| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | <?php |
| 2 | + | |
| 2 | 3 | namespace UiCoreElements; |
| 3 | 4 | |
| 4 | 5 | use Elementor\Controls_Manager; |
| 5 | 6 | |
| @@ -37,40 +38,32 @@ | ||
| 37 | 38 | $styles[] = 'gallery-slider'; |
| 38 | 39 | |
| 39 | 40 | return $styles; |
| 40 | 41 | } |
| 42 | + // TODO: remove after Optmized Markup experiment is merged to the core | |
| 43 | + public function has_widget_inner_wrapper(): bool | |
| 44 | + { | |
| 45 | + return true; | |
| 46 | + } | |
| 41 | 47 | protected function register_controls() |
| 42 | 48 | { |
| 43 | - parent::register_controls(); // keep original controls | |
| 49 | + parent::register_controls(); | |
| 50 | + $this->TRAIT_update_slider_controls(); | |
| 44 | 51 | |
| 45 | - // Add special animation slide | |
| 46 | - $this->update_control( | |
| 47 | - 'animation_style', | |
| 52 | + // Remove conditions from image height and image style section | |
| 53 | + $this->update_responsive_control( | |
| 54 | + 'image_height', | |
| 48 | 55 | [ |
| 49 | - 'default' => 'fade', | |
| 50 | - 'options' => [ | |
| 51 | - 'coverflow' => esc_html__('Coverflow', 'uicore-elements'), | |
| 52 | - 'fade' => esc_html__('Fade', 'uicore-elements'), | |
| 53 | - 'cards' => esc_html__('Cards', 'uicore-elements'), | |
| 54 | - 'flip' => esc_html__('Flip', 'uicore-elements'), | |
| 55 | - 'creative' => esc_html__('Creative', 'uicore-elements'), | |
| 56 | - 'stacked' => esc_html__('Stacked', 'uicore-elements'), | |
| 57 | - ] | |
| 56 | + 'conditions' => false, | |
| 58 | 57 | ] |
| 59 | 58 | ); |
| 60 | - | |
| 61 | - // Remove conditions from image height | |
| 62 | 59 | $this->update_responsive_control( |
| 63 | - 'image_height', | |
| 60 | + 'style_image_section', | |
| 64 | 61 | [ |
| 65 | 62 | 'conditions' => false, |
| 66 | 63 | ] |
| 67 | 64 | ); |
| 68 | 65 | |
| 69 | - // Remove item entrance and hover animation | |
| 70 | - $this->remove_control('animate_items'); | |
| 71 | - $this->remove_control('item_hover_animation'); | |
| 72 | - | |
| 73 | 66 | // Remove item active state styles |
| 74 | 67 | $this->remove_control('tab_item_active'); |
| 75 | 68 | $this->remove_control('item_active_background'); |
| 76 | 69 | $this->remove_control('item_active_border_color'); |
| @@ -76,15 +69,9 @@ | ||
| 76 | 69 | $this->remove_control('item_active_border_color'); |
| 77 | 70 | $this->remove_control('item_active_box_shadow'); |
| 78 | 71 | |
| 79 | 72 | // Remove controls that are meant for carousel, not slide type widgets |
| 80 | - $this->remove_responsive_control('slides_per_view'); | |
| 81 | - $this->remove_control('show_hidden'); | |
| 82 | - $this->remove_control('fade_edges'); | |
| 83 | - $this->remove_control('fade_edges_alert'); | |
| 84 | - $this->remove_control('match_height'); | |
| 85 | - $this->remove_control('carousel_gap'); | |
| 86 | - //$this->remove_control('main_image'); TODO: remove this control after releasing it on carousel | |
| 73 | + $this->remove_control('main_image'); | |
| 87 | 74 | |
| 88 | 75 | // Add vertical content alignment control |
| 89 | 76 | $this->start_injection([ |
| 90 | 77 | 'of' => 'layout', |
| @@ -90,37 +77,37 @@ | ||
| 90 | 77 | 'of' => 'layout', |
| 91 | 78 | 'at' => 'after', |
| 92 | 79 | ]); |
| 93 | 80 | |
| 94 | - $this->add_responsive_control( | |
| 95 | - 'content_v_alignment', | |
| 96 | - [ | |
| 97 | - 'label' => __('Vertical Alignment', 'uicore-elements'), | |
| 98 | - 'type' => Controls_Manager::CHOOSE, | |
| 99 | - 'default' => 'start', | |
| 100 | - 'options' => [ | |
| 101 | - 'start' => [ | |
| 102 | - 'title' => __('Left', 'uicore-elements'), | |
| 103 | - 'icon' => 'eicon-align-start-v', | |
| 104 | - ], | |
| 105 | - 'center' => [ | |
| 106 | - 'title' => __('Center', 'uicore-elements'), | |
| 107 | - 'icon' => 'eicon-align-center-v', | |
| 108 | - ], | |
| 109 | - 'end' => [ | |
| 110 | - 'title' => __('Right', 'uicore-elements'), | |
| 111 | - 'icon' => 'eicon-align-end-v', | |
| 112 | - ], | |
| 81 | + $this->add_responsive_control( | |
| 82 | + 'content_v_alignment', | |
| 83 | + [ | |
| 84 | + 'label' => __('Vertical Alignment', 'uicore-elements'), | |
| 85 | + 'type' => Controls_Manager::CHOOSE, | |
| 86 | + 'default' => 'start', | |
| 87 | + 'options' => [ | |
| 88 | + 'start' => [ | |
| 89 | + 'title' => __('Start', 'uicore-elements'), | |
| 90 | + 'icon' => 'eicon-align-start-v', | |
| 113 | 91 | ], |
| 114 | - 'condition' => [ | |
| 115 | - 'layout' => 'ui-e-overlay' | |
| 92 | + 'center' => [ | |
| 93 | + 'title' => __('Center', 'uicore-elements'), | |
| 94 | + 'icon' => 'eicon-align-center-v', | |
| 116 | 95 | ], |
| 117 | - 'selectors' => [ | |
| 118 | - '{{WRAPPER}} .ui-e-content' => 'justify-content: {{VALUE}};', | |
| 119 | - ] | |
| 96 | + 'end' => [ | |
| 97 | + 'title' => __('Bottom', 'uicore-elements'), | |
| 98 | + 'icon' => 'eicon-align-end-v', | |
| 99 | + ], | |
| 100 | + ], | |
| 101 | + 'condition' => [ | |
| 102 | + 'layout' => 'ui-e-overlay' | |
| 103 | + ], | |
| 104 | + 'selectors' => [ | |
| 105 | + '{{WRAPPER}} .ui-e-content' => 'justify-content: {{VALUE}};', | |
| 120 | 106 | ] |
| 121 | - ); | |
| 107 | + ] | |
| 108 | + ); | |
| 122 | 109 | |
| 123 | 110 | $this->end_injection(); |
| 124 | 111 | } |
| 125 | 112 | } |
| 126 | -\Elementor\Plugin::instance()->widgets_manager->register(new GallerySlider()); | |
| 113 | +\Elementor\Plugin::instance()->widgets_manager->register(new GallerySlider()); | |