PluginProbe
Elementor Website Builder – more than just a page builder / 3.14.0-beta4
Elementor Website Builder – more than just a page builder v3.14.0-beta4
4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.3.0-beta3 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 All 457 releases
← All changes | includes/elements/container.php +168 -384 4.1.1 → 3.14.0-beta4 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,9 +34,9 @@
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();
46 42 }
@@ -81,34 +77,15 @@
81 77 return 'eicon-container';
82 78 }
83 79
84 80 public function get_keywords() {
85 - return [ 'Container', 'Flex', 'Flexbox', 'Flexbox Container', 'Grid', 'Grid Container', 'CSS Grid', 'Layout' ];
86 - }
81 + $keywords = [ 'Container', 'Flex', 'Flexbox', 'Flexbox Container', 'Layout' ];
87 82
88 - public function get_panel_presets() {
89 - return [
90 - 'container_grid' => [
91 - 'replacements' => [
92 - 'name' => 'container_grid',
93 - 'controls' => [
94 - 'container_type' => [ 'default' => 'grid' ],
95 - ],
96 - 'title' => esc_html__( 'Grid', 'elementor' ),
97 - 'icon' => 'eicon-container-grid',
98 - 'custom' => [
99 - 'isPreset' => true,
100 - 'originalWidget' => $this->get_name(),
101 - 'presetWidget' => 'container_grid',
102 - 'preset_settings' => [
103 - 'container_type' => 'grid',
104 - 'presetTitle' => esc_html__( 'Grid', 'elementor' ),
105 - 'presetIcon' => 'eicon-container-grid',
106 - ],
107 - ],
108 - ],
109 - ],
110 - ];
83 + if ( Plugin::$instance->experiments->is_feature_active( 'container_grid' ) ) {
84 + array_push( $keywords, 'Grid', 'Grid Container', 'CSS Grid' );
85 + }
86 +
87 + return $keywords;
111 88 }
112 89
113 90 /**
114 91 * Override the render attributes to add a custom wrapper class.
@@ -117,14 +94,11 @@
117 94 */
118 95 protected function add_render_attributes() {
119 96 parent::add_render_attributes();
120 97
121 - $is_nested_class_name = $this->get_data( 'isInner' ) ? 'e-child' : 'e-parent';
122 -
123 98 $this->add_render_attribute( '_wrapper', [
124 99 'class' => [
125 100 'e-con',
126 - $is_nested_class_name,
127 101 ],
128 102 ] );
129 103 }
130 104
@@ -139,9 +113,8 @@
139 113 $config['controls'] = $this->get_controls();
140 114 $config['tabs_controls'] = $this->get_tabs_controls();
141 115 $config['show_in_panel'] = true;
142 116 $config['categories'] = [ 'layout' ];
143 - $config['include_in_widgets_config'] = true;
144 117
145 118 return $config;
146 119 }
147 120
@@ -162,26 +135,21 @@
162 135 if ( ! settings.background_play_once ) {
163 136 videoAttributes += ' loop';
164 137 }
165 138
166 - view.addRenderAttribute(
167 - 'background-video-container',
168 - {
169 - 'class': 'elementor-background-video-container',
170 - }
171 - );
139 + view.addRenderAttribute( 'background-video-container', 'class', 'elementor-background-video-container' );
172 140
173 141 if ( ! settings.background_play_on_mobile ) {
174 - view.addRenderAttribute( 'background-video-container', 'class', 'elementor-hidden-mobile' );
142 + view.addRenderAttribute( 'background-video-container', 'class', 'elementor-hidden-phone' );
175 143 }
176 144 #>
177 145 <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>
146 + <div class="elementor-background-video-embed"></div>
147 + <video class="elementor-background-video-hosted elementor-html5-video" {{ videoAttributes }}></video>
180 148 </div>
181 149 <# } #>
182 - <div class="elementor-shape elementor-shape-top" aria-hidden="true"></div>
183 - <div class="elementor-shape elementor-shape-bottom" aria-hidden="true"></div>
150 + <div class="elementor-shape elementor-shape-top"></div>
151 + <div class="elementor-shape elementor-shape-bottom"></div>
184 152 <# if ( 'boxed' === settings.content_width ) { #>
185 153 </div>
186 154 <# } #>
187 155 <?php
@@ -191,9 +159,9 @@
191 159 * Render the video background markup.
192 160 *
193 161 * @return void
194 162 */
195 - protected function render_video_background() {
163 + private function render_video_background() {
196 164 $settings = $this->get_settings_for_display();
197 165
198 166 if ( 'video' !== $settings['background_background'] ) {
199 167 return;
@@ -204,22 +172,17 @@
204 172 }
205 173
206 174 $video_properties = Embed::get_video_properties( $settings['background_video_link'] );
207 175
208 - $this->add_render_attribute(
209 - 'background-video-container',
210 - [
211 - 'class' => 'elementor-background-video-container',
212 - ]
213 - );
176 + $this->add_render_attribute( 'background-video-container', 'class', 'elementor-background-video-container' );
214 177
215 178 if ( ! $settings['background_play_on_mobile'] ) {
216 - $this->add_render_attribute( 'background-video-container', 'class', 'elementor-hidden-mobile' );
179 + $this->add_render_attribute( 'background-video-container', 'class', 'elementor-hidden-phone' );
217 180 }
218 181
219 182 ?><div <?php $this->print_render_attribute_string( 'background-video-container' ); ?>>
220 183 <?php if ( $video_properties ) : ?>
221 - <div class="elementor-background-video-embed" role="presentation"></div>
184 + <div class="elementor-background-video-embed"></div>
222 185 <?php
223 186 else :
224 187 $video_tag_attributes = 'autoplay muted playsinline';
225 188
@@ -226,9 +189,9 @@
226 189 if ( 'yes' !== $settings['background_play_once'] ) {
227 190 $video_tag_attributes .= ' loop';
228 191 }
229 192 ?>
230 - <video class="elementor-background-video-hosted" role="presentation" <?php echo esc_attr( $video_tag_attributes ); ?>></video>
193 + <video class="elementor-background-video-hosted elementor-html5-video" <?php echo esc_attr( $video_tag_attributes ); ?>></video>
231 194 <?php endif; ?>
232 195 </div><?php
233 196 }
234 197
@@ -241,9 +204,9 @@
241 204 * @param string $side - Shape divider side, used to set the shape key.
242 205 *
243 206 * @return void
244 207 */
245 - protected function render_shape_divider( $side ) {
208 + private function render_shape_divider( $side ) {
246 209 $settings = $this->get_active_settings();
247 210 $base_setting_key = "shape_divider_$side";
248 211 $negative = ! empty( $settings[ $base_setting_key . '_negative' ] );
249 212 $shape_path = Shapes::get_shape_path( $settings[ $base_setting_key ], $negative );
@@ -251,9 +214,9 @@
251 214 if ( ! is_file( $shape_path ) || ! is_readable( $shape_path ) ) {
252 215 return;
253 216 }
254 217 ?>
255 - <div class="elementor-shape elementor-shape-<?php echo esc_attr( $side ); ?>" aria-hidden="true" data-negative="<?php
218 + <div class="elementor-shape elementor-shape-<?php echo esc_attr( $side ); ?>" data-negative="<?php
256 219 Utils::print_unescaped_internal_string( $negative ? 'true' : 'false' );
257 220 ?>">
258 221 <?php
259 222 // PHPCS - The file content is being read from a strict file path structure.
@@ -267,9 +230,9 @@
267 230 * Print safe HTML tag for the element based on the element settings.
268 231 *
269 232 * @return void
270 233 */
271 - protected function print_html_tag() {
234 + private function print_html_tag() {
272 235 $html_tag = $this->get_settings( 'html_tag' );
273 236
274 237 if ( empty( $html_tag ) ) {
275 238 $html_tag = 'div';
@@ -321,9 +284,9 @@
321 284 </<?php $this->print_html_tag(); ?>>
322 285 <?php
323 286 }
324 287
325 - protected function is_boxed_container( array $settings ) {
288 + private function is_boxed_container( array $settings ) {
326 289 return ! empty( $settings['content_width'] ) && 'boxed' === $settings['content_width'];
327 290 }
328 291
329 292 /**
@@ -333,19 +296,71 @@
333 296 *
334 297 * @return \Elementor\Element_Base|\Elementor\Widget_Base|null
335 298 */
336 299 protected function _get_default_child_type( array $element_data ) {
337 - $el_types = array_keys( Plugin::$instance->elements_manager->get_element_types() );
300 + if ( 'container' === $element_data['elType'] ) {
301 + return Plugin::$instance->elements_manager->get_element_types( 'container' );
302 + }
338 303
339 - if ( in_array( $element_data['elType'], $el_types, true ) ) {
340 - return Plugin::$instance->elements_manager->get_element_types( $element_data['elType'] );
304 + return Plugin::$instance->widgets_manager->get_widget_types( $element_data['widgetType'] );
305 + }
306 +
307 + protected function get_flex_control_options( $is_container_grid_active ) {
308 + $flex_control_options = [
309 + 'name' => 'flex',
310 + 'selector' => '{{WRAPPER}}',
311 + 'fields_options' => [
312 + 'gap' => [
313 + 'label' => esc_html_x( 'Gap between elements', 'Flex Container Control', 'elementor' ),
314 + 'device_args' => [
315 + Breakpoints_Manager::BREAKPOINT_KEY_DESKTOP => [
316 + // Use the default gap from the kit as a placeholder.
317 + 'placeholder' => $this->active_kit->get_settings_for_display( 'space_between_widgets' ),
318 + ],
319 + ],
320 + ],
321 + ],
322 + ];
323 +
324 + if ( $is_container_grid_active ) {
325 + $flex_control_options['condition'] = [
326 + 'container_type' => 'flex',
327 + ];
341 328 }
342 329
343 - if ( ! isset( $element_data['widgetType'] ) ) {
344 - return null;
330 + return $flex_control_options;
331 + }
332 +
333 + protected function get_container_type_control_options( $is_container_grid_active ) {
334 + if ( $is_container_grid_active ) {
335 + return [
336 + 'label' => esc_html__( 'Container Layout', 'elementor' ),
337 + 'type' => Controls_Manager::SELECT,
338 + 'default' => 'flex',
339 + 'prefix_class' => 'e-',
340 + 'options' => [
341 + 'flex' => esc_html__( 'Flexbox', 'elementor' ),
342 + 'grid' => esc_html__( 'Grid', 'elementor' ),
343 + ],
344 + 'selectors' => [
345 + '{{WRAPPER}}' => '--display: {{VALUE}}',
346 + ],
347 + 'separator' => 'after',
348 + ];
345 349 }
346 350
347 - return Plugin::$instance->widgets_manager->get_widget_types( $element_data['widgetType'] );
351 + // TODO: This can be removed when the 'Container Grid Experiment' is merged.
352 + return [
353 + 'label' => esc_html__( 'Container Layout', 'elementor' ),
354 + 'type' => Controls_Manager::HIDDEN,
355 + 'render_type' => 'none',
356 + 'default' => 'flex',
357 + 'prefix_class' => 'e-',
358 + 'selectors' => [
359 + '{{WRAPPER}}' => '--display: {{VALUE}}',
360 + ],
361 + 'separator' => 'after',
362 + ];
348 363 }
349 364
350 365 /**
351 366 * Register the Container's layout controls.
@@ -368,25 +383,13 @@
368 383 } else {
369 384 $min_affected_device = Breakpoints_Manager::BREAKPOINT_KEY_TABLET;
370 385 }
371 386
387 + $is_container_grid_active = Plugin::$instance->experiments->is_feature_active( 'container_grid' );
388 +
372 389 $this->add_control(
373 390 '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 - ]
391 + $this->get_container_type_control_options( $is_container_grid_active )
389 392 );
390 393
391 394 $this->add_control(
392 395 'content_width',
@@ -399,9 +402,9 @@
399 402 'full' => esc_html__( 'Full Width', 'elementor' ),
400 403 ],
401 404 'render_type' => 'template',
402 405 'prefix_class' => 'e-con-',
403 - 'editor_available' => true,
406 + 'frontend_available' => true,
404 407 ]
405 408 );
406 409
407 410 $width_control_settings = [
@@ -412,8 +415,16 @@
412 415 'px' => [
413 416 'min' => 500,
414 417 'max' => 1600,
415 418 ],
419 + '%' => [
420 + 'min' => 0,
421 + 'max' => 100,
422 + ],
423 + 'vw' => [
424 + 'min' => 0,
425 + 'max' => 100,
426 + ],
416 427 ],
417 428 'default' => [
418 429 'unit' => '%',
419 430 ],
@@ -423,8 +434,9 @@
423 434 Breakpoints_Manager::BREAKPOINT_KEY_TABLET_EXTRA => $min_affected_device,
424 435 Breakpoints_Manager::BREAKPOINT_KEY_TABLET => $min_affected_device,
425 436 Breakpoints_Manager::BREAKPOINT_KEY_MOBILE_EXTRA => $min_affected_device,
426 437 ],
438 + 'separator' => 'none',
427 439 ];
428 440
429 441 $this->add_responsive_control(
430 442 'width',
@@ -488,13 +500,17 @@
488 500 'type' => Controls_Manager::SLIDER,
489 501 'size_units' => [ 'px', 'em', 'rem', 'vh', 'custom' ],
490 502 'range' => [
491 503 'px' => [
504 + 'min' => 0,
492 505 'max' => 1440,
493 506 ],
507 + 'vh' => [
508 + 'min' => 0,
509 + 'max' => 100,
510 + ],
494 511 ],
495 512 'description' => sprintf(
496 - /* translators: %s: 100vh. */
497 513 esc_html__( 'To achieve full height Container use %s.', 'elementor' ),
498 514 '100vh'
499 515 ),
500 516 'selectors' => [
@@ -504,38 +520,23 @@
504 520 );
505 521
506 522 $this->add_group_control(
507 523 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 - ]
524 + $this->get_flex_control_options( $is_container_grid_active )
526 525 );
527 526
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 - );
527 + if ( $is_container_grid_active ) {
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 + );
538 + }
538 539
539 540 $this->end_controls_section();
540 541 }
541 542
@@ -597,11 +598,11 @@
597 598
598 599 $this->add_control(
599 600 'link_note',
600 601 [
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' ),
602 + 'type' => Controls_Manager::RAW_HTML,
603 + 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning',
604 + 'raw' => esc_html__( 'Don’t add links to elements nested in this container - it will break the layout.', 'elementor' ),
604 605 'condition' => [
605 606 'html_tag' => 'a',
606 607 ],
607 608 ]
@@ -614,8 +615,9 @@
614 615 'type' => Controls_Manager::URL,
615 616 'dynamic' => [
616 617 'active' => true,
617 618 ],
619 + 'placeholder' => esc_html__( 'https://your-link.com', 'elementor' ),
618 620 'condition' => [
619 621 'html_tag' => 'a',
620 622 ],
621 623 ]
@@ -669,45 +671,14 @@
669 671 'fields_options' => [
670 672 'background' => [
671 673 'frontend_available' => true,
672 674 ],
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 - ],
675 + 'image' => [
676 + 'background_lazyload' => [
677 + 'active' => true,
678 + 'keys' => [ 'background_image', 'url' ],
694 679 ],
695 680 ],
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 681 ],
711 682 ]
712 683 );
713 684
@@ -733,25 +704,15 @@
733 704
734 705 $this->add_control(
735 706 'background_hover_transition',
736 707 [
737 - 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)',
708 + 'label' => esc_html__( 'Transition Duration', 'elementor' ),
738 709 'type' => Controls_Manager::SLIDER,
739 710 'default' => [
740 711 'size' => 0.3,
741 712 ],
742 - 'range' => [
743 - 'px' => [
744 - 'min' => 0,
745 - 'max' => 3,
746 - 'step' => 0.1,
747 - ],
748 - ],
749 713 'render_type' => 'ui',
750 714 'separator' => 'before',
751 - 'condition' => [
752 - 'background_hover_background' => [ 'classic', 'gradient' ],
753 - ],
754 715 'selectors' => [
755 716 '{{WRAPPER}}' => '--background-transition: {{SIZE}}s;',
756 717 ],
757 718 ]
@@ -803,8 +764,14 @@
803 764 // Hack to set the `::before` content in order to render it only when there is a background overlay.
804 765 $background_overlay_selector => '--background-overlay: \'\';',
805 766 ],
806 767 ],
768 + 'image' => [
769 + 'background_lazyload' => [
770 + 'active' => true,
771 + 'keys' => [ 'background_overlay_image', 'url' ],
772 + ],
773 + ],
807 774 ],
808 775 ]
809 776 );
810 777
@@ -944,16 +911,23 @@
944 911 ],
945 912 ]
946 913 );
947 914
915 + $this->add_group_control(
916 + Group_Control_Css_Filter::get_type(),
917 + [
918 + 'name' => 'css_filters_hover',
919 + 'selector' => '{{WRAPPER}}:hover::before',
920 + ]
921 + );
922 +
948 923 $this->add_control(
949 924 'background_overlay_hover_transition',
950 925 [
951 - 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)',
926 + 'label' => esc_html__( 'Transition Duration', 'elementor' ),
952 927 'type' => Controls_Manager::SLIDER,
953 928 'range' => [
954 929 'px' => [
955 - 'min' => 0,
956 930 'max' => 3,
957 931 'step' => 0.1,
958 932 ],
959 933 ],
@@ -958,11 +932,8 @@
958 932 ],
959 933 ],
960 934 'render_type' => 'ui',
961 935 'separator' => 'before',
962 - 'condition' => [
963 - 'background_overlay_hover_background' => [ 'classic', 'gradient' ],
964 - ],
965 936 'selectors' => [
966 937 '{{WRAPPER}}, {{WRAPPER}}::before' => '--overlay-transition: {{SIZE}}s;',
967 938 ],
968 939 ]
@@ -967,16 +938,8 @@
967 938 ],
968 939 ]
969 940 );
970 941
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 942 $this->end_controls_tab();
980 943
981 944 $this->end_controls_tabs();
982 945
@@ -1016,9 +979,9 @@
1016 979 'selector' => '{{WRAPPER}}',
1017 980 'fields_options' => [
1018 981 'width' => [
1019 982 '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}};',
983 + '{{SELECTOR}}' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; --border-width-top: {{TOP}}{{UNIT}}; --border-width-right: {{RIGHT}}{{UNIT}}; --border-width-bottom: {{BOTTOM}}{{UNIT}}; --border-width-left: {{LEFT}}{{UNIT}};',
1021 984 ],
1022 985 ],
1023 986 'color' => [
1024 987 'selectors' => [
@@ -1040,9 +1003,9 @@
1040 1003 'label' => esc_html__( 'Border Radius', 'elementor' ),
1041 1004 'type' => Controls_Manager::DIMENSIONS,
1042 1005 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
1043 1006 'selectors' => [
1044 - '{{WRAPPER}}' => '--border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1007 + '{{WRAPPER}}' => '--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}};',
1045 1008 ],
1046 1009 ]
1047 1010 );
1048 1011
@@ -1072,9 +1035,9 @@
1072 1035 'selector' => '{{WRAPPER}}:hover',
1073 1036 'fields_options' => [
1074 1037 'width' => [
1075 1038 '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}};',
1039 + '{{SELECTOR}}' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; --border-width-top: {{TOP}}{{UNIT}}; --border-width-right: {{RIGHT}}{{UNIT}}; --border-width-bottom: {{BOTTOM}}{{UNIT}}; --border-width-left: {{LEFT}}{{UNIT}};',
1077 1040 ],
1078 1041 ],
1079 1042 'color' => [
1080 1043 'selectors' => [
@@ -1107,9 +1070,9 @@
1107 1070
1108 1071 $this->add_control(
1109 1072 'border_hover_transition',
1110 1073 [
1111 - 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)',
1074 + 'label' => esc_html__( 'Transition Duration', 'elementor' ),
1112 1075 'type' => Controls_Manager::SLIDER,
1113 1076 'separator' => 'before',
1114 1077 'default' => [
1115 1078 'size' => 0.3,
@@ -1115,9 +1078,8 @@
1115 1078 'size' => 0.3,
1116 1079 ],
1117 1080 'range' => [
1118 1081 'px' => [
1119 - 'min' => 0,
1120 1082 'max' => 3,
1121 1083 'step' => 0.1,
1122 1084 ],
1123 1085 ],
@@ -1124,32 +1086,17 @@
1124 1086 'conditions' => [
1125 1087 'relation' => 'or',
1126 1088 'terms' => [
1127 1089 [
1128 - 'name' => 'border_hover_border',
1090 + 'name' => 'background_background',
1129 1091 'operator' => '!==',
1130 1092 'value' => '',
1131 1093 ],
1132 1094 [
1133 - 'name' => 'border_radius_hover[top]',
1095 + 'name' => 'border_border',
1134 1096 'operator' => '!==',
1135 1097 'value' => '',
1136 1098 ],
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 1099 ],
1153 1100 ],
1154 1101 'selectors' => [
1155 1102 '{{WRAPPER}}, {{WRAPPER}}::before' => '--border-transition: {{SIZE}}s;',
@@ -1180,8 +1127,16 @@
1180 1127 );
1181 1128
1182 1129 $this->start_controls_tabs( 'tabs_shape_dividers' );
1183 1130
1131 + $shapes_options = [
1132 + '' => esc_html__( 'None', 'elementor' ),
1133 + ];
1134 +
1135 + foreach ( Shapes::get_shapes() as $shape_name => $shape_props ) {
1136 + $shapes_options[ $shape_name ] = $shape_props['title'];
1137 + }
1138 +
1184 1139 foreach ( [
1185 1140 'top' => esc_html__( 'Top', 'elementor' ),
1186 1141 'bottom' => esc_html__( 'Bottom', 'elementor' ),
1187 1142 ] as $side => $side_label ) {
@@ -1197,30 +1152,12 @@
1197 1152 $this->add_control(
1198 1153 $base_control_key,
1199 1154 [
1200 1155 'label' => esc_html__( 'Type', 'elementor' ),
1201 - 'type' => Controls_Manager::VISUAL_CHOICE,
1202 - 'label_block' => true,
1203 - 'columns' => 2,
1204 - 'options' => Shapes::get_shapes(),
1156 + 'type' => Controls_Manager::SELECT,
1157 + 'options' => $shapes_options,
1205 1158 'render_type' => 'none',
1206 1159 '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 1160 ]
1224 1161 );
1225 1162
1226 1163 $this->add_control(
@@ -1241,9 +1178,8 @@
1241 1178 $base_control_key . '_width',
1242 1179 [
1243 1180 'label' => esc_html__( 'Width', 'elementor' ),
1244 1181 'type' => Controls_Manager::SLIDER,
1245 - 'size_units' => [ '%', 'vw', 'custom' ],
1246 1182 'default' => [
1247 1183 'unit' => '%',
1248 1184 ],
1249 1185 'tablet_default' => [
@@ -1256,12 +1192,8 @@
1256 1192 '%' => [
1257 1193 'min' => 100,
1258 1194 'max' => 300,
1259 1195 ],
1260 - 'vw' => [
1261 - 'min' => 100,
1262 - 'max' => 300,
1263 - ],
1264 1196 ],
1265 1197 'condition' => [
1266 1198 "shape_divider_$side" => array_keys( Shapes::filter_shapes( 'height_only', Shapes::FILTER_EXCLUDE ) ),
1267 1199 ],
@@ -1275,19 +1207,12 @@
1275 1207 $base_control_key . '_height',
1276 1208 [
1277 1209 'label' => esc_html__( 'Height', 'elementor' ),
1278 1210 'type' => Controls_Manager::SLIDER,
1279 - 'size_units' => [ 'px', 'em', 'rem', 'custom' ],
1280 1211 'range' => [
1281 1212 'px' => [
1282 1213 'max' => 500,
1283 1214 ],
1284 - 'em' => [
1285 - 'max' => 50,
1286 - ],
1287 - 'rem' => [
1288 - 'max' => 50,
1289 - ],
1290 1215 ],
1291 1216 'condition' => [
1292 1217 "shape_divider_$side!" => '',
1293 1218 ],
@@ -1380,9 +1305,9 @@
1380 1305 'label' => esc_html__( 'Margin', 'elementor' ),
1381 1306 'type' => Controls_Manager::DIMENSIONS,
1382 1307 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
1383 1308 'selectors' => [
1384 - '{{WRAPPER}}' => '--margin-top: {{TOP}}{{UNIT}}; --margin-bottom: {{BOTTOM}}{{UNIT}}; --margin-left: {{LEFT}}{{UNIT}}; --margin-right: {{RIGHT}}{{UNIT}};',
1309 + '{{WRAPPER}}' => '--margin-top: {{TOP}}{{UNIT}}; --margin-right: {{RIGHT}}{{UNIT}}; --margin-bottom: {{BOTTOM}}{{UNIT}}; --margin-left:{{LEFT}}{{UNIT}};',
1385 1310 ],
1386 1311 ]
1387 1312 );
1388 1313
@@ -1392,111 +1317,13 @@
1392 1317 'label' => esc_html__( 'Padding', 'elementor' ),
1393 1318 'type' => Controls_Manager::DIMENSIONS,
1394 1319 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
1395 1320 'selectors' => [
1396 - '{{WRAPPER}}' => '--padding-top: {{TOP}}{{UNIT}}; --padding-bottom: {{BOTTOM}}{{UNIT}}; --padding-left: {{LEFT}}{{UNIT}}; --padding-right: {{RIGHT}}{{UNIT}};',
1321 + '{{WRAPPER}}' => '--padding-top: {{TOP}}{{UNIT}}; --padding-right: {{RIGHT}}{{UNIT}}; --padding-bottom: {{BOTTOM}}{{UNIT}}; --padding-left: {{LEFT}}{{UNIT}};',
1397 1322 ],
1398 1323 ]
1399 1324 );
1400 1325
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 - '' => ' ' . esc_html__( 'Default', 'elementor' ),
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' => esc_html__( 'Custom', 'elementor' ),
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 - '' => ' ' . esc_html__( 'Default', 'elementor' ),
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' => esc_html__( 'Custom', 'elementor' ),
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 1326 $this->add_group_control(
1500 1327 Group_Control_Flex_Item::get_type(),
1501 1328 [
1502 1329 'name' => '_flex',
@@ -1515,12 +1342,11 @@
1515 1342
1516 1343 $this->add_control(
1517 1344 'position_description',
1518 1345 [
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' ),
1346 + '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' ),
1347 + 'type' => Controls_Manager::RAW_HTML,
1348 + 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning',
1523 1349 'render_type' => 'ui',
1524 1350 'condition' => [
1525 1351 'position!' => '',
1526 1352 ],
@@ -1586,8 +1412,9 @@
1586 1412 'range' => [
1587 1413 'px' => [
1588 1414 'min' => -1000,
1589 1415 'max' => 1000,
1416 + 'step' => 1,
1590 1417 ],
1591 1418 '%' => [
1592 1419 'min' => -200,
1593 1420 'max' => 200,
@@ -1601,9 +1428,9 @@
1601 1428 'max' => 200,
1602 1429 ],
1603 1430 ],
1604 1431 'default' => [
1605 - 'size' => 0,
1432 + 'size' => '0',
1606 1433 ],
1607 1434 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'vh', 'custom' ],
1608 1435 'selectors' => [
1609 1436 'body:not(.rtl) {{WRAPPER}}' => 'left: {{SIZE}}{{UNIT}}',
@@ -1624,8 +1451,9 @@
1624 1451 'range' => [
1625 1452 'px' => [
1626 1453 'min' => -1000,
1627 1454 'max' => 1000,
1455 + 'step' => 0.1,
1628 1456 ],
1629 1457 '%' => [
1630 1458 'min' => -200,
1631 1459 'max' => 200,
@@ -1639,9 +1467,9 @@
1639 1467 'max' => 200,
1640 1468 ],
1641 1469 ],
1642 1470 'default' => [
1643 - 'size' => 0,
1471 + 'size' => '0',
1644 1472 ],
1645 1473 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'vh', 'custom' ],
1646 1474 'selectors' => [
1647 1475 'body:not(.rtl) {{WRAPPER}}' => 'right: {{SIZE}}{{UNIT}}',
@@ -1686,8 +1514,9 @@
1686 1514 'range' => [
1687 1515 'px' => [
1688 1516 'min' => -1000,
1689 1517 'max' => 1000,
1518 + 'step' => 1,
1690 1519 ],
1691 1520 '%' => [
1692 1521 'min' => -200,
1693 1522 'max' => 200,
@@ -1702,9 +1531,9 @@
1702 1531 ],
1703 1532 ],
1704 1533 'size_units' => [ 'px', '%', 'em', 'rem', 'vh', 'vw', 'custom' ],
1705 1534 'default' => [
1706 - 'size' => 0,
1535 + 'size' => '0',
1707 1536 ],
1708 1537 'selectors' => [
1709 1538 '{{WRAPPER}}' => 'top: {{SIZE}}{{UNIT}}',
1710 1539 ],
@@ -1723,8 +1552,9 @@
1723 1552 'range' => [
1724 1553 'px' => [
1725 1554 'min' => -1000,
1726 1555 'max' => 1000,
1556 + 'step' => 1,
1727 1557 ],
1728 1558 '%' => [
1729 1559 'min' => -200,
1730 1560 'max' => 200,
@@ -1739,9 +1569,9 @@
1739 1569 ],
1740 1570 ],
1741 1571 'size_units' => [ 'px', '%', 'em', 'rem', 'vh', 'vw', 'custom' ],
1742 1572 'default' => [
1743 - 'size' => 0,
1573 + 'size' => '0',
1744 1574 ],
1745 1575 'selectors' => [
1746 1576 '{{WRAPPER}}' => 'bottom: {{SIZE}}{{UNIT}}',
1747 1577 ],
@@ -1799,10 +1629,8 @@
1799 1629 'classes' => 'elementor-control-direction-ltr',
1800 1630 ]
1801 1631 );
1802 1632
1803 - Plugin::$instance->controls_manager->add_display_conditions_controls( $this );
1804 -
1805 1633 $this->end_controls_section();
1806 1634 }
1807 1635
1808 1636 /**
@@ -1818,10 +1646,8 @@
1818 1646 'tab' => Controls_Manager::TAB_ADVANCED,
1819 1647 ]
1820 1648 );
1821 1649
1822 - Plugin::$instance->controls_manager->add_motion_effects_promotion_control( $this );
1823 -
1824 1650 $this->add_responsive_control(
1825 1651 'animation',
1826 1652 [
1827 1653 'label' => esc_html__( 'Entrance Animation', 'elementor' ),
@@ -1929,19 +1755,15 @@
1929 1755 Plugin::$instance->controls_manager->add_custom_css_controls( $this );
1930 1756 }
1931 1757
1932 1758 protected function hook_sticky_notice_into_transform_section() {
1933 - add_action( 'elementor/element/container/_section_transform/after_section_start', function( Container $container ) {
1934 - if ( ! empty( $container->get_controls( 'transform_sticky_notice' ) ) ) {
1935 - return;
1936 - }
1937 -
1759 + add_action( 'elementor/element/container/_section_transform/after_section_start', function( $container ) {
1938 1760 $container->add_control(
1939 1761 'transform_sticky_notice',
1940 1762 [
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' ),
1763 + 'type' => Controls_Manager::RAW_HTML,
1764 + 'raw' => esc_html__( 'Note: Avoid applying transform properties on sticky containers. Doing so might cause unexpected results.', 'elementor' ),
1765 + 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning',
1944 1766 ]
1945 1767 );
1946 1768 } );
1947 1769 }
@@ -1954,44 +1776,6 @@
1954 1776 protected function register_controls() {
1955 1777 $this->register_layout_tab();
1956 1778 $this->register_style_tab();
1957 1779 $this->register_advanced_tab();
1958 - }
1959 -
1960 - public function on_import( $element ) {
1961 - return self::slider_to_gaps_converter( $element );
1962 - }
1963 -
1964 - /**
1965 - * Convert slider to gaps control for the 3.16 upgrade script
1966 - *
1967 - * @param array $element
1968 - * @return array
1969 - */
1970 - public static function slider_to_gaps_converter( $element ) {
1971 - $breakpoints = array_keys( (array) Plugin::$instance->breakpoints->get_breakpoints() );
1972 - $breakpoints[] = 'desktop';
1973 - $control_name = 'flex_gap';
1974 -
1975 - foreach ( $breakpoints as $breakpoint ) {
1976 - $control = 'desktop' !== $breakpoint
1977 - ? $control_name . '_' . $breakpoint
1978 - : $control_name;
1979 -
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 ) {
1987 - $old_size = strval( $element['settings'][ $control ]['size'] );
1988 -
1989 - $element['settings'][ $control ]['column'] = $old_size;
1990 - $element['settings'][ $control ]['row'] = $old_size;
1991 - $element['settings'][ $control ]['isLinked'] = true;
1992 - }
1993 - }
1994 -
1995 - return $element;
1996 1780 }
1997 1781 }