← All changes
|
modules/atomic-widgets/elements/atomic-tabs/atomic-tabs/atomic-tabs.php
+5
-8
4.3.1
→
4.0.0-dev4
View file →
| @@ -1,11 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | namespace Elementor\Modules\AtomicWidgets\Elements\Atomic_Tabs\Atomic_Tabs; |
| 3 | 3 | |
| 4 | -use Elementor\Modules\AtomicWidgets\Elements\Atomic_Paragraph\Atomic_Paragraph; | |
| 5 | 4 | use Elementor\Modules\AtomicWidgets\Elements\Base\Atomic_Element_Base; |
| 6 | 5 | use Elementor\Modules\AtomicWidgets\Elements\Base\Has_Element_Template; |
| 7 | -use Elementor\Modules\AtomicWidgets\Elements\Base\Html_Tag_Computer; | |
| 8 | 6 | use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\Number_Prop_Type; |
| 9 | 7 | use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type; |
| 10 | 8 | use Elementor\Modules\AtomicWidgets\PropTypes\Size_Prop_Type; |
| 11 | 9 | use Elementor\Modules\AtomicWidgets\Styles\Style_Definition; |
| @@ -38,14 +36,13 @@ | ||
| 38 | 36 | const ELEMENT_TYPE_TABS_CONTENT_AREA = 'e-tabs-content-area'; |
| 39 | 37 | const ELEMENT_TYPE_TAB = 'e-tab'; |
| 40 | 38 | const ELEMENT_TYPE_TAB_CONTENT = 'e-tab-content'; |
| 41 | 39 | |
| 42 | - public static $widget_description = 'Create a tabbed interface with customizable tabs and content areas. Structure: e-tabs contains e-tabs-menu (with e-tab triggers) and e-tabs-content-area (with e-tab-content panels). The number of e-tab elements MUST equal the number of e-tab-content elements. Each e-tab at index N is paired with the e-tab-content at index N.'; | |
| 40 | + public static $widget_description = 'Create a tabbed interface with customizable tabs and content areas. LLM support: Each child element will be represented as a tab, the menu auto-generates based on the children'; | |
| 43 | 41 | |
| 44 | 42 | public function __construct( $data = [], $args = null ) { |
| 45 | 43 | parent::__construct( $data, $args ); |
| 46 | 44 | $this->meta( 'is_container', true ); |
| 47 | - $this->meta( 'is_compound', true ); | |
| 48 | 45 | } |
| 49 | 46 | |
| 50 | 47 | public static function get_type() { |
| 51 | 48 | return 'e-tabs'; |
| @@ -66,12 +63,8 @@ | ||
| 66 | 63 | public function get_icon() { |
| 67 | 64 | return 'eicon-tabs'; |
| 68 | 65 | } |
| 69 | 66 | |
| 70 | - public static function get_computed_html_tag( array $settings ): string { | |
| 71 | - return Html_Tag_Computer::compute( $settings, 'div' ); | |
| 72 | - } | |
| 73 | - | |
| 74 | 67 | protected static function define_props_schema(): array { |
| 75 | 68 | return [ |
| 76 | 69 | 'classes' => Classes_Prop_Type::make() |
| 77 | 70 | ->default( [] ), |
| @@ -142,11 +135,13 @@ | ||
| 142 | 135 | ->editor_settings( [ |
| 143 | 136 | 'title' => "Tab {$i} trigger", |
| 144 | 137 | 'initial_position' => $i, |
| 145 | 138 | ] ) |
| 139 | + ->is_locked( true ) | |
| 146 | 140 | ->build(); |
| 147 | 141 | |
| 148 | 142 | $tab_content_elements[] = Atomic_Tab_Content::generate() |
| 143 | + ->is_locked( true ) | |
| 149 | 144 | ->editor_settings( [ |
| 150 | 145 | 'title' => "Tab {$i} content", |
| 151 | 146 | 'initial_position' => $i, |
| 152 | 147 | ] ) |
| @@ -154,12 +149,14 @@ | ||
| 154 | 149 | } |
| 155 | 150 | |
| 156 | 151 | $tabs_menu = Atomic_Tabs_Menu::generate() |
| 157 | 152 | ->children( $tab_elements ) |
| 153 | + ->is_locked( true ) | |
| 158 | 154 | ->build(); |
| 159 | 155 | |
| 160 | 156 | $tabs_content_area = Atomic_Tabs_Content_Area::generate() |
| 161 | 157 | ->children( $tab_content_elements ) |
| 158 | + ->is_locked( true ) | |
| 162 | 159 | ->build(); |
| 163 | 160 | |
| 164 | 161 | return [ |
| 165 | 162 | $tabs_menu, |