@makeswift/prop-controllers 0.1.0-canary.4 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +315 -187
- 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/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-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 +7 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/link/link.d.ts +4 -4
- package/dist/types/margin/margin.d.ts +4 -4
- package/dist/types/navigation-links/navigation-links.d.ts +4 -4
- package/dist/types/number.d.ts +4 -4
- package/dist/types/padding/padding.d.ts +4 -4
- package/dist/types/prop-controllers.d.ts +4 -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/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/video/video.d.ts +4 -4
- package/dist/types/width/width.d.ts +4 -4
- package/package.json +1 -1
- package/dist/types/border copy/border.d.ts +0 -2435
- package/dist/types/border copy/border.d.ts.map +0 -1
- package/dist/types/border copy/border.test.d.ts +0 -2
- package/dist/types/border copy/border.test.d.ts.map +0 -1
- package/dist/types/border copy/index.d.ts +0 -2
- package/dist/types/border copy/index.d.ts.map +0 -1
- package/dist/types/date/checkbox.test.d.ts +0 -2
- package/dist/types/date/checkbox.test.d.ts.map +0 -1
- package/dist/types/date copy/date.d.ts +0 -50
- package/dist/types/date copy/date.d.ts.map +0 -1
- package/dist/types/date copy/date.test.d.ts +0 -2
- package/dist/types/date copy/date.test.d.ts.map +0 -1
- package/dist/types/date copy/index.d.ts +0 -2
- package/dist/types/date copy/index.d.ts.map +0 -1
- package/dist/types/font/border.d.ts +0 -2435
- package/dist/types/font/border.d.ts.map +0 -1
- package/dist/types/font/border.test.d.ts +0 -2
- package/dist/types/font/border.test.d.ts.map +0 -1
- package/dist/types/font/date.d.ts +0 -50
- package/dist/types/font/date.d.ts.map +0 -1
- package/dist/types/font/date.test.d.ts +0 -2
- package/dist/types/font/date.test.d.ts.map +0 -1
- package/dist/types/margin/border.d.ts +0 -2435
- package/dist/types/margin/border.d.ts.map +0 -1
- package/dist/types/margin/border.test.d.ts +0 -2
- package/dist/types/margin/border.test.d.ts.map +0 -1
- package/dist/types/margin copy/index.d.ts +0 -2
- package/dist/types/margin copy/index.d.ts.map +0 -1
- package/dist/types/margin copy/margin.d.ts +0 -1026
- package/dist/types/margin copy/margin.d.ts.map +0 -1
- package/dist/types/margin copy/margin.test.d.ts +0 -2
- package/dist/types/margin copy/margin.test.d.ts.map +0 -1
- package/dist/types/navigation-links/date.d.ts +0 -50
- package/dist/types/navigation-links/date.d.ts.map +0 -1
- package/dist/types/navigation-links/date.test.d.ts +0 -2
- package/dist/types/navigation-links/date.test.d.ts.map +0 -1
- package/dist/types/padding/margin.d.ts +0 -1026
- package/dist/types/padding/margin.d.ts.map +0 -1
- package/dist/types/padding/margin.test.d.ts +0 -2
- package/dist/types/padding/margin.test.d.ts.map +0 -1
- package/dist/types/padding copy/index.d.ts +0 -2
- package/dist/types/padding copy/index.d.ts.map +0 -1
- package/dist/types/padding copy/padding.d.ts +0 -1026
- package/dist/types/padding copy/padding.d.ts.map +0 -1
- package/dist/types/padding copy/padding.test.d.ts +0 -2
- package/dist/types/padding copy/padding.test.d.ts.map +0 -1
- package/dist/types/table/date.d.ts +0 -50
- package/dist/types/table/date.d.ts.map +0 -1
- package/dist/types/table/date.test.d.ts +0 -2
- package/dist/types/table/date.test.d.ts.map +0 -1
- package/dist/types/text-style/font.test.d.ts +0 -2
- package/dist/types/text-style/font.test.d.ts.map +0 -1
- package/dist/types/video/date.d.ts +0 -50
- package/dist/types/video/date.d.ts.map +0 -1
- package/dist/types/video/date.test.d.ts +0 -2
- package/dist/types/video/date.test.d.ts.map +0 -1
- package/dist/types/video/font.test.d.ts +0 -2
- package/dist/types/video/font.test.d.ts.map +0 -1
- package/dist/types/width/padding.d.ts +0 -1026
- package/dist/types/width/padding.d.ts.map +0 -1
- package/dist/types/width/padding.test.d.ts +0 -2
- package/dist/types/width/padding.test.d.ts.map +0 -1
package/dist/index.cjs
CHANGED
@@ -28,6 +28,8 @@ __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
34
|
Margin: () => Margin,
|
33
35
|
MarginPropControllerFormat: () => MarginPropControllerFormat,
|
@@ -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,
|
@@ -59,6 +62,8 @@ __export(src_exports, {
|
|
59
62
|
createCheckboxPropControllerDataFromBoolean: () => createCheckboxPropControllerDataFromBoolean,
|
60
63
|
createDatePropControllerDataFromString: () => createDatePropControllerDataFromString,
|
61
64
|
createFontPropControllerDataFromResponsiveFontData: () => createFontPropControllerDataFromResponsiveFontData,
|
65
|
+
createGapXPropControllerDataFromResponsiveGapData: () => createGapXPropControllerDataFromResponsiveGapData,
|
66
|
+
createGapYPropControllerDataFromResponsiveGapData: () => createGapYPropControllerDataFromResponsiveGapData,
|
62
67
|
createLinkPropControllerDataFromLinkData: () => createLinkPropControllerDataFromLinkData,
|
63
68
|
createMarginPropControllerDataFromResponsiveMarginData: () => createMarginPropControllerDataFromResponsiveMarginData,
|
64
69
|
createNavigationLinksPropControllerDataFromNavigationLinksData: () => createNavigationLinksPropControllerDataFromNavigationLinksData,
|
@@ -69,17 +74,22 @@ __export(src_exports, {
|
|
69
74
|
createResponsiveValueSchema: () => createResponsiveValueSchema,
|
70
75
|
createShadowsPropControllerDataFromResponsiveShadowsData: () => createShadowsPropControllerDataFromResponsiveShadowsData,
|
71
76
|
createTablePropControllerDataFromTableId: () => createTablePropControllerDataFromTableId,
|
77
|
+
createTextAreaPropControllerDataFromString: () => createTextAreaPropControllerDataFromString,
|
72
78
|
createTextStylePropControllerDataFromResponsiveTextStyleData: () => createTextStylePropControllerDataFromResponsiveTextStyleData,
|
73
79
|
createVideoPropControllerDataFromVideoData: () => createVideoPropControllerDataFromVideoData,
|
74
80
|
createWidthPropControllerDataFromResponsiveLengthData: () => createWidthPropControllerDataFromResponsiveLengthData,
|
75
81
|
datePropControllerDataSchema: () => datePropControllerDataSchema,
|
76
82
|
fontPropControllerDataSchema: () => fontPropControllerDataSchema,
|
83
|
+
gapXPropControllerDataSchema: () => gapXPropControllerDataSchema,
|
84
|
+
gapYPropControllerDataSchema: () => gapYPropControllerDataSchema,
|
77
85
|
getBorderPropControllerDataResponsiveBorderData: () => getBorderPropControllerDataResponsiveBorderData,
|
78
86
|
getBorderPropControllerDataSwatchIds: () => getBorderPropControllerDataSwatchIds,
|
79
87
|
getBorderRadiusPropControllerDataResponsiveBorderRadiusData: () => getBorderRadiusPropControllerDataResponsiveBorderRadiusData,
|
80
88
|
getCheckboxPropControllerDataBoolean: () => getCheckboxPropControllerDataBoolean,
|
81
89
|
getDatePropControllerDataString: () => getDatePropControllerDataString,
|
82
90
|
getFontPropControllerDataResponsiveFontData: () => getFontPropControllerDataResponsiveFontData,
|
91
|
+
getGapXPropControllerDataResponsiveGapData: () => getGapXPropControllerDataResponsiveGapData,
|
92
|
+
getGapYPropControllerDataResponsiveGapData: () => getGapYPropControllerDataResponsiveGapData,
|
83
93
|
getLinkPropControllerDataLinkData: () => getLinkPropControllerDataLinkData,
|
84
94
|
getLinkPropControllerPageIds: () => getLinkPropControllerPageIds,
|
85
95
|
getMarginPropControllerDataResponsiveMarginData: () => getMarginPropControllerDataResponsiveMarginData,
|
@@ -96,6 +106,7 @@ __export(src_exports, {
|
|
96
106
|
getShadowsPropControllerDataSwatchIds: () => getShadowsPropControllerDataSwatchIds,
|
97
107
|
getTablePropControllerDataTableId: () => getTablePropControllerDataTableId,
|
98
108
|
getTablePropControllerDataTableIds: () => getTablePropControllerDataTableIds,
|
109
|
+
getTextAreaPropControllerDataString: () => getTextAreaPropControllerDataString,
|
99
110
|
getTextStylePropControllerDataResponsiveTextStyleData: () => getTextStylePropControllerDataResponsiveTextStyleData,
|
100
111
|
getVideoPropControllerDataVideoData: () => getVideoPropControllerDataVideoData,
|
101
112
|
getWidthPropControllerDataResponsiveLengthData: () => getWidthPropControllerDataResponsiveLengthData,
|
@@ -109,6 +120,7 @@ __export(src_exports, {
|
|
109
120
|
responsiveLengthPropControllerDataSchema: () => responsiveLengthPropControllerDataSchema,
|
110
121
|
shadowsPropControllerDataSchema: () => shadowsPropControllerDataSchema,
|
111
122
|
tablePropControllerDataSchema: () => tablePropControllerDataSchema,
|
123
|
+
textAreaPropControllerDataSchema: () => textAreaPropControllerDataSchema,
|
112
124
|
textStylePropControllerDataSchema: () => textStylePropControllerDataSchema,
|
113
125
|
videoPropControllerDataSchema: () => videoPropControllerDataSchema,
|
114
126
|
widthPropControllerDataSchema: () => widthPropControllerDataSchema
|
@@ -123,6 +135,8 @@ var Types = {
|
|
123
135
|
Checkbox: "Checkbox",
|
124
136
|
Date: "Date",
|
125
137
|
Font: "Font",
|
138
|
+
GapX: "GapX",
|
139
|
+
GapY: "GapY",
|
126
140
|
Link: "Link",
|
127
141
|
Margin: "Margin",
|
128
142
|
NavigationLinks: "NavigationLinks",
|
@@ -131,6 +145,7 @@ var Types = {
|
|
131
145
|
Shadows: "Shadows",
|
132
146
|
ResponsiveColor: "ResponsiveColor",
|
133
147
|
ResponsiveLength: "ResponsiveLength",
|
148
|
+
TextArea: "TextArea",
|
134
149
|
Table: "Table",
|
135
150
|
TextStyle: "TextStyle",
|
136
151
|
Width: "Width",
|
@@ -161,6 +176,11 @@ var lengthDataSchema = import_zod2.z.object({
|
|
161
176
|
value: import_zod2.z.number(),
|
162
177
|
unit: import_zod2.z.union([import_zod2.z.literal("px"), import_zod2.z.literal("%")])
|
163
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);
|
164
184
|
|
165
185
|
// src/border/border.ts
|
166
186
|
var import_zod3 = require("zod");
|
@@ -417,58 +437,122 @@ function createFontPropControllerDataFromResponsiveFontData(responsiveFontData,
|
|
417
437
|
).otherwise(() => responsiveFontData);
|
418
438
|
}
|
419
439
|
|
420
|
-
// src/
|
440
|
+
// src/gap-x/gap-x.ts
|
421
441
|
var import_ts_pattern6 = require("ts-pattern");
|
422
442
|
var import_zod8 = require("zod");
|
423
|
-
var
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
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) {
|
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()
|
428
512
|
}).transform((v) => ({
|
429
513
|
pageId: v.pageId,
|
430
514
|
...v
|
431
515
|
}))
|
432
516
|
});
|
433
|
-
var openURLLinkSchema =
|
434
|
-
type:
|
435
|
-
payload:
|
436
|
-
url:
|
437
|
-
openInNewTab:
|
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()
|
438
522
|
})
|
439
523
|
});
|
440
|
-
var sendEmailLinkSchema =
|
441
|
-
type:
|
442
|
-
payload:
|
443
|
-
to:
|
444
|
-
subject:
|
445
|
-
body:
|
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()
|
446
530
|
})
|
447
531
|
});
|
448
|
-
var callPhoneLinkSchema =
|
449
|
-
type:
|
450
|
-
payload:
|
451
|
-
phoneNumber:
|
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()
|
452
536
|
})
|
453
537
|
});
|
454
|
-
var scrollToElementLinkSchema =
|
455
|
-
type:
|
456
|
-
payload:
|
457
|
-
elementIdConfig:
|
458
|
-
elementKey:
|
459
|
-
propName:
|
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()
|
460
544
|
}).nullable().optional(),
|
461
|
-
block:
|
462
|
-
|
463
|
-
|
464
|
-
|
545
|
+
block: import_zod10.z.union([
|
546
|
+
import_zod10.z.literal("start"),
|
547
|
+
import_zod10.z.literal("center"),
|
548
|
+
import_zod10.z.literal("end")
|
465
549
|
])
|
466
550
|
}).transform((v) => ({
|
467
551
|
elementIdConfig: v.elementIdConfig,
|
468
552
|
...v
|
469
553
|
}))
|
470
554
|
});
|
471
|
-
var linkDataSchema =
|
555
|
+
var linkDataSchema = import_zod10.z.union([
|
472
556
|
openPageLinkSchema,
|
473
557
|
openURLLinkSchema,
|
474
558
|
sendEmailLinkSchema,
|
@@ -477,11 +561,11 @@ var linkDataSchema = import_zod8.z.union([
|
|
477
561
|
]);
|
478
562
|
var linkPropControllerDataV0Schema = linkDataSchema;
|
479
563
|
var LinkPropControllerDataV1Type = "prop-controllers::link::v1";
|
480
|
-
var linkPropControllerDataV1Schema =
|
481
|
-
[ControlDataTypeKey]:
|
564
|
+
var linkPropControllerDataV1Schema = import_zod10.z.object({
|
565
|
+
[ControlDataTypeKey]: import_zod10.z.literal(LinkPropControllerDataV1Type),
|
482
566
|
value: linkDataSchema
|
483
567
|
});
|
484
|
-
var linkPropControllerDataSchema =
|
568
|
+
var linkPropControllerDataSchema = import_zod10.z.union([
|
485
569
|
linkPropControllerDataV0Schema,
|
486
570
|
linkPropControllerDataV1Schema
|
487
571
|
]);
|
@@ -489,13 +573,13 @@ function Link(options = {}) {
|
|
489
573
|
return { type: Types.Link, version: 1, options };
|
490
574
|
}
|
491
575
|
function getLinkPropControllerDataLinkData(data) {
|
492
|
-
return (0,
|
576
|
+
return (0, import_ts_pattern8.match)(data).with(
|
493
577
|
{ [ControlDataTypeKey]: LinkPropControllerDataV1Type },
|
494
578
|
(v1) => v1.value
|
495
579
|
).otherwise((v0) => v0);
|
496
580
|
}
|
497
581
|
function createLinkPropControllerDataFromLinkData(value, definition) {
|
498
|
-
return (0,
|
582
|
+
return (0, import_ts_pattern8.match)(definition).with(
|
499
583
|
{ version: 1 },
|
500
584
|
() => ({
|
501
585
|
[ControlDataTypeKey]: LinkPropControllerDataV1Type,
|
@@ -558,23 +642,23 @@ function copyLinkPropControllerData(data, context) {
|
|
558
642
|
const value = copyLinkData(getLinkPropControllerDataLinkData(data), context);
|
559
643
|
if (value == null)
|
560
644
|
return value;
|
561
|
-
return (0,
|
645
|
+
return (0, import_ts_pattern8.match)(data).with({ [ControlDataTypeKey]: LinkPropControllerDataV1Type }, (v1) => ({
|
562
646
|
...v1,
|
563
647
|
value
|
564
648
|
})).otherwise((_) => value);
|
565
649
|
}
|
566
650
|
|
567
651
|
// src/margin/margin.ts
|
568
|
-
var
|
569
|
-
var
|
570
|
-
var marginSideDataSchema =
|
571
|
-
|
572
|
-
value:
|
573
|
-
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")
|
574
658
|
}),
|
575
|
-
|
659
|
+
import_zod11.z.literal("auto")
|
576
660
|
]);
|
577
|
-
var marginDataSchema =
|
661
|
+
var marginDataSchema = import_zod11.z.object({
|
578
662
|
marginTop: marginSideDataSchema.nullable().optional(),
|
579
663
|
marginRight: marginSideDataSchema.nullable().optional(),
|
580
664
|
marginBottom: marginSideDataSchema.nullable().optional(),
|
@@ -588,11 +672,11 @@ var marginDataSchema = import_zod9.z.object({
|
|
588
672
|
var responsiveMarginDataSchema = createResponsiveValueSchema(marginDataSchema);
|
589
673
|
var marginPropControllerDataV0Schema = responsiveMarginDataSchema;
|
590
674
|
var MarginPropControllerDataV1Type = "prop-controllers::margin::v1";
|
591
|
-
var marginPropControllerDataV1Schema =
|
592
|
-
[ControlDataTypeKey]:
|
675
|
+
var marginPropControllerDataV1Schema = import_zod11.z.object({
|
676
|
+
[ControlDataTypeKey]: import_zod11.z.literal(MarginPropControllerDataV1Type),
|
593
677
|
value: responsiveMarginDataSchema
|
594
678
|
});
|
595
|
-
var marginPropControllerDataSchema =
|
679
|
+
var marginPropControllerDataSchema = import_zod11.z.union([
|
596
680
|
marginPropControllerDataV0Schema,
|
597
681
|
marginPropControllerDataV1Schema
|
598
682
|
]);
|
@@ -605,15 +689,15 @@ function Margin(options = {}) {
|
|
605
689
|
}
|
606
690
|
Margin.Format = MarginPropControllerFormat;
|
607
691
|
function getMarginPropControllerDataResponsiveMarginData(data) {
|
608
|
-
return (0,
|
692
|
+
return (0, import_ts_pattern9.match)(data).with(
|
609
693
|
{ [ControlDataTypeKey]: MarginPropControllerDataV1Type },
|
610
694
|
(v1) => v1.value
|
611
695
|
).otherwise((v0) => v0);
|
612
696
|
}
|
613
697
|
function createMarginPropControllerDataFromResponsiveMarginData(responsiveMarginData, definition) {
|
614
|
-
return (0,
|
698
|
+
return (0, import_ts_pattern9.match)(definition).with(
|
615
699
|
{ version: 1 },
|
616
|
-
|
700
|
+
import_ts_pattern9.P.nullish,
|
617
701
|
() => ({
|
618
702
|
[ControlDataTypeKey]: MarginPropControllerDataV1Type,
|
619
703
|
value: responsiveMarginData
|
@@ -622,22 +706,22 @@ function createMarginPropControllerDataFromResponsiveMarginData(responsiveMargin
|
|
622
706
|
}
|
623
707
|
|
624
708
|
// src/navigation-links/navigation-links.ts
|
625
|
-
var
|
626
|
-
var
|
709
|
+
var import_ts_pattern12 = require("ts-pattern");
|
710
|
+
var import_zod14 = require("zod");
|
627
711
|
|
628
712
|
// src/text-style/text-style.ts
|
629
|
-
var
|
630
|
-
var
|
631
|
-
var textStyleDataSchema =
|
632
|
-
fontFamily:
|
633
|
-
letterSpacing:
|
634
|
-
fontSize:
|
635
|
-
value:
|
636
|
-
unit:
|
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")
|
637
721
|
}).optional().nullable(),
|
638
|
-
fontWeight:
|
639
|
-
textTransform:
|
640
|
-
fontStyle:
|
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"))
|
641
725
|
}).transform((v) => ({
|
642
726
|
...v,
|
643
727
|
letterSpacing: v.letterSpacing,
|
@@ -649,11 +733,11 @@ var textStyleDataSchema = import_zod10.z.object({
|
|
649
733
|
var responsiveTextStyleDataSchema = createResponsiveValueSchema(textStyleDataSchema);
|
650
734
|
var textStylePropControllerDataV0Schema = responsiveTextStyleDataSchema;
|
651
735
|
var TextStylePropControllerDataV1Type = "prop-controllers::text-style::v1";
|
652
|
-
var textStylePropControllerDataV1Schema =
|
653
|
-
[ControlDataTypeKey]:
|
736
|
+
var textStylePropControllerDataV1Schema = import_zod12.z.object({
|
737
|
+
[ControlDataTypeKey]: import_zod12.z.literal(TextStylePropControllerDataV1Type),
|
654
738
|
value: responsiveTextStyleDataSchema
|
655
739
|
});
|
656
|
-
var textStylePropControllerDataSchema =
|
740
|
+
var textStylePropControllerDataSchema = import_zod12.z.union([
|
657
741
|
textStylePropControllerDataV0Schema,
|
658
742
|
textStylePropControllerDataV1Schema
|
659
743
|
]);
|
@@ -661,13 +745,13 @@ function TextStyle(options = {}) {
|
|
661
745
|
return { type: Types.TextStyle, version: 1, options };
|
662
746
|
}
|
663
747
|
function getTextStylePropControllerDataResponsiveTextStyleData(data) {
|
664
|
-
return (0,
|
748
|
+
return (0, import_ts_pattern10.match)(data).with(
|
665
749
|
{ [ControlDataTypeKey]: TextStylePropControllerDataV1Type },
|
666
750
|
(v1) => v1.value
|
667
751
|
).otherwise((v0) => v0);
|
668
752
|
}
|
669
753
|
function createTextStylePropControllerDataFromResponsiveTextStyleData(responsiveTextStyleData, definition) {
|
670
|
-
return (0,
|
754
|
+
return (0, import_ts_pattern10.match)(definition).with(
|
671
755
|
{ version: 1 },
|
672
756
|
() => ({
|
673
757
|
[ControlDataTypeKey]: TextStylePropControllerDataV1Type,
|
@@ -677,16 +761,16 @@ function createTextStylePropControllerDataFromResponsiveTextStyleData(responsive
|
|
677
761
|
}
|
678
762
|
|
679
763
|
// src/responsive-color.ts
|
680
|
-
var
|
681
|
-
var
|
764
|
+
var import_zod13 = require("zod");
|
765
|
+
var import_ts_pattern11 = require("ts-pattern");
|
682
766
|
var responsiveColorDataSchema = createResponsiveValueSchema(colorDataSchema);
|
683
767
|
var responsiveColorPropControllerDataV0Schema = responsiveColorDataSchema;
|
684
768
|
var ResponsiveColorPropControllerDataV1Type = "prop-controllers::responsive-color::v1";
|
685
|
-
var responsiveColorPropControllerDataV1Schema =
|
686
|
-
[ControlDataTypeKey]:
|
769
|
+
var responsiveColorPropControllerDataV1Schema = import_zod13.z.object({
|
770
|
+
[ControlDataTypeKey]: import_zod13.z.literal(ResponsiveColorPropControllerDataV1Type),
|
687
771
|
value: responsiveColorDataSchema
|
688
772
|
});
|
689
|
-
var responsiveColorPropControllerDataSchema =
|
773
|
+
var responsiveColorPropControllerDataSchema = import_zod13.z.union([
|
690
774
|
responsiveColorPropControllerDataV0Schema,
|
691
775
|
responsiveColorPropControllerDataV1Schema
|
692
776
|
]);
|
@@ -694,13 +778,13 @@ function ResponsiveColor(options = {}) {
|
|
694
778
|
return { type: Types.ResponsiveColor, version: 1, options };
|
695
779
|
}
|
696
780
|
function getResponsiveColorPropControllerDataResponsiveColorData(data) {
|
697
|
-
return (0,
|
781
|
+
return (0, import_ts_pattern11.match)(data).with(
|
698
782
|
{ [ControlDataTypeKey]: ResponsiveColorPropControllerDataV1Type },
|
699
783
|
(v1) => v1.value
|
700
784
|
).otherwise((v0) => v0);
|
701
785
|
}
|
702
786
|
function createResponsiveColorPropControllerDataFromResponsiveColorData(definition, responsiveColorData) {
|
703
|
-
return (0,
|
787
|
+
return (0, import_ts_pattern11.match)(definition).with(
|
704
788
|
{ version: 1 },
|
705
789
|
() => ({
|
706
790
|
[ControlDataTypeKey]: ResponsiveColorPropControllerDataV1Type,
|
@@ -731,7 +815,7 @@ function copyResponsiveColorData(data, context) {
|
|
731
815
|
}
|
732
816
|
}
|
733
817
|
function copyResponsiveColorPropControllerData(data, context) {
|
734
|
-
return (0,
|
818
|
+
return (0, import_ts_pattern11.match)(data).with(void 0, () => void 0).with(
|
735
819
|
{ [ControlDataTypeKey]: ResponsiveColorPropControllerDataV1Type },
|
736
820
|
(v1) => ({
|
737
821
|
[ControlDataTypeKey]: ResponsiveColorPropControllerDataV1Type,
|
@@ -741,7 +825,7 @@ function copyResponsiveColorPropControllerData(data, context) {
|
|
741
825
|
}
|
742
826
|
|
743
827
|
// src/navigation-links/navigation-links.ts
|
744
|
-
var buttonVariantSchema =
|
828
|
+
var buttonVariantSchema = import_zod14.z.enum([
|
745
829
|
"flat",
|
746
830
|
"outline",
|
747
831
|
"shadow",
|
@@ -750,13 +834,13 @@ var buttonVariantSchema = import_zod12.z.enum([
|
|
750
834
|
"bubbly",
|
751
835
|
"skewed"
|
752
836
|
]);
|
753
|
-
var buttonShapeSchema =
|
754
|
-
var buttonSizeSchema =
|
755
|
-
var navigationButtonSchema =
|
756
|
-
id:
|
757
|
-
type:
|
758
|
-
payload:
|
759
|
-
label:
|
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(),
|
760
844
|
link: linkDataSchema.optional(),
|
761
845
|
variant: createResponsiveValueSchema(buttonVariantSchema).optional(),
|
762
846
|
shape: createResponsiveValueSchema(buttonShapeSchema).optional(),
|
@@ -766,28 +850,28 @@ var navigationButtonSchema = import_zod12.z.object({
|
|
766
850
|
textStyle: createResponsiveValueSchema(textStyleDataSchema).optional()
|
767
851
|
})
|
768
852
|
});
|
769
|
-
var navigationDropdownCaretTypeSchema =
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
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")
|
774
858
|
]);
|
775
|
-
var navigationDropdownLinkSchema =
|
776
|
-
id:
|
777
|
-
payload:
|
778
|
-
label:
|
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(),
|
779
863
|
link: linkDataSchema.optional(),
|
780
864
|
color: createResponsiveValueSchema(colorDataSchema).optional(),
|
781
865
|
textStyle: createResponsiveValueSchema(textStyleDataSchema).optional()
|
782
866
|
})
|
783
867
|
});
|
784
|
-
var navigationDropdownSchema =
|
785
|
-
id:
|
786
|
-
type:
|
787
|
-
payload:
|
788
|
-
label:
|
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(),
|
789
873
|
caret: navigationDropdownCaretTypeSchema.optional(),
|
790
|
-
links:
|
874
|
+
links: import_zod14.z.array(navigationDropdownLinkSchema).optional(),
|
791
875
|
variant: createResponsiveValueSchema(buttonVariantSchema).optional(),
|
792
876
|
shape: createResponsiveValueSchema(buttonShapeSchema).optional(),
|
793
877
|
size: createResponsiveValueSchema(buttonSizeSchema).optional(),
|
@@ -796,16 +880,16 @@ var navigationDropdownSchema = import_zod12.z.object({
|
|
796
880
|
textStyle: createResponsiveValueSchema(textStyleDataSchema).optional()
|
797
881
|
})
|
798
882
|
});
|
799
|
-
var navigationLinksDataSchema =
|
800
|
-
|
883
|
+
var navigationLinksDataSchema = import_zod14.z.array(
|
884
|
+
import_zod14.z.union([navigationButtonSchema, navigationDropdownSchema])
|
801
885
|
);
|
802
886
|
var navigationLinksPropControllerDataV0Schema = navigationLinksDataSchema;
|
803
887
|
var NavigationLinksPropControllerDataV1Type = "prop-controllers::navigation-links::v1";
|
804
|
-
var navigationLinksPropControllerDataV1Schema =
|
805
|
-
[ControlDataTypeKey]:
|
888
|
+
var navigationLinksPropControllerDataV1Schema = import_zod14.z.object({
|
889
|
+
[ControlDataTypeKey]: import_zod14.z.literal(NavigationLinksPropControllerDataV1Type),
|
806
890
|
value: navigationLinksDataSchema
|
807
891
|
});
|
808
|
-
var navigationLinksPropControllerDataSchema =
|
892
|
+
var navigationLinksPropControllerDataSchema = import_zod14.z.union([
|
809
893
|
navigationLinksPropControllerDataV0Schema,
|
810
894
|
navigationLinksPropControllerDataV1Schema
|
811
895
|
]);
|
@@ -813,13 +897,13 @@ function NavigationLinks(options = {}) {
|
|
813
897
|
return { type: Types.NavigationLinks, version: 1, options };
|
814
898
|
}
|
815
899
|
function getNavigationLinksPropControllerDataNavigationLinksData(data) {
|
816
|
-
return (0,
|
900
|
+
return (0, import_ts_pattern12.match)(data).with(
|
817
901
|
{ [ControlDataTypeKey]: NavigationLinksPropControllerDataV1Type },
|
818
902
|
(v1) => v1.value
|
819
903
|
).otherwise((v0) => v0);
|
820
904
|
}
|
821
905
|
function createNavigationLinksPropControllerDataFromNavigationLinksData(navigationLinksData, definition) {
|
822
|
-
return (0,
|
906
|
+
return (0, import_ts_pattern12.match)(definition).with(
|
823
907
|
{ version: 1 },
|
824
908
|
() => ({
|
825
909
|
[ControlDataTypeKey]: NavigationLinksPropControllerDataV1Type,
|
@@ -910,7 +994,7 @@ function copyNavigationLinksData(data, context) {
|
|
910
994
|
});
|
911
995
|
}
|
912
996
|
function copyNavigationLinksPropControllerData(data, context) {
|
913
|
-
return (0,
|
997
|
+
return (0, import_ts_pattern12.match)(data).with(void 0, () => void 0).with(
|
914
998
|
{ [ControlDataTypeKey]: NavigationLinksPropControllerDataV1Type },
|
915
999
|
(v1) => ({
|
916
1000
|
[ControlDataTypeKey]: NavigationLinksPropControllerDataV1Type,
|
@@ -920,15 +1004,15 @@ function copyNavigationLinksPropControllerData(data, context) {
|
|
920
1004
|
}
|
921
1005
|
|
922
1006
|
// src/number.ts
|
923
|
-
var
|
924
|
-
var
|
925
|
-
var numberPropControllerDataV0Schema =
|
1007
|
+
var import_zod15 = require("zod");
|
1008
|
+
var import_ts_pattern13 = require("ts-pattern");
|
1009
|
+
var numberPropControllerDataV0Schema = import_zod15.z.number();
|
926
1010
|
var NumberPropControllerDataV1Type = "prop-controllers::number::v1";
|
927
|
-
var numberPropControllerDataV1Schema =
|
928
|
-
[ControlDataTypeKey]:
|
929
|
-
value:
|
1011
|
+
var numberPropControllerDataV1Schema = import_zod15.z.object({
|
1012
|
+
[ControlDataTypeKey]: import_zod15.z.literal(NumberPropControllerDataV1Type),
|
1013
|
+
value: import_zod15.z.number()
|
930
1014
|
});
|
931
|
-
var numberPropControllerDataSchema =
|
1015
|
+
var numberPropControllerDataSchema = import_zod15.z.union([
|
932
1016
|
numberPropControllerDataV0Schema,
|
933
1017
|
numberPropControllerDataV1Schema
|
934
1018
|
]);
|
@@ -936,15 +1020,15 @@ function Number(options = {}) {
|
|
936
1020
|
return { type: Types.Number, version: 1, options };
|
937
1021
|
}
|
938
1022
|
function getNumberPropControllerDataNumber(data) {
|
939
|
-
return (0,
|
1023
|
+
return (0, import_ts_pattern13.match)(data).with(
|
940
1024
|
{ [ControlDataTypeKey]: NumberPropControllerDataV1Type },
|
941
1025
|
(v1) => v1.value
|
942
1026
|
).otherwise((v0) => v0);
|
943
1027
|
}
|
944
1028
|
function createNumberPropControllerDataFromNumber(value, definition) {
|
945
|
-
return (0,
|
1029
|
+
return (0, import_ts_pattern13.match)(definition).with(
|
946
1030
|
{ version: 1 },
|
947
|
-
|
1031
|
+
import_ts_pattern13.P.nullish,
|
948
1032
|
() => ({
|
949
1033
|
[ControlDataTypeKey]: NumberPropControllerDataV1Type,
|
950
1034
|
value
|
@@ -953,13 +1037,13 @@ function createNumberPropControllerDataFromNumber(value, definition) {
|
|
953
1037
|
}
|
954
1038
|
|
955
1039
|
// src/padding/padding.ts
|
956
|
-
var
|
957
|
-
var
|
958
|
-
var paddingSideDataSchema =
|
959
|
-
value:
|
960
|
-
unit:
|
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")
|
961
1045
|
});
|
962
|
-
var paddingDataSchema =
|
1046
|
+
var paddingDataSchema = import_zod16.z.object({
|
963
1047
|
paddingTop: paddingSideDataSchema.nullable().optional(),
|
964
1048
|
paddingRight: paddingSideDataSchema.nullable().optional(),
|
965
1049
|
paddingBottom: paddingSideDataSchema.nullable().optional(),
|
@@ -973,11 +1057,11 @@ var paddingDataSchema = import_zod14.z.object({
|
|
973
1057
|
var responsivePaddingDataSchema = createResponsiveValueSchema(paddingDataSchema);
|
974
1058
|
var paddingPropControllerDataV0Schema = responsivePaddingDataSchema;
|
975
1059
|
var PaddingPropControllerDataV1Type = "prop-controllers::padding::v1";
|
976
|
-
var paddingPropControllerDataV1Schema =
|
977
|
-
[ControlDataTypeKey]:
|
1060
|
+
var paddingPropControllerDataV1Schema = import_zod16.z.object({
|
1061
|
+
[ControlDataTypeKey]: import_zod16.z.literal(PaddingPropControllerDataV1Type),
|
978
1062
|
value: responsivePaddingDataSchema
|
979
1063
|
});
|
980
|
-
var paddingPropControllerDataSchema =
|
1064
|
+
var paddingPropControllerDataSchema = import_zod16.z.union([
|
981
1065
|
paddingPropControllerDataV0Schema,
|
982
1066
|
paddingPropControllerDataV1Schema
|
983
1067
|
]);
|
@@ -990,15 +1074,15 @@ function Padding(options = {}) {
|
|
990
1074
|
}
|
991
1075
|
Padding.Format = PaddingPropControllerFormat;
|
992
1076
|
function getPaddingPropControllerDataResponsivePaddingData(data) {
|
993
|
-
return (0,
|
1077
|
+
return (0, import_ts_pattern14.match)(data).with(
|
994
1078
|
{ [ControlDataTypeKey]: PaddingPropControllerDataV1Type },
|
995
1079
|
(v1) => v1.value
|
996
1080
|
).otherwise((v0) => v0);
|
997
1081
|
}
|
998
1082
|
function createPaddingPropControllerDataFromResponsivePaddingData(responsivePaddingData, definition) {
|
999
|
-
return (0,
|
1083
|
+
return (0, import_ts_pattern14.match)(definition).with(
|
1000
1084
|
{ version: 1 },
|
1001
|
-
|
1085
|
+
import_ts_pattern14.P.nullish,
|
1002
1086
|
() => ({
|
1003
1087
|
[ControlDataTypeKey]: PaddingPropControllerDataV1Type,
|
1004
1088
|
value: responsivePaddingData
|
@@ -1007,16 +1091,16 @@ function createPaddingPropControllerDataFromResponsivePaddingData(responsivePadd
|
|
1007
1091
|
}
|
1008
1092
|
|
1009
1093
|
// src/responsive-length.ts
|
1010
|
-
var
|
1011
|
-
var
|
1094
|
+
var import_zod17 = require("zod");
|
1095
|
+
var import_ts_pattern15 = require("ts-pattern");
|
1012
1096
|
var responsiveLengthDataSchema = createResponsiveValueSchema(lengthDataSchema);
|
1013
1097
|
var responsiveLengthPropControllerDataV0Schema = responsiveLengthDataSchema;
|
1014
1098
|
var ResponsiveLengthPropControllerDataV1Type = "prop-controllers::responsive-length::v1";
|
1015
|
-
var responsiveLengthPropControllerDataV1Schema =
|
1016
|
-
[ControlDataTypeKey]:
|
1099
|
+
var responsiveLengthPropControllerDataV1Schema = import_zod17.z.object({
|
1100
|
+
[ControlDataTypeKey]: import_zod17.z.literal(ResponsiveLengthPropControllerDataV1Type),
|
1017
1101
|
value: responsiveLengthDataSchema
|
1018
1102
|
});
|
1019
|
-
var responsiveLengthPropControllerDataSchema =
|
1103
|
+
var responsiveLengthPropControllerDataSchema = import_zod17.z.union([
|
1020
1104
|
responsiveLengthPropControllerDataV0Schema,
|
1021
1105
|
responsiveLengthPropControllerDataV1Schema
|
1022
1106
|
]);
|
@@ -1024,13 +1108,13 @@ function ResponsiveLength(options = {}) {
|
|
1024
1108
|
return { type: Types.ResponsiveLength, version: 1, options };
|
1025
1109
|
}
|
1026
1110
|
function getResponsiveLengthPropControllerDataResponsiveLengthData(data) {
|
1027
|
-
return (0,
|
1111
|
+
return (0, import_ts_pattern15.match)(data).with(
|
1028
1112
|
{ [ControlDataTypeKey]: ResponsiveLengthPropControllerDataV1Type },
|
1029
1113
|
(v1) => v1.value
|
1030
1114
|
).otherwise((v0) => v0);
|
1031
1115
|
}
|
1032
1116
|
function createResponsiveLengthPropControllerDataFromResponsiveLengthData(definition, responsiveLengthData) {
|
1033
|
-
return (0,
|
1117
|
+
return (0, import_ts_pattern15.match)(definition).with(
|
1034
1118
|
{ version: 1 },
|
1035
1119
|
() => ({
|
1036
1120
|
[ControlDataTypeKey]: ResponsiveLengthPropControllerDataV1Type,
|
@@ -1040,30 +1124,30 @@ function createResponsiveLengthPropControllerDataFromResponsiveLengthData(defini
|
|
1040
1124
|
}
|
1041
1125
|
|
1042
1126
|
// src/shadows.ts
|
1043
|
-
var
|
1044
|
-
var
|
1045
|
-
var shadowDataSchema =
|
1127
|
+
var import_ts_pattern16 = require("ts-pattern");
|
1128
|
+
var import_zod18 = require("zod");
|
1129
|
+
var shadowDataSchema = import_zod18.z.object({
|
1046
1130
|
color: colorDataSchema.nullable().optional(),
|
1047
|
-
blurRadius:
|
1048
|
-
spreadRadius:
|
1049
|
-
offsetX:
|
1050
|
-
offsetY:
|
1051
|
-
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()
|
1052
1136
|
});
|
1053
|
-
var shadowsDataSchema =
|
1054
|
-
|
1055
|
-
id:
|
1137
|
+
var shadowsDataSchema = import_zod18.z.array(
|
1138
|
+
import_zod18.z.object({
|
1139
|
+
id: import_zod18.z.string(),
|
1056
1140
|
payload: shadowDataSchema
|
1057
1141
|
})
|
1058
1142
|
);
|
1059
1143
|
var responsiveShadowsDataSchema = createResponsiveValueSchema(shadowsDataSchema);
|
1060
1144
|
var shadowsPropControllerDataV0Schema = responsiveShadowsDataSchema;
|
1061
1145
|
var ShadowsPropControllerDataV1Type = "prop-controllers::shadows::v1";
|
1062
|
-
var shadowsPropControllerDataV1Schema =
|
1063
|
-
[ControlDataTypeKey]:
|
1146
|
+
var shadowsPropControllerDataV1Schema = import_zod18.z.object({
|
1147
|
+
[ControlDataTypeKey]: import_zod18.z.literal(ShadowsPropControllerDataV1Type),
|
1064
1148
|
value: responsiveShadowsDataSchema
|
1065
1149
|
});
|
1066
|
-
var shadowsPropControllerDataSchema =
|
1150
|
+
var shadowsPropControllerDataSchema = import_zod18.z.union([
|
1067
1151
|
shadowsPropControllerDataV0Schema,
|
1068
1152
|
shadowsPropControllerDataV1Schema
|
1069
1153
|
]);
|
@@ -1076,13 +1160,13 @@ function Shadows(options = {}) {
|
|
1076
1160
|
}
|
1077
1161
|
Shadows.Format = ShadowsPropControllerFormat;
|
1078
1162
|
function getShadowsPropControllerDataResponsiveShadowsData(data) {
|
1079
|
-
return (0,
|
1163
|
+
return (0, import_ts_pattern16.match)(data).with(
|
1080
1164
|
{ [ControlDataTypeKey]: ShadowsPropControllerDataV1Type },
|
1081
1165
|
(v1) => v1.value
|
1082
1166
|
).otherwise((v0) => v0);
|
1083
1167
|
}
|
1084
1168
|
function createShadowsPropControllerDataFromResponsiveShadowsData(definition, responsiveShadowsData) {
|
1085
|
-
return (0,
|
1169
|
+
return (0, import_ts_pattern16.match)(definition).with(
|
1086
1170
|
{ version: 1 },
|
1087
1171
|
() => ({
|
1088
1172
|
[ControlDataTypeKey]: ShadowsPropControllerDataV1Type,
|
@@ -1116,7 +1200,7 @@ function copyResponsiveShadowsData(data, context) {
|
|
1116
1200
|
}));
|
1117
1201
|
}
|
1118
1202
|
function copyShadowsPropControllerData(data, context) {
|
1119
|
-
return (0,
|
1203
|
+
return (0, import_ts_pattern16.match)(data).with(void 0, () => void 0).with(
|
1120
1204
|
{ [ControlDataTypeKey]: ShadowsPropControllerDataV1Type },
|
1121
1205
|
(v1) => ({
|
1122
1206
|
[ControlDataTypeKey]: ShadowsPropControllerDataV1Type,
|
@@ -1126,16 +1210,16 @@ function copyShadowsPropControllerData(data, context) {
|
|
1126
1210
|
}
|
1127
1211
|
|
1128
1212
|
// src/table/table.ts
|
1129
|
-
var
|
1130
|
-
var
|
1131
|
-
var tableIdSchema =
|
1213
|
+
var import_zod19 = require("zod");
|
1214
|
+
var import_ts_pattern17 = require("ts-pattern");
|
1215
|
+
var tableIdSchema = import_zod19.z.string();
|
1132
1216
|
var tablePropControllerDataV0Schema = tableIdSchema;
|
1133
1217
|
var TablePropControllerDataV1Type = "prop-controllers::table::v1";
|
1134
|
-
var tablePropControllerDataV1Schema =
|
1135
|
-
[ControlDataTypeKey]:
|
1218
|
+
var tablePropControllerDataV1Schema = import_zod19.z.object({
|
1219
|
+
[ControlDataTypeKey]: import_zod19.z.literal(TablePropControllerDataV1Type),
|
1136
1220
|
value: tableIdSchema
|
1137
1221
|
});
|
1138
|
-
var tablePropControllerDataSchema =
|
1222
|
+
var tablePropControllerDataSchema = import_zod19.z.union([
|
1139
1223
|
tablePropControllerDataV0Schema,
|
1140
1224
|
tablePropControllerDataV1Schema
|
1141
1225
|
]);
|
@@ -1143,15 +1227,15 @@ function Table(options = {}) {
|
|
1143
1227
|
return { type: Types.Table, version: 1, options };
|
1144
1228
|
}
|
1145
1229
|
function getTablePropControllerDataTableId(data) {
|
1146
|
-
return (0,
|
1230
|
+
return (0, import_ts_pattern17.match)(data).with(
|
1147
1231
|
{ [ControlDataTypeKey]: TablePropControllerDataV1Type },
|
1148
1232
|
(v1) => v1.value
|
1149
1233
|
).otherwise((v0) => v0);
|
1150
1234
|
}
|
1151
1235
|
function createTablePropControllerDataFromTableId(value, definition) {
|
1152
|
-
return (0,
|
1236
|
+
return (0, import_ts_pattern17.match)(definition).with(
|
1153
1237
|
{ version: 1 },
|
1154
|
-
|
1238
|
+
import_ts_pattern17.P.nullish,
|
1155
1239
|
() => ({
|
1156
1240
|
[ControlDataTypeKey]: TablePropControllerDataV1Type,
|
1157
1241
|
value
|
@@ -1164,7 +1248,7 @@ function copyTableId(data, context) {
|
|
1164
1248
|
return context.replacementContext.tableIds.get(data) ?? data;
|
1165
1249
|
}
|
1166
1250
|
function copyTablePropControllerData(data, context) {
|
1167
|
-
return (0,
|
1251
|
+
return (0, import_ts_pattern17.match)(data).with(void 0, () => void 0).with(
|
1168
1252
|
{ [ControlDataTypeKey]: TablePropControllerDataV1Type },
|
1169
1253
|
(v1) => ({
|
1170
1254
|
[ControlDataTypeKey]: TablePropControllerDataV1Type,
|
@@ -1177,16 +1261,48 @@ function getTablePropControllerDataTableIds(data) {
|
|
1177
1261
|
return value ? [value] : [];
|
1178
1262
|
}
|
1179
1263
|
|
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()
|
1272
|
+
});
|
1273
|
+
var textAreaPropControllerDataSchema = import_zod20.z.union([
|
1274
|
+
textAreaPropControllerDataV0Schema,
|
1275
|
+
textAreaPropControllerDataV1Schema
|
1276
|
+
]);
|
1277
|
+
function TextArea(options = {}) {
|
1278
|
+
return { type: Types.TextArea, version: 1, options };
|
1279
|
+
}
|
1280
|
+
function getTextAreaPropControllerDataString(data) {
|
1281
|
+
return (0, import_ts_pattern18.match)(data).with(
|
1282
|
+
{ [ControlDataTypeKey]: TextAreaPropControllerDataV1Type },
|
1283
|
+
(v1) => v1.value
|
1284
|
+
).otherwise((v0) => v0);
|
1285
|
+
}
|
1286
|
+
function createTextAreaPropControllerDataFromString(value, definition) {
|
1287
|
+
return (0, import_ts_pattern18.match)(definition).with(
|
1288
|
+
{ version: 1 },
|
1289
|
+
() => ({
|
1290
|
+
[ControlDataTypeKey]: TextAreaPropControllerDataV1Type,
|
1291
|
+
value
|
1292
|
+
})
|
1293
|
+
).otherwise(() => value);
|
1294
|
+
}
|
1295
|
+
|
1180
1296
|
// src/width/width.ts
|
1181
|
-
var
|
1182
|
-
var
|
1297
|
+
var import_ts_pattern19 = require("ts-pattern");
|
1298
|
+
var import_zod21 = require("zod");
|
1183
1299
|
var widthPropControllerDataV0Schema = responsiveLengthDataSchema;
|
1184
1300
|
var WidthPropControllerDataV1Type = "prop-controllers::width::v1";
|
1185
|
-
var widthPropControllerDataV1Schema =
|
1186
|
-
[ControlDataTypeKey]:
|
1301
|
+
var widthPropControllerDataV1Schema = import_zod21.z.object({
|
1302
|
+
[ControlDataTypeKey]: import_zod21.z.literal(WidthPropControllerDataV1Type),
|
1187
1303
|
value: responsiveLengthDataSchema
|
1188
1304
|
});
|
1189
|
-
var widthPropControllerDataSchema =
|
1305
|
+
var widthPropControllerDataSchema = import_zod21.z.union([
|
1190
1306
|
widthPropControllerDataV0Schema,
|
1191
1307
|
widthPropControllerDataV1Schema
|
1192
1308
|
]);
|
@@ -1199,15 +1315,15 @@ function Width(options = {}) {
|
|
1199
1315
|
}
|
1200
1316
|
Width.Format = WidthPropControllerFormat;
|
1201
1317
|
function getWidthPropControllerDataResponsiveLengthData(data) {
|
1202
|
-
return (0,
|
1318
|
+
return (0, import_ts_pattern19.match)(data).with(
|
1203
1319
|
{ [ControlDataTypeKey]: WidthPropControllerDataV1Type },
|
1204
1320
|
(v1) => v1.value
|
1205
1321
|
).otherwise((v0) => v0);
|
1206
1322
|
}
|
1207
1323
|
function createWidthPropControllerDataFromResponsiveLengthData(responsiveLengthData, definition) {
|
1208
|
-
return (0,
|
1324
|
+
return (0, import_ts_pattern19.match)(definition).with(
|
1209
1325
|
{ version: 1 },
|
1210
|
-
|
1326
|
+
import_ts_pattern19.P.nullish,
|
1211
1327
|
() => ({
|
1212
1328
|
[ControlDataTypeKey]: WidthPropControllerDataV1Type,
|
1213
1329
|
value: responsiveLengthData
|
@@ -1216,22 +1332,22 @@ function createWidthPropControllerDataFromResponsiveLengthData(responsiveLengthD
|
|
1216
1332
|
}
|
1217
1333
|
|
1218
1334
|
// src/video/video.ts
|
1219
|
-
var
|
1220
|
-
var
|
1221
|
-
var videoDataSchema =
|
1222
|
-
url:
|
1223
|
-
muted:
|
1224
|
-
playing:
|
1225
|
-
loop:
|
1226
|
-
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()
|
1227
1343
|
});
|
1228
1344
|
var videoPropControllerDataV0Schema = videoDataSchema;
|
1229
1345
|
var VideoPropControllerDataV1Type = "prop-controllers::video::v1";
|
1230
|
-
var videoPropControllerDataV1Schema =
|
1231
|
-
[ControlDataTypeKey]:
|
1346
|
+
var videoPropControllerDataV1Schema = import_zod22.z.object({
|
1347
|
+
[ControlDataTypeKey]: import_zod22.z.literal(VideoPropControllerDataV1Type),
|
1232
1348
|
value: videoDataSchema
|
1233
1349
|
});
|
1234
|
-
var videoPropControllerDataSchema =
|
1350
|
+
var videoPropControllerDataSchema = import_zod22.z.union([
|
1235
1351
|
videoPropControllerDataV1Schema,
|
1236
1352
|
videoPropControllerDataV0Schema
|
1237
1353
|
]);
|
@@ -1239,15 +1355,15 @@ function Video(options = {}) {
|
|
1239
1355
|
return { type: Types.Video, version: 1, options };
|
1240
1356
|
}
|
1241
1357
|
function getVideoPropControllerDataVideoData(data) {
|
1242
|
-
return (0,
|
1358
|
+
return (0, import_ts_pattern20.match)(data).with(
|
1243
1359
|
{ [ControlDataTypeKey]: VideoPropControllerDataV1Type },
|
1244
1360
|
(v1) => v1.value
|
1245
1361
|
).otherwise((v0) => v0);
|
1246
1362
|
}
|
1247
1363
|
function createVideoPropControllerDataFromVideoData(value, definition) {
|
1248
|
-
return (0,
|
1364
|
+
return (0, import_ts_pattern20.match)(definition).with(
|
1249
1365
|
{ version: 1 },
|
1250
|
-
|
1366
|
+
import_ts_pattern20.P.nullish,
|
1251
1367
|
() => ({
|
1252
1368
|
[ControlDataTypeKey]: VideoPropControllerDataV1Type,
|
1253
1369
|
value
|
@@ -1264,6 +1380,8 @@ function createVideoPropControllerDataFromVideoData(value, definition) {
|
|
1264
1380
|
ControlDataTypeKey,
|
1265
1381
|
Date,
|
1266
1382
|
Font,
|
1383
|
+
GapX,
|
1384
|
+
GapY,
|
1267
1385
|
Link,
|
1268
1386
|
Margin,
|
1269
1387
|
MarginPropControllerFormat,
|
@@ -1276,6 +1394,7 @@ function createVideoPropControllerDataFromVideoData(value, definition) {
|
|
1276
1394
|
ResponsiveLengthPropControllerDataV1Type,
|
1277
1395
|
Shadows,
|
1278
1396
|
Table,
|
1397
|
+
TextArea,
|
1279
1398
|
TextStyle,
|
1280
1399
|
Types,
|
1281
1400
|
Video,
|
@@ -1295,6 +1414,8 @@ function createVideoPropControllerDataFromVideoData(value, definition) {
|
|
1295
1414
|
createCheckboxPropControllerDataFromBoolean,
|
1296
1415
|
createDatePropControllerDataFromString,
|
1297
1416
|
createFontPropControllerDataFromResponsiveFontData,
|
1417
|
+
createGapXPropControllerDataFromResponsiveGapData,
|
1418
|
+
createGapYPropControllerDataFromResponsiveGapData,
|
1298
1419
|
createLinkPropControllerDataFromLinkData,
|
1299
1420
|
createMarginPropControllerDataFromResponsiveMarginData,
|
1300
1421
|
createNavigationLinksPropControllerDataFromNavigationLinksData,
|
@@ -1305,17 +1426,22 @@ function createVideoPropControllerDataFromVideoData(value, definition) {
|
|
1305
1426
|
createResponsiveValueSchema,
|
1306
1427
|
createShadowsPropControllerDataFromResponsiveShadowsData,
|
1307
1428
|
createTablePropControllerDataFromTableId,
|
1429
|
+
createTextAreaPropControllerDataFromString,
|
1308
1430
|
createTextStylePropControllerDataFromResponsiveTextStyleData,
|
1309
1431
|
createVideoPropControllerDataFromVideoData,
|
1310
1432
|
createWidthPropControllerDataFromResponsiveLengthData,
|
1311
1433
|
datePropControllerDataSchema,
|
1312
1434
|
fontPropControllerDataSchema,
|
1435
|
+
gapXPropControllerDataSchema,
|
1436
|
+
gapYPropControllerDataSchema,
|
1313
1437
|
getBorderPropControllerDataResponsiveBorderData,
|
1314
1438
|
getBorderPropControllerDataSwatchIds,
|
1315
1439
|
getBorderRadiusPropControllerDataResponsiveBorderRadiusData,
|
1316
1440
|
getCheckboxPropControllerDataBoolean,
|
1317
1441
|
getDatePropControllerDataString,
|
1318
1442
|
getFontPropControllerDataResponsiveFontData,
|
1443
|
+
getGapXPropControllerDataResponsiveGapData,
|
1444
|
+
getGapYPropControllerDataResponsiveGapData,
|
1319
1445
|
getLinkPropControllerDataLinkData,
|
1320
1446
|
getLinkPropControllerPageIds,
|
1321
1447
|
getMarginPropControllerDataResponsiveMarginData,
|
@@ -1332,6 +1458,7 @@ function createVideoPropControllerDataFromVideoData(value, definition) {
|
|
1332
1458
|
getShadowsPropControllerDataSwatchIds,
|
1333
1459
|
getTablePropControllerDataTableId,
|
1334
1460
|
getTablePropControllerDataTableIds,
|
1461
|
+
getTextAreaPropControllerDataString,
|
1335
1462
|
getTextStylePropControllerDataResponsiveTextStyleData,
|
1336
1463
|
getVideoPropControllerDataVideoData,
|
1337
1464
|
getWidthPropControllerDataResponsiveLengthData,
|
@@ -1345,6 +1472,7 @@ function createVideoPropControllerDataFromVideoData(value, definition) {
|
|
1345
1472
|
responsiveLengthPropControllerDataSchema,
|
1346
1473
|
shadowsPropControllerDataSchema,
|
1347
1474
|
tablePropControllerDataSchema,
|
1475
|
+
textAreaPropControllerDataSchema,
|
1348
1476
|
textStylePropControllerDataSchema,
|
1349
1477
|
videoPropControllerDataSchema,
|
1350
1478
|
widthPropControllerDataSchema
|