← All changes
|
core/kits/documents/tabs/settings-layout.php
+10
-23
4.3.0-beta3
→
3.17.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 | ], |
| @@ -79,8 +79,10 @@ | ||
| 79 | 79 | ] |
| 80 | 80 | ); |
| 81 | 81 | |
| 82 | 82 | $is_container_active = Plugin::instance()->experiments->is_feature_active( 'container' ); |
| 83 | + $logical_dimensions_inline_start = is_rtl() ? '{{RIGHT}}{{UNIT}}' : '{{LEFT}}{{UNIT}}'; | |
| 84 | + $logical_dimensions_inline_end = is_rtl() ? '{{LEFT}}{{UNIT}}' : '{{RIGHT}}{{UNIT}}'; | |
| 83 | 85 | |
| 84 | 86 | if ( $is_container_active ) { |
| 85 | 87 | $this->add_responsive_control( |
| 86 | 88 | 'container_padding', |
| @@ -89,9 +91,9 @@ | ||
| 89 | 91 | 'type' => Controls_Manager::DIMENSIONS, |
| 90 | 92 | 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], |
| 91 | 93 | 'description' => esc_html__( 'Sets the default space inside the container (Default is 10px)', 'elementor' ), |
| 92 | 94 | 'selectors' => [ |
| 93 | - '.e-con' => '--container-default-padding-top: {{TOP}}{{UNIT}}; --container-default-padding-right: {{RIGHT}}{{UNIT}}; --container-default-padding-bottom: {{BOTTOM}}{{UNIT}}; --container-default-padding-left: {{LEFT}}{{UNIT}};', | |
| 95 | + '.e-con' => "--container-default-padding-block-start: {{TOP}}{{UNIT}}; --container-default-padding-inline-end: $logical_dimensions_inline_end; --container-default-padding-block-end: {{BOTTOM}}{{UNIT}}; --container-default-padding-inline-start: $logical_dimensions_inline_start;", | |
| 94 | 96 | ], |
| 95 | 97 | ] |
| 96 | 98 | ); |
| 97 | 99 | } |
| @@ -115,9 +117,12 @@ | ||
| 115 | 117 | 'row' => '20', |
| 116 | 118 | 'column' => '20', |
| 117 | 119 | ], |
| 118 | 120 | 'description' => esc_html__( 'Sets the default space between widgets (Default: 20px)', 'elementor' ), |
| 119 | - 'selectors' => $this->get_spacing_selectors(), | |
| 121 | + 'selectors' => [ | |
| 122 | + '.elementor-widget:not(:last-child)' => 'margin-block-end: {{ROW}}{{UNIT}}', | |
| 123 | + '.elementor-element' => '--widgets-spacing: {{ROW}}{{UNIT}} {{COLUMN}}{{UNIT}}', | |
| 124 | + ], | |
| 120 | 125 | 'conversion_map' => [ |
| 121 | 126 | 'old_key' => 'size', |
| 122 | 127 | 'new_key' => 'column', |
| 123 | 128 | ], |
| @@ -141,11 +146,8 @@ | ||
| 141 | 146 | 'default' => 'h1.entry-title', |
| 142 | 147 | 'placeholder' => 'h1.entry-title', |
| 143 | 148 | '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 | 149 | 'label_block' => true, |
| 145 | - 'ai' => [ | |
| 146 | - 'active' => false, | |
| 147 | - ], | |
| 148 | 150 | 'selectors' => [ |
| 149 | 151 | // Hack to convert the value into a CSS selector. |
| 150 | 152 | '' => '}{{VALUE}}{display: var(--page-title-display)', |
| 151 | 153 | ], |
| @@ -160,11 +162,8 @@ | ||
| 160 | 162 | 'placeholder' => 'body', |
| 161 | 163 | '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 | 164 | 'label_block' => true, |
| 163 | 165 | 'frontend_available' => true, |
| 164 | - 'ai' => [ | |
| 165 | - 'active' => false, | |
| 166 | - ], | |
| 167 | 166 | ] |
| 168 | 167 | ); |
| 169 | 168 | |
| 170 | 169 | /** |
| @@ -242,20 +241,8 @@ | ||
| 242 | 241 | |
| 243 | 242 | $this->end_controls_section(); |
| 244 | 243 | } |
| 245 | 244 | |
| 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 | 245 | /** |
| 259 | 246 | * Before Save |
| 260 | 247 | * |
| 261 | 248 | * Runs Before the Kit document is saved. |
| @@ -332,9 +319,8 @@ | ||
| 332 | 319 | 'breakpoint_' . $breakpoint_key . '_heading', |
| 333 | 320 | [ |
| 334 | 321 | 'label' => $default_breakpoint_config['label'], |
| 335 | 322 | 'type' => Controls_Manager::HEADING, |
| 336 | - 'separator' => 'before', | |
| 337 | 323 | 'conditions' => [ |
| 338 | 324 | 'terms' => [ |
| 339 | 325 | [ |
| 340 | 326 | 'name' => 'active_breakpoints', |
| @@ -350,8 +336,9 @@ | ||
| 350 | 336 | 'label' => esc_html__( 'Breakpoint', 'elementor' ) . ' (px)', |
| 351 | 337 | 'type' => Controls_Manager::NUMBER, |
| 352 | 338 | 'placeholder' => $default_breakpoint_config['default_value'], |
| 353 | 339 | 'frontend_available' => true, |
| 340 | + 'separator' => 'after', | |
| 354 | 341 | 'validators' => [ |
| 355 | 342 | 'Breakpoint' => [ |
| 356 | 343 | 'breakpointName' => $breakpoint_key, |
| 357 | 344 | ], |