PluginProbe
Elementor Website Builder – more than just a page builder / 3.32.0-dev3
Elementor Website Builder – more than just a page builder v3.32.0-dev3
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
← All changes | modules/atomic-widgets/styles/style-schema.php +53 -164 4.1.0-dev23.32.0-dev3 View file →
@@ -23,9 +23,8 @@
23 23 use Elementor\Modules\AtomicWidgets\PropTypes\Transition_Prop_Type;
24 24 use Elementor\Modules\AtomicWidgets\PropTypes\Union_Prop_Type;
25 25 use Elementor\Modules\AtomicWidgets\PropTypes\Flex_Prop_Type;
26 26 use Elementor\Modules\AtomicWidgets\PropDependencies\Manager as Dependency_Manager;
27 -use Elementor\Modules\AtomicWidgets\PropTypes\Span_Prop_Type;
28 27
29 28 if ( ! defined( 'ABSPATH' ) ) {
30 29 exit; // Exit if accessed directly.
31 30 }
@@ -45,26 +44,25 @@
45 44 self::get_background_props(),
46 45 self::get_effects_props(),
47 46 self::get_layout_props(),
48 47 self::get_alignment_props(),
49 - self::get_special_props(),
50 48 );
51 49 }
52 50
53 51 private static function get_size_props() {
54 52 return [
55 - 'width' => Size_Prop_Type::make()->description( 'The width of the element' ),
56 - 'height' => Size_Prop_Type::make()->description( 'The height of the element' ),
57 - 'min-width' => Size_Prop_Type::make()->description( 'The minimum width of the element' ),
58 - 'min-height' => Size_Prop_Type::make()->description( 'The minimum height of the element' ),
59 - 'max-width' => Size_Prop_Type::make()->description( 'The maximum width of the element' ),
60 - 'max-height' => Size_Prop_Type::make()->description( 'The maximum height of the element' ),
53 + 'width' => Size_Prop_Type::make(),
54 + 'height' => Size_Prop_Type::make(),
55 + 'min-width' => Size_Prop_Type::make(),
56 + 'min-height' => Size_Prop_Type::make(),
57 + 'max-width' => Size_Prop_Type::make(),
58 + 'max-height' => Size_Prop_Type::make(),
61 59 'overflow' => String_Prop_Type::make()->enum( [
62 60 'visible',
63 61 'hidden',
64 62 'auto',
65 - ] )->description( 'The overflow CSS property. CSS values: visible, hidden, auto' ),
66 - 'aspect-ratio' => String_Prop_Type::make()->description( 'Equivalent to CSS aspect-ration property' ),
63 + ] ),
64 + 'aspect-ratio' => String_Prop_Type::make(),
67 65 'object-fit' => String_Prop_Type::make()->enum( [
68 66 'fill',
69 67 'cover',
70 68 'contain',
@@ -69,9 +67,9 @@
69 67 'cover',
70 68 'contain',
71 69 'none',
72 70 'scale-down',
73 - ] )->description( 'The object-fit CSS. CSS values: fill, cover, contain, none, scale-down' ),
71 + ] ),
74 72 'object-position' => Union_Prop_Type::make()
75 73 ->add_prop_type( String_Prop_Type::make()->enum( Position_Prop_Type::get_position_enum_values() ) )
76 74 ->add_prop_type( Position_Prop_Type::make() )
77 75 ->set_dependencies(
@@ -90,20 +88,8 @@
90 88 ];
91 89 }
92 90
93 91 private static function get_position_props() {
94 - $non_static_dependency = Dependency_Manager::make( Dependency_Manager::RELATION_AND )
95 - ->where( [
96 - 'operator' => 'exists',
97 - 'path' => [ 'position' ],
98 - ] )
99 - ->where( [
100 - 'operator' => 'ne',
101 - 'path' => [ 'position' ],
102 - 'value' => 'static',
103 - ] )
104 - ->get();
105 -
106 92 return [
107 93 'position' => String_Prop_Type::make()->enum( [
108 94 'static',
109 95 'relative',
@@ -109,23 +95,14 @@
109 95 'relative',
110 96 'absolute',
111 97 'fixed',
112 98 'sticky',
113 - ] )->description( 'The CSS position property specifies the type of positioning method used for an element (static, relative, absolute, fixed, or sticky).' ),
114 - 'inset-block-start' => Size_Prop_Type::make()
115 - ->description( 'Size PropType for the inset-block-start CSS property' )
116 - ->set_dependencies( $non_static_dependency ),
117 - 'inset-inline-end' => Size_Prop_Type::make()
118 - ->description( 'Size PropType for the inset-inline-end CSS property' )
119 - ->set_dependencies( $non_static_dependency ),
120 - 'inset-block-end' => Size_Prop_Type::make()
121 - ->description( 'Size PropType for the inset-block-end CSS property' )
122 - ->set_dependencies( $non_static_dependency ),
123 - 'inset-inline-start' => Size_Prop_Type::make()
124 - ->description( 'Size PropType for the inset-inline-start CSS property' )
125 - ->set_dependencies( $non_static_dependency ),
126 - 'z-index' => Number_Prop_Type::make()
127 - ->description( 'The z-index CSS property sets the z-order of a positioned element and its descendants or flex items. It specifies the stack order of elements.' ),
99 + ] ),
100 + 'inset-block-start' => Size_Prop_Type::make(),
101 + 'inset-inline-end' => Size_Prop_Type::make(),
102 + 'inset-block-end' => Size_Prop_Type::make(),
103 + 'inset-inline-start' => Size_Prop_Type::make(),
104 + 'z-index' => Number_Prop_Type::make(),
128 105 'scroll-margin-top' => Size_Prop_Type::make()->units( Size_Constants::anchor_offset() ),
129 106 ];
130 107 }
131 108
@@ -130,9 +107,9 @@
130 107 }
131 108
132 109 private static function get_typography_props() {
133 110 return [
134 - 'font-family' => String_Prop_Type::make()->description( 'The font family of the text content.' ),
111 + 'font-family' => String_Prop_Type::make(),
135 112 'font-weight' => String_Prop_Type::make()->enum( [
136 113 '100',
137 114 '200',
138 115 '300',
@@ -145,16 +122,14 @@
145 122 'normal',
146 123 'bold',
147 124 'bolder',
148 125 'lighter',
149 - ] )
150 - ->description( 'The weight (or boldness) of the font. Values should match css font-weight specifications.' ),
151 - 'font-size' => Size_Prop_Type::make()->units( Size_Constants::typography() )->description( 'The font size in Size PropType Format' ),
152 - 'color' => Color_Prop_Type::make()
153 - ->description( 'The text color, specified as a hex code, rgb(a), hsl(a), or a standard css color name.' ),
154 - 'letter-spacing' => Size_Prop_Type::make()->units( Size_Constants::typography() )->description( 'The spacing between letters in Size PropType format' ),
155 - 'word-spacing' => Size_Prop_Type::make()->units( Size_Constants::typography() )->description( 'The spacing between words in Size PropType format' ),
156 - 'column-count' => Number_Prop_Type::make()->description( 'The number of columns the text content should be divided into.' ),
126 + ] ),
127 + 'font-size' => Size_Prop_Type::make()->units( Size_Constants::typography() ),
128 + 'color' => Color_Prop_Type::make(),
129 + 'letter-spacing' => Size_Prop_Type::make()->units( Size_Constants::typography() ),
130 + 'word-spacing' => Size_Prop_Type::make()->units( Size_Constants::typography() ),
131 + 'column-count' => Number_Prop_Type::make(),
157 132 'column-gap' => Size_Prop_Type::make()
158 133 ->set_dependencies(
159 134 Dependency_Manager::make()
160 135 ->where( [
@@ -163,36 +138,32 @@
163 138 'value' => 1,
164 139 ] )
165 140 ->get()
166 141 ),
167 - 'line-height' => Size_Prop_Type::make()->units( Size_Constants::typography() )->description( 'The line height of the text content in Size PropType format' ),
142 + 'line-height' => Size_Prop_Type::make()->units( Size_Constants::typography() ),
168 143 'text-align' => String_Prop_Type::make()->enum( [
169 144 'start',
170 145 'center',
171 146 'end',
172 147 'justify',
173 - ] )
174 - ->description( 'The horizontal alignment of the text content. Allowed values: start, center, end, justify.' ),
148 + ] ),
175 149 'font-style' => String_Prop_Type::make()->enum( [
176 150 'normal',
177 151 'italic',
178 152 'oblique',
179 - ] )
180 - ->description( 'The font style of the text content. CSS values: normal, italic, oblique' ),
153 + ] ),
181 154 // TODO: validate text-decoration in more specific way [EDS-524]
182 - 'text-decoration' => String_Prop_Type::make()
183 - ->description( 'The text decoration style. CSS values like: none, underline, overline, line-through, blink, etc.' ),
155 + 'text-decoration' => String_Prop_Type::make(),
184 156 'text-transform' => String_Prop_Type::make()->enum( [
185 157 'none',
186 158 'capitalize',
187 159 'uppercase',
188 160 'lowercase',
189 - ] )
190 - ->description( 'Controls the capitalization of text. CSS values: none, capitalize, uppercase, lowercase' ),
161 + ] ),
191 162 'direction' => String_Prop_Type::make()->enum( [
192 163 'ltr',
193 164 'rtl',
194 - ] )->description( 'The text direction. CSS values: ltr (left to right), rtl (right to left)' ),
165 + ] ),
195 166 'stroke' => Stroke_Prop_Type::make(),
196 167 'all' => String_Prop_Type::make()->enum( [
197 168 'initial',
198 169 'inherit',
@@ -198,13 +169,12 @@
198 169 'inherit',
199 170 'unset',
200 171 'revert',
201 172 'revert-layer',
202 - ] )->description( 'The all CSS property. CSS values: initial, inherit, unset, revert, revert-layer' ),
173 + ] ),
203 174 'cursor' => String_Prop_Type::make()->enum( [
204 175 'pointer',
205 - ] )
206 - ->description( 'The type of cursor to be displayed when pointing over the element. E.g., pointer.' ),
176 + ] ),
207 177 ];
208 178 }
209 179
210 180 private static function get_spacing_props() {
@@ -210,20 +180,12 @@
210 180 private static function get_spacing_props() {
211 181 return [
212 182 'padding' => Union_Prop_Type::make()
213 183 ->add_prop_type( Dimensions_Prop_Type::make_with_units( Size_Constants::spacing() ) )
214 - ->add_prop_type(
215 - Size_Prop_Type::make()
216 - ->units( Size_Constants::spacing() )
217 - ->description( 'Padding css in Size PropType format' )
218 - ),
184 + ->add_prop_type( Size_Prop_Type::make()->units( Size_Constants::spacing() ) ),
219 185 'margin' => Union_Prop_Type::make()
220 - ->add_prop_type( Dimensions_Prop_Type::make_with_units( Size_Constants::spacing_margin() ) )
221 - ->add_prop_type(
222 - Size_Prop_Type::make()
223 - ->units( Size_Constants::spacing_margin() )
224 - ->description( 'Margin css in Size PropType format' )
225 - ),
186 + ->add_prop_type( Dimensions_Prop_Type::make() )
187 + ->add_prop_type( Size_Prop_Type::make() ),
226 188 ];
227 189 }
228 190
229 191 private static function get_border_props() {
@@ -228,14 +190,14 @@
228 190
229 191 private static function get_border_props() {
230 192 return [
231 193 'border-radius' => Union_Prop_Type::make()
232 - ->add_prop_type( Border_Radius_Prop_Type::make() )
233 - ->add_prop_type( Size_Prop_Type::make()->units( Size_Constants::border() ) ),
194 + ->add_prop_type( Size_Prop_Type::make()->units( Size_Constants::border() ) )
195 + ->add_prop_type( Border_Radius_Prop_Type::make() ),
234 196 'border-width' => Union_Prop_Type::make()
235 - ->add_prop_type( Border_Width_Prop_Type::make() )
236 - ->add_prop_type( Size_Prop_Type::make()->units( Size_Constants::border() ) ),
237 - 'border-color' => Color_Prop_Type::make()->description( 'The border color, specified as a hex code, rgb(a), hsl(a), or a standard css color name.' ),
197 + ->add_prop_type( Size_Prop_Type::make()->units( Size_Constants::border() ) )
198 + ->add_prop_type( Border_Width_Prop_Type::make() ),
199 + 'border-color' => Color_Prop_Type::make(),
238 200 'border-style' => String_Prop_Type::make()->enum( [
239 201 'none',
240 202 'hidden',
241 203 'dotted',
@@ -245,28 +207,9 @@
245 207 'groove',
246 208 'ridge',
247 209 'inset',
248 210 'outset',
249 - ] )
250 - ->description( 'The border style in CSS values' ),
251 - 'outline-width' => Size_Prop_Type::make()
252 - ->units( Size_Constants::border() )
253 - ->description( 'The width of the outline in Size PropType format' ),
254 - 'outline-color' => Color_Prop_Type::make()->description( 'The color of the outline, specified as a hex code, rgb(a), hsl(a), or a standard css color name.' ),
255 - 'outline-style' => String_Prop_Type::make()->enum( [
256 - 'none',
257 - 'hidden',
258 - 'dotted',
259 - 'dashed',
260 - 'solid',
261 - 'double',
262 - 'groove',
263 - 'ridge',
264 - 'inset',
265 - 'outset',
266 - ] )->description( 'The outline style in CSS values' ),
267 - 'outline-offset' => Size_Prop_Type::make()->units( Size_Constants::border() )->description( 'The offset of the outline, specified as a length in Size PropType format' ),
268 -
211 + ] ),
269 212 ];
270 213 }
271 214
272 215 private static function get_background_props() {
@@ -273,9 +216,9 @@
273 216 // Background image overlay as an exception
274 217 $background_prop_type = Background_Prop_Type::make();
275 218 $bg_overlay_prop_type = $background_prop_type->get_shape_field( Background_Overlay_Prop_Type::get_key() );
276 219 $bg_image_overlay_prop_type = $bg_overlay_prop_type->get_item_type()->get_prop_type( Background_Image_Overlay_Prop_Type::get_key() );
277 - Dynamic_Prop_Types_Mapping::make()->get_extended_schema( $bg_image_overlay_prop_type->get_shape() );
220 + Dynamic_Prop_Types_Mapping::make()->get_modified_prop_types( $bg_image_overlay_prop_type->get_shape() );
278 221 return [
279 222 'background' => $background_prop_type,
280 223 ];
281 224 }
@@ -281,29 +224,10 @@
281 224 }
282 225
283 226 private static function get_effects_props() {
284 227 return [
285 - 'mix-blend-mode' => String_Prop_Type::make()->enum( [
286 - 'normal',
287 - 'multiply',
288 - 'screen',
289 - 'overlay',
290 - 'darken',
291 - 'lighten',
292 - 'color-dodge',
293 - 'saturation',
294 - 'color',
295 - 'difference',
296 - 'exclusion',
297 - 'hue',
298 - 'luminosity',
299 - 'soft-light',
300 - 'hard-light',
301 - 'color-burn',
302 - ] )->description( 'Applied as mix-blend mode css effect.' ),
303 228 'box-shadow' => Box_Shadow_Prop_Type::make(),
304 229 'opacity' => Size_Prop_Type::make()
305 - ->description( 'The opacity of the element, specified as a percentage between 0 (fully transparent) and 100 (fully opaque).' )
306 230 ->units( Size_Constants::opacity() )
307 231 ->default_unit( Size_Constants::UNIT_PERCENT ),
308 232 'filter' => Filter_Prop_Type::make(),
309 233 'backdrop-filter' => Backdrop_Filter_Prop_Type::make(),
@@ -324,17 +248,15 @@
324 248 'inline-grid',
325 249 'flow-root',
326 250 'none',
327 251 'contents',
328 - ] )->description( 'The CSS display property defines the display behavior (the type of rendering box) of an element.' ),
329 - 'flex-direction' => String_Prop_Type::make()
330 - ->description( 'The direction of the contained items.' )
331 - ->enum( [
332 - 'row',
333 - 'row-reverse',
334 - 'column',
335 - 'column-reverse',
336 - ] ),
252 + ] ),
253 + 'flex-direction' => String_Prop_Type::make()->enum( [
254 + 'row',
255 + 'row-reverse',
256 + 'column',
257 + 'column-reverse',
258 + ] ),
337 259 'gap' => Union_Prop_Type::make()
338 260 ->add_prop_type( Layout_Direction_Prop_Type::make() )
339 261 ->add_prop_type( Size_Prop_Type::make()->units( Size_Constants::layout() ) ),
340 262 'flex-wrap' => String_Prop_Type::make()->enum( [
@@ -340,21 +262,10 @@
340 262 'flex-wrap' => String_Prop_Type::make()->enum( [
341 263 'wrap',
342 264 'nowrap',
343 265 'wrap-reverse',
344 - ] )->description( 'Specifies whether the flex items should wrap or not. CSS values: wrap, nowrap, wrap-reverse' ),
266 + ] ),
345 267 'flex' => Flex_Prop_Type::make(),
346 - 'grid-template-columns' => String_Prop_Type::make()
347 - ->description( 'Defines the columns of a grid container. Accepts any valid CSS grid-template-columns value, e.g. repeat(3, 1fr) or 100px 200px auto.' ),
348 - 'grid-template-rows' => String_Prop_Type::make()
349 - ->description( 'Defines the rows of a grid container. Accepts any valid CSS grid-template-rows value, e.g. repeat(3, 1fr) or 100px 200px auto.' ),
350 - 'grid-auto-flow' => String_Prop_Type::make()
351 - ->enum( [ 'row', 'column', 'row dense', 'column dense' ] )
352 - ->description( 'Controls how auto-placed items flow in the grid. CSS values: row, column, row dense, column dense.' ),
353 - 'grid-column' => Span_Prop_Type::make()
354 - ->description( 'Defines a grid item column placement. Accepts values like span N or any valid CSS grid-column value.' ),
355 - 'grid-row' => Span_Prop_Type::make()
356 - ->description( 'Defines a grid item row placement. Accepts values like span N or any valid CSS grid-row value.' ),
357 268 ];
358 269 }
359 270
360 271 private static function get_alignment_props() {
@@ -371,22 +282,9 @@
371 282 'space-between',
372 283 'space-around',
373 284 'space-evenly',
374 285 'stretch',
375 - ] )
376 - ->description( 'Defines how the browser distributes space between and around content items along the main-axis of a flex container. CSS values: center, start, end, flex-start, flex-end, left, right, normal, space-between, space-around, space-evenly, stretch' ),
377 - 'justify-items' => String_Prop_Type::make()->enum( [
378 - 'normal',
379 - 'stretch',
380 - 'center',
381 - 'start',
382 - 'end',
383 - 'flex-start',
384 - 'flex-end',
385 - 'left',
386 - 'right',
387 - 'anchor-center',
388 - ] )->description( 'Defines how the browser distributes space between and around content items along the inline axis of a grid container. CSS values: center, start, end, flex-start, flex-end, left, right' ),
286 + ] ),
389 287 'align-content' => String_Prop_Type::make()->enum( [
390 288 'center',
391 289 'start',
392 290 'end',
@@ -392,10 +290,9 @@
392 290 'end',
393 291 'space-between',
394 292 'space-around',
395 293 'space-evenly',
396 - ] )
397 - ->description( 'Aligns a flex container\'s lines within when there is extra space in the cross-axis. CSS values: center, start, end, space-between, space-around, space-evenly' ),
294 + ] ),
398 295 'align-items' => String_Prop_Type::make()->enum( [
399 296 'normal',
400 297 'stretch',
401 298 'center',
@@ -405,9 +302,9 @@
405 302 'flex-end',
406 303 'self-start',
407 304 'self-end',
408 305 'anchor-center',
409 - ] )->description( 'Defines the default behavior for how flex items are laid out along the cross axis on the current line. CSS values: normal, stretch, center, start, end, flex-start, flex-end, self-start, self-end, anchor-center' ),
306 + ] ),
410 307 'align-self' => String_Prop_Type::make()->enum( [
411 308 'auto',
412 309 'normal',
413 310 'center',
@@ -421,17 +318,9 @@
421 318 'baseline',
422 319 'first baseline',
423 320 'last baseline',
424 321 'stretch',
425 - ] )->description( 'Allows the default alignment (or the one specified by align-items) to be overridden for individual flex items. CSS values: auto, normal, center, start, end, self-start, self-end, flex-start, flex-end, anchor-center, baseline, first baseline, last baseline, stretch' ),
426 - 'order' => Number_Prop_Type::make()->description( 'Specifies the order of the flex items. Items with lower order values are displayed first.' ),
427 - ];
428 - }
429 -
430 - private static function get_special_props() {
431 - return [
432 - 'content' => String_Prop_Type::make()->description( 'The string content for pseudo-element content property' ),
433 - 'appearance' => String_Prop_Type::make()->enum( [ 'none', 'auto' ] )->description( 'The appearance of the element. CSS values: none, auto' ),
434 - 'clip-path' => String_Prop_Type::make()->description( 'The clip-path CSS property defines a shape to be used as clipping region.' ),
322 + ] ),
323 + 'order' => Number_Prop_Type::make(),
435 324 ];
436 325 }
437 326 }