| @@ -25,13 +25,11 @@ | ||
| 25 | 25 | /** |
| 26 | 26 | * @var \Elementor\Core\Kits\Documents\Kit |
| 27 | 27 | */ |
| 28 | 28 | private $active_kit; |
| 29 | + private $logical_dimensions_inline_start; | |
| 30 | + private $logical_dimensions_inline_end; | |
| 29 | 31 | |
| 30 | - protected function is_dynamic_content(): bool { | |
| 31 | - return false; | |
| 32 | - } | |
| 33 | - | |
| 34 | 32 | /** |
| 35 | 33 | * Container constructor. |
| 36 | 34 | * |
| 37 | 35 | * @param array $data |
| @@ -38,12 +36,14 @@ | ||
| 38 | 36 | * @param array|null $args |
| 39 | 37 | * |
| 40 | 38 | * @return void |
| 41 | 39 | */ |
| 42 | - public function __construct( array $data = [], ?array $args = null ) { | |
| 40 | + public function __construct( array $data = [], array $args = null ) { | |
| 43 | 41 | parent::__construct( $data, $args ); |
| 44 | 42 | |
| 45 | 43 | $this->active_kit = Plugin::$instance->kits_manager->get_active_kit(); |
| 44 | + $this->logical_dimensions_inline_start = is_rtl() ? '{{RIGHT}}{{UNIT}}' : '{{LEFT}}{{UNIT}}'; | |
| 45 | + $this->logical_dimensions_inline_end = is_rtl() ? '{{LEFT}}{{UNIT}}' : '{{RIGHT}}{{UNIT}}'; | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
| 49 | 49 | * Get the element type. |
| @@ -81,9 +81,15 @@ | ||
| 81 | 81 | return 'eicon-container'; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | public function get_keywords() { |
| 85 | - return [ 'Container', 'Flex', 'Flexbox', 'Flexbox Container', 'Grid', 'Grid Container', 'CSS Grid', 'Layout' ]; | |
| 85 | + $keywords = [ 'Container', 'Flex', 'Flexbox', 'Flexbox Container', 'Layout' ]; | |
| 86 | + | |
| 87 | + if ( Plugin::$instance->experiments->is_feature_active( 'container_grid' ) ) { | |
| 88 | + array_push( $keywords, 'Grid', 'Grid Container', 'CSS Grid' ); | |
| 89 | + } | |
| 90 | + | |
| 91 | + return $keywords; | |
| 86 | 92 | } |
| 87 | 93 | |
| 88 | 94 | public function get_panel_presets() { |
| 89 | 95 | return [ |
| @@ -125,8 +131,18 @@ | ||
| 125 | 131 | 'e-con', |
| 126 | 132 | $is_nested_class_name, |
| 127 | 133 | ], |
| 128 | 134 | ] ); |
| 135 | + | |
| 136 | + if ( $this->get_data( 'isInner' ) ) { | |
| 137 | + return; | |
| 138 | + } | |
| 139 | + | |
| 140 | + // Todo: Remove in version 3.21.0: https://elementor.atlassian.net/browse/ED-11884. | |
| 141 | + // Remove together with support for physical properties inside the Mega Menu & Nested Carousel widgets. | |
| 142 | + $this->add_render_attribute( '_wrapper', [ | |
| 143 | + 'data-core-v316-plus' => 'true', | |
| 144 | + ] ); | |
| 129 | 145 | } |
| 130 | 146 | |
| 131 | 147 | /** |
| 132 | 148 | * Override the initial element config to display the Container in the panel. |
| @@ -139,9 +155,8 @@ | ||
| 139 | 155 | $config['controls'] = $this->get_controls(); |
| 140 | 156 | $config['tabs_controls'] = $this->get_tabs_controls(); |
| 141 | 157 | $config['show_in_panel'] = true; |
| 142 | 158 | $config['categories'] = [ 'layout' ]; |
| 143 | - $config['include_in_widgets_config'] = true; | |
| 144 | 159 | |
| 145 | 160 | return $config; |
| 146 | 161 | } |
| 147 | 162 | |
| @@ -162,26 +177,21 @@ | ||
| 162 | 177 | if ( ! settings.background_play_once ) { |
| 163 | 178 | videoAttributes += ' loop'; |
| 164 | 179 | } |
| 165 | 180 | |
| 166 | - view.addRenderAttribute( | |
| 167 | - 'background-video-container', | |
| 168 | - { | |
| 169 | - 'class': 'elementor-background-video-container', | |
| 170 | - } | |
| 171 | - ); | |
| 181 | + view.addRenderAttribute( 'background-video-container', 'class', 'elementor-background-video-container' ); | |
| 172 | 182 | |
| 173 | 183 | if ( ! settings.background_play_on_mobile ) { |
| 174 | - view.addRenderAttribute( 'background-video-container', 'class', 'elementor-hidden-mobile' ); | |
| 184 | + view.addRenderAttribute( 'background-video-container', 'class', 'elementor-hidden-phone' ); | |
| 175 | 185 | } |
| 176 | 186 | #> |
| 177 | 187 | <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> | |
| 188 | + <div class="elementor-background-video-embed"></div> | |
| 189 | + <video class="elementor-background-video-hosted elementor-html5-video" {{ videoAttributes }}></video> | |
| 180 | 190 | </div> |
| 181 | 191 | <# } #> |
| 182 | - <div class="elementor-shape elementor-shape-top" aria-hidden="true"></div> | |
| 183 | - <div class="elementor-shape elementor-shape-bottom" aria-hidden="true"></div> | |
| 192 | + <div class="elementor-shape elementor-shape-top"></div> | |
| 193 | + <div class="elementor-shape elementor-shape-bottom"></div> | |
| 184 | 194 | <# if ( 'boxed' === settings.content_width ) { #> |
| 185 | 195 | </div> |
| 186 | 196 | <# } #> |
| 187 | 197 | <?php |
| @@ -204,22 +214,17 @@ | ||
| 204 | 214 | } |
| 205 | 215 | |
| 206 | 216 | $video_properties = Embed::get_video_properties( $settings['background_video_link'] ); |
| 207 | 217 | |
| 208 | - $this->add_render_attribute( | |
| 209 | - 'background-video-container', | |
| 210 | - [ | |
| 211 | - 'class' => 'elementor-background-video-container', | |
| 212 | - ] | |
| 213 | - ); | |
| 218 | + $this->add_render_attribute( 'background-video-container', 'class', 'elementor-background-video-container' ); | |
| 214 | 219 | |
| 215 | 220 | if ( ! $settings['background_play_on_mobile'] ) { |
| 216 | - $this->add_render_attribute( 'background-video-container', 'class', 'elementor-hidden-mobile' ); | |
| 221 | + $this->add_render_attribute( 'background-video-container', 'class', 'elementor-hidden-phone' ); | |
| 217 | 222 | } |
| 218 | 223 | |
| 219 | 224 | ?><div <?php $this->print_render_attribute_string( 'background-video-container' ); ?>> |
| 220 | 225 | <?php if ( $video_properties ) : ?> |
| 221 | - <div class="elementor-background-video-embed" role="presentation"></div> | |
| 226 | + <div class="elementor-background-video-embed"></div> | |
| 222 | 227 | <?php |
| 223 | 228 | else : |
| 224 | 229 | $video_tag_attributes = 'autoplay muted playsinline'; |
| 225 | 230 | |
| @@ -226,9 +231,9 @@ | ||
| 226 | 231 | if ( 'yes' !== $settings['background_play_once'] ) { |
| 227 | 232 | $video_tag_attributes .= ' loop'; |
| 228 | 233 | } |
| 229 | 234 | ?> |
| 230 | - <video class="elementor-background-video-hosted" role="presentation" <?php echo esc_attr( $video_tag_attributes ); ?>></video> | |
| 235 | + <video class="elementor-background-video-hosted elementor-html5-video" <?php echo esc_attr( $video_tag_attributes ); ?>></video> | |
| 231 | 236 | <?php endif; ?> |
| 232 | 237 | </div><?php |
| 233 | 238 | } |
| 234 | 239 | |
| @@ -251,9 +256,9 @@ | ||
| 251 | 256 | if ( ! is_file( $shape_path ) || ! is_readable( $shape_path ) ) { |
| 252 | 257 | return; |
| 253 | 258 | } |
| 254 | 259 | ?> |
| 255 | - <div class="elementor-shape elementor-shape-<?php echo esc_attr( $side ); ?>" aria-hidden="true" data-negative="<?php | |
| 260 | + <div class="elementor-shape elementor-shape-<?php echo esc_attr( $side ); ?>" data-negative="<?php | |
| 256 | 261 | Utils::print_unescaped_internal_string( $negative ? 'true' : 'false' ); |
| 257 | 262 | ?>"> |
| 258 | 263 | <?php |
| 259 | 264 | // PHPCS - The file content is being read from a strict file path structure. |
| @@ -333,19 +338,72 @@ | ||
| 333 | 338 | * |
| 334 | 339 | * @return \Elementor\Element_Base|\Elementor\Widget_Base|null |
| 335 | 340 | */ |
| 336 | 341 | protected function _get_default_child_type( array $element_data ) { |
| 337 | - $el_types = array_keys( Plugin::$instance->elements_manager->get_element_types() ); | |
| 342 | + if ( 'container' === $element_data['elType'] ) { | |
| 343 | + return Plugin::$instance->elements_manager->get_element_types( 'container' ); | |
| 344 | + } | |
| 338 | 345 | |
| 339 | - if ( in_array( $element_data['elType'], $el_types, true ) ) { | |
| 340 | - return Plugin::$instance->elements_manager->get_element_types( $element_data['elType'] ); | |
| 346 | + return Plugin::$instance->widgets_manager->get_widget_types( $element_data['widgetType'] ); | |
| 347 | + } | |
| 348 | + | |
| 349 | + protected function get_flex_control_options( $is_container_grid_active ) { | |
| 350 | + $flex_control_options = [ | |
| 351 | + 'name' => 'flex', | |
| 352 | + 'selector' => '{{WRAPPER}}', | |
| 353 | + 'fields_options' => [ | |
| 354 | + 'gap' => [ | |
| 355 | + 'label' => esc_html__( 'Gaps', 'elementor' ), | |
| 356 | + 'device_args' => [ | |
| 357 | + Breakpoints_Manager::BREAKPOINT_KEY_DESKTOP => [ | |
| 358 | + // Use the default gap from the kit as a placeholder. | |
| 359 | + 'placeholder' => $this->active_kit->get_settings_for_display( 'space_between_widgets' ), | |
| 360 | + ], | |
| 361 | + ], | |
| 362 | + ], | |
| 363 | + ], | |
| 364 | + ]; | |
| 365 | + | |
| 366 | + if ( $is_container_grid_active ) { | |
| 367 | + $flex_control_options['condition'] = [ | |
| 368 | + 'container_type' => 'flex', | |
| 369 | + ]; | |
| 341 | 370 | } |
| 342 | 371 | |
| 343 | - if ( ! isset( $element_data['widgetType'] ) ) { | |
| 344 | - return null; | |
| 372 | + return $flex_control_options; | |
| 373 | + } | |
| 374 | + | |
| 375 | + protected function get_container_type_control_options( $is_container_grid_active ) { | |
| 376 | + if ( $is_container_grid_active ) { | |
| 377 | + return [ | |
| 378 | + 'label' => esc_html__( 'Container Layout', 'elementor' ), | |
| 379 | + 'type' => Controls_Manager::SELECT, | |
| 380 | + 'default' => 'flex', | |
| 381 | + 'prefix_class' => 'e-', | |
| 382 | + 'options' => [ | |
| 383 | + 'flex' => esc_html__( 'Flexbox', 'elementor' ), | |
| 384 | + 'grid' => esc_html__( 'Grid', 'elementor' ), | |
| 385 | + ], | |
| 386 | + 'selectors' => [ | |
| 387 | + '{{WRAPPER}}' => '--display: {{VALUE}}', | |
| 388 | + ], | |
| 389 | + 'separator' => 'after', | |
| 390 | + 'editor_available' => true, | |
| 391 | + ]; | |
| 345 | 392 | } |
| 346 | 393 | |
| 347 | - return Plugin::$instance->widgets_manager->get_widget_types( $element_data['widgetType'] ); | |
| 394 | + // TODO: This can be removed when the 'Container Grid Experiment' is merged. | |
| 395 | + return [ | |
| 396 | + 'label' => esc_html__( 'Container Layout', 'elementor' ), | |
| 397 | + 'type' => Controls_Manager::HIDDEN, | |
| 398 | + 'render_type' => 'none', | |
| 399 | + 'default' => 'flex', | |
| 400 | + 'prefix_class' => 'e-', | |
| 401 | + 'selectors' => [ | |
| 402 | + '{{WRAPPER}}' => '--display: {{VALUE}}', | |
| 403 | + ], | |
| 404 | + 'separator' => 'after', | |
| 405 | + ]; | |
| 348 | 406 | } |
| 349 | 407 | |
| 350 | 408 | /** |
| 351 | 409 | * Register the Container's layout controls. |
| @@ -368,25 +426,13 @@ | ||
| 368 | 426 | } else { |
| 369 | 427 | $min_affected_device = Breakpoints_Manager::BREAKPOINT_KEY_TABLET; |
| 370 | 428 | } |
| 371 | 429 | |
| 430 | + $is_container_grid_active = Plugin::$instance->experiments->is_feature_active( 'container_grid' ); | |
| 431 | + | |
| 372 | 432 | $this->add_control( |
| 373 | 433 | '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 | - ] | |
| 434 | + $this->get_container_type_control_options( $is_container_grid_active ) | |
| 389 | 435 | ); |
| 390 | 436 | |
| 391 | 437 | $this->add_control( |
| 392 | 438 | 'content_width', |
| @@ -492,9 +538,8 @@ | ||
| 492 | 538 | 'max' => 1440, |
| 493 | 539 | ], |
| 494 | 540 | ], |
| 495 | 541 | 'description' => sprintf( |
| 496 | - /* translators: %s: 100vh. */ | |
| 497 | 542 | esc_html__( 'To achieve full height Container use %s.', 'elementor' ), |
| 498 | 543 | '100vh' |
| 499 | 544 | ), |
| 500 | 545 | 'selectors' => [ |
| @@ -504,38 +549,23 @@ | ||
| 504 | 549 | ); |
| 505 | 550 | |
| 506 | 551 | $this->add_group_control( |
| 507 | 552 | 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 | - ] | |
| 553 | + $this->get_flex_control_options( $is_container_grid_active ) | |
| 526 | 554 | ); |
| 527 | 555 | |
| 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 | - ); | |
| 556 | + if ( $is_container_grid_active ) { | |
| 557 | + $this->add_group_control( | |
| 558 | + Group_Control_Grid_Container::get_type(), | |
| 559 | + [ | |
| 560 | + 'name' => 'grid', | |
| 561 | + 'selector' => '{{WRAPPER}}', | |
| 562 | + 'condition' => [ | |
| 563 | + 'container_type' => [ 'grid' ], | |
| 564 | + ], | |
| 565 | + ] | |
| 566 | + ); | |
| 567 | + } | |
| 538 | 568 | |
| 539 | 569 | $this->end_controls_section(); |
| 540 | 570 | } |
| 541 | 571 | |
| @@ -669,45 +699,14 @@ | ||
| 669 | 699 | 'fields_options' => [ |
| 670 | 700 | 'background' => [ |
| 671 | 701 | 'frontend_available' => true, |
| 672 | 702 | ], |
| 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 | - ], | |
| 703 | + 'image' => [ | |
| 704 | + 'background_lazyload' => [ | |
| 705 | + 'active' => true, | |
| 706 | + 'keys' => [ 'background_image', 'url' ], | |
| 694 | 707 | ], |
| 695 | 708 | ], |
| 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 | 709 | ], |
| 711 | 710 | ] |
| 712 | 711 | ); |
| 713 | 712 | |
| @@ -747,11 +746,8 @@ | ||
| 747 | 746 | ], |
| 748 | 747 | ], |
| 749 | 748 | 'render_type' => 'ui', |
| 750 | 749 | 'separator' => 'before', |
| 751 | - 'condition' => [ | |
| 752 | - 'background_hover_background' => [ 'classic', 'gradient' ], | |
| 753 | - ], | |
| 754 | 750 | 'selectors' => [ |
| 755 | 751 | '{{WRAPPER}}' => '--background-transition: {{SIZE}}s;', |
| 756 | 752 | ], |
| 757 | 753 | ] |
| @@ -803,8 +799,14 @@ | ||
| 803 | 799 | // Hack to set the `::before` content in order to render it only when there is a background overlay. |
| 804 | 800 | $background_overlay_selector => '--background-overlay: \'\';', |
| 805 | 801 | ], |
| 806 | 802 | ], |
| 803 | + 'image' => [ | |
| 804 | + 'background_lazyload' => [ | |
| 805 | + 'active' => true, | |
| 806 | + 'keys' => [ 'background_overlay_image', 'url' ], | |
| 807 | + ], | |
| 808 | + ], | |
| 807 | 809 | ], |
| 808 | 810 | ] |
| 809 | 811 | ); |
| 810 | 812 | |
| @@ -944,8 +946,16 @@ | ||
| 944 | 946 | ], |
| 945 | 947 | ] |
| 946 | 948 | ); |
| 947 | 949 | |
| 950 | + $this->add_group_control( | |
| 951 | + Group_Control_Css_Filter::get_type(), | |
| 952 | + [ | |
| 953 | + 'name' => 'css_filters_hover', | |
| 954 | + 'selector' => '{{WRAPPER}}:hover::before', | |
| 955 | + ] | |
| 956 | + ); | |
| 957 | + | |
| 948 | 958 | $this->add_control( |
| 949 | 959 | 'background_overlay_hover_transition', |
| 950 | 960 | [ |
| 951 | 961 | 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)', |
| @@ -958,11 +968,8 @@ | ||
| 958 | 968 | ], |
| 959 | 969 | ], |
| 960 | 970 | 'render_type' => 'ui', |
| 961 | 971 | 'separator' => 'before', |
| 962 | - 'condition' => [ | |
| 963 | - 'background_overlay_hover_background' => [ 'classic', 'gradient' ], | |
| 964 | - ], | |
| 965 | 972 | 'selectors' => [ |
| 966 | 973 | '{{WRAPPER}}, {{WRAPPER}}::before' => '--overlay-transition: {{SIZE}}s;', |
| 967 | 974 | ], |
| 968 | 975 | ] |
| @@ -967,16 +974,8 @@ | ||
| 967 | 974 | ], |
| 968 | 975 | ] |
| 969 | 976 | ); |
| 970 | 977 | |
| 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 | 978 | $this->end_controls_tab(); |
| 980 | 979 | |
| 981 | 980 | $this->end_controls_tabs(); |
| 982 | 981 | |
| @@ -1016,9 +1015,9 @@ | ||
| 1016 | 1015 | 'selector' => '{{WRAPPER}}', |
| 1017 | 1016 | 'fields_options' => [ |
| 1018 | 1017 | 'width' => [ |
| 1019 | 1018 | '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}};', | |
| 1019 | + '{{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 | 1020 | ], |
| 1022 | 1021 | ], |
| 1023 | 1022 | 'color' => [ |
| 1024 | 1023 | 'selectors' => [ |
| @@ -1072,9 +1071,9 @@ | ||
| 1072 | 1071 | 'selector' => '{{WRAPPER}}:hover', |
| 1073 | 1072 | 'fields_options' => [ |
| 1074 | 1073 | 'width' => [ |
| 1075 | 1074 | '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}};', | |
| 1075 | + '{{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 | 1076 | ], |
| 1078 | 1077 | ], |
| 1079 | 1078 | 'color' => [ |
| 1080 | 1079 | 'selectors' => [ |
| @@ -1091,9 +1090,9 @@ | ||
| 1091 | 1090 | 'label' => esc_html__( 'Border Radius', 'elementor' ), |
| 1092 | 1091 | 'type' => Controls_Manager::DIMENSIONS, |
| 1093 | 1092 | 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], |
| 1094 | 1093 | '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}};', | |
| 1094 | + '{{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 | 1095 | ], |
| 1097 | 1096 | ] |
| 1098 | 1097 | ); |
| 1099 | 1098 | |
| @@ -1124,32 +1123,17 @@ | ||
| 1124 | 1123 | 'conditions' => [ |
| 1125 | 1124 | 'relation' => 'or', |
| 1126 | 1125 | 'terms' => [ |
| 1127 | 1126 | [ |
| 1128 | - 'name' => 'border_hover_border', | |
| 1127 | + 'name' => 'background_background', | |
| 1129 | 1128 | 'operator' => '!==', |
| 1130 | 1129 | 'value' => '', |
| 1131 | 1130 | ], |
| 1132 | 1131 | [ |
| 1133 | - 'name' => 'border_radius_hover[top]', | |
| 1132 | + 'name' => 'border_border', | |
| 1134 | 1133 | 'operator' => '!==', |
| 1135 | 1134 | 'value' => '', |
| 1136 | 1135 | ], |
| 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 | 1136 | ], |
| 1153 | 1137 | ], |
| 1154 | 1138 | 'selectors' => [ |
| 1155 | 1139 | '{{WRAPPER}}, {{WRAPPER}}::before' => '--border-transition: {{SIZE}}s;', |
| @@ -1180,8 +1164,16 @@ | ||
| 1180 | 1164 | ); |
| 1181 | 1165 | |
| 1182 | 1166 | $this->start_controls_tabs( 'tabs_shape_dividers' ); |
| 1183 | 1167 | |
| 1168 | + $shapes_options = [ | |
| 1169 | + '' => esc_html__( 'None', 'elementor' ), | |
| 1170 | + ]; | |
| 1171 | + | |
| 1172 | + foreach ( Shapes::get_shapes() as $shape_name => $shape_props ) { | |
| 1173 | + $shapes_options[ $shape_name ] = $shape_props['title']; | |
| 1174 | + } | |
| 1175 | + | |
| 1184 | 1176 | foreach ( [ |
| 1185 | 1177 | 'top' => esc_html__( 'Top', 'elementor' ), |
| 1186 | 1178 | 'bottom' => esc_html__( 'Bottom', 'elementor' ), |
| 1187 | 1179 | ] as $side => $side_label ) { |
| @@ -1197,30 +1189,12 @@ | ||
| 1197 | 1189 | $this->add_control( |
| 1198 | 1190 | $base_control_key, |
| 1199 | 1191 | [ |
| 1200 | 1192 | 'label' => esc_html__( 'Type', 'elementor' ), |
| 1201 | - 'type' => Controls_Manager::VISUAL_CHOICE, | |
| 1202 | - 'label_block' => true, | |
| 1203 | - 'columns' => 2, | |
| 1204 | - 'options' => Shapes::get_shapes(), | |
| 1193 | + 'type' => Controls_Manager::SELECT, | |
| 1194 | + 'options' => $shapes_options, | |
| 1205 | 1195 | 'render_type' => 'none', |
| 1206 | 1196 | '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 | 1197 | ] |
| 1224 | 1198 | ); |
| 1225 | 1199 | |
| 1226 | 1200 | $this->add_control( |
| @@ -1241,9 +1215,8 @@ | ||
| 1241 | 1215 | $base_control_key . '_width', |
| 1242 | 1216 | [ |
| 1243 | 1217 | 'label' => esc_html__( 'Width', 'elementor' ), |
| 1244 | 1218 | 'type' => Controls_Manager::SLIDER, |
| 1245 | - 'size_units' => [ '%', 'vw', 'custom' ], | |
| 1246 | 1219 | 'default' => [ |
| 1247 | 1220 | 'unit' => '%', |
| 1248 | 1221 | ], |
| 1249 | 1222 | 'tablet_default' => [ |
| @@ -1256,12 +1229,8 @@ | ||
| 1256 | 1229 | '%' => [ |
| 1257 | 1230 | 'min' => 100, |
| 1258 | 1231 | 'max' => 300, |
| 1259 | 1232 | ], |
| 1260 | - 'vw' => [ | |
| 1261 | - 'min' => 100, | |
| 1262 | - 'max' => 300, | |
| 1263 | - ], | |
| 1264 | 1233 | ], |
| 1265 | 1234 | 'condition' => [ |
| 1266 | 1235 | "shape_divider_$side" => array_keys( Shapes::filter_shapes( 'height_only', Shapes::FILTER_EXCLUDE ) ), |
| 1267 | 1236 | ], |
| @@ -1275,19 +1244,12 @@ | ||
| 1275 | 1244 | $base_control_key . '_height', |
| 1276 | 1245 | [ |
| 1277 | 1246 | 'label' => esc_html__( 'Height', 'elementor' ), |
| 1278 | 1247 | 'type' => Controls_Manager::SLIDER, |
| 1279 | - 'size_units' => [ 'px', 'em', 'rem', 'custom' ], | |
| 1280 | 1248 | 'range' => [ |
| 1281 | 1249 | 'px' => [ |
| 1282 | 1250 | 'max' => 500, |
| 1283 | 1251 | ], |
| 1284 | - 'em' => [ | |
| 1285 | - 'max' => 50, | |
| 1286 | - ], | |
| 1287 | - 'rem' => [ | |
| 1288 | - 'max' => 50, | |
| 1289 | - ], | |
| 1290 | 1252 | ], |
| 1291 | 1253 | 'condition' => [ |
| 1292 | 1254 | "shape_divider_$side!" => '', |
| 1293 | 1255 | ], |
| @@ -1380,9 +1342,9 @@ | ||
| 1380 | 1342 | 'label' => esc_html__( 'Margin', 'elementor' ), |
| 1381 | 1343 | 'type' => Controls_Manager::DIMENSIONS, |
| 1382 | 1344 | 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], |
| 1383 | 1345 | 'selectors' => [ |
| 1384 | - '{{WRAPPER}}' => '--margin-top: {{TOP}}{{UNIT}}; --margin-bottom: {{BOTTOM}}{{UNIT}}; --margin-left: {{LEFT}}{{UNIT}}; --margin-right: {{RIGHT}}{{UNIT}};', | |
| 1346 | + '{{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 | 1347 | ], |
| 1386 | 1348 | ] |
| 1387 | 1349 | ); |
| 1388 | 1350 | |
| @@ -1392,111 +1354,13 @@ | ||
| 1392 | 1354 | 'label' => esc_html__( 'Padding', 'elementor' ), |
| 1393 | 1355 | 'type' => Controls_Manager::DIMENSIONS, |
| 1394 | 1356 | 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], |
| 1395 | 1357 | 'selectors' => [ |
| 1396 | - '{{WRAPPER}}' => '--padding-top: {{TOP}}{{UNIT}}; --padding-bottom: {{BOTTOM}}{{UNIT}}; --padding-left: {{LEFT}}{{UNIT}}; --padding-right: {{RIGHT}}{{UNIT}};', | |
| 1358 | + '{{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 | 1359 | ], |
| 1398 | 1360 | ] |
| 1399 | 1361 | ); |
| 1400 | 1362 | |
| 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 | 1363 | $this->add_group_control( |
| 1500 | 1364 | Group_Control_Flex_Item::get_type(), |
| 1501 | 1365 | [ |
| 1502 | 1366 | 'name' => '_flex', |
| @@ -1961,11 +1825,11 @@ | ||
| 1961 | 1825 | return self::slider_to_gaps_converter( $element ); |
| 1962 | 1826 | } |
| 1963 | 1827 | |
| 1964 | 1828 | /** |
| 1965 | - * Convert slider to gaps control for the 3.16 upgrade script | |
| 1829 | + * convert slider to gaps control for the 3.16 upgrade script | |
| 1966 | 1830 | * |
| 1967 | - * @param array $element | |
| 1831 | + * @param $element | |
| 1968 | 1832 | * @return array |
| 1969 | 1833 | */ |
| 1970 | 1834 | public static function slider_to_gaps_converter( $element ) { |
| 1971 | 1835 | $breakpoints = array_keys( (array) Plugin::$instance->breakpoints->get_breakpoints() ); |
| @@ -1976,15 +1840,9 @@ | ||
| 1976 | 1840 | $control = 'desktop' !== $breakpoint |
| 1977 | 1841 | ? $control_name . '_' . $breakpoint |
| 1978 | 1842 | : $control_name; |
| 1979 | 1843 | |
| 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 ) { | |
| 1844 | + if ( isset( $element['settings'][ $control ] ) ) { | |
| 1987 | 1845 | $old_size = strval( $element['settings'][ $control ]['size'] ); |
| 1988 | 1846 | |
| 1989 | 1847 | $element['settings'][ $control ]['column'] = $old_size; |
| 1990 | 1848 | $element['settings'][ $control ]['row'] = $old_size; |