@elementor/editor-props 0.6.0 → 0.7.1
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 +14 -0
- package/dist/index.d.mts +60 -36
- package/dist/index.d.ts +60 -36
- package/dist/index.js +19 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/prop-types/boolean.ts +7 -0
- package/src/prop-types/{linked-dimensions.ts → dimensions.ts} +3 -4
- package/src/prop-types/index.ts +3 -1
- package/src/prop-types/link.ts +0 -1
- package/src/prop-types/url.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @elementor/editor-props
|
|
2
2
|
|
|
3
|
+
## 0.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7582ba6: Modify linked dimensions control functionality
|
|
8
|
+
- 7654921: Allow any strings in link control
|
|
9
|
+
|
|
10
|
+
## 0.7.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- 45038fc: Added background image overlay control
|
|
15
|
+
- 43f1684: Save previous link value in session
|
|
16
|
+
|
|
3
17
|
## 0.6.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -683,20 +683,18 @@ declare const imageSrcPropTypeUtil: {
|
|
|
683
683
|
};
|
|
684
684
|
type ImageSrcPropValue = z.infer<typeof imageSrcPropTypeUtil.schema>;
|
|
685
685
|
|
|
686
|
-
declare const
|
|
686
|
+
declare const dimensionsPropTypeUtil: {
|
|
687
687
|
extract: (prop: unknown) => {
|
|
688
688
|
top?: any;
|
|
689
689
|
right?: any;
|
|
690
690
|
bottom?: any;
|
|
691
691
|
left?: any;
|
|
692
|
-
isLinked?: any;
|
|
693
692
|
} | null;
|
|
694
|
-
isValid: (prop: unknown) => prop is TransformablePropValue$1<"
|
|
693
|
+
isValid: (prop: unknown) => prop is TransformablePropValue$1<"dimensions", {
|
|
695
694
|
top?: any;
|
|
696
695
|
right?: any;
|
|
697
696
|
bottom?: any;
|
|
698
697
|
left?: any;
|
|
699
|
-
isLinked?: any;
|
|
700
698
|
}>;
|
|
701
699
|
create: {
|
|
702
700
|
(value: {
|
|
@@ -704,87 +702,76 @@ declare const linkedDimensionsPropTypeUtil: {
|
|
|
704
702
|
right?: any;
|
|
705
703
|
bottom?: any;
|
|
706
704
|
left?: any;
|
|
707
|
-
|
|
708
|
-
}): TransformablePropValue$1<"linked-dimensions", {
|
|
705
|
+
}): TransformablePropValue$1<"dimensions", {
|
|
709
706
|
top?: any;
|
|
710
707
|
right?: any;
|
|
711
708
|
bottom?: any;
|
|
712
709
|
left?: any;
|
|
713
|
-
isLinked?: any;
|
|
714
710
|
}>;
|
|
715
711
|
(value: {
|
|
716
712
|
top?: any;
|
|
717
713
|
right?: any;
|
|
718
714
|
bottom?: any;
|
|
719
715
|
left?: any;
|
|
720
|
-
|
|
721
|
-
}, createOptions?: CreateOptions): TransformablePropValue$1<"linked-dimensions", {
|
|
716
|
+
}, createOptions?: CreateOptions): TransformablePropValue$1<"dimensions", {
|
|
722
717
|
top?: any;
|
|
723
718
|
right?: any;
|
|
724
719
|
bottom?: any;
|
|
725
720
|
left?: any;
|
|
726
|
-
isLinked?: any;
|
|
727
721
|
}>;
|
|
728
722
|
(value: (prev?: {
|
|
729
723
|
top?: any;
|
|
730
724
|
right?: any;
|
|
731
725
|
bottom?: any;
|
|
732
726
|
left?: any;
|
|
733
|
-
isLinked?: any;
|
|
734
727
|
} | undefined) => {
|
|
735
728
|
top?: any;
|
|
736
729
|
right?: any;
|
|
737
730
|
bottom?: any;
|
|
738
731
|
left?: any;
|
|
739
|
-
|
|
740
|
-
}, createOptions: CreateOptions): TransformablePropValue$1<"linked-dimensions", {
|
|
732
|
+
}, createOptions: CreateOptions): TransformablePropValue$1<"dimensions", {
|
|
741
733
|
top?: any;
|
|
742
734
|
right?: any;
|
|
743
735
|
bottom?: any;
|
|
744
736
|
left?: any;
|
|
745
|
-
isLinked?: any;
|
|
746
737
|
}>;
|
|
747
738
|
};
|
|
748
739
|
schema: z.ZodObject<{
|
|
749
|
-
$$type: z.ZodLiteral<"
|
|
740
|
+
$$type: z.ZodLiteral<"dimensions">;
|
|
750
741
|
value: z.ZodType<{
|
|
751
742
|
top?: any;
|
|
752
743
|
right?: any;
|
|
753
744
|
bottom?: any;
|
|
754
745
|
left?: any;
|
|
755
|
-
isLinked?: any;
|
|
756
746
|
}, z.ZodTypeDef, {
|
|
757
747
|
top?: any;
|
|
758
748
|
right?: any;
|
|
759
749
|
bottom?: any;
|
|
760
750
|
left?: any;
|
|
761
|
-
isLinked?: any;
|
|
762
751
|
}>;
|
|
763
752
|
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
764
753
|
}, "strict", z.ZodTypeAny, {
|
|
765
|
-
$$type: "
|
|
754
|
+
$$type: "dimensions";
|
|
766
755
|
value: {
|
|
767
756
|
top?: any;
|
|
768
757
|
right?: any;
|
|
769
758
|
bottom?: any;
|
|
770
759
|
left?: any;
|
|
771
|
-
isLinked?: any;
|
|
772
760
|
};
|
|
773
761
|
disabled?: boolean | undefined;
|
|
774
762
|
}, {
|
|
775
|
-
$$type: "
|
|
763
|
+
$$type: "dimensions";
|
|
776
764
|
value: {
|
|
777
765
|
top?: any;
|
|
778
766
|
right?: any;
|
|
779
767
|
bottom?: any;
|
|
780
768
|
left?: any;
|
|
781
|
-
isLinked?: any;
|
|
782
769
|
};
|
|
783
770
|
disabled?: boolean | undefined;
|
|
784
771
|
}>;
|
|
785
772
|
key: TKey;
|
|
786
773
|
};
|
|
787
|
-
type
|
|
774
|
+
type DimensionsPropValue = z.infer<typeof dimensionsPropTypeUtil.schema>;
|
|
788
775
|
|
|
789
776
|
declare const numberPropTypeUtil: {
|
|
790
777
|
extract: (prop: unknown) => number | null;
|
|
@@ -1107,44 +1094,35 @@ type UrlPropValue = z.infer<typeof urlPropTypeUtil.schema>;
|
|
|
1107
1094
|
|
|
1108
1095
|
declare const linkPropTypeUtil: {
|
|
1109
1096
|
extract: (prop: unknown) => {
|
|
1110
|
-
enabled?: any;
|
|
1111
1097
|
href?: any;
|
|
1112
1098
|
isTargetBlank?: any;
|
|
1113
1099
|
} | null;
|
|
1114
1100
|
isValid: (prop: unknown) => prop is TransformablePropValue$1<"link", {
|
|
1115
|
-
enabled?: any;
|
|
1116
1101
|
href?: any;
|
|
1117
1102
|
isTargetBlank?: any;
|
|
1118
1103
|
}>;
|
|
1119
1104
|
create: {
|
|
1120
1105
|
(value: {
|
|
1121
|
-
enabled?: any;
|
|
1122
1106
|
href?: any;
|
|
1123
1107
|
isTargetBlank?: any;
|
|
1124
1108
|
}): TransformablePropValue$1<"link", {
|
|
1125
|
-
enabled?: any;
|
|
1126
1109
|
href?: any;
|
|
1127
1110
|
isTargetBlank?: any;
|
|
1128
1111
|
}>;
|
|
1129
1112
|
(value: {
|
|
1130
|
-
enabled?: any;
|
|
1131
1113
|
href?: any;
|
|
1132
1114
|
isTargetBlank?: any;
|
|
1133
1115
|
}, createOptions?: CreateOptions): TransformablePropValue$1<"link", {
|
|
1134
|
-
enabled?: any;
|
|
1135
1116
|
href?: any;
|
|
1136
1117
|
isTargetBlank?: any;
|
|
1137
1118
|
}>;
|
|
1138
1119
|
(value: (prev?: {
|
|
1139
|
-
enabled?: any;
|
|
1140
1120
|
href?: any;
|
|
1141
1121
|
isTargetBlank?: any;
|
|
1142
1122
|
} | undefined) => {
|
|
1143
|
-
enabled?: any;
|
|
1144
1123
|
href?: any;
|
|
1145
1124
|
isTargetBlank?: any;
|
|
1146
1125
|
}, createOptions: CreateOptions): TransformablePropValue$1<"link", {
|
|
1147
|
-
enabled?: any;
|
|
1148
1126
|
href?: any;
|
|
1149
1127
|
isTargetBlank?: any;
|
|
1150
1128
|
}>;
|
|
@@ -1152,11 +1130,9 @@ declare const linkPropTypeUtil: {
|
|
|
1152
1130
|
schema: z.ZodObject<{
|
|
1153
1131
|
$$type: z.ZodLiteral<"link">;
|
|
1154
1132
|
value: z.ZodType<{
|
|
1155
|
-
enabled?: any;
|
|
1156
1133
|
href?: any;
|
|
1157
1134
|
isTargetBlank?: any;
|
|
1158
1135
|
}, z.ZodTypeDef, {
|
|
1159
|
-
enabled?: any;
|
|
1160
1136
|
href?: any;
|
|
1161
1137
|
isTargetBlank?: any;
|
|
1162
1138
|
}>;
|
|
@@ -1164,7 +1140,6 @@ declare const linkPropTypeUtil: {
|
|
|
1164
1140
|
}, "strict", z.ZodTypeAny, {
|
|
1165
1141
|
$$type: "link";
|
|
1166
1142
|
value: {
|
|
1167
|
-
enabled?: any;
|
|
1168
1143
|
href?: any;
|
|
1169
1144
|
isTargetBlank?: any;
|
|
1170
1145
|
};
|
|
@@ -1172,7 +1147,6 @@ declare const linkPropTypeUtil: {
|
|
|
1172
1147
|
}, {
|
|
1173
1148
|
$$type: "link";
|
|
1174
1149
|
value: {
|
|
1175
|
-
enabled?: any;
|
|
1176
1150
|
href?: any;
|
|
1177
1151
|
isTargetBlank?: any;
|
|
1178
1152
|
};
|
|
@@ -1567,6 +1541,56 @@ declare const backgroundColorOverlayPropTypeUtil: {
|
|
|
1567
1541
|
};
|
|
1568
1542
|
type BackgroundColorOverlayPropValue = z.infer<typeof backgroundColorOverlayPropTypeUtil.schema>;
|
|
1569
1543
|
|
|
1544
|
+
declare const backgroundImageOverlayPropTypeUtil: {
|
|
1545
|
+
extract: (prop: unknown) => any;
|
|
1546
|
+
isValid: (prop: unknown) => prop is TransformablePropValue$1<"background-image-overlay", any>;
|
|
1547
|
+
create: {
|
|
1548
|
+
(value: any): TransformablePropValue$1<"background-image-overlay", any>;
|
|
1549
|
+
(value: any, createOptions?: CreateOptions): TransformablePropValue$1<"background-image-overlay", any>;
|
|
1550
|
+
(value: (prev?: any) => any, createOptions: CreateOptions): TransformablePropValue$1<"background-image-overlay", any>;
|
|
1551
|
+
};
|
|
1552
|
+
schema: z.ZodObject<{
|
|
1553
|
+
$$type: z.ZodLiteral<"background-image-overlay">;
|
|
1554
|
+
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
1555
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
1556
|
+
}, "strict", z.ZodTypeAny, {
|
|
1557
|
+
$$type: "background-image-overlay";
|
|
1558
|
+
value?: any;
|
|
1559
|
+
disabled?: boolean | undefined;
|
|
1560
|
+
}, {
|
|
1561
|
+
$$type: "background-image-overlay";
|
|
1562
|
+
value?: any;
|
|
1563
|
+
disabled?: boolean | undefined;
|
|
1564
|
+
}>;
|
|
1565
|
+
key: TKey;
|
|
1566
|
+
};
|
|
1567
|
+
type BackgroundImageOverlayPropValue = z.infer<typeof backgroundImageOverlayPropTypeUtil.schema>;
|
|
1568
|
+
|
|
1569
|
+
declare const booleanPropTypeUtil: {
|
|
1570
|
+
extract: (prop: unknown) => boolean | null;
|
|
1571
|
+
isValid: (prop: unknown) => prop is TransformablePropValue$1<"boolean", boolean | null>;
|
|
1572
|
+
create: {
|
|
1573
|
+
(value: boolean | null): TransformablePropValue$1<"boolean", boolean | null>;
|
|
1574
|
+
(value: boolean | null, createOptions?: CreateOptions): TransformablePropValue$1<"boolean", boolean | null>;
|
|
1575
|
+
(value: (prev?: boolean | null | undefined) => boolean | null, createOptions: CreateOptions): TransformablePropValue$1<"boolean", boolean | null>;
|
|
1576
|
+
};
|
|
1577
|
+
schema: z.ZodObject<{
|
|
1578
|
+
$$type: z.ZodLiteral<"boolean">;
|
|
1579
|
+
value: z.ZodType<boolean | null, z.ZodTypeDef, boolean | null>;
|
|
1580
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
1581
|
+
}, "strict", z.ZodTypeAny, {
|
|
1582
|
+
$$type: "boolean";
|
|
1583
|
+
value: boolean | null;
|
|
1584
|
+
disabled?: boolean | undefined;
|
|
1585
|
+
}, {
|
|
1586
|
+
$$type: "boolean";
|
|
1587
|
+
value: boolean | null;
|
|
1588
|
+
disabled?: boolean | undefined;
|
|
1589
|
+
}>;
|
|
1590
|
+
key: TKey;
|
|
1591
|
+
};
|
|
1592
|
+
type BooleanPropValue = z.infer<typeof booleanPropTypeUtil.schema>;
|
|
1593
|
+
|
|
1570
1594
|
declare const transformableSchema: z.ZodObject<{
|
|
1571
1595
|
$$type: z.ZodString;
|
|
1572
1596
|
value: z.ZodAny;
|
|
@@ -1583,4 +1607,4 @@ declare const transformableSchema: z.ZodObject<{
|
|
|
1583
1607
|
type TransformablePropValue = z.infer<typeof transformableSchema>;
|
|
1584
1608
|
declare const isTransformable: (value: unknown) => value is TransformablePropValue;
|
|
1585
1609
|
|
|
1586
|
-
export { type ArrayPropType, type ArrayPropValue, 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
|
|
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 GapPropValue, type ImageAttachmentIdPropValue, type ImagePropValue, type ImageSrcPropValue, 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, gapPropTypeUtil, imageAttachmentIdPropType, imagePropTypeUtil, imageSrcPropTypeUtil, isTransformable, linkPropTypeUtil, numberPropTypeUtil, shadowPropTypeUtil, sizePropTypeUtil, stringPropTypeUtil, strokePropTypeUtil, urlPropTypeUtil };
|
package/dist/index.d.ts
CHANGED
|
@@ -683,20 +683,18 @@ declare const imageSrcPropTypeUtil: {
|
|
|
683
683
|
};
|
|
684
684
|
type ImageSrcPropValue = z.infer<typeof imageSrcPropTypeUtil.schema>;
|
|
685
685
|
|
|
686
|
-
declare const
|
|
686
|
+
declare const dimensionsPropTypeUtil: {
|
|
687
687
|
extract: (prop: unknown) => {
|
|
688
688
|
top?: any;
|
|
689
689
|
right?: any;
|
|
690
690
|
bottom?: any;
|
|
691
691
|
left?: any;
|
|
692
|
-
isLinked?: any;
|
|
693
692
|
} | null;
|
|
694
|
-
isValid: (prop: unknown) => prop is TransformablePropValue$1<"
|
|
693
|
+
isValid: (prop: unknown) => prop is TransformablePropValue$1<"dimensions", {
|
|
695
694
|
top?: any;
|
|
696
695
|
right?: any;
|
|
697
696
|
bottom?: any;
|
|
698
697
|
left?: any;
|
|
699
|
-
isLinked?: any;
|
|
700
698
|
}>;
|
|
701
699
|
create: {
|
|
702
700
|
(value: {
|
|
@@ -704,87 +702,76 @@ declare const linkedDimensionsPropTypeUtil: {
|
|
|
704
702
|
right?: any;
|
|
705
703
|
bottom?: any;
|
|
706
704
|
left?: any;
|
|
707
|
-
|
|
708
|
-
}): TransformablePropValue$1<"linked-dimensions", {
|
|
705
|
+
}): TransformablePropValue$1<"dimensions", {
|
|
709
706
|
top?: any;
|
|
710
707
|
right?: any;
|
|
711
708
|
bottom?: any;
|
|
712
709
|
left?: any;
|
|
713
|
-
isLinked?: any;
|
|
714
710
|
}>;
|
|
715
711
|
(value: {
|
|
716
712
|
top?: any;
|
|
717
713
|
right?: any;
|
|
718
714
|
bottom?: any;
|
|
719
715
|
left?: any;
|
|
720
|
-
|
|
721
|
-
}, createOptions?: CreateOptions): TransformablePropValue$1<"linked-dimensions", {
|
|
716
|
+
}, createOptions?: CreateOptions): TransformablePropValue$1<"dimensions", {
|
|
722
717
|
top?: any;
|
|
723
718
|
right?: any;
|
|
724
719
|
bottom?: any;
|
|
725
720
|
left?: any;
|
|
726
|
-
isLinked?: any;
|
|
727
721
|
}>;
|
|
728
722
|
(value: (prev?: {
|
|
729
723
|
top?: any;
|
|
730
724
|
right?: any;
|
|
731
725
|
bottom?: any;
|
|
732
726
|
left?: any;
|
|
733
|
-
isLinked?: any;
|
|
734
727
|
} | undefined) => {
|
|
735
728
|
top?: any;
|
|
736
729
|
right?: any;
|
|
737
730
|
bottom?: any;
|
|
738
731
|
left?: any;
|
|
739
|
-
|
|
740
|
-
}, createOptions: CreateOptions): TransformablePropValue$1<"linked-dimensions", {
|
|
732
|
+
}, createOptions: CreateOptions): TransformablePropValue$1<"dimensions", {
|
|
741
733
|
top?: any;
|
|
742
734
|
right?: any;
|
|
743
735
|
bottom?: any;
|
|
744
736
|
left?: any;
|
|
745
|
-
isLinked?: any;
|
|
746
737
|
}>;
|
|
747
738
|
};
|
|
748
739
|
schema: z.ZodObject<{
|
|
749
|
-
$$type: z.ZodLiteral<"
|
|
740
|
+
$$type: z.ZodLiteral<"dimensions">;
|
|
750
741
|
value: z.ZodType<{
|
|
751
742
|
top?: any;
|
|
752
743
|
right?: any;
|
|
753
744
|
bottom?: any;
|
|
754
745
|
left?: any;
|
|
755
|
-
isLinked?: any;
|
|
756
746
|
}, z.ZodTypeDef, {
|
|
757
747
|
top?: any;
|
|
758
748
|
right?: any;
|
|
759
749
|
bottom?: any;
|
|
760
750
|
left?: any;
|
|
761
|
-
isLinked?: any;
|
|
762
751
|
}>;
|
|
763
752
|
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
764
753
|
}, "strict", z.ZodTypeAny, {
|
|
765
|
-
$$type: "
|
|
754
|
+
$$type: "dimensions";
|
|
766
755
|
value: {
|
|
767
756
|
top?: any;
|
|
768
757
|
right?: any;
|
|
769
758
|
bottom?: any;
|
|
770
759
|
left?: any;
|
|
771
|
-
isLinked?: any;
|
|
772
760
|
};
|
|
773
761
|
disabled?: boolean | undefined;
|
|
774
762
|
}, {
|
|
775
|
-
$$type: "
|
|
763
|
+
$$type: "dimensions";
|
|
776
764
|
value: {
|
|
777
765
|
top?: any;
|
|
778
766
|
right?: any;
|
|
779
767
|
bottom?: any;
|
|
780
768
|
left?: any;
|
|
781
|
-
isLinked?: any;
|
|
782
769
|
};
|
|
783
770
|
disabled?: boolean | undefined;
|
|
784
771
|
}>;
|
|
785
772
|
key: TKey;
|
|
786
773
|
};
|
|
787
|
-
type
|
|
774
|
+
type DimensionsPropValue = z.infer<typeof dimensionsPropTypeUtil.schema>;
|
|
788
775
|
|
|
789
776
|
declare const numberPropTypeUtil: {
|
|
790
777
|
extract: (prop: unknown) => number | null;
|
|
@@ -1107,44 +1094,35 @@ type UrlPropValue = z.infer<typeof urlPropTypeUtil.schema>;
|
|
|
1107
1094
|
|
|
1108
1095
|
declare const linkPropTypeUtil: {
|
|
1109
1096
|
extract: (prop: unknown) => {
|
|
1110
|
-
enabled?: any;
|
|
1111
1097
|
href?: any;
|
|
1112
1098
|
isTargetBlank?: any;
|
|
1113
1099
|
} | null;
|
|
1114
1100
|
isValid: (prop: unknown) => prop is TransformablePropValue$1<"link", {
|
|
1115
|
-
enabled?: any;
|
|
1116
1101
|
href?: any;
|
|
1117
1102
|
isTargetBlank?: any;
|
|
1118
1103
|
}>;
|
|
1119
1104
|
create: {
|
|
1120
1105
|
(value: {
|
|
1121
|
-
enabled?: any;
|
|
1122
1106
|
href?: any;
|
|
1123
1107
|
isTargetBlank?: any;
|
|
1124
1108
|
}): TransformablePropValue$1<"link", {
|
|
1125
|
-
enabled?: any;
|
|
1126
1109
|
href?: any;
|
|
1127
1110
|
isTargetBlank?: any;
|
|
1128
1111
|
}>;
|
|
1129
1112
|
(value: {
|
|
1130
|
-
enabled?: any;
|
|
1131
1113
|
href?: any;
|
|
1132
1114
|
isTargetBlank?: any;
|
|
1133
1115
|
}, createOptions?: CreateOptions): TransformablePropValue$1<"link", {
|
|
1134
|
-
enabled?: any;
|
|
1135
1116
|
href?: any;
|
|
1136
1117
|
isTargetBlank?: any;
|
|
1137
1118
|
}>;
|
|
1138
1119
|
(value: (prev?: {
|
|
1139
|
-
enabled?: any;
|
|
1140
1120
|
href?: any;
|
|
1141
1121
|
isTargetBlank?: any;
|
|
1142
1122
|
} | undefined) => {
|
|
1143
|
-
enabled?: any;
|
|
1144
1123
|
href?: any;
|
|
1145
1124
|
isTargetBlank?: any;
|
|
1146
1125
|
}, createOptions: CreateOptions): TransformablePropValue$1<"link", {
|
|
1147
|
-
enabled?: any;
|
|
1148
1126
|
href?: any;
|
|
1149
1127
|
isTargetBlank?: any;
|
|
1150
1128
|
}>;
|
|
@@ -1152,11 +1130,9 @@ declare const linkPropTypeUtil: {
|
|
|
1152
1130
|
schema: z.ZodObject<{
|
|
1153
1131
|
$$type: z.ZodLiteral<"link">;
|
|
1154
1132
|
value: z.ZodType<{
|
|
1155
|
-
enabled?: any;
|
|
1156
1133
|
href?: any;
|
|
1157
1134
|
isTargetBlank?: any;
|
|
1158
1135
|
}, z.ZodTypeDef, {
|
|
1159
|
-
enabled?: any;
|
|
1160
1136
|
href?: any;
|
|
1161
1137
|
isTargetBlank?: any;
|
|
1162
1138
|
}>;
|
|
@@ -1164,7 +1140,6 @@ declare const linkPropTypeUtil: {
|
|
|
1164
1140
|
}, "strict", z.ZodTypeAny, {
|
|
1165
1141
|
$$type: "link";
|
|
1166
1142
|
value: {
|
|
1167
|
-
enabled?: any;
|
|
1168
1143
|
href?: any;
|
|
1169
1144
|
isTargetBlank?: any;
|
|
1170
1145
|
};
|
|
@@ -1172,7 +1147,6 @@ declare const linkPropTypeUtil: {
|
|
|
1172
1147
|
}, {
|
|
1173
1148
|
$$type: "link";
|
|
1174
1149
|
value: {
|
|
1175
|
-
enabled?: any;
|
|
1176
1150
|
href?: any;
|
|
1177
1151
|
isTargetBlank?: any;
|
|
1178
1152
|
};
|
|
@@ -1567,6 +1541,56 @@ declare const backgroundColorOverlayPropTypeUtil: {
|
|
|
1567
1541
|
};
|
|
1568
1542
|
type BackgroundColorOverlayPropValue = z.infer<typeof backgroundColorOverlayPropTypeUtil.schema>;
|
|
1569
1543
|
|
|
1544
|
+
declare const backgroundImageOverlayPropTypeUtil: {
|
|
1545
|
+
extract: (prop: unknown) => any;
|
|
1546
|
+
isValid: (prop: unknown) => prop is TransformablePropValue$1<"background-image-overlay", any>;
|
|
1547
|
+
create: {
|
|
1548
|
+
(value: any): TransformablePropValue$1<"background-image-overlay", any>;
|
|
1549
|
+
(value: any, createOptions?: CreateOptions): TransformablePropValue$1<"background-image-overlay", any>;
|
|
1550
|
+
(value: (prev?: any) => any, createOptions: CreateOptions): TransformablePropValue$1<"background-image-overlay", any>;
|
|
1551
|
+
};
|
|
1552
|
+
schema: z.ZodObject<{
|
|
1553
|
+
$$type: z.ZodLiteral<"background-image-overlay">;
|
|
1554
|
+
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
1555
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
1556
|
+
}, "strict", z.ZodTypeAny, {
|
|
1557
|
+
$$type: "background-image-overlay";
|
|
1558
|
+
value?: any;
|
|
1559
|
+
disabled?: boolean | undefined;
|
|
1560
|
+
}, {
|
|
1561
|
+
$$type: "background-image-overlay";
|
|
1562
|
+
value?: any;
|
|
1563
|
+
disabled?: boolean | undefined;
|
|
1564
|
+
}>;
|
|
1565
|
+
key: TKey;
|
|
1566
|
+
};
|
|
1567
|
+
type BackgroundImageOverlayPropValue = z.infer<typeof backgroundImageOverlayPropTypeUtil.schema>;
|
|
1568
|
+
|
|
1569
|
+
declare const booleanPropTypeUtil: {
|
|
1570
|
+
extract: (prop: unknown) => boolean | null;
|
|
1571
|
+
isValid: (prop: unknown) => prop is TransformablePropValue$1<"boolean", boolean | null>;
|
|
1572
|
+
create: {
|
|
1573
|
+
(value: boolean | null): TransformablePropValue$1<"boolean", boolean | null>;
|
|
1574
|
+
(value: boolean | null, createOptions?: CreateOptions): TransformablePropValue$1<"boolean", boolean | null>;
|
|
1575
|
+
(value: (prev?: boolean | null | undefined) => boolean | null, createOptions: CreateOptions): TransformablePropValue$1<"boolean", boolean | null>;
|
|
1576
|
+
};
|
|
1577
|
+
schema: z.ZodObject<{
|
|
1578
|
+
$$type: z.ZodLiteral<"boolean">;
|
|
1579
|
+
value: z.ZodType<boolean | null, z.ZodTypeDef, boolean | null>;
|
|
1580
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
1581
|
+
}, "strict", z.ZodTypeAny, {
|
|
1582
|
+
$$type: "boolean";
|
|
1583
|
+
value: boolean | null;
|
|
1584
|
+
disabled?: boolean | undefined;
|
|
1585
|
+
}, {
|
|
1586
|
+
$$type: "boolean";
|
|
1587
|
+
value: boolean | null;
|
|
1588
|
+
disabled?: boolean | undefined;
|
|
1589
|
+
}>;
|
|
1590
|
+
key: TKey;
|
|
1591
|
+
};
|
|
1592
|
+
type BooleanPropValue = z.infer<typeof booleanPropTypeUtil.schema>;
|
|
1593
|
+
|
|
1570
1594
|
declare const transformableSchema: z.ZodObject<{
|
|
1571
1595
|
$$type: z.ZodString;
|
|
1572
1596
|
value: z.ZodAny;
|
|
@@ -1583,4 +1607,4 @@ declare const transformableSchema: z.ZodObject<{
|
|
|
1583
1607
|
type TransformablePropValue = z.infer<typeof transformableSchema>;
|
|
1584
1608
|
declare const isTransformable: (value: unknown) => value is TransformablePropValue;
|
|
1585
1609
|
|
|
1586
|
-
export { type ArrayPropType, type ArrayPropValue, 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
|
|
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 GapPropValue, type ImageAttachmentIdPropValue, type ImagePropValue, type ImageSrcPropValue, 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, gapPropTypeUtil, imageAttachmentIdPropType, imagePropTypeUtil, imageSrcPropTypeUtil, isTransformable, linkPropTypeUtil, numberPropTypeUtil, shadowPropTypeUtil, sizePropTypeUtil, stringPropTypeUtil, strokePropTypeUtil, urlPropTypeUtil };
|
package/dist/index.js
CHANGED
|
@@ -21,21 +21,23 @@ 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,
|
|
29
31
|
classesPropTypeUtil: () => classesPropTypeUtil,
|
|
30
32
|
colorPropTypeUtil: () => colorPropTypeUtil,
|
|
31
33
|
createPropUtils: () => createPropUtils,
|
|
34
|
+
dimensionsPropTypeUtil: () => dimensionsPropTypeUtil,
|
|
32
35
|
gapPropTypeUtil: () => gapPropTypeUtil,
|
|
33
36
|
imageAttachmentIdPropType: () => imageAttachmentIdPropType,
|
|
34
37
|
imagePropTypeUtil: () => imagePropTypeUtil,
|
|
35
38
|
imageSrcPropTypeUtil: () => imageSrcPropTypeUtil,
|
|
36
39
|
isTransformable: () => isTransformable,
|
|
37
40
|
linkPropTypeUtil: () => linkPropTypeUtil,
|
|
38
|
-
linkedDimensionsPropTypeUtil: () => linkedDimensionsPropTypeUtil,
|
|
39
41
|
numberPropTypeUtil: () => numberPropTypeUtil,
|
|
40
42
|
shadowPropTypeUtil: () => shadowPropTypeUtil,
|
|
41
43
|
sizePropTypeUtil: () => sizePropTypeUtil,
|
|
@@ -177,12 +179,11 @@ var imageSrcPropTypeUtil = createPropUtils(
|
|
|
177
179
|
)
|
|
178
180
|
);
|
|
179
181
|
|
|
180
|
-
// src/prop-types/
|
|
182
|
+
// src/prop-types/dimensions.ts
|
|
181
183
|
var import_schema12 = require("@elementor/schema");
|
|
182
|
-
var
|
|
183
|
-
"
|
|
184
|
+
var dimensionsPropTypeUtil = createPropUtils(
|
|
185
|
+
"dimensions",
|
|
184
186
|
import_schema12.z.strictObject({
|
|
185
|
-
isLinked: unknownChildrenSchema,
|
|
186
187
|
top: unknownChildrenSchema,
|
|
187
188
|
right: unknownChildrenSchema,
|
|
188
189
|
bottom: unknownChildrenSchema,
|
|
@@ -220,14 +221,13 @@ var strokePropTypeUtil = createPropUtils(
|
|
|
220
221
|
|
|
221
222
|
// src/prop-types/url.ts
|
|
222
223
|
var import_schema17 = require("@elementor/schema");
|
|
223
|
-
var urlPropTypeUtil = createPropUtils("url", import_schema17.z.string().
|
|
224
|
+
var urlPropTypeUtil = createPropUtils("url", import_schema17.z.string().nullable());
|
|
224
225
|
|
|
225
226
|
// src/prop-types/link.ts
|
|
226
227
|
var import_schema18 = require("@elementor/schema");
|
|
227
228
|
var linkPropTypeUtil = createPropUtils(
|
|
228
229
|
"link",
|
|
229
230
|
import_schema18.z.strictObject({
|
|
230
|
-
enabled: unknownChildrenSchema,
|
|
231
231
|
href: unknownChildrenSchema,
|
|
232
232
|
isTargetBlank: unknownChildrenSchema
|
|
233
233
|
})
|
|
@@ -274,12 +274,16 @@ var backgroundImageOverlayPropTypeUtil = createPropUtils("background-image-overl
|
|
|
274
274
|
var backgroundOverlayItem = backgroundColorOverlayPropTypeUtil.schema.or(backgroundGradientOverlayPropTypeUtil.schema).or(backgroundImageOverlayPropTypeUtil.schema);
|
|
275
275
|
var backgroundOverlayPropTypeUtil = createPropUtils("background-overlay", import_schema22.z.array(backgroundOverlayItem));
|
|
276
276
|
|
|
277
|
-
// src/
|
|
277
|
+
// src/prop-types/boolean.ts
|
|
278
278
|
var import_schema23 = require("@elementor/schema");
|
|
279
|
-
var
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
279
|
+
var booleanPropTypeUtil = createPropUtils("boolean", import_schema23.z.boolean().nullable());
|
|
280
|
+
|
|
281
|
+
// src/utils/is-transformable.ts
|
|
282
|
+
var import_schema24 = require("@elementor/schema");
|
|
283
|
+
var transformableSchema = import_schema24.z.object({
|
|
284
|
+
$$type: import_schema24.z.string(),
|
|
285
|
+
value: import_schema24.z.any(),
|
|
286
|
+
disabled: import_schema24.z.boolean().optional()
|
|
283
287
|
});
|
|
284
288
|
var isTransformable = (value) => {
|
|
285
289
|
return transformableSchema.safeParse(value).success;
|
|
@@ -287,21 +291,23 @@ var isTransformable = (value) => {
|
|
|
287
291
|
// Annotate the CommonJS export names for ESM import in node:
|
|
288
292
|
0 && (module.exports = {
|
|
289
293
|
backgroundColorOverlayPropTypeUtil,
|
|
294
|
+
backgroundImageOverlayPropTypeUtil,
|
|
290
295
|
backgroundOverlayPropTypeUtil,
|
|
291
296
|
backgroundPropTypeUtil,
|
|
297
|
+
booleanPropTypeUtil,
|
|
292
298
|
borderRadiusPropTypeUtil,
|
|
293
299
|
borderWidthPropTypeUtil,
|
|
294
300
|
boxShadowPropTypeUtil,
|
|
295
301
|
classesPropTypeUtil,
|
|
296
302
|
colorPropTypeUtil,
|
|
297
303
|
createPropUtils,
|
|
304
|
+
dimensionsPropTypeUtil,
|
|
298
305
|
gapPropTypeUtil,
|
|
299
306
|
imageAttachmentIdPropType,
|
|
300
307
|
imagePropTypeUtil,
|
|
301
308
|
imageSrcPropTypeUtil,
|
|
302
309
|
isTransformable,
|
|
303
310
|
linkPropTypeUtil,
|
|
304
|
-
linkedDimensionsPropTypeUtil,
|
|
305
311
|
numberPropTypeUtil,
|
|
306
312
|
shadowPropTypeUtil,
|
|
307
313
|
sizePropTypeUtil,
|
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\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\tenabled: unknownChildrenSchema,\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\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;;;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;AAAA,MACN,QAAQ;AAAA,MACR,OAAO,GAAI,KAAK,KAAM;AAAA,MACtB,GAAK,YAAY,EAAE,SAAS;AAAA,IAC7B;AAAA,EACD;AAEA,WAAS,QAAS,MAA+B;AAChD,QAAK,CAAE,QAAS,IAAK,GAAI;AACxB,aAAO;AAAA,IACR;AAEA,WAAO,KAAK;AAAA,EACb;AAEA,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AkB;AAAA,EAC9B;AAAA,EACA,kBAAE,OAAQ;AAAA,IACT,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/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,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,WAA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_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
|
@@ -130,12 +130,11 @@ var imageSrcPropTypeUtil = createPropUtils(
|
|
|
130
130
|
)
|
|
131
131
|
);
|
|
132
132
|
|
|
133
|
-
// src/prop-types/
|
|
133
|
+
// src/prop-types/dimensions.ts
|
|
134
134
|
import { z as z12 } from "@elementor/schema";
|
|
135
|
-
var
|
|
136
|
-
"
|
|
135
|
+
var dimensionsPropTypeUtil = createPropUtils(
|
|
136
|
+
"dimensions",
|
|
137
137
|
z12.strictObject({
|
|
138
|
-
isLinked: unknownChildrenSchema,
|
|
139
138
|
top: unknownChildrenSchema,
|
|
140
139
|
right: unknownChildrenSchema,
|
|
141
140
|
bottom: unknownChildrenSchema,
|
|
@@ -173,14 +172,13 @@ var strokePropTypeUtil = createPropUtils(
|
|
|
173
172
|
|
|
174
173
|
// src/prop-types/url.ts
|
|
175
174
|
import { z as z17 } from "@elementor/schema";
|
|
176
|
-
var urlPropTypeUtil = createPropUtils("url", z17.string().
|
|
175
|
+
var urlPropTypeUtil = createPropUtils("url", z17.string().nullable());
|
|
177
176
|
|
|
178
177
|
// src/prop-types/link.ts
|
|
179
178
|
import { z as z18 } from "@elementor/schema";
|
|
180
179
|
var linkPropTypeUtil = createPropUtils(
|
|
181
180
|
"link",
|
|
182
181
|
z18.strictObject({
|
|
183
|
-
enabled: unknownChildrenSchema,
|
|
184
182
|
href: unknownChildrenSchema,
|
|
185
183
|
isTargetBlank: unknownChildrenSchema
|
|
186
184
|
})
|
|
@@ -227,33 +225,39 @@ var backgroundImageOverlayPropTypeUtil = createPropUtils("background-image-overl
|
|
|
227
225
|
var backgroundOverlayItem = backgroundColorOverlayPropTypeUtil.schema.or(backgroundGradientOverlayPropTypeUtil.schema).or(backgroundImageOverlayPropTypeUtil.schema);
|
|
228
226
|
var backgroundOverlayPropTypeUtil = createPropUtils("background-overlay", z22.array(backgroundOverlayItem));
|
|
229
227
|
|
|
230
|
-
// src/
|
|
228
|
+
// src/prop-types/boolean.ts
|
|
231
229
|
import { z as z23 } from "@elementor/schema";
|
|
232
|
-
var
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
230
|
+
var booleanPropTypeUtil = createPropUtils("boolean", z23.boolean().nullable());
|
|
231
|
+
|
|
232
|
+
// src/utils/is-transformable.ts
|
|
233
|
+
import { z as z24 } from "@elementor/schema";
|
|
234
|
+
var transformableSchema = z24.object({
|
|
235
|
+
$$type: z24.string(),
|
|
236
|
+
value: z24.any(),
|
|
237
|
+
disabled: z24.boolean().optional()
|
|
236
238
|
});
|
|
237
239
|
var isTransformable = (value) => {
|
|
238
240
|
return transformableSchema.safeParse(value).success;
|
|
239
241
|
};
|
|
240
242
|
export {
|
|
241
243
|
backgroundColorOverlayPropTypeUtil,
|
|
244
|
+
backgroundImageOverlayPropTypeUtil,
|
|
242
245
|
backgroundOverlayPropTypeUtil,
|
|
243
246
|
backgroundPropTypeUtil,
|
|
247
|
+
booleanPropTypeUtil,
|
|
244
248
|
borderRadiusPropTypeUtil,
|
|
245
249
|
borderWidthPropTypeUtil,
|
|
246
250
|
boxShadowPropTypeUtil,
|
|
247
251
|
classesPropTypeUtil,
|
|
248
252
|
colorPropTypeUtil,
|
|
249
253
|
createPropUtils,
|
|
254
|
+
dimensionsPropTypeUtil,
|
|
250
255
|
gapPropTypeUtil,
|
|
251
256
|
imageAttachmentIdPropType,
|
|
252
257
|
imagePropTypeUtil,
|
|
253
258
|
imageSrcPropTypeUtil,
|
|
254
259
|
isTransformable,
|
|
255
260
|
linkPropTypeUtil,
|
|
256
|
-
linkedDimensionsPropTypeUtil,
|
|
257
261
|
numberPropTypeUtil,
|
|
258
262
|
shadowPropTypeUtil,
|
|
259
263
|
sizePropTypeUtil,
|
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/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":["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\tenabled: unknownChildrenSchema,\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\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;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;AAAA,MACN,QAAQ;AAAA,MACR,OAAO,GAAI,KAAK,KAAM;AAAA,MACtB,GAAK,YAAY,EAAE,SAAS;AAAA,IAC7B;AAAA,EACD;AAEA,WAAS,QAAS,MAA+B;AAChD,QAAK,CAAE,QAAS,IAAK,GAAI;AACxB,aAAO;AAAA,IACR;AAEA,WAAO,KAAK;AAAA,EACb;AAEA,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,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,kBAAkB;AAAA,EAC9B;AAAA,EACAC,IAAE,OAAQ;AAAA,IACT,UAAUA,IAAE,QAAQ;AAAA,IACpB,KAAKA,IAAE,IAAI;AAAA,IACX,QAAQA,IAAE,IAAI;AAAA,EACf,CAAE;AACH;;;ACXA,SAAS,KAAAC,WAAS;AAKX,IAAM,yBAAyB;AAAA,EACrC;AAAA,EACAC,IAAE,aAAc;AAAA,IACf,OAAO;AAAA,IACP,sBAAsB;AAAA,EACvB,CAAE;AACH;;;ACXA,SAAS,KAAAC,WAAS;;;ACAlB,SAAS,KAAAC,WAAS;AAIX,IAAM,qCAAqC,gBAAiB,4BAA4BC,IAAE,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,sBAAsBC,IAAE,MAAO,qBAAsB,CAAE;;;AIXrH,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"]}
|
|
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,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;AAAA,MACN,QAAQ;AAAA,MACR,OAAO,GAAI,KAAK,KAAM;AAAA,MACtB,GAAK,YAAY,EAAE,SAAS;AAAA,IAC7B;AAAA,EACD;AAEA,WAAS,QAAS,MAA+B;AAChD,QAAK,CAAE,QAAS,IAAK,GAAI;AACxB,aAAO;AAAA,IACR;AAEA,WAAO,KAAK;AAAA,EACb;AAEA,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;;;ACxFA,SAAS,KAAAC,UAAS;;;ACAlB,SAAS,KAAAC,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ACX,QAAQA,IAAE,IAAI;AAAA,EACf,CAAE;AACH;;;ACXA,SAAS,KAAAC,WAAS;AAKX,IAAM,yBAAyB;AAAA,EACrC;AAAA,EACAC,IAAE,aAAc;AAAA,IACf,OAAO;AAAA,IACP,sBAAsB;AAAA,EACvB,CAAE;AACH;;;ACXA,SAAS,KAAAC,WAAS;;;ACAlB,SAAS,KAAAC,WAAS;AAIX,IAAM,qCAAqC,gBAAiB,4BAA4BC,IAAE,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,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
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from '@elementor/schema';
|
|
2
|
+
|
|
3
|
+
import { createPropUtils } from '../utils/create-prop-utils';
|
|
4
|
+
|
|
5
|
+
export const booleanPropTypeUtil = createPropUtils( 'boolean', z.boolean().nullable() );
|
|
6
|
+
|
|
7
|
+
export type BooleanPropValue = z.infer< typeof booleanPropTypeUtil.schema >;
|
|
@@ -3,10 +3,9 @@ import { z } from '@elementor/schema';
|
|
|
3
3
|
import { createPropUtils } from '../utils/create-prop-utils';
|
|
4
4
|
import { unknownChildrenSchema } from './utils';
|
|
5
5
|
|
|
6
|
-
export const
|
|
7
|
-
'
|
|
6
|
+
export const dimensionsPropTypeUtil = createPropUtils(
|
|
7
|
+
'dimensions',
|
|
8
8
|
z.strictObject( {
|
|
9
|
-
isLinked: unknownChildrenSchema,
|
|
10
9
|
top: unknownChildrenSchema,
|
|
11
10
|
right: unknownChildrenSchema,
|
|
12
11
|
bottom: unknownChildrenSchema,
|
|
@@ -14,4 +13,4 @@ export const linkedDimensionsPropTypeUtil = createPropUtils(
|
|
|
14
13
|
} )
|
|
15
14
|
);
|
|
16
15
|
|
|
17
|
-
export type
|
|
16
|
+
export type DimensionsPropValue = z.infer< typeof dimensionsPropTypeUtil.schema >;
|
package/src/prop-types/index.ts
CHANGED
|
@@ -6,7 +6,7 @@ export * from './color';
|
|
|
6
6
|
export * from './image';
|
|
7
7
|
export * from './image-attachment-id';
|
|
8
8
|
export * from './image-src';
|
|
9
|
-
export * from './
|
|
9
|
+
export * from './dimensions';
|
|
10
10
|
export * from './number';
|
|
11
11
|
export * from './shadow';
|
|
12
12
|
export * from './size';
|
|
@@ -18,3 +18,5 @@ 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';
|
|
21
|
+
export * from './background-prop-types/background-image-overlay';
|
|
22
|
+
export * from './boolean';
|
package/src/prop-types/link.ts
CHANGED
package/src/prop-types/url.ts
CHANGED
|
@@ -2,6 +2,6 @@ import { z } from '@elementor/schema';
|
|
|
2
2
|
|
|
3
3
|
import { createPropUtils } from '../utils/create-prop-utils';
|
|
4
4
|
|
|
5
|
-
export const urlPropTypeUtil = createPropUtils( 'url', z.string().
|
|
5
|
+
export const urlPropTypeUtil = createPropUtils( 'url', z.string().nullable() );
|
|
6
6
|
|
|
7
7
|
export type UrlPropValue = z.infer< typeof urlPropTypeUtil.schema >;
|