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