| @@ -10,13 +10,15 @@ | ||
| 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; | |
| 14 | 15 | use Elementor\Modules\AtomicWidgets\PropTypes\Filters\Backdrop_Filter_Prop_Type; |
| 15 | 16 | use Elementor\Modules\AtomicWidgets\PropTypes\Filters\Filter_Prop_Type; |
| 16 | 17 | use Elementor\Modules\AtomicWidgets\PropTypes\Layout_Direction_Prop_Type; |
| 17 | 18 | use Elementor\Modules\AtomicWidgets\PropTypes\Position_Prop_Type; |
| 18 | 19 | use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\Number_Prop_Type; |
| 20 | +use Elementor\Modules\AtomicWidgets\PropTypes\Grid_Track_Size_Prop_Type; | |
| 19 | 21 | use Elementor\Modules\AtomicWidgets\PropTypes\Size_Prop_Type; |
| 20 | 22 | use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type; |
| 21 | 23 | use Elementor\Modules\AtomicWidgets\PropTypes\Stroke_Prop_Type; |
| 22 | 24 | use Elementor\Modules\AtomicWidgets\PropTypes\Transform\Transform_Prop_Type; |
| @@ -23,8 +25,9 @@ | ||
| 23 | 25 | use Elementor\Modules\AtomicWidgets\PropTypes\Transition_Prop_Type; |
| 24 | 26 | use Elementor\Modules\AtomicWidgets\PropTypes\Union_Prop_Type; |
| 25 | 27 | use Elementor\Modules\AtomicWidgets\PropTypes\Flex_Prop_Type; |
| 26 | 28 | use Elementor\Modules\AtomicWidgets\PropDependencies\Manager as Dependency_Manager; |
| 29 | +use Elementor\Modules\AtomicWidgets\PropTypes\Span_Prop_Type; | |
| 27 | 30 | |
| 28 | 31 | if ( ! defined( 'ABSPATH' ) ) { |
| 29 | 32 | exit; // Exit if accessed directly. |
| 30 | 33 | } |
| @@ -89,8 +92,20 @@ | ||
| 89 | 92 | ]; |
| 90 | 93 | } |
| 91 | 94 | |
| 92 | 95 | 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 | + | |
| 93 | 108 | return [ |
| 94 | 109 | 'position' => String_Prop_Type::make()->enum( [ |
| 95 | 110 | 'static', |
| 96 | 111 | 'relative', |
| @@ -97,12 +112,20 @@ | ||
| 97 | 112 | 'absolute', |
| 98 | 113 | 'fixed', |
| 99 | 114 | 'sticky', |
| 100 | 115 | ] )->description( 'The CSS position property specifies the type of positioning method used for an element (static, relative, absolute, fixed, or sticky).' ), |
| 101 | - 'inset-block-start' => Size_Prop_Type::make()->description( 'Size PropType for the inset-block-start CSS property' ), | |
| 102 | - 'inset-inline-end' => Size_Prop_Type::make()->description( 'Size PropType for the inset-inline-end CSS property' ), | |
| 103 | - 'inset-block-end' => Size_Prop_Type::make()->description( 'Size PropType for the inset-block-end CSS property' ), | |
| 104 | - 'inset-inline-start' => Size_Prop_Type::make()->description( 'Size PropType for the inset-inline-start CSS property' ), | |
| 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 ), | |
| 105 | 128 | 'z-index' => Number_Prop_Type::make() |
| 106 | 129 | ->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.' ), |
| 107 | 130 | 'scroll-margin-top' => Size_Prop_Type::make()->units( Size_Constants::anchor_offset() ), |
| 108 | 131 | ]; |
| @@ -109,9 +132,10 @@ | ||
| 109 | 132 | } |
| 110 | 133 | |
| 111 | 134 | private static function get_typography_props() { |
| 112 | 135 | return [ |
| 113 | - 'font-family' => String_Prop_Type::make()->description( 'The font family of the text content.' ), | |
| 136 | + 'font-family' => Font_Family_Prop_Type::make() | |
| 137 | + ->description( 'The font family of the text content.' ), | |
| 114 | 138 | 'font-weight' => String_Prop_Type::make()->enum( [ |
| 115 | 139 | '100', |
| 116 | 140 | '200', |
| 117 | 141 | '300', |
| @@ -321,8 +345,29 @@ | ||
| 321 | 345 | 'nowrap', |
| 322 | 346 | 'wrap-reverse', |
| 323 | 347 | ] )->description( 'Specifies whether the flex items should wrap or not. CSS values: wrap, nowrap, wrap-reverse' ), |
| 324 | 348 | '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.' ), | |
| 325 | 370 | ]; |
| 326 | 371 | } |
| 327 | 372 | |
| 328 | 373 | private static function get_alignment_props() { |