PluginProbe
Elementor Website Builder – more than just a page builder / 3.16.2
Elementor Website Builder – more than just a page builder v3.16.2
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | includes/elements/container.php +183 -323 4.0.83.16.2 View file →
@@ -26,12 +26,8 @@
26 26 * @var \Elementor\Core\Kits\Documents\Kit
27 27 */
28 28 private $active_kit;
29 29
30 - protected function is_dynamic_content(): bool {
31 - return false;
32 - }
33 -
34 30 /**
35 31 * Container constructor.
36 32 *
37 33 * @param array $data
@@ -38,12 +34,14 @@
38 34 * @param array|null $args
39 35 *
40 36 * @return void
41 37 */
42 - public function __construct( array $data = [], ?array $args = null ) {
38 + public function __construct( array $data = [], array $args = null ) {
43 39 parent::__construct( $data, $args );
44 40
45 41 $this->active_kit = Plugin::$instance->kits_manager->get_active_kit();
42 + $this->logical_dimensions_inline_start = is_rtl() ? '{{RIGHT}}{{UNIT}}' : '{{LEFT}}{{UNIT}}';
43 + $this->logical_dimensions_inline_end = is_rtl() ? '{{LEFT}}{{UNIT}}' : '{{RIGHT}}{{UNIT}}';
46 44 }
47 45
48 46 /**
49 47 * Get the element type.
@@ -81,9 +79,15 @@
81 79 return 'eicon-container';
82 80 }
83 81
84 82 public function get_keywords() {
85 - return [ 'Container', 'Flex', 'Flexbox', 'Flexbox Container', 'Grid', 'Grid Container', 'CSS Grid', 'Layout' ];
83 + $keywords = [ 'Container', 'Flex', 'Flexbox', 'Flexbox Container', 'Layout' ];
84 +
85 + if ( Plugin::$instance->experiments->is_feature_active( 'container_grid' ) ) {
86 + array_push( $keywords, 'Grid', 'Grid Container', 'CSS Grid' );
87 + }
88 +
89 + return $keywords;
86 90 }
87 91
88 92 public function get_panel_presets() {
89 93 return [
@@ -125,8 +129,18 @@
125 129 'e-con',
126 130 $is_nested_class_name,
127 131 ],
128 132 ] );
133 +
134 + if ( $this->get_data( 'isInner' ) ) {
135 + return;
136 + }
137 +
138 + // Todo: Remove in version 3.21.0: https://elementor.atlassian.net/browse/ED-11884.
139 + // Remove together with support for physical properties inside the Mega Menu & Nested Carousel widgets.
140 + $this->add_render_attribute( '_wrapper', [
141 + 'data-core-v316-plus' => 'true',
142 + ] );
129 143 }
130 144
131 145 /**
132 146 * Override the initial element config to display the Container in the panel.
@@ -139,9 +153,8 @@
139 153 $config['controls'] = $this->get_controls();
140 154 $config['tabs_controls'] = $this->get_tabs_controls();
141 155 $config['show_in_panel'] = true;
142 156 $config['categories'] = [ 'layout' ];
143 - $config['include_in_widgets_config'] = true;
144 157
145 158 return $config;
146 159 }
147 160
@@ -162,26 +175,21 @@
162 175 if ( ! settings.background_play_once ) {
163 176 videoAttributes += ' loop';
164 177 }
165 178
166 - view.addRenderAttribute(
167 - 'background-video-container',
168 - {
169 - 'class': 'elementor-background-video-container',
170 - }
171 - );
179 + view.addRenderAttribute( 'background-video-container', 'class', 'elementor-background-video-container' );
172 180
173 181 if ( ! settings.background_play_on_mobile ) {
174 - view.addRenderAttribute( 'background-video-container', 'class', 'elementor-hidden-mobile' );
182 + view.addRenderAttribute( 'background-video-container', 'class', 'elementor-hidden-phone' );
175 183 }
176 184 #>
177 185 <div {{{ view.getRenderAttributeString( 'background-video-container' ) }}}>
178 - <div class="elementor-background-video-embed" role="presentation"></div>
179 - <video class="elementor-background-video-hosted" role="presentation" {{ videoAttributes }}></video>
186 + <div class="elementor-background-video-embed"></div>
187 + <video class="elementor-background-video-hosted elementor-html5-video" {{ videoAttributes }}></video>
180 188 </div>
181 189 <# } #>
182 - <div class="elementor-shape elementor-shape-top" aria-hidden="true"></div>
183 - <div class="elementor-shape elementor-shape-bottom" aria-hidden="true"></div>
190 + <div class="elementor-shape elementor-shape-top"></div>
191 + <div class="elementor-shape elementor-shape-bottom"></div>
184 192 <# if ( 'boxed' === settings.content_width ) { #>
185 193 </div>
186 194 <# } #>
187 195 <?php
@@ -191,9 +199,9 @@
191 199 * Render the video background markup.
192 200 *
193 201 * @return void
194 202 */
195 - protected function render_video_background() {
203 + private function render_video_background() {
196 204 $settings = $this->get_settings_for_display();
197 205
198 206 if ( 'video' !== $settings['background_background'] ) {
199 207 return;
@@ -204,22 +212,17 @@
204 212 }
205 213
206 214 $video_properties = Embed::get_video_properties( $settings['background_video_link'] );
207 215
208 - $this->add_render_attribute(
209 - 'background-video-container',
210 - [
211 - 'class' => 'elementor-background-video-container',
212 - ]
213 - );
216 + $this->add_render_attribute( 'background-video-container', 'class', 'elementor-background-video-container' );
214 217
215 218 if ( ! $settings['background_play_on_mobile'] ) {
216 - $this->add_render_attribute( 'background-video-container', 'class', 'elementor-hidden-mobile' );
219 + $this->add_render_attribute( 'background-video-container', 'class', 'elementor-hidden-phone' );
217 220 }
218 221
219 222 ?><div <?php $this->print_render_attribute_string( 'background-video-container' ); ?>>
220 223 <?php if ( $video_properties ) : ?>
221 - <div class="elementor-background-video-embed" role="presentation"></div>
224 + <div class="elementor-background-video-embed"></div>
222 225 <?php
223 226 else :
224 227 $video_tag_attributes = 'autoplay muted playsinline';
225 228
@@ -226,9 +229,9 @@
226 229 if ( 'yes' !== $settings['background_play_once'] ) {
227 230 $video_tag_attributes .= ' loop';
228 231 }
229 232 ?>
230 - <video class="elementor-background-video-hosted" role="presentation" <?php echo esc_attr( $video_tag_attributes ); ?>></video>
233 + <video class="elementor-background-video-hosted elementor-html5-video" <?php echo esc_attr( $video_tag_attributes ); ?>></video>
231 234 <?php endif; ?>
232 235 </div><?php
233 236 }
234 237
@@ -241,9 +244,9 @@
241 244 * @param string $side - Shape divider side, used to set the shape key.
242 245 *
243 246 * @return void
244 247 */
245 - protected function render_shape_divider( $side ) {
248 + private function render_shape_divider( $side ) {
246 249 $settings = $this->get_active_settings();
247 250 $base_setting_key = "shape_divider_$side";
248 251 $negative = ! empty( $settings[ $base_setting_key . '_negative' ] );
249 252 $shape_path = Shapes::get_shape_path( $settings[ $base_setting_key ], $negative );
@@ -251,9 +254,9 @@
251 254 if ( ! is_file( $shape_path ) || ! is_readable( $shape_path ) ) {
252 255 return;
253 256 }
254 257 ?>
255 - <div class="elementor-shape elementor-shape-<?php echo esc_attr( $side ); ?>" aria-hidden="true" data-negative="<?php
258 + <div class="elementor-shape elementor-shape-<?php echo esc_attr( $side ); ?>" data-negative="<?php
256 259 Utils::print_unescaped_internal_string( $negative ? 'true' : 'false' );
257 260 ?>">
258 261 <?php
259 262 // PHPCS - The file content is being read from a strict file path structure.
@@ -267,9 +270,9 @@
267 270 * Print safe HTML tag for the element based on the element settings.
268 271 *
269 272 * @return void
270 273 */
271 - protected function print_html_tag() {
274 + private function print_html_tag() {
272 275 $html_tag = $this->get_settings( 'html_tag' );
273 276
274 277 if ( empty( $html_tag ) ) {
275 278 $html_tag = 'div';
@@ -321,9 +324,9 @@
321 324 </<?php $this->print_html_tag(); ?>>
322 325 <?php
323 326 }
324 327
325 - protected function is_boxed_container( array $settings ) {
328 + private function is_boxed_container( array $settings ) {
326 329 return ! empty( $settings['content_width'] ) && 'boxed' === $settings['content_width'];
327 330 }
328 331
329 332 /**
@@ -333,19 +336,72 @@
333 336 *
334 337 * @return \Elementor\Element_Base|\Elementor\Widget_Base|null
335 338 */
336 339 protected function _get_default_child_type( array $element_data ) {
337 - $el_types = array_keys( Plugin::$instance->elements_manager->get_element_types() );
340 + if ( 'container' === $element_data['elType'] ) {
341 + return Plugin::$instance->elements_manager->get_element_types( 'container' );
342 + }
338 343
339 - if ( in_array( $element_data['elType'], $el_types, true ) ) {
340 - return Plugin::$instance->elements_manager->get_element_types( $element_data['elType'] );
344 + return Plugin::$instance->widgets_manager->get_widget_types( $element_data['widgetType'] );
345 + }
346 +
347 + protected function get_flex_control_options( $is_container_grid_active ) {
348 + $flex_control_options = [
349 + 'name' => 'flex',
350 + 'selector' => '{{WRAPPER}}',
351 + 'fields_options' => [
352 + 'gap' => [
353 + 'label' => esc_html_x( 'Gaps', 'Flex Container Control', 'elementor' ),
354 + 'device_args' => [
355 + Breakpoints_Manager::BREAKPOINT_KEY_DESKTOP => [
356 + // Use the default gap from the kit as a placeholder.
357 + 'placeholder' => $this->active_kit->get_settings_for_display( 'space_between_widgets' ),
358 + ],
359 + ],
360 + ],
361 + ],
362 + ];
363 +
364 + if ( $is_container_grid_active ) {
365 + $flex_control_options['condition'] = [
366 + 'container_type' => 'flex',
367 + ];
341 368 }
342 369
343 - if ( ! isset( $element_data['widgetType'] ) ) {
344 - return null;
370 + return $flex_control_options;
371 + }
372 +
373 + protected function get_container_type_control_options( $is_container_grid_active ) {
374 + if ( $is_container_grid_active ) {
375 + return [
376 + 'label' => esc_html__( 'Container Layout', 'elementor' ),
377 + 'type' => Controls_Manager::SELECT,
378 + 'default' => 'flex',
379 + 'prefix_class' => 'e-',
380 + 'options' => [
381 + 'flex' => esc_html__( 'Flexbox', 'elementor' ),
382 + 'grid' => esc_html__( 'Grid', 'elementor' ),
383 + ],
384 + 'selectors' => [
385 + '{{WRAPPER}}' => '--display: {{VALUE}}',
386 + ],
387 + 'separator' => 'after',
388 + 'frontend_available' => true,
389 + ];
345 390 }
346 391
347 - return Plugin::$instance->widgets_manager->get_widget_types( $element_data['widgetType'] );
392 + // TODO: This can be removed when the 'Container Grid Experiment' is merged.
393 + return [
394 + 'label' => esc_html__( 'Container Layout', 'elementor' ),
395 + 'type' => Controls_Manager::HIDDEN,
396 + 'render_type' => 'none',
397 + 'default' => 'flex',
398 + 'prefix_class' => 'e-',
399 + 'selectors' => [
400 + '{{WRAPPER}}' => '--display: {{VALUE}}',
401 + ],
402 + 'separator' => 'after',
403 + ];
348 404 }
349 405
350 406 /**
351 407 * Register the Container's layout controls.
@@ -368,25 +424,13 @@
368 424 } else {
369 425 $min_affected_device = Breakpoints_Manager::BREAKPOINT_KEY_TABLET;
370 426 }
371 427
428 + $is_container_grid_active = Plugin::$instance->experiments->is_feature_active( 'container_grid' );
429 +
372 430 $this->add_control(
373 431 'container_type',
374 - [
375 - 'label' => esc_html__( 'Container Layout', 'elementor' ),
376 - 'type' => Controls_Manager::SELECT,
377 - 'default' => 'flex',
378 - 'prefix_class' => 'e-',
379 - 'options' => [
380 - 'flex' => esc_html__( 'Flexbox', 'elementor' ),
381 - 'grid' => esc_html__( 'Grid', 'elementor' ),
382 - ],
383 - 'selectors' => [
384 - '{{WRAPPER}}' => '--display: {{VALUE}}',
385 - ],
386 - 'separator' => 'after',
387 - 'editor_available' => true,
388 - ]
432 + $this->get_container_type_control_options( $is_container_grid_active )
389 433 );
390 434
391 435 $this->add_control(
392 436 'content_width',
@@ -399,9 +443,9 @@
399 443 'full' => esc_html__( 'Full Width', 'elementor' ),
400 444 ],
401 445 'render_type' => 'template',
402 446 'prefix_class' => 'e-con-',
403 - 'editor_available' => true,
447 + 'frontend_available' => true,
404 448 ]
405 449 );
406 450
407 451 $width_control_settings = [
@@ -412,8 +456,16 @@
412 456 'px' => [
413 457 'min' => 500,
414 458 'max' => 1600,
415 459 ],
460 + '%' => [
461 + 'min' => 0,
462 + 'max' => 100,
463 + ],
464 + 'vw' => [
465 + 'min' => 0,
466 + 'max' => 100,
467 + ],
416 468 ],
417 469 'default' => [
418 470 'unit' => '%',
419 471 ],
@@ -423,8 +475,9 @@
423 475 Breakpoints_Manager::BREAKPOINT_KEY_TABLET_EXTRA => $min_affected_device,
424 476 Breakpoints_Manager::BREAKPOINT_KEY_TABLET => $min_affected_device,
425 477 Breakpoints_Manager::BREAKPOINT_KEY_MOBILE_EXTRA => $min_affected_device,
426 478 ],
479 + 'separator' => 'none',
427 480 ];
428 481
429 482 $this->add_responsive_control(
430 483 'width',
@@ -488,13 +541,17 @@
488 541 'type' => Controls_Manager::SLIDER,
489 542 'size_units' => [ 'px', 'em', 'rem', 'vh', 'custom' ],
490 543 'range' => [
491 544 'px' => [
545 + 'min' => 0,
492 546 'max' => 1440,
493 547 ],
548 + 'vh' => [
549 + 'min' => 0,
550 + 'max' => 100,
551 + ],
494 552 ],
495 553 'description' => sprintf(
496 - /* translators: %s: 100vh. */
497 554 esc_html__( 'To achieve full height Container use %s.', 'elementor' ),
498 555 '100vh'
499 556 ),
500 557 'selectors' => [
@@ -504,38 +561,23 @@
504 561 );
505 562
506 563 $this->add_group_control(
507 564 Group_Control_Flex_Container::get_type(),
508 - [
509 - 'name' => 'flex',
510 - 'selector' => '{{WRAPPER}}',
511 - 'fields_options' => [
512 - 'gap' => [
513 - 'label' => esc_html__( 'Gaps', 'elementor' ),
514 - 'device_args' => [
515 - Breakpoints_Manager::BREAKPOINT_KEY_DESKTOP => [
516 - // Use the default gap from the kit as a placeholder.
517 - 'placeholder' => $this->active_kit->get_settings_for_display( 'space_between_widgets' ),
518 - ],
519 - ],
520 - ],
521 - ],
522 - 'condition' => [
523 - 'container_type' => [ 'flex' ],
524 - ],
525 - ]
565 + $this->get_flex_control_options( $is_container_grid_active )
526 566 );
527 567
528 - $this->add_group_control(
529 - Group_Control_Grid_Container::get_type(),
530 - [
531 - 'name' => 'grid',
532 - 'selector' => '{{WRAPPER}}',
533 - 'condition' => [
534 - 'container_type' => [ 'grid' ],
535 - ],
536 - ]
537 - );
568 + if ( $is_container_grid_active ) {
569 + $this->add_group_control(
570 + Group_Control_Grid_Container::get_type(),
571 + [
572 + 'name' => 'grid',
573 + 'selector' => '{{WRAPPER}}',
574 + 'condition' => [
575 + 'container_type' => [ 'grid' ],
576 + ],
577 + ]
578 + );
579 + }
538 580
539 581 $this->end_controls_section();
540 582 }
541 583
@@ -597,11 +639,11 @@
597 639
598 640 $this->add_control(
599 641 'link_note',
600 642 [
601 - 'type' => Controls_Manager::ALERT,
602 - 'alert_type' => 'warning',
603 - 'content' => esc_html__( 'Don’t add links to elements nested in this container - it will break the layout.', 'elementor' ),
643 + 'type' => Controls_Manager::RAW_HTML,
644 + 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning',
645 + 'raw' => esc_html__( 'Don’t add links to elements nested in this container - it will break the layout.', 'elementor' ),
604 646 'condition' => [
605 647 'html_tag' => 'a',
606 648 ],
607 649 ]
@@ -669,45 +711,14 @@
669 711 'fields_options' => [
670 712 'background' => [
671 713 'frontend_available' => true,
672 714 ],
673 - ],
674 - ]
675 - );
676 -
677 - $this->add_control(
678 - 'handle_slideshow_asset_loading',
679 - [
680 - 'type' => Controls_Manager::HIDDEN,
681 - 'assets' => [
682 - 'styles' => [
683 - [
684 - 'name' => 'e-swiper',
685 - 'conditions' => [
686 - 'terms' => [
687 - [
688 - 'name' => 'background_background',
689 - 'operator' => '===',
690 - 'value' => 'slideshow',
691 - ],
692 - ],
693 - ],
715 + 'image' => [
716 + 'background_lazyload' => [
717 + 'active' => true,
718 + 'keys' => [ 'background_image', 'url' ],
694 719 ],
695 720 ],
696 - 'scripts' => [
697 - [
698 - 'name' => 'swiper',
699 - 'conditions' => [
700 - 'terms' => [
701 - [
702 - 'name' => 'background_background',
703 - 'operator' => '===',
704 - 'value' => 'slideshow',
705 - ],
706 - ],
707 - ],
708 - ],
709 - ],
710 721 ],
711 722 ]
712 723 );
713 724
@@ -733,25 +744,15 @@
733 744
734 745 $this->add_control(
735 746 'background_hover_transition',
736 747 [
737 - 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)',
748 + 'label' => esc_html__( 'Transition Duration', 'elementor' ),
738 749 'type' => Controls_Manager::SLIDER,
739 750 'default' => [
740 751 'size' => 0.3,
741 752 ],
742 - 'range' => [
743 - 'px' => [
744 - 'min' => 0,
745 - 'max' => 3,
746 - 'step' => 0.1,
747 - ],
748 - ],
749 753 'render_type' => 'ui',
750 754 'separator' => 'before',
751 - 'condition' => [
752 - 'background_hover_background' => [ 'classic', 'gradient' ],
753 - ],
754 755 'selectors' => [
755 756 '{{WRAPPER}}' => '--background-transition: {{SIZE}}s;',
756 757 ],
757 758 ]
@@ -803,8 +804,14 @@
803 804 // Hack to set the `::before` content in order to render it only when there is a background overlay.
804 805 $background_overlay_selector => '--background-overlay: \'\';',
805 806 ],
806 807 ],
808 + 'image' => [
809 + 'background_lazyload' => [
810 + 'active' => true,
811 + 'keys' => [ 'background_overlay_image', 'url' ],
812 + ],
813 + ],
807 814 ],
808 815 ]
809 816 );
810 817
@@ -944,16 +951,23 @@
944 951 ],
945 952 ]
946 953 );
947 954
955 + $this->add_group_control(
956 + Group_Control_Css_Filter::get_type(),
957 + [
958 + 'name' => 'css_filters_hover',
959 + 'selector' => '{{WRAPPER}}:hover::before',
960 + ]
961 + );
962 +
948 963 $this->add_control(
949 964 'background_overlay_hover_transition',
950 965 [
951 - 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)',
966 + 'label' => esc_html__( 'Transition Duration', 'elementor' ),
952 967 'type' => Controls_Manager::SLIDER,
953 968 'range' => [
954 969 'px' => [
955 - 'min' => 0,
956 970 'max' => 3,
957 971 'step' => 0.1,
958 972 ],
959 973 ],
@@ -958,11 +972,8 @@
958 972 ],
959 973 ],
960 974 'render_type' => 'ui',
961 975 'separator' => 'before',
962 - 'condition' => [
963 - 'background_overlay_hover_background' => [ 'classic', 'gradient' ],
964 - ],
965 976 'selectors' => [
966 977 '{{WRAPPER}}, {{WRAPPER}}::before' => '--overlay-transition: {{SIZE}}s;',
967 978 ],
968 979 ]
@@ -967,16 +978,8 @@
967 978 ],
968 979 ]
969 980 );
970 981
971 - $this->add_group_control(
972 - Group_Control_Css_Filter::get_type(),
973 - [
974 - 'name' => 'css_filters_hover',
975 - 'selector' => '{{WRAPPER}}:hover::before',
976 - ]
977 - );
978 -
979 982 $this->end_controls_tab();
980 983
981 984 $this->end_controls_tabs();
982 985
@@ -1016,9 +1019,9 @@
1016 1019 'selector' => '{{WRAPPER}}',
1017 1020 'fields_options' => [
1018 1021 'width' => [
1019 1022 'selectors' => [
1020 - '{{SELECTOR}}' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; --border-top-width: {{TOP}}{{UNIT}}; --border-right-width: {{RIGHT}}{{UNIT}}; --border-bottom-width: {{BOTTOM}}{{UNIT}}; --border-left-width: {{LEFT}}{{UNIT}};',
1023 + '{{SELECTOR}}' => "border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; --border-block-start-width: {{TOP}}{{UNIT}}; --border-inline-end-width: $this->logical_dimensions_inline_end; --border-block-end-width: {{BOTTOM}}{{UNIT}}; --border-inline-start-width: $this->logical_dimensions_inline_start;",
1021 1024 ],
1022 1025 ],
1023 1026 'color' => [
1024 1027 'selectors' => [
@@ -1072,9 +1075,9 @@
1072 1075 'selector' => '{{WRAPPER}}:hover',
1073 1076 'fields_options' => [
1074 1077 'width' => [
1075 1078 'selectors' => [
1076 - '{{SELECTOR}}' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; --border-top-width: {{TOP}}{{UNIT}}; --border-right-width: {{RIGHT}}{{UNIT}}; --border-bottom-width: {{BOTTOM}}{{UNIT}}; --border-left-width: {{LEFT}}{{UNIT}};',
1079 + '{{SELECTOR}}' => "border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; --border-block-start-width: {{TOP}}{{UNIT}}; --border-inline-end-width: $this->logical_dimensions_inline_end; --border-block-end-width: {{BOTTOM}}{{UNIT}}; --border-inline-start-width: $this->logical_dimensions_inline_start;",
1077 1080 ],
1078 1081 ],
1079 1082 'color' => [
1080 1083 'selectors' => [
@@ -1091,9 +1094,9 @@
1091 1094 'label' => esc_html__( 'Border Radius', 'elementor' ),
1092 1095 'type' => Controls_Manager::DIMENSIONS,
1093 1096 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
1094 1097 'selectors' => [
1095 - '{{WRAPPER}}:hover' => '--border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; --border-top-left-radius: {{TOP}}{{UNIT}}; --border-top-right-radius: {{RIGHT}}{{UNIT}}; --border-bottom-right-radius: {{BOTTOM}}{{UNIT}}; --border-bottom-left-radius: {{LEFT}}{{UNIT}};',
1098 + '{{WRAPPER}}:hover' => "--border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; --border-top-left-radius: {{TOP}}{{UNIT}}; --border-top-right-radius: $this->logical_dimensions_inline_end; --border-bottom-right-radius: {{BOTTOM}}{{UNIT}}; --border-bottom-left-radius: $this->logical_dimensions_inline_start;",
1096 1099 ],
1097 1100 ]
1098 1101 );
1099 1102
@@ -1107,9 +1110,9 @@
1107 1110
1108 1111 $this->add_control(
1109 1112 'border_hover_transition',
1110 1113 [
1111 - 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)',
1114 + 'label' => esc_html__( 'Transition Duration', 'elementor' ),
1112 1115 'type' => Controls_Manager::SLIDER,
1113 1116 'separator' => 'before',
1114 1117 'default' => [
1115 1118 'size' => 0.3,
@@ -1115,9 +1118,8 @@
1115 1118 'size' => 0.3,
1116 1119 ],
1117 1120 'range' => [
1118 1121 'px' => [
1119 - 'min' => 0,
1120 1122 'max' => 3,
1121 1123 'step' => 0.1,
1122 1124 ],
1123 1125 ],
@@ -1124,32 +1126,17 @@
1124 1126 'conditions' => [
1125 1127 'relation' => 'or',
1126 1128 'terms' => [
1127 1129 [
1128 - 'name' => 'border_hover_border',
1130 + 'name' => 'background_background',
1129 1131 'operator' => '!==',
1130 1132 'value' => '',
1131 1133 ],
1132 1134 [
1133 - 'name' => 'border_radius_hover[top]',
1135 + 'name' => 'border_border',
1134 1136 'operator' => '!==',
1135 1137 'value' => '',
1136 1138 ],
1137 - [
1138 - 'name' => 'border_radius_hover[right]',
1139 - 'operator' => '!==',
1140 - 'value' => '',
1141 - ],
1142 - [
1143 - 'name' => 'border_radius_hover[bottom]',
1144 - 'operator' => '!==',
1145 - 'value' => '',
1146 - ],
1147 - [
1148 - 'name' => 'border_radius_hover[left]',
1149 - 'operator' => '!==',
1150 - 'value' => '',
1151 - ],
1152 1139 ],
1153 1140 ],
1154 1141 'selectors' => [
1155 1142 '{{WRAPPER}}, {{WRAPPER}}::before' => '--border-transition: {{SIZE}}s;',
@@ -1180,8 +1167,16 @@
1180 1167 );
1181 1168
1182 1169 $this->start_controls_tabs( 'tabs_shape_dividers' );
1183 1170
1171 + $shapes_options = [
1172 + '' => esc_html__( 'None', 'elementor' ),
1173 + ];
1174 +
1175 + foreach ( Shapes::get_shapes() as $shape_name => $shape_props ) {
1176 + $shapes_options[ $shape_name ] = $shape_props['title'];
1177 + }
1178 +
1184 1179 foreach ( [
1185 1180 'top' => esc_html__( 'Top', 'elementor' ),
1186 1181 'bottom' => esc_html__( 'Bottom', 'elementor' ),
1187 1182 ] as $side => $side_label ) {
@@ -1197,30 +1192,12 @@
1197 1192 $this->add_control(
1198 1193 $base_control_key,
1199 1194 [
1200 1195 'label' => esc_html__( 'Type', 'elementor' ),
1201 - 'type' => Controls_Manager::VISUAL_CHOICE,
1202 - 'label_block' => true,
1203 - 'columns' => 2,
1204 - 'options' => Shapes::get_shapes(),
1196 + 'type' => Controls_Manager::SELECT,
1197 + 'options' => $shapes_options,
1205 1198 'render_type' => 'none',
1206 1199 'frontend_available' => true,
1207 - 'assets' => [
1208 - 'styles' => [
1209 - [
1210 - 'name' => 'e-shapes',
1211 - 'conditions' => [
1212 - 'terms' => [
1213 - [
1214 - 'name' => $base_control_key,
1215 - 'operator' => '!==',
1216 - 'value' => '',
1217 - ],
1218 - ],
1219 - ],
1220 - ],
1221 - ],
1222 - ],
1223 1200 ]
1224 1201 );
1225 1202
1226 1203 $this->add_control(
@@ -1241,9 +1218,8 @@
1241 1218 $base_control_key . '_width',
1242 1219 [
1243 1220 'label' => esc_html__( 'Width', 'elementor' ),
1244 1221 'type' => Controls_Manager::SLIDER,
1245 - 'size_units' => [ '%', 'vw', 'custom' ],
1246 1222 'default' => [
1247 1223 'unit' => '%',
1248 1224 ],
1249 1225 'tablet_default' => [
@@ -1256,12 +1232,8 @@
1256 1232 '%' => [
1257 1233 'min' => 100,
1258 1234 'max' => 300,
1259 1235 ],
1260 - 'vw' => [
1261 - 'min' => 100,
1262 - 'max' => 300,
1263 - ],
1264 1236 ],
1265 1237 'condition' => [
1266 1238 "shape_divider_$side" => array_keys( Shapes::filter_shapes( 'height_only', Shapes::FILTER_EXCLUDE ) ),
1267 1239 ],
@@ -1275,19 +1247,12 @@
1275 1247 $base_control_key . '_height',
1276 1248 [
1277 1249 'label' => esc_html__( 'Height', 'elementor' ),
1278 1250 'type' => Controls_Manager::SLIDER,
1279 - 'size_units' => [ 'px', 'em', 'rem', 'custom' ],
1280 1251 'range' => [
1281 1252 'px' => [
1282 1253 'max' => 500,
1283 1254 ],
1284 - 'em' => [
1285 - 'max' => 50,
1286 - ],
1287 - 'rem' => [
1288 - 'max' => 50,
1289 - ],
1290 1255 ],
1291 1256 'condition' => [
1292 1257 "shape_divider_$side!" => '',
1293 1258 ],
@@ -1380,9 +1345,9 @@
1380 1345 'label' => esc_html__( 'Margin', 'elementor' ),
1381 1346 'type' => Controls_Manager::DIMENSIONS,
1382 1347 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
1383 1348 'selectors' => [
1384 - '{{WRAPPER}}' => '--margin-top: {{TOP}}{{UNIT}}; --margin-bottom: {{BOTTOM}}{{UNIT}}; --margin-left: {{LEFT}}{{UNIT}}; --margin-right: {{RIGHT}}{{UNIT}};',
1349 + '{{WRAPPER}}' => "--margin-block-start: {{TOP}}{{UNIT}}; --margin-block-end: {{BOTTOM}}{{UNIT}}; --margin-inline-start: $this->logical_dimensions_inline_start; --margin-inline-end: $this->logical_dimensions_inline_end;",
1385 1350 ],
1386 1351 ]
1387 1352 );
1388 1353
@@ -1392,111 +1357,13 @@
1392 1357 'label' => esc_html__( 'Padding', 'elementor' ),
1393 1358 'type' => Controls_Manager::DIMENSIONS,
1394 1359 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
1395 1360 'selectors' => [
1396 - '{{WRAPPER}}' => '--padding-top: {{TOP}}{{UNIT}}; --padding-bottom: {{BOTTOM}}{{UNIT}}; --padding-left: {{LEFT}}{{UNIT}}; --padding-right: {{RIGHT}}{{UNIT}};',
1361 + '{{WRAPPER}}' => "--padding-block-start: {{TOP}}{{UNIT}}; --padding-block-end: {{BOTTOM}}{{UNIT}}; --padding-inline-start: $this->logical_dimensions_inline_start; --padding-inline-end: $this->logical_dimensions_inline_end;",
1397 1362 ],
1398 1363 ]
1399 1364 );
1400 1365
1401 - $this->add_control(
1402 - 'heading_grid_item',
1403 - [
1404 - 'type' => Controls_Manager::HEADING,
1405 - 'label' => esc_html__( 'Grid Item', 'elementor' ),
1406 - 'separator' => 'before',
1407 - ]
1408 - );
1409 -
1410 - $this->add_responsive_control(
1411 - 'grid_column',
1412 - [
1413 - 'label' => esc_html__( 'Column Span', 'elementor' ),
1414 - 'type' => Controls_Manager::SELECT,
1415 - 'options' => [
1416 - '' => ' Default',
1417 - '1' => '1',
1418 - '2' => '2',
1419 - '3' => '3',
1420 - '4' => '4',
1421 - '5' => '5',
1422 - '6' => '6',
1423 - '7' => '7',
1424 - '8' => '8',
1425 - '9' => '9',
1426 - '10' => '10',
1427 - '11' => '11',
1428 - '12' => '12',
1429 - 'custom' => 'Custom',
1430 - ],
1431 - 'selectors' => [
1432 - '{{WRAPPER}}' => 'grid-column: span {{VALUE}};',
1433 - ],
1434 - ]
1435 - );
1436 -
1437 - $this->add_responsive_control(
1438 - 'grid_column_custom',
1439 - [
1440 - 'label' => esc_html__( 'Custom', 'elementor' ),
1441 - 'type' => Controls_Manager::TEXT,
1442 - 'ai' => [
1443 - 'active' => false,
1444 - ],
1445 - 'selectors' => [
1446 - '{{WRAPPER}}' => 'grid-column: {{VALUE}}',
1447 - ],
1448 - 'condition' => [
1449 - 'grid_column' => 'custom',
1450 - ],
1451 - ]
1452 - );
1453 -
1454 - $this->add_responsive_control(
1455 - 'grid_row',
1456 - [
1457 - 'label' => esc_html__( 'Row Span', 'elementor' ),
1458 - 'type' => Controls_Manager::SELECT,
1459 - 'options' => [
1460 - '' => ' Default',
1461 - '1' => '1',
1462 - '2' => '2',
1463 - '3' => '3',
1464 - '4' => '4',
1465 - '5' => '5',
1466 - '6' => '6',
1467 - '7' => '7',
1468 - '8' => '8',
1469 - '9' => '9',
1470 - '10' => '10',
1471 - '11' => '11',
1472 - '12' => '12',
1473 - 'custom' => 'Custom',
1474 - ],
1475 - 'selectors' => [
1476 - '{{WRAPPER}}' => 'grid-row: span {{VALUE}};',
1477 - ],
1478 - ]
1479 - );
1480 -
1481 - $this->add_responsive_control(
1482 - 'grid_row_custom',
1483 - [
1484 - 'label' => esc_html__( 'Custom', 'elementor' ),
1485 - 'type' => Controls_Manager::TEXT,
1486 - 'separator' => 'after',
1487 - 'ai' => [
1488 - 'active' => false,
1489 - ],
1490 - 'selectors' => [
1491 - '{{WRAPPER}}' => 'grid-row: {{VALUE}}',
1492 - ],
1493 - 'condition' => [
1494 - 'grid_row' => 'custom',
1495 - ],
1496 - ]
1497 - );
1498 -
1499 1366 $this->add_group_control(
1500 1367 Group_Control_Flex_Item::get_type(),
1501 1368 [
1502 1369 'name' => '_flex',
@@ -1515,12 +1382,11 @@
1515 1382
1516 1383 $this->add_control(
1517 1384 'position_description',
1518 1385 [
1519 - 'type' => Controls_Manager::ALERT,
1520 - 'alert_type' => 'warning',
1521 - 'heading' => esc_html__( 'Please note!', 'elementor' ),
1522 - 'content' => esc_html__( 'Custom positioning is not considered best practice for responsive web design and should not be used too frequently.', 'elementor' ),
1386 + 'raw' => '<strong>' . esc_html__( 'Please note!', 'elementor' ) . '</strong> ' . esc_html__( 'Custom positioning is not considered best practice for responsive web design and should not be used too frequently.', 'elementor' ),
1387 + 'type' => Controls_Manager::RAW_HTML,
1388 + 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning',
1523 1389 'render_type' => 'ui',
1524 1390 'condition' => [
1525 1391 'position!' => '',
1526 1392 ],
@@ -1586,8 +1452,9 @@
1586 1452 'range' => [
1587 1453 'px' => [
1588 1454 'min' => -1000,
1589 1455 'max' => 1000,
1456 + 'step' => 1,
1590 1457 ],
1591 1458 '%' => [
1592 1459 'min' => -200,
1593 1460 'max' => 200,
@@ -1601,9 +1468,9 @@
1601 1468 'max' => 200,
1602 1469 ],
1603 1470 ],
1604 1471 'default' => [
1605 - 'size' => 0,
1472 + 'size' => '0',
1606 1473 ],
1607 1474 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'vh', 'custom' ],
1608 1475 'selectors' => [
1609 1476 'body:not(.rtl) {{WRAPPER}}' => 'left: {{SIZE}}{{UNIT}}',
@@ -1624,8 +1491,9 @@
1624 1491 'range' => [
1625 1492 'px' => [
1626 1493 'min' => -1000,
1627 1494 'max' => 1000,
1495 + 'step' => 0.1,
1628 1496 ],
1629 1497 '%' => [
1630 1498 'min' => -200,
1631 1499 'max' => 200,
@@ -1639,9 +1507,9 @@
1639 1507 'max' => 200,
1640 1508 ],
1641 1509 ],
1642 1510 'default' => [
1643 - 'size' => 0,
1511 + 'size' => '0',
1644 1512 ],
1645 1513 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'vh', 'custom' ],
1646 1514 'selectors' => [
1647 1515 'body:not(.rtl) {{WRAPPER}}' => 'right: {{SIZE}}{{UNIT}}',
@@ -1686,8 +1554,9 @@
1686 1554 'range' => [
1687 1555 'px' => [
1688 1556 'min' => -1000,
1689 1557 'max' => 1000,
1558 + 'step' => 1,
1690 1559 ],
1691 1560 '%' => [
1692 1561 'min' => -200,
1693 1562 'max' => 200,
@@ -1702,9 +1571,9 @@
1702 1571 ],
1703 1572 ],
1704 1573 'size_units' => [ 'px', '%', 'em', 'rem', 'vh', 'vw', 'custom' ],
1705 1574 'default' => [
1706 - 'size' => 0,
1575 + 'size' => '0',
1707 1576 ],
1708 1577 'selectors' => [
1709 1578 '{{WRAPPER}}' => 'top: {{SIZE}}{{UNIT}}',
1710 1579 ],
@@ -1723,8 +1592,9 @@
1723 1592 'range' => [
1724 1593 'px' => [
1725 1594 'min' => -1000,
1726 1595 'max' => 1000,
1596 + 'step' => 1,
1727 1597 ],
1728 1598 '%' => [
1729 1599 'min' => -200,
1730 1600 'max' => 200,
@@ -1739,9 +1609,9 @@
1739 1609 ],
1740 1610 ],
1741 1611 'size_units' => [ 'px', '%', 'em', 'rem', 'vh', 'vw', 'custom' ],
1742 1612 'default' => [
1743 - 'size' => 0,
1613 + 'size' => '0',
1744 1614 ],
1745 1615 'selectors' => [
1746 1616 '{{WRAPPER}}' => 'bottom: {{SIZE}}{{UNIT}}',
1747 1617 ],
@@ -1799,10 +1669,8 @@
1799 1669 'classes' => 'elementor-control-direction-ltr',
1800 1670 ]
1801 1671 );
1802 1672
1803 - Plugin::$instance->controls_manager->add_display_conditions_controls( $this );
1804 -
1805 1673 $this->end_controls_section();
1806 1674 }
1807 1675
1808 1676 /**
@@ -1818,10 +1686,8 @@
1818 1686 'tab' => Controls_Manager::TAB_ADVANCED,
1819 1687 ]
1820 1688 );
1821 1689
1822 - Plugin::$instance->controls_manager->add_motion_effects_promotion_control( $this );
1823 -
1824 1690 $this->add_responsive_control(
1825 1691 'animation',
1826 1692 [
1827 1693 'label' => esc_html__( 'Entrance Animation', 'elementor' ),
@@ -1937,11 +1803,11 @@
1937 1803
1938 1804 $container->add_control(
1939 1805 'transform_sticky_notice',
1940 1806 [
1941 - 'type' => Controls_Manager::ALERT,
1942 - 'alert_type' => 'warning',
1943 - 'content' => esc_html__( 'Note: Avoid applying transform properties on sticky containers. Doing so might cause unexpected results.', 'elementor' ),
1807 + 'type' => Controls_Manager::RAW_HTML,
1808 + 'raw' => esc_html__( 'Note: Avoid applying transform properties on sticky containers. Doing so might cause unexpected results.', 'elementor' ),
1809 + 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning',
1944 1810 ]
1945 1811 );
1946 1812 } );
1947 1813 }
@@ -1961,11 +1827,11 @@
1961 1827 return self::slider_to_gaps_converter( $element );
1962 1828 }
1963 1829
1964 1830 /**
1965 - * Convert slider to gaps control for the 3.16 upgrade script
1831 + * convert slider to gaps control for the 3.16 upgrade script
1966 1832 *
1967 - * @param array $element
1833 + * @param $element
1968 1834 * @return array
1969 1835 */
1970 1836 public static function slider_to_gaps_converter( $element ) {
1971 1837 $breakpoints = array_keys( (array) Plugin::$instance->breakpoints->get_breakpoints() );
@@ -1976,15 +1842,9 @@
1976 1842 $control = 'desktop' !== $breakpoint
1977 1843 ? $control_name . '_' . $breakpoint
1978 1844 : $control_name;
1979 1845
1980 - if ( ! isset( $element['settings'][ $control ] ) ) {
1981 - continue;
1982 - }
1983 -
1984 - $already_using_gaps_control = isset( $element['settings'][ $control ]['isLinked'] ); // Slider control won't have the 'isLinked' property.
1985 -
1986 - if ( ! $already_using_gaps_control ) {
1846 + if ( isset( $element['settings'][ $control ] ) ) {
1987 1847 $old_size = strval( $element['settings'][ $control ]['size'] );
1988 1848
1989 1849 $element['settings'][ $control ]['column'] = $old_size;
1990 1850 $element['settings'][ $control ]['row'] = $old_size;