@makeswift/prop-controllers 0.1.0-canary.3 → 0.1.0-canary.5
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/dist/index.cjs +635 -225
- package/dist/types/border/border.d.ts +4 -4
- package/dist/types/border-radius/border-radius.d.ts +2 -2
- package/dist/types/checkbox/checkbox.d.ts +4 -4
- package/dist/types/data.d.ts +37 -0
- package/dist/types/data.d.ts.map +1 -1
- package/dist/types/date/date.d.ts +4 -4
- package/dist/types/date copy/date.d.ts +1 -1
- package/dist/types/date copy/date.d.ts.map +1 -1
- package/dist/types/deleted.d.ts +1 -0
- package/dist/types/deleted.d.ts.map +1 -0
- package/dist/types/deteted.d.ts +1 -0
- package/dist/types/deteted.d.ts.map +1 -0
- package/dist/types/font/font.d.ts +4 -4
- package/dist/types/gap-x/gap-x.d.ts +177 -0
- package/dist/types/gap-x/gap-x.d.ts.map +1 -0
- package/dist/types/gap-x/gap-x.test.d.ts +2 -0
- package/dist/types/gap-x/gap-x.test.d.ts.map +1 -0
- package/dist/types/gap-x/index.d.ts +2 -0
- package/dist/types/gap-x/index.d.ts.map +1 -0
- package/dist/types/gap-x/text-style.d.ts +589 -0
- package/dist/types/gap-x/text-style.d.ts.map +1 -0
- package/dist/types/gap-x/text-style.test.d.ts +2 -0
- package/dist/types/gap-x/text-style.test.d.ts.map +1 -0
- package/dist/types/gap-x copy/gap-x.d.ts +177 -0
- package/dist/types/gap-x copy/gap-x.d.ts.map +1 -0
- package/dist/types/gap-x copy/gap-x.test.d.ts +2 -0
- package/dist/types/gap-x copy/gap-x.test.d.ts.map +1 -0
- package/dist/types/gap-x copy/index.d.ts +2 -0
- package/dist/types/gap-x copy/index.d.ts.map +1 -0
- package/dist/types/gap-y/gap-x.d.ts +177 -0
- package/dist/types/gap-y/gap-x.d.ts.map +1 -0
- package/dist/types/gap-y/gap-x.test.d.ts +2 -0
- package/dist/types/gap-y/gap-x.test.d.ts.map +1 -0
- package/dist/types/gap-y/gap-y.d.ts +177 -0
- package/dist/types/gap-y/gap-y.d.ts.map +1 -0
- package/dist/types/gap-y/gap-y.test.d.ts +2 -0
- package/dist/types/gap-y/gap-y.test.d.ts.map +1 -0
- package/dist/types/gap-y/index.d.ts +2 -0
- package/dist/types/gap-y/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +12 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/link/link.d.ts +944 -34
- package/dist/types/link/link.d.ts.map +1 -1
- package/dist/types/margin/margin.d.ts +4 -4
- package/dist/types/navigation-links/navigation-links.d.ts +80 -77
- package/dist/types/navigation-links/navigation-links.d.ts.map +1 -1
- package/dist/types/number.d.ts +4 -4
- package/dist/types/padding/padding.d.ts +4 -4
- package/dist/types/prop-controllers.d.ts +5 -1
- package/dist/types/prop-controllers.d.ts.map +1 -1
- package/dist/types/responsive-color.d.ts +4 -4
- package/dist/types/responsive-length.d.ts +4 -4
- package/dist/types/shadows.d.ts +2 -2
- package/dist/types/table/table.d.ts +4 -4
- package/dist/types/text-area/date.d.ts +50 -0
- package/dist/types/text-area/date.d.ts.map +1 -0
- package/dist/types/text-area/date.test.d.ts +2 -0
- package/dist/types/text-area/date.test.d.ts.map +1 -0
- package/dist/types/text-area/index.d.ts +2 -0
- package/dist/types/text-area/index.d.ts.map +1 -0
- package/dist/types/text-area/text-area.d.ts +52 -0
- package/dist/types/text-area/text-area.d.ts.map +1 -0
- package/dist/types/text-area/text-area.test.d.ts +2 -0
- package/dist/types/text-area/text-area.test.d.ts.map +1 -0
- package/dist/types/text-style/text-style.d.ts +4 -4
- package/dist/types/text-style copy/index.d.ts +2 -0
- package/dist/types/text-style copy/index.d.ts.map +1 -0
- package/dist/types/text-style copy/text-style.d.ts +589 -0
- package/dist/types/text-style copy/text-style.d.ts.map +1 -0
- package/dist/types/text-style copy/text-style.test.d.ts +2 -0
- package/dist/types/text-style copy/text-style.test.d.ts.map +1 -0
- package/dist/types/typeahead/date.d.ts +50 -0
- package/dist/types/typeahead/date.d.ts.map +1 -0
- package/dist/types/typeahead/date.test.d.ts +2 -0
- package/dist/types/typeahead/date.test.d.ts.map +1 -0
- package/dist/types/typeahead/index.d.ts +2 -0
- package/dist/types/typeahead/index.d.ts.map +1 -0
- package/dist/types/typeahead/typeahead.d.ts +50 -0
- package/dist/types/typeahead/typeahead.d.ts.map +1 -0
- package/dist/types/typeahead/typeahead.test.d.ts +2 -0
- package/dist/types/typeahead/typeahead.test.d.ts.map +1 -0
- package/dist/types/video/video.d.ts +4 -4
- package/dist/types/width/width.d.ts +4 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -28,10 +28,12 @@ __export(src_exports, {
|
|
28
28
|
ControlDataTypeKey: () => ControlDataTypeKey,
|
29
29
|
Date: () => Date,
|
30
30
|
Font: () => Font,
|
31
|
+
GapX: () => GapX,
|
32
|
+
GapY: () => GapY,
|
31
33
|
Link: () => Link,
|
32
|
-
LinkPropControllerDataV1Type: () => LinkPropControllerDataV1Type,
|
33
34
|
Margin: () => Margin,
|
34
35
|
MarginPropControllerFormat: () => MarginPropControllerFormat,
|
36
|
+
NavigationLinks: () => NavigationLinks,
|
35
37
|
Number: () => Number,
|
36
38
|
Padding: () => Padding,
|
37
39
|
PaddingPropControllerFormat: () => PaddingPropControllerFormat,
|
@@ -40,6 +42,7 @@ __export(src_exports, {
|
|
40
42
|
ResponsiveLengthPropControllerDataV1Type: () => ResponsiveLengthPropControllerDataV1Type,
|
41
43
|
Shadows: () => Shadows,
|
42
44
|
Table: () => Table,
|
45
|
+
TextArea: () => TextArea,
|
43
46
|
TextStyle: () => TextStyle,
|
44
47
|
Types: () => Types,
|
45
48
|
Video: () => Video,
|
@@ -50,6 +53,7 @@ __export(src_exports, {
|
|
50
53
|
checkboxPropControllerDataSchema: () => checkboxPropControllerDataSchema,
|
51
54
|
copyBorderPropControllerData: () => copyBorderPropControllerData,
|
52
55
|
copyLinkPropControllerData: () => copyLinkPropControllerData,
|
56
|
+
copyNavigationLinksPropControllerData: () => copyNavigationLinksPropControllerData,
|
53
57
|
copyResponsiveColorPropControllerData: () => copyResponsiveColorPropControllerData,
|
54
58
|
copyShadowsPropControllerData: () => copyShadowsPropControllerData,
|
55
59
|
copyTablePropControllerData: () => copyTablePropControllerData,
|
@@ -58,7 +62,11 @@ __export(src_exports, {
|
|
58
62
|
createCheckboxPropControllerDataFromBoolean: () => createCheckboxPropControllerDataFromBoolean,
|
59
63
|
createDatePropControllerDataFromString: () => createDatePropControllerDataFromString,
|
60
64
|
createFontPropControllerDataFromResponsiveFontData: () => createFontPropControllerDataFromResponsiveFontData,
|
65
|
+
createGapXPropControllerDataFromResponsiveGapData: () => createGapXPropControllerDataFromResponsiveGapData,
|
66
|
+
createGapYPropControllerDataFromResponsiveGapData: () => createGapYPropControllerDataFromResponsiveGapData,
|
67
|
+
createLinkPropControllerDataFromLinkData: () => createLinkPropControllerDataFromLinkData,
|
61
68
|
createMarginPropControllerDataFromResponsiveMarginData: () => createMarginPropControllerDataFromResponsiveMarginData,
|
69
|
+
createNavigationLinksPropControllerDataFromNavigationLinksData: () => createNavigationLinksPropControllerDataFromNavigationLinksData,
|
62
70
|
createNumberPropControllerDataFromNumber: () => createNumberPropControllerDataFromNumber,
|
63
71
|
createPaddingPropControllerDataFromResponsivePaddingData: () => createPaddingPropControllerDataFromResponsivePaddingData,
|
64
72
|
createResponsiveColorPropControllerDataFromResponsiveColorData: () => createResponsiveColorPropControllerDataFromResponsiveColorData,
|
@@ -66,20 +74,28 @@ __export(src_exports, {
|
|
66
74
|
createResponsiveValueSchema: () => createResponsiveValueSchema,
|
67
75
|
createShadowsPropControllerDataFromResponsiveShadowsData: () => createShadowsPropControllerDataFromResponsiveShadowsData,
|
68
76
|
createTablePropControllerDataFromTableId: () => createTablePropControllerDataFromTableId,
|
77
|
+
createTextAreaPropControllerDataFromString: () => createTextAreaPropControllerDataFromString,
|
69
78
|
createTextStylePropControllerDataFromResponsiveTextStyleData: () => createTextStylePropControllerDataFromResponsiveTextStyleData,
|
70
79
|
createVideoPropControllerDataFromVideoData: () => createVideoPropControllerDataFromVideoData,
|
71
80
|
createWidthPropControllerDataFromResponsiveLengthData: () => createWidthPropControllerDataFromResponsiveLengthData,
|
72
81
|
datePropControllerDataSchema: () => datePropControllerDataSchema,
|
73
82
|
fontPropControllerDataSchema: () => fontPropControllerDataSchema,
|
83
|
+
gapXPropControllerDataSchema: () => gapXPropControllerDataSchema,
|
84
|
+
gapYPropControllerDataSchema: () => gapYPropControllerDataSchema,
|
74
85
|
getBorderPropControllerDataResponsiveBorderData: () => getBorderPropControllerDataResponsiveBorderData,
|
75
86
|
getBorderPropControllerDataSwatchIds: () => getBorderPropControllerDataSwatchIds,
|
76
87
|
getBorderRadiusPropControllerDataResponsiveBorderRadiusData: () => getBorderRadiusPropControllerDataResponsiveBorderRadiusData,
|
77
88
|
getCheckboxPropControllerDataBoolean: () => getCheckboxPropControllerDataBoolean,
|
78
89
|
getDatePropControllerDataString: () => getDatePropControllerDataString,
|
79
90
|
getFontPropControllerDataResponsiveFontData: () => getFontPropControllerDataResponsiveFontData,
|
91
|
+
getGapXPropControllerDataResponsiveGapData: () => getGapXPropControllerDataResponsiveGapData,
|
92
|
+
getGapYPropControllerDataResponsiveGapData: () => getGapYPropControllerDataResponsiveGapData,
|
93
|
+
getLinkPropControllerDataLinkData: () => getLinkPropControllerDataLinkData,
|
80
94
|
getLinkPropControllerPageIds: () => getLinkPropControllerPageIds,
|
81
|
-
getLinkPropControllerValue: () => getLinkPropControllerValue,
|
82
95
|
getMarginPropControllerDataResponsiveMarginData: () => getMarginPropControllerDataResponsiveMarginData,
|
96
|
+
getNavigationLinksPropControllerDataNavigationLinksData: () => getNavigationLinksPropControllerDataNavigationLinksData,
|
97
|
+
getNavigationLinksPropControllerPageIds: () => getNavigationLinksPropControllerPageIds,
|
98
|
+
getNavigationLinksPropControllerSwatchIds: () => getNavigationLinksPropControllerSwatchIds,
|
83
99
|
getNumberPropControllerDataNumber: () => getNumberPropControllerDataNumber,
|
84
100
|
getPaddingPropControllerDataResponsivePaddingData: () => getPaddingPropControllerDataResponsivePaddingData,
|
85
101
|
getResponsiveColorDataSwatchIds: () => getResponsiveColorDataSwatchIds,
|
@@ -90,68 +106,82 @@ __export(src_exports, {
|
|
90
106
|
getShadowsPropControllerDataSwatchIds: () => getShadowsPropControllerDataSwatchIds,
|
91
107
|
getTablePropControllerDataTableId: () => getTablePropControllerDataTableId,
|
92
108
|
getTablePropControllerDataTableIds: () => getTablePropControllerDataTableIds,
|
109
|
+
getTextAreaPropControllerDataString: () => getTextAreaPropControllerDataString,
|
93
110
|
getTextStylePropControllerDataResponsiveTextStyleData: () => getTextStylePropControllerDataResponsiveTextStyleData,
|
94
111
|
getVideoPropControllerDataVideoData: () => getVideoPropControllerDataVideoData,
|
95
112
|
getWidthPropControllerDataResponsiveLengthData: () => getWidthPropControllerDataResponsiveLengthData,
|
113
|
+
linkDataSchema: () => linkDataSchema,
|
114
|
+
linkPropControllerDataSchema: () => linkPropControllerDataSchema,
|
96
115
|
marginPropControllerDataSchema: () => marginPropControllerDataSchema,
|
116
|
+
navigationLinksPropControllerDataSchema: () => navigationLinksPropControllerDataSchema,
|
97
117
|
numberPropControllerDataSchema: () => numberPropControllerDataSchema,
|
98
118
|
paddingPropControllerDataSchema: () => paddingPropControllerDataSchema,
|
99
119
|
responsiveColorPropControllerDataSchema: () => responsiveColorPropControllerDataSchema,
|
100
120
|
responsiveLengthPropControllerDataSchema: () => responsiveLengthPropControllerDataSchema,
|
101
121
|
shadowsPropControllerDataSchema: () => shadowsPropControllerDataSchema,
|
102
122
|
tablePropControllerDataSchema: () => tablePropControllerDataSchema,
|
123
|
+
textAreaPropControllerDataSchema: () => textAreaPropControllerDataSchema,
|
103
124
|
textStylePropControllerDataSchema: () => textStylePropControllerDataSchema,
|
104
125
|
videoPropControllerDataSchema: () => videoPropControllerDataSchema,
|
105
126
|
widthPropControllerDataSchema: () => widthPropControllerDataSchema
|
106
127
|
});
|
107
128
|
module.exports = __toCommonJS(src_exports);
|
108
129
|
|
109
|
-
// src/border/border.ts
|
110
|
-
var import_ts_pattern = require("ts-pattern");
|
111
|
-
|
112
|
-
// src/data.ts
|
113
|
-
var import_zod = require("zod");
|
114
|
-
var colorDataSchema = import_zod.z.object({
|
115
|
-
swatchId: import_zod.z.string(),
|
116
|
-
alpha: import_zod.z.number()
|
117
|
-
});
|
118
|
-
var lengthDataSchema = import_zod.z.object({
|
119
|
-
value: import_zod.z.number(),
|
120
|
-
unit: import_zod.z.union([import_zod.z.literal("px"), import_zod.z.literal("%")])
|
121
|
-
});
|
122
|
-
|
123
130
|
// src/prop-controllers.ts
|
124
|
-
var
|
131
|
+
var import_zod = require("zod");
|
125
132
|
var Types = {
|
126
133
|
Border: "Border",
|
127
134
|
BorderRadius: "BorderRadius",
|
128
135
|
Checkbox: "Checkbox",
|
129
136
|
Date: "Date",
|
130
137
|
Font: "Font",
|
138
|
+
GapX: "GapX",
|
139
|
+
GapY: "GapY",
|
131
140
|
Link: "Link",
|
132
141
|
Margin: "Margin",
|
142
|
+
NavigationLinks: "NavigationLinks",
|
133
143
|
Padding: "Padding",
|
134
144
|
Number: "Number",
|
135
145
|
Shadows: "Shadows",
|
136
146
|
ResponsiveColor: "ResponsiveColor",
|
137
147
|
ResponsiveLength: "ResponsiveLength",
|
148
|
+
TextArea: "TextArea",
|
138
149
|
Table: "Table",
|
139
150
|
TextStyle: "TextStyle",
|
140
151
|
Width: "Width",
|
141
152
|
Video: "Video"
|
142
153
|
};
|
143
154
|
var ControlDataTypeKey = "@@makeswift/type";
|
144
|
-
var deviceSchema =
|
155
|
+
var deviceSchema = import_zod.z.string();
|
145
156
|
function createDeviceOverrideSchema(schema) {
|
146
|
-
return
|
157
|
+
return import_zod.z.object({
|
147
158
|
deviceId: deviceSchema,
|
148
159
|
value: schema
|
149
160
|
});
|
150
161
|
}
|
151
162
|
function createResponsiveValueSchema(schema) {
|
152
|
-
return
|
163
|
+
return import_zod.z.array(createDeviceOverrideSchema(schema));
|
153
164
|
}
|
154
165
|
|
166
|
+
// src/border/border.ts
|
167
|
+
var import_ts_pattern = require("ts-pattern");
|
168
|
+
|
169
|
+
// src/data.ts
|
170
|
+
var import_zod2 = require("zod");
|
171
|
+
var colorDataSchema = import_zod2.z.object({
|
172
|
+
swatchId: import_zod2.z.string(),
|
173
|
+
alpha: import_zod2.z.number()
|
174
|
+
});
|
175
|
+
var lengthDataSchema = import_zod2.z.object({
|
176
|
+
value: import_zod2.z.number(),
|
177
|
+
unit: import_zod2.z.union([import_zod2.z.literal("px"), import_zod2.z.literal("%")])
|
178
|
+
});
|
179
|
+
var gapDataSchema = import_zod2.z.object({
|
180
|
+
value: import_zod2.z.number(),
|
181
|
+
unit: import_zod2.z.literal("px")
|
182
|
+
});
|
183
|
+
var responsiveGapDataSchema = createResponsiveValueSchema(gapDataSchema);
|
184
|
+
|
155
185
|
// src/border/border.ts
|
156
186
|
var import_zod3 = require("zod");
|
157
187
|
var borderSideDataSchema = import_zod3.z.object({
|
@@ -407,19 +437,160 @@ function createFontPropControllerDataFromResponsiveFontData(responsiveFontData,
|
|
407
437
|
).otherwise(() => responsiveFontData);
|
408
438
|
}
|
409
439
|
|
410
|
-
// src/
|
440
|
+
// src/gap-x/gap-x.ts
|
411
441
|
var import_ts_pattern6 = require("ts-pattern");
|
412
|
-
var
|
413
|
-
|
442
|
+
var import_zod8 = require("zod");
|
443
|
+
var gapXPropControllerDataV0Schema = responsiveGapDataSchema;
|
444
|
+
var GapXPropControllerDataV1Type = "prop-controllers::gap-x::v1";
|
445
|
+
var gapXPropControllerDataV1Schema = import_zod8.z.object({
|
446
|
+
[ControlDataTypeKey]: import_zod8.z.literal(GapXPropControllerDataV1Type),
|
447
|
+
value: responsiveGapDataSchema
|
448
|
+
});
|
449
|
+
var gapXPropControllerDataSchema = import_zod8.z.union([
|
450
|
+
gapXPropControllerDataV0Schema,
|
451
|
+
gapXPropControllerDataV1Schema
|
452
|
+
]);
|
453
|
+
function GapX(options = {}) {
|
454
|
+
return { type: Types.GapX, version: 1, options };
|
455
|
+
}
|
456
|
+
function getGapXPropControllerDataResponsiveGapData(data) {
|
414
457
|
return (0, import_ts_pattern6.match)(data).with(
|
458
|
+
{ [ControlDataTypeKey]: GapXPropControllerDataV1Type },
|
459
|
+
(v1) => v1.value
|
460
|
+
).otherwise((v0) => v0);
|
461
|
+
}
|
462
|
+
function createGapXPropControllerDataFromResponsiveGapData(responsiveGapData, definition) {
|
463
|
+
return (0, import_ts_pattern6.match)(definition).with(
|
464
|
+
{ version: 1 },
|
465
|
+
() => ({
|
466
|
+
[ControlDataTypeKey]: GapXPropControllerDataV1Type,
|
467
|
+
value: responsiveGapData
|
468
|
+
})
|
469
|
+
).otherwise(() => responsiveGapData);
|
470
|
+
}
|
471
|
+
|
472
|
+
// src/gap-y/gap-y.ts
|
473
|
+
var import_ts_pattern7 = require("ts-pattern");
|
474
|
+
var import_zod9 = require("zod");
|
475
|
+
var gapYPropControllerDataV0Schema = responsiveGapDataSchema;
|
476
|
+
var GapYPropControllerDataV1Type = "prop-controllers::gap-y::v1";
|
477
|
+
var gapYPropControllerDataV1Schema = import_zod9.z.object({
|
478
|
+
[ControlDataTypeKey]: import_zod9.z.literal(GapYPropControllerDataV1Type),
|
479
|
+
value: responsiveGapDataSchema
|
480
|
+
});
|
481
|
+
var gapYPropControllerDataSchema = import_zod9.z.union([
|
482
|
+
gapYPropControllerDataV0Schema,
|
483
|
+
gapYPropControllerDataV1Schema
|
484
|
+
]);
|
485
|
+
function GapY(options = {}) {
|
486
|
+
return { type: Types.GapY, version: 1, options };
|
487
|
+
}
|
488
|
+
function getGapYPropControllerDataResponsiveGapData(data) {
|
489
|
+
return (0, import_ts_pattern7.match)(data).with(
|
490
|
+
{ [ControlDataTypeKey]: GapYPropControllerDataV1Type },
|
491
|
+
(v1) => v1.value
|
492
|
+
).otherwise((v0) => v0);
|
493
|
+
}
|
494
|
+
function createGapYPropControllerDataFromResponsiveGapData(responsiveGapData, definition) {
|
495
|
+
return (0, import_ts_pattern7.match)(definition).with(
|
496
|
+
{ version: 1 },
|
497
|
+
() => ({
|
498
|
+
[ControlDataTypeKey]: GapYPropControllerDataV1Type,
|
499
|
+
value: responsiveGapData
|
500
|
+
})
|
501
|
+
).otherwise(() => responsiveGapData);
|
502
|
+
}
|
503
|
+
|
504
|
+
// src/link/link.ts
|
505
|
+
var import_ts_pattern8 = require("ts-pattern");
|
506
|
+
var import_zod10 = require("zod");
|
507
|
+
var openPageLinkSchema = import_zod10.z.object({
|
508
|
+
type: import_zod10.z.literal("OPEN_PAGE"),
|
509
|
+
payload: import_zod10.z.object({
|
510
|
+
pageId: import_zod10.z.string().nullable().optional(),
|
511
|
+
openInNewTab: import_zod10.z.boolean()
|
512
|
+
}).transform((v) => ({
|
513
|
+
pageId: v.pageId,
|
514
|
+
...v
|
515
|
+
}))
|
516
|
+
});
|
517
|
+
var openURLLinkSchema = import_zod10.z.object({
|
518
|
+
type: import_zod10.z.literal("OPEN_URL"),
|
519
|
+
payload: import_zod10.z.object({
|
520
|
+
url: import_zod10.z.string(),
|
521
|
+
openInNewTab: import_zod10.z.boolean()
|
522
|
+
})
|
523
|
+
});
|
524
|
+
var sendEmailLinkSchema = import_zod10.z.object({
|
525
|
+
type: import_zod10.z.literal("SEND_EMAIL"),
|
526
|
+
payload: import_zod10.z.object({
|
527
|
+
to: import_zod10.z.string(),
|
528
|
+
subject: import_zod10.z.string().optional(),
|
529
|
+
body: import_zod10.z.string().optional()
|
530
|
+
})
|
531
|
+
});
|
532
|
+
var callPhoneLinkSchema = import_zod10.z.object({
|
533
|
+
type: import_zod10.z.literal("CALL_PHONE"),
|
534
|
+
payload: import_zod10.z.object({
|
535
|
+
phoneNumber: import_zod10.z.string()
|
536
|
+
})
|
537
|
+
});
|
538
|
+
var scrollToElementLinkSchema = import_zod10.z.object({
|
539
|
+
type: import_zod10.z.literal("SCROLL_TO_ELEMENT"),
|
540
|
+
payload: import_zod10.z.object({
|
541
|
+
elementIdConfig: import_zod10.z.object({
|
542
|
+
elementKey: import_zod10.z.string(),
|
543
|
+
propName: import_zod10.z.string()
|
544
|
+
}).nullable().optional(),
|
545
|
+
block: import_zod10.z.union([
|
546
|
+
import_zod10.z.literal("start"),
|
547
|
+
import_zod10.z.literal("center"),
|
548
|
+
import_zod10.z.literal("end")
|
549
|
+
])
|
550
|
+
}).transform((v) => ({
|
551
|
+
elementIdConfig: v.elementIdConfig,
|
552
|
+
...v
|
553
|
+
}))
|
554
|
+
});
|
555
|
+
var linkDataSchema = import_zod10.z.union([
|
556
|
+
openPageLinkSchema,
|
557
|
+
openURLLinkSchema,
|
558
|
+
sendEmailLinkSchema,
|
559
|
+
callPhoneLinkSchema,
|
560
|
+
scrollToElementLinkSchema
|
561
|
+
]);
|
562
|
+
var linkPropControllerDataV0Schema = linkDataSchema;
|
563
|
+
var LinkPropControllerDataV1Type = "prop-controllers::link::v1";
|
564
|
+
var linkPropControllerDataV1Schema = import_zod10.z.object({
|
565
|
+
[ControlDataTypeKey]: import_zod10.z.literal(LinkPropControllerDataV1Type),
|
566
|
+
value: linkDataSchema
|
567
|
+
});
|
568
|
+
var linkPropControllerDataSchema = import_zod10.z.union([
|
569
|
+
linkPropControllerDataV0Schema,
|
570
|
+
linkPropControllerDataV1Schema
|
571
|
+
]);
|
572
|
+
function Link(options = {}) {
|
573
|
+
return { type: Types.Link, version: 1, options };
|
574
|
+
}
|
575
|
+
function getLinkPropControllerDataLinkData(data) {
|
576
|
+
return (0, import_ts_pattern8.match)(data).with(
|
415
577
|
{ [ControlDataTypeKey]: LinkPropControllerDataV1Type },
|
416
578
|
(v1) => v1.value
|
417
579
|
).otherwise((v0) => v0);
|
418
580
|
}
|
581
|
+
function createLinkPropControllerDataFromLinkData(value, definition) {
|
582
|
+
return (0, import_ts_pattern8.match)(definition).with(
|
583
|
+
{ version: 1 },
|
584
|
+
() => ({
|
585
|
+
[ControlDataTypeKey]: LinkPropControllerDataV1Type,
|
586
|
+
value
|
587
|
+
})
|
588
|
+
).otherwise(() => value);
|
589
|
+
}
|
419
590
|
function getLinkPropControllerPageIds(linkData) {
|
420
591
|
if (linkData == null)
|
421
592
|
return [];
|
422
|
-
const link =
|
593
|
+
const link = getLinkPropControllerDataLinkData(linkData);
|
423
594
|
switch (link.type) {
|
424
595
|
case "OPEN_PAGE":
|
425
596
|
return link.payload.pageId == null ? [] : [link.payload.pageId];
|
@@ -427,10 +598,8 @@ function getLinkPropControllerPageIds(linkData) {
|
|
427
598
|
return [];
|
428
599
|
}
|
429
600
|
}
|
430
|
-
function
|
431
|
-
|
432
|
-
return data;
|
433
|
-
let value = getLinkPropControllerValue(data);
|
601
|
+
function copyLinkData(data, context) {
|
602
|
+
let value = data;
|
434
603
|
switch (value?.type) {
|
435
604
|
case "OPEN_PAGE":
|
436
605
|
{
|
@@ -465,26 +634,31 @@ function copyLinkPropControllerData(data, context) {
|
|
465
634
|
break;
|
466
635
|
}
|
467
636
|
}
|
468
|
-
return
|
637
|
+
return value;
|
638
|
+
}
|
639
|
+
function copyLinkPropControllerData(data, context) {
|
640
|
+
if (data == null)
|
641
|
+
return data;
|
642
|
+
const value = copyLinkData(getLinkPropControllerDataLinkData(data), context);
|
643
|
+
if (value == null)
|
644
|
+
return value;
|
645
|
+
return (0, import_ts_pattern8.match)(data).with({ [ControlDataTypeKey]: LinkPropControllerDataV1Type }, (v1) => ({
|
469
646
|
...v1,
|
470
647
|
value
|
471
648
|
})).otherwise((_) => value);
|
472
649
|
}
|
473
|
-
function Link(options = {}) {
|
474
|
-
return { type: Types.Link, version: 1, options };
|
475
|
-
}
|
476
650
|
|
477
651
|
// src/margin/margin.ts
|
478
|
-
var
|
479
|
-
var
|
480
|
-
var marginSideDataSchema =
|
481
|
-
|
482
|
-
value:
|
483
|
-
unit:
|
652
|
+
var import_ts_pattern9 = require("ts-pattern");
|
653
|
+
var import_zod11 = require("zod");
|
654
|
+
var marginSideDataSchema = import_zod11.z.union([
|
655
|
+
import_zod11.z.object({
|
656
|
+
value: import_zod11.z.number(),
|
657
|
+
unit: import_zod11.z.literal("px")
|
484
658
|
}),
|
485
|
-
|
659
|
+
import_zod11.z.literal("auto")
|
486
660
|
]);
|
487
|
-
var marginDataSchema =
|
661
|
+
var marginDataSchema = import_zod11.z.object({
|
488
662
|
marginTop: marginSideDataSchema.nullable().optional(),
|
489
663
|
marginRight: marginSideDataSchema.nullable().optional(),
|
490
664
|
marginBottom: marginSideDataSchema.nullable().optional(),
|
@@ -498,11 +672,11 @@ var marginDataSchema = import_zod8.z.object({
|
|
498
672
|
var responsiveMarginDataSchema = createResponsiveValueSchema(marginDataSchema);
|
499
673
|
var marginPropControllerDataV0Schema = responsiveMarginDataSchema;
|
500
674
|
var MarginPropControllerDataV1Type = "prop-controllers::margin::v1";
|
501
|
-
var marginPropControllerDataV1Schema =
|
502
|
-
[ControlDataTypeKey]:
|
675
|
+
var marginPropControllerDataV1Schema = import_zod11.z.object({
|
676
|
+
[ControlDataTypeKey]: import_zod11.z.literal(MarginPropControllerDataV1Type),
|
503
677
|
value: responsiveMarginDataSchema
|
504
678
|
});
|
505
|
-
var marginPropControllerDataSchema =
|
679
|
+
var marginPropControllerDataSchema = import_zod11.z.union([
|
506
680
|
marginPropControllerDataV0Schema,
|
507
681
|
marginPropControllerDataV1Schema
|
508
682
|
]);
|
@@ -515,15 +689,15 @@ function Margin(options = {}) {
|
|
515
689
|
}
|
516
690
|
Margin.Format = MarginPropControllerFormat;
|
517
691
|
function getMarginPropControllerDataResponsiveMarginData(data) {
|
518
|
-
return (0,
|
692
|
+
return (0, import_ts_pattern9.match)(data).with(
|
519
693
|
{ [ControlDataTypeKey]: MarginPropControllerDataV1Type },
|
520
694
|
(v1) => v1.value
|
521
695
|
).otherwise((v0) => v0);
|
522
696
|
}
|
523
697
|
function createMarginPropControllerDataFromResponsiveMarginData(responsiveMarginData, definition) {
|
524
|
-
return (0,
|
698
|
+
return (0, import_ts_pattern9.match)(definition).with(
|
525
699
|
{ version: 1 },
|
526
|
-
|
700
|
+
import_ts_pattern9.P.nullish,
|
527
701
|
() => ({
|
528
702
|
[ControlDataTypeKey]: MarginPropControllerDataV1Type,
|
529
703
|
value: responsiveMarginData
|
@@ -531,104 +705,72 @@ function createMarginPropControllerDataFromResponsiveMarginData(responsiveMargin
|
|
531
705
|
).otherwise(() => responsiveMarginData);
|
532
706
|
}
|
533
707
|
|
534
|
-
// src/
|
535
|
-
var
|
536
|
-
var
|
537
|
-
var numberPropControllerDataV0Schema = import_zod9.z.number();
|
538
|
-
var NumberPropControllerDataV1Type = "prop-controllers::number::v1";
|
539
|
-
var numberPropControllerDataV1Schema = import_zod9.z.object({
|
540
|
-
[ControlDataTypeKey]: import_zod9.z.literal(NumberPropControllerDataV1Type),
|
541
|
-
value: import_zod9.z.number()
|
542
|
-
});
|
543
|
-
var numberPropControllerDataSchema = import_zod9.z.union([
|
544
|
-
numberPropControllerDataV0Schema,
|
545
|
-
numberPropControllerDataV1Schema
|
546
|
-
]);
|
547
|
-
function Number(options = {}) {
|
548
|
-
return { type: Types.Number, version: 1, options };
|
549
|
-
}
|
550
|
-
function getNumberPropControllerDataNumber(data) {
|
551
|
-
return (0, import_ts_pattern8.match)(data).with(
|
552
|
-
{ [ControlDataTypeKey]: NumberPropControllerDataV1Type },
|
553
|
-
(v1) => v1.value
|
554
|
-
).otherwise((v0) => v0);
|
555
|
-
}
|
556
|
-
function createNumberPropControllerDataFromNumber(value, definition) {
|
557
|
-
return (0, import_ts_pattern8.match)(definition).with(
|
558
|
-
{ version: 1 },
|
559
|
-
import_ts_pattern8.P.nullish,
|
560
|
-
() => ({
|
561
|
-
[ControlDataTypeKey]: NumberPropControllerDataV1Type,
|
562
|
-
value
|
563
|
-
})
|
564
|
-
).otherwise(() => value);
|
565
|
-
}
|
708
|
+
// src/navigation-links/navigation-links.ts
|
709
|
+
var import_ts_pattern12 = require("ts-pattern");
|
710
|
+
var import_zod14 = require("zod");
|
566
711
|
|
567
|
-
// src/
|
568
|
-
var
|
569
|
-
var
|
570
|
-
var
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
712
|
+
// src/text-style/text-style.ts
|
713
|
+
var import_ts_pattern10 = require("ts-pattern");
|
714
|
+
var import_zod12 = require("zod");
|
715
|
+
var textStyleDataSchema = import_zod12.z.object({
|
716
|
+
fontFamily: import_zod12.z.string().optional().nullable(),
|
717
|
+
letterSpacing: import_zod12.z.number().optional().nullable(),
|
718
|
+
fontSize: import_zod12.z.object({
|
719
|
+
value: import_zod12.z.number(),
|
720
|
+
unit: import_zod12.z.literal("px")
|
721
|
+
}).optional().nullable(),
|
722
|
+
fontWeight: import_zod12.z.number().optional().nullable(),
|
723
|
+
textTransform: import_zod12.z.array(import_zod12.z.literal("uppercase")),
|
724
|
+
fontStyle: import_zod12.z.array(import_zod12.z.literal("italic"))
|
579
725
|
}).transform((v) => ({
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
726
|
+
...v,
|
727
|
+
letterSpacing: v.letterSpacing,
|
728
|
+
fontSize: v.fontSize,
|
729
|
+
fontWeight: v.fontWeight,
|
730
|
+
textTransform: v.textTransform,
|
731
|
+
fontStyle: v.fontStyle
|
584
732
|
}));
|
585
|
-
var
|
586
|
-
var
|
587
|
-
var
|
588
|
-
var
|
589
|
-
[ControlDataTypeKey]:
|
590
|
-
value:
|
733
|
+
var responsiveTextStyleDataSchema = createResponsiveValueSchema(textStyleDataSchema);
|
734
|
+
var textStylePropControllerDataV0Schema = responsiveTextStyleDataSchema;
|
735
|
+
var TextStylePropControllerDataV1Type = "prop-controllers::text-style::v1";
|
736
|
+
var textStylePropControllerDataV1Schema = import_zod12.z.object({
|
737
|
+
[ControlDataTypeKey]: import_zod12.z.literal(TextStylePropControllerDataV1Type),
|
738
|
+
value: responsiveTextStyleDataSchema
|
591
739
|
});
|
592
|
-
var
|
593
|
-
|
594
|
-
|
740
|
+
var textStylePropControllerDataSchema = import_zod12.z.union([
|
741
|
+
textStylePropControllerDataV0Schema,
|
742
|
+
textStylePropControllerDataV1Schema
|
595
743
|
]);
|
596
|
-
|
597
|
-
|
598
|
-
ResponsiveValue: "makeswift::prop-controllers::padding::format::responsive-value"
|
599
|
-
};
|
600
|
-
function Padding(options = {}) {
|
601
|
-
return { type: Types.Padding, version: 1, options };
|
744
|
+
function TextStyle(options = {}) {
|
745
|
+
return { type: Types.TextStyle, version: 1, options };
|
602
746
|
}
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
{ [ControlDataTypeKey]: PaddingPropControllerDataV1Type },
|
747
|
+
function getTextStylePropControllerDataResponsiveTextStyleData(data) {
|
748
|
+
return (0, import_ts_pattern10.match)(data).with(
|
749
|
+
{ [ControlDataTypeKey]: TextStylePropControllerDataV1Type },
|
607
750
|
(v1) => v1.value
|
608
751
|
).otherwise((v0) => v0);
|
609
752
|
}
|
610
|
-
function
|
611
|
-
return (0,
|
753
|
+
function createTextStylePropControllerDataFromResponsiveTextStyleData(responsiveTextStyleData, definition) {
|
754
|
+
return (0, import_ts_pattern10.match)(definition).with(
|
612
755
|
{ version: 1 },
|
613
|
-
import_ts_pattern9.P.nullish,
|
614
756
|
() => ({
|
615
|
-
[ControlDataTypeKey]:
|
616
|
-
value:
|
757
|
+
[ControlDataTypeKey]: TextStylePropControllerDataV1Type,
|
758
|
+
value: responsiveTextStyleData
|
617
759
|
})
|
618
|
-
).otherwise(() =>
|
760
|
+
).otherwise(() => responsiveTextStyleData);
|
619
761
|
}
|
620
762
|
|
621
763
|
// src/responsive-color.ts
|
622
|
-
var
|
623
|
-
var
|
764
|
+
var import_zod13 = require("zod");
|
765
|
+
var import_ts_pattern11 = require("ts-pattern");
|
624
766
|
var responsiveColorDataSchema = createResponsiveValueSchema(colorDataSchema);
|
625
767
|
var responsiveColorPropControllerDataV0Schema = responsiveColorDataSchema;
|
626
768
|
var ResponsiveColorPropControllerDataV1Type = "prop-controllers::responsive-color::v1";
|
627
|
-
var responsiveColorPropControllerDataV1Schema =
|
628
|
-
[ControlDataTypeKey]:
|
769
|
+
var responsiveColorPropControllerDataV1Schema = import_zod13.z.object({
|
770
|
+
[ControlDataTypeKey]: import_zod13.z.literal(ResponsiveColorPropControllerDataV1Type),
|
629
771
|
value: responsiveColorDataSchema
|
630
772
|
});
|
631
|
-
var responsiveColorPropControllerDataSchema =
|
773
|
+
var responsiveColorPropControllerDataSchema = import_zod13.z.union([
|
632
774
|
responsiveColorPropControllerDataV0Schema,
|
633
775
|
responsiveColorPropControllerDataV1Schema
|
634
776
|
]);
|
@@ -636,13 +778,13 @@ function ResponsiveColor(options = {}) {
|
|
636
778
|
return { type: Types.ResponsiveColor, version: 1, options };
|
637
779
|
}
|
638
780
|
function getResponsiveColorPropControllerDataResponsiveColorData(data) {
|
639
|
-
return (0,
|
781
|
+
return (0, import_ts_pattern11.match)(data).with(
|
640
782
|
{ [ControlDataTypeKey]: ResponsiveColorPropControllerDataV1Type },
|
641
783
|
(v1) => v1.value
|
642
784
|
).otherwise((v0) => v0);
|
643
785
|
}
|
644
786
|
function createResponsiveColorPropControllerDataFromResponsiveColorData(definition, responsiveColorData) {
|
645
|
-
return (0,
|
787
|
+
return (0, import_ts_pattern11.match)(definition).with(
|
646
788
|
{ version: 1 },
|
647
789
|
() => ({
|
648
790
|
[ControlDataTypeKey]: ResponsiveColorPropControllerDataV1Type,
|
@@ -673,7 +815,7 @@ function copyResponsiveColorData(data, context) {
|
|
673
815
|
}
|
674
816
|
}
|
675
817
|
function copyResponsiveColorPropControllerData(data, context) {
|
676
|
-
return (0,
|
818
|
+
return (0, import_ts_pattern11.match)(data).with(void 0, () => void 0).with(
|
677
819
|
{ [ControlDataTypeKey]: ResponsiveColorPropControllerDataV1Type },
|
678
820
|
(v1) => ({
|
679
821
|
[ControlDataTypeKey]: ResponsiveColorPropControllerDataV1Type,
|
@@ -682,17 +824,283 @@ function copyResponsiveColorPropControllerData(data, context) {
|
|
682
824
|
).otherwise((v0) => copyResponsiveColorData(v0, context));
|
683
825
|
}
|
684
826
|
|
827
|
+
// src/navigation-links/navigation-links.ts
|
828
|
+
var buttonVariantSchema = import_zod14.z.enum([
|
829
|
+
"flat",
|
830
|
+
"outline",
|
831
|
+
"shadow",
|
832
|
+
"clear",
|
833
|
+
"blocky",
|
834
|
+
"bubbly",
|
835
|
+
"skewed"
|
836
|
+
]);
|
837
|
+
var buttonShapeSchema = import_zod14.z.enum(["pill", "rounded", "square"]);
|
838
|
+
var buttonSizeSchema = import_zod14.z.enum(["small", "medium", "large"]);
|
839
|
+
var navigationButtonSchema = import_zod14.z.object({
|
840
|
+
id: import_zod14.z.string(),
|
841
|
+
type: import_zod14.z.literal("button"),
|
842
|
+
payload: import_zod14.z.object({
|
843
|
+
label: import_zod14.z.string(),
|
844
|
+
link: linkDataSchema.optional(),
|
845
|
+
variant: createResponsiveValueSchema(buttonVariantSchema).optional(),
|
846
|
+
shape: createResponsiveValueSchema(buttonShapeSchema).optional(),
|
847
|
+
size: createResponsiveValueSchema(buttonSizeSchema).optional(),
|
848
|
+
textColor: createResponsiveValueSchema(colorDataSchema).optional(),
|
849
|
+
color: createResponsiveValueSchema(colorDataSchema).optional(),
|
850
|
+
textStyle: createResponsiveValueSchema(textStyleDataSchema).optional()
|
851
|
+
})
|
852
|
+
});
|
853
|
+
var navigationDropdownCaretTypeSchema = import_zod14.z.union([
|
854
|
+
import_zod14.z.literal("caret"),
|
855
|
+
import_zod14.z.literal("plus"),
|
856
|
+
import_zod14.z.literal("arrow-down"),
|
857
|
+
import_zod14.z.literal("chevron-down")
|
858
|
+
]);
|
859
|
+
var navigationDropdownLinkSchema = import_zod14.z.object({
|
860
|
+
id: import_zod14.z.string(),
|
861
|
+
payload: import_zod14.z.object({
|
862
|
+
label: import_zod14.z.string(),
|
863
|
+
link: linkDataSchema.optional(),
|
864
|
+
color: createResponsiveValueSchema(colorDataSchema).optional(),
|
865
|
+
textStyle: createResponsiveValueSchema(textStyleDataSchema).optional()
|
866
|
+
})
|
867
|
+
});
|
868
|
+
var navigationDropdownSchema = import_zod14.z.object({
|
869
|
+
id: import_zod14.z.string(),
|
870
|
+
type: import_zod14.z.literal("dropdown"),
|
871
|
+
payload: import_zod14.z.object({
|
872
|
+
label: import_zod14.z.string(),
|
873
|
+
caret: navigationDropdownCaretTypeSchema.optional(),
|
874
|
+
links: import_zod14.z.array(navigationDropdownLinkSchema).optional(),
|
875
|
+
variant: createResponsiveValueSchema(buttonVariantSchema).optional(),
|
876
|
+
shape: createResponsiveValueSchema(buttonShapeSchema).optional(),
|
877
|
+
size: createResponsiveValueSchema(buttonSizeSchema).optional(),
|
878
|
+
textColor: createResponsiveValueSchema(colorDataSchema).optional(),
|
879
|
+
color: createResponsiveValueSchema(colorDataSchema).optional(),
|
880
|
+
textStyle: createResponsiveValueSchema(textStyleDataSchema).optional()
|
881
|
+
})
|
882
|
+
});
|
883
|
+
var navigationLinksDataSchema = import_zod14.z.array(
|
884
|
+
import_zod14.z.union([navigationButtonSchema, navigationDropdownSchema])
|
885
|
+
);
|
886
|
+
var navigationLinksPropControllerDataV0Schema = navigationLinksDataSchema;
|
887
|
+
var NavigationLinksPropControllerDataV1Type = "prop-controllers::navigation-links::v1";
|
888
|
+
var navigationLinksPropControllerDataV1Schema = import_zod14.z.object({
|
889
|
+
[ControlDataTypeKey]: import_zod14.z.literal(NavigationLinksPropControllerDataV1Type),
|
890
|
+
value: navigationLinksDataSchema
|
891
|
+
});
|
892
|
+
var navigationLinksPropControllerDataSchema = import_zod14.z.union([
|
893
|
+
navigationLinksPropControllerDataV0Schema,
|
894
|
+
navigationLinksPropControllerDataV1Schema
|
895
|
+
]);
|
896
|
+
function NavigationLinks(options = {}) {
|
897
|
+
return { type: Types.NavigationLinks, version: 1, options };
|
898
|
+
}
|
899
|
+
function getNavigationLinksPropControllerDataNavigationLinksData(data) {
|
900
|
+
return (0, import_ts_pattern12.match)(data).with(
|
901
|
+
{ [ControlDataTypeKey]: NavigationLinksPropControllerDataV1Type },
|
902
|
+
(v1) => v1.value
|
903
|
+
).otherwise((v0) => v0);
|
904
|
+
}
|
905
|
+
function createNavigationLinksPropControllerDataFromNavigationLinksData(navigationLinksData, definition) {
|
906
|
+
return (0, import_ts_pattern12.match)(definition).with(
|
907
|
+
{ version: 1 },
|
908
|
+
() => ({
|
909
|
+
[ControlDataTypeKey]: NavigationLinksPropControllerDataV1Type,
|
910
|
+
value: navigationLinksData
|
911
|
+
})
|
912
|
+
).otherwise(() => navigationLinksData);
|
913
|
+
}
|
914
|
+
function getNavigationLinksPropControllerPageIds(data) {
|
915
|
+
if (data == null)
|
916
|
+
return [];
|
917
|
+
const value = getNavigationLinksPropControllerDataNavigationLinksData(data);
|
918
|
+
return value?.flatMap((item) => {
|
919
|
+
switch (item.type) {
|
920
|
+
case "button": {
|
921
|
+
if (item.payload.link == null)
|
922
|
+
return [];
|
923
|
+
switch (item.payload.link.type) {
|
924
|
+
case "OPEN_PAGE":
|
925
|
+
return item.payload.link.payload.pageId == null ? [] : [item.payload.link.payload.pageId];
|
926
|
+
default:
|
927
|
+
return [];
|
928
|
+
}
|
929
|
+
}
|
930
|
+
case "dropdown": {
|
931
|
+
return item.payload.links?.flatMap((link) => {
|
932
|
+
if (link.payload.link == null)
|
933
|
+
return [];
|
934
|
+
switch (link.payload.link.type) {
|
935
|
+
case "OPEN_PAGE":
|
936
|
+
return link.payload.link.payload.pageId == null ? [] : [link.payload.link.payload.pageId];
|
937
|
+
default:
|
938
|
+
return [];
|
939
|
+
}
|
940
|
+
}) ?? [];
|
941
|
+
}
|
942
|
+
}
|
943
|
+
}) ?? [];
|
944
|
+
}
|
945
|
+
function getNavigationLinksPropControllerSwatchIds(data) {
|
946
|
+
if (data == null)
|
947
|
+
return [];
|
948
|
+
const value = getNavigationLinksPropControllerDataNavigationLinksData(data);
|
949
|
+
return value?.flatMap((item) => {
|
950
|
+
switch (item.type) {
|
951
|
+
case "button":
|
952
|
+
case "dropdown":
|
953
|
+
return [
|
954
|
+
...item.payload.color?.map((override) => override.value).map((color) => color.swatchId) ?? [],
|
955
|
+
...item.payload.textColor?.map((override) => override.value).map((color) => color.swatchId) ?? []
|
956
|
+
];
|
957
|
+
}
|
958
|
+
}) ?? [];
|
959
|
+
}
|
960
|
+
function copyNavigationLinksData(data, context) {
|
961
|
+
return data?.map((item) => {
|
962
|
+
switch (item.type) {
|
963
|
+
case "button": {
|
964
|
+
const { color, link } = item.payload;
|
965
|
+
return {
|
966
|
+
...item,
|
967
|
+
payload: {
|
968
|
+
...item.payload,
|
969
|
+
link: copyLinkData(link, context),
|
970
|
+
color: color != null ? copyResponsiveColorData(color, context) : void 0
|
971
|
+
}
|
972
|
+
};
|
973
|
+
}
|
974
|
+
case "dropdown": {
|
975
|
+
const { color, links } = item.payload;
|
976
|
+
return {
|
977
|
+
...item,
|
978
|
+
payload: {
|
979
|
+
...item.payload,
|
980
|
+
links: links != null ? links.map((link) => ({
|
981
|
+
...link,
|
982
|
+
payload: {
|
983
|
+
...link.payload,
|
984
|
+
link: copyLinkData(link.payload.link, context)
|
985
|
+
}
|
986
|
+
})) : void 0,
|
987
|
+
color: color != null ? copyResponsiveColorData(color, context) : void 0
|
988
|
+
}
|
989
|
+
};
|
990
|
+
}
|
991
|
+
default:
|
992
|
+
return item;
|
993
|
+
}
|
994
|
+
});
|
995
|
+
}
|
996
|
+
function copyNavigationLinksPropControllerData(data, context) {
|
997
|
+
return (0, import_ts_pattern12.match)(data).with(void 0, () => void 0).with(
|
998
|
+
{ [ControlDataTypeKey]: NavigationLinksPropControllerDataV1Type },
|
999
|
+
(v1) => ({
|
1000
|
+
[ControlDataTypeKey]: NavigationLinksPropControllerDataV1Type,
|
1001
|
+
value: copyNavigationLinksData(v1.value, context)
|
1002
|
+
})
|
1003
|
+
).otherwise((v0) => copyNavigationLinksData(v0, context));
|
1004
|
+
}
|
1005
|
+
|
1006
|
+
// src/number.ts
|
1007
|
+
var import_zod15 = require("zod");
|
1008
|
+
var import_ts_pattern13 = require("ts-pattern");
|
1009
|
+
var numberPropControllerDataV0Schema = import_zod15.z.number();
|
1010
|
+
var NumberPropControllerDataV1Type = "prop-controllers::number::v1";
|
1011
|
+
var numberPropControllerDataV1Schema = import_zod15.z.object({
|
1012
|
+
[ControlDataTypeKey]: import_zod15.z.literal(NumberPropControllerDataV1Type),
|
1013
|
+
value: import_zod15.z.number()
|
1014
|
+
});
|
1015
|
+
var numberPropControllerDataSchema = import_zod15.z.union([
|
1016
|
+
numberPropControllerDataV0Schema,
|
1017
|
+
numberPropControllerDataV1Schema
|
1018
|
+
]);
|
1019
|
+
function Number(options = {}) {
|
1020
|
+
return { type: Types.Number, version: 1, options };
|
1021
|
+
}
|
1022
|
+
function getNumberPropControllerDataNumber(data) {
|
1023
|
+
return (0, import_ts_pattern13.match)(data).with(
|
1024
|
+
{ [ControlDataTypeKey]: NumberPropControllerDataV1Type },
|
1025
|
+
(v1) => v1.value
|
1026
|
+
).otherwise((v0) => v0);
|
1027
|
+
}
|
1028
|
+
function createNumberPropControllerDataFromNumber(value, definition) {
|
1029
|
+
return (0, import_ts_pattern13.match)(definition).with(
|
1030
|
+
{ version: 1 },
|
1031
|
+
import_ts_pattern13.P.nullish,
|
1032
|
+
() => ({
|
1033
|
+
[ControlDataTypeKey]: NumberPropControllerDataV1Type,
|
1034
|
+
value
|
1035
|
+
})
|
1036
|
+
).otherwise(() => value);
|
1037
|
+
}
|
1038
|
+
|
1039
|
+
// src/padding/padding.ts
|
1040
|
+
var import_ts_pattern14 = require("ts-pattern");
|
1041
|
+
var import_zod16 = require("zod");
|
1042
|
+
var paddingSideDataSchema = import_zod16.z.object({
|
1043
|
+
value: import_zod16.z.number(),
|
1044
|
+
unit: import_zod16.z.literal("px")
|
1045
|
+
});
|
1046
|
+
var paddingDataSchema = import_zod16.z.object({
|
1047
|
+
paddingTop: paddingSideDataSchema.nullable().optional(),
|
1048
|
+
paddingRight: paddingSideDataSchema.nullable().optional(),
|
1049
|
+
paddingBottom: paddingSideDataSchema.nullable().optional(),
|
1050
|
+
paddingLeft: paddingSideDataSchema.nullable().optional()
|
1051
|
+
}).transform((v) => ({
|
1052
|
+
paddingTop: v.paddingTop,
|
1053
|
+
paddingRight: v.paddingRight,
|
1054
|
+
paddingBottom: v.paddingBottom,
|
1055
|
+
paddingLeft: v.paddingLeft
|
1056
|
+
}));
|
1057
|
+
var responsivePaddingDataSchema = createResponsiveValueSchema(paddingDataSchema);
|
1058
|
+
var paddingPropControllerDataV0Schema = responsivePaddingDataSchema;
|
1059
|
+
var PaddingPropControllerDataV1Type = "prop-controllers::padding::v1";
|
1060
|
+
var paddingPropControllerDataV1Schema = import_zod16.z.object({
|
1061
|
+
[ControlDataTypeKey]: import_zod16.z.literal(PaddingPropControllerDataV1Type),
|
1062
|
+
value: responsivePaddingDataSchema
|
1063
|
+
});
|
1064
|
+
var paddingPropControllerDataSchema = import_zod16.z.union([
|
1065
|
+
paddingPropControllerDataV0Schema,
|
1066
|
+
paddingPropControllerDataV1Schema
|
1067
|
+
]);
|
1068
|
+
var PaddingPropControllerFormat = {
|
1069
|
+
ClassName: "makeswift::prop-controllers::padding::format::class-name",
|
1070
|
+
ResponsiveValue: "makeswift::prop-controllers::padding::format::responsive-value"
|
1071
|
+
};
|
1072
|
+
function Padding(options = {}) {
|
1073
|
+
return { type: Types.Padding, version: 1, options };
|
1074
|
+
}
|
1075
|
+
Padding.Format = PaddingPropControllerFormat;
|
1076
|
+
function getPaddingPropControllerDataResponsivePaddingData(data) {
|
1077
|
+
return (0, import_ts_pattern14.match)(data).with(
|
1078
|
+
{ [ControlDataTypeKey]: PaddingPropControllerDataV1Type },
|
1079
|
+
(v1) => v1.value
|
1080
|
+
).otherwise((v0) => v0);
|
1081
|
+
}
|
1082
|
+
function createPaddingPropControllerDataFromResponsivePaddingData(responsivePaddingData, definition) {
|
1083
|
+
return (0, import_ts_pattern14.match)(definition).with(
|
1084
|
+
{ version: 1 },
|
1085
|
+
import_ts_pattern14.P.nullish,
|
1086
|
+
() => ({
|
1087
|
+
[ControlDataTypeKey]: PaddingPropControllerDataV1Type,
|
1088
|
+
value: responsivePaddingData
|
1089
|
+
})
|
1090
|
+
).otherwise(() => responsivePaddingData);
|
1091
|
+
}
|
1092
|
+
|
685
1093
|
// src/responsive-length.ts
|
686
|
-
var
|
687
|
-
var
|
1094
|
+
var import_zod17 = require("zod");
|
1095
|
+
var import_ts_pattern15 = require("ts-pattern");
|
688
1096
|
var responsiveLengthDataSchema = createResponsiveValueSchema(lengthDataSchema);
|
689
1097
|
var responsiveLengthPropControllerDataV0Schema = responsiveLengthDataSchema;
|
690
1098
|
var ResponsiveLengthPropControllerDataV1Type = "prop-controllers::responsive-length::v1";
|
691
|
-
var responsiveLengthPropControllerDataV1Schema =
|
692
|
-
[ControlDataTypeKey]:
|
1099
|
+
var responsiveLengthPropControllerDataV1Schema = import_zod17.z.object({
|
1100
|
+
[ControlDataTypeKey]: import_zod17.z.literal(ResponsiveLengthPropControllerDataV1Type),
|
693
1101
|
value: responsiveLengthDataSchema
|
694
1102
|
});
|
695
|
-
var responsiveLengthPropControllerDataSchema =
|
1103
|
+
var responsiveLengthPropControllerDataSchema = import_zod17.z.union([
|
696
1104
|
responsiveLengthPropControllerDataV0Schema,
|
697
1105
|
responsiveLengthPropControllerDataV1Schema
|
698
1106
|
]);
|
@@ -700,13 +1108,13 @@ function ResponsiveLength(options = {}) {
|
|
700
1108
|
return { type: Types.ResponsiveLength, version: 1, options };
|
701
1109
|
}
|
702
1110
|
function getResponsiveLengthPropControllerDataResponsiveLengthData(data) {
|
703
|
-
return (0,
|
1111
|
+
return (0, import_ts_pattern15.match)(data).with(
|
704
1112
|
{ [ControlDataTypeKey]: ResponsiveLengthPropControllerDataV1Type },
|
705
1113
|
(v1) => v1.value
|
706
1114
|
).otherwise((v0) => v0);
|
707
1115
|
}
|
708
1116
|
function createResponsiveLengthPropControllerDataFromResponsiveLengthData(definition, responsiveLengthData) {
|
709
|
-
return (0,
|
1117
|
+
return (0, import_ts_pattern15.match)(definition).with(
|
710
1118
|
{ version: 1 },
|
711
1119
|
() => ({
|
712
1120
|
[ControlDataTypeKey]: ResponsiveLengthPropControllerDataV1Type,
|
@@ -716,30 +1124,30 @@ function createResponsiveLengthPropControllerDataFromResponsiveLengthData(defini
|
|
716
1124
|
}
|
717
1125
|
|
718
1126
|
// src/shadows.ts
|
719
|
-
var
|
720
|
-
var
|
721
|
-
var shadowDataSchema =
|
1127
|
+
var import_ts_pattern16 = require("ts-pattern");
|
1128
|
+
var import_zod18 = require("zod");
|
1129
|
+
var shadowDataSchema = import_zod18.z.object({
|
722
1130
|
color: colorDataSchema.nullable().optional(),
|
723
|
-
blurRadius:
|
724
|
-
spreadRadius:
|
725
|
-
offsetX:
|
726
|
-
offsetY:
|
727
|
-
inset:
|
1131
|
+
blurRadius: import_zod18.z.number().optional(),
|
1132
|
+
spreadRadius: import_zod18.z.number().optional(),
|
1133
|
+
offsetX: import_zod18.z.number().optional(),
|
1134
|
+
offsetY: import_zod18.z.number().optional(),
|
1135
|
+
inset: import_zod18.z.boolean().optional()
|
728
1136
|
});
|
729
|
-
var shadowsDataSchema =
|
730
|
-
|
731
|
-
id:
|
1137
|
+
var shadowsDataSchema = import_zod18.z.array(
|
1138
|
+
import_zod18.z.object({
|
1139
|
+
id: import_zod18.z.string(),
|
732
1140
|
payload: shadowDataSchema
|
733
1141
|
})
|
734
1142
|
);
|
735
1143
|
var responsiveShadowsDataSchema = createResponsiveValueSchema(shadowsDataSchema);
|
736
1144
|
var shadowsPropControllerDataV0Schema = responsiveShadowsDataSchema;
|
737
1145
|
var ShadowsPropControllerDataV1Type = "prop-controllers::shadows::v1";
|
738
|
-
var shadowsPropControllerDataV1Schema =
|
739
|
-
[ControlDataTypeKey]:
|
1146
|
+
var shadowsPropControllerDataV1Schema = import_zod18.z.object({
|
1147
|
+
[ControlDataTypeKey]: import_zod18.z.literal(ShadowsPropControllerDataV1Type),
|
740
1148
|
value: responsiveShadowsDataSchema
|
741
1149
|
});
|
742
|
-
var shadowsPropControllerDataSchema =
|
1150
|
+
var shadowsPropControllerDataSchema = import_zod18.z.union([
|
743
1151
|
shadowsPropControllerDataV0Schema,
|
744
1152
|
shadowsPropControllerDataV1Schema
|
745
1153
|
]);
|
@@ -752,13 +1160,13 @@ function Shadows(options = {}) {
|
|
752
1160
|
}
|
753
1161
|
Shadows.Format = ShadowsPropControllerFormat;
|
754
1162
|
function getShadowsPropControllerDataResponsiveShadowsData(data) {
|
755
|
-
return (0,
|
1163
|
+
return (0, import_ts_pattern16.match)(data).with(
|
756
1164
|
{ [ControlDataTypeKey]: ShadowsPropControllerDataV1Type },
|
757
1165
|
(v1) => v1.value
|
758
1166
|
).otherwise((v0) => v0);
|
759
1167
|
}
|
760
1168
|
function createShadowsPropControllerDataFromResponsiveShadowsData(definition, responsiveShadowsData) {
|
761
|
-
return (0,
|
1169
|
+
return (0, import_ts_pattern16.match)(definition).with(
|
762
1170
|
{ version: 1 },
|
763
1171
|
() => ({
|
764
1172
|
[ControlDataTypeKey]: ShadowsPropControllerDataV1Type,
|
@@ -792,7 +1200,7 @@ function copyResponsiveShadowsData(data, context) {
|
|
792
1200
|
}));
|
793
1201
|
}
|
794
1202
|
function copyShadowsPropControllerData(data, context) {
|
795
|
-
return (0,
|
1203
|
+
return (0, import_ts_pattern16.match)(data).with(void 0, () => void 0).with(
|
796
1204
|
{ [ControlDataTypeKey]: ShadowsPropControllerDataV1Type },
|
797
1205
|
(v1) => ({
|
798
1206
|
[ControlDataTypeKey]: ShadowsPropControllerDataV1Type,
|
@@ -802,16 +1210,16 @@ function copyShadowsPropControllerData(data, context) {
|
|
802
1210
|
}
|
803
1211
|
|
804
1212
|
// src/table/table.ts
|
805
|
-
var
|
806
|
-
var
|
807
|
-
var tableIdSchema =
|
1213
|
+
var import_zod19 = require("zod");
|
1214
|
+
var import_ts_pattern17 = require("ts-pattern");
|
1215
|
+
var tableIdSchema = import_zod19.z.string();
|
808
1216
|
var tablePropControllerDataV0Schema = tableIdSchema;
|
809
1217
|
var TablePropControllerDataV1Type = "prop-controllers::table::v1";
|
810
|
-
var tablePropControllerDataV1Schema =
|
811
|
-
[ControlDataTypeKey]:
|
1218
|
+
var tablePropControllerDataV1Schema = import_zod19.z.object({
|
1219
|
+
[ControlDataTypeKey]: import_zod19.z.literal(TablePropControllerDataV1Type),
|
812
1220
|
value: tableIdSchema
|
813
1221
|
});
|
814
|
-
var tablePropControllerDataSchema =
|
1222
|
+
var tablePropControllerDataSchema = import_zod19.z.union([
|
815
1223
|
tablePropControllerDataV0Schema,
|
816
1224
|
tablePropControllerDataV1Schema
|
817
1225
|
]);
|
@@ -819,15 +1227,15 @@ function Table(options = {}) {
|
|
819
1227
|
return { type: Types.Table, version: 1, options };
|
820
1228
|
}
|
821
1229
|
function getTablePropControllerDataTableId(data) {
|
822
|
-
return (0,
|
1230
|
+
return (0, import_ts_pattern17.match)(data).with(
|
823
1231
|
{ [ControlDataTypeKey]: TablePropControllerDataV1Type },
|
824
1232
|
(v1) => v1.value
|
825
1233
|
).otherwise((v0) => v0);
|
826
1234
|
}
|
827
1235
|
function createTablePropControllerDataFromTableId(value, definition) {
|
828
|
-
return (0,
|
1236
|
+
return (0, import_ts_pattern17.match)(definition).with(
|
829
1237
|
{ version: 1 },
|
830
|
-
|
1238
|
+
import_ts_pattern17.P.nullish,
|
831
1239
|
() => ({
|
832
1240
|
[ControlDataTypeKey]: TablePropControllerDataV1Type,
|
833
1241
|
value
|
@@ -840,7 +1248,7 @@ function copyTableId(data, context) {
|
|
840
1248
|
return context.replacementContext.tableIds.get(data) ?? data;
|
841
1249
|
}
|
842
1250
|
function copyTablePropControllerData(data, context) {
|
843
|
-
return (0,
|
1251
|
+
return (0, import_ts_pattern17.match)(data).with(void 0, () => void 0).with(
|
844
1252
|
{ [ControlDataTypeKey]: TablePropControllerDataV1Type },
|
845
1253
|
(v1) => ({
|
846
1254
|
[ControlDataTypeKey]: TablePropControllerDataV1Type,
|
@@ -853,67 +1261,48 @@ function getTablePropControllerDataTableIds(data) {
|
|
853
1261
|
return value ? [value] : [];
|
854
1262
|
}
|
855
1263
|
|
856
|
-
// src/text-
|
857
|
-
var
|
858
|
-
var
|
859
|
-
var
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
unit: import_zod15.z.literal("px")
|
865
|
-
}).optional().nullable(),
|
866
|
-
fontWeight: import_zod15.z.number().optional().nullable(),
|
867
|
-
textTransform: import_zod15.z.array(import_zod15.z.literal("uppercase")),
|
868
|
-
fontStyle: import_zod15.z.array(import_zod15.z.literal("italic"))
|
869
|
-
}).transform((v) => ({
|
870
|
-
...v,
|
871
|
-
letterSpacing: v.letterSpacing,
|
872
|
-
fontSize: v.fontSize,
|
873
|
-
fontWeight: v.fontWeight,
|
874
|
-
textTransform: v.textTransform,
|
875
|
-
fontStyle: v.fontStyle
|
876
|
-
}));
|
877
|
-
var responsiveTextStyleDataSchema = createResponsiveValueSchema(textStyleDataSchema);
|
878
|
-
var textStylePropControllerDataV0Schema = responsiveTextStyleDataSchema;
|
879
|
-
var TextStylePropControllerDataV1Type = "prop-controllers::text-style::v1";
|
880
|
-
var textStylePropControllerDataV1Schema = import_zod15.z.object({
|
881
|
-
[ControlDataTypeKey]: import_zod15.z.literal(TextStylePropControllerDataV1Type),
|
882
|
-
value: responsiveTextStyleDataSchema
|
1264
|
+
// src/text-area/text-area.ts
|
1265
|
+
var import_zod20 = require("zod");
|
1266
|
+
var import_ts_pattern18 = require("ts-pattern");
|
1267
|
+
var textAreaPropControllerDataV0Schema = import_zod20.z.string();
|
1268
|
+
var TextAreaPropControllerDataV1Type = "prop-controllers::text-area::v1";
|
1269
|
+
var textAreaPropControllerDataV1Schema = import_zod20.z.object({
|
1270
|
+
[ControlDataTypeKey]: import_zod20.z.literal(TextAreaPropControllerDataV1Type),
|
1271
|
+
value: import_zod20.z.string()
|
883
1272
|
});
|
884
|
-
var
|
885
|
-
|
886
|
-
|
1273
|
+
var textAreaPropControllerDataSchema = import_zod20.z.union([
|
1274
|
+
textAreaPropControllerDataV0Schema,
|
1275
|
+
textAreaPropControllerDataV1Schema
|
887
1276
|
]);
|
888
|
-
function
|
889
|
-
return { type: Types.
|
1277
|
+
function TextArea(options = {}) {
|
1278
|
+
return { type: Types.TextArea, version: 1, options };
|
890
1279
|
}
|
891
|
-
function
|
892
|
-
return (0,
|
893
|
-
{ [ControlDataTypeKey]:
|
1280
|
+
function getTextAreaPropControllerDataString(data) {
|
1281
|
+
return (0, import_ts_pattern18.match)(data).with(
|
1282
|
+
{ [ControlDataTypeKey]: TextAreaPropControllerDataV1Type },
|
894
1283
|
(v1) => v1.value
|
895
1284
|
).otherwise((v0) => v0);
|
896
1285
|
}
|
897
|
-
function
|
898
|
-
return (0,
|
1286
|
+
function createTextAreaPropControllerDataFromString(value, definition) {
|
1287
|
+
return (0, import_ts_pattern18.match)(definition).with(
|
899
1288
|
{ version: 1 },
|
900
1289
|
() => ({
|
901
|
-
[ControlDataTypeKey]:
|
902
|
-
value
|
1290
|
+
[ControlDataTypeKey]: TextAreaPropControllerDataV1Type,
|
1291
|
+
value
|
903
1292
|
})
|
904
|
-
).otherwise(() =>
|
1293
|
+
).otherwise(() => value);
|
905
1294
|
}
|
906
1295
|
|
907
1296
|
// src/width/width.ts
|
908
|
-
var
|
909
|
-
var
|
1297
|
+
var import_ts_pattern19 = require("ts-pattern");
|
1298
|
+
var import_zod21 = require("zod");
|
910
1299
|
var widthPropControllerDataV0Schema = responsiveLengthDataSchema;
|
911
1300
|
var WidthPropControllerDataV1Type = "prop-controllers::width::v1";
|
912
|
-
var widthPropControllerDataV1Schema =
|
913
|
-
[ControlDataTypeKey]:
|
1301
|
+
var widthPropControllerDataV1Schema = import_zod21.z.object({
|
1302
|
+
[ControlDataTypeKey]: import_zod21.z.literal(WidthPropControllerDataV1Type),
|
914
1303
|
value: responsiveLengthDataSchema
|
915
1304
|
});
|
916
|
-
var widthPropControllerDataSchema =
|
1305
|
+
var widthPropControllerDataSchema = import_zod21.z.union([
|
917
1306
|
widthPropControllerDataV0Schema,
|
918
1307
|
widthPropControllerDataV1Schema
|
919
1308
|
]);
|
@@ -926,15 +1315,15 @@ function Width(options = {}) {
|
|
926
1315
|
}
|
927
1316
|
Width.Format = WidthPropControllerFormat;
|
928
1317
|
function getWidthPropControllerDataResponsiveLengthData(data) {
|
929
|
-
return (0,
|
1318
|
+
return (0, import_ts_pattern19.match)(data).with(
|
930
1319
|
{ [ControlDataTypeKey]: WidthPropControllerDataV1Type },
|
931
1320
|
(v1) => v1.value
|
932
1321
|
).otherwise((v0) => v0);
|
933
1322
|
}
|
934
1323
|
function createWidthPropControllerDataFromResponsiveLengthData(responsiveLengthData, definition) {
|
935
|
-
return (0,
|
1324
|
+
return (0, import_ts_pattern19.match)(definition).with(
|
936
1325
|
{ version: 1 },
|
937
|
-
|
1326
|
+
import_ts_pattern19.P.nullish,
|
938
1327
|
() => ({
|
939
1328
|
[ControlDataTypeKey]: WidthPropControllerDataV1Type,
|
940
1329
|
value: responsiveLengthData
|
@@ -943,22 +1332,22 @@ function createWidthPropControllerDataFromResponsiveLengthData(responsiveLengthD
|
|
943
1332
|
}
|
944
1333
|
|
945
1334
|
// src/video/video.ts
|
946
|
-
var
|
947
|
-
var
|
948
|
-
var videoDataSchema =
|
949
|
-
url:
|
950
|
-
muted:
|
951
|
-
playing:
|
952
|
-
loop:
|
953
|
-
controls:
|
1335
|
+
var import_zod22 = require("zod");
|
1336
|
+
var import_ts_pattern20 = require("ts-pattern");
|
1337
|
+
var videoDataSchema = import_zod22.z.object({
|
1338
|
+
url: import_zod22.z.string().optional(),
|
1339
|
+
muted: import_zod22.z.boolean().optional(),
|
1340
|
+
playing: import_zod22.z.boolean().optional(),
|
1341
|
+
loop: import_zod22.z.boolean().optional(),
|
1342
|
+
controls: import_zod22.z.boolean().optional()
|
954
1343
|
});
|
955
1344
|
var videoPropControllerDataV0Schema = videoDataSchema;
|
956
1345
|
var VideoPropControllerDataV1Type = "prop-controllers::video::v1";
|
957
|
-
var videoPropControllerDataV1Schema =
|
958
|
-
[ControlDataTypeKey]:
|
1346
|
+
var videoPropControllerDataV1Schema = import_zod22.z.object({
|
1347
|
+
[ControlDataTypeKey]: import_zod22.z.literal(VideoPropControllerDataV1Type),
|
959
1348
|
value: videoDataSchema
|
960
1349
|
});
|
961
|
-
var videoPropControllerDataSchema =
|
1350
|
+
var videoPropControllerDataSchema = import_zod22.z.union([
|
962
1351
|
videoPropControllerDataV1Schema,
|
963
1352
|
videoPropControllerDataV0Schema
|
964
1353
|
]);
|
@@ -966,15 +1355,15 @@ function Video(options = {}) {
|
|
966
1355
|
return { type: Types.Video, version: 1, options };
|
967
1356
|
}
|
968
1357
|
function getVideoPropControllerDataVideoData(data) {
|
969
|
-
return (0,
|
1358
|
+
return (0, import_ts_pattern20.match)(data).with(
|
970
1359
|
{ [ControlDataTypeKey]: VideoPropControllerDataV1Type },
|
971
1360
|
(v1) => v1.value
|
972
1361
|
).otherwise((v0) => v0);
|
973
1362
|
}
|
974
1363
|
function createVideoPropControllerDataFromVideoData(value, definition) {
|
975
|
-
return (0,
|
1364
|
+
return (0, import_ts_pattern20.match)(definition).with(
|
976
1365
|
{ version: 1 },
|
977
|
-
|
1366
|
+
import_ts_pattern20.P.nullish,
|
978
1367
|
() => ({
|
979
1368
|
[ControlDataTypeKey]: VideoPropControllerDataV1Type,
|
980
1369
|
value
|
@@ -991,10 +1380,12 @@ function createVideoPropControllerDataFromVideoData(value, definition) {
|
|
991
1380
|
ControlDataTypeKey,
|
992
1381
|
Date,
|
993
1382
|
Font,
|
1383
|
+
GapX,
|
1384
|
+
GapY,
|
994
1385
|
Link,
|
995
|
-
LinkPropControllerDataV1Type,
|
996
1386
|
Margin,
|
997
1387
|
MarginPropControllerFormat,
|
1388
|
+
NavigationLinks,
|
998
1389
|
Number,
|
999
1390
|
Padding,
|
1000
1391
|
PaddingPropControllerFormat,
|
@@ -1003,6 +1394,7 @@ function createVideoPropControllerDataFromVideoData(value, definition) {
|
|
1003
1394
|
ResponsiveLengthPropControllerDataV1Type,
|
1004
1395
|
Shadows,
|
1005
1396
|
Table,
|
1397
|
+
TextArea,
|
1006
1398
|
TextStyle,
|
1007
1399
|
Types,
|
1008
1400
|
Video,
|
@@ -1013,6 +1405,7 @@ function createVideoPropControllerDataFromVideoData(value, definition) {
|
|
1013
1405
|
checkboxPropControllerDataSchema,
|
1014
1406
|
copyBorderPropControllerData,
|
1015
1407
|
copyLinkPropControllerData,
|
1408
|
+
copyNavigationLinksPropControllerData,
|
1016
1409
|
copyResponsiveColorPropControllerData,
|
1017
1410
|
copyShadowsPropControllerData,
|
1018
1411
|
copyTablePropControllerData,
|
@@ -1021,7 +1414,11 @@ function createVideoPropControllerDataFromVideoData(value, definition) {
|
|
1021
1414
|
createCheckboxPropControllerDataFromBoolean,
|
1022
1415
|
createDatePropControllerDataFromString,
|
1023
1416
|
createFontPropControllerDataFromResponsiveFontData,
|
1417
|
+
createGapXPropControllerDataFromResponsiveGapData,
|
1418
|
+
createGapYPropControllerDataFromResponsiveGapData,
|
1419
|
+
createLinkPropControllerDataFromLinkData,
|
1024
1420
|
createMarginPropControllerDataFromResponsiveMarginData,
|
1421
|
+
createNavigationLinksPropControllerDataFromNavigationLinksData,
|
1025
1422
|
createNumberPropControllerDataFromNumber,
|
1026
1423
|
createPaddingPropControllerDataFromResponsivePaddingData,
|
1027
1424
|
createResponsiveColorPropControllerDataFromResponsiveColorData,
|
@@ -1029,20 +1426,28 @@ function createVideoPropControllerDataFromVideoData(value, definition) {
|
|
1029
1426
|
createResponsiveValueSchema,
|
1030
1427
|
createShadowsPropControllerDataFromResponsiveShadowsData,
|
1031
1428
|
createTablePropControllerDataFromTableId,
|
1429
|
+
createTextAreaPropControllerDataFromString,
|
1032
1430
|
createTextStylePropControllerDataFromResponsiveTextStyleData,
|
1033
1431
|
createVideoPropControllerDataFromVideoData,
|
1034
1432
|
createWidthPropControllerDataFromResponsiveLengthData,
|
1035
1433
|
datePropControllerDataSchema,
|
1036
1434
|
fontPropControllerDataSchema,
|
1435
|
+
gapXPropControllerDataSchema,
|
1436
|
+
gapYPropControllerDataSchema,
|
1037
1437
|
getBorderPropControllerDataResponsiveBorderData,
|
1038
1438
|
getBorderPropControllerDataSwatchIds,
|
1039
1439
|
getBorderRadiusPropControllerDataResponsiveBorderRadiusData,
|
1040
1440
|
getCheckboxPropControllerDataBoolean,
|
1041
1441
|
getDatePropControllerDataString,
|
1042
1442
|
getFontPropControllerDataResponsiveFontData,
|
1443
|
+
getGapXPropControllerDataResponsiveGapData,
|
1444
|
+
getGapYPropControllerDataResponsiveGapData,
|
1445
|
+
getLinkPropControllerDataLinkData,
|
1043
1446
|
getLinkPropControllerPageIds,
|
1044
|
-
getLinkPropControllerValue,
|
1045
1447
|
getMarginPropControllerDataResponsiveMarginData,
|
1448
|
+
getNavigationLinksPropControllerDataNavigationLinksData,
|
1449
|
+
getNavigationLinksPropControllerPageIds,
|
1450
|
+
getNavigationLinksPropControllerSwatchIds,
|
1046
1451
|
getNumberPropControllerDataNumber,
|
1047
1452
|
getPaddingPropControllerDataResponsivePaddingData,
|
1048
1453
|
getResponsiveColorDataSwatchIds,
|
@@ -1053,16 +1458,21 @@ function createVideoPropControllerDataFromVideoData(value, definition) {
|
|
1053
1458
|
getShadowsPropControllerDataSwatchIds,
|
1054
1459
|
getTablePropControllerDataTableId,
|
1055
1460
|
getTablePropControllerDataTableIds,
|
1461
|
+
getTextAreaPropControllerDataString,
|
1056
1462
|
getTextStylePropControllerDataResponsiveTextStyleData,
|
1057
1463
|
getVideoPropControllerDataVideoData,
|
1058
1464
|
getWidthPropControllerDataResponsiveLengthData,
|
1465
|
+
linkDataSchema,
|
1466
|
+
linkPropControllerDataSchema,
|
1059
1467
|
marginPropControllerDataSchema,
|
1468
|
+
navigationLinksPropControllerDataSchema,
|
1060
1469
|
numberPropControllerDataSchema,
|
1061
1470
|
paddingPropControllerDataSchema,
|
1062
1471
|
responsiveColorPropControllerDataSchema,
|
1063
1472
|
responsiveLengthPropControllerDataSchema,
|
1064
1473
|
shadowsPropControllerDataSchema,
|
1065
1474
|
tablePropControllerDataSchema,
|
1475
|
+
textAreaPropControllerDataSchema,
|
1066
1476
|
textStylePropControllerDataSchema,
|
1067
1477
|
videoPropControllerDataSchema,
|
1068
1478
|
widthPropControllerDataSchema
|