← All changes
|
modules/atomic-widgets/styles/style-schema.php
+5
-86
4.2.1
→
3.35.0-dev2
View file →
| @@ -10,15 +10,13 @@ | ||
| 10 | 10 | use Elementor\Modules\AtomicWidgets\PropTypes\Border_Radius_Prop_Type; |
| 11 | 11 | use Elementor\Modules\AtomicWidgets\PropTypes\Border_Width_Prop_Type; |
| 12 | 12 | use Elementor\Modules\AtomicWidgets\PropTypes\Color_Prop_Type; |
| 13 | 13 | use Elementor\Modules\AtomicWidgets\PropTypes\Dimensions_Prop_Type; |
| 14 | -use Elementor\Modules\AtomicWidgets\PropTypes\Font_Family_Prop_Type; | |
| 15 | 14 | use Elementor\Modules\AtomicWidgets\PropTypes\Filters\Backdrop_Filter_Prop_Type; |
| 16 | 15 | use Elementor\Modules\AtomicWidgets\PropTypes\Filters\Filter_Prop_Type; |
| 17 | 16 | use Elementor\Modules\AtomicWidgets\PropTypes\Layout_Direction_Prop_Type; |
| 18 | 17 | use Elementor\Modules\AtomicWidgets\PropTypes\Position_Prop_Type; |
| 19 | 18 | use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\Number_Prop_Type; |
| 20 | -use Elementor\Modules\AtomicWidgets\PropTypes\Grid_Track_Size_Prop_Type; | |
| 21 | 19 | use Elementor\Modules\AtomicWidgets\PropTypes\Size_Prop_Type; |
| 22 | 20 | use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type; |
| 23 | 21 | use Elementor\Modules\AtomicWidgets\PropTypes\Stroke_Prop_Type; |
| 24 | 22 | use Elementor\Modules\AtomicWidgets\PropTypes\Transform\Transform_Prop_Type; |
| @@ -25,9 +23,8 @@ | ||
| 25 | 23 | use Elementor\Modules\AtomicWidgets\PropTypes\Transition_Prop_Type; |
| 26 | 24 | use Elementor\Modules\AtomicWidgets\PropTypes\Union_Prop_Type; |
| 27 | 25 | use Elementor\Modules\AtomicWidgets\PropTypes\Flex_Prop_Type; |
| 28 | 26 | use Elementor\Modules\AtomicWidgets\PropDependencies\Manager as Dependency_Manager; |
| 29 | -use Elementor\Modules\AtomicWidgets\PropTypes\Span_Prop_Type; | |
| 30 | 27 | |
| 31 | 28 | if ( ! defined( 'ABSPATH' ) ) { |
| 32 | 29 | exit; // Exit if accessed directly. |
| 33 | 30 | } |
| @@ -47,9 +44,8 @@ | ||
| 47 | 44 | self::get_background_props(), |
| 48 | 45 | self::get_effects_props(), |
| 49 | 46 | self::get_layout_props(), |
| 50 | 47 | self::get_alignment_props(), |
| 51 | - self::get_special_props(), | |
| 52 | 48 | ); |
| 53 | 49 | } |
| 54 | 50 | |
| 55 | 51 | private static function get_size_props() { |
| @@ -92,20 +88,8 @@ | ||
| 92 | 88 | ]; |
| 93 | 89 | } |
| 94 | 90 | |
| 95 | 91 | private static function get_position_props() { |
| 96 | - $non_static_dependency = Dependency_Manager::make( Dependency_Manager::RELATION_AND ) | |
| 97 | - ->where( [ | |
| 98 | - 'operator' => 'exists', | |
| 99 | - 'path' => [ 'position' ], | |
| 100 | - ] ) | |
| 101 | - ->where( [ | |
| 102 | - 'operator' => 'ne', | |
| 103 | - 'path' => [ 'position' ], | |
| 104 | - 'value' => 'static', | |
| 105 | - ] ) | |
| 106 | - ->get(); | |
| 107 | - | |
| 108 | 92 | return [ |
| 109 | 93 | 'position' => String_Prop_Type::make()->enum( [ |
| 110 | 94 | 'static', |
| 111 | 95 | 'relative', |
| @@ -112,20 +96,12 @@ | ||
| 112 | 96 | 'absolute', |
| 113 | 97 | 'fixed', |
| 114 | 98 | 'sticky', |
| 115 | 99 | ] )->description( 'The CSS position property specifies the type of positioning method used for an element (static, relative, absolute, fixed, or sticky).' ), |
| 116 | - 'inset-block-start' => Size_Prop_Type::make() | |
| 117 | - ->description( 'Size PropType for the inset-block-start CSS property' ) | |
| 118 | - ->set_dependencies( $non_static_dependency ), | |
| 119 | - 'inset-inline-end' => Size_Prop_Type::make() | |
| 120 | - ->description( 'Size PropType for the inset-inline-end CSS property' ) | |
| 121 | - ->set_dependencies( $non_static_dependency ), | |
| 122 | - 'inset-block-end' => Size_Prop_Type::make() | |
| 123 | - ->description( 'Size PropType for the inset-block-end CSS property' ) | |
| 124 | - ->set_dependencies( $non_static_dependency ), | |
| 125 | - 'inset-inline-start' => Size_Prop_Type::make() | |
| 126 | - ->description( 'Size PropType for the inset-inline-start CSS property' ) | |
| 127 | - ->set_dependencies( $non_static_dependency ), | |
| 100 | + 'inset-block-start' => Size_Prop_Type::make()->description( 'Size PropType for the inset-block-start CSS property' ), | |
| 101 | + 'inset-inline-end' => Size_Prop_Type::make()->description( 'Size PropType for the inset-inline-end CSS property' ), | |
| 102 | + 'inset-block-end' => Size_Prop_Type::make()->description( 'Size PropType for the inset-block-end CSS property' ), | |
| 103 | + 'inset-inline-start' => Size_Prop_Type::make()->description( 'Size PropType for the inset-inline-start CSS property' ), | |
| 128 | 104 | 'z-index' => Number_Prop_Type::make() |
| 129 | 105 | ->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.' ), |
| 130 | 106 | 'scroll-margin-top' => Size_Prop_Type::make()->units( Size_Constants::anchor_offset() ), |
| 131 | 107 | ]; |
| @@ -132,10 +108,9 @@ | ||
| 132 | 108 | } |
| 133 | 109 | |
| 134 | 110 | private static function get_typography_props() { |
| 135 | 111 | return [ |
| 136 | - 'font-family' => Font_Family_Prop_Type::make() | |
| 137 | - ->description( 'The font family of the text content.' ), | |
| 112 | + 'font-family' => String_Prop_Type::make()->description( 'The font family of the text content.' ), | |
| 138 | 113 | 'font-weight' => String_Prop_Type::make()->enum( [ |
| 139 | 114 | '100', |
| 140 | 115 | '200', |
| 141 | 116 | '300', |
| @@ -253,23 +228,8 @@ | ||
| 253 | 228 | ->description( 'The border style in CSS values' ), |
| 254 | 229 | 'outline-width' => Size_Prop_Type::make() |
| 255 | 230 | ->units( Size_Constants::border() ) |
| 256 | 231 | ->description( 'The width of the outline in Size PropType format' ), |
| 257 | - '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.' ), | |
| 258 | - 'outline-style' => String_Prop_Type::make()->enum( [ | |
| 259 | - 'none', | |
| 260 | - 'hidden', | |
| 261 | - 'dotted', | |
| 262 | - 'dashed', | |
| 263 | - 'solid', | |
| 264 | - 'double', | |
| 265 | - 'groove', | |
| 266 | - 'ridge', | |
| 267 | - 'inset', | |
| 268 | - 'outset', | |
| 269 | - ] )->description( 'The outline style in CSS values' ), | |
| 270 | - 'outline-offset' => Size_Prop_Type::make()->units( Size_Constants::border() )->description( 'The offset of the outline, specified as a length in Size PropType format' ), | |
| 271 | - | |
| 272 | 232 | ]; |
| 273 | 233 | } |
| 274 | 234 | |
| 275 | 235 | private static function get_background_props() { |
| @@ -345,29 +305,8 @@ | ||
| 345 | 305 | 'nowrap', |
| 346 | 306 | 'wrap-reverse', |
| 347 | 307 | ] )->description( 'Specifies whether the flex items should wrap or not. CSS values: wrap, nowrap, wrap-reverse' ), |
| 348 | 308 | 'flex' => Flex_Prop_Type::make(), |
| 349 | - 'grid-template-columns' => Union_Prop_Type::make() | |
| 350 | - ->add_prop_type( String_Prop_Type::make() ) | |
| 351 | - ->add_prop_type( Grid_Track_Size_Prop_Type::make()->units( Size_Constants::grid_track() ) ), | |
| 352 | - 'grid-template-rows' => Union_Prop_Type::make() | |
| 353 | - ->add_prop_type( String_Prop_Type::make() ) | |
| 354 | - ->add_prop_type( Grid_Track_Size_Prop_Type::make()->units( Size_Constants::grid_track() ) ), | |
| 355 | - 'grid-auto-flow' => String_Prop_Type::make() | |
| 356 | - ->enum( [ 'row', 'column', 'row dense', 'column dense' ] ) | |
| 357 | - ->description( 'Controls how auto-placed items flow in the grid. CSS values: row, column, row dense, column dense.' ), | |
| 358 | - 'grid-auto-rows' => Size_Prop_Type::make() | |
| 359 | - ->units( Size_Constants::grid_auto_track() ) | |
| 360 | - ->default_unit( Size_Constants::UNIT_FR ), | |
| 361 | - 'grid-auto-columns' => Size_Prop_Type::make() | |
| 362 | - ->units( Size_Constants::grid_auto_track() ) | |
| 363 | - ->default_unit( Size_Constants::UNIT_FR ), | |
| 364 | - 'grid-column' => Span_Prop_Type::make() | |
| 365 | - ->regex( '/^(?!.*https?:\/\/)(?!.*;).*$/' ) | |
| 366 | - ->description( 'Defines a grid item column placement. Accepts values like span N or any valid CSS grid-column value. Disallows URLs and semicolons.' ), | |
| 367 | - 'grid-row' => Span_Prop_Type::make() | |
| 368 | - ->regex( '/^(?!.*https?:\/\/)(?!.*;).*$/' ) | |
| 369 | - ->description( 'Defines a grid item row placement. Accepts values like span N or any valid CSS grid-row value. Disallows URLs and semicolons.' ), | |
| 370 | 309 | ]; |
| 371 | 310 | } |
| 372 | 311 | |
| 373 | 312 | private static function get_alignment_props() { |
| @@ -386,20 +325,8 @@ | ||
| 386 | 325 | 'space-evenly', |
| 387 | 326 | 'stretch', |
| 388 | 327 | ] ) |
| 389 | 328 | ->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' ), |
| 390 | - 'justify-items' => String_Prop_Type::make()->enum( [ | |
| 391 | - 'normal', | |
| 392 | - 'stretch', | |
| 393 | - 'center', | |
| 394 | - 'start', | |
| 395 | - 'end', | |
| 396 | - 'flex-start', | |
| 397 | - 'flex-end', | |
| 398 | - 'left', | |
| 399 | - 'right', | |
| 400 | - 'anchor-center', | |
| 401 | - ] )->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' ), | |
| 402 | 329 | 'align-content' => String_Prop_Type::make()->enum( [ |
| 403 | 330 | 'center', |
| 404 | 331 | 'start', |
| 405 | 332 | 'end', |
| @@ -436,15 +363,7 @@ | ||
| 436 | 363 | 'last baseline', |
| 437 | 364 | 'stretch', |
| 438 | 365 | ] )->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' ), |
| 439 | 366 | 'order' => Number_Prop_Type::make()->description( 'Specifies the order of the flex items. Items with lower order values are displayed first.' ), |
| 440 | - ]; | |
| 441 | - } | |
| 442 | - | |
| 443 | - private static function get_special_props() { | |
| 444 | - return [ | |
| 445 | - 'content' => String_Prop_Type::make()->description( 'The string content for pseudo-element content property' ), | |
| 446 | - 'appearance' => String_Prop_Type::make()->enum( [ 'none', 'auto' ] )->description( 'The appearance of the element. CSS values: none, auto' ), | |
| 447 | - 'clip-path' => String_Prop_Type::make()->description( 'The clip-path CSS property defines a shape to be used as clipping region.' ), | |
| 448 | 367 | ]; |
| 449 | 368 | } |
| 450 | 369 | } |