@elementor/editor-props 0.5.1 → 0.7.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 +13 -0
- package/dist/index.d.mts +114 -105
- package/dist/index.d.ts +114 -105
- package/dist/index.js +18 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/prop-types/boolean.ts +7 -0
- package/src/prop-types/index.ts +2 -0
- package/src/prop-types/link.ts +3 -4
- package/src/prop-types/number.ts +1 -1
- package/src/types.ts +12 -6
- package/src/utils/create-prop-utils.ts +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,37 +1,40 @@
|
|
|
1
1
|
import { ZodType, z } from '@elementor/schema';
|
|
2
2
|
|
|
3
3
|
type PropTypeKey = string;
|
|
4
|
-
type BasePropType = {
|
|
5
|
-
default
|
|
4
|
+
type BasePropType<TValue> = {
|
|
5
|
+
default?: TValue | null;
|
|
6
6
|
settings: Record<string, unknown>;
|
|
7
7
|
meta: Record<string, unknown>;
|
|
8
8
|
};
|
|
9
|
-
type PlainPropType = BasePropType & {
|
|
9
|
+
type PlainPropType = BasePropType<PlainPropValue> & {
|
|
10
10
|
kind: 'plain';
|
|
11
11
|
key: PropTypeKey;
|
|
12
12
|
};
|
|
13
|
-
type ArrayPropType = BasePropType & {
|
|
13
|
+
type ArrayPropType = BasePropType<ArrayPropValue> & {
|
|
14
14
|
kind: 'array';
|
|
15
15
|
key: PropTypeKey;
|
|
16
16
|
item_prop_type: PropType;
|
|
17
17
|
};
|
|
18
|
-
type ObjectPropType = BasePropType & {
|
|
18
|
+
type ObjectPropType = BasePropType<ObjectPropValue> & {
|
|
19
19
|
kind: 'object';
|
|
20
20
|
key: PropTypeKey;
|
|
21
21
|
shape: Record<string, PropType>;
|
|
22
22
|
};
|
|
23
23
|
type TransformablePropType = PlainPropType | ArrayPropType | ObjectPropType;
|
|
24
|
-
type UnionPropType = BasePropType & {
|
|
24
|
+
type UnionPropType = BasePropType<PropValue> & {
|
|
25
25
|
kind: 'union';
|
|
26
26
|
prop_types: Record<string, TransformablePropType>;
|
|
27
27
|
};
|
|
28
28
|
type PropType = TransformablePropType | UnionPropType;
|
|
29
|
+
type PropsSchema = Record<string, PropType>;
|
|
29
30
|
type MaybeArray<T> = T | T[];
|
|
30
31
|
type TransformablePropValue$1<Type extends string, Value = unknown> = {
|
|
31
32
|
$$type: Type;
|
|
32
33
|
value: Value;
|
|
33
34
|
disabled?: boolean;
|
|
34
35
|
};
|
|
36
|
+
type ArrayPropValue = TransformablePropValue$1<string, PropValue[]>;
|
|
37
|
+
type ObjectPropValue = TransformablePropValue$1<string, Record<string, PropValue>>;
|
|
35
38
|
type PlainPropValue = MaybeArray<string | number | boolean | object | null | undefined>;
|
|
36
39
|
type PropValue = PlainPropValue | TransformablePropValue$1<string>;
|
|
37
40
|
type PropKey = string;
|
|
@@ -87,6 +90,7 @@ declare function createPropUtils<TKey extends string, TValue extends PropValue>(
|
|
|
87
90
|
value: z.ZodType<TValue, z.ZodTypeDef, TValue>;
|
|
88
91
|
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
89
92
|
}>[k_1]; } : never>;
|
|
93
|
+
key: TKey;
|
|
90
94
|
};
|
|
91
95
|
|
|
92
96
|
declare const boxShadowPropTypeUtil: {
|
|
@@ -253,6 +257,7 @@ declare const boxShadowPropTypeUtil: {
|
|
|
253
257
|
}[];
|
|
254
258
|
disabled?: boolean | undefined;
|
|
255
259
|
}>;
|
|
260
|
+
key: TKey;
|
|
256
261
|
};
|
|
257
262
|
type BoxShadowPropValue = z.infer<typeof boxShadowPropTypeUtil.schema>;
|
|
258
263
|
|
|
@@ -342,6 +347,7 @@ declare const borderRadiusPropTypeUtil: {
|
|
|
342
347
|
};
|
|
343
348
|
disabled?: boolean | undefined;
|
|
344
349
|
}>;
|
|
350
|
+
key: TKey;
|
|
345
351
|
};
|
|
346
352
|
type BorderRadiusPropValue = z.infer<typeof borderRadiusPropTypeUtil.schema>;
|
|
347
353
|
|
|
@@ -431,6 +437,7 @@ declare const borderWidthPropTypeUtil: {
|
|
|
431
437
|
};
|
|
432
438
|
disabled?: boolean | undefined;
|
|
433
439
|
}>;
|
|
440
|
+
key: TKey;
|
|
434
441
|
};
|
|
435
442
|
type BorderWidthPropValue = z.infer<typeof borderWidthPropTypeUtil.schema>;
|
|
436
443
|
|
|
@@ -455,6 +462,7 @@ declare const classesPropTypeUtil: {
|
|
|
455
462
|
value: string[];
|
|
456
463
|
disabled?: boolean | undefined;
|
|
457
464
|
}>;
|
|
465
|
+
key: TKey;
|
|
458
466
|
};
|
|
459
467
|
type ClassesPropValue = z.infer<typeof classesPropTypeUtil.schema>;
|
|
460
468
|
|
|
@@ -479,6 +487,7 @@ declare const colorPropTypeUtil: {
|
|
|
479
487
|
value: string;
|
|
480
488
|
disabled?: boolean | undefined;
|
|
481
489
|
}>;
|
|
490
|
+
key: TKey;
|
|
482
491
|
};
|
|
483
492
|
type ColorPropValue = z.infer<typeof colorPropTypeUtil.schema>;
|
|
484
493
|
|
|
@@ -542,6 +551,7 @@ declare const imagePropTypeUtil: {
|
|
|
542
551
|
};
|
|
543
552
|
disabled?: boolean | undefined;
|
|
544
553
|
}>;
|
|
554
|
+
key: TKey;
|
|
545
555
|
};
|
|
546
556
|
type ImagePropValue = z.infer<typeof imagePropTypeUtil.schema>;
|
|
547
557
|
|
|
@@ -566,6 +576,7 @@ declare const imageAttachmentIdPropType: {
|
|
|
566
576
|
value: number;
|
|
567
577
|
disabled?: boolean | undefined;
|
|
568
578
|
}>;
|
|
579
|
+
key: TKey;
|
|
569
580
|
};
|
|
570
581
|
type ImageAttachmentIdPropValue = z.infer<typeof imageAttachmentIdPropType.schema>;
|
|
571
582
|
|
|
@@ -668,6 +679,7 @@ declare const imageSrcPropTypeUtil: {
|
|
|
668
679
|
};
|
|
669
680
|
disabled?: boolean | undefined;
|
|
670
681
|
}>;
|
|
682
|
+
key: TKey;
|
|
671
683
|
};
|
|
672
684
|
type ImageSrcPropValue = z.infer<typeof imageSrcPropTypeUtil.schema>;
|
|
673
685
|
|
|
@@ -770,30 +782,32 @@ declare const linkedDimensionsPropTypeUtil: {
|
|
|
770
782
|
};
|
|
771
783
|
disabled?: boolean | undefined;
|
|
772
784
|
}>;
|
|
785
|
+
key: TKey;
|
|
773
786
|
};
|
|
774
787
|
type LinkedDimensionsPropValue = z.infer<typeof linkedDimensionsPropTypeUtil.schema>;
|
|
775
788
|
|
|
776
789
|
declare const numberPropTypeUtil: {
|
|
777
790
|
extract: (prop: unknown) => number | null;
|
|
778
|
-
isValid: (prop: unknown) => prop is TransformablePropValue$1<"number", number>;
|
|
791
|
+
isValid: (prop: unknown) => prop is TransformablePropValue$1<"number", number | null>;
|
|
779
792
|
create: {
|
|
780
|
-
(value: number): TransformablePropValue$1<"number", number>;
|
|
781
|
-
(value: number, createOptions?: CreateOptions): TransformablePropValue$1<"number", number>;
|
|
782
|
-
(value: (prev?: number | undefined) => number, createOptions: CreateOptions): TransformablePropValue$1<"number", number>;
|
|
793
|
+
(value: number | null): TransformablePropValue$1<"number", number | null>;
|
|
794
|
+
(value: number | null, createOptions?: CreateOptions): TransformablePropValue$1<"number", number | null>;
|
|
795
|
+
(value: (prev?: number | null | undefined) => number | null, createOptions: CreateOptions): TransformablePropValue$1<"number", number | null>;
|
|
783
796
|
};
|
|
784
797
|
schema: z.ZodObject<{
|
|
785
798
|
$$type: z.ZodLiteral<"number">;
|
|
786
|
-
value: z.ZodType<number, z.ZodTypeDef, number>;
|
|
799
|
+
value: z.ZodType<number | null, z.ZodTypeDef, number | null>;
|
|
787
800
|
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
788
801
|
}, "strict", z.ZodTypeAny, {
|
|
789
802
|
$$type: "number";
|
|
790
|
-
value: number;
|
|
803
|
+
value: number | null;
|
|
791
804
|
disabled?: boolean | undefined;
|
|
792
805
|
}, {
|
|
793
806
|
$$type: "number";
|
|
794
|
-
value: number;
|
|
807
|
+
value: number | null;
|
|
795
808
|
disabled?: boolean | undefined;
|
|
796
809
|
}>;
|
|
810
|
+
key: TKey;
|
|
797
811
|
};
|
|
798
812
|
type NumberPropValue = z.infer<typeof numberPropTypeUtil.schema>;
|
|
799
813
|
|
|
@@ -909,6 +923,7 @@ declare const shadowPropTypeUtil: {
|
|
|
909
923
|
};
|
|
910
924
|
disabled?: boolean | undefined;
|
|
911
925
|
}>;
|
|
926
|
+
key: TKey;
|
|
912
927
|
};
|
|
913
928
|
type ShadowPropValue = z.infer<typeof shadowPropTypeUtil.schema>;
|
|
914
929
|
|
|
@@ -972,6 +987,7 @@ declare const sizePropTypeUtil: {
|
|
|
972
987
|
};
|
|
973
988
|
disabled?: boolean | undefined;
|
|
974
989
|
}>;
|
|
990
|
+
key: TKey;
|
|
975
991
|
};
|
|
976
992
|
type SizePropValue = z.infer<typeof sizePropTypeUtil.schema>;
|
|
977
993
|
|
|
@@ -996,6 +1012,7 @@ declare const stringPropTypeUtil: {
|
|
|
996
1012
|
value: string | null;
|
|
997
1013
|
disabled?: boolean | undefined;
|
|
998
1014
|
}>;
|
|
1015
|
+
key: TKey;
|
|
999
1016
|
};
|
|
1000
1017
|
type StringPropValue = z.infer<typeof stringPropTypeUtil.schema>;
|
|
1001
1018
|
|
|
@@ -1059,6 +1076,7 @@ declare const strokePropTypeUtil: {
|
|
|
1059
1076
|
};
|
|
1060
1077
|
disabled?: boolean | undefined;
|
|
1061
1078
|
}>;
|
|
1079
|
+
key: TKey;
|
|
1062
1080
|
};
|
|
1063
1081
|
type StrokePropValue = z.infer<typeof strokePropTypeUtil.schema>;
|
|
1064
1082
|
|
|
@@ -1083,134 +1101,71 @@ declare const urlPropTypeUtil: {
|
|
|
1083
1101
|
value: string | null;
|
|
1084
1102
|
disabled?: boolean | undefined;
|
|
1085
1103
|
}>;
|
|
1104
|
+
key: TKey;
|
|
1086
1105
|
};
|
|
1087
1106
|
type UrlPropValue = z.infer<typeof urlPropTypeUtil.schema>;
|
|
1088
1107
|
|
|
1089
1108
|
declare const linkPropTypeUtil: {
|
|
1090
1109
|
extract: (prop: unknown) => {
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
$$type: "url";
|
|
1094
|
-
value: string | null;
|
|
1095
|
-
disabled?: boolean | undefined;
|
|
1096
|
-
};
|
|
1097
|
-
isTargetBlank: boolean;
|
|
1110
|
+
href?: any;
|
|
1111
|
+
isTargetBlank?: any;
|
|
1098
1112
|
} | null;
|
|
1099
1113
|
isValid: (prop: unknown) => prop is TransformablePropValue$1<"link", {
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
$$type: "url";
|
|
1103
|
-
value: string | null;
|
|
1104
|
-
disabled?: boolean | undefined;
|
|
1105
|
-
};
|
|
1106
|
-
isTargetBlank: boolean;
|
|
1114
|
+
href?: any;
|
|
1115
|
+
isTargetBlank?: any;
|
|
1107
1116
|
}>;
|
|
1108
1117
|
create: {
|
|
1109
1118
|
(value: {
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
$$type: "url";
|
|
1113
|
-
value: string | null;
|
|
1114
|
-
disabled?: boolean | undefined;
|
|
1115
|
-
};
|
|
1116
|
-
isTargetBlank: boolean;
|
|
1119
|
+
href?: any;
|
|
1120
|
+
isTargetBlank?: any;
|
|
1117
1121
|
}): TransformablePropValue$1<"link", {
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
$$type: "url";
|
|
1121
|
-
value: string | null;
|
|
1122
|
-
disabled?: boolean | undefined;
|
|
1123
|
-
};
|
|
1124
|
-
isTargetBlank: boolean;
|
|
1122
|
+
href?: any;
|
|
1123
|
+
isTargetBlank?: any;
|
|
1125
1124
|
}>;
|
|
1126
1125
|
(value: {
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
$$type: "url";
|
|
1130
|
-
value: string | null;
|
|
1131
|
-
disabled?: boolean | undefined;
|
|
1132
|
-
};
|
|
1133
|
-
isTargetBlank: boolean;
|
|
1126
|
+
href?: any;
|
|
1127
|
+
isTargetBlank?: any;
|
|
1134
1128
|
}, createOptions?: CreateOptions): TransformablePropValue$1<"link", {
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
$$type: "url";
|
|
1138
|
-
value: string | null;
|
|
1139
|
-
disabled?: boolean | undefined;
|
|
1140
|
-
};
|
|
1141
|
-
isTargetBlank: boolean;
|
|
1129
|
+
href?: any;
|
|
1130
|
+
isTargetBlank?: any;
|
|
1142
1131
|
}>;
|
|
1143
1132
|
(value: (prev?: {
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
$$type: "url";
|
|
1147
|
-
value: string | null;
|
|
1148
|
-
disabled?: boolean | undefined;
|
|
1149
|
-
};
|
|
1150
|
-
isTargetBlank: boolean;
|
|
1133
|
+
href?: any;
|
|
1134
|
+
isTargetBlank?: any;
|
|
1151
1135
|
} | undefined) => {
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
$$type: "url";
|
|
1155
|
-
value: string | null;
|
|
1156
|
-
disabled?: boolean | undefined;
|
|
1157
|
-
};
|
|
1158
|
-
isTargetBlank: boolean;
|
|
1136
|
+
href?: any;
|
|
1137
|
+
isTargetBlank?: any;
|
|
1159
1138
|
}, createOptions: CreateOptions): TransformablePropValue$1<"link", {
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
$$type: "url";
|
|
1163
|
-
value: string | null;
|
|
1164
|
-
disabled?: boolean | undefined;
|
|
1165
|
-
};
|
|
1166
|
-
isTargetBlank: boolean;
|
|
1139
|
+
href?: any;
|
|
1140
|
+
isTargetBlank?: any;
|
|
1167
1141
|
}>;
|
|
1168
1142
|
};
|
|
1169
1143
|
schema: z.ZodObject<{
|
|
1170
1144
|
$$type: z.ZodLiteral<"link">;
|
|
1171
1145
|
value: z.ZodType<{
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
$$type: "url";
|
|
1175
|
-
value: string | null;
|
|
1176
|
-
disabled?: boolean | undefined;
|
|
1177
|
-
};
|
|
1178
|
-
isTargetBlank: boolean;
|
|
1146
|
+
href?: any;
|
|
1147
|
+
isTargetBlank?: any;
|
|
1179
1148
|
}, z.ZodTypeDef, {
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
$$type: "url";
|
|
1183
|
-
value: string | null;
|
|
1184
|
-
disabled?: boolean | undefined;
|
|
1185
|
-
};
|
|
1186
|
-
isTargetBlank: boolean;
|
|
1149
|
+
href?: any;
|
|
1150
|
+
isTargetBlank?: any;
|
|
1187
1151
|
}>;
|
|
1188
1152
|
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
1189
1153
|
}, "strict", z.ZodTypeAny, {
|
|
1190
1154
|
$$type: "link";
|
|
1191
1155
|
value: {
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
$$type: "url";
|
|
1195
|
-
value: string | null;
|
|
1196
|
-
disabled?: boolean | undefined;
|
|
1197
|
-
};
|
|
1198
|
-
isTargetBlank: boolean;
|
|
1156
|
+
href?: any;
|
|
1157
|
+
isTargetBlank?: any;
|
|
1199
1158
|
};
|
|
1200
1159
|
disabled?: boolean | undefined;
|
|
1201
1160
|
}, {
|
|
1202
1161
|
$$type: "link";
|
|
1203
1162
|
value: {
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
$$type: "url";
|
|
1207
|
-
value: string | null;
|
|
1208
|
-
disabled?: boolean | undefined;
|
|
1209
|
-
};
|
|
1210
|
-
isTargetBlank: boolean;
|
|
1163
|
+
href?: any;
|
|
1164
|
+
isTargetBlank?: any;
|
|
1211
1165
|
};
|
|
1212
1166
|
disabled?: boolean | undefined;
|
|
1213
1167
|
}>;
|
|
1168
|
+
key: TKey;
|
|
1214
1169
|
};
|
|
1215
1170
|
type LinkPropValue = z.infer<typeof linkPropTypeUtil.schema>;
|
|
1216
1171
|
|
|
@@ -1287,6 +1242,7 @@ declare const gapPropTypeUtil: {
|
|
|
1287
1242
|
};
|
|
1288
1243
|
disabled?: boolean | undefined;
|
|
1289
1244
|
}>;
|
|
1245
|
+
key: TKey;
|
|
1290
1246
|
};
|
|
1291
1247
|
type GapPropValue = z.infer<typeof gapPropTypeUtil.schema>;
|
|
1292
1248
|
|
|
@@ -1350,6 +1306,7 @@ declare const backgroundPropTypeUtil: {
|
|
|
1350
1306
|
};
|
|
1351
1307
|
disabled?: boolean | undefined;
|
|
1352
1308
|
}>;
|
|
1309
|
+
key: TKey;
|
|
1353
1310
|
};
|
|
1354
1311
|
type BackgroundPropValue = z.infer<typeof backgroundPropTypeUtil.schema>;
|
|
1355
1312
|
|
|
@@ -1567,6 +1524,7 @@ declare const backgroundOverlayPropTypeUtil: {
|
|
|
1567
1524
|
})[];
|
|
1568
1525
|
disabled?: boolean | undefined;
|
|
1569
1526
|
}>;
|
|
1527
|
+
key: TKey;
|
|
1570
1528
|
};
|
|
1571
1529
|
type BackgroundOverlayPropValue = z.infer<typeof backgroundOverlayPropTypeUtil.schema>;
|
|
1572
1530
|
type BackgroundOverlayItemPropValue = z.infer<typeof backgroundOverlayItem>;
|
|
@@ -1592,9 +1550,60 @@ declare const backgroundColorOverlayPropTypeUtil: {
|
|
|
1592
1550
|
value: string;
|
|
1593
1551
|
disabled?: boolean | undefined;
|
|
1594
1552
|
}>;
|
|
1553
|
+
key: TKey;
|
|
1595
1554
|
};
|
|
1596
1555
|
type BackgroundColorOverlayPropValue = z.infer<typeof backgroundColorOverlayPropTypeUtil.schema>;
|
|
1597
1556
|
|
|
1557
|
+
declare const backgroundImageOverlayPropTypeUtil: {
|
|
1558
|
+
extract: (prop: unknown) => any;
|
|
1559
|
+
isValid: (prop: unknown) => prop is TransformablePropValue$1<"background-image-overlay", any>;
|
|
1560
|
+
create: {
|
|
1561
|
+
(value: any): TransformablePropValue$1<"background-image-overlay", any>;
|
|
1562
|
+
(value: any, createOptions?: CreateOptions): TransformablePropValue$1<"background-image-overlay", any>;
|
|
1563
|
+
(value: (prev?: any) => any, createOptions: CreateOptions): TransformablePropValue$1<"background-image-overlay", any>;
|
|
1564
|
+
};
|
|
1565
|
+
schema: z.ZodObject<{
|
|
1566
|
+
$$type: z.ZodLiteral<"background-image-overlay">;
|
|
1567
|
+
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
1568
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
1569
|
+
}, "strict", z.ZodTypeAny, {
|
|
1570
|
+
$$type: "background-image-overlay";
|
|
1571
|
+
value?: any;
|
|
1572
|
+
disabled?: boolean | undefined;
|
|
1573
|
+
}, {
|
|
1574
|
+
$$type: "background-image-overlay";
|
|
1575
|
+
value?: any;
|
|
1576
|
+
disabled?: boolean | undefined;
|
|
1577
|
+
}>;
|
|
1578
|
+
key: TKey;
|
|
1579
|
+
};
|
|
1580
|
+
type BackgroundImageOverlayPropValue = z.infer<typeof backgroundImageOverlayPropTypeUtil.schema>;
|
|
1581
|
+
|
|
1582
|
+
declare const booleanPropTypeUtil: {
|
|
1583
|
+
extract: (prop: unknown) => boolean | null;
|
|
1584
|
+
isValid: (prop: unknown) => prop is TransformablePropValue$1<"boolean", boolean | null>;
|
|
1585
|
+
create: {
|
|
1586
|
+
(value: boolean | null): TransformablePropValue$1<"boolean", boolean | null>;
|
|
1587
|
+
(value: boolean | null, createOptions?: CreateOptions): TransformablePropValue$1<"boolean", boolean | null>;
|
|
1588
|
+
(value: (prev?: boolean | null | undefined) => boolean | null, createOptions: CreateOptions): TransformablePropValue$1<"boolean", boolean | null>;
|
|
1589
|
+
};
|
|
1590
|
+
schema: z.ZodObject<{
|
|
1591
|
+
$$type: z.ZodLiteral<"boolean">;
|
|
1592
|
+
value: z.ZodType<boolean | null, z.ZodTypeDef, boolean | null>;
|
|
1593
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
1594
|
+
}, "strict", z.ZodTypeAny, {
|
|
1595
|
+
$$type: "boolean";
|
|
1596
|
+
value: boolean | null;
|
|
1597
|
+
disabled?: boolean | undefined;
|
|
1598
|
+
}, {
|
|
1599
|
+
$$type: "boolean";
|
|
1600
|
+
value: boolean | null;
|
|
1601
|
+
disabled?: boolean | undefined;
|
|
1602
|
+
}>;
|
|
1603
|
+
key: TKey;
|
|
1604
|
+
};
|
|
1605
|
+
type BooleanPropValue = z.infer<typeof booleanPropTypeUtil.schema>;
|
|
1606
|
+
|
|
1598
1607
|
declare const transformableSchema: z.ZodObject<{
|
|
1599
1608
|
$$type: z.ZodString;
|
|
1600
1609
|
value: z.ZodAny;
|
|
@@ -1611,4 +1620,4 @@ declare const transformableSchema: z.ZodObject<{
|
|
|
1611
1620
|
type TransformablePropValue = z.infer<typeof transformableSchema>;
|
|
1612
1621
|
declare const isTransformable: (value: unknown) => value is TransformablePropValue;
|
|
1613
1622
|
|
|
1614
|
-
export { type ArrayPropType, type BackgroundColorOverlayPropValue, type BackgroundOverlayItemPropValue, type BackgroundOverlayPropValue, type BackgroundPropValue, type BorderRadiusPropValue, type BorderWidthPropValue, type BoxShadowPropValue, type ClassesPropValue, type ColorPropValue, type CreateOptions, type GapPropValue, type ImageAttachmentIdPropValue, type ImagePropValue, type ImageSrcPropValue, type LinkPropValue, type LinkedDimensionsPropValue, type NumberPropValue, type ObjectPropType, type PlainPropType, type PlainPropValue, type PlainProps, type PropKey, type PropType, type PropTypeUtil, type PropValue, type Props, type ShadowPropValue, type SizePropValue, type StringPropValue, type StrokePropValue, type TransformablePropType, type TransformablePropValue$1 as TransformablePropValue, type UnionPropType, type UrlPropValue, backgroundColorOverlayPropTypeUtil, backgroundOverlayPropTypeUtil, backgroundPropTypeUtil, borderRadiusPropTypeUtil, borderWidthPropTypeUtil, boxShadowPropTypeUtil, classesPropTypeUtil, colorPropTypeUtil, createPropUtils, gapPropTypeUtil, imageAttachmentIdPropType, imagePropTypeUtil, imageSrcPropTypeUtil, isTransformable, linkPropTypeUtil, linkedDimensionsPropTypeUtil, numberPropTypeUtil, shadowPropTypeUtil, sizePropTypeUtil, stringPropTypeUtil, strokePropTypeUtil, urlPropTypeUtil };
|
|
1623
|
+
export { type ArrayPropType, type ArrayPropValue, type BackgroundColorOverlayPropValue, type BackgroundImageOverlayPropValue, type BackgroundOverlayItemPropValue, type BackgroundOverlayPropValue, type BackgroundPropValue, type BooleanPropValue, type BorderRadiusPropValue, type BorderWidthPropValue, type BoxShadowPropValue, type ClassesPropValue, type ColorPropValue, type CreateOptions, type GapPropValue, type ImageAttachmentIdPropValue, type ImagePropValue, type ImageSrcPropValue, type LinkPropValue, type LinkedDimensionsPropValue, type NumberPropValue, type ObjectPropType, type ObjectPropValue, type PlainPropType, type PlainPropValue, type PlainProps, type PropKey, type PropType, 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, backgroundImageOverlayPropTypeUtil, backgroundOverlayPropTypeUtil, backgroundPropTypeUtil, booleanPropTypeUtil, borderRadiusPropTypeUtil, borderWidthPropTypeUtil, boxShadowPropTypeUtil, classesPropTypeUtil, colorPropTypeUtil, createPropUtils, gapPropTypeUtil, imageAttachmentIdPropType, imagePropTypeUtil, imageSrcPropTypeUtil, isTransformable, linkPropTypeUtil, linkedDimensionsPropTypeUtil, numberPropTypeUtil, shadowPropTypeUtil, sizePropTypeUtil, stringPropTypeUtil, strokePropTypeUtil, urlPropTypeUtil };
|
package/dist/index.js
CHANGED
|
@@ -21,8 +21,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
backgroundColorOverlayPropTypeUtil: () => backgroundColorOverlayPropTypeUtil,
|
|
24
|
+
backgroundImageOverlayPropTypeUtil: () => backgroundImageOverlayPropTypeUtil,
|
|
24
25
|
backgroundOverlayPropTypeUtil: () => backgroundOverlayPropTypeUtil,
|
|
25
26
|
backgroundPropTypeUtil: () => backgroundPropTypeUtil,
|
|
27
|
+
booleanPropTypeUtil: () => booleanPropTypeUtil,
|
|
26
28
|
borderRadiusPropTypeUtil: () => borderRadiusPropTypeUtil,
|
|
27
29
|
borderWidthPropTypeUtil: () => borderWidthPropTypeUtil,
|
|
28
30
|
boxShadowPropTypeUtil: () => boxShadowPropTypeUtil,
|
|
@@ -88,7 +90,8 @@ function createPropUtils(key, valueSchema) {
|
|
|
88
90
|
extract,
|
|
89
91
|
isValid,
|
|
90
92
|
create,
|
|
91
|
-
schema
|
|
93
|
+
schema,
|
|
94
|
+
key
|
|
92
95
|
};
|
|
93
96
|
}
|
|
94
97
|
|
|
@@ -191,7 +194,7 @@ var linkedDimensionsPropTypeUtil = createPropUtils(
|
|
|
191
194
|
|
|
192
195
|
// src/prop-types/number.ts
|
|
193
196
|
var import_schema13 = require("@elementor/schema");
|
|
194
|
-
var numberPropTypeUtil = createPropUtils("number", import_schema13.z.number());
|
|
197
|
+
var numberPropTypeUtil = createPropUtils("number", import_schema13.z.number().nullable());
|
|
195
198
|
|
|
196
199
|
// src/prop-types/size.ts
|
|
197
200
|
var import_schema14 = require("@elementor/schema");
|
|
@@ -226,9 +229,8 @@ var import_schema18 = require("@elementor/schema");
|
|
|
226
229
|
var linkPropTypeUtil = createPropUtils(
|
|
227
230
|
"link",
|
|
228
231
|
import_schema18.z.strictObject({
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
isTargetBlank: import_schema18.z.boolean()
|
|
232
|
+
href: unknownChildrenSchema,
|
|
233
|
+
isTargetBlank: unknownChildrenSchema
|
|
232
234
|
})
|
|
233
235
|
);
|
|
234
236
|
|
|
@@ -273,12 +275,16 @@ var backgroundImageOverlayPropTypeUtil = createPropUtils("background-image-overl
|
|
|
273
275
|
var backgroundOverlayItem = backgroundColorOverlayPropTypeUtil.schema.or(backgroundGradientOverlayPropTypeUtil.schema).or(backgroundImageOverlayPropTypeUtil.schema);
|
|
274
276
|
var backgroundOverlayPropTypeUtil = createPropUtils("background-overlay", import_schema22.z.array(backgroundOverlayItem));
|
|
275
277
|
|
|
276
|
-
// src/
|
|
278
|
+
// src/prop-types/boolean.ts
|
|
277
279
|
var import_schema23 = require("@elementor/schema");
|
|
278
|
-
var
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
280
|
+
var booleanPropTypeUtil = createPropUtils("boolean", import_schema23.z.boolean().nullable());
|
|
281
|
+
|
|
282
|
+
// src/utils/is-transformable.ts
|
|
283
|
+
var import_schema24 = require("@elementor/schema");
|
|
284
|
+
var transformableSchema = import_schema24.z.object({
|
|
285
|
+
$$type: import_schema24.z.string(),
|
|
286
|
+
value: import_schema24.z.any(),
|
|
287
|
+
disabled: import_schema24.z.boolean().optional()
|
|
282
288
|
});
|
|
283
289
|
var isTransformable = (value) => {
|
|
284
290
|
return transformableSchema.safeParse(value).success;
|
|
@@ -286,8 +292,10 @@ var isTransformable = (value) => {
|
|
|
286
292
|
// Annotate the CommonJS export names for ESM import in node:
|
|
287
293
|
0 && (module.exports = {
|
|
288
294
|
backgroundColorOverlayPropTypeUtil,
|
|
295
|
+
backgroundImageOverlayPropTypeUtil,
|
|
289
296
|
backgroundOverlayPropTypeUtil,
|
|
290
297
|
backgroundPropTypeUtil,
|
|
298
|
+
booleanPropTypeUtil,
|
|
291
299
|
borderRadiusPropTypeUtil,
|
|
292
300
|
borderWidthPropTypeUtil,
|
|
293
301
|
boxShadowPropTypeUtil,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/prop-types/box-shadow.ts","../src/utils/create-prop-utils.ts","../src/prop-types/shadow.ts","../src/prop-types/utils.ts","../src/prop-types/border-radius.ts","../src/prop-types/border-width.ts","../src/prop-types/classes.ts","../src/prop-types/color.ts","../src/prop-types/image.ts","../src/prop-types/image-attachment-id.ts","../src/prop-types/image-src.ts","../src/prop-types/linked-dimensions.ts","../src/prop-types/number.ts","../src/prop-types/size.ts","../src/prop-types/string.ts","../src/prop-types/stroke.ts","../src/prop-types/url.ts","../src/prop-types/link.ts","../src/prop-types/gaps.ts","../src/prop-types/background-prop-types/background.ts","../src/prop-types/background-prop-types/background-overlay.ts","../src/prop-types/background-prop-types/background-color-overlay.ts","../src/prop-types/background-prop-types/background-gradient-overlay.ts","../src/prop-types/background-prop-types/background-image-overlay.ts","../src/utils/is-transformable.ts"],"sourcesContent":["// types\nexport * from './types';\nexport { type PropTypeUtil, type CreateOptions } from './utils/create-prop-utils';\n\n// prop types\nexport * from './prop-types';\n\n// utils\nexport { createPropUtils } from './utils/create-prop-utils';\nexport { isTransformable } from './utils/is-transformable';\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\nimport { shadowPropTypeUtil } from './shadow';\n\nexport const boxShadowPropTypeUtil = createPropUtils( 'box-shadow', z.array( shadowPropTypeUtil.schema ) );\n\nexport type BoxShadowPropValue = z.infer< typeof boxShadowPropTypeUtil.schema >;\n","import { z, type ZodType } from '@elementor/schema';\n\nimport { type PropValue, type TransformablePropValue } from '../types';\n\ntype Updater< T > = ( prev?: T ) => T;\n\nexport type CreateOptions = {\n\tbase?: unknown;\n\tdisabled?: boolean;\n};\n\nexport type PropTypeUtil< TKey extends string, TValue extends PropValue > = ReturnType<\n\ttypeof createPropUtils< TKey, TValue >\n>;\n\n/**\n * Usage example:\n *\n * ```ts\n * const elementsPropUtils = createPropUtils( 'elements', z.array( z.string() ) );\n *\n * elementsPropUtils.isValid( element.props?.children );\n * elementsPropUtils.create( [ 'a', 'b' ] );\n * elementsPropUtils.create( ( prev = [] ) => [ ...prev, 'c' ], { base: element.props?.children } );\n * elementsPropUtils.create( ( prev = [] ) => [ ...prev, 'c' ], { disabled: true } );\n * elementsPropUtils.extract( element.props?.children );\n *\n * ```\n */\n\nexport function createPropUtils< TKey extends string, TValue extends PropValue >(\n\tkey: TKey,\n\tvalueSchema: ZodType< TValue >\n) {\n\tconst schema = z.strictObject( {\n\t\t$$type: z.literal( key ),\n\t\tvalue: valueSchema,\n\t\tdisabled: z.boolean().optional(),\n\t} );\n\n\ttype Prop = TransformablePropValue< TKey, TValue >;\n\n\tfunction isValid( prop: unknown ): prop is Prop {\n\t\treturn schema.safeParse( prop ).success;\n\t}\n\n\tfunction create( value: TValue ): Prop;\n\tfunction create( value: TValue, createOptions?: CreateOptions ): Prop;\n\tfunction create( value: Updater< TValue >, createOptions: CreateOptions ): Prop;\n\tfunction create( value: TValue | Updater< TValue >, createOptions?: CreateOptions ): Prop {\n\t\tconst fn = ( typeof value === 'function' ? value : () => value ) as Updater< TValue >;\n\n\t\tconst { base, disabled } = createOptions || {};\n\n\t\tif ( ! base ) {\n\t\t\treturn {\n\t\t\t\t$$type: key,\n\t\t\t\tvalue: fn(),\n\t\t\t\t...( disabled && { disabled } ),\n\t\t\t};\n\t\t}\n\n\t\tif ( ! isValid( base ) ) {\n\t\t\tthrow new Error( `Cannot create prop based on invalid value: ${ JSON.stringify( base ) }` );\n\t\t}\n\n\t\treturn {\n\t\t\t$$type: key,\n\t\t\tvalue: fn( base.value ),\n\t\t\t...( disabled && { disabled } ),\n\t\t};\n\t}\n\n\tfunction extract( prop: unknown ): TValue | null {\n\t\tif ( ! isValid( prop ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn prop.value;\n\t}\n\n\treturn {\n\t\textract,\n\t\tisValid,\n\t\tcreate,\n\t\tschema,\n\t};\n}\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\nimport { unknownChildrenSchema } from './utils';\n\nexport const shadowPropTypeUtil = createPropUtils(\n\t'shadow',\n\tz.strictObject( {\n\t\tposition: unknownChildrenSchema,\n\t\thOffset: unknownChildrenSchema,\n\t\tvOffset: unknownChildrenSchema,\n\t\tblur: unknownChildrenSchema,\n\t\tspread: unknownChildrenSchema,\n\t\tcolor: unknownChildrenSchema,\n\t} )\n);\n\nexport type ShadowPropValue = z.infer< typeof shadowPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nexport const unknownChildrenSchema = z.any().nullable();\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\nimport { unknownChildrenSchema } from './utils';\n\nexport const borderRadiusPropTypeUtil = createPropUtils(\n\t'border-radius',\n\tz.strictObject( {\n\t\t'top-left': unknownChildrenSchema,\n\t\t'top-right': unknownChildrenSchema,\n\t\t'bottom-right': unknownChildrenSchema,\n\t\t'bottom-left': unknownChildrenSchema,\n\t} )\n);\n\nexport type BorderRadiusPropValue = z.infer< typeof borderRadiusPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\nimport { unknownChildrenSchema } from './utils';\n\nexport const borderWidthPropTypeUtil = createPropUtils(\n\t'border-width',\n\tz.strictObject( {\n\t\ttop: unknownChildrenSchema,\n\t\tright: unknownChildrenSchema,\n\t\tbottom: unknownChildrenSchema,\n\t\tleft: unknownChildrenSchema,\n\t} )\n);\n\nexport type BorderWidthPropValue = z.infer< typeof borderWidthPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\n\nexport const classesPropTypeUtil = createPropUtils( 'classes', z.array( z.string().regex( /^[a-z][a-z-_0-9]*$/i ) ) );\n\nexport type ClassesPropValue = z.infer< typeof classesPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\n\nexport const colorPropTypeUtil = createPropUtils( 'color', z.string() );\n\nexport type ColorPropValue = z.infer< typeof colorPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\nimport { unknownChildrenSchema } from './utils';\n\nexport const imagePropTypeUtil = createPropUtils(\n\t'image',\n\tz.strictObject( {\n\t\tsrc: unknownChildrenSchema,\n\t\tsize: unknownChildrenSchema,\n\t} )\n);\n\nexport type ImagePropValue = z.infer< typeof imagePropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\n\nexport const imageAttachmentIdPropType = createPropUtils( 'image-attachment-id', z.number() );\n\nexport type ImageAttachmentIdPropValue = z.infer< typeof imageAttachmentIdPropType.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\nimport { unknownChildrenSchema } from './utils';\n\nexport const imageSrcPropTypeUtil = createPropUtils(\n\t'image-src',\n\tz\n\t\t.strictObject( {\n\t\t\tid: unknownChildrenSchema,\n\t\t\turl: z.null(),\n\t\t} )\n\t\t.or(\n\t\t\tz.strictObject( {\n\t\t\t\tid: z.null(),\n\t\t\t\turl: unknownChildrenSchema,\n\t\t\t} )\n\t\t)\n);\n\nexport type ImageSrcPropValue = z.infer< typeof imageSrcPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\nimport { unknownChildrenSchema } from './utils';\n\nexport const linkedDimensionsPropTypeUtil = createPropUtils(\n\t'linked-dimensions',\n\tz.strictObject( {\n\t\tisLinked: unknownChildrenSchema,\n\t\ttop: unknownChildrenSchema,\n\t\tright: unknownChildrenSchema,\n\t\tbottom: unknownChildrenSchema,\n\t\tleft: unknownChildrenSchema,\n\t} )\n);\n\nexport type LinkedDimensionsPropValue = z.infer< typeof linkedDimensionsPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\n\nexport const numberPropTypeUtil = createPropUtils( 'number', z.number() );\n\nexport type NumberPropValue = z.infer< typeof numberPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\n\nexport const sizePropTypeUtil = createPropUtils(\n\t'size',\n\tz.strictObject( {\n\t\tunit: z.enum( [ 'px', 'em', 'rem', '%', 'vw', 'vh' ] ),\n\t\tsize: z.number(),\n\t} )\n);\n\nexport type SizePropValue = z.infer< typeof sizePropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\n\nexport const stringPropTypeUtil = createPropUtils( 'string', z.string().nullable() );\n\nexport type StringPropValue = z.infer< typeof stringPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\nimport { unknownChildrenSchema } from './utils';\n\nexport const strokePropTypeUtil = createPropUtils(\n\t'stroke',\n\tz.strictObject( {\n\t\tcolor: unknownChildrenSchema,\n\t\twidth: unknownChildrenSchema,\n\t} )\n);\n\nexport type StrokePropValue = z.infer< typeof strokePropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\n\nexport const urlPropTypeUtil = createPropUtils( 'url', z.string().url().nullable() );\n\nexport type UrlPropValue = z.infer< typeof urlPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\nimport { urlPropTypeUtil } from './url';\n\nexport const linkPropTypeUtil = createPropUtils(\n\t'link',\n\tz.strictObject( {\n\t\tenabled: z.boolean(),\n\t\thref: urlPropTypeUtil.schema,\n\t\tisTargetBlank: z.boolean(),\n\t} )\n);\n\nexport type LinkPropValue = z.infer< typeof linkPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\n\nexport const gapPropTypeUtil = createPropUtils(\n\t'gap',\n\tz.object( {\n\t\tisLinked: z.boolean(),\n\t\trow: z.any(),\n\t\tcolumn: z.any(),\n\t} )\n);\n\nexport type GapPropValue = z.infer< typeof gapPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../../utils/create-prop-utils';\nimport { unknownChildrenSchema } from '../utils';\n\nexport const backgroundPropTypeUtil = createPropUtils(\n\t'background',\n\tz.strictObject( {\n\t\tcolor: unknownChildrenSchema,\n\t\t'background-overlay': unknownChildrenSchema,\n\t} )\n);\n\nexport type BackgroundPropValue = z.infer< typeof backgroundPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../../utils/create-prop-utils';\nimport { backgroundColorOverlayPropTypeUtil } from './background-color-overlay';\nimport { backgroundGradientOverlayPropTypeUtil } from './background-gradient-overlay';\nimport { backgroundImageOverlayPropTypeUtil } from './background-image-overlay';\n\nconst backgroundOverlayItem = backgroundColorOverlayPropTypeUtil.schema\n\t.or( backgroundGradientOverlayPropTypeUtil.schema )\n\t.or( backgroundImageOverlayPropTypeUtil.schema );\n\nexport const backgroundOverlayPropTypeUtil = createPropUtils( 'background-overlay', z.array( backgroundOverlayItem ) );\n\nexport type BackgroundOverlayPropValue = z.infer< typeof backgroundOverlayPropTypeUtil.schema >;\nexport type BackgroundOverlayItemPropValue = z.infer< typeof backgroundOverlayItem >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../../utils/create-prop-utils';\n\nexport const backgroundColorOverlayPropTypeUtil = createPropUtils( 'background-color-overlay', z.string() );\n\nexport type BackgroundColorOverlayPropValue = z.infer< typeof backgroundColorOverlayPropTypeUtil.schema >;\n","import { type z } from '@elementor/schema';\n\nimport { createPropUtils } from '../../utils/create-prop-utils';\nimport { unknownChildrenSchema } from '../utils';\n\nexport const backgroundGradientOverlayPropTypeUtil = createPropUtils(\n\t'background-gradient-overlay',\n\tunknownChildrenSchema\n);\n\nexport type BackgroundGradientOverlayPropValue = z.infer< typeof backgroundGradientOverlayPropTypeUtil.schema >;\n","import { type z } from '@elementor/schema';\n\nimport { createPropUtils } from '../../utils/create-prop-utils';\nimport { unknownChildrenSchema } from '../utils';\n\nexport const backgroundImageOverlayPropTypeUtil = createPropUtils( 'background-image-overlay', unknownChildrenSchema );\n\nexport type BackgroundImageOverlayPropValue = z.infer< typeof backgroundImageOverlayPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nconst transformableSchema = z.object( {\n\t$$type: z.string(),\n\tvalue: z.any(),\n\tdisabled: z.boolean().optional(),\n} );\n\ntype TransformablePropValue = z.infer< typeof transformableSchema >;\n\nexport const isTransformable = ( value: unknown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T,UAAU,kBAAE,QAAQ;AAAA,IACpB,KAAK,kBAAE,IAAI;AAAA,IACX,QAAQ,kBAAE,IAAI;AAAA,EACf,CAAE;AACH;;;ACXA,IAAAC,kBAAkB;AAKX,IAAM,yBAAyB;AAAA,EACrC;AAAA,EACA,kBAAE,aAAc;AAAA,IACf,OAAO;AAAA,IACP,sBAAsB;AAAA,EACvB,CAAE;AACH;;;ACXA,IAAAC,kBAAkB;;;ACAlB,IAAAC,kBAAkB;AAIX,IAAM,qCAAqC,gBAAiB,4BAA4B,kBAAE,OAAO,CAAE;;;ACCnG,IAAM,wCAAwC;AAAA,EACpD;AAAA,EACA;AACD;;;ACHO,IAAM,qCAAqC,gBAAiB,4BAA4B,qBAAsB;;;AHErH,IAAM,wBAAwB,mCAAmC,OAC/D,GAAI,sCAAsC,MAAO,EACjD,GAAI,mCAAmC,MAAO;AAEzC,IAAM,gCAAgC,gBAAiB,sBAAsB,kBAAE,MAAO,qBAAsB,CAAE;;;AIXrH,IAAAC,kBAAkB;AAElB,IAAM,sBAAsB,kBAAE,OAAQ;AAAA,EACrC,QAAQ,kBAAE,OAAO;AAAA,EACjB,OAAO,kBAAE,IAAI;AAAA,EACb,UAAU,kBAAE,QAAQ,EAAE,SAAS;AAChC,CAAE;AAIK,IAAM,kBAAkB,CAAE,UAAqD;AACrF,SAAO,oBAAoB,UAAW,KAAM,EAAE;AAC/C;","names":["import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/prop-types/box-shadow.ts","../src/utils/create-prop-utils.ts","../src/prop-types/shadow.ts","../src/prop-types/utils.ts","../src/prop-types/border-radius.ts","../src/prop-types/border-width.ts","../src/prop-types/classes.ts","../src/prop-types/color.ts","../src/prop-types/image.ts","../src/prop-types/image-attachment-id.ts","../src/prop-types/image-src.ts","../src/prop-types/linked-dimensions.ts","../src/prop-types/number.ts","../src/prop-types/size.ts","../src/prop-types/string.ts","../src/prop-types/stroke.ts","../src/prop-types/url.ts","../src/prop-types/link.ts","../src/prop-types/gaps.ts","../src/prop-types/background-prop-types/background.ts","../src/prop-types/background-prop-types/background-overlay.ts","../src/prop-types/background-prop-types/background-color-overlay.ts","../src/prop-types/background-prop-types/background-gradient-overlay.ts","../src/prop-types/background-prop-types/background-image-overlay.ts","../src/prop-types/boolean.ts","../src/utils/is-transformable.ts"],"sourcesContent":["// types\nexport * from './types';\nexport { type PropTypeUtil, type CreateOptions } from './utils/create-prop-utils';\n\n// prop types\nexport * from './prop-types';\n\n// utils\nexport { createPropUtils } from './utils/create-prop-utils';\nexport { isTransformable } from './utils/is-transformable';\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\nimport { shadowPropTypeUtil } from './shadow';\n\nexport const boxShadowPropTypeUtil = createPropUtils( 'box-shadow', z.array( shadowPropTypeUtil.schema ) );\n\nexport type BoxShadowPropValue = z.infer< typeof boxShadowPropTypeUtil.schema >;\n","import { z, type ZodType } from '@elementor/schema';\n\nimport { type PropValue, type TransformablePropValue } from '../types';\n\ntype Updater< T > = ( prev?: T ) => T;\n\nexport type CreateOptions = {\n\tbase?: unknown;\n\tdisabled?: boolean;\n};\n\nexport type PropTypeUtil< TKey extends string, TValue extends PropValue > = ReturnType<\n\ttypeof createPropUtils< TKey, TValue >\n>;\n\n/**\n * Usage example:\n *\n * ```ts\n * const elementsPropUtils = createPropUtils( 'elements', z.array( z.string() ) );\n *\n * elementsPropUtils.isValid( element.props?.children );\n * elementsPropUtils.create( [ 'a', 'b' ] );\n * elementsPropUtils.create( ( prev = [] ) => [ ...prev, 'c' ], { base: element.props?.children } );\n * elementsPropUtils.create( ( prev = [] ) => [ ...prev, 'c' ], { disabled: true } );\n * elementsPropUtils.extract( element.props?.children );\n *\n * ```\n */\n\nexport function createPropUtils< TKey extends string, TValue extends PropValue >(\n\tkey: TKey,\n\tvalueSchema: ZodType< TValue >\n) {\n\tconst schema = z.strictObject( {\n\t\t$$type: z.literal( key ),\n\t\tvalue: valueSchema,\n\t\tdisabled: z.boolean().optional(),\n\t} );\n\n\ttype Prop = TransformablePropValue< TKey, TValue >;\n\n\tfunction isValid( prop: unknown ): prop is Prop {\n\t\treturn schema.safeParse( prop ).success;\n\t}\n\n\tfunction create( value: TValue ): Prop;\n\tfunction create( value: TValue, createOptions?: CreateOptions ): Prop;\n\tfunction create( value: Updater< TValue >, createOptions: CreateOptions ): Prop;\n\tfunction create( value: TValue | Updater< TValue >, createOptions?: CreateOptions ): Prop {\n\t\tconst fn = ( typeof value === 'function' ? value : () => value ) as Updater< TValue >;\n\n\t\tconst { base, disabled } = createOptions || {};\n\n\t\tif ( ! base ) {\n\t\t\treturn {\n\t\t\t\t$$type: key,\n\t\t\t\tvalue: fn(),\n\t\t\t\t...( disabled && { disabled } ),\n\t\t\t};\n\t\t}\n\n\t\tif ( ! isValid( base ) ) {\n\t\t\tthrow new Error( `Cannot create prop based on invalid value: ${ JSON.stringify( base ) }` );\n\t\t}\n\n\t\treturn {\n\t\t\t$$type: key,\n\t\t\tvalue: fn( base.value ),\n\t\t\t...( disabled && { disabled } ),\n\t\t};\n\t}\n\n\tfunction extract( prop: unknown ): TValue | null {\n\t\tif ( ! isValid( prop ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn prop.value;\n\t}\n\n\treturn {\n\t\textract,\n\t\tisValid,\n\t\tcreate,\n\t\tschema,\n\t\tkey: key as TKey,\n\t};\n}\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\nimport { unknownChildrenSchema } from './utils';\n\nexport const shadowPropTypeUtil = createPropUtils(\n\t'shadow',\n\tz.strictObject( {\n\t\tposition: unknownChildrenSchema,\n\t\thOffset: unknownChildrenSchema,\n\t\tvOffset: unknownChildrenSchema,\n\t\tblur: unknownChildrenSchema,\n\t\tspread: unknownChildrenSchema,\n\t\tcolor: unknownChildrenSchema,\n\t} )\n);\n\nexport type ShadowPropValue = z.infer< typeof shadowPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nexport const unknownChildrenSchema = z.any().nullable();\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\nimport { unknownChildrenSchema } from './utils';\n\nexport const borderRadiusPropTypeUtil = createPropUtils(\n\t'border-radius',\n\tz.strictObject( {\n\t\t'top-left': unknownChildrenSchema,\n\t\t'top-right': unknownChildrenSchema,\n\t\t'bottom-right': unknownChildrenSchema,\n\t\t'bottom-left': unknownChildrenSchema,\n\t} )\n);\n\nexport type BorderRadiusPropValue = z.infer< typeof borderRadiusPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\nimport { unknownChildrenSchema } from './utils';\n\nexport const borderWidthPropTypeUtil = createPropUtils(\n\t'border-width',\n\tz.strictObject( {\n\t\ttop: unknownChildrenSchema,\n\t\tright: unknownChildrenSchema,\n\t\tbottom: unknownChildrenSchema,\n\t\tleft: unknownChildrenSchema,\n\t} )\n);\n\nexport type BorderWidthPropValue = z.infer< typeof borderWidthPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\n\nexport const classesPropTypeUtil = createPropUtils( 'classes', z.array( z.string().regex( /^[a-z][a-z-_0-9]*$/i ) ) );\n\nexport type ClassesPropValue = z.infer< typeof classesPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\n\nexport const colorPropTypeUtil = createPropUtils( 'color', z.string() );\n\nexport type ColorPropValue = z.infer< typeof colorPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\nimport { unknownChildrenSchema } from './utils';\n\nexport const imagePropTypeUtil = createPropUtils(\n\t'image',\n\tz.strictObject( {\n\t\tsrc: unknownChildrenSchema,\n\t\tsize: unknownChildrenSchema,\n\t} )\n);\n\nexport type ImagePropValue = z.infer< typeof imagePropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\n\nexport const imageAttachmentIdPropType = createPropUtils( 'image-attachment-id', z.number() );\n\nexport type ImageAttachmentIdPropValue = z.infer< typeof imageAttachmentIdPropType.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\nimport { unknownChildrenSchema } from './utils';\n\nexport const imageSrcPropTypeUtil = createPropUtils(\n\t'image-src',\n\tz\n\t\t.strictObject( {\n\t\t\tid: unknownChildrenSchema,\n\t\t\turl: z.null(),\n\t\t} )\n\t\t.or(\n\t\t\tz.strictObject( {\n\t\t\t\tid: z.null(),\n\t\t\t\turl: unknownChildrenSchema,\n\t\t\t} )\n\t\t)\n);\n\nexport type ImageSrcPropValue = z.infer< typeof imageSrcPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\nimport { unknownChildrenSchema } from './utils';\n\nexport const linkedDimensionsPropTypeUtil = createPropUtils(\n\t'linked-dimensions',\n\tz.strictObject( {\n\t\tisLinked: unknownChildrenSchema,\n\t\ttop: unknownChildrenSchema,\n\t\tright: unknownChildrenSchema,\n\t\tbottom: unknownChildrenSchema,\n\t\tleft: unknownChildrenSchema,\n\t} )\n);\n\nexport type LinkedDimensionsPropValue = z.infer< typeof linkedDimensionsPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\n\nexport const numberPropTypeUtil = createPropUtils( 'number', z.number().nullable() );\n\nexport type NumberPropValue = z.infer< typeof numberPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\n\nexport const sizePropTypeUtil = createPropUtils(\n\t'size',\n\tz.strictObject( {\n\t\tunit: z.enum( [ 'px', 'em', 'rem', '%', 'vw', 'vh' ] ),\n\t\tsize: z.number(),\n\t} )\n);\n\nexport type SizePropValue = z.infer< typeof sizePropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\n\nexport const stringPropTypeUtil = createPropUtils( 'string', z.string().nullable() );\n\nexport type StringPropValue = z.infer< typeof stringPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\nimport { unknownChildrenSchema } from './utils';\n\nexport const strokePropTypeUtil = createPropUtils(\n\t'stroke',\n\tz.strictObject( {\n\t\tcolor: unknownChildrenSchema,\n\t\twidth: unknownChildrenSchema,\n\t} )\n);\n\nexport type StrokePropValue = z.infer< typeof strokePropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\n\nexport const urlPropTypeUtil = createPropUtils( 'url', z.string().url().nullable() );\n\nexport type UrlPropValue = z.infer< typeof urlPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\nimport { unknownChildrenSchema } from './utils';\n\nexport const linkPropTypeUtil = createPropUtils(\n\t'link',\n\tz.strictObject( {\n\t\thref: unknownChildrenSchema,\n\t\tisTargetBlank: unknownChildrenSchema,\n\t} )\n);\n\nexport type LinkPropValue = z.infer< typeof linkPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\n\nexport const gapPropTypeUtil = createPropUtils(\n\t'gap',\n\tz.object( {\n\t\tisLinked: z.boolean(),\n\t\trow: z.any(),\n\t\tcolumn: z.any(),\n\t} )\n);\n\nexport type GapPropValue = z.infer< typeof gapPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../../utils/create-prop-utils';\nimport { unknownChildrenSchema } from '../utils';\n\nexport const backgroundPropTypeUtil = createPropUtils(\n\t'background',\n\tz.strictObject( {\n\t\tcolor: unknownChildrenSchema,\n\t\t'background-overlay': unknownChildrenSchema,\n\t} )\n);\n\nexport type BackgroundPropValue = z.infer< typeof backgroundPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../../utils/create-prop-utils';\nimport { backgroundColorOverlayPropTypeUtil } from './background-color-overlay';\nimport { backgroundGradientOverlayPropTypeUtil } from './background-gradient-overlay';\nimport { backgroundImageOverlayPropTypeUtil } from './background-image-overlay';\n\nconst backgroundOverlayItem = backgroundColorOverlayPropTypeUtil.schema\n\t.or( backgroundGradientOverlayPropTypeUtil.schema )\n\t.or( backgroundImageOverlayPropTypeUtil.schema );\n\nexport const backgroundOverlayPropTypeUtil = createPropUtils( 'background-overlay', z.array( backgroundOverlayItem ) );\n\nexport type BackgroundOverlayPropValue = z.infer< typeof backgroundOverlayPropTypeUtil.schema >;\nexport type BackgroundOverlayItemPropValue = z.infer< typeof backgroundOverlayItem >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../../utils/create-prop-utils';\n\nexport const backgroundColorOverlayPropTypeUtil = createPropUtils( 'background-color-overlay', z.string() );\n\nexport type BackgroundColorOverlayPropValue = z.infer< typeof backgroundColorOverlayPropTypeUtil.schema >;\n","import { type z } from '@elementor/schema';\n\nimport { createPropUtils } from '../../utils/create-prop-utils';\nimport { unknownChildrenSchema } from '../utils';\n\nexport const backgroundGradientOverlayPropTypeUtil = createPropUtils(\n\t'background-gradient-overlay',\n\tunknownChildrenSchema\n);\n\nexport type BackgroundGradientOverlayPropValue = z.infer< typeof backgroundGradientOverlayPropTypeUtil.schema >;\n","import { type z } from '@elementor/schema';\n\nimport { createPropUtils } from '../../utils/create-prop-utils';\nimport { unknownChildrenSchema } from '../utils';\n\nexport const backgroundImageOverlayPropTypeUtil = createPropUtils( 'background-image-overlay', unknownChildrenSchema );\n\nexport type BackgroundImageOverlayPropValue = z.infer< typeof backgroundImageOverlayPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\n\nexport const booleanPropTypeUtil = createPropUtils( 'boolean', z.boolean().nullable() );\n\nexport type BooleanPropValue = z.infer< typeof booleanPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nconst transformableSchema = z.object( {\n\t$$type: z.string(),\n\tvalue: z.any(),\n\tdisabled: z.boolean().optional(),\n} );\n\ntype TransformablePropValue = z.infer< typeof transformableSchema >;\n\nexport const isTransformable = ( value: unknown ): value is TransformablePropValue => {\n\treturn transformableSchema.safeParse( value ).success;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,iBAAkB;;;ACAlB,oBAAgC;AA8BzB,SAAS,gBACf,KACA,aACC;AACD,QAAM,SAAS,gBAAE,aAAc;AAAA,IAC9B,QAAQ,gBAAE,QAAS,GAAI;AAAA,IACvB,OAAO;AAAA,IACP,UAAU,gBAAE,QAAQ,EAAE,SAAS;AAAA,EAChC,CAAE;AAIF,WAAS,QAAS,MAA8B;AAC/C,WAAO,OAAO,UAAW,IAAK,EAAE;AAAA,EACjC;AAKA,WAAS,OAAQ,OAAmC,eAAsC;AACzF,UAAM,KAAO,OAAO,UAAU,aAAa,QAAQ,MAAM;AAEzD,UAAM,EAAE,MAAM,SAAS,IAAI,iBAAiB,CAAC;AAE7C,QAAK,CAAE,MAAO;AACb,aAAO;AAAA,QACN,QAAQ;AAAA,QACR,OAAO,GAAG;AAAA,QACV,GAAK,YAAY,EAAE,SAAS;AAAA,MAC7B;AAAA,IACD;AAEA,QAAK,CAAE,QAAS,IAAK,GAAI;AACxB,YAAM,IAAI,MAAO,8CAA+C,KAAK,UAAW,IAAK,CAAE,EAAG;AAAA,IAC3F;AAEA,WAAO;A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import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema","import_schema"]}
|