| @@ -1,9 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | namespace Elementor; |
| 3 | 3 | |
| 4 | 4 | use Elementor\Core\Breakpoints\Manager as Breakpoints_Manager; |
| 5 | -use Elementor\Plugin; | |
| 6 | 5 | |
| 7 | 6 | if ( ! defined( 'ABSPATH' ) ) { |
| 8 | 7 | exit; // Exit if accessed directly. |
| 9 | 8 | } |
| @@ -74,12 +73,8 @@ | ||
| 74 | 73 | public function get_icon() { |
| 75 | 74 | return 'eicon-column'; |
| 76 | 75 | } |
| 77 | 76 | |
| 78 | - protected function is_dynamic_content(): bool { | |
| 79 | - return false; | |
| 80 | - } | |
| 81 | - | |
| 82 | 77 | /** |
| 83 | 78 | * Get initial config. |
| 84 | 79 | * |
| 85 | 80 | * Retrieve the current section initial configuration. |
| @@ -119,9 +114,9 @@ | ||
| 119 | 114 | 'tab' => Controls_Manager::TAB_LAYOUT, |
| 120 | 115 | ] |
| 121 | 116 | ); |
| 122 | 117 | |
| 123 | - // Element Name for the Navigator. | |
| 118 | + // Element Name for the Navigator | |
| 124 | 119 | $this->add_control( |
| 125 | 120 | '_title', |
| 126 | 121 | [ |
| 127 | 122 | 'label' => esc_html__( 'Title', 'elementor' ), |
| @@ -176,12 +171,17 @@ | ||
| 176 | 171 | ], |
| 177 | 172 | ] |
| 178 | 173 | ); |
| 179 | 174 | |
| 175 | + $is_dome_optimization_active = Plugin::$instance->experiments->is_feature_active( 'e_dom_optimization' ); | |
| 176 | + $main_selector_element = $is_dome_optimization_active ? 'widget' : 'column'; | |
| 177 | + $widget_wrap_child = $is_dome_optimization_active ? '' : ' > .elementor-widget-wrap'; | |
| 178 | + $column_wrap_child = $is_dome_optimization_active ? '' : ' > .elementor-column-wrap'; | |
| 179 | + | |
| 180 | 180 | $this->add_responsive_control( |
| 181 | 181 | 'content_position', |
| 182 | 182 | [ |
| 183 | - 'label' => esc_html__( 'Vertical Alignment', 'elementor' ), | |
| 183 | + 'label' => esc_html__( 'Vertical Align', 'elementor' ), | |
| 184 | 184 | 'type' => Controls_Manager::SELECT, |
| 185 | 185 | 'default' => '', |
| 186 | 186 | 'options' => [ |
| 187 | 187 | '' => esc_html__( 'Default', 'elementor' ), |
| @@ -196,12 +196,12 @@ | ||
| 196 | 196 | 'top' => 'flex-start', |
| 197 | 197 | 'bottom' => 'flex-end', |
| 198 | 198 | ], |
| 199 | 199 | 'selectors' => [ |
| 200 | - // TODO: The following line is for BC since 2.7.0. | |
| 201 | - '.elementor-bc-flex-widget {{WRAPPER}}.elementor-column .elementor-widget-wrap' => 'align-items: {{VALUE}}', | |
| 202 | - // This specificity is intended to make sure column css overwrites section css on vertical alignment (content_position). | |
| 203 | - '{{WRAPPER}}.elementor-column.elementor-element[data-element_type="column"] > .elementor-widget-wrap.elementor-element-populated' => 'align-content: {{VALUE}}; align-items: {{VALUE}};', | |
| 200 | + // TODO: The following line is for BC since 2.7.0 | |
| 201 | + '.elementor-bc-flex-widget {{WRAPPER}}.elementor-column .elementor-' . $main_selector_element . '-wrap' => 'align-items: {{VALUE}}', | |
| 202 | + // This specificity is intended to make sure column css overwrites section css on vertical alignment (content_position) | |
| 203 | + '{{WRAPPER}}.elementor-column.elementor-element[data-element_type="column"] > .elementor-' . $main_selector_element . '-wrap.elementor-element-populated' . $widget_wrap_child => 'align-content: {{VALUE}}; align-items: {{VALUE}};', | |
| 204 | 204 | ], |
| 205 | 205 | ] |
| 206 | 206 | ); |
| 207 | 207 | |
| @@ -207,9 +207,9 @@ | ||
| 207 | 207 | |
| 208 | 208 | $this->add_responsive_control( |
| 209 | 209 | 'align', |
| 210 | 210 | [ |
| 211 | - 'label' => esc_html__( 'Horizontal Alignment', 'elementor' ), | |
| 211 | + 'label' => esc_html__( 'Horizontal Align', 'elementor' ), | |
| 212 | 212 | 'type' => Controls_Manager::SELECT, |
| 213 | 213 | 'default' => '', |
| 214 | 214 | 'options' => [ |
| 215 | 215 | '' => esc_html__( 'Default', 'elementor' ), |
| @@ -220,17 +220,14 @@ | ||
| 220 | 220 | 'space-around' => esc_html__( 'Space Around', 'elementor' ), |
| 221 | 221 | 'space-evenly' => esc_html__( 'Space Evenly', 'elementor' ), |
| 222 | 222 | ], |
| 223 | 223 | 'selectors' => [ |
| 224 | - '{{WRAPPER}}.elementor-column > .elementor-widget-wrap' => 'justify-content: {{VALUE}}', | |
| 224 | + '{{WRAPPER}}.elementor-column' . $column_wrap_child . ' > .elementor-widget-wrap' => 'justify-content: {{VALUE}}', | |
| 225 | 225 | ], |
| 226 | 226 | ] |
| 227 | 227 | ); |
| 228 | 228 | |
| 229 | - $optimized_markup = Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); | |
| 230 | - $space_between_widgets = $optimized_markup | |
| 231 | - ? '--kit-widget-spacing: {{VALUE}}px' | |
| 232 | - : 'margin-block-end: {{VALUE}}px'; | |
| 229 | + $space_between_widgets_selector = $is_dome_optimization_active ? '' : '> .elementor-column-wrap '; | |
| 233 | 230 | |
| 234 | 231 | $this->add_responsive_control( |
| 235 | 232 | 'space_between_widgets', |
| 236 | 233 | [ |
| @@ -237,9 +234,9 @@ | ||
| 237 | 234 | 'label' => esc_html__( 'Widgets Space', 'elementor' ) . ' (px)', |
| 238 | 235 | 'type' => Controls_Manager::NUMBER, |
| 239 | 236 | 'placeholder' => 20, |
| 240 | 237 | 'selectors' => [ |
| 241 | - '{{WRAPPER}} > .elementor-widget-wrap > .elementor-widget:not(.elementor-widget__width-auto):not(.elementor-widget__width-initial):not(:last-child):not(.elementor-absolute)' => $space_between_widgets, // Need the full path for exclude the inner section. | |
| 238 | + '{{WRAPPER}} ' . $space_between_widgets_selector . '> .elementor-widget-wrap > .elementor-widget:not(.elementor-widget__width-auto):not(.elementor-widget__width-initial):not(:last-child):not(.elementor-absolute)' => 'margin-bottom: {{VALUE}}px', //Need the full path for exclude the inner section | |
| 242 | 239 | ], |
| 243 | 240 | ] |
| 244 | 241 | ); |
| 245 | 242 | |
| @@ -291,9 +288,9 @@ | ||
| 291 | 288 | Group_Control_Background::get_type(), |
| 292 | 289 | [ |
| 293 | 290 | 'name' => 'background', |
| 294 | 291 | 'types' => [ 'classic', 'gradient', 'slideshow' ], |
| 295 | - 'selector' => '{{WRAPPER}}:not(.elementor-motion-effects-element-type-background) > .elementor-widget-wrap, {{WRAPPER}} > .elementor-widget-wrap > .elementor-motion-effects-container > .elementor-motion-effects-layer', | |
| 292 | + 'selector' => '{{WRAPPER}}:not(.elementor-motion-effects-element-type-background) > .elementor-' . $main_selector_element . '-wrap, {{WRAPPER}} > .elementor-' . $main_selector_element . '-wrap > .elementor-motion-effects-container > .elementor-motion-effects-layer', | |
| 296 | 293 | 'fields_options' => [ |
| 297 | 294 | 'background' => [ |
| 298 | 295 | 'frontend_available' => true, |
| 299 | 296 | ], |
| @@ -300,45 +297,8 @@ | ||
| 300 | 297 | ], |
| 301 | 298 | ] |
| 302 | 299 | ); |
| 303 | 300 | |
| 304 | - $this->add_control( | |
| 305 | - 'handle_slideshow_asset_loading', | |
| 306 | - [ | |
| 307 | - 'type' => Controls_Manager::HIDDEN, | |
| 308 | - 'assets' => [ | |
| 309 | - 'styles' => [ | |
| 310 | - [ | |
| 311 | - 'name' => 'e-swiper', | |
| 312 | - 'conditions' => [ | |
| 313 | - 'terms' => [ | |
| 314 | - [ | |
| 315 | - 'name' => 'background_background', | |
| 316 | - 'operator' => '===', | |
| 317 | - 'value' => 'slideshow', | |
| 318 | - ], | |
| 319 | - ], | |
| 320 | - ], | |
| 321 | - ], | |
| 322 | - ], | |
| 323 | - 'scripts' => [ | |
| 324 | - [ | |
| 325 | - 'name' => 'swiper', | |
| 326 | - 'conditions' => [ | |
| 327 | - 'terms' => [ | |
| 328 | - [ | |
| 329 | - 'name' => 'background_background', | |
| 330 | - 'operator' => '===', | |
| 331 | - 'value' => 'slideshow', | |
| 332 | - ], | |
| 333 | - ], | |
| 334 | - ], | |
| 335 | - ], | |
| 336 | - ], | |
| 337 | - ], | |
| 338 | - ] | |
| 339 | - ); | |
| 340 | - | |
| 341 | 301 | $this->end_controls_tab(); |
| 342 | 302 | |
| 343 | 303 | $this->start_controls_tab( |
| 344 | 304 | 'tab_background_hover', |
| @@ -357,9 +317,9 @@ | ||
| 357 | 317 | |
| 358 | 318 | $this->add_control( |
| 359 | 319 | 'background_hover_transition', |
| 360 | 320 | [ |
| 361 | - 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)', | |
| 321 | + 'label' => esc_html__( 'Transition Duration', 'elementor' ), | |
| 362 | 322 | 'type' => Controls_Manager::SLIDER, |
| 363 | 323 | 'default' => [ |
| 364 | 324 | 'size' => 0.3, |
| 365 | 325 | ], |
| @@ -364,9 +324,8 @@ | ||
| 364 | 324 | 'size' => 0.3, |
| 365 | 325 | ], |
| 366 | 326 | 'range' => [ |
| 367 | 327 | 'px' => [ |
| 368 | - 'min' => 0, | |
| 369 | 328 | 'max' => 3, |
| 370 | 329 | 'step' => 0.1, |
| 371 | 330 | ], |
| 372 | 331 | ], |
| @@ -409,9 +368,9 @@ | ||
| 409 | 368 | 'selector' => '{{WRAPPER}} > .elementor-element-populated > .elementor-background-overlay', |
| 410 | 369 | ] |
| 411 | 370 | ); |
| 412 | 371 | |
| 413 | - $this->add_responsive_control( | |
| 372 | + $this->add_control( | |
| 414 | 373 | 'background_overlay_opacity', |
| 415 | 374 | [ |
| 416 | 375 | 'label' => esc_html__( 'Opacity', 'elementor' ), |
| 417 | 376 | 'type' => Controls_Manager::SLIDER, |
| @@ -455,11 +414,8 @@ | ||
| 455 | 414 | 'lighten' => esc_html__( 'Lighten', 'elementor' ), |
| 456 | 415 | 'color-dodge' => esc_html__( 'Color Dodge', 'elementor' ), |
| 457 | 416 | 'saturation' => esc_html__( 'Saturation', 'elementor' ), |
| 458 | 417 | 'color' => esc_html__( 'Color', 'elementor' ), |
| 459 | - 'difference' => esc_html__( 'Difference', 'elementor' ), | |
| 460 | - 'exclusion' => esc_html__( 'Exclusion', 'elementor' ), | |
| 461 | - 'hue' => esc_html__( 'Hue', 'elementor' ), | |
| 462 | 418 | 'luminosity' => esc_html__( 'Luminosity', 'elementor' ), |
| 463 | 419 | ], |
| 464 | 420 | 'selectors' => [ |
| 465 | 421 | '{{WRAPPER}} > .elementor-element-populated > .elementor-background-overlay' => 'mix-blend-mode: {{VALUE}}', |
| @@ -483,9 +439,9 @@ | ||
| 483 | 439 | 'selector' => '{{WRAPPER}}:hover > .elementor-element-populated > .elementor-background-overlay', |
| 484 | 440 | ] |
| 485 | 441 | ); |
| 486 | 442 | |
| 487 | - $this->add_responsive_control( | |
| 443 | + $this->add_control( | |
| 488 | 444 | 'background_overlay_hover_opacity', |
| 489 | 445 | [ |
| 490 | 446 | 'label' => esc_html__( 'Opacity', 'elementor' ), |
| 491 | 447 | 'type' => Controls_Manager::SLIDER, |
| @@ -517,9 +473,9 @@ | ||
| 517 | 473 | |
| 518 | 474 | $this->add_control( |
| 519 | 475 | 'background_overlay_hover_transition', |
| 520 | 476 | [ |
| 521 | - 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)', | |
| 477 | + 'label' => esc_html__( 'Transition Duration', 'elementor' ), | |
| 522 | 478 | 'type' => Controls_Manager::SLIDER, |
| 523 | 479 | 'default' => [ |
| 524 | 480 | 'size' => 0.3, |
| 525 | 481 | ], |
| @@ -524,9 +480,8 @@ | ||
| 524 | 480 | 'size' => 0.3, |
| 525 | 481 | ], |
| 526 | 482 | 'range' => [ |
| 527 | 483 | 'px' => [ |
| 528 | - 'min' => 0, | |
| 529 | 484 | 'max' => 3, |
| 530 | 485 | 'step' => 0.1, |
| 531 | 486 | ], |
| 532 | 487 | ], |
| @@ -570,9 +525,9 @@ | ||
| 570 | 525 | 'border_radius', |
| 571 | 526 | [ |
| 572 | 527 | 'label' => esc_html__( 'Border Radius', 'elementor' ), |
| 573 | 528 | 'type' => Controls_Manager::DIMENSIONS, |
| 574 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], | |
| 529 | + 'size_units' => [ 'px', '%' ], | |
| 575 | 530 | 'selectors' => [ |
| 576 | 531 | '{{WRAPPER}} > .elementor-element-populated, {{WRAPPER}} > .elementor-element-populated > .elementor-background-overlay, {{WRAPPER}} > .elementor-background-slideshow' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 577 | 532 | ], |
| 578 | 533 | ] |
| @@ -607,9 +562,9 @@ | ||
| 607 | 562 | 'border_radius_hover', |
| 608 | 563 | [ |
| 609 | 564 | 'label' => esc_html__( 'Border Radius', 'elementor' ), |
| 610 | 565 | 'type' => Controls_Manager::DIMENSIONS, |
| 611 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], | |
| 566 | + 'size_units' => [ 'px', '%' ], | |
| 612 | 567 | 'selectors' => [ |
| 613 | 568 | '{{WRAPPER}}:hover > .elementor-element-populated, {{WRAPPER}}:hover > .elementor-element-populated > .elementor-background-overlay' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 614 | 569 | ], |
| 615 | 570 | ] |
| @@ -625,9 +580,9 @@ | ||
| 625 | 580 | |
| 626 | 581 | $this->add_control( |
| 627 | 582 | 'border_hover_transition', |
| 628 | 583 | [ |
| 629 | - 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)', | |
| 584 | + 'label' => esc_html__( 'Transition Duration', 'elementor' ), | |
| 630 | 585 | 'type' => Controls_Manager::SLIDER, |
| 631 | 586 | 'separator' => 'before', |
| 632 | 587 | 'default' => [ |
| 633 | 588 | 'size' => 0.3, |
| @@ -633,9 +588,8 @@ | ||
| 633 | 588 | 'size' => 0.3, |
| 634 | 589 | ], |
| 635 | 590 | 'range' => [ |
| 636 | 591 | 'px' => [ |
| 637 | - 'min' => 0, | |
| 638 | 592 | 'max' => 3, |
| 639 | 593 | 'step' => 0.1, |
| 640 | 594 | ], |
| 641 | 595 | ], |
| @@ -647,9 +601,9 @@ | ||
| 647 | 601 | 'operator' => '!==', |
| 648 | 602 | 'value' => '', |
| 649 | 603 | ], |
| 650 | 604 | [ |
| 651 | - 'name' => 'border_hover_border', | |
| 605 | + 'name' => 'border_border', | |
| 652 | 606 | 'operator' => '!==', |
| 653 | 607 | 'value' => '', |
| 654 | 608 | ], |
| 655 | 609 | ], |
| @@ -685,8 +639,9 @@ | ||
| 685 | 639 | 'default' => '', |
| 686 | 640 | 'selectors' => [ |
| 687 | 641 | '{{WRAPPER}} .elementor-element-populated .elementor-heading-title' => 'color: {{VALUE}};', |
| 688 | 642 | ], |
| 643 | + 'separator' => 'none', | |
| 689 | 644 | ] |
| 690 | 645 | ); |
| 691 | 646 | |
| 692 | 647 | $this->add_control( |
| @@ -724,16 +679,16 @@ | ||
| 724 | 679 | ], |
| 725 | 680 | ] |
| 726 | 681 | ); |
| 727 | 682 | |
| 728 | - $this->add_responsive_control( | |
| 683 | + $this->add_control( | |
| 729 | 684 | 'text_align', |
| 730 | 685 | [ |
| 731 | 686 | 'label' => esc_html__( 'Text Align', 'elementor' ), |
| 732 | 687 | 'type' => Controls_Manager::CHOOSE, |
| 733 | 688 | 'options' => [ |
| 734 | - 'start' => [ | |
| 735 | - 'title' => esc_html__( 'Start', 'elementor' ), | |
| 689 | + 'left' => [ | |
| 690 | + 'title' => esc_html__( 'Left', 'elementor' ), | |
| 736 | 691 | 'icon' => 'eicon-text-align-left', |
| 737 | 692 | ], |
| 738 | 693 | 'center' => [ |
| 739 | 694 | 'title' => esc_html__( 'Center', 'elementor' ), |
| @@ -738,22 +693,17 @@ | ||
| 738 | 693 | 'center' => [ |
| 739 | 694 | 'title' => esc_html__( 'Center', 'elementor' ), |
| 740 | 695 | 'icon' => 'eicon-text-align-center', |
| 741 | 696 | ], |
| 742 | - 'end' => [ | |
| 743 | - 'title' => esc_html__( 'End', 'elementor' ), | |
| 697 | + 'right' => [ | |
| 698 | + 'title' => esc_html__( 'Right', 'elementor' ), | |
| 744 | 699 | 'icon' => 'eicon-text-align-right', |
| 745 | 700 | ], |
| 746 | 701 | 'justify' => [ |
| 747 | - 'title' => esc_html__( 'Justified', 'elementor' ), | |
| 702 | + 'title' => __( 'Justified', 'elementor' ), | |
| 748 | 703 | 'icon' => 'eicon-text-align-justify', |
| 749 | 704 | ], |
| 750 | 705 | ], |
| 751 | - 'classes' => 'elementor-control-start-end', | |
| 752 | - 'selectors_dictionary' => [ | |
| 753 | - 'left' => is_rtl() ? 'end' : 'start', | |
| 754 | - 'right' => is_rtl() ? 'start' : 'end', | |
| 755 | - ], | |
| 756 | 706 | 'selectors' => [ |
| 757 | 707 | '{{WRAPPER}} > .elementor-element-populated' => 'text-align: {{VALUE}};', |
| 758 | 708 | ], |
| 759 | 709 | ] |
| @@ -775,9 +725,9 @@ | ||
| 775 | 725 | 'margin', |
| 776 | 726 | [ |
| 777 | 727 | 'label' => esc_html__( 'Margin', 'elementor' ), |
| 778 | 728 | 'type' => Controls_Manager::DIMENSIONS, |
| 779 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], | |
| 729 | + 'size_units' => [ 'px', 'em', '%', 'rem' ], | |
| 780 | 730 | 'selectors' => [ |
| 781 | 731 | '{{WRAPPER}} > .elementor-element-populated' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; |
| 782 | 732 | --e-column-margin-right: {{RIGHT}}{{UNIT}}; --e-column-margin-left: {{LEFT}}{{UNIT}};', |
| 783 | 733 | ], |
| @@ -783,16 +733,22 @@ | ||
| 783 | 733 | ], |
| 784 | 734 | ] |
| 785 | 735 | ); |
| 786 | 736 | |
| 737 | + $padding_selector = '{{WRAPPER}} > .elementor-element-populated'; | |
| 738 | + | |
| 739 | + if ( ! $is_dome_optimization_active ) { | |
| 740 | + $padding_selector .= ' > .elementor-widget-wrap'; | |
| 741 | + } | |
| 742 | + | |
| 787 | 743 | $this->add_responsive_control( |
| 788 | 744 | 'padding', |
| 789 | 745 | [ |
| 790 | 746 | 'label' => esc_html__( 'Padding', 'elementor' ), |
| 791 | 747 | 'type' => Controls_Manager::DIMENSIONS, |
| 792 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], | |
| 748 | + 'size_units' => [ 'px', 'em', '%', 'rem' ], | |
| 793 | 749 | 'selectors' => [ |
| 794 | - '{{WRAPPER}} > .elementor-element-populated' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 750 | + $padding_selector => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 795 | 751 | ], |
| 796 | 752 | ] |
| 797 | 753 | ); |
| 798 | 754 | |
| @@ -813,11 +769,8 @@ | ||
| 813 | 769 | [ |
| 814 | 770 | 'label' => esc_html__( 'CSS ID', 'elementor' ), |
| 815 | 771 | 'type' => Controls_Manager::TEXT, |
| 816 | 772 | 'default' => '', |
| 817 | - 'ai' => [ | |
| 818 | - 'active' => false, | |
| 819 | - ], | |
| 820 | 773 | 'dynamic' => [ |
| 821 | 774 | 'active' => true, |
| 822 | 775 | ], |
| 823 | 776 | 'title' => esc_html__( 'Add your custom id WITHOUT the Pound key. e.g: my-id', 'elementor' ), |
| @@ -831,11 +784,8 @@ | ||
| 831 | 784 | [ |
| 832 | 785 | 'label' => esc_html__( 'CSS Classes', 'elementor' ), |
| 833 | 786 | 'type' => Controls_Manager::TEXT, |
| 834 | 787 | 'default' => '', |
| 835 | - 'ai' => [ | |
| 836 | - 'active' => false, | |
| 837 | - ], | |
| 838 | 788 | 'dynamic' => [ |
| 839 | 789 | 'active' => true, |
| 840 | 790 | ], |
| 841 | 791 | 'prefix_class' => '', |
| @@ -843,11 +793,9 @@ | ||
| 843 | 793 | 'classes' => 'elementor-control-direction-ltr', |
| 844 | 794 | ] |
| 845 | 795 | ); |
| 846 | 796 | |
| 847 | - Plugin::$instance->controls_manager->add_display_conditions_controls( $this ); | |
| 848 | - | |
| 849 | - // TODO: Backward comparability for deprecated controls. | |
| 797 | + // TODO: Backward comparability for deprecated controls | |
| 850 | 798 | $this->add_control( |
| 851 | 799 | 'screen_sm', |
| 852 | 800 | [ |
| 853 | 801 | 'type' => Controls_Manager::HIDDEN, |
| @@ -863,9 +811,9 @@ | ||
| 863 | 811 | ], |
| 864 | 812 | 'prefix_class' => 'elementor-sm-', |
| 865 | 813 | ] |
| 866 | 814 | ); |
| 867 | - // END Backward comparability. | |
| 815 | + // END Backward comparability | |
| 868 | 816 | |
| 869 | 817 | $this->end_controls_section(); |
| 870 | 818 | |
| 871 | 819 | $this->start_controls_section( |
| @@ -875,10 +823,8 @@ | ||
| 875 | 823 | 'tab' => Controls_Manager::TAB_ADVANCED, |
| 876 | 824 | ] |
| 877 | 825 | ); |
| 878 | 826 | |
| 879 | - Plugin::$instance->controls_manager->add_motion_effects_promotion_control( $this ); | |
| 880 | - | |
| 881 | 827 | $this->add_responsive_control( |
| 882 | 828 | 'animation', |
| 883 | 829 | [ |
| 884 | 830 | 'label' => esc_html__( 'Entrance Animation', 'elementor' ), |
| @@ -933,14 +879,9 @@ | ||
| 933 | 879 | |
| 934 | 880 | $this->add_control( |
| 935 | 881 | 'responsive_description', |
| 936 | 882 | [ |
| 937 | - 'raw' => sprintf( | |
| 938 | - /* translators: 1: Link open tag, 2: Link close tag. */ | |
| 939 | - esc_html__( 'Responsive visibility will take effect only on %1$s preview mode %2$s or live page, and not while editing in Elementor.', 'elementor' ), | |
| 940 | - '<a href="javascript: $e.run( \'panel/close\' )">', | |
| 941 | - '</a>' | |
| 942 | - ), | |
| 883 | + 'raw' => esc_html__( 'Responsive visibility will take effect only on preview or live page, and not while editing in Elementor.', 'elementor' ), | |
| 943 | 884 | 'type' => Controls_Manager::RAW_HTML, |
| 944 | 885 | 'content_classes' => 'elementor-descriptor', |
| 945 | 886 | ] |
| 946 | 887 | ); |
| @@ -962,11 +903,17 @@ | ||
| 962 | 903 | * @since 2.9.0 |
| 963 | 904 | * @access protected |
| 964 | 905 | */ |
| 965 | 906 | protected function content_template() { |
| 907 | + $is_dom_optimization_active = Plugin::$instance->experiments->is_feature_active( 'e_dom_optimization' ); | |
| 908 | + $wrapper_element = $is_dom_optimization_active ? 'widget' : 'column'; | |
| 909 | + | |
| 966 | 910 | ?> |
| 967 | - <div class="elementor-widget-wrap"> | |
| 911 | + <div class="elementor-<?php echo esc_attr( $wrapper_element ); ?>-wrap"> | |
| 968 | 912 | <div class="elementor-background-overlay"></div> |
| 913 | + <?php if ( ! $is_dom_optimization_active ) { ?> | |
| 914 | + <div class="elementor-widget-wrap"></div> | |
| 915 | + <?php } ?> | |
| 969 | 916 | </div> |
| 970 | 917 | <?php |
| 971 | 918 | } |
| 972 | 919 | |
| @@ -980,15 +927,15 @@ | ||
| 980 | 927 | */ |
| 981 | 928 | public function before_render() { |
| 982 | 929 | $settings = $this->get_settings_for_display(); |
| 983 | 930 | |
| 984 | - $overlay_background = $settings['background_overlay_background'] ?? ''; | |
| 985 | - $overlay_hover_background = $settings['background_overlay_hover_background'] ?? ''; | |
| 931 | + $has_background_overlay = in_array( $settings['background_overlay_background'], [ 'classic', 'gradient' ], true ) || | |
| 932 | + in_array( $settings['background_overlay_hover_background'], [ 'classic', 'gradient' ], true ); | |
| 986 | 933 | |
| 987 | - $has_background_overlay = in_array( $overlay_background, [ 'classic', 'gradient' ], true ) || | |
| 988 | - in_array( $overlay_hover_background, [ 'classic', 'gradient' ], true ); | |
| 934 | + $is_dom_optimization_active = Plugin::$instance->experiments->is_feature_active( 'e_dom_optimization' ); | |
| 935 | + $wrapper_attribute_string = $is_dom_optimization_active ? '_widget_wrapper' : '_inner_wrapper'; | |
| 989 | 936 | |
| 990 | - $column_wrap_classes = [ 'elementor-widget-wrap' ]; | |
| 937 | + $column_wrap_classes = $is_dom_optimization_active ? [ 'elementor-widget-wrap' ] : [ 'elementor-column-wrap' ]; | |
| 991 | 938 | |
| 992 | 939 | if ( $this->get_children() ) { |
| 993 | 940 | $column_wrap_classes[] = 'elementor-element-populated'; |
| 994 | 941 | } |
| @@ -993,10 +940,13 @@ | ||
| 993 | 940 | $column_wrap_classes[] = 'elementor-element-populated'; |
| 994 | 941 | } |
| 995 | 942 | |
| 996 | 943 | $this->add_render_attribute( [ |
| 944 | + '_inner_wrapper' => [ | |
| 945 | + 'class' => $column_wrap_classes, | |
| 946 | + ], | |
| 997 | 947 | '_widget_wrapper' => [ |
| 998 | - 'class' => $column_wrap_classes, | |
| 948 | + 'class' => $is_dom_optimization_active ? $column_wrap_classes : 'elementor-widget-wrap', | |
| 999 | 949 | ], |
| 1000 | 950 | '_background_overlay' => [ |
| 1001 | 951 | 'class' => [ 'elementor-background-overlay' ], |
| 1002 | 952 | ], |
| @@ -1005,12 +955,15 @@ | ||
| 1005 | 955 | <<?php |
| 1006 | 956 | // PHPCS - the method get_html_tag is safe. |
| 1007 | 957 | echo $this->get_html_tag(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 1008 | 958 | ?> <?php $this->print_render_attribute_string( '_wrapper' ); ?>> |
| 1009 | - <div <?php $this->print_render_attribute_string( '_widget_wrapper' ); ?>> | |
| 959 | + <div <?php $this->print_render_attribute_string( $wrapper_attribute_string ); ?>> | |
| 1010 | 960 | <?php if ( $has_background_overlay ) : ?> |
| 1011 | 961 | <div <?php $this->print_render_attribute_string( '_background_overlay' ); ?>></div> |
| 1012 | 962 | <?php endif; ?> |
| 963 | + <?php if ( ! $is_dom_optimization_active ) : ?> | |
| 964 | + <div <?php $this->print_render_attribute_string( '_widget_wrapper' ); ?>> | |
| 965 | + <?php endif; ?> | |
| 1013 | 966 | <?php |
| 1014 | 967 | } |
| 1015 | 968 | |
| 1016 | 969 | /** |
| @@ -1021,9 +974,11 @@ | ||
| 1021 | 974 | * @since 1.0.0 |
| 1022 | 975 | * @access public |
| 1023 | 976 | */ |
| 1024 | 977 | public function after_render() { |
| 1025 | - ?> | |
| 978 | + if ( ! Plugin::$instance->experiments->is_feature_active( 'e_dom_optimization' ) ) { ?> | |
| 979 | + </div> | |
| 980 | + <?php } ?> | |
| 1026 | 981 | </div> |
| 1027 | 982 | </<?php |
| 1028 | 983 | // PHPCS - the method get_html_tag is safe. |
| 1029 | 984 | echo $this->get_html_tag(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> |
| @@ -1071,12 +1026,8 @@ | ||
| 1071 | 1026 | */ |
| 1072 | 1027 | protected function _get_default_child_type( array $element_data ) { |
| 1073 | 1028 | if ( 'section' === $element_data['elType'] ) { |
| 1074 | 1029 | return Plugin::$instance->elements_manager->get_element_types( 'section' ); |
| 1075 | - } | |
| 1076 | - | |
| 1077 | - if ( 'container' === $element_data['elType'] ) { | |
| 1078 | - return Plugin::$instance->elements_manager->get_element_types( 'container' ); | |
| 1079 | 1030 | } |
| 1080 | 1031 | |
| 1081 | 1032 | // If the element doesn't exists (disabled element, experiment, etc.), return false to prevent errors. |
| 1082 | 1033 | if ( empty( $element_data['widgetType'] ) ) { |