| @@ -297,8 +297,18 @@ | ||
| 297 | 297 | if ( is_singular() && $document && $document->is_built_with_elementor() ) { |
| 298 | 298 | $classes[] = 'elementor-page elementor-page-' . $id; |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | + if ( Plugin::$instance->preview->is_preview_mode() ) { | |
| 302 | + $editor_preferences = SettingsManager::get_settings_managers( 'editorPreferences' ); | |
| 303 | + | |
| 304 | + $show_hidden_elements = $editor_preferences->get_model()->get_settings( 'show_hidden_elements' ); | |
| 305 | + | |
| 306 | + if ( 'yes' === $show_hidden_elements ) { | |
| 307 | + $classes[] = 'e-preview--show-hidden-elements'; | |
| 308 | + } | |
| 309 | + } | |
| 310 | + | |
| 301 | 311 | return $classes; |
| 302 | 312 | } |
| 303 | 313 | |
| 304 | 314 | /** |
| @@ -500,15 +510,8 @@ | ||
| 500 | 510 | '5.11.0' |
| 501 | 511 | ); |
| 502 | 512 | |
| 503 | 513 | wp_register_style( |
| 504 | - 'elementor-animations', | |
| 505 | - $this->get_css_assets_url( 'animations', 'assets/lib/animations/', true ), | |
| 506 | - [], | |
| 507 | - ELEMENTOR_VERSION | |
| 508 | - ); | |
| 509 | - | |
| 510 | - wp_register_style( | |
| 511 | 514 | 'flatpickr', |
| 512 | 515 | $this->get_css_assets_url( 'flatpickr', 'assets/lib/flatpickr/' ), |
| 513 | 516 | [], |
| 514 | 517 | '4.1.4' |
| @@ -524,10 +527,12 @@ | ||
| 524 | 527 | $min_suffix = Utils::is_script_debug() ? '' : '.min'; |
| 525 | 528 | |
| 526 | 529 | $direction_suffix = is_rtl() ? '-rtl' : ''; |
| 527 | 530 | |
| 528 | - $frontend_file_name = 'frontend' . $direction_suffix . $min_suffix . '.css'; | |
| 531 | + $frontend_base_file_name = $this->is_optimized_css_mode() ? 'frontend-lite' : 'frontend'; | |
| 529 | 532 | |
| 533 | + $frontend_file_name = $frontend_base_file_name . $direction_suffix . $min_suffix . '.css'; | |
| 534 | + | |
| 530 | 535 | $has_custom_file = Plugin::$instance->breakpoints->has_custom_breakpoints(); |
| 531 | 536 | |
| 532 | 537 | if ( $has_custom_file ) { |
| 533 | 538 | $frontend_file = new FrontendFile( 'custom-' . $frontend_file_name, Breakpoints_Manager::get_stylesheet_templates_path() . $frontend_file_name ); |
| @@ -607,8 +612,10 @@ | ||
| 607 | 612 | } |
| 608 | 613 | |
| 609 | 614 | $this->print_config(); |
| 610 | 615 | |
| 616 | + $this->enqueue_conditional_assets(); | |
| 617 | + | |
| 611 | 618 | /** |
| 612 | 619 | * After frontend enqueue scripts. |
| 613 | 620 | * |
| 614 | 621 | * Fires after Elementor frontend scripts are enqueued. |
| @@ -648,9 +655,9 @@ | ||
| 648 | 655 | // The e-icons are needed in preview mode for the editor icons (plus-icon for new section, folder-icon for the templates library etc.). |
| 649 | 656 | if ( ! $this->is_improved_assets_loading() || Plugin::$instance->preview->is_preview_mode() ) { |
| 650 | 657 | wp_enqueue_style( 'elementor-icons' ); |
| 651 | 658 | } |
| 652 | - wp_enqueue_style( 'elementor-animations' ); | |
| 659 | + | |
| 653 | 660 | wp_enqueue_style( 'elementor-frontend' ); |
| 654 | 661 | |
| 655 | 662 | /** |
| 656 | 663 | * After frontend styles enqueued. |
| @@ -674,8 +681,20 @@ | ||
| 674 | 681 | } |
| 675 | 682 | } |
| 676 | 683 | |
| 677 | 684 | /** |
| 685 | + * Enqueue assets conditionally. | |
| 686 | + * | |
| 687 | + * Enqueue all assets that were pre-enabled. | |
| 688 | + * | |
| 689 | + * @since 3.3.0 | |
| 690 | + * @access private | |
| 691 | + */ | |
| 692 | + private function enqueue_conditional_assets() { | |
| 693 | + Plugin::$instance->assets_loader->enqueue_assets(); | |
| 694 | + } | |
| 695 | + | |
| 696 | + /** | |
| 678 | 697 | * Elementor footer scripts and styles. |
| 679 | 698 | * |
| 680 | 699 | * Handle styles and scripts that are not printed in the header. |
| 681 | 700 | * |
| @@ -1294,8 +1313,9 @@ | ||
| 1294 | 1313 | 'label' => $breakpoint->get_label(), |
| 1295 | 1314 | 'value' => $breakpoint->get_value(), |
| 1296 | 1315 | 'direction' => $breakpoint->get_direction(), |
| 1297 | 1316 | 'is_enabled' => $breakpoint->is_enabled(), |
| 1317 | + 'default_value' => $breakpoint->get_default_value(), | |
| 1298 | 1318 | ]; |
| 1299 | 1319 | } |
| 1300 | 1320 | |
| 1301 | 1321 | return $config; |
| @@ -1306,11 +1326,11 @@ | ||
| 1306 | 1326 | * |
| 1307 | 1327 | * Restore removed WordPress filters that conflicted with Elementor. |
| 1308 | 1328 | * |
| 1309 | 1329 | * @since 1.5.0 |
| 1310 | - * @access private | |
| 1330 | + * @access public | |
| 1311 | 1331 | */ |
| 1312 | - private function restore_content_filters() { | |
| 1332 | + public function restore_content_filters() { | |
| 1313 | 1333 | foreach ( $this->content_removed_filters as $filter ) { |
| 1314 | 1334 | add_filter( 'the_content', $filter ); |
| 1315 | 1335 | } |
| 1316 | 1336 | |
| @@ -1387,8 +1407,14 @@ | ||
| 1387 | 1407 | $dependencies[] = 'elementor-dialog'; |
| 1388 | 1408 | } |
| 1389 | 1409 | |
| 1390 | 1410 | return $dependencies; |
| 1411 | + } | |
| 1412 | + | |
| 1413 | + private function is_optimized_css_mode() { | |
| 1414 | + $is_optimized_css_loading = Plugin::$instance->experiments->is_feature_active( 'e_optimized_css_loading' ); | |
| 1415 | + | |
| 1416 | + return ! Utils::is_script_debug() && $is_optimized_css_loading && ! Plugin::$instance->preview->is_preview_mode(); | |
| 1391 | 1417 | } |
| 1392 | 1418 | |
| 1393 | 1419 | private function add_elementor_icons_inline_css() { |
| 1394 | 1420 | $elementor_icons_library_version = '5.10.0'; |