| @@ -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 | |
| @@ -51,13 +51,12 @@ | ||
| 51 | 51 | |
| 52 | 52 | $this->add_responsive_control( |
| 53 | 53 | 'container_width', |
| 54 | 54 | [ |
| 55 | - 'label' => esc_html__( 'Content Width', 'elementor' ), | |
| 55 | + 'label' => esc_html__( 'Content Width', 'elementor' ) . ' (px)', | |
| 56 | 56 | 'type' => Controls_Manager::SLIDER, |
| 57 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], | |
| 58 | 57 | 'default' => [ |
| 59 | - 'size' => 1140, | |
| 58 | + 'size' => '1140', | |
| 60 | 59 | ], |
| 61 | 60 | 'tablet_default' => [ |
| 62 | 61 | 'size' => $breakpoints_default_config[ $breakpoint_key_tablet ]['default_value'], |
| 63 | 62 | ], |
| @@ -70,9 +69,9 @@ | ||
| 70 | 69 | 'max' => 1500, |
| 71 | 70 | 'step' => 10, |
| 72 | 71 | ], |
| 73 | 72 | ], |
| 74 | - 'description' => esc_html__( 'Sets the default width of the content area (Default: 1140px)', 'elementor' ), | |
| 73 | + 'description' => esc_html__( 'Sets the default width of the content area (Default: 1140)', 'elementor' ), | |
| 75 | 74 | 'selectors' => [ |
| 76 | 75 | '.elementor-section.elementor-section-boxed > .elementor-container' => 'max-width: {{SIZE}}{{UNIT}}', |
| 77 | 76 | '.e-con' => '--container-max-width: {{SIZE}}{{UNIT}}', |
| 78 | 77 | ], |
| @@ -86,9 +85,12 @@ | ||
| 86 | 85 | 'container_padding', |
| 87 | 86 | [ |
| 88 | 87 | 'label' => esc_html__( 'Container Padding', 'elementor' ), |
| 89 | 88 | 'type' => Controls_Manager::DIMENSIONS, |
| 90 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], | |
| 89 | + 'size_units' => [ 'px', 'em', '%', 'rem' ], | |
| 90 | + 'default' => [ | |
| 91 | + 'unit' => 'px', | |
| 92 | + ], | |
| 91 | 93 | 'description' => esc_html__( 'Sets the default space inside the container (Default is 10px)', 'elementor' ), |
| 92 | 94 | 'selectors' => [ |
| 93 | 95 | '.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}};', |
| 94 | 96 | ], |
| @@ -96,41 +98,33 @@ | ||
| 96 | 98 | ); |
| 97 | 99 | } |
| 98 | 100 | |
| 99 | 101 | $widgets_space_label = $is_container_active |
| 100 | - ? esc_html__( 'Gaps', 'elementor' ) | |
| 102 | + ? esc_html__( 'Gap between elements', 'elementor' ) | |
| 101 | 103 | : esc_html__( 'Widgets Space', 'elementor' ); |
| 102 | 104 | |
| 103 | 105 | $this->add_control( |
| 104 | 106 | 'space_between_widgets', |
| 105 | 107 | [ |
| 106 | - 'label' => $widgets_space_label, | |
| 107 | - 'type' => Controls_Manager::GAPS, | |
| 108 | + 'label' => $widgets_space_label . ' (px)', | |
| 109 | + 'type' => Controls_Manager::SLIDER, | |
| 108 | 110 | 'default' => [ |
| 109 | - 'row' => '20', | |
| 110 | - 'column' => '20', | |
| 111 | - 'unit' => 'px', | |
| 111 | + 'size' => 20, | |
| 112 | 112 | ], |
| 113 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], | |
| 113 | + 'range' => [ | |
| 114 | + 'px' => [ | |
| 115 | + 'min' => 0, | |
| 116 | + 'max' => 40, | |
| 117 | + ], | |
| 118 | + ], | |
| 114 | 119 | 'placeholder' => [ |
| 115 | - 'row' => '20', | |
| 116 | - 'column' => '20', | |
| 120 | + 'size' => '20', | |
| 117 | 121 | ], |
| 118 | - '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 | + 'description' => esc_html__( 'Sets the default space between widgets (Default: 20)', 'elementor' ), | |
| 123 | + 'selectors' => [ | |
| 124 | + '.elementor-widget:not(:last-child)' => 'margin-bottom: {{SIZE}}{{UNIT}}', | |
| 125 | + '.elementor-element' => '--widgets-spacing: {{SIZE}}{{UNIT}}', | |
| 123 | 126 | ], |
| 124 | - 'upgrade_conversion_map' => [ | |
| 125 | - 'old_key' => 'size', | |
| 126 | - 'new_keys' => [ 'column', 'row' ], | |
| 127 | - ], | |
| 128 | - 'validators' => [ | |
| 129 | - 'Number' => [ | |
| 130 | - 'min' => 0, | |
| 131 | - ], | |
| 132 | - ], | |
| 133 | 127 | ] |
| 134 | 128 | ); |
| 135 | 129 | |
| 136 | 130 | $this->add_control( |
| @@ -141,11 +135,8 @@ | ||
| 141 | 135 | 'default' => 'h1.entry-title', |
| 142 | 136 | 'placeholder' => 'h1.entry-title', |
| 143 | 137 | '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 | 138 | 'label_block' => true, |
| 145 | - 'ai' => [ | |
| 146 | - 'active' => false, | |
| 147 | - ], | |
| 148 | 139 | 'selectors' => [ |
| 149 | 140 | // Hack to convert the value into a CSS selector. |
| 150 | 141 | '' => '}{{VALUE}}{display: var(--page-title-display)', |
| 151 | 142 | ], |
| @@ -160,11 +151,8 @@ | ||
| 160 | 151 | 'placeholder' => 'body', |
| 161 | 152 | '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 | 153 | 'label_block' => true, |
| 163 | 154 | 'frontend_available' => true, |
| 164 | - 'ai' => [ | |
| 165 | - 'active' => false, | |
| 166 | - ], | |
| 167 | 155 | ] |
| 168 | 156 | ); |
| 169 | 157 | |
| 170 | 158 | /** |
| @@ -242,20 +230,8 @@ | ||
| 242 | 230 | |
| 243 | 231 | $this->end_controls_section(); |
| 244 | 232 | } |
| 245 | 233 | |
| 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 | 234 | /** |
| 259 | 235 | * Before Save |
| 260 | 236 | * |
| 261 | 237 | * Runs Before the Kit document is saved. |
| @@ -332,9 +308,8 @@ | ||
| 332 | 308 | 'breakpoint_' . $breakpoint_key . '_heading', |
| 333 | 309 | [ |
| 334 | 310 | 'label' => $default_breakpoint_config['label'], |
| 335 | 311 | 'type' => Controls_Manager::HEADING, |
| 336 | - 'separator' => 'before', | |
| 337 | 312 | 'conditions' => [ |
| 338 | 313 | 'terms' => [ |
| 339 | 314 | [ |
| 340 | 315 | 'name' => 'active_breakpoints', |