@elementor/editor-props 0.7.1 → 0.8.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 +6 -0
- package/dist/index.d.mts +86 -99
- package/dist/index.d.ts +86 -99
- package/dist/index.js +14 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/prop-types/index.ts +1 -1
- package/src/prop-types/layout-direction.ts +13 -0
- package/src/prop-types/gaps.ts +0 -14
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -257,7 +257,7 @@ declare const boxShadowPropTypeUtil: {
|
|
|
257
257
|
}[];
|
|
258
258
|
disabled?: boolean | undefined;
|
|
259
259
|
}>;
|
|
260
|
-
key:
|
|
260
|
+
key: "box-shadow";
|
|
261
261
|
};
|
|
262
262
|
type BoxShadowPropValue = z.infer<typeof boxShadowPropTypeUtil.schema>;
|
|
263
263
|
|
|
@@ -347,7 +347,7 @@ declare const borderRadiusPropTypeUtil: {
|
|
|
347
347
|
};
|
|
348
348
|
disabled?: boolean | undefined;
|
|
349
349
|
}>;
|
|
350
|
-
key:
|
|
350
|
+
key: "border-radius";
|
|
351
351
|
};
|
|
352
352
|
type BorderRadiusPropValue = z.infer<typeof borderRadiusPropTypeUtil.schema>;
|
|
353
353
|
|
|
@@ -437,7 +437,7 @@ declare const borderWidthPropTypeUtil: {
|
|
|
437
437
|
};
|
|
438
438
|
disabled?: boolean | undefined;
|
|
439
439
|
}>;
|
|
440
|
-
key:
|
|
440
|
+
key: "border-width";
|
|
441
441
|
};
|
|
442
442
|
type BorderWidthPropValue = z.infer<typeof borderWidthPropTypeUtil.schema>;
|
|
443
443
|
|
|
@@ -462,7 +462,7 @@ declare const classesPropTypeUtil: {
|
|
|
462
462
|
value: string[];
|
|
463
463
|
disabled?: boolean | undefined;
|
|
464
464
|
}>;
|
|
465
|
-
key:
|
|
465
|
+
key: "classes";
|
|
466
466
|
};
|
|
467
467
|
type ClassesPropValue = z.infer<typeof classesPropTypeUtil.schema>;
|
|
468
468
|
|
|
@@ -487,7 +487,7 @@ declare const colorPropTypeUtil: {
|
|
|
487
487
|
value: string;
|
|
488
488
|
disabled?: boolean | undefined;
|
|
489
489
|
}>;
|
|
490
|
-
key:
|
|
490
|
+
key: "color";
|
|
491
491
|
};
|
|
492
492
|
type ColorPropValue = z.infer<typeof colorPropTypeUtil.schema>;
|
|
493
493
|
|
|
@@ -551,7 +551,7 @@ declare const imagePropTypeUtil: {
|
|
|
551
551
|
};
|
|
552
552
|
disabled?: boolean | undefined;
|
|
553
553
|
}>;
|
|
554
|
-
key:
|
|
554
|
+
key: "image";
|
|
555
555
|
};
|
|
556
556
|
type ImagePropValue = z.infer<typeof imagePropTypeUtil.schema>;
|
|
557
557
|
|
|
@@ -576,7 +576,7 @@ declare const imageAttachmentIdPropType: {
|
|
|
576
576
|
value: number;
|
|
577
577
|
disabled?: boolean | undefined;
|
|
578
578
|
}>;
|
|
579
|
-
key:
|
|
579
|
+
key: "image-attachment-id";
|
|
580
580
|
};
|
|
581
581
|
type ImageAttachmentIdPropValue = z.infer<typeof imageAttachmentIdPropType.schema>;
|
|
582
582
|
|
|
@@ -679,7 +679,7 @@ declare const imageSrcPropTypeUtil: {
|
|
|
679
679
|
};
|
|
680
680
|
disabled?: boolean | undefined;
|
|
681
681
|
}>;
|
|
682
|
-
key:
|
|
682
|
+
key: "image-src";
|
|
683
683
|
};
|
|
684
684
|
type ImageSrcPropValue = z.infer<typeof imageSrcPropTypeUtil.schema>;
|
|
685
685
|
|
|
@@ -769,7 +769,7 @@ declare const dimensionsPropTypeUtil: {
|
|
|
769
769
|
};
|
|
770
770
|
disabled?: boolean | undefined;
|
|
771
771
|
}>;
|
|
772
|
-
key:
|
|
772
|
+
key: "dimensions";
|
|
773
773
|
};
|
|
774
774
|
type DimensionsPropValue = z.infer<typeof dimensionsPropTypeUtil.schema>;
|
|
775
775
|
|
|
@@ -794,7 +794,7 @@ declare const numberPropTypeUtil: {
|
|
|
794
794
|
value: number | null;
|
|
795
795
|
disabled?: boolean | undefined;
|
|
796
796
|
}>;
|
|
797
|
-
key:
|
|
797
|
+
key: "number";
|
|
798
798
|
};
|
|
799
799
|
type NumberPropValue = z.infer<typeof numberPropTypeUtil.schema>;
|
|
800
800
|
|
|
@@ -910,7 +910,7 @@ declare const shadowPropTypeUtil: {
|
|
|
910
910
|
};
|
|
911
911
|
disabled?: boolean | undefined;
|
|
912
912
|
}>;
|
|
913
|
-
key:
|
|
913
|
+
key: "shadow";
|
|
914
914
|
};
|
|
915
915
|
type ShadowPropValue = z.infer<typeof shadowPropTypeUtil.schema>;
|
|
916
916
|
|
|
@@ -974,7 +974,7 @@ declare const sizePropTypeUtil: {
|
|
|
974
974
|
};
|
|
975
975
|
disabled?: boolean | undefined;
|
|
976
976
|
}>;
|
|
977
|
-
key:
|
|
977
|
+
key: "size";
|
|
978
978
|
};
|
|
979
979
|
type SizePropValue = z.infer<typeof sizePropTypeUtil.schema>;
|
|
980
980
|
|
|
@@ -999,7 +999,7 @@ declare const stringPropTypeUtil: {
|
|
|
999
999
|
value: string | null;
|
|
1000
1000
|
disabled?: boolean | undefined;
|
|
1001
1001
|
}>;
|
|
1002
|
-
key:
|
|
1002
|
+
key: "string";
|
|
1003
1003
|
};
|
|
1004
1004
|
type StringPropValue = z.infer<typeof stringPropTypeUtil.schema>;
|
|
1005
1005
|
|
|
@@ -1063,7 +1063,7 @@ declare const strokePropTypeUtil: {
|
|
|
1063
1063
|
};
|
|
1064
1064
|
disabled?: boolean | undefined;
|
|
1065
1065
|
}>;
|
|
1066
|
-
key:
|
|
1066
|
+
key: "stroke";
|
|
1067
1067
|
};
|
|
1068
1068
|
type StrokePropValue = z.infer<typeof strokePropTypeUtil.schema>;
|
|
1069
1069
|
|
|
@@ -1088,10 +1088,74 @@ declare const urlPropTypeUtil: {
|
|
|
1088
1088
|
value: string | null;
|
|
1089
1089
|
disabled?: boolean | undefined;
|
|
1090
1090
|
}>;
|
|
1091
|
-
key:
|
|
1091
|
+
key: "url";
|
|
1092
1092
|
};
|
|
1093
1093
|
type UrlPropValue = z.infer<typeof urlPropTypeUtil.schema>;
|
|
1094
1094
|
|
|
1095
|
+
declare const layoutDirectionPropTypeUtil: {
|
|
1096
|
+
extract: (prop: unknown) => {
|
|
1097
|
+
row?: any;
|
|
1098
|
+
column?: any;
|
|
1099
|
+
} | null;
|
|
1100
|
+
isValid: (prop: unknown) => prop is TransformablePropValue$1<"layout-direction", {
|
|
1101
|
+
row?: any;
|
|
1102
|
+
column?: any;
|
|
1103
|
+
}>;
|
|
1104
|
+
create: {
|
|
1105
|
+
(value: {
|
|
1106
|
+
row?: any;
|
|
1107
|
+
column?: any;
|
|
1108
|
+
}): TransformablePropValue$1<"layout-direction", {
|
|
1109
|
+
row?: any;
|
|
1110
|
+
column?: any;
|
|
1111
|
+
}>;
|
|
1112
|
+
(value: {
|
|
1113
|
+
row?: any;
|
|
1114
|
+
column?: any;
|
|
1115
|
+
}, createOptions?: CreateOptions): TransformablePropValue$1<"layout-direction", {
|
|
1116
|
+
row?: any;
|
|
1117
|
+
column?: any;
|
|
1118
|
+
}>;
|
|
1119
|
+
(value: (prev?: {
|
|
1120
|
+
row?: any;
|
|
1121
|
+
column?: any;
|
|
1122
|
+
} | undefined) => {
|
|
1123
|
+
row?: any;
|
|
1124
|
+
column?: any;
|
|
1125
|
+
}, createOptions: CreateOptions): TransformablePropValue$1<"layout-direction", {
|
|
1126
|
+
row?: any;
|
|
1127
|
+
column?: any;
|
|
1128
|
+
}>;
|
|
1129
|
+
};
|
|
1130
|
+
schema: z.ZodObject<{
|
|
1131
|
+
$$type: z.ZodLiteral<"layout-direction">;
|
|
1132
|
+
value: z.ZodType<{
|
|
1133
|
+
row?: any;
|
|
1134
|
+
column?: any;
|
|
1135
|
+
}, z.ZodTypeDef, {
|
|
1136
|
+
row?: any;
|
|
1137
|
+
column?: any;
|
|
1138
|
+
}>;
|
|
1139
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
1140
|
+
}, "strict", z.ZodTypeAny, {
|
|
1141
|
+
$$type: "layout-direction";
|
|
1142
|
+
value: {
|
|
1143
|
+
row?: any;
|
|
1144
|
+
column?: any;
|
|
1145
|
+
};
|
|
1146
|
+
disabled?: boolean | undefined;
|
|
1147
|
+
}, {
|
|
1148
|
+
$$type: "layout-direction";
|
|
1149
|
+
value: {
|
|
1150
|
+
row?: any;
|
|
1151
|
+
column?: any;
|
|
1152
|
+
};
|
|
1153
|
+
disabled?: boolean | undefined;
|
|
1154
|
+
}>;
|
|
1155
|
+
key: "layout-direction";
|
|
1156
|
+
};
|
|
1157
|
+
type LayoutDirectionPropValue = z.infer<typeof layoutDirectionPropTypeUtil.schema>;
|
|
1158
|
+
|
|
1095
1159
|
declare const linkPropTypeUtil: {
|
|
1096
1160
|
extract: (prop: unknown) => {
|
|
1097
1161
|
href?: any;
|
|
@@ -1152,87 +1216,10 @@ declare const linkPropTypeUtil: {
|
|
|
1152
1216
|
};
|
|
1153
1217
|
disabled?: boolean | undefined;
|
|
1154
1218
|
}>;
|
|
1155
|
-
key:
|
|
1219
|
+
key: "link";
|
|
1156
1220
|
};
|
|
1157
1221
|
type LinkPropValue = z.infer<typeof linkPropTypeUtil.schema>;
|
|
1158
1222
|
|
|
1159
|
-
declare const gapPropTypeUtil: {
|
|
1160
|
-
extract: (prop: unknown) => {
|
|
1161
|
-
isLinked: boolean;
|
|
1162
|
-
row?: any;
|
|
1163
|
-
column?: any;
|
|
1164
|
-
} | null;
|
|
1165
|
-
isValid: (prop: unknown) => prop is TransformablePropValue$1<"gap", {
|
|
1166
|
-
isLinked: boolean;
|
|
1167
|
-
row?: any;
|
|
1168
|
-
column?: any;
|
|
1169
|
-
}>;
|
|
1170
|
-
create: {
|
|
1171
|
-
(value: {
|
|
1172
|
-
isLinked: boolean;
|
|
1173
|
-
row?: any;
|
|
1174
|
-
column?: any;
|
|
1175
|
-
}): TransformablePropValue$1<"gap", {
|
|
1176
|
-
isLinked: boolean;
|
|
1177
|
-
row?: any;
|
|
1178
|
-
column?: any;
|
|
1179
|
-
}>;
|
|
1180
|
-
(value: {
|
|
1181
|
-
isLinked: boolean;
|
|
1182
|
-
row?: any;
|
|
1183
|
-
column?: any;
|
|
1184
|
-
}, createOptions?: CreateOptions): TransformablePropValue$1<"gap", {
|
|
1185
|
-
isLinked: boolean;
|
|
1186
|
-
row?: any;
|
|
1187
|
-
column?: any;
|
|
1188
|
-
}>;
|
|
1189
|
-
(value: (prev?: {
|
|
1190
|
-
isLinked: boolean;
|
|
1191
|
-
row?: any;
|
|
1192
|
-
column?: any;
|
|
1193
|
-
} | undefined) => {
|
|
1194
|
-
isLinked: boolean;
|
|
1195
|
-
row?: any;
|
|
1196
|
-
column?: any;
|
|
1197
|
-
}, createOptions: CreateOptions): TransformablePropValue$1<"gap", {
|
|
1198
|
-
isLinked: boolean;
|
|
1199
|
-
row?: any;
|
|
1200
|
-
column?: any;
|
|
1201
|
-
}>;
|
|
1202
|
-
};
|
|
1203
|
-
schema: z.ZodObject<{
|
|
1204
|
-
$$type: z.ZodLiteral<"gap">;
|
|
1205
|
-
value: z.ZodType<{
|
|
1206
|
-
isLinked: boolean;
|
|
1207
|
-
row?: any;
|
|
1208
|
-
column?: any;
|
|
1209
|
-
}, z.ZodTypeDef, {
|
|
1210
|
-
isLinked: boolean;
|
|
1211
|
-
row?: any;
|
|
1212
|
-
column?: any;
|
|
1213
|
-
}>;
|
|
1214
|
-
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
1215
|
-
}, "strict", z.ZodTypeAny, {
|
|
1216
|
-
$$type: "gap";
|
|
1217
|
-
value: {
|
|
1218
|
-
isLinked: boolean;
|
|
1219
|
-
row?: any;
|
|
1220
|
-
column?: any;
|
|
1221
|
-
};
|
|
1222
|
-
disabled?: boolean | undefined;
|
|
1223
|
-
}, {
|
|
1224
|
-
$$type: "gap";
|
|
1225
|
-
value: {
|
|
1226
|
-
isLinked: boolean;
|
|
1227
|
-
row?: any;
|
|
1228
|
-
column?: any;
|
|
1229
|
-
};
|
|
1230
|
-
disabled?: boolean | undefined;
|
|
1231
|
-
}>;
|
|
1232
|
-
key: TKey;
|
|
1233
|
-
};
|
|
1234
|
-
type GapPropValue = z.infer<typeof gapPropTypeUtil.schema>;
|
|
1235
|
-
|
|
1236
1223
|
declare const backgroundPropTypeUtil: {
|
|
1237
1224
|
extract: (prop: unknown) => {
|
|
1238
1225
|
color?: any;
|
|
@@ -1293,7 +1280,7 @@ declare const backgroundPropTypeUtil: {
|
|
|
1293
1280
|
};
|
|
1294
1281
|
disabled?: boolean | undefined;
|
|
1295
1282
|
}>;
|
|
1296
|
-
key:
|
|
1283
|
+
key: "background";
|
|
1297
1284
|
};
|
|
1298
1285
|
type BackgroundPropValue = z.infer<typeof backgroundPropTypeUtil.schema>;
|
|
1299
1286
|
|
|
@@ -1511,7 +1498,7 @@ declare const backgroundOverlayPropTypeUtil: {
|
|
|
1511
1498
|
})[];
|
|
1512
1499
|
disabled?: boolean | undefined;
|
|
1513
1500
|
}>;
|
|
1514
|
-
key:
|
|
1501
|
+
key: "background-overlay";
|
|
1515
1502
|
};
|
|
1516
1503
|
type BackgroundOverlayPropValue = z.infer<typeof backgroundOverlayPropTypeUtil.schema>;
|
|
1517
1504
|
type BackgroundOverlayItemPropValue = z.infer<typeof backgroundOverlayItem>;
|
|
@@ -1537,7 +1524,7 @@ declare const backgroundColorOverlayPropTypeUtil: {
|
|
|
1537
1524
|
value: string;
|
|
1538
1525
|
disabled?: boolean | undefined;
|
|
1539
1526
|
}>;
|
|
1540
|
-
key:
|
|
1527
|
+
key: "background-color-overlay";
|
|
1541
1528
|
};
|
|
1542
1529
|
type BackgroundColorOverlayPropValue = z.infer<typeof backgroundColorOverlayPropTypeUtil.schema>;
|
|
1543
1530
|
|
|
@@ -1562,7 +1549,7 @@ declare const backgroundImageOverlayPropTypeUtil: {
|
|
|
1562
1549
|
value?: any;
|
|
1563
1550
|
disabled?: boolean | undefined;
|
|
1564
1551
|
}>;
|
|
1565
|
-
key:
|
|
1552
|
+
key: "background-image-overlay";
|
|
1566
1553
|
};
|
|
1567
1554
|
type BackgroundImageOverlayPropValue = z.infer<typeof backgroundImageOverlayPropTypeUtil.schema>;
|
|
1568
1555
|
|
|
@@ -1587,7 +1574,7 @@ declare const booleanPropTypeUtil: {
|
|
|
1587
1574
|
value: boolean | null;
|
|
1588
1575
|
disabled?: boolean | undefined;
|
|
1589
1576
|
}>;
|
|
1590
|
-
key:
|
|
1577
|
+
key: "boolean";
|
|
1591
1578
|
};
|
|
1592
1579
|
type BooleanPropValue = z.infer<typeof booleanPropTypeUtil.schema>;
|
|
1593
1580
|
|
|
@@ -1607,4 +1594,4 @@ declare const transformableSchema: z.ZodObject<{
|
|
|
1607
1594
|
type TransformablePropValue = z.infer<typeof transformableSchema>;
|
|
1608
1595
|
declare const isTransformable: (value: unknown) => value is TransformablePropValue;
|
|
1609
1596
|
|
|
1610
|
-
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 DimensionsPropValue, type
|
|
1597
|
+
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 DimensionsPropValue, type ImageAttachmentIdPropValue, type ImagePropValue, type ImageSrcPropValue, type LayoutDirectionPropValue, type LinkPropValue, 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, dimensionsPropTypeUtil, imageAttachmentIdPropType, imagePropTypeUtil, imageSrcPropTypeUtil, isTransformable, layoutDirectionPropTypeUtil, linkPropTypeUtil, numberPropTypeUtil, shadowPropTypeUtil, sizePropTypeUtil, stringPropTypeUtil, strokePropTypeUtil, urlPropTypeUtil };
|
package/dist/index.d.ts
CHANGED
|
@@ -257,7 +257,7 @@ declare const boxShadowPropTypeUtil: {
|
|
|
257
257
|
}[];
|
|
258
258
|
disabled?: boolean | undefined;
|
|
259
259
|
}>;
|
|
260
|
-
key:
|
|
260
|
+
key: "box-shadow";
|
|
261
261
|
};
|
|
262
262
|
type BoxShadowPropValue = z.infer<typeof boxShadowPropTypeUtil.schema>;
|
|
263
263
|
|
|
@@ -347,7 +347,7 @@ declare const borderRadiusPropTypeUtil: {
|
|
|
347
347
|
};
|
|
348
348
|
disabled?: boolean | undefined;
|
|
349
349
|
}>;
|
|
350
|
-
key:
|
|
350
|
+
key: "border-radius";
|
|
351
351
|
};
|
|
352
352
|
type BorderRadiusPropValue = z.infer<typeof borderRadiusPropTypeUtil.schema>;
|
|
353
353
|
|
|
@@ -437,7 +437,7 @@ declare const borderWidthPropTypeUtil: {
|
|
|
437
437
|
};
|
|
438
438
|
disabled?: boolean | undefined;
|
|
439
439
|
}>;
|
|
440
|
-
key:
|
|
440
|
+
key: "border-width";
|
|
441
441
|
};
|
|
442
442
|
type BorderWidthPropValue = z.infer<typeof borderWidthPropTypeUtil.schema>;
|
|
443
443
|
|
|
@@ -462,7 +462,7 @@ declare const classesPropTypeUtil: {
|
|
|
462
462
|
value: string[];
|
|
463
463
|
disabled?: boolean | undefined;
|
|
464
464
|
}>;
|
|
465
|
-
key:
|
|
465
|
+
key: "classes";
|
|
466
466
|
};
|
|
467
467
|
type ClassesPropValue = z.infer<typeof classesPropTypeUtil.schema>;
|
|
468
468
|
|
|
@@ -487,7 +487,7 @@ declare const colorPropTypeUtil: {
|
|
|
487
487
|
value: string;
|
|
488
488
|
disabled?: boolean | undefined;
|
|
489
489
|
}>;
|
|
490
|
-
key:
|
|
490
|
+
key: "color";
|
|
491
491
|
};
|
|
492
492
|
type ColorPropValue = z.infer<typeof colorPropTypeUtil.schema>;
|
|
493
493
|
|
|
@@ -551,7 +551,7 @@ declare const imagePropTypeUtil: {
|
|
|
551
551
|
};
|
|
552
552
|
disabled?: boolean | undefined;
|
|
553
553
|
}>;
|
|
554
|
-
key:
|
|
554
|
+
key: "image";
|
|
555
555
|
};
|
|
556
556
|
type ImagePropValue = z.infer<typeof imagePropTypeUtil.schema>;
|
|
557
557
|
|
|
@@ -576,7 +576,7 @@ declare const imageAttachmentIdPropType: {
|
|
|
576
576
|
value: number;
|
|
577
577
|
disabled?: boolean | undefined;
|
|
578
578
|
}>;
|
|
579
|
-
key:
|
|
579
|
+
key: "image-attachment-id";
|
|
580
580
|
};
|
|
581
581
|
type ImageAttachmentIdPropValue = z.infer<typeof imageAttachmentIdPropType.schema>;
|
|
582
582
|
|
|
@@ -679,7 +679,7 @@ declare const imageSrcPropTypeUtil: {
|
|
|
679
679
|
};
|
|
680
680
|
disabled?: boolean | undefined;
|
|
681
681
|
}>;
|
|
682
|
-
key:
|
|
682
|
+
key: "image-src";
|
|
683
683
|
};
|
|
684
684
|
type ImageSrcPropValue = z.infer<typeof imageSrcPropTypeUtil.schema>;
|
|
685
685
|
|
|
@@ -769,7 +769,7 @@ declare const dimensionsPropTypeUtil: {
|
|
|
769
769
|
};
|
|
770
770
|
disabled?: boolean | undefined;
|
|
771
771
|
}>;
|
|
772
|
-
key:
|
|
772
|
+
key: "dimensions";
|
|
773
773
|
};
|
|
774
774
|
type DimensionsPropValue = z.infer<typeof dimensionsPropTypeUtil.schema>;
|
|
775
775
|
|
|
@@ -794,7 +794,7 @@ declare const numberPropTypeUtil: {
|
|
|
794
794
|
value: number | null;
|
|
795
795
|
disabled?: boolean | undefined;
|
|
796
796
|
}>;
|
|
797
|
-
key:
|
|
797
|
+
key: "number";
|
|
798
798
|
};
|
|
799
799
|
type NumberPropValue = z.infer<typeof numberPropTypeUtil.schema>;
|
|
800
800
|
|
|
@@ -910,7 +910,7 @@ declare const shadowPropTypeUtil: {
|
|
|
910
910
|
};
|
|
911
911
|
disabled?: boolean | undefined;
|
|
912
912
|
}>;
|
|
913
|
-
key:
|
|
913
|
+
key: "shadow";
|
|
914
914
|
};
|
|
915
915
|
type ShadowPropValue = z.infer<typeof shadowPropTypeUtil.schema>;
|
|
916
916
|
|
|
@@ -974,7 +974,7 @@ declare const sizePropTypeUtil: {
|
|
|
974
974
|
};
|
|
975
975
|
disabled?: boolean | undefined;
|
|
976
976
|
}>;
|
|
977
|
-
key:
|
|
977
|
+
key: "size";
|
|
978
978
|
};
|
|
979
979
|
type SizePropValue = z.infer<typeof sizePropTypeUtil.schema>;
|
|
980
980
|
|
|
@@ -999,7 +999,7 @@ declare const stringPropTypeUtil: {
|
|
|
999
999
|
value: string | null;
|
|
1000
1000
|
disabled?: boolean | undefined;
|
|
1001
1001
|
}>;
|
|
1002
|
-
key:
|
|
1002
|
+
key: "string";
|
|
1003
1003
|
};
|
|
1004
1004
|
type StringPropValue = z.infer<typeof stringPropTypeUtil.schema>;
|
|
1005
1005
|
|
|
@@ -1063,7 +1063,7 @@ declare const strokePropTypeUtil: {
|
|
|
1063
1063
|
};
|
|
1064
1064
|
disabled?: boolean | undefined;
|
|
1065
1065
|
}>;
|
|
1066
|
-
key:
|
|
1066
|
+
key: "stroke";
|
|
1067
1067
|
};
|
|
1068
1068
|
type StrokePropValue = z.infer<typeof strokePropTypeUtil.schema>;
|
|
1069
1069
|
|
|
@@ -1088,10 +1088,74 @@ declare const urlPropTypeUtil: {
|
|
|
1088
1088
|
value: string | null;
|
|
1089
1089
|
disabled?: boolean | undefined;
|
|
1090
1090
|
}>;
|
|
1091
|
-
key:
|
|
1091
|
+
key: "url";
|
|
1092
1092
|
};
|
|
1093
1093
|
type UrlPropValue = z.infer<typeof urlPropTypeUtil.schema>;
|
|
1094
1094
|
|
|
1095
|
+
declare const layoutDirectionPropTypeUtil: {
|
|
1096
|
+
extract: (prop: unknown) => {
|
|
1097
|
+
row?: any;
|
|
1098
|
+
column?: any;
|
|
1099
|
+
} | null;
|
|
1100
|
+
isValid: (prop: unknown) => prop is TransformablePropValue$1<"layout-direction", {
|
|
1101
|
+
row?: any;
|
|
1102
|
+
column?: any;
|
|
1103
|
+
}>;
|
|
1104
|
+
create: {
|
|
1105
|
+
(value: {
|
|
1106
|
+
row?: any;
|
|
1107
|
+
column?: any;
|
|
1108
|
+
}): TransformablePropValue$1<"layout-direction", {
|
|
1109
|
+
row?: any;
|
|
1110
|
+
column?: any;
|
|
1111
|
+
}>;
|
|
1112
|
+
(value: {
|
|
1113
|
+
row?: any;
|
|
1114
|
+
column?: any;
|
|
1115
|
+
}, createOptions?: CreateOptions): TransformablePropValue$1<"layout-direction", {
|
|
1116
|
+
row?: any;
|
|
1117
|
+
column?: any;
|
|
1118
|
+
}>;
|
|
1119
|
+
(value: (prev?: {
|
|
1120
|
+
row?: any;
|
|
1121
|
+
column?: any;
|
|
1122
|
+
} | undefined) => {
|
|
1123
|
+
row?: any;
|
|
1124
|
+
column?: any;
|
|
1125
|
+
}, createOptions: CreateOptions): TransformablePropValue$1<"layout-direction", {
|
|
1126
|
+
row?: any;
|
|
1127
|
+
column?: any;
|
|
1128
|
+
}>;
|
|
1129
|
+
};
|
|
1130
|
+
schema: z.ZodObject<{
|
|
1131
|
+
$$type: z.ZodLiteral<"layout-direction">;
|
|
1132
|
+
value: z.ZodType<{
|
|
1133
|
+
row?: any;
|
|
1134
|
+
column?: any;
|
|
1135
|
+
}, z.ZodTypeDef, {
|
|
1136
|
+
row?: any;
|
|
1137
|
+
column?: any;
|
|
1138
|
+
}>;
|
|
1139
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
1140
|
+
}, "strict", z.ZodTypeAny, {
|
|
1141
|
+
$$type: "layout-direction";
|
|
1142
|
+
value: {
|
|
1143
|
+
row?: any;
|
|
1144
|
+
column?: any;
|
|
1145
|
+
};
|
|
1146
|
+
disabled?: boolean | undefined;
|
|
1147
|
+
}, {
|
|
1148
|
+
$$type: "layout-direction";
|
|
1149
|
+
value: {
|
|
1150
|
+
row?: any;
|
|
1151
|
+
column?: any;
|
|
1152
|
+
};
|
|
1153
|
+
disabled?: boolean | undefined;
|
|
1154
|
+
}>;
|
|
1155
|
+
key: "layout-direction";
|
|
1156
|
+
};
|
|
1157
|
+
type LayoutDirectionPropValue = z.infer<typeof layoutDirectionPropTypeUtil.schema>;
|
|
1158
|
+
|
|
1095
1159
|
declare const linkPropTypeUtil: {
|
|
1096
1160
|
extract: (prop: unknown) => {
|
|
1097
1161
|
href?: any;
|
|
@@ -1152,87 +1216,10 @@ declare const linkPropTypeUtil: {
|
|
|
1152
1216
|
};
|
|
1153
1217
|
disabled?: boolean | undefined;
|
|
1154
1218
|
}>;
|
|
1155
|
-
key:
|
|
1219
|
+
key: "link";
|
|
1156
1220
|
};
|
|
1157
1221
|
type LinkPropValue = z.infer<typeof linkPropTypeUtil.schema>;
|
|
1158
1222
|
|
|
1159
|
-
declare const gapPropTypeUtil: {
|
|
1160
|
-
extract: (prop: unknown) => {
|
|
1161
|
-
isLinked: boolean;
|
|
1162
|
-
row?: any;
|
|
1163
|
-
column?: any;
|
|
1164
|
-
} | null;
|
|
1165
|
-
isValid: (prop: unknown) => prop is TransformablePropValue$1<"gap", {
|
|
1166
|
-
isLinked: boolean;
|
|
1167
|
-
row?: any;
|
|
1168
|
-
column?: any;
|
|
1169
|
-
}>;
|
|
1170
|
-
create: {
|
|
1171
|
-
(value: {
|
|
1172
|
-
isLinked: boolean;
|
|
1173
|
-
row?: any;
|
|
1174
|
-
column?: any;
|
|
1175
|
-
}): TransformablePropValue$1<"gap", {
|
|
1176
|
-
isLinked: boolean;
|
|
1177
|
-
row?: any;
|
|
1178
|
-
column?: any;
|
|
1179
|
-
}>;
|
|
1180
|
-
(value: {
|
|
1181
|
-
isLinked: boolean;
|
|
1182
|
-
row?: any;
|
|
1183
|
-
column?: any;
|
|
1184
|
-
}, createOptions?: CreateOptions): TransformablePropValue$1<"gap", {
|
|
1185
|
-
isLinked: boolean;
|
|
1186
|
-
row?: any;
|
|
1187
|
-
column?: any;
|
|
1188
|
-
}>;
|
|
1189
|
-
(value: (prev?: {
|
|
1190
|
-
isLinked: boolean;
|
|
1191
|
-
row?: any;
|
|
1192
|
-
column?: any;
|
|
1193
|
-
} | undefined) => {
|
|
1194
|
-
isLinked: boolean;
|
|
1195
|
-
row?: any;
|
|
1196
|
-
column?: any;
|
|
1197
|
-
}, createOptions: CreateOptions): TransformablePropValue$1<"gap", {
|
|
1198
|
-
isLinked: boolean;
|
|
1199
|
-
row?: any;
|
|
1200
|
-
column?: any;
|
|
1201
|
-
}>;
|
|
1202
|
-
};
|
|
1203
|
-
schema: z.ZodObject<{
|
|
1204
|
-
$$type: z.ZodLiteral<"gap">;
|
|
1205
|
-
value: z.ZodType<{
|
|
1206
|
-
isLinked: boolean;
|
|
1207
|
-
row?: any;
|
|
1208
|
-
column?: any;
|
|
1209
|
-
}, z.ZodTypeDef, {
|
|
1210
|
-
isLinked: boolean;
|
|
1211
|
-
row?: any;
|
|
1212
|
-
column?: any;
|
|
1213
|
-
}>;
|
|
1214
|
-
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
1215
|
-
}, "strict", z.ZodTypeAny, {
|
|
1216
|
-
$$type: "gap";
|
|
1217
|
-
value: {
|
|
1218
|
-
isLinked: boolean;
|
|
1219
|
-
row?: any;
|
|
1220
|
-
column?: any;
|
|
1221
|
-
};
|
|
1222
|
-
disabled?: boolean | undefined;
|
|
1223
|
-
}, {
|
|
1224
|
-
$$type: "gap";
|
|
1225
|
-
value: {
|
|
1226
|
-
isLinked: boolean;
|
|
1227
|
-
row?: any;
|
|
1228
|
-
column?: any;
|
|
1229
|
-
};
|
|
1230
|
-
disabled?: boolean | undefined;
|
|
1231
|
-
}>;
|
|
1232
|
-
key: TKey;
|
|
1233
|
-
};
|
|
1234
|
-
type GapPropValue = z.infer<typeof gapPropTypeUtil.schema>;
|
|
1235
|
-
|
|
1236
1223
|
declare const backgroundPropTypeUtil: {
|
|
1237
1224
|
extract: (prop: unknown) => {
|
|
1238
1225
|
color?: any;
|
|
@@ -1293,7 +1280,7 @@ declare const backgroundPropTypeUtil: {
|
|
|
1293
1280
|
};
|
|
1294
1281
|
disabled?: boolean | undefined;
|
|
1295
1282
|
}>;
|
|
1296
|
-
key:
|
|
1283
|
+
key: "background";
|
|
1297
1284
|
};
|
|
1298
1285
|
type BackgroundPropValue = z.infer<typeof backgroundPropTypeUtil.schema>;
|
|
1299
1286
|
|
|
@@ -1511,7 +1498,7 @@ declare const backgroundOverlayPropTypeUtil: {
|
|
|
1511
1498
|
})[];
|
|
1512
1499
|
disabled?: boolean | undefined;
|
|
1513
1500
|
}>;
|
|
1514
|
-
key:
|
|
1501
|
+
key: "background-overlay";
|
|
1515
1502
|
};
|
|
1516
1503
|
type BackgroundOverlayPropValue = z.infer<typeof backgroundOverlayPropTypeUtil.schema>;
|
|
1517
1504
|
type BackgroundOverlayItemPropValue = z.infer<typeof backgroundOverlayItem>;
|
|
@@ -1537,7 +1524,7 @@ declare const backgroundColorOverlayPropTypeUtil: {
|
|
|
1537
1524
|
value: string;
|
|
1538
1525
|
disabled?: boolean | undefined;
|
|
1539
1526
|
}>;
|
|
1540
|
-
key:
|
|
1527
|
+
key: "background-color-overlay";
|
|
1541
1528
|
};
|
|
1542
1529
|
type BackgroundColorOverlayPropValue = z.infer<typeof backgroundColorOverlayPropTypeUtil.schema>;
|
|
1543
1530
|
|
|
@@ -1562,7 +1549,7 @@ declare const backgroundImageOverlayPropTypeUtil: {
|
|
|
1562
1549
|
value?: any;
|
|
1563
1550
|
disabled?: boolean | undefined;
|
|
1564
1551
|
}>;
|
|
1565
|
-
key:
|
|
1552
|
+
key: "background-image-overlay";
|
|
1566
1553
|
};
|
|
1567
1554
|
type BackgroundImageOverlayPropValue = z.infer<typeof backgroundImageOverlayPropTypeUtil.schema>;
|
|
1568
1555
|
|
|
@@ -1587,7 +1574,7 @@ declare const booleanPropTypeUtil: {
|
|
|
1587
1574
|
value: boolean | null;
|
|
1588
1575
|
disabled?: boolean | undefined;
|
|
1589
1576
|
}>;
|
|
1590
|
-
key:
|
|
1577
|
+
key: "boolean";
|
|
1591
1578
|
};
|
|
1592
1579
|
type BooleanPropValue = z.infer<typeof booleanPropTypeUtil.schema>;
|
|
1593
1580
|
|
|
@@ -1607,4 +1594,4 @@ declare const transformableSchema: z.ZodObject<{
|
|
|
1607
1594
|
type TransformablePropValue = z.infer<typeof transformableSchema>;
|
|
1608
1595
|
declare const isTransformable: (value: unknown) => value is TransformablePropValue;
|
|
1609
1596
|
|
|
1610
|
-
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 DimensionsPropValue, type
|
|
1597
|
+
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 DimensionsPropValue, type ImageAttachmentIdPropValue, type ImagePropValue, type ImageSrcPropValue, type LayoutDirectionPropValue, type LinkPropValue, 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, dimensionsPropTypeUtil, imageAttachmentIdPropType, imagePropTypeUtil, imageSrcPropTypeUtil, isTransformable, layoutDirectionPropTypeUtil, linkPropTypeUtil, numberPropTypeUtil, shadowPropTypeUtil, sizePropTypeUtil, stringPropTypeUtil, strokePropTypeUtil, urlPropTypeUtil };
|
package/dist/index.js
CHANGED
|
@@ -32,11 +32,11 @@ __export(index_exports, {
|
|
|
32
32
|
colorPropTypeUtil: () => colorPropTypeUtil,
|
|
33
33
|
createPropUtils: () => createPropUtils,
|
|
34
34
|
dimensionsPropTypeUtil: () => dimensionsPropTypeUtil,
|
|
35
|
-
gapPropTypeUtil: () => gapPropTypeUtil,
|
|
36
35
|
imageAttachmentIdPropType: () => imageAttachmentIdPropType,
|
|
37
36
|
imagePropTypeUtil: () => imagePropTypeUtil,
|
|
38
37
|
imageSrcPropTypeUtil: () => imageSrcPropTypeUtil,
|
|
39
38
|
isTransformable: () => isTransformable,
|
|
39
|
+
layoutDirectionPropTypeUtil: () => layoutDirectionPropTypeUtil,
|
|
40
40
|
linkPropTypeUtil: () => linkPropTypeUtil,
|
|
41
41
|
numberPropTypeUtil: () => numberPropTypeUtil,
|
|
42
42
|
shadowPropTypeUtil: () => shadowPropTypeUtil,
|
|
@@ -223,24 +223,23 @@ var strokePropTypeUtil = createPropUtils(
|
|
|
223
223
|
var import_schema17 = require("@elementor/schema");
|
|
224
224
|
var urlPropTypeUtil = createPropUtils("url", import_schema17.z.string().nullable());
|
|
225
225
|
|
|
226
|
-
// src/prop-types/
|
|
226
|
+
// src/prop-types/layout-direction.ts
|
|
227
227
|
var import_schema18 = require("@elementor/schema");
|
|
228
|
-
var
|
|
229
|
-
"
|
|
230
|
-
import_schema18.z.
|
|
231
|
-
|
|
232
|
-
|
|
228
|
+
var layoutDirectionPropTypeUtil = createPropUtils(
|
|
229
|
+
"layout-direction",
|
|
230
|
+
import_schema18.z.object({
|
|
231
|
+
row: import_schema18.z.any(),
|
|
232
|
+
column: import_schema18.z.any()
|
|
233
233
|
})
|
|
234
234
|
);
|
|
235
235
|
|
|
236
|
-
// src/prop-types/
|
|
236
|
+
// src/prop-types/link.ts
|
|
237
237
|
var import_schema19 = require("@elementor/schema");
|
|
238
|
-
var
|
|
239
|
-
"
|
|
240
|
-
import_schema19.z.
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
column: import_schema19.z.any()
|
|
238
|
+
var linkPropTypeUtil = createPropUtils(
|
|
239
|
+
"link",
|
|
240
|
+
import_schema19.z.strictObject({
|
|
241
|
+
href: unknownChildrenSchema,
|
|
242
|
+
isTargetBlank: unknownChildrenSchema
|
|
244
243
|
})
|
|
245
244
|
);
|
|
246
245
|
|
|
@@ -302,11 +301,11 @@ var isTransformable = (value) => {
|
|
|
302
301
|
colorPropTypeUtil,
|
|
303
302
|
createPropUtils,
|
|
304
303
|
dimensionsPropTypeUtil,
|
|
305
|
-
gapPropTypeUtil,
|
|
306
304
|
imageAttachmentIdPropType,
|
|
307
305
|
imagePropTypeUtil,
|
|
308
306
|
imageSrcPropTypeUtil,
|
|
309
307
|
isTransformable,
|
|
308
|
+
layoutDirectionPropTypeUtil,
|
|
310
309
|
linkPropTypeUtil,
|
|
311
310
|
numberPropTypeUtil,
|
|
312
311
|
shadowPropTypeUtil,
|
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/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 dimensionsPropTypeUtil = createPropUtils(\n\t'dimensions',\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 DimensionsPropValue = z.infer< typeof dimensionsPropTypeUtil.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().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,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Q;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","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/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/layout-direction.ts","../src/prop-types/link.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 dimensionsPropTypeUtil = createPropUtils(\n\t'dimensions',\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 DimensionsPropValue = z.infer< typeof dimensionsPropTypeUtil.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().nullable() );\n\nexport type UrlPropValue = z.infer< typeof urlPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\n\nexport const layoutDirectionPropTypeUtil = createPropUtils(\n\t'layout-direction',\n\tz.object( {\n\t\trow: z.any(),\n\t\tcolumn: z.any(),\n\t} )\n);\n\nexport type LayoutDirectionPropValue = z.infer< typeof layoutDirectionPropTypeUtil.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';\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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I,sCAAsC,MAAO,EACjD,GAAI,mCAAmC,MAAO;AAEzC,IAAM,gCAAgC,gBAAiB,sBAAsB,kBAAE,MAAO,qBAAsB,CAAE;;;AIXrH,IAAAC,kBAAkB;AAIX,IAAM,sBAAsB,gBAAiB,WAAW,kBAAE,QAAQ,EAAE,SAAS,CAAE;;;ACJtF,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","import_schema"]}
|
package/dist/index.mjs
CHANGED
|
@@ -174,24 +174,23 @@ var strokePropTypeUtil = createPropUtils(
|
|
|
174
174
|
import { z as z17 } from "@elementor/schema";
|
|
175
175
|
var urlPropTypeUtil = createPropUtils("url", z17.string().nullable());
|
|
176
176
|
|
|
177
|
-
// src/prop-types/
|
|
177
|
+
// src/prop-types/layout-direction.ts
|
|
178
178
|
import { z as z18 } from "@elementor/schema";
|
|
179
|
-
var
|
|
180
|
-
"
|
|
181
|
-
z18.
|
|
182
|
-
|
|
183
|
-
|
|
179
|
+
var layoutDirectionPropTypeUtil = createPropUtils(
|
|
180
|
+
"layout-direction",
|
|
181
|
+
z18.object({
|
|
182
|
+
row: z18.any(),
|
|
183
|
+
column: z18.any()
|
|
184
184
|
})
|
|
185
185
|
);
|
|
186
186
|
|
|
187
|
-
// src/prop-types/
|
|
187
|
+
// src/prop-types/link.ts
|
|
188
188
|
import { z as z19 } from "@elementor/schema";
|
|
189
|
-
var
|
|
190
|
-
"
|
|
191
|
-
z19.
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
column: z19.any()
|
|
189
|
+
var linkPropTypeUtil = createPropUtils(
|
|
190
|
+
"link",
|
|
191
|
+
z19.strictObject({
|
|
192
|
+
href: unknownChildrenSchema,
|
|
193
|
+
isTargetBlank: unknownChildrenSchema
|
|
195
194
|
})
|
|
196
195
|
);
|
|
197
196
|
|
|
@@ -252,11 +251,11 @@ export {
|
|
|
252
251
|
colorPropTypeUtil,
|
|
253
252
|
createPropUtils,
|
|
254
253
|
dimensionsPropTypeUtil,
|
|
255
|
-
gapPropTypeUtil,
|
|
256
254
|
imageAttachmentIdPropType,
|
|
257
255
|
imagePropTypeUtil,
|
|
258
256
|
imageSrcPropTypeUtil,
|
|
259
257
|
isTransformable,
|
|
258
|
+
layoutDirectionPropTypeUtil,
|
|
260
259
|
linkPropTypeUtil,
|
|
261
260
|
numberPropTypeUtil,
|
|
262
261
|
shadowPropTypeUtil,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../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/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":["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 dimensionsPropTypeUtil = createPropUtils(\n\t'dimensions',\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 DimensionsPropValue = z.infer< typeof dimensionsPropTypeUtil.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().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,SAAS,KAAAA,UAAS;;;ACAlB,SAAS,SAAuB;AA8BzB,SAAS,gBACf,KACA,aACC;AACD,QAAM,SAAS,EAAE,aAAc;AAAA,IAC9B,QAAQ,EAAE,QAAS,GAAI;AAAA,IACvB,OAAO;AAAA,IACP,UAAU,EAAE,QAAQ,EAAE,SAAS;AAAA,EAChC,CAAE;AAIF,WAAS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,wBAAwB,mCAAmC,OAC/D,GAAI,sCAAsC,MAAO,EACjD,GAAI,mCAAmC,MAAO;AAEzC,IAAM,gCAAgC,gBAAiB,sBAAsBC,IAAE,MAAO,qBAAsB,CAAE;;;AIXrH,SAAS,KAAAC,WAAS;AAIX,IAAM,sBAAsB,gBAAiB,WAAWC,IAAE,QAAQ,EAAE,SAAS,CAAE;;;ACJtF,SAAS,KAAAC,WAAS;AAElB,IAAM,sBAAsBA,IAAE,OAAQ;AAAA,EACrC,QAAQA,IAAE,OAAO;AAAA,EACjB,OAAOA,IAAE,IAAI;AAAA,EACb,UAAUA,IAAE,QAAQ,EAAE,SAAS;AAChC,CAAE;AAIK,IAAM,kBAAkB,CAAE,UAAqD;AACrF,SAAO,oBAAoB,UAAW,KAAM,EAAE;AAC/C;","names":["z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z"]}
|
|
1
|
+
{"version":3,"sources":["../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/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/layout-direction.ts","../src/prop-types/link.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":["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 dimensionsPropTypeUtil = createPropUtils(\n\t'dimensions',\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 DimensionsPropValue = z.infer< typeof dimensionsPropTypeUtil.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().nullable() );\n\nexport type UrlPropValue = z.infer< typeof urlPropTypeUtil.schema >;\n","import { z } from '@elementor/schema';\n\nimport { createPropUtils } from '../utils/create-prop-utils';\n\nexport const layoutDirectionPropTypeUtil = createPropUtils(\n\t'layout-direction',\n\tz.object( {\n\t\trow: z.any(),\n\t\tcolumn: z.any(),\n\t} )\n);\n\nexport type LayoutDirectionPropValue = z.infer< typeof layoutDirectionPropTypeUtil.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';\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,SAAS,KAAAA,UAAS;;;ACAlB,SAAS,SAAuB;AA8BzB,SAAS,gBACf,KACA,aACC;AACD,QAAM,SAAS,EAAE,aAAc;AAAA,IAC9B,QAAQ,EAAE,QAAS,GAAI;AAAA,IACvB,OAAO;AAAA,IACP,UAAU,EAAE,QAAQ,EAAE,SAAS;AAAA,EAChC,CAAE;AAIF,WAAS,QAAS,MAA8B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EACjD,GAAI,mCAAmC,MAAO;AAEzC,IAAM,gCAAgC,gBAAiB,sBAAsBC,IAAE,MAAO,qBAAsB,CAAE;;;AIXrH,SAAS,KAAAC,WAAS;AAIX,IAAM,sBAAsB,gBAAiB,WAAWC,IAAE,QAAQ,EAAE,SAAS,CAAE;;;ACJtF,SAAS,KAAAC,WAAS;AAElB,IAAM,sBAAsBA,IAAE,OAAQ;AAAA,EACrC,QAAQA,IAAE,OAAO;AAAA,EACjB,OAAOA,IAAE,IAAI;AAAA,EACb,UAAUA,IAAE,QAAQ,EAAE,SAAS;AAChC,CAAE;AAIK,IAAM,kBAAkB,CAAE,UAAqD;AACrF,SAAO,oBAAoB,UAAW,KAAM,EAAE;AAC/C;","names":["z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z"]}
|
package/package.json
CHANGED
package/src/prop-types/index.ts
CHANGED
|
@@ -13,8 +13,8 @@ export * from './size';
|
|
|
13
13
|
export * from './string';
|
|
14
14
|
export * from './stroke';
|
|
15
15
|
export * from './url';
|
|
16
|
+
export * from './layout-direction';
|
|
16
17
|
export * from './link';
|
|
17
|
-
export * from './gaps';
|
|
18
18
|
export * from './background-prop-types/background';
|
|
19
19
|
export * from './background-prop-types/background-overlay';
|
|
20
20
|
export * from './background-prop-types/background-color-overlay';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from '@elementor/schema';
|
|
2
|
+
|
|
3
|
+
import { createPropUtils } from '../utils/create-prop-utils';
|
|
4
|
+
|
|
5
|
+
export const layoutDirectionPropTypeUtil = createPropUtils(
|
|
6
|
+
'layout-direction',
|
|
7
|
+
z.object( {
|
|
8
|
+
row: z.any(),
|
|
9
|
+
column: z.any(),
|
|
10
|
+
} )
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export type LayoutDirectionPropValue = z.infer< typeof layoutDirectionPropTypeUtil.schema >;
|
package/src/prop-types/gaps.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { z } from '@elementor/schema';
|
|
2
|
-
|
|
3
|
-
import { createPropUtils } from '../utils/create-prop-utils';
|
|
4
|
-
|
|
5
|
-
export const gapPropTypeUtil = createPropUtils(
|
|
6
|
-
'gap',
|
|
7
|
-
z.object( {
|
|
8
|
-
isLinked: z.boolean(),
|
|
9
|
-
row: z.any(),
|
|
10
|
-
column: z.any(),
|
|
11
|
-
} )
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
export type GapPropValue = z.infer< typeof gapPropTypeUtil.schema >;
|