← All changes
|
core/kits/documents/tabs/settings-layout.php
+17
-42
4.1.0-dev2
→
3.13.2
View file →
| @@ -8,9 +8,9 @@ | ||
| 8 | 8 | use Elementor\Core\Base\Document; |
| 9 | 9 | use Elementor\Modules\PageTemplates\Module as PageTemplatesModule; |
| 10 | 10 | |
| 11 | 11 | if ( ! defined( 'ABSPATH' ) ) { |
| 12 | - exit; // Exit if accessed directly. | |
| 12 | + exit; // Exit if accessed directly | |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | class Settings_Layout extends Tab_Base { |
| 16 | 16 | |
| @@ -55,9 +55,9 @@ | ||
| 55 | 55 | 'label' => esc_html__( 'Content Width', 'elementor' ), |
| 56 | 56 | 'type' => Controls_Manager::SLIDER, |
| 57 | 57 | 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], |
| 58 | 58 | 'default' => [ |
| 59 | - 'size' => 1140, | |
| 59 | + 'size' => '1140', | |
| 60 | 60 | ], |
| 61 | 61 | 'tablet_default' => [ |
| 62 | 62 | 'size' => $breakpoints_default_config[ $breakpoint_key_tablet ]['default_value'], |
| 63 | 63 | ], |
| @@ -96,9 +96,9 @@ | ||
| 96 | 96 | ); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | $widgets_space_label = $is_container_active |
| 100 | - ? esc_html__( 'Gaps', 'elementor' ) | |
| 100 | + ? esc_html__( 'Gap between elements', 'elementor' ) | |
| 101 | 101 | : esc_html__( 'Widgets Space', 'elementor' ); |
| 102 | 102 | |
| 103 | 103 | $this->add_control( |
| 104 | 104 | 'space_between_widgets', |
| @@ -103,34 +103,27 @@ | ||
| 103 | 103 | $this->add_control( |
| 104 | 104 | 'space_between_widgets', |
| 105 | 105 | [ |
| 106 | 106 | 'label' => $widgets_space_label, |
| 107 | - 'type' => Controls_Manager::GAPS, | |
| 107 | + 'type' => Controls_Manager::SLIDER, | |
| 108 | 108 | 'default' => [ |
| 109 | - 'row' => '20', | |
| 110 | - 'column' => '20', | |
| 111 | - 'unit' => 'px', | |
| 109 | + 'size' => 20, | |
| 112 | 110 | ], |
| 113 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], | |
| 111 | + 'size_units' => [ 'px', 'em', 'rem', 'custom' ], | |
| 112 | + 'range' => [ | |
| 113 | + 'px' => [ | |
| 114 | + 'min' => 0, | |
| 115 | + 'max' => 40, | |
| 116 | + ], | |
| 117 | + ], | |
| 114 | 118 | 'placeholder' => [ |
| 115 | - 'row' => '20', | |
| 116 | - 'column' => '20', | |
| 119 | + 'size' => 20, | |
| 117 | 120 | ], |
| 118 | 121 | 'description' => esc_html__( 'Sets the default space between widgets (Default: 20px)', 'elementor' ), |
| 119 | - 'selectors' => $this->get_spacing_selectors(), | |
| 120 | - 'conversion_map' => [ | |
| 121 | - 'old_key' => 'size', | |
| 122 | - 'new_key' => 'column', | |
| 122 | + 'selectors' => [ | |
| 123 | + '.elementor-widget:not(:last-child)' => 'margin-bottom: {{SIZE}}{{UNIT}}', | |
| 124 | + '.elementor-element' => '--widgets-spacing: {{SIZE}}{{UNIT}}', | |
| 123 | 125 | ], |
| 124 | - 'upgrade_conversion_map' => [ | |
| 125 | - 'old_key' => 'size', | |
| 126 | - 'new_keys' => [ 'column', 'row' ], | |
| 127 | - ], | |
| 128 | - 'validators' => [ | |
| 129 | - 'Number' => [ | |
| 130 | - 'min' => 0, | |
| 131 | - ], | |
| 132 | - ], | |
| 133 | 126 | ] |
| 134 | 127 | ); |
| 135 | 128 | |
| 136 | 129 | $this->add_control( |
| @@ -141,11 +134,8 @@ | ||
| 141 | 134 | 'default' => 'h1.entry-title', |
| 142 | 135 | 'placeholder' => 'h1.entry-title', |
| 143 | 136 | 'description' => esc_html__( 'Elementor lets you hide the page title. This works for themes that have "h1.entry-title" selector. If your theme\'s selector is different, please enter it above.', 'elementor' ), |
| 144 | 137 | 'label_block' => true, |
| 145 | - 'ai' => [ | |
| 146 | - 'active' => false, | |
| 147 | - ], | |
| 148 | 138 | 'selectors' => [ |
| 149 | 139 | // Hack to convert the value into a CSS selector. |
| 150 | 140 | '' => '}{{VALUE}}{display: var(--page-title-display)', |
| 151 | 141 | ], |
| @@ -160,11 +150,8 @@ | ||
| 160 | 150 | 'placeholder' => 'body', |
| 161 | 151 | 'description' => esc_html__( 'Enter parent element selector to which stretched sections will fit to (e.g. #primary / .wrapper / main etc). Leave blank to fit to page width.', 'elementor' ), |
| 162 | 152 | 'label_block' => true, |
| 163 | 153 | 'frontend_available' => true, |
| 164 | - 'ai' => [ | |
| 165 | - 'active' => false, | |
| 166 | - ], | |
| 167 | 154 | ] |
| 168 | 155 | ); |
| 169 | 156 | |
| 170 | 157 | /** |
| @@ -242,20 +229,8 @@ | ||
| 242 | 229 | |
| 243 | 230 | $this->end_controls_section(); |
| 244 | 231 | } |
| 245 | 232 | |
| 246 | - private function get_spacing_selectors(): array { | |
| 247 | - $optimized_markup = Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); | |
| 248 | - $sections_widget_spacing = $optimized_markup | |
| 249 | - ? '--kit-widget-spacing: {{ROW}}{{UNIT}}' | |
| 250 | - : 'margin-block-end: {{ROW}}{{UNIT}}'; | |
| 251 | - | |
| 252 | - return [ | |
| 253 | - '.elementor-widget:not(:last-child)' => $sections_widget_spacing, | |
| 254 | - '.elementor-element' => '--widgets-spacing: {{ROW}}{{UNIT}} {{COLUMN}}{{UNIT}};--widgets-spacing-row: {{ROW}}{{UNIT}};--widgets-spacing-column: {{COLUMN}}{{UNIT}};', | |
| 255 | - ]; | |
| 256 | - } | |
| 257 | - | |
| 258 | 233 | /** |
| 259 | 234 | * Before Save |
| 260 | 235 | * |
| 261 | 236 | * Runs Before the Kit document is saved. |
| @@ -332,9 +307,8 @@ | ||
| 332 | 307 | 'breakpoint_' . $breakpoint_key . '_heading', |
| 333 | 308 | [ |
| 334 | 309 | 'label' => $default_breakpoint_config['label'], |
| 335 | 310 | 'type' => Controls_Manager::HEADING, |
| 336 | - 'separator' => 'before', | |
| 337 | 311 | 'conditions' => [ |
| 338 | 312 | 'terms' => [ |
| 339 | 313 | [ |
| 340 | 314 | 'name' => 'active_breakpoints', |
| @@ -350,8 +324,9 @@ | ||
| 350 | 324 | 'label' => esc_html__( 'Breakpoint', 'elementor' ) . ' (px)', |
| 351 | 325 | 'type' => Controls_Manager::NUMBER, |
| 352 | 326 | 'placeholder' => $default_breakpoint_config['default_value'], |
| 353 | 327 | 'frontend_available' => true, |
| 328 | + 'separator' => 'after', | |
| 354 | 329 | 'validators' => [ |
| 355 | 330 | 'Breakpoint' => [ |
| 356 | 331 | 'breakpointName' => $breakpoint_key, |
| 357 | 332 | ], |