@elementor/editor-props 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/index.d.mts +231 -9
- package/dist/index.d.ts +231 -9
- package/dist/index.js +79 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +74 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/prop-types/filter-prop-types/blur-filter.ts +8 -0
- package/src/prop-types/filter-prop-types/brightness-filter.ts +8 -0
- package/src/prop-types/filter-prop-types/filter.ts +12 -0
- package/src/prop-types/index.ts +3 -0
- package/src/prop-types/key-value.ts +1 -1
- package/src/types.ts +30 -0
- package/src/utils/prop-dependency-utils.ts +83 -0
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
import { ZodType, z } from '@elementor/schema';
|
|
2
2
|
|
|
3
3
|
type PropTypeKey = string;
|
|
4
|
+
type DependencyEffect = 'disable' | 'hide';
|
|
5
|
+
type DependencyOperator = 'lt' | 'lte' | 'eq' | 'ne' | 'gte' | 'gt' | 'exists' | 'not_exist' | 'in' | 'nin' | 'contains' | 'ncontains';
|
|
6
|
+
type DependencyTerm<THasActualValue extends boolean = false> = {
|
|
7
|
+
operator: DependencyOperator;
|
|
8
|
+
path: string[];
|
|
9
|
+
value: PropValue;
|
|
10
|
+
actualValue: THasActualValue extends true ? PropValue : never;
|
|
11
|
+
};
|
|
12
|
+
type Dependency<THasActualValue extends boolean = false> = {
|
|
13
|
+
effect: DependencyEffect;
|
|
14
|
+
relation: 'or' | 'and';
|
|
15
|
+
terms: (DependencyTerm<THasActualValue> | Dependency<THasActualValue>)[];
|
|
16
|
+
};
|
|
4
17
|
type BasePropType<TValue> = {
|
|
5
18
|
default?: TValue | null;
|
|
6
19
|
settings: Record<string, unknown>;
|
|
7
20
|
meta: Record<string, unknown>;
|
|
21
|
+
dependencies?: Dependency[];
|
|
8
22
|
};
|
|
9
23
|
type PlainPropType = BasePropType<PlainPropValue> & {
|
|
10
24
|
kind: 'plain';
|
|
@@ -1977,7 +1991,7 @@ declare const keyValuePropTypeUtil: {
|
|
|
1977
1991
|
value?: any;
|
|
1978
1992
|
key?: any;
|
|
1979
1993
|
} | null;
|
|
1980
|
-
isValid: (prop: unknown) => prop is TransformablePropValue$1<"
|
|
1994
|
+
isValid: (prop: unknown) => prop is TransformablePropValue$1<"key-value", {
|
|
1981
1995
|
value?: any;
|
|
1982
1996
|
key?: any;
|
|
1983
1997
|
}>;
|
|
@@ -1985,14 +1999,14 @@ declare const keyValuePropTypeUtil: {
|
|
|
1985
1999
|
(value: {
|
|
1986
2000
|
value?: any;
|
|
1987
2001
|
key?: any;
|
|
1988
|
-
}): TransformablePropValue$1<"
|
|
2002
|
+
}): TransformablePropValue$1<"key-value", {
|
|
1989
2003
|
value?: any;
|
|
1990
2004
|
key?: any;
|
|
1991
2005
|
}>;
|
|
1992
2006
|
(value: {
|
|
1993
2007
|
value?: any;
|
|
1994
2008
|
key?: any;
|
|
1995
|
-
}, createOptions?: CreateOptions): TransformablePropValue$1<"
|
|
2009
|
+
}, createOptions?: CreateOptions): TransformablePropValue$1<"key-value", {
|
|
1996
2010
|
value?: any;
|
|
1997
2011
|
key?: any;
|
|
1998
2012
|
}>;
|
|
@@ -2002,13 +2016,13 @@ declare const keyValuePropTypeUtil: {
|
|
|
2002
2016
|
} | undefined) => {
|
|
2003
2017
|
value?: any;
|
|
2004
2018
|
key?: any;
|
|
2005
|
-
}, createOptions: CreateOptions): TransformablePropValue$1<"
|
|
2019
|
+
}, createOptions: CreateOptions): TransformablePropValue$1<"key-value", {
|
|
2006
2020
|
value?: any;
|
|
2007
2021
|
key?: any;
|
|
2008
2022
|
}>;
|
|
2009
2023
|
};
|
|
2010
2024
|
schema: z.ZodObject<{
|
|
2011
|
-
$$type: z.ZodLiteral<"
|
|
2025
|
+
$$type: z.ZodLiteral<"key-value">;
|
|
2012
2026
|
value: z.ZodType<{
|
|
2013
2027
|
value?: any;
|
|
2014
2028
|
key?: any;
|
|
@@ -2018,21 +2032,21 @@ declare const keyValuePropTypeUtil: {
|
|
|
2018
2032
|
}>;
|
|
2019
2033
|
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
2020
2034
|
}, "strict", z.ZodTypeAny, {
|
|
2021
|
-
$$type: "
|
|
2035
|
+
$$type: "key-value";
|
|
2022
2036
|
value: {
|
|
2023
2037
|
value?: any;
|
|
2024
2038
|
key?: any;
|
|
2025
2039
|
};
|
|
2026
2040
|
disabled?: boolean | undefined;
|
|
2027
2041
|
}, {
|
|
2028
|
-
$$type: "
|
|
2042
|
+
$$type: "key-value";
|
|
2029
2043
|
value: {
|
|
2030
2044
|
value?: any;
|
|
2031
2045
|
key?: any;
|
|
2032
2046
|
};
|
|
2033
2047
|
disabled?: boolean | undefined;
|
|
2034
2048
|
}>;
|
|
2035
|
-
key: "
|
|
2049
|
+
key: "key-value";
|
|
2036
2050
|
};
|
|
2037
2051
|
type KeyValuePropValue = z.infer<typeof keyValuePropTypeUtil.schema>;
|
|
2038
2052
|
|
|
@@ -2438,8 +2452,216 @@ declare const positionPropTypeUtil: {
|
|
|
2438
2452
|
};
|
|
2439
2453
|
type PositionPropTypeValue = z.infer<typeof positionPropTypeUtil.schema>;
|
|
2440
2454
|
|
|
2455
|
+
declare const filterTypes: z.ZodUnion<[z.ZodObject<{
|
|
2456
|
+
$$type: z.ZodLiteral<"blur">;
|
|
2457
|
+
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
2458
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
2459
|
+
}, "strict", z.ZodTypeAny, {
|
|
2460
|
+
$$type: "blur";
|
|
2461
|
+
value?: any;
|
|
2462
|
+
disabled?: boolean | undefined;
|
|
2463
|
+
}, {
|
|
2464
|
+
$$type: "blur";
|
|
2465
|
+
value?: any;
|
|
2466
|
+
disabled?: boolean | undefined;
|
|
2467
|
+
}>, z.ZodObject<{
|
|
2468
|
+
$$type: z.ZodLiteral<"brightness">;
|
|
2469
|
+
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
2470
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
2471
|
+
}, "strict", z.ZodTypeAny, {
|
|
2472
|
+
$$type: "brightness";
|
|
2473
|
+
value?: any;
|
|
2474
|
+
disabled?: boolean | undefined;
|
|
2475
|
+
}, {
|
|
2476
|
+
$$type: "brightness";
|
|
2477
|
+
value?: any;
|
|
2478
|
+
disabled?: boolean | undefined;
|
|
2479
|
+
}>]>;
|
|
2480
|
+
declare const filterPropTypeUtil: {
|
|
2481
|
+
extract: (prop: unknown) => ({
|
|
2482
|
+
$$type: "blur";
|
|
2483
|
+
value?: any;
|
|
2484
|
+
disabled?: boolean | undefined;
|
|
2485
|
+
} | {
|
|
2486
|
+
$$type: "brightness";
|
|
2487
|
+
value?: any;
|
|
2488
|
+
disabled?: boolean | undefined;
|
|
2489
|
+
})[] | null;
|
|
2490
|
+
isValid: (prop: unknown) => prop is TransformablePropValue$1<"filter", ({
|
|
2491
|
+
$$type: "blur";
|
|
2492
|
+
value?: any;
|
|
2493
|
+
disabled?: boolean | undefined;
|
|
2494
|
+
} | {
|
|
2495
|
+
$$type: "brightness";
|
|
2496
|
+
value?: any;
|
|
2497
|
+
disabled?: boolean | undefined;
|
|
2498
|
+
})[]>;
|
|
2499
|
+
create: {
|
|
2500
|
+
(value: ({
|
|
2501
|
+
$$type: "blur";
|
|
2502
|
+
value?: any;
|
|
2503
|
+
disabled?: boolean | undefined;
|
|
2504
|
+
} | {
|
|
2505
|
+
$$type: "brightness";
|
|
2506
|
+
value?: any;
|
|
2507
|
+
disabled?: boolean | undefined;
|
|
2508
|
+
})[]): TransformablePropValue$1<"filter", ({
|
|
2509
|
+
$$type: "blur";
|
|
2510
|
+
value?: any;
|
|
2511
|
+
disabled?: boolean | undefined;
|
|
2512
|
+
} | {
|
|
2513
|
+
$$type: "brightness";
|
|
2514
|
+
value?: any;
|
|
2515
|
+
disabled?: boolean | undefined;
|
|
2516
|
+
})[]>;
|
|
2517
|
+
(value: ({
|
|
2518
|
+
$$type: "blur";
|
|
2519
|
+
value?: any;
|
|
2520
|
+
disabled?: boolean | undefined;
|
|
2521
|
+
} | {
|
|
2522
|
+
$$type: "brightness";
|
|
2523
|
+
value?: any;
|
|
2524
|
+
disabled?: boolean | undefined;
|
|
2525
|
+
})[], createOptions?: CreateOptions): TransformablePropValue$1<"filter", ({
|
|
2526
|
+
$$type: "blur";
|
|
2527
|
+
value?: any;
|
|
2528
|
+
disabled?: boolean | undefined;
|
|
2529
|
+
} | {
|
|
2530
|
+
$$type: "brightness";
|
|
2531
|
+
value?: any;
|
|
2532
|
+
disabled?: boolean | undefined;
|
|
2533
|
+
})[]>;
|
|
2534
|
+
(value: (prev?: ({
|
|
2535
|
+
$$type: "blur";
|
|
2536
|
+
value?: any;
|
|
2537
|
+
disabled?: boolean | undefined;
|
|
2538
|
+
} | {
|
|
2539
|
+
$$type: "brightness";
|
|
2540
|
+
value?: any;
|
|
2541
|
+
disabled?: boolean | undefined;
|
|
2542
|
+
})[] | undefined) => ({
|
|
2543
|
+
$$type: "blur";
|
|
2544
|
+
value?: any;
|
|
2545
|
+
disabled?: boolean | undefined;
|
|
2546
|
+
} | {
|
|
2547
|
+
$$type: "brightness";
|
|
2548
|
+
value?: any;
|
|
2549
|
+
disabled?: boolean | undefined;
|
|
2550
|
+
})[], createOptions: CreateOptions): TransformablePropValue$1<"filter", ({
|
|
2551
|
+
$$type: "blur";
|
|
2552
|
+
value?: any;
|
|
2553
|
+
disabled?: boolean | undefined;
|
|
2554
|
+
} | {
|
|
2555
|
+
$$type: "brightness";
|
|
2556
|
+
value?: any;
|
|
2557
|
+
disabled?: boolean | undefined;
|
|
2558
|
+
})[]>;
|
|
2559
|
+
};
|
|
2560
|
+
schema: z.ZodObject<{
|
|
2561
|
+
$$type: z.ZodLiteral<"filter">;
|
|
2562
|
+
value: z.ZodType<({
|
|
2563
|
+
$$type: "blur";
|
|
2564
|
+
value?: any;
|
|
2565
|
+
disabled?: boolean | undefined;
|
|
2566
|
+
} | {
|
|
2567
|
+
$$type: "brightness";
|
|
2568
|
+
value?: any;
|
|
2569
|
+
disabled?: boolean | undefined;
|
|
2570
|
+
})[], z.ZodTypeDef, ({
|
|
2571
|
+
$$type: "blur";
|
|
2572
|
+
value?: any;
|
|
2573
|
+
disabled?: boolean | undefined;
|
|
2574
|
+
} | {
|
|
2575
|
+
$$type: "brightness";
|
|
2576
|
+
value?: any;
|
|
2577
|
+
disabled?: boolean | undefined;
|
|
2578
|
+
})[]>;
|
|
2579
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
2580
|
+
}, "strict", z.ZodTypeAny, {
|
|
2581
|
+
$$type: "filter";
|
|
2582
|
+
value: ({
|
|
2583
|
+
$$type: "blur";
|
|
2584
|
+
value?: any;
|
|
2585
|
+
disabled?: boolean | undefined;
|
|
2586
|
+
} | {
|
|
2587
|
+
$$type: "brightness";
|
|
2588
|
+
value?: any;
|
|
2589
|
+
disabled?: boolean | undefined;
|
|
2590
|
+
})[];
|
|
2591
|
+
disabled?: boolean | undefined;
|
|
2592
|
+
}, {
|
|
2593
|
+
$$type: "filter";
|
|
2594
|
+
value: ({
|
|
2595
|
+
$$type: "blur";
|
|
2596
|
+
value?: any;
|
|
2597
|
+
disabled?: boolean | undefined;
|
|
2598
|
+
} | {
|
|
2599
|
+
$$type: "brightness";
|
|
2600
|
+
value?: any;
|
|
2601
|
+
disabled?: boolean | undefined;
|
|
2602
|
+
})[];
|
|
2603
|
+
disabled?: boolean | undefined;
|
|
2604
|
+
}>;
|
|
2605
|
+
key: "filter";
|
|
2606
|
+
};
|
|
2607
|
+
type FilterPropValue = z.infer<typeof filterPropTypeUtil.schema>;
|
|
2608
|
+
type FilterItemPropValue = z.infer<typeof filterTypes>;
|
|
2609
|
+
|
|
2610
|
+
declare const blurFilterPropTypeUtil: {
|
|
2611
|
+
extract: (prop: unknown) => any;
|
|
2612
|
+
isValid: (prop: unknown) => prop is TransformablePropValue$1<"blur", any>;
|
|
2613
|
+
create: {
|
|
2614
|
+
(value: any): TransformablePropValue$1<"blur", any>;
|
|
2615
|
+
(value: any, createOptions?: CreateOptions): TransformablePropValue$1<"blur", any>;
|
|
2616
|
+
(value: (prev?: any) => any, createOptions: CreateOptions): TransformablePropValue$1<"blur", any>;
|
|
2617
|
+
};
|
|
2618
|
+
schema: z.ZodObject<{
|
|
2619
|
+
$$type: z.ZodLiteral<"blur">;
|
|
2620
|
+
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
2621
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
2622
|
+
}, "strict", z.ZodTypeAny, {
|
|
2623
|
+
$$type: "blur";
|
|
2624
|
+
value?: any;
|
|
2625
|
+
disabled?: boolean | undefined;
|
|
2626
|
+
}, {
|
|
2627
|
+
$$type: "blur";
|
|
2628
|
+
value?: any;
|
|
2629
|
+
disabled?: boolean | undefined;
|
|
2630
|
+
}>;
|
|
2631
|
+
key: "blur";
|
|
2632
|
+
};
|
|
2633
|
+
type BlurFilterPropValue = z.infer<typeof blurFilterPropTypeUtil.schema>;
|
|
2634
|
+
|
|
2635
|
+
declare const brightnessFilterPropTypeUtil: {
|
|
2636
|
+
extract: (prop: unknown) => any;
|
|
2637
|
+
isValid: (prop: unknown) => prop is TransformablePropValue$1<"brightness", any>;
|
|
2638
|
+
create: {
|
|
2639
|
+
(value: any): TransformablePropValue$1<"brightness", any>;
|
|
2640
|
+
(value: any, createOptions?: CreateOptions): TransformablePropValue$1<"brightness", any>;
|
|
2641
|
+
(value: (prev?: any) => any, createOptions: CreateOptions): TransformablePropValue$1<"brightness", any>;
|
|
2642
|
+
};
|
|
2643
|
+
schema: z.ZodObject<{
|
|
2644
|
+
$$type: z.ZodLiteral<"brightness">;
|
|
2645
|
+
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
2646
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
2647
|
+
}, "strict", z.ZodTypeAny, {
|
|
2648
|
+
$$type: "brightness";
|
|
2649
|
+
value?: any;
|
|
2650
|
+
disabled?: boolean | undefined;
|
|
2651
|
+
}, {
|
|
2652
|
+
$$type: "brightness";
|
|
2653
|
+
value?: any;
|
|
2654
|
+
disabled?: boolean | undefined;
|
|
2655
|
+
}>;
|
|
2656
|
+
key: "brightness";
|
|
2657
|
+
};
|
|
2658
|
+
type BrightnessFilterPropValue = z.infer<typeof brightnessFilterPropTypeUtil.schema>;
|
|
2659
|
+
|
|
2441
2660
|
declare function mergeProps(current: Props, updates: Props): Props;
|
|
2442
2661
|
|
|
2662
|
+
declare function shouldApplyEffect({ relation, terms }: Dependency<true>): boolean;
|
|
2663
|
+
declare function evaluateTerm(term: DependencyTerm<true>, actualValue: PropValue): boolean;
|
|
2664
|
+
|
|
2443
2665
|
declare const transformableSchema: z.ZodObject<{
|
|
2444
2666
|
$$type: z.ZodString;
|
|
2445
2667
|
value: z.ZodAny;
|
|
@@ -2460,4 +2682,4 @@ declare const filterEmptyValues: <TValue extends PropValue>(value: TValue) => TV
|
|
|
2460
2682
|
type Nullish = null | undefined | '';
|
|
2461
2683
|
declare const isEmpty: (value: PropValue) => value is Nullish;
|
|
2462
2684
|
|
|
2463
|
-
export { type AnyTransformable, type ArrayPropType, type ArrayPropValue, type BackgroundColorOverlayPropValue, type BackgroundGradientOverlayPropValue, type BackgroundImageOverlayPropValue, type BackgroundImagePositionOffsetPropValue, type BackgroundImageSizeScalePropValue, type BackgroundOverlayImagePropType, type BackgroundOverlayItemPropValue, type BackgroundOverlayPropType, type BackgroundOverlayPropValue, type BackgroundPropValue, type BooleanPropValue, type BorderRadiusPropValue, type BorderWidthPropValue, type BoxShadowPropValue, CLASSES_PROP_KEY, type ClassesPropValue, type ColorPropValue, type ColorStopPropValue, type CreateOptions, type DimensionsPropValue, type GradientColorStopPropValue, type ImageAttachmentIdPropValue, type ImagePropValue, type ImageSrcPropValue, type KeyValuePropValue, type LayoutDirectionPropValue, type LinkPropValue, type NumberPropValue, type ObjectPropType, type ObjectPropValue, type PlainPropType, type PlainPropValue, type PositionPropTypeValue, type PropKey, type PropType, type PropTypeKey, type PropTypeUtil, type PropValue, type Props, type PropsSchema, type ShadowPropValue, type SizePropValue, type StringPropValue, type StrokePropValue, type TransformablePropType, type TransformablePropValue$1 as TransformablePropValue, type UnionPropType, type UrlPropValue, backgroundColorOverlayPropTypeUtil, backgroundGradientOverlayPropTypeUtil, backgroundImageOverlayPropTypeUtil, backgroundImagePositionOffsetPropTypeUtil, backgroundImageSizeScalePropTypeUtil, backgroundOverlayPropTypeUtil, backgroundPropTypeUtil, booleanPropTypeUtil, borderRadiusPropTypeUtil, borderWidthPropTypeUtil, boxShadowPropTypeUtil, classesPropTypeUtil, colorPropTypeUtil, colorStopPropTypeUtil, createArrayPropUtils, createPropUtils, dimensionsPropTypeUtil, filterEmptyValues, gradientColorStopPropTypeUtil, imageAttachmentIdPropType, imagePropTypeUtil, imageSrcPropTypeUtil, isEmpty, isTransformable, keyValuePropTypeUtil, layoutDirectionPropTypeUtil, linkPropTypeUtil, mergeProps, numberPropTypeUtil, positionPropTypeUtil, shadowPropTypeUtil, sizePropTypeUtil, stringPropTypeUtil, strokePropTypeUtil, urlPropTypeUtil };
|
|
2685
|
+
export { type AnyTransformable, type ArrayPropType, type ArrayPropValue, type BackgroundColorOverlayPropValue, type BackgroundGradientOverlayPropValue, type BackgroundImageOverlayPropValue, type BackgroundImagePositionOffsetPropValue, type BackgroundImageSizeScalePropValue, type BackgroundOverlayImagePropType, type BackgroundOverlayItemPropValue, type BackgroundOverlayPropType, type BackgroundOverlayPropValue, type BackgroundPropValue, type BlurFilterPropValue, type BooleanPropValue, type BorderRadiusPropValue, type BorderWidthPropValue, type BoxShadowPropValue, type BrightnessFilterPropValue, CLASSES_PROP_KEY, type ClassesPropValue, type ColorPropValue, type ColorStopPropValue, type CreateOptions, type Dependency, type DependencyEffect, type DependencyOperator, type DependencyTerm, type DimensionsPropValue, type FilterItemPropValue, type FilterPropValue, type GradientColorStopPropValue, type ImageAttachmentIdPropValue, type ImagePropValue, type ImageSrcPropValue, type KeyValuePropValue, type LayoutDirectionPropValue, type LinkPropValue, type NumberPropValue, type ObjectPropType, type ObjectPropValue, type PlainPropType, type PlainPropValue, type PositionPropTypeValue, type PropKey, type PropType, type PropTypeKey, type PropTypeUtil, type PropValue, type Props, type PropsSchema, type ShadowPropValue, type SizePropValue, type StringPropValue, type StrokePropValue, type TransformablePropType, type TransformablePropValue$1 as TransformablePropValue, type UnionPropType, type UrlPropValue, backgroundColorOverlayPropTypeUtil, backgroundGradientOverlayPropTypeUtil, backgroundImageOverlayPropTypeUtil, backgroundImagePositionOffsetPropTypeUtil, backgroundImageSizeScalePropTypeUtil, backgroundOverlayPropTypeUtil, backgroundPropTypeUtil, blurFilterPropTypeUtil, booleanPropTypeUtil, borderRadiusPropTypeUtil, borderWidthPropTypeUtil, boxShadowPropTypeUtil, brightnessFilterPropTypeUtil, classesPropTypeUtil, colorPropTypeUtil, colorStopPropTypeUtil, createArrayPropUtils, createPropUtils, dimensionsPropTypeUtil, evaluateTerm, filterEmptyValues, filterPropTypeUtil, gradientColorStopPropTypeUtil, imageAttachmentIdPropType, imagePropTypeUtil, imageSrcPropTypeUtil, isEmpty, isTransformable, keyValuePropTypeUtil, layoutDirectionPropTypeUtil, linkPropTypeUtil, mergeProps, numberPropTypeUtil, positionPropTypeUtil, shadowPropTypeUtil, shouldApplyEffect, sizePropTypeUtil, stringPropTypeUtil, strokePropTypeUtil, urlPropTypeUtil };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
import { ZodType, z } from '@elementor/schema';
|
|
2
2
|
|
|
3
3
|
type PropTypeKey = string;
|
|
4
|
+
type DependencyEffect = 'disable' | 'hide';
|
|
5
|
+
type DependencyOperator = 'lt' | 'lte' | 'eq' | 'ne' | 'gte' | 'gt' | 'exists' | 'not_exist' | 'in' | 'nin' | 'contains' | 'ncontains';
|
|
6
|
+
type DependencyTerm<THasActualValue extends boolean = false> = {
|
|
7
|
+
operator: DependencyOperator;
|
|
8
|
+
path: string[];
|
|
9
|
+
value: PropValue;
|
|
10
|
+
actualValue: THasActualValue extends true ? PropValue : never;
|
|
11
|
+
};
|
|
12
|
+
type Dependency<THasActualValue extends boolean = false> = {
|
|
13
|
+
effect: DependencyEffect;
|
|
14
|
+
relation: 'or' | 'and';
|
|
15
|
+
terms: (DependencyTerm<THasActualValue> | Dependency<THasActualValue>)[];
|
|
16
|
+
};
|
|
4
17
|
type BasePropType<TValue> = {
|
|
5
18
|
default?: TValue | null;
|
|
6
19
|
settings: Record<string, unknown>;
|
|
7
20
|
meta: Record<string, unknown>;
|
|
21
|
+
dependencies?: Dependency[];
|
|
8
22
|
};
|
|
9
23
|
type PlainPropType = BasePropType<PlainPropValue> & {
|
|
10
24
|
kind: 'plain';
|
|
@@ -1977,7 +1991,7 @@ declare const keyValuePropTypeUtil: {
|
|
|
1977
1991
|
value?: any;
|
|
1978
1992
|
key?: any;
|
|
1979
1993
|
} | null;
|
|
1980
|
-
isValid: (prop: unknown) => prop is TransformablePropValue$1<"
|
|
1994
|
+
isValid: (prop: unknown) => prop is TransformablePropValue$1<"key-value", {
|
|
1981
1995
|
value?: any;
|
|
1982
1996
|
key?: any;
|
|
1983
1997
|
}>;
|
|
@@ -1985,14 +1999,14 @@ declare const keyValuePropTypeUtil: {
|
|
|
1985
1999
|
(value: {
|
|
1986
2000
|
value?: any;
|
|
1987
2001
|
key?: any;
|
|
1988
|
-
}): TransformablePropValue$1<"
|
|
2002
|
+
}): TransformablePropValue$1<"key-value", {
|
|
1989
2003
|
value?: any;
|
|
1990
2004
|
key?: any;
|
|
1991
2005
|
}>;
|
|
1992
2006
|
(value: {
|
|
1993
2007
|
value?: any;
|
|
1994
2008
|
key?: any;
|
|
1995
|
-
}, createOptions?: CreateOptions): TransformablePropValue$1<"
|
|
2009
|
+
}, createOptions?: CreateOptions): TransformablePropValue$1<"key-value", {
|
|
1996
2010
|
value?: any;
|
|
1997
2011
|
key?: any;
|
|
1998
2012
|
}>;
|
|
@@ -2002,13 +2016,13 @@ declare const keyValuePropTypeUtil: {
|
|
|
2002
2016
|
} | undefined) => {
|
|
2003
2017
|
value?: any;
|
|
2004
2018
|
key?: any;
|
|
2005
|
-
}, createOptions: CreateOptions): TransformablePropValue$1<"
|
|
2019
|
+
}, createOptions: CreateOptions): TransformablePropValue$1<"key-value", {
|
|
2006
2020
|
value?: any;
|
|
2007
2021
|
key?: any;
|
|
2008
2022
|
}>;
|
|
2009
2023
|
};
|
|
2010
2024
|
schema: z.ZodObject<{
|
|
2011
|
-
$$type: z.ZodLiteral<"
|
|
2025
|
+
$$type: z.ZodLiteral<"key-value">;
|
|
2012
2026
|
value: z.ZodType<{
|
|
2013
2027
|
value?: any;
|
|
2014
2028
|
key?: any;
|
|
@@ -2018,21 +2032,21 @@ declare const keyValuePropTypeUtil: {
|
|
|
2018
2032
|
}>;
|
|
2019
2033
|
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
2020
2034
|
}, "strict", z.ZodTypeAny, {
|
|
2021
|
-
$$type: "
|
|
2035
|
+
$$type: "key-value";
|
|
2022
2036
|
value: {
|
|
2023
2037
|
value?: any;
|
|
2024
2038
|
key?: any;
|
|
2025
2039
|
};
|
|
2026
2040
|
disabled?: boolean | undefined;
|
|
2027
2041
|
}, {
|
|
2028
|
-
$$type: "
|
|
2042
|
+
$$type: "key-value";
|
|
2029
2043
|
value: {
|
|
2030
2044
|
value?: any;
|
|
2031
2045
|
key?: any;
|
|
2032
2046
|
};
|
|
2033
2047
|
disabled?: boolean | undefined;
|
|
2034
2048
|
}>;
|
|
2035
|
-
key: "
|
|
2049
|
+
key: "key-value";
|
|
2036
2050
|
};
|
|
2037
2051
|
type KeyValuePropValue = z.infer<typeof keyValuePropTypeUtil.schema>;
|
|
2038
2052
|
|
|
@@ -2438,8 +2452,216 @@ declare const positionPropTypeUtil: {
|
|
|
2438
2452
|
};
|
|
2439
2453
|
type PositionPropTypeValue = z.infer<typeof positionPropTypeUtil.schema>;
|
|
2440
2454
|
|
|
2455
|
+
declare const filterTypes: z.ZodUnion<[z.ZodObject<{
|
|
2456
|
+
$$type: z.ZodLiteral<"blur">;
|
|
2457
|
+
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
2458
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
2459
|
+
}, "strict", z.ZodTypeAny, {
|
|
2460
|
+
$$type: "blur";
|
|
2461
|
+
value?: any;
|
|
2462
|
+
disabled?: boolean | undefined;
|
|
2463
|
+
}, {
|
|
2464
|
+
$$type: "blur";
|
|
2465
|
+
value?: any;
|
|
2466
|
+
disabled?: boolean | undefined;
|
|
2467
|
+
}>, z.ZodObject<{
|
|
2468
|
+
$$type: z.ZodLiteral<"brightness">;
|
|
2469
|
+
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
2470
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
2471
|
+
}, "strict", z.ZodTypeAny, {
|
|
2472
|
+
$$type: "brightness";
|
|
2473
|
+
value?: any;
|
|
2474
|
+
disabled?: boolean | undefined;
|
|
2475
|
+
}, {
|
|
2476
|
+
$$type: "brightness";
|
|
2477
|
+
value?: any;
|
|
2478
|
+
disabled?: boolean | undefined;
|
|
2479
|
+
}>]>;
|
|
2480
|
+
declare const filterPropTypeUtil: {
|
|
2481
|
+
extract: (prop: unknown) => ({
|
|
2482
|
+
$$type: "blur";
|
|
2483
|
+
value?: any;
|
|
2484
|
+
disabled?: boolean | undefined;
|
|
2485
|
+
} | {
|
|
2486
|
+
$$type: "brightness";
|
|
2487
|
+
value?: any;
|
|
2488
|
+
disabled?: boolean | undefined;
|
|
2489
|
+
})[] | null;
|
|
2490
|
+
isValid: (prop: unknown) => prop is TransformablePropValue$1<"filter", ({
|
|
2491
|
+
$$type: "blur";
|
|
2492
|
+
value?: any;
|
|
2493
|
+
disabled?: boolean | undefined;
|
|
2494
|
+
} | {
|
|
2495
|
+
$$type: "brightness";
|
|
2496
|
+
value?: any;
|
|
2497
|
+
disabled?: boolean | undefined;
|
|
2498
|
+
})[]>;
|
|
2499
|
+
create: {
|
|
2500
|
+
(value: ({
|
|
2501
|
+
$$type: "blur";
|
|
2502
|
+
value?: any;
|
|
2503
|
+
disabled?: boolean | undefined;
|
|
2504
|
+
} | {
|
|
2505
|
+
$$type: "brightness";
|
|
2506
|
+
value?: any;
|
|
2507
|
+
disabled?: boolean | undefined;
|
|
2508
|
+
})[]): TransformablePropValue$1<"filter", ({
|
|
2509
|
+
$$type: "blur";
|
|
2510
|
+
value?: any;
|
|
2511
|
+
disabled?: boolean | undefined;
|
|
2512
|
+
} | {
|
|
2513
|
+
$$type: "brightness";
|
|
2514
|
+
value?: any;
|
|
2515
|
+
disabled?: boolean | undefined;
|
|
2516
|
+
})[]>;
|
|
2517
|
+
(value: ({
|
|
2518
|
+
$$type: "blur";
|
|
2519
|
+
value?: any;
|
|
2520
|
+
disabled?: boolean | undefined;
|
|
2521
|
+
} | {
|
|
2522
|
+
$$type: "brightness";
|
|
2523
|
+
value?: any;
|
|
2524
|
+
disabled?: boolean | undefined;
|
|
2525
|
+
})[], createOptions?: CreateOptions): TransformablePropValue$1<"filter", ({
|
|
2526
|
+
$$type: "blur";
|
|
2527
|
+
value?: any;
|
|
2528
|
+
disabled?: boolean | undefined;
|
|
2529
|
+
} | {
|
|
2530
|
+
$$type: "brightness";
|
|
2531
|
+
value?: any;
|
|
2532
|
+
disabled?: boolean | undefined;
|
|
2533
|
+
})[]>;
|
|
2534
|
+
(value: (prev?: ({
|
|
2535
|
+
$$type: "blur";
|
|
2536
|
+
value?: any;
|
|
2537
|
+
disabled?: boolean | undefined;
|
|
2538
|
+
} | {
|
|
2539
|
+
$$type: "brightness";
|
|
2540
|
+
value?: any;
|
|
2541
|
+
disabled?: boolean | undefined;
|
|
2542
|
+
})[] | undefined) => ({
|
|
2543
|
+
$$type: "blur";
|
|
2544
|
+
value?: any;
|
|
2545
|
+
disabled?: boolean | undefined;
|
|
2546
|
+
} | {
|
|
2547
|
+
$$type: "brightness";
|
|
2548
|
+
value?: any;
|
|
2549
|
+
disabled?: boolean | undefined;
|
|
2550
|
+
})[], createOptions: CreateOptions): TransformablePropValue$1<"filter", ({
|
|
2551
|
+
$$type: "blur";
|
|
2552
|
+
value?: any;
|
|
2553
|
+
disabled?: boolean | undefined;
|
|
2554
|
+
} | {
|
|
2555
|
+
$$type: "brightness";
|
|
2556
|
+
value?: any;
|
|
2557
|
+
disabled?: boolean | undefined;
|
|
2558
|
+
})[]>;
|
|
2559
|
+
};
|
|
2560
|
+
schema: z.ZodObject<{
|
|
2561
|
+
$$type: z.ZodLiteral<"filter">;
|
|
2562
|
+
value: z.ZodType<({
|
|
2563
|
+
$$type: "blur";
|
|
2564
|
+
value?: any;
|
|
2565
|
+
disabled?: boolean | undefined;
|
|
2566
|
+
} | {
|
|
2567
|
+
$$type: "brightness";
|
|
2568
|
+
value?: any;
|
|
2569
|
+
disabled?: boolean | undefined;
|
|
2570
|
+
})[], z.ZodTypeDef, ({
|
|
2571
|
+
$$type: "blur";
|
|
2572
|
+
value?: any;
|
|
2573
|
+
disabled?: boolean | undefined;
|
|
2574
|
+
} | {
|
|
2575
|
+
$$type: "brightness";
|
|
2576
|
+
value?: any;
|
|
2577
|
+
disabled?: boolean | undefined;
|
|
2578
|
+
})[]>;
|
|
2579
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
2580
|
+
}, "strict", z.ZodTypeAny, {
|
|
2581
|
+
$$type: "filter";
|
|
2582
|
+
value: ({
|
|
2583
|
+
$$type: "blur";
|
|
2584
|
+
value?: any;
|
|
2585
|
+
disabled?: boolean | undefined;
|
|
2586
|
+
} | {
|
|
2587
|
+
$$type: "brightness";
|
|
2588
|
+
value?: any;
|
|
2589
|
+
disabled?: boolean | undefined;
|
|
2590
|
+
})[];
|
|
2591
|
+
disabled?: boolean | undefined;
|
|
2592
|
+
}, {
|
|
2593
|
+
$$type: "filter";
|
|
2594
|
+
value: ({
|
|
2595
|
+
$$type: "blur";
|
|
2596
|
+
value?: any;
|
|
2597
|
+
disabled?: boolean | undefined;
|
|
2598
|
+
} | {
|
|
2599
|
+
$$type: "brightness";
|
|
2600
|
+
value?: any;
|
|
2601
|
+
disabled?: boolean | undefined;
|
|
2602
|
+
})[];
|
|
2603
|
+
disabled?: boolean | undefined;
|
|
2604
|
+
}>;
|
|
2605
|
+
key: "filter";
|
|
2606
|
+
};
|
|
2607
|
+
type FilterPropValue = z.infer<typeof filterPropTypeUtil.schema>;
|
|
2608
|
+
type FilterItemPropValue = z.infer<typeof filterTypes>;
|
|
2609
|
+
|
|
2610
|
+
declare const blurFilterPropTypeUtil: {
|
|
2611
|
+
extract: (prop: unknown) => any;
|
|
2612
|
+
isValid: (prop: unknown) => prop is TransformablePropValue$1<"blur", any>;
|
|
2613
|
+
create: {
|
|
2614
|
+
(value: any): TransformablePropValue$1<"blur", any>;
|
|
2615
|
+
(value: any, createOptions?: CreateOptions): TransformablePropValue$1<"blur", any>;
|
|
2616
|
+
(value: (prev?: any) => any, createOptions: CreateOptions): TransformablePropValue$1<"blur", any>;
|
|
2617
|
+
};
|
|
2618
|
+
schema: z.ZodObject<{
|
|
2619
|
+
$$type: z.ZodLiteral<"blur">;
|
|
2620
|
+
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
2621
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
2622
|
+
}, "strict", z.ZodTypeAny, {
|
|
2623
|
+
$$type: "blur";
|
|
2624
|
+
value?: any;
|
|
2625
|
+
disabled?: boolean | undefined;
|
|
2626
|
+
}, {
|
|
2627
|
+
$$type: "blur";
|
|
2628
|
+
value?: any;
|
|
2629
|
+
disabled?: boolean | undefined;
|
|
2630
|
+
}>;
|
|
2631
|
+
key: "blur";
|
|
2632
|
+
};
|
|
2633
|
+
type BlurFilterPropValue = z.infer<typeof blurFilterPropTypeUtil.schema>;
|
|
2634
|
+
|
|
2635
|
+
declare const brightnessFilterPropTypeUtil: {
|
|
2636
|
+
extract: (prop: unknown) => any;
|
|
2637
|
+
isValid: (prop: unknown) => prop is TransformablePropValue$1<"brightness", any>;
|
|
2638
|
+
create: {
|
|
2639
|
+
(value: any): TransformablePropValue$1<"brightness", any>;
|
|
2640
|
+
(value: any, createOptions?: CreateOptions): TransformablePropValue$1<"brightness", any>;
|
|
2641
|
+
(value: (prev?: any) => any, createOptions: CreateOptions): TransformablePropValue$1<"brightness", any>;
|
|
2642
|
+
};
|
|
2643
|
+
schema: z.ZodObject<{
|
|
2644
|
+
$$type: z.ZodLiteral<"brightness">;
|
|
2645
|
+
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
2646
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
2647
|
+
}, "strict", z.ZodTypeAny, {
|
|
2648
|
+
$$type: "brightness";
|
|
2649
|
+
value?: any;
|
|
2650
|
+
disabled?: boolean | undefined;
|
|
2651
|
+
}, {
|
|
2652
|
+
$$type: "brightness";
|
|
2653
|
+
value?: any;
|
|
2654
|
+
disabled?: boolean | undefined;
|
|
2655
|
+
}>;
|
|
2656
|
+
key: "brightness";
|
|
2657
|
+
};
|
|
2658
|
+
type BrightnessFilterPropValue = z.infer<typeof brightnessFilterPropTypeUtil.schema>;
|
|
2659
|
+
|
|
2441
2660
|
declare function mergeProps(current: Props, updates: Props): Props;
|
|
2442
2661
|
|
|
2662
|
+
declare function shouldApplyEffect({ relation, terms }: Dependency<true>): boolean;
|
|
2663
|
+
declare function evaluateTerm(term: DependencyTerm<true>, actualValue: PropValue): boolean;
|
|
2664
|
+
|
|
2443
2665
|
declare const transformableSchema: z.ZodObject<{
|
|
2444
2666
|
$$type: z.ZodString;
|
|
2445
2667
|
value: z.ZodAny;
|
|
@@ -2460,4 +2682,4 @@ declare const filterEmptyValues: <TValue extends PropValue>(value: TValue) => TV
|
|
|
2460
2682
|
type Nullish = null | undefined | '';
|
|
2461
2683
|
declare const isEmpty: (value: PropValue) => value is Nullish;
|
|
2462
2684
|
|
|
2463
|
-
export { type AnyTransformable, type ArrayPropType, type ArrayPropValue, type BackgroundColorOverlayPropValue, type BackgroundGradientOverlayPropValue, type BackgroundImageOverlayPropValue, type BackgroundImagePositionOffsetPropValue, type BackgroundImageSizeScalePropValue, type BackgroundOverlayImagePropType, type BackgroundOverlayItemPropValue, type BackgroundOverlayPropType, type BackgroundOverlayPropValue, type BackgroundPropValue, type BooleanPropValue, type BorderRadiusPropValue, type BorderWidthPropValue, type BoxShadowPropValue, CLASSES_PROP_KEY, type ClassesPropValue, type ColorPropValue, type ColorStopPropValue, type CreateOptions, type DimensionsPropValue, type GradientColorStopPropValue, type ImageAttachmentIdPropValue, type ImagePropValue, type ImageSrcPropValue, type KeyValuePropValue, type LayoutDirectionPropValue, type LinkPropValue, type NumberPropValue, type ObjectPropType, type ObjectPropValue, type PlainPropType, type PlainPropValue, type PositionPropTypeValue, type PropKey, type PropType, type PropTypeKey, type PropTypeUtil, type PropValue, type Props, type PropsSchema, type ShadowPropValue, type SizePropValue, type StringPropValue, type StrokePropValue, type TransformablePropType, type TransformablePropValue$1 as TransformablePropValue, type UnionPropType, type UrlPropValue, backgroundColorOverlayPropTypeUtil, backgroundGradientOverlayPropTypeUtil, backgroundImageOverlayPropTypeUtil, backgroundImagePositionOffsetPropTypeUtil, backgroundImageSizeScalePropTypeUtil, backgroundOverlayPropTypeUtil, backgroundPropTypeUtil, booleanPropTypeUtil, borderRadiusPropTypeUtil, borderWidthPropTypeUtil, boxShadowPropTypeUtil, classesPropTypeUtil, colorPropTypeUtil, colorStopPropTypeUtil, createArrayPropUtils, createPropUtils, dimensionsPropTypeUtil, filterEmptyValues, gradientColorStopPropTypeUtil, imageAttachmentIdPropType, imagePropTypeUtil, imageSrcPropTypeUtil, isEmpty, isTransformable, keyValuePropTypeUtil, layoutDirectionPropTypeUtil, linkPropTypeUtil, mergeProps, numberPropTypeUtil, positionPropTypeUtil, shadowPropTypeUtil, sizePropTypeUtil, stringPropTypeUtil, strokePropTypeUtil, urlPropTypeUtil };
|
|
2685
|
+
export { type AnyTransformable, type ArrayPropType, type ArrayPropValue, type BackgroundColorOverlayPropValue, type BackgroundGradientOverlayPropValue, type BackgroundImageOverlayPropValue, type BackgroundImagePositionOffsetPropValue, type BackgroundImageSizeScalePropValue, type BackgroundOverlayImagePropType, type BackgroundOverlayItemPropValue, type BackgroundOverlayPropType, type BackgroundOverlayPropValue, type BackgroundPropValue, type BlurFilterPropValue, type BooleanPropValue, type BorderRadiusPropValue, type BorderWidthPropValue, type BoxShadowPropValue, type BrightnessFilterPropValue, CLASSES_PROP_KEY, type ClassesPropValue, type ColorPropValue, type ColorStopPropValue, type CreateOptions, type Dependency, type DependencyEffect, type DependencyOperator, type DependencyTerm, type DimensionsPropValue, type FilterItemPropValue, type FilterPropValue, type GradientColorStopPropValue, type ImageAttachmentIdPropValue, type ImagePropValue, type ImageSrcPropValue, type KeyValuePropValue, type LayoutDirectionPropValue, type LinkPropValue, type NumberPropValue, type ObjectPropType, type ObjectPropValue, type PlainPropType, type PlainPropValue, type PositionPropTypeValue, type PropKey, type PropType, type PropTypeKey, type PropTypeUtil, type PropValue, type Props, type PropsSchema, type ShadowPropValue, type SizePropValue, type StringPropValue, type StrokePropValue, type TransformablePropType, type TransformablePropValue$1 as TransformablePropValue, type UnionPropType, type UrlPropValue, backgroundColorOverlayPropTypeUtil, backgroundGradientOverlayPropTypeUtil, backgroundImageOverlayPropTypeUtil, backgroundImagePositionOffsetPropTypeUtil, backgroundImageSizeScalePropTypeUtil, backgroundOverlayPropTypeUtil, backgroundPropTypeUtil, blurFilterPropTypeUtil, booleanPropTypeUtil, borderRadiusPropTypeUtil, borderWidthPropTypeUtil, boxShadowPropTypeUtil, brightnessFilterPropTypeUtil, classesPropTypeUtil, colorPropTypeUtil, colorStopPropTypeUtil, createArrayPropUtils, createPropUtils, dimensionsPropTypeUtil, evaluateTerm, filterEmptyValues, filterPropTypeUtil, gradientColorStopPropTypeUtil, imageAttachmentIdPropType, imagePropTypeUtil, imageSrcPropTypeUtil, isEmpty, isTransformable, keyValuePropTypeUtil, layoutDirectionPropTypeUtil, linkPropTypeUtil, mergeProps, numberPropTypeUtil, positionPropTypeUtil, shadowPropTypeUtil, shouldApplyEffect, sizePropTypeUtil, stringPropTypeUtil, strokePropTypeUtil, urlPropTypeUtil };
|