| @@ -10,9 +10,8 @@ | ||
| 10 | 10 | use Elementor\Group_Control_Box_Shadow; |
| 11 | 11 | use Elementor\Group_Control_Css_Filter; |
| 12 | 12 | use Elementor\Group_Control_Flex_Container; |
| 13 | 13 | use Elementor\Group_Control_Flex_Item; |
| 14 | -use Elementor\Group_Control_Grid_Container; | |
| 15 | 14 | use Elementor\Plugin; |
| 16 | 15 | use Elementor\Shapes; |
| 17 | 16 | use Elementor\Utils; |
| 18 | 17 | |
| @@ -26,12 +25,8 @@ | ||
| 26 | 25 | * @var \Elementor\Core\Kits\Documents\Kit |
| 27 | 26 | */ |
| 28 | 27 | private $active_kit; |
| 29 | 28 | |
| 30 | - protected function is_dynamic_content(): bool { | |
| 31 | - return false; | |
| 32 | - } | |
| 33 | - | |
| 34 | 29 | /** |
| 35 | 30 | * Container constructor. |
| 36 | 31 | * |
| 37 | 32 | * @param array $data |
| @@ -38,9 +33,9 @@ | ||
| 38 | 33 | * @param array|null $args |
| 39 | 34 | * |
| 40 | 35 | * @return void |
| 41 | 36 | */ |
| 42 | - public function __construct( array $data = [], ?array $args = null ) { | |
| 37 | + public function __construct( array $data = [], array $args = null ) { | |
| 43 | 38 | parent::__construct( $data, $args ); |
| 44 | 39 | |
| 45 | 40 | $this->active_kit = Plugin::$instance->kits_manager->get_active_kit(); |
| 46 | 41 | } |
| @@ -80,37 +75,8 @@ | ||
| 80 | 75 | public function get_icon() { |
| 81 | 76 | return 'eicon-container'; |
| 82 | 77 | } |
| 83 | 78 | |
| 84 | - public function get_keywords() { | |
| 85 | - return [ 'Container', 'Flex', 'Flexbox', 'Flexbox Container', 'Grid', 'Grid Container', 'CSS Grid', 'Layout' ]; | |
| 86 | - } | |
| 87 | - | |
| 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 | - ]; | |
| 111 | - } | |
| 112 | - | |
| 113 | 79 | /** |
| 114 | 80 | * Override the render attributes to add a custom wrapper class. |
| 115 | 81 | * |
| 116 | 82 | * @return void |
| @@ -117,14 +83,11 @@ | ||
| 117 | 83 | */ |
| 118 | 84 | protected function add_render_attributes() { |
| 119 | 85 | parent::add_render_attributes(); |
| 120 | 86 | |
| 121 | - $is_nested_class_name = $this->get_data( 'isInner' ) ? 'e-child' : 'e-parent'; | |
| 122 | - | |
| 123 | 87 | $this->add_render_attribute( '_wrapper', [ |
| 124 | 88 | 'class' => [ |
| 125 | 89 | 'e-con', |
| 126 | - $is_nested_class_name, | |
| 127 | 90 | ], |
| 128 | 91 | ] ); |
| 129 | 92 | } |
| 130 | 93 | |
| @@ -139,9 +102,8 @@ | ||
| 139 | 102 | $config['controls'] = $this->get_controls(); |
| 140 | 103 | $config['tabs_controls'] = $this->get_tabs_controls(); |
| 141 | 104 | $config['show_in_panel'] = true; |
| 142 | 105 | $config['categories'] = [ 'layout' ]; |
| 143 | - $config['include_in_widgets_config'] = true; | |
| 144 | 106 | |
| 145 | 107 | return $config; |
| 146 | 108 | } |
| 147 | 109 | |
| @@ -162,26 +124,21 @@ | ||
| 162 | 124 | if ( ! settings.background_play_once ) { |
| 163 | 125 | videoAttributes += ' loop'; |
| 164 | 126 | } |
| 165 | 127 | |
| 166 | - view.addRenderAttribute( | |
| 167 | - 'background-video-container', | |
| 168 | - { | |
| 169 | - 'class': 'elementor-background-video-container', | |
| 170 | - } | |
| 171 | - ); | |
| 128 | + view.addRenderAttribute( 'background-video-container', 'class', 'elementor-background-video-container' ); | |
| 172 | 129 | |
| 173 | 130 | if ( ! settings.background_play_on_mobile ) { |
| 174 | - view.addRenderAttribute( 'background-video-container', 'class', 'elementor-hidden-mobile' ); | |
| 131 | + view.addRenderAttribute( 'background-video-container', 'class', 'elementor-hidden-phone' ); | |
| 175 | 132 | } |
| 176 | 133 | #> |
| 177 | 134 | <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> | |
| 135 | + <div class="elementor-background-video-embed"></div> | |
| 136 | + <video class="elementor-background-video-hosted elementor-html5-video" {{ videoAttributes }}></video> | |
| 180 | 137 | </div> |
| 181 | 138 | <# } #> |
| 182 | - <div class="elementor-shape elementor-shape-top" aria-hidden="true"></div> | |
| 183 | - <div class="elementor-shape elementor-shape-bottom" aria-hidden="true"></div> | |
| 139 | + <div class="elementor-shape elementor-shape-top"></div> | |
| 140 | + <div class="elementor-shape elementor-shape-bottom"></div> | |
| 184 | 141 | <# if ( 'boxed' === settings.content_width ) { #> |
| 185 | 142 | </div> |
| 186 | 143 | <# } #> |
| 187 | 144 | <?php |
| @@ -191,9 +148,9 @@ | ||
| 191 | 148 | * Render the video background markup. |
| 192 | 149 | * |
| 193 | 150 | * @return void |
| 194 | 151 | */ |
| 195 | - protected function render_video_background() { | |
| 152 | + private function render_video_background() { | |
| 196 | 153 | $settings = $this->get_settings_for_display(); |
| 197 | 154 | |
| 198 | 155 | if ( 'video' !== $settings['background_background'] ) { |
| 199 | 156 | return; |
| @@ -204,22 +161,17 @@ | ||
| 204 | 161 | } |
| 205 | 162 | |
| 206 | 163 | $video_properties = Embed::get_video_properties( $settings['background_video_link'] ); |
| 207 | 164 | |
| 208 | - $this->add_render_attribute( | |
| 209 | - 'background-video-container', | |
| 210 | - [ | |
| 211 | - 'class' => 'elementor-background-video-container', | |
| 212 | - ] | |
| 213 | - ); | |
| 165 | + $this->add_render_attribute( 'background-video-container', 'class', 'elementor-background-video-container' ); | |
| 214 | 166 | |
| 215 | 167 | if ( ! $settings['background_play_on_mobile'] ) { |
| 216 | - $this->add_render_attribute( 'background-video-container', 'class', 'elementor-hidden-mobile' ); | |
| 168 | + $this->add_render_attribute( 'background-video-container', 'class', 'elementor-hidden-phone' ); | |
| 217 | 169 | } |
| 218 | 170 | |
| 219 | 171 | ?><div <?php $this->print_render_attribute_string( 'background-video-container' ); ?>> |
| 220 | 172 | <?php if ( $video_properties ) : ?> |
| 221 | - <div class="elementor-background-video-embed" role="presentation"></div> | |
| 173 | + <div class="elementor-background-video-embed"></div> | |
| 222 | 174 | <?php |
| 223 | 175 | else : |
| 224 | 176 | $video_tag_attributes = 'autoplay muted playsinline'; |
| 225 | 177 | |
| @@ -226,9 +178,9 @@ | ||
| 226 | 178 | if ( 'yes' !== $settings['background_play_once'] ) { |
| 227 | 179 | $video_tag_attributes .= ' loop'; |
| 228 | 180 | } |
| 229 | 181 | ?> |
| 230 | - <video class="elementor-background-video-hosted" role="presentation" <?php echo esc_attr( $video_tag_attributes ); ?>></video> | |
| 182 | + <video class="elementor-background-video-hosted elementor-html5-video" <?php echo esc_attr( $video_tag_attributes ); ?>></video> | |
| 231 | 183 | <?php endif; ?> |
| 232 | 184 | </div><?php |
| 233 | 185 | } |
| 234 | 186 | |
| @@ -241,9 +193,9 @@ | ||
| 241 | 193 | * @param string $side - Shape divider side, used to set the shape key. |
| 242 | 194 | * |
| 243 | 195 | * @return void |
| 244 | 196 | */ |
| 245 | - protected function render_shape_divider( $side ) { | |
| 197 | + private function render_shape_divider( $side ) { | |
| 246 | 198 | $settings = $this->get_active_settings(); |
| 247 | 199 | $base_setting_key = "shape_divider_$side"; |
| 248 | 200 | $negative = ! empty( $settings[ $base_setting_key . '_negative' ] ); |
| 249 | 201 | $shape_path = Shapes::get_shape_path( $settings[ $base_setting_key ], $negative ); |
| @@ -251,9 +203,9 @@ | ||
| 251 | 203 | if ( ! is_file( $shape_path ) || ! is_readable( $shape_path ) ) { |
| 252 | 204 | return; |
| 253 | 205 | } |
| 254 | 206 | ?> |
| 255 | - <div class="elementor-shape elementor-shape-<?php echo esc_attr( $side ); ?>" aria-hidden="true" data-negative="<?php | |
| 207 | + <div class="elementor-shape elementor-shape-<?php echo esc_attr( $side ); ?>" data-negative="<?php | |
| 256 | 208 | Utils::print_unescaped_internal_string( $negative ? 'true' : 'false' ); |
| 257 | 209 | ?>"> |
| 258 | 210 | <?php |
| 259 | 211 | // PHPCS - The file content is being read from a strict file path structure. |
| @@ -267,9 +219,9 @@ | ||
| 267 | 219 | * Print safe HTML tag for the element based on the element settings. |
| 268 | 220 | * |
| 269 | 221 | * @return void |
| 270 | 222 | */ |
| 271 | - protected function print_html_tag() { | |
| 223 | + private function print_html_tag() { | |
| 272 | 224 | $html_tag = $this->get_settings( 'html_tag' ); |
| 273 | 225 | |
| 274 | 226 | if ( empty( $html_tag ) ) { |
| 275 | 227 | $html_tag = 'div'; |
| @@ -321,9 +273,9 @@ | ||
| 321 | 273 | </<?php $this->print_html_tag(); ?>> |
| 322 | 274 | <?php |
| 323 | 275 | } |
| 324 | 276 | |
| 325 | - protected function is_boxed_container( array $settings ) { | |
| 277 | + private function is_boxed_container( array $settings ) { | |
| 326 | 278 | return ! empty( $settings['content_width'] ) && 'boxed' === $settings['content_width']; |
| 327 | 279 | } |
| 328 | 280 | |
| 329 | 281 | /** |
| @@ -333,18 +285,12 @@ | ||
| 333 | 285 | * |
| 334 | 286 | * @return \Elementor\Element_Base|\Elementor\Widget_Base|null |
| 335 | 287 | */ |
| 336 | 288 | protected function _get_default_child_type( array $element_data ) { |
| 337 | - $el_types = array_keys( Plugin::$instance->elements_manager->get_element_types() ); | |
| 338 | - | |
| 339 | - if ( in_array( $element_data['elType'], $el_types, true ) ) { | |
| 340 | - return Plugin::$instance->elements_manager->get_element_types( $element_data['elType'] ); | |
| 289 | + if ( 'container' === $element_data['elType'] ) { | |
| 290 | + return Plugin::$instance->elements_manager->get_element_types( 'container' ); | |
| 341 | 291 | } |
| 342 | 292 | |
| 343 | - if ( ! isset( $element_data['widgetType'] ) ) { | |
| 344 | - return null; | |
| 345 | - } | |
| 346 | - | |
| 347 | 293 | return Plugin::$instance->widgets_manager->get_widget_types( $element_data['widgetType'] ); |
| 348 | 294 | } |
| 349 | 295 | |
| 350 | 296 | /** |
| @@ -369,27 +315,8 @@ | ||
| 369 | 315 | $min_affected_device = Breakpoints_Manager::BREAKPOINT_KEY_TABLET; |
| 370 | 316 | } |
| 371 | 317 | |
| 372 | 318 | $this->add_control( |
| 373 | - '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 | - ] | |
| 389 | - ); | |
| 390 | - | |
| 391 | - $this->add_control( | |
| 392 | 319 | 'content_width', |
| 393 | 320 | [ |
| 394 | 321 | 'label' => esc_html__( 'Content Width', 'elementor' ), |
| 395 | 322 | 'type' => Controls_Manager::SELECT, |
| @@ -399,9 +326,9 @@ | ||
| 399 | 326 | 'full' => esc_html__( 'Full Width', 'elementor' ), |
| 400 | 327 | ], |
| 401 | 328 | 'render_type' => 'template', |
| 402 | 329 | 'prefix_class' => 'e-con-', |
| 403 | - 'editor_available' => true, | |
| 330 | + 'frontend_available' => true, | |
| 404 | 331 | ] |
| 405 | 332 | ); |
| 406 | 333 | |
| 407 | 334 | $width_control_settings = [ |
| @@ -406,14 +333,22 @@ | ||
| 406 | 333 | |
| 407 | 334 | $width_control_settings = [ |
| 408 | 335 | 'label' => esc_html__( 'Width', 'elementor' ), |
| 409 | 336 | 'type' => Controls_Manager::SLIDER, |
| 410 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], | |
| 337 | + 'size_units' => [ 'px', '%', 'vw' ], | |
| 411 | 338 | 'range' => [ |
| 412 | 339 | 'px' => [ |
| 413 | 340 | 'min' => 500, |
| 414 | 341 | 'max' => 1600, |
| 415 | 342 | ], |
| 343 | + '%' => [ | |
| 344 | + 'min' => 0, | |
| 345 | + 'max' => 100, | |
| 346 | + ], | |
| 347 | + 'vw' => [ | |
| 348 | + 'min' => 0, | |
| 349 | + 'max' => 100, | |
| 350 | + ], | |
| 416 | 351 | ], |
| 417 | 352 | 'default' => [ |
| 418 | 353 | 'unit' => '%', |
| 419 | 354 | ], |
| @@ -423,8 +358,9 @@ | ||
| 423 | 358 | Breakpoints_Manager::BREAKPOINT_KEY_TABLET_EXTRA => $min_affected_device, |
| 424 | 359 | Breakpoints_Manager::BREAKPOINT_KEY_TABLET => $min_affected_device, |
| 425 | 360 | Breakpoints_Manager::BREAKPOINT_KEY_MOBILE_EXTRA => $min_affected_device, |
| 426 | 361 | ], |
| 362 | + 'separator' => 'none', | |
| 427 | 363 | ]; |
| 428 | 364 | |
| 429 | 365 | $this->add_responsive_control( |
| 430 | 366 | 'width', |
| @@ -485,16 +421,20 @@ | ||
| 485 | 421 | 'min_height', |
| 486 | 422 | [ |
| 487 | 423 | 'label' => esc_html__( 'Min Height', 'elementor' ), |
| 488 | 424 | 'type' => Controls_Manager::SLIDER, |
| 489 | - 'size_units' => [ 'px', 'em', 'rem', 'vh', 'custom' ], | |
| 425 | + 'size_units' => [ 'px', 'vh' ], | |
| 490 | 426 | 'range' => [ |
| 491 | 427 | 'px' => [ |
| 428 | + 'min' => 0, | |
| 492 | 429 | 'max' => 1440, |
| 493 | 430 | ], |
| 431 | + 'vh' => [ | |
| 432 | + 'min' => 0, | |
| 433 | + 'max' => 100, | |
| 434 | + ], | |
| 494 | 435 | ], |
| 495 | 436 | 'description' => sprintf( |
| 496 | - /* translators: %s: 100vh. */ | |
| 497 | 437 | esc_html__( 'To achieve full height Container use %s.', 'elementor' ), |
| 498 | 438 | '100vh' |
| 499 | 439 | ), |
| 500 | 440 | 'selectors' => [ |
| @@ -509,9 +449,9 @@ | ||
| 509 | 449 | 'name' => 'flex', |
| 510 | 450 | 'selector' => '{{WRAPPER}}', |
| 511 | 451 | 'fields_options' => [ |
| 512 | 452 | 'gap' => [ |
| 513 | - 'label' => esc_html__( 'Gaps', 'elementor' ), | |
| 453 | + 'label' => esc_html_x( 'Gap between elements', 'Flex Container Control', 'elementor' ), | |
| 514 | 454 | 'device_args' => [ |
| 515 | 455 | Breakpoints_Manager::BREAKPOINT_KEY_DESKTOP => [ |
| 516 | 456 | // Use the default gap from the kit as a placeholder. |
| 517 | 457 | 'placeholder' => $this->active_kit->get_settings_for_display( 'space_between_widgets' ), |
| @@ -518,25 +458,11 @@ | ||
| 518 | 458 | ], |
| 519 | 459 | ], |
| 520 | 460 | ], |
| 521 | 461 | ], |
| 522 | - 'condition' => [ | |
| 523 | - 'container_type' => [ 'flex' ], | |
| 524 | - ], | |
| 525 | 462 | ] |
| 526 | 463 | ); |
| 527 | 464 | |
| 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 | - | |
| 539 | 465 | $this->end_controls_section(); |
| 540 | 466 | } |
| 541 | 467 | |
| 542 | 468 | /** |
| @@ -597,11 +523,11 @@ | ||
| 597 | 523 | |
| 598 | 524 | $this->add_control( |
| 599 | 525 | 'link_note', |
| 600 | 526 | [ |
| 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' ), | |
| 527 | + 'type' => Controls_Manager::RAW_HTML, | |
| 528 | + 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning', | |
| 529 | + 'raw' => esc_html__( 'Don’t add links to elements nested in this container - it will break the layout.', 'elementor' ), | |
| 604 | 530 | 'condition' => [ |
| 605 | 531 | 'html_tag' => 'a', |
| 606 | 532 | ], |
| 607 | 533 | ] |
| @@ -614,8 +540,9 @@ | ||
| 614 | 540 | 'type' => Controls_Manager::URL, |
| 615 | 541 | 'dynamic' => [ |
| 616 | 542 | 'active' => true, |
| 617 | 543 | ], |
| 544 | + 'placeholder' => esc_html__( 'https://your-link.com', 'elementor' ), | |
| 618 | 545 | 'condition' => [ |
| 619 | 546 | 'html_tag' => 'a', |
| 620 | 547 | ], |
| 621 | 548 | ] |
| @@ -673,45 +600,8 @@ | ||
| 673 | 600 | ], |
| 674 | 601 | ] |
| 675 | 602 | ); |
| 676 | 603 | |
| 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 | - ], | |
| 694 | - ], | |
| 695 | - ], | |
| 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 | - ], | |
| 711 | - ] | |
| 712 | - ); | |
| 713 | - | |
| 714 | 604 | $this->end_controls_tab(); |
| 715 | 605 | |
| 716 | 606 | /** |
| 717 | 607 | * Hover. |
| @@ -733,9 +623,9 @@ | ||
| 733 | 623 | |
| 734 | 624 | $this->add_control( |
| 735 | 625 | 'background_hover_transition', |
| 736 | 626 | [ |
| 737 | - 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)', | |
| 627 | + 'label' => esc_html__( 'Transition Duration', 'elementor' ), | |
| 738 | 628 | 'type' => Controls_Manager::SLIDER, |
| 739 | 629 | 'default' => [ |
| 740 | 630 | 'size' => 0.3, |
| 741 | 631 | ], |
| @@ -740,9 +630,8 @@ | ||
| 740 | 630 | 'size' => 0.3, |
| 741 | 631 | ], |
| 742 | 632 | 'range' => [ |
| 743 | 633 | 'px' => [ |
| 744 | - 'min' => 0, | |
| 745 | 634 | 'max' => 3, |
| 746 | 635 | 'step' => 0.1, |
| 747 | 636 | ], |
| 748 | 637 | ], |
| @@ -747,14 +636,8 @@ | ||
| 747 | 636 | ], |
| 748 | 637 | ], |
| 749 | 638 | 'render_type' => 'ui', |
| 750 | 639 | 'separator' => 'before', |
| 751 | - 'condition' => [ | |
| 752 | - 'background_hover_background' => [ 'classic', 'gradient' ], | |
| 753 | - ], | |
| 754 | - 'selectors' => [ | |
| 755 | - '{{WRAPPER}}' => '--background-transition: {{SIZE}}s;', | |
| 756 | - ], | |
| 757 | 640 | ] |
| 758 | 641 | ); |
| 759 | 642 | |
| 760 | 643 | $this->end_controls_tab(); |
| @@ -789,9 +672,9 @@ | ||
| 789 | 672 | 'label' => esc_html__( 'Normal', 'elementor' ), |
| 790 | 673 | ] |
| 791 | 674 | ); |
| 792 | 675 | |
| 793 | - $background_overlay_selector = '{{WRAPPER}}::before, {{WRAPPER}} > .elementor-background-video-container::before, {{WRAPPER}} > .e-con-inner > .elementor-background-video-container::before, {{WRAPPER}} > .elementor-background-slideshow::before, {{WRAPPER}} > .e-con-inner > .elementor-background-slideshow::before, {{WRAPPER}} > .elementor-motion-effects-container > .elementor-motion-effects-layer::before'; | |
| 676 | + $background_overlay_selector = '{{WRAPPER}}::before, {{WRAPPER}} > .elementor-background-video-container::before, {{WRAPPER}} > .e-con-inner > .elementor-background-video-container::before, {{WRAPPER}} > .elementor-background-slideshow::before, {{WRAPPER}} > .e-con-inner > .elementor-background-slideshow::before'; | |
| 794 | 677 | |
| 795 | 678 | $this->add_group_control( |
| 796 | 679 | Group_Control_Background::get_type(), |
| 797 | 680 | [ |
| @@ -807,9 +690,9 @@ | ||
| 807 | 690 | ], |
| 808 | 691 | ] |
| 809 | 692 | ); |
| 810 | 693 | |
| 811 | - $this->add_responsive_control( | |
| 694 | + $this->add_control( | |
| 812 | 695 | 'background_overlay_opacity', |
| 813 | 696 | [ |
| 814 | 697 | 'label' => esc_html__( 'Opacity', 'elementor' ), |
| 815 | 698 | 'type' => Controls_Manager::SLIDER, |
| @@ -921,9 +804,9 @@ | ||
| 921 | 804 | ], |
| 922 | 805 | ] |
| 923 | 806 | ); |
| 924 | 807 | |
| 925 | - $this->add_responsive_control( | |
| 808 | + $this->add_control( | |
| 926 | 809 | 'background_overlay_hover_opacity', |
| 927 | 810 | [ |
| 928 | 811 | 'label' => esc_html__( 'Opacity', 'elementor' ), |
| 929 | 812 | 'type' => Controls_Manager::SLIDER, |
| @@ -944,16 +827,23 @@ | ||
| 944 | 827 | ], |
| 945 | 828 | ] |
| 946 | 829 | ); |
| 947 | 830 | |
| 831 | + $this->add_group_control( | |
| 832 | + Group_Control_Css_Filter::get_type(), | |
| 833 | + [ | |
| 834 | + 'name' => 'css_filters_hover', | |
| 835 | + 'selector' => '{{WRAPPER}}:hover::before', | |
| 836 | + ] | |
| 837 | + ); | |
| 838 | + | |
| 948 | 839 | $this->add_control( |
| 949 | 840 | 'background_overlay_hover_transition', |
| 950 | 841 | [ |
| 951 | - 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)', | |
| 842 | + 'label' => esc_html__( 'Transition Duration', 'elementor' ), | |
| 952 | 843 | 'type' => Controls_Manager::SLIDER, |
| 953 | 844 | 'range' => [ |
| 954 | 845 | 'px' => [ |
| 955 | - 'min' => 0, | |
| 956 | 846 | 'max' => 3, |
| 957 | 847 | 'step' => 0.1, |
| 958 | 848 | ], |
| 959 | 849 | ], |
| @@ -958,25 +848,14 @@ | ||
| 958 | 848 | ], |
| 959 | 849 | ], |
| 960 | 850 | 'render_type' => 'ui', |
| 961 | 851 | 'separator' => 'before', |
| 962 | - 'condition' => [ | |
| 963 | - 'background_overlay_hover_background' => [ 'classic', 'gradient' ], | |
| 964 | - ], | |
| 965 | 852 | 'selectors' => [ |
| 966 | - '{{WRAPPER}}, {{WRAPPER}}::before' => '--overlay-transition: {{SIZE}}s;', | |
| 853 | + '{{WRAPPER}}' => '--overlay-transition: {{SIZE}}s;', | |
| 967 | 854 | ], |
| 968 | 855 | ] |
| 969 | 856 | ); |
| 970 | 857 | |
| 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 | 858 | $this->end_controls_tab(); |
| 980 | 859 | |
| 981 | 860 | $this->end_controls_tabs(); |
| 982 | 861 | |
| @@ -1012,26 +891,8 @@ | ||
| 1012 | 891 | $this->add_group_control( |
| 1013 | 892 | Group_Control_Border::get_type(), |
| 1014 | 893 | [ |
| 1015 | 894 | 'name' => 'border', |
| 1016 | - 'selector' => '{{WRAPPER}}', | |
| 1017 | - 'fields_options' => [ | |
| 1018 | - 'width' => [ | |
| 1019 | - '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}};', | |
| 1021 | - ], | |
| 1022 | - ], | |
| 1023 | - 'color' => [ | |
| 1024 | - 'selectors' => [ | |
| 1025 | - '{{SELECTOR}}' => 'border-color: {{VALUE}}; --border-color: {{VALUE}};', | |
| 1026 | - ], | |
| 1027 | - ], | |
| 1028 | - 'border' => [ | |
| 1029 | - 'selectors' => [ | |
| 1030 | - '{{SELECTOR}}' => 'border-style: {{VALUE}}; --border-style: {{VALUE}};', | |
| 1031 | - ], | |
| 1032 | - ], | |
| 1033 | - ], | |
| 1034 | 895 | ] |
| 1035 | 896 | ); |
| 1036 | 897 | |
| 1037 | 898 | $this->add_responsive_control( |
| @@ -1038,9 +899,9 @@ | ||
| 1038 | 899 | 'border_radius', |
| 1039 | 900 | [ |
| 1040 | 901 | 'label' => esc_html__( 'Border Radius', 'elementor' ), |
| 1041 | 902 | 'type' => Controls_Manager::DIMENSIONS, |
| 1042 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], | |
| 903 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 1043 | 904 | 'selectors' => [ |
| 1044 | 905 | '{{WRAPPER}}' => '--border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1045 | 906 | ], |
| 1046 | 907 | ] |
| @@ -1069,20 +930,8 @@ | ||
| 1069 | 930 | Group_Control_Border::get_type(), |
| 1070 | 931 | [ |
| 1071 | 932 | 'name' => 'border_hover', |
| 1072 | 933 | 'selector' => '{{WRAPPER}}:hover', |
| 1073 | - 'fields_options' => [ | |
| 1074 | - 'width' => [ | |
| 1075 | - '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}};', | |
| 1077 | - ], | |
| 1078 | - ], | |
| 1079 | - 'color' => [ | |
| 1080 | - 'selectors' => [ | |
| 1081 | - '{{SELECTOR}}' => 'border-color: {{VALUE}}; --border-color: {{VALUE}};', | |
| 1082 | - ], | |
| 1083 | - ], | |
| 1084 | - ], | |
| 1085 | 934 | ] |
| 1086 | 935 | ); |
| 1087 | 936 | |
| 1088 | 937 | $this->add_responsive_control( |
| @@ -1089,11 +938,11 @@ | ||
| 1089 | 938 | 'border_radius_hover', |
| 1090 | 939 | [ |
| 1091 | 940 | 'label' => esc_html__( 'Border Radius', 'elementor' ), |
| 1092 | 941 | 'type' => Controls_Manager::DIMENSIONS, |
| 1093 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], | |
| 942 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 1094 | 943 | '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}};', | |
| 944 | + '{{WRAPPER}}:hover' => '--border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1096 | 945 | ], |
| 1097 | 946 | ] |
| 1098 | 947 | ); |
| 1099 | 948 | |
| @@ -1107,9 +956,9 @@ | ||
| 1107 | 956 | |
| 1108 | 957 | $this->add_control( |
| 1109 | 958 | 'border_hover_transition', |
| 1110 | 959 | [ |
| 1111 | - 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)', | |
| 960 | + 'label' => esc_html__( 'Transition Duration', 'elementor' ), | |
| 1112 | 961 | 'type' => Controls_Manager::SLIDER, |
| 1113 | 962 | 'separator' => 'before', |
| 1114 | 963 | 'default' => [ |
| 1115 | 964 | 'size' => 0.3, |
| @@ -1115,9 +964,8 @@ | ||
| 1115 | 964 | 'size' => 0.3, |
| 1116 | 965 | ], |
| 1117 | 966 | 'range' => [ |
| 1118 | 967 | 'px' => [ |
| 1119 | - 'min' => 0, | |
| 1120 | 968 | 'max' => 3, |
| 1121 | 969 | 'step' => 0.1, |
| 1122 | 970 | ], |
| 1123 | 971 | ], |
| @@ -1124,36 +972,22 @@ | ||
| 1124 | 972 | 'conditions' => [ |
| 1125 | 973 | 'relation' => 'or', |
| 1126 | 974 | 'terms' => [ |
| 1127 | 975 | [ |
| 1128 | - 'name' => 'border_hover_border', | |
| 976 | + 'name' => 'background_background', | |
| 1129 | 977 | 'operator' => '!==', |
| 1130 | 978 | 'value' => '', |
| 1131 | 979 | ], |
| 1132 | 980 | [ |
| 1133 | - 'name' => 'border_radius_hover[top]', | |
| 981 | + 'name' => 'border_border', | |
| 1134 | 982 | 'operator' => '!==', |
| 1135 | 983 | 'value' => '', |
| 1136 | 984 | ], |
| 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 | 985 | ], |
| 1153 | 986 | ], |
| 1154 | 987 | 'selectors' => [ |
| 1155 | - '{{WRAPPER}}, {{WRAPPER}}::before' => '--border-transition: {{SIZE}}s;', | |
| 988 | + '{{WRAPPER}}' => '--transition: background {{background_hover_transition.SIZE}}s, border {{SIZE}}s, border-radius {{SIZE}}s, box-shadow {{SIZE}}s', | |
| 989 | + '{{WRAPPER}}::before' => '--overlay-transition: background {{background_overlay_hover_transition.SIZE}}s, border-radius {{SIZE}}s, opacity {{background_overlay_hover_transition.SIZE}}s', | |
| 1156 | 990 | ], |
| 1157 | 991 | ] |
| 1158 | 992 | ); |
| 1159 | 993 | |
| @@ -1180,8 +1014,16 @@ | ||
| 1180 | 1014 | ); |
| 1181 | 1015 | |
| 1182 | 1016 | $this->start_controls_tabs( 'tabs_shape_dividers' ); |
| 1183 | 1017 | |
| 1018 | + $shapes_options = [ | |
| 1019 | + '' => esc_html__( 'None', 'elementor' ), | |
| 1020 | + ]; | |
| 1021 | + | |
| 1022 | + foreach ( Shapes::get_shapes() as $shape_name => $shape_props ) { | |
| 1023 | + $shapes_options[ $shape_name ] = $shape_props['title']; | |
| 1024 | + } | |
| 1025 | + | |
| 1184 | 1026 | foreach ( [ |
| 1185 | 1027 | 'top' => esc_html__( 'Top', 'elementor' ), |
| 1186 | 1028 | 'bottom' => esc_html__( 'Bottom', 'elementor' ), |
| 1187 | 1029 | ] as $side => $side_label ) { |
| @@ -1197,30 +1039,12 @@ | ||
| 1197 | 1039 | $this->add_control( |
| 1198 | 1040 | $base_control_key, |
| 1199 | 1041 | [ |
| 1200 | 1042 | 'label' => esc_html__( 'Type', 'elementor' ), |
| 1201 | - 'type' => Controls_Manager::VISUAL_CHOICE, | |
| 1202 | - 'label_block' => true, | |
| 1203 | - 'columns' => 2, | |
| 1204 | - 'options' => Shapes::get_shapes(), | |
| 1043 | + 'type' => Controls_Manager::SELECT, | |
| 1044 | + 'options' => $shapes_options, | |
| 1205 | 1045 | 'render_type' => 'none', |
| 1206 | 1046 | '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 | 1047 | ] |
| 1224 | 1048 | ); |
| 1225 | 1049 | |
| 1226 | 1050 | $this->add_control( |
| @@ -1241,9 +1065,8 @@ | ||
| 1241 | 1065 | $base_control_key . '_width', |
| 1242 | 1066 | [ |
| 1243 | 1067 | 'label' => esc_html__( 'Width', 'elementor' ), |
| 1244 | 1068 | 'type' => Controls_Manager::SLIDER, |
| 1245 | - 'size_units' => [ '%', 'vw', 'custom' ], | |
| 1246 | 1069 | 'default' => [ |
| 1247 | 1070 | 'unit' => '%', |
| 1248 | 1071 | ], |
| 1249 | 1072 | 'tablet_default' => [ |
| @@ -1256,12 +1079,8 @@ | ||
| 1256 | 1079 | '%' => [ |
| 1257 | 1080 | 'min' => 100, |
| 1258 | 1081 | 'max' => 300, |
| 1259 | 1082 | ], |
| 1260 | - 'vw' => [ | |
| 1261 | - 'min' => 100, | |
| 1262 | - 'max' => 300, | |
| 1263 | - ], | |
| 1264 | 1083 | ], |
| 1265 | 1084 | 'condition' => [ |
| 1266 | 1085 | "shape_divider_$side" => array_keys( Shapes::filter_shapes( 'height_only', Shapes::FILTER_EXCLUDE ) ), |
| 1267 | 1086 | ], |
| @@ -1275,19 +1094,12 @@ | ||
| 1275 | 1094 | $base_control_key . '_height', |
| 1276 | 1095 | [ |
| 1277 | 1096 | 'label' => esc_html__( 'Height', 'elementor' ), |
| 1278 | 1097 | 'type' => Controls_Manager::SLIDER, |
| 1279 | - 'size_units' => [ 'px', 'em', 'rem', 'custom' ], | |
| 1280 | 1098 | 'range' => [ |
| 1281 | 1099 | 'px' => [ |
| 1282 | 1100 | 'max' => 500, |
| 1283 | 1101 | ], |
| 1284 | - 'em' => [ | |
| 1285 | - 'max' => 50, | |
| 1286 | - ], | |
| 1287 | - 'rem' => [ | |
| 1288 | - 'max' => 50, | |
| 1289 | - ], | |
| 1290 | 1102 | ], |
| 1291 | 1103 | 'condition' => [ |
| 1292 | 1104 | "shape_divider_$side!" => '', |
| 1293 | 1105 | ], |
| @@ -1378,11 +1190,11 @@ | ||
| 1378 | 1190 | 'margin', |
| 1379 | 1191 | [ |
| 1380 | 1192 | 'label' => esc_html__( 'Margin', 'elementor' ), |
| 1381 | 1193 | 'type' => Controls_Manager::DIMENSIONS, |
| 1382 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], | |
| 1194 | + 'size_units' => [ 'px', 'em', '%', 'rem' ], | |
| 1383 | 1195 | 'selectors' => [ |
| 1384 | - '{{WRAPPER}}' => '--margin-top: {{TOP}}{{UNIT}}; --margin-bottom: {{BOTTOM}}{{UNIT}}; --margin-left: {{LEFT}}{{UNIT}}; --margin-right: {{RIGHT}}{{UNIT}};', | |
| 1196 | + '{{WRAPPER}}' => '--margin-top: {{TOP}}{{UNIT}}; --margin-right: {{RIGHT}}{{UNIT}}; --margin-bottom: {{BOTTOM}}{{UNIT}}; --margin-left:{{LEFT}}{{UNIT}};', | |
| 1385 | 1197 | ], |
| 1386 | 1198 | ] |
| 1387 | 1199 | ); |
| 1388 | 1200 | |
| @@ -1390,113 +1202,15 @@ | ||
| 1390 | 1202 | 'padding', |
| 1391 | 1203 | [ |
| 1392 | 1204 | 'label' => esc_html__( 'Padding', 'elementor' ), |
| 1393 | 1205 | 'type' => Controls_Manager::DIMENSIONS, |
| 1394 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], | |
| 1206 | + 'size_units' => [ 'px', 'em', '%', 'rem' ], | |
| 1395 | 1207 | 'selectors' => [ |
| 1396 | - '{{WRAPPER}}' => '--padding-top: {{TOP}}{{UNIT}}; --padding-bottom: {{BOTTOM}}{{UNIT}}; --padding-left: {{LEFT}}{{UNIT}}; --padding-right: {{RIGHT}}{{UNIT}};', | |
| 1208 | + '{{WRAPPER}}' => '--padding-top: {{TOP}}{{UNIT}}; --padding-right: {{RIGHT}}{{UNIT}}; --padding-bottom: {{BOTTOM}}{{UNIT}}; --padding-left: {{LEFT}}{{UNIT}};', | |
| 1397 | 1209 | ], |
| 1398 | 1210 | ] |
| 1399 | 1211 | ); |
| 1400 | 1212 | |
| 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 | 1213 | $this->add_group_control( |
| 1500 | 1214 | Group_Control_Flex_Item::get_type(), |
| 1501 | 1215 | [ |
| 1502 | 1216 | 'name' => '_flex', |
| @@ -1515,12 +1229,11 @@ | ||
| 1515 | 1229 | |
| 1516 | 1230 | $this->add_control( |
| 1517 | 1231 | 'position_description', |
| 1518 | 1232 | [ |
| 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' ), | |
| 1233 | + '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' ), | |
| 1234 | + 'type' => Controls_Manager::RAW_HTML, | |
| 1235 | + 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning', | |
| 1523 | 1236 | 'render_type' => 'ui', |
| 1524 | 1237 | 'condition' => [ |
| 1525 | 1238 | 'position!' => '', |
| 1526 | 1239 | ], |
| @@ -1586,8 +1299,9 @@ | ||
| 1586 | 1299 | 'range' => [ |
| 1587 | 1300 | 'px' => [ |
| 1588 | 1301 | 'min' => -1000, |
| 1589 | 1302 | 'max' => 1000, |
| 1303 | + 'step' => 1, | |
| 1590 | 1304 | ], |
| 1591 | 1305 | '%' => [ |
| 1592 | 1306 | 'min' => -200, |
| 1593 | 1307 | 'max' => 200, |
| @@ -1601,11 +1315,11 @@ | ||
| 1601 | 1315 | 'max' => 200, |
| 1602 | 1316 | ], |
| 1603 | 1317 | ], |
| 1604 | 1318 | 'default' => [ |
| 1605 | - 'size' => 0, | |
| 1319 | + 'size' => '0', | |
| 1606 | 1320 | ], |
| 1607 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'vh', 'custom' ], | |
| 1321 | + 'size_units' => [ 'px', '%', 'vw', 'vh' ], | |
| 1608 | 1322 | 'selectors' => [ |
| 1609 | 1323 | 'body:not(.rtl) {{WRAPPER}}' => 'left: {{SIZE}}{{UNIT}}', |
| 1610 | 1324 | 'body.rtl {{WRAPPER}}' => 'right: {{SIZE}}{{UNIT}}', |
| 1611 | 1325 | ], |
| @@ -1624,8 +1338,9 @@ | ||
| 1624 | 1338 | 'range' => [ |
| 1625 | 1339 | 'px' => [ |
| 1626 | 1340 | 'min' => -1000, |
| 1627 | 1341 | 'max' => 1000, |
| 1342 | + 'step' => 0.1, | |
| 1628 | 1343 | ], |
| 1629 | 1344 | '%' => [ |
| 1630 | 1345 | 'min' => -200, |
| 1631 | 1346 | 'max' => 200, |
| @@ -1639,11 +1354,11 @@ | ||
| 1639 | 1354 | 'max' => 200, |
| 1640 | 1355 | ], |
| 1641 | 1356 | ], |
| 1642 | 1357 | 'default' => [ |
| 1643 | - 'size' => 0, | |
| 1358 | + 'size' => '0', | |
| 1644 | 1359 | ], |
| 1645 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'vh', 'custom' ], | |
| 1360 | + 'size_units' => [ 'px', '%', 'vw', 'vh' ], | |
| 1646 | 1361 | 'selectors' => [ |
| 1647 | 1362 | 'body:not(.rtl) {{WRAPPER}}' => 'right: {{SIZE}}{{UNIT}}', |
| 1648 | 1363 | 'body.rtl {{WRAPPER}}' => 'left: {{SIZE}}{{UNIT}}', |
| 1649 | 1364 | ], |
| @@ -1686,8 +1401,9 @@ | ||
| 1686 | 1401 | 'range' => [ |
| 1687 | 1402 | 'px' => [ |
| 1688 | 1403 | 'min' => -1000, |
| 1689 | 1404 | 'max' => 1000, |
| 1405 | + 'step' => 1, | |
| 1690 | 1406 | ], |
| 1691 | 1407 | '%' => [ |
| 1692 | 1408 | 'min' => -200, |
| 1693 | 1409 | 'max' => 200, |
| @@ -1700,11 +1416,11 @@ | ||
| 1700 | 1416 | 'min' => -200, |
| 1701 | 1417 | 'max' => 200, |
| 1702 | 1418 | ], |
| 1703 | 1419 | ], |
| 1704 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vh', 'vw', 'custom' ], | |
| 1420 | + 'size_units' => [ 'px', '%', 'vh', 'vw' ], | |
| 1705 | 1421 | 'default' => [ |
| 1706 | - 'size' => 0, | |
| 1422 | + 'size' => '0', | |
| 1707 | 1423 | ], |
| 1708 | 1424 | 'selectors' => [ |
| 1709 | 1425 | '{{WRAPPER}}' => 'top: {{SIZE}}{{UNIT}}', |
| 1710 | 1426 | ], |
| @@ -1723,8 +1439,9 @@ | ||
| 1723 | 1439 | 'range' => [ |
| 1724 | 1440 | 'px' => [ |
| 1725 | 1441 | 'min' => -1000, |
| 1726 | 1442 | 'max' => 1000, |
| 1443 | + 'step' => 1, | |
| 1727 | 1444 | ], |
| 1728 | 1445 | '%' => [ |
| 1729 | 1446 | 'min' => -200, |
| 1730 | 1447 | 'max' => 200, |
| @@ -1737,11 +1454,11 @@ | ||
| 1737 | 1454 | 'min' => -200, |
| 1738 | 1455 | 'max' => 200, |
| 1739 | 1456 | ], |
| 1740 | 1457 | ], |
| 1741 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vh', 'vw', 'custom' ], | |
| 1458 | + 'size_units' => [ 'px', '%', 'vh', 'vw' ], | |
| 1742 | 1459 | 'default' => [ |
| 1743 | - 'size' => 0, | |
| 1460 | + 'size' => '0', | |
| 1744 | 1461 | ], |
| 1745 | 1462 | 'selectors' => [ |
| 1746 | 1463 | '{{WRAPPER}}' => 'bottom: {{SIZE}}{{UNIT}}', |
| 1747 | 1464 | ], |
| @@ -1769,11 +1486,8 @@ | ||
| 1769 | 1486 | [ |
| 1770 | 1487 | 'label' => esc_html__( 'CSS ID', 'elementor' ), |
| 1771 | 1488 | 'type' => Controls_Manager::TEXT, |
| 1772 | 1489 | 'default' => '', |
| 1773 | - 'ai' => [ | |
| 1774 | - 'active' => false, | |
| 1775 | - ], | |
| 1776 | 1490 | 'dynamic' => [ |
| 1777 | 1491 | 'active' => true, |
| 1778 | 1492 | ], |
| 1779 | 1493 | 'title' => esc_html__( 'Add your custom id WITHOUT the Pound key. e.g: my-id', 'elementor' ), |
| @@ -1787,11 +1501,8 @@ | ||
| 1787 | 1501 | [ |
| 1788 | 1502 | 'label' => esc_html__( 'CSS Classes', 'elementor' ), |
| 1789 | 1503 | 'type' => Controls_Manager::TEXT, |
| 1790 | 1504 | 'default' => '', |
| 1791 | - 'ai' => [ | |
| 1792 | - 'active' => false, | |
| 1793 | - ], | |
| 1794 | 1505 | 'dynamic' => [ |
| 1795 | 1506 | 'active' => true, |
| 1796 | 1507 | ], |
| 1797 | 1508 | 'prefix_class' => '', |
| @@ -1799,10 +1510,8 @@ | ||
| 1799 | 1510 | 'classes' => 'elementor-control-direction-ltr', |
| 1800 | 1511 | ] |
| 1801 | 1512 | ); |
| 1802 | 1513 | |
| 1803 | - Plugin::$instance->controls_manager->add_display_conditions_controls( $this ); | |
| 1804 | - | |
| 1805 | 1514 | $this->end_controls_section(); |
| 1806 | 1515 | } |
| 1807 | 1516 | |
| 1808 | 1517 | /** |
| @@ -1818,10 +1527,8 @@ | ||
| 1818 | 1527 | 'tab' => Controls_Manager::TAB_ADVANCED, |
| 1819 | 1528 | ] |
| 1820 | 1529 | ); |
| 1821 | 1530 | |
| 1822 | - Plugin::$instance->controls_manager->add_motion_effects_promotion_control( $this ); | |
| 1823 | - | |
| 1824 | 1531 | $this->add_responsive_control( |
| 1825 | 1532 | 'animation', |
| 1826 | 1533 | [ |
| 1827 | 1534 | 'label' => esc_html__( 'Entrance Animation', 'elementor' ), |
| @@ -1891,14 +1598,9 @@ | ||
| 1891 | 1598 | |
| 1892 | 1599 | $this->add_control( |
| 1893 | 1600 | 'responsive_description', |
| 1894 | 1601 | [ |
| 1895 | - 'raw' => sprintf( | |
| 1896 | - /* translators: 1: Link open tag, 2: Link close tag. */ | |
| 1897 | - esc_html__( 'Responsive visibility will take effect only on %1$s preview mode %2$s or live page, and not while editing in Elementor.', 'elementor' ), | |
| 1898 | - '<a href="javascript: $e.run( \'panel/close\' )">', | |
| 1899 | - '</a>' | |
| 1900 | - ), | |
| 1602 | + 'raw' => esc_html__( 'Responsive visibility will take effect only on preview or live page, and not while editing in Elementor.', 'elementor' ), | |
| 1901 | 1603 | 'type' => Controls_Manager::RAW_HTML, |
| 1902 | 1604 | 'content_classes' => 'elementor-descriptor', |
| 1903 | 1605 | ] |
| 1904 | 1606 | ); |
| @@ -1917,12 +1619,8 @@ | ||
| 1917 | 1619 | $this->register_advanced_controls(); |
| 1918 | 1620 | |
| 1919 | 1621 | $this->register_motion_effects_controls(); |
| 1920 | 1622 | |
| 1921 | - $this->hook_sticky_notice_into_transform_section(); | |
| 1922 | - | |
| 1923 | - $this->register_transform_section( 'con' ); | |
| 1924 | - | |
| 1925 | 1623 | $this->register_responsive_controls(); |
| 1926 | 1624 | |
| 1927 | 1625 | Plugin::$instance->controls_manager->add_custom_attributes_controls( $this ); |
| 1928 | 1626 | |
| @@ -1928,25 +1626,8 @@ | ||
| 1928 | 1626 | |
| 1929 | 1627 | Plugin::$instance->controls_manager->add_custom_css_controls( $this ); |
| 1930 | 1628 | } |
| 1931 | 1629 | |
| 1932 | - 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 | - | |
| 1938 | - $container->add_control( | |
| 1939 | - 'transform_sticky_notice', | |
| 1940 | - [ | |
| 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' ), | |
| 1944 | - ] | |
| 1945 | - ); | |
| 1946 | - } ); | |
| 1947 | - } | |
| 1948 | - | |
| 1949 | 1630 | /** |
| 1950 | 1631 | * Register the Container's controls. |
| 1951 | 1632 | * |
| 1952 | 1633 | * @return void |
| @@ -1954,44 +1635,6 @@ | ||
| 1954 | 1635 | protected function register_controls() { |
| 1955 | 1636 | $this->register_layout_tab(); |
| 1956 | 1637 | $this->register_style_tab(); |
| 1957 | 1638 | $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 | 1639 | } |
| 1997 | 1640 | } |