@makeswift/prop-controllers 0.3.0-canary.1 → 0.3.0-canary.3
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 +301 -136
- package/dist/types/data.d.ts +12 -0
- package/dist/types/data.d.ts.map +1 -1
- package/dist/types/gap-x/gap-x.d.ts +147 -358
- package/dist/types/gap-x/gap-x.d.ts.map +1 -1
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/prop-controllers.d.ts +4 -0
- package/dist/types/prop-controllers.d.ts.map +1 -1
- package/dist/types/responsive-number/responsive-number.d.ts +69 -179
- package/dist/types/responsive-number/responsive-number.d.ts.map +1 -1
- package/dist/types/responsive-opacity/responsive-opacity.d.ts +74 -187
- package/dist/types/responsive-opacity/responsive-opacity.d.ts.map +1 -1
- package/dist/types/responsive-select/index.d.ts +2 -0
- package/dist/types/responsive-select/index.d.ts.map +1 -0
- package/dist/types/responsive-select/responsive-select.d.ts +76 -0
- package/dist/types/responsive-select/responsive-select.d.ts.map +1 -0
- package/dist/types/responsive-select/responsive-select.test.d.ts +2 -0
- package/dist/types/responsive-select/responsive-select.test.d.ts.map +1 -0
- package/dist/types/social-links/index.d.ts +2 -0
- package/dist/types/social-links/index.d.ts.map +1 -0
- package/dist/types/social-links/social-links.d.ts +648 -0
- package/dist/types/social-links/social-links.d.ts.map +1 -0
- package/dist/types/social-links/social-links.test.d.ts +2 -0
- package/dist/types/social-links/social-links.test.d.ts.map +1 -0
- package/dist/types/text-input/index.d.ts +2 -0
- package/dist/types/text-input/index.d.ts.map +1 -0
- package/dist/types/text-input/text-input.d.ts +52 -0
- package/dist/types/text-input/text-input.d.ts.map +1 -0
- package/dist/types/text-input/text-input.test.d.ts +2 -0
- package/dist/types/text-input/text-input.test.d.ts.map +1 -0
- package/dist/types/versioned.d.ts +121 -241
- package/dist/types/versioned.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -49,10 +49,13 @@ __export(src_exports, {
|
|
49
49
|
ResponsiveLengthPropControllerDataV1Type: () => ResponsiveLengthPropControllerDataV1Type,
|
50
50
|
ResponsiveNumber: () => ResponsiveNumber,
|
51
51
|
ResponsiveOpacity: () => ResponsiveOpacity,
|
52
|
+
ResponsiveSelect: () => ResponsiveSelect,
|
52
53
|
Shadows: () => Shadows,
|
54
|
+
SocialLinks: () => SocialLinks,
|
53
55
|
Table: () => Table,
|
54
56
|
TableFormFields: () => TableFormFields,
|
55
57
|
TextArea: () => TextArea,
|
58
|
+
TextInput: () => TextInput,
|
56
59
|
TextStyle: () => TextStyle,
|
57
60
|
Types: () => Types,
|
58
61
|
Video: () => Video,
|
@@ -96,9 +99,11 @@ __export(src_exports, {
|
|
96
99
|
createResponsiveLengthPropControllerDataFromResponsiveLengthData: () => createResponsiveLengthPropControllerDataFromResponsiveLengthData,
|
97
100
|
createResponsiveValueSchema: () => createResponsiveValueSchema,
|
98
101
|
createShadowsPropControllerDataFromResponsiveShadowsData: () => createShadowsPropControllerDataFromResponsiveShadowsData,
|
102
|
+
createSocialLinksPropControllerDataFromSocialLinksData: () => createSocialLinksPropControllerDataFromSocialLinksData,
|
99
103
|
createTableFormFieldsPropControllerDataFromTableFormFieldsData: () => createTableFormFieldsPropControllerDataFromTableFormFieldsData,
|
100
104
|
createTablePropControllerDataFromTableId: () => createTablePropControllerDataFromTableId,
|
101
105
|
createTextAreaPropControllerDataFromString: () => createTextAreaPropControllerDataFromString,
|
106
|
+
createTextInputPropControllerDataFromString: () => createTextInputPropControllerDataFromString,
|
102
107
|
createTextStylePropControllerDataFromResponsiveTextStyleData: () => createTextStylePropControllerDataFromResponsiveTextStyleData,
|
103
108
|
createVideoPropControllerDataFromVideoData: () => createVideoPropControllerDataFromVideoData,
|
104
109
|
createWidthPropControllerDataFromResponsiveLengthData: () => createWidthPropControllerDataFromResponsiveLengthData,
|
@@ -142,10 +147,13 @@ __export(src_exports, {
|
|
142
147
|
getResponsiveLengthPropControllerDataResponsiveLengthData: () => getResponsiveLengthPropControllerDataResponsiveLengthData,
|
143
148
|
getShadowsPropControllerDataResponsiveShadowsData: () => getShadowsPropControllerDataResponsiveShadowsData,
|
144
149
|
getShadowsPropControllerDataSwatchIds: () => getShadowsPropControllerDataSwatchIds,
|
150
|
+
getSocialLinkTypes: () => getSocialLinkTypes,
|
151
|
+
getSocialLinksPropControllerDataSocialLinksData: () => getSocialLinksPropControllerDataSocialLinksData,
|
145
152
|
getTableFormFieldsPropControllerDataTableFormFieldsData: () => getTableFormFieldsPropControllerDataTableFormFieldsData,
|
146
153
|
getTablePropControllerDataTableId: () => getTablePropControllerDataTableId,
|
147
154
|
getTablePropControllerDataTableIds: () => getTablePropControllerDataTableIds,
|
148
155
|
getTextAreaPropControllerDataString: () => getTextAreaPropControllerDataString,
|
156
|
+
getTextInputPropControllerDataString: () => getTextInputPropControllerDataString,
|
149
157
|
getTextStylePropControllerDataResponsiveTextStyleData: () => getTextStylePropControllerDataResponsiveTextStyleData,
|
150
158
|
getVideoPropControllerDataVideoData: () => getVideoPropControllerDataVideoData,
|
151
159
|
getWidthPropControllerDataResponsiveLengthData: () => getWidthPropControllerDataResponsiveLengthData,
|
@@ -169,11 +177,15 @@ __export(src_exports, {
|
|
169
177
|
responsiveLengthPropControllerDataSchema: () => responsiveLengthPropControllerDataSchema,
|
170
178
|
responsiveNumberValueSchema: () => responsiveNumberValueSchema,
|
171
179
|
responsiveOpacityValueSchema: () => responsiveOpacityValueSchema,
|
180
|
+
responsiveSelectValueSchema: () => responsiveSelectValueSchema,
|
172
181
|
shadowsPropControllerDataSchema: () => shadowsPropControllerDataSchema,
|
182
|
+
socialLinksPropControllerDataSchema: () => socialLinksPropControllerDataSchema,
|
173
183
|
tableFormFieldsPropControllerDataSchema: () => tableFormFieldsPropControllerDataSchema,
|
174
184
|
tablePropControllerDataSchema: () => tablePropControllerDataSchema,
|
175
185
|
textAreaPropControllerDataSchema: () => textAreaPropControllerDataSchema,
|
186
|
+
textInputPropControllerDataSchema: () => textInputPropControllerDataSchema,
|
176
187
|
textStylePropControllerDataSchema: () => textStylePropControllerDataSchema,
|
188
|
+
typeArg: () => typeArg,
|
177
189
|
versionedPropDef: () => versionedPropDef,
|
178
190
|
videoPropControllerDataSchema: () => videoPropControllerDataSchema,
|
179
191
|
widthPropControllerDataSchema: () => widthPropControllerDataSchema
|
@@ -208,7 +220,10 @@ var Types = {
|
|
208
220
|
ResponsiveLength: "ResponsiveLength",
|
209
221
|
ResponsiveNumber: "ResponsiveNumber",
|
210
222
|
ResponsiveOpacity: "ResponsiveOpacity",
|
223
|
+
ResponsiveSelect: "ResponsiveSelect",
|
224
|
+
SocialLinks: "SocialLinks",
|
211
225
|
TextArea: "TextArea",
|
226
|
+
TextInput: "TextInput",
|
212
227
|
Table: "Table",
|
213
228
|
TableFormFields: "TableFormFields",
|
214
229
|
TextStyle: "TextStyle",
|
@@ -278,84 +293,101 @@ var imageDataSchema = import_zod2.z.union([imageDataV0Schema, imageDataV1Schema]
|
|
278
293
|
var responsiveNumberValueSchema = createResponsiveValueSchema(
|
279
294
|
import_zod2.z.number()
|
280
295
|
);
|
296
|
+
var responsiveSelectValueSchema = createResponsiveValueSchema(
|
297
|
+
import_zod2.z.string()
|
298
|
+
);
|
281
299
|
|
282
300
|
// src/versioned.ts
|
283
301
|
var import_ts_pattern = require("ts-pattern");
|
284
302
|
var import_zod3 = require("zod");
|
285
|
-
var PropDef = class
|
303
|
+
var PropDef = class {
|
304
|
+
__associated_types__;
|
305
|
+
};
|
306
|
+
var TypeArg = class {
|
286
307
|
__associated_types__;
|
287
|
-
_callable;
|
288
|
-
constructor() {
|
289
|
-
super("...args", "return this._callable.__call__(...args)");
|
290
|
-
this._callable = this.bind(this);
|
291
|
-
return this._callable;
|
292
|
-
}
|
293
308
|
};
|
294
|
-
var
|
309
|
+
var typeArg = () => new TypeArg();
|
310
|
+
var versionedPropDef = (type, valueSchema, discriminator2, _rawOptionsType, _ctor) => {
|
295
311
|
const schemaV0 = valueSchema;
|
296
312
|
const schemaV1 = import_zod3.z.object({
|
297
|
-
[ControlDataTypeKey]: import_zod3.z.literal(
|
313
|
+
[ControlDataTypeKey]: import_zod3.z.literal(discriminator2.dataKey),
|
298
314
|
value: valueSchema
|
299
315
|
});
|
300
316
|
const schema = import_zod3.z.union([schemaV0, schemaV1]);
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
() => ({
|
326
|
-
[ControlDataTypeKey]: discriminator.dataKey,
|
327
|
-
value: data
|
328
|
-
})
|
329
|
-
).otherwise(() => data);
|
330
|
-
}
|
331
|
-
}
|
332
|
-
return new Def();
|
317
|
+
const r = (options) => {
|
318
|
+
return {
|
319
|
+
type,
|
320
|
+
version: discriminator2.version,
|
321
|
+
options: options ?? {}
|
322
|
+
};
|
323
|
+
};
|
324
|
+
r.schema = schema;
|
325
|
+
r.type = type;
|
326
|
+
r.discriminator = discriminator2;
|
327
|
+
r.fromPropData = (propData) => (0, import_ts_pattern.match)(propData).with(
|
328
|
+
{
|
329
|
+
[ControlDataTypeKey]: discriminator2.dataKey
|
330
|
+
},
|
331
|
+
(v1) => v1.value
|
332
|
+
).otherwise((v0) => v0);
|
333
|
+
r.toPropData = (data, descriptor) => (0, import_ts_pattern.match)(descriptor).with(
|
334
|
+
{ version: discriminator2.version },
|
335
|
+
() => ({
|
336
|
+
[ControlDataTypeKey]: discriminator2.dataKey,
|
337
|
+
value: data
|
338
|
+
})
|
339
|
+
).otherwise(() => data);
|
340
|
+
return r;
|
333
341
|
};
|
334
342
|
|
335
343
|
// src/gap-x/gap-x.ts
|
336
|
-
var GapX = versionedPropDef(
|
337
|
-
|
338
|
-
|
339
|
-
|
344
|
+
var GapX = versionedPropDef(
|
345
|
+
Types.GapX,
|
346
|
+
responsiveGapDataSchema,
|
347
|
+
{
|
348
|
+
version: 1,
|
349
|
+
dataKey: "prop-controllers::gap-x::v1"
|
350
|
+
},
|
351
|
+
typeArg()
|
352
|
+
);
|
340
353
|
|
341
354
|
// src/responsive-number/responsive-number.ts
|
342
|
-
var ResponsiveNumber = versionedPropDef(
|
343
|
-
|
344
|
-
|
345
|
-
|
355
|
+
var ResponsiveNumber = versionedPropDef(
|
356
|
+
Types.ResponsiveNumber,
|
357
|
+
responsiveNumberValueSchema,
|
358
|
+
{
|
359
|
+
version: 1,
|
360
|
+
dataKey: "prop-controllers::responsive-number::v1"
|
361
|
+
},
|
362
|
+
typeArg()
|
363
|
+
);
|
346
364
|
|
347
365
|
// src/responsive-opacity/responsive-opacity.ts
|
348
366
|
var import_zod4 = require("zod");
|
349
367
|
var responsiveOpacityValueSchema = createResponsiveValueSchema(
|
350
368
|
import_zod4.z.number()
|
351
369
|
);
|
352
|
-
var ResponsiveOpacity = versionedPropDef(
|
370
|
+
var ResponsiveOpacity = versionedPropDef(
|
353
371
|
Types.ResponsiveOpacity,
|
354
372
|
responsiveOpacityValueSchema,
|
355
373
|
{
|
356
374
|
version: 1,
|
357
375
|
dataKey: "prop-controllers::responsive-opacity::v1"
|
358
|
-
}
|
376
|
+
},
|
377
|
+
typeArg()
|
378
|
+
);
|
379
|
+
|
380
|
+
// src/responsive-select/responsive-select.ts
|
381
|
+
var discriminator = {
|
382
|
+
version: 1,
|
383
|
+
dataKey: "prop-controllers::responsive-select::v1"
|
384
|
+
};
|
385
|
+
var ResponsiveSelect = versionedPropDef(
|
386
|
+
Types.ResponsiveSelect,
|
387
|
+
responsiveSelectValueSchema,
|
388
|
+
discriminator,
|
389
|
+
typeArg(),
|
390
|
+
typeArg()
|
359
391
|
);
|
360
392
|
|
361
393
|
// src/backgrounds/backgrounds.ts
|
@@ -1820,31 +1852,120 @@ function createResponsiveLengthPropControllerDataFromResponsiveLengthData(defini
|
|
1820
1852
|
).otherwise(() => responsiveLengthData);
|
1821
1853
|
}
|
1822
1854
|
|
1823
|
-
// src/
|
1824
|
-
var import_ts_pattern21 = require("ts-pattern");
|
1855
|
+
// src/social-links/social-links.ts
|
1825
1856
|
var import_zod24 = require("zod");
|
1826
|
-
var
|
1857
|
+
var import_ts_pattern21 = require("ts-pattern");
|
1858
|
+
var socialLinkTypesV0 = [
|
1859
|
+
"angellist",
|
1860
|
+
"codepen",
|
1861
|
+
"discord",
|
1862
|
+
"dribbble",
|
1863
|
+
"facebook",
|
1864
|
+
"github",
|
1865
|
+
"instagram",
|
1866
|
+
"linkedin",
|
1867
|
+
"medium",
|
1868
|
+
"pinterest",
|
1869
|
+
"reddit",
|
1870
|
+
"rss",
|
1871
|
+
"snapchat",
|
1872
|
+
"soundcloud",
|
1873
|
+
"spotify",
|
1874
|
+
"telegram",
|
1875
|
+
"tumblr",
|
1876
|
+
"twitch",
|
1877
|
+
"twitter",
|
1878
|
+
"vimeo",
|
1879
|
+
"whatsapp",
|
1880
|
+
"yelp",
|
1881
|
+
"youtube"
|
1882
|
+
];
|
1883
|
+
var socialLinkTypesV1 = [...socialLinkTypesV0, "x", "slack"];
|
1884
|
+
var socialLinkV0Schema = import_zod24.z.object({
|
1885
|
+
type: import_zod24.z.enum(socialLinkTypesV0),
|
1886
|
+
url: import_zod24.z.string()
|
1887
|
+
});
|
1888
|
+
var socialLinkV1Schema = import_zod24.z.object({
|
1889
|
+
type: import_zod24.z.enum(socialLinkTypesV1),
|
1890
|
+
url: import_zod24.z.string()
|
1891
|
+
});
|
1892
|
+
var socialLinksLinkV0Schema = import_zod24.z.object({
|
1893
|
+
id: import_zod24.z.string(),
|
1894
|
+
payload: socialLinkV0Schema
|
1895
|
+
});
|
1896
|
+
var socialLinksLinkV1Schema = import_zod24.z.object({
|
1897
|
+
id: import_zod24.z.string(),
|
1898
|
+
payload: socialLinkV1Schema
|
1899
|
+
});
|
1900
|
+
var socialLinksDataV0Schema = import_zod24.z.object({
|
1901
|
+
links: import_zod24.z.array(socialLinksLinkV0Schema),
|
1902
|
+
openInNewTab: import_zod24.z.boolean()
|
1903
|
+
});
|
1904
|
+
var socialLinksDataV1Schema = import_zod24.z.object({
|
1905
|
+
links: import_zod24.z.array(socialLinksLinkV1Schema),
|
1906
|
+
openInNewTab: import_zod24.z.boolean()
|
1907
|
+
});
|
1908
|
+
var socialLinksDataSchema = import_zod24.z.union([
|
1909
|
+
socialLinksDataV0Schema,
|
1910
|
+
socialLinksDataV1Schema
|
1911
|
+
]);
|
1912
|
+
var socialLinksPropControllerDataV1Schema = socialLinksDataSchema;
|
1913
|
+
var SocialLinksPropControllerDataV2Type = "prop-controllers::social-links::v2";
|
1914
|
+
var socialLinksPropControllerDataV2Schema = import_zod24.z.object({
|
1915
|
+
[ControlDataTypeKey]: import_zod24.z.literal(SocialLinksPropControllerDataV2Type),
|
1916
|
+
value: socialLinksDataSchema
|
1917
|
+
});
|
1918
|
+
var socialLinksPropControllerDataSchema = import_zod24.z.union([
|
1919
|
+
socialLinksPropControllerDataV1Schema,
|
1920
|
+
socialLinksPropControllerDataV2Schema
|
1921
|
+
]);
|
1922
|
+
function SocialLinks(options = {}) {
|
1923
|
+
return { type: Types.SocialLinks, version: 2, options };
|
1924
|
+
}
|
1925
|
+
function getSocialLinkTypes(descriptor) {
|
1926
|
+
return (0, import_ts_pattern21.match)(descriptor).with({ version: import_ts_pattern21.P.union(1, 2) }, () => socialLinkTypesV1).otherwise(() => socialLinkTypesV0);
|
1927
|
+
}
|
1928
|
+
function getSocialLinksPropControllerDataSocialLinksData(data) {
|
1929
|
+
return (0, import_ts_pattern21.match)(data).with(
|
1930
|
+
{ [ControlDataTypeKey]: SocialLinksPropControllerDataV2Type },
|
1931
|
+
(v2) => v2.value
|
1932
|
+
).otherwise((v0) => v0);
|
1933
|
+
}
|
1934
|
+
function createSocialLinksPropControllerDataFromSocialLinksData(data, definition) {
|
1935
|
+
return (0, import_ts_pattern21.match)(definition).with(
|
1936
|
+
{ version: 2 },
|
1937
|
+
() => ({
|
1938
|
+
[ControlDataTypeKey]: SocialLinksPropControllerDataV2Type,
|
1939
|
+
value: data
|
1940
|
+
})
|
1941
|
+
).otherwise(() => data);
|
1942
|
+
}
|
1943
|
+
|
1944
|
+
// src/shadows.ts
|
1945
|
+
var import_ts_pattern22 = require("ts-pattern");
|
1946
|
+
var import_zod25 = require("zod");
|
1947
|
+
var shadowDataSchema = import_zod25.z.object({
|
1827
1948
|
color: colorDataSchema.nullable().optional(),
|
1828
|
-
blurRadius:
|
1829
|
-
spreadRadius:
|
1830
|
-
offsetX:
|
1831
|
-
offsetY:
|
1832
|
-
inset:
|
1833
|
-
});
|
1834
|
-
var shadowsDataSchema =
|
1835
|
-
|
1836
|
-
id:
|
1949
|
+
blurRadius: import_zod25.z.number().optional(),
|
1950
|
+
spreadRadius: import_zod25.z.number().optional(),
|
1951
|
+
offsetX: import_zod25.z.number().optional(),
|
1952
|
+
offsetY: import_zod25.z.number().optional(),
|
1953
|
+
inset: import_zod25.z.boolean().optional()
|
1954
|
+
});
|
1955
|
+
var shadowsDataSchema = import_zod25.z.array(
|
1956
|
+
import_zod25.z.object({
|
1957
|
+
id: import_zod25.z.string(),
|
1837
1958
|
payload: shadowDataSchema
|
1838
1959
|
})
|
1839
1960
|
);
|
1840
1961
|
var responsiveShadowsDataSchema = createResponsiveValueSchema(shadowsDataSchema);
|
1841
1962
|
var shadowsPropControllerDataV0Schema = responsiveShadowsDataSchema;
|
1842
1963
|
var ShadowsPropControllerDataV1Type = "prop-controllers::shadows::v1";
|
1843
|
-
var shadowsPropControllerDataV1Schema =
|
1844
|
-
[ControlDataTypeKey]:
|
1964
|
+
var shadowsPropControllerDataV1Schema = import_zod25.z.object({
|
1965
|
+
[ControlDataTypeKey]: import_zod25.z.literal(ShadowsPropControllerDataV1Type),
|
1845
1966
|
value: responsiveShadowsDataSchema
|
1846
1967
|
});
|
1847
|
-
var shadowsPropControllerDataSchema =
|
1968
|
+
var shadowsPropControllerDataSchema = import_zod25.z.union([
|
1848
1969
|
shadowsPropControllerDataV0Schema,
|
1849
1970
|
shadowsPropControllerDataV1Schema
|
1850
1971
|
]);
|
@@ -1857,13 +1978,13 @@ function Shadows(options = {}) {
|
|
1857
1978
|
}
|
1858
1979
|
Shadows.Format = ShadowsPropControllerFormat;
|
1859
1980
|
function getShadowsPropControllerDataResponsiveShadowsData(data) {
|
1860
|
-
return (0,
|
1981
|
+
return (0, import_ts_pattern22.match)(data).with(
|
1861
1982
|
{ [ControlDataTypeKey]: ShadowsPropControllerDataV1Type },
|
1862
1983
|
(v1) => v1.value
|
1863
1984
|
).otherwise((v0) => v0);
|
1864
1985
|
}
|
1865
1986
|
function createShadowsPropControllerDataFromResponsiveShadowsData(definition, responsiveShadowsData) {
|
1866
|
-
return (0,
|
1987
|
+
return (0, import_ts_pattern22.match)(definition).with(
|
1867
1988
|
{ version: 1 },
|
1868
1989
|
() => ({
|
1869
1990
|
[ControlDataTypeKey]: ShadowsPropControllerDataV1Type,
|
@@ -1897,7 +2018,7 @@ function copyResponsiveShadowsData(data, context) {
|
|
1897
2018
|
}));
|
1898
2019
|
}
|
1899
2020
|
function copyShadowsPropControllerData(data, context) {
|
1900
|
-
return (0,
|
2021
|
+
return (0, import_ts_pattern22.match)(data).with(void 0, () => void 0).with(
|
1901
2022
|
{ [ControlDataTypeKey]: ShadowsPropControllerDataV1Type },
|
1902
2023
|
(v1) => ({
|
1903
2024
|
[ControlDataTypeKey]: ShadowsPropControllerDataV1Type,
|
@@ -1907,16 +2028,16 @@ function copyShadowsPropControllerData(data, context) {
|
|
1907
2028
|
}
|
1908
2029
|
|
1909
2030
|
// src/table/table.ts
|
1910
|
-
var
|
1911
|
-
var
|
1912
|
-
var tableIdSchema =
|
2031
|
+
var import_zod26 = require("zod");
|
2032
|
+
var import_ts_pattern23 = require("ts-pattern");
|
2033
|
+
var tableIdSchema = import_zod26.z.string();
|
1913
2034
|
var tablePropControllerDataV0Schema = tableIdSchema;
|
1914
2035
|
var TablePropControllerDataV1Type = "prop-controllers::table::v1";
|
1915
|
-
var tablePropControllerDataV1Schema =
|
1916
|
-
[ControlDataTypeKey]:
|
2036
|
+
var tablePropControllerDataV1Schema = import_zod26.z.object({
|
2037
|
+
[ControlDataTypeKey]: import_zod26.z.literal(TablePropControllerDataV1Type),
|
1917
2038
|
value: tableIdSchema
|
1918
2039
|
});
|
1919
|
-
var tablePropControllerDataSchema =
|
2040
|
+
var tablePropControllerDataSchema = import_zod26.z.union([
|
1920
2041
|
tablePropControllerDataV0Schema,
|
1921
2042
|
tablePropControllerDataV1Schema
|
1922
2043
|
]);
|
@@ -1924,15 +2045,15 @@ function Table(options = {}) {
|
|
1924
2045
|
return { type: Types.Table, version: 1, options };
|
1925
2046
|
}
|
1926
2047
|
function getTablePropControllerDataTableId(data) {
|
1927
|
-
return (0,
|
2048
|
+
return (0, import_ts_pattern23.match)(data).with(
|
1928
2049
|
{ [ControlDataTypeKey]: TablePropControllerDataV1Type },
|
1929
2050
|
(v1) => v1.value
|
1930
2051
|
).otherwise((v0) => v0);
|
1931
2052
|
}
|
1932
2053
|
function createTablePropControllerDataFromTableId(value, definition) {
|
1933
|
-
return (0,
|
2054
|
+
return (0, import_ts_pattern23.match)(definition).with(
|
1934
2055
|
{ version: 1 },
|
1935
|
-
|
2056
|
+
import_ts_pattern23.P.nullish,
|
1936
2057
|
() => ({
|
1937
2058
|
[ControlDataTypeKey]: TablePropControllerDataV1Type,
|
1938
2059
|
value
|
@@ -1945,7 +2066,7 @@ function copyTableId(data, context) {
|
|
1945
2066
|
return context.replacementContext.tableIds.get(data) ?? data;
|
1946
2067
|
}
|
1947
2068
|
function copyTablePropControllerData(data, context) {
|
1948
|
-
return (0,
|
2069
|
+
return (0, import_ts_pattern23.match)(data).with(void 0, () => void 0).with(
|
1949
2070
|
{ [ControlDataTypeKey]: TablePropControllerDataV1Type },
|
1950
2071
|
(v1) => ({
|
1951
2072
|
[ControlDataTypeKey]: TablePropControllerDataV1Type,
|
@@ -1959,36 +2080,36 @@ function getTablePropControllerDataTableIds(data) {
|
|
1959
2080
|
}
|
1960
2081
|
|
1961
2082
|
// src/table-form-fields/table-form-fields.ts
|
1962
|
-
var
|
1963
|
-
var
|
1964
|
-
var tableFormFieldSchema =
|
1965
|
-
id:
|
1966
|
-
tableColumnId:
|
1967
|
-
label:
|
1968
|
-
placeholder:
|
1969
|
-
defaultValue:
|
1970
|
-
required:
|
1971
|
-
hidden:
|
1972
|
-
type:
|
1973
|
-
hideLabel:
|
1974
|
-
autofill:
|
1975
|
-
});
|
1976
|
-
var tableFormFieldsDataSchema =
|
1977
|
-
fields:
|
2083
|
+
var import_zod27 = require("zod");
|
2084
|
+
var import_ts_pattern24 = require("ts-pattern");
|
2085
|
+
var tableFormFieldSchema = import_zod27.z.object({
|
2086
|
+
id: import_zod27.z.string(),
|
2087
|
+
tableColumnId: import_zod27.z.string(),
|
2088
|
+
label: import_zod27.z.string().optional(),
|
2089
|
+
placeholder: import_zod27.z.string().optional(),
|
2090
|
+
defaultValue: import_zod27.z.union([import_zod27.z.string(), import_zod27.z.boolean(), import_zod27.z.array(import_zod27.z.string())]).optional(),
|
2091
|
+
required: import_zod27.z.boolean().optional(),
|
2092
|
+
hidden: import_zod27.z.boolean().optional(),
|
2093
|
+
type: import_zod27.z.union([import_zod27.z.literal("select"), import_zod27.z.literal("radio")]).optional(),
|
2094
|
+
hideLabel: import_zod27.z.boolean().optional(),
|
2095
|
+
autofill: import_zod27.z.boolean().optional()
|
2096
|
+
});
|
2097
|
+
var tableFormFieldsDataSchema = import_zod27.z.object({
|
2098
|
+
fields: import_zod27.z.array(tableFormFieldSchema),
|
1978
2099
|
grid: createResponsiveValueSchema(
|
1979
|
-
|
1980
|
-
count:
|
1981
|
-
spans:
|
2100
|
+
import_zod27.z.object({
|
2101
|
+
count: import_zod27.z.number(),
|
2102
|
+
spans: import_zod27.z.array(import_zod27.z.array(import_zod27.z.number()))
|
1982
2103
|
})
|
1983
2104
|
)
|
1984
2105
|
});
|
1985
2106
|
var tableFormFieldsPropControllerDataV0Schema = tableFormFieldsDataSchema;
|
1986
2107
|
var TableFormFieldsPropControllerDataV1Type = "prop-controllers::table-form-fields::v1";
|
1987
|
-
var tableFormFieldsPropControllerDataV1Schema =
|
1988
|
-
[ControlDataTypeKey]:
|
2108
|
+
var tableFormFieldsPropControllerDataV1Schema = import_zod27.z.object({
|
2109
|
+
[ControlDataTypeKey]: import_zod27.z.literal(TableFormFieldsPropControllerDataV1Type),
|
1989
2110
|
value: tableFormFieldsDataSchema
|
1990
2111
|
});
|
1991
|
-
var tableFormFieldsPropControllerDataSchema =
|
2112
|
+
var tableFormFieldsPropControllerDataSchema = import_zod27.z.union([
|
1992
2113
|
tableFormFieldsPropControllerDataV0Schema,
|
1993
2114
|
tableFormFieldsPropControllerDataV1Schema
|
1994
2115
|
]);
|
@@ -1996,15 +2117,15 @@ function TableFormFields(options = {}) {
|
|
1996
2117
|
return { type: Types.TableFormFields, version: 1, options };
|
1997
2118
|
}
|
1998
2119
|
function getTableFormFieldsPropControllerDataTableFormFieldsData(data) {
|
1999
|
-
return (0,
|
2120
|
+
return (0, import_ts_pattern24.match)(data).with(
|
2000
2121
|
{ [ControlDataTypeKey]: TableFormFieldsPropControllerDataV1Type },
|
2001
2122
|
(v1) => v1.value
|
2002
2123
|
).otherwise((v0) => v0);
|
2003
2124
|
}
|
2004
2125
|
function createTableFormFieldsPropControllerDataFromTableFormFieldsData(value, definition) {
|
2005
|
-
return (0,
|
2126
|
+
return (0, import_ts_pattern24.match)(definition).with(
|
2006
2127
|
{ version: 1 },
|
2007
|
-
|
2128
|
+
import_ts_pattern24.P.nullish,
|
2008
2129
|
() => ({
|
2009
2130
|
[ControlDataTypeKey]: TableFormFieldsPropControllerDataV1Type,
|
2010
2131
|
value
|
@@ -2023,7 +2144,7 @@ function copyTableFormFieldsData(data, context) {
|
|
2023
2144
|
};
|
2024
2145
|
}
|
2025
2146
|
function copyTableFormFieldsPropControllerData(data, context) {
|
2026
|
-
return (0,
|
2147
|
+
return (0, import_ts_pattern24.match)(data).with(void 0, () => void 0).with(
|
2027
2148
|
{ [ControlDataTypeKey]: TableFormFieldsPropControllerDataV1Type },
|
2028
2149
|
(v1) => ({
|
2029
2150
|
[ControlDataTypeKey]: TableFormFieldsPropControllerDataV1Type,
|
@@ -2033,15 +2154,15 @@ function copyTableFormFieldsPropControllerData(data, context) {
|
|
2033
2154
|
}
|
2034
2155
|
|
2035
2156
|
// src/text-area/text-area.ts
|
2036
|
-
var
|
2037
|
-
var
|
2038
|
-
var textAreaPropControllerDataV0Schema =
|
2157
|
+
var import_zod28 = require("zod");
|
2158
|
+
var import_ts_pattern25 = require("ts-pattern");
|
2159
|
+
var textAreaPropControllerDataV0Schema = import_zod28.z.string();
|
2039
2160
|
var TextAreaPropControllerDataV1Type = "prop-controllers::text-area::v1";
|
2040
|
-
var textAreaPropControllerDataV1Schema =
|
2041
|
-
[ControlDataTypeKey]:
|
2042
|
-
value:
|
2161
|
+
var textAreaPropControllerDataV1Schema = import_zod28.z.object({
|
2162
|
+
[ControlDataTypeKey]: import_zod28.z.literal(TextAreaPropControllerDataV1Type),
|
2163
|
+
value: import_zod28.z.string()
|
2043
2164
|
});
|
2044
|
-
var textAreaPropControllerDataSchema =
|
2165
|
+
var textAreaPropControllerDataSchema = import_zod28.z.union([
|
2045
2166
|
textAreaPropControllerDataV0Schema,
|
2046
2167
|
textAreaPropControllerDataV1Schema
|
2047
2168
|
]);
|
@@ -2049,13 +2170,13 @@ function TextArea(options = {}) {
|
|
2049
2170
|
return { type: Types.TextArea, version: 1, options };
|
2050
2171
|
}
|
2051
2172
|
function getTextAreaPropControllerDataString(data) {
|
2052
|
-
return (0,
|
2173
|
+
return (0, import_ts_pattern25.match)(data).with(
|
2053
2174
|
{ [ControlDataTypeKey]: TextAreaPropControllerDataV1Type },
|
2054
2175
|
(v1) => v1.value
|
2055
2176
|
).otherwise((v0) => v0);
|
2056
2177
|
}
|
2057
2178
|
function createTextAreaPropControllerDataFromString(value, definition) {
|
2058
|
-
return (0,
|
2179
|
+
return (0, import_ts_pattern25.match)(definition).with(
|
2059
2180
|
{ version: 1 },
|
2060
2181
|
() => ({
|
2061
2182
|
[ControlDataTypeKey]: TextAreaPropControllerDataV1Type,
|
@@ -2064,16 +2185,48 @@ function createTextAreaPropControllerDataFromString(value, definition) {
|
|
2064
2185
|
).otherwise(() => value);
|
2065
2186
|
}
|
2066
2187
|
|
2188
|
+
// src/text-input/text-input.ts
|
2189
|
+
var import_zod29 = require("zod");
|
2190
|
+
var import_ts_pattern26 = require("ts-pattern");
|
2191
|
+
var textInputPropControllerDataV0Schema = import_zod29.z.string();
|
2192
|
+
var TextInputPropControllerDataV1Type = "prop-controllers::text-input::v1";
|
2193
|
+
var textInputPropControllerDataV1Schema = import_zod29.z.object({
|
2194
|
+
[ControlDataTypeKey]: import_zod29.z.literal(TextInputPropControllerDataV1Type),
|
2195
|
+
value: import_zod29.z.string()
|
2196
|
+
});
|
2197
|
+
var textInputPropControllerDataSchema = import_zod29.z.union([
|
2198
|
+
textInputPropControllerDataV0Schema,
|
2199
|
+
textInputPropControllerDataV1Schema
|
2200
|
+
]);
|
2201
|
+
function TextInput(options = {}) {
|
2202
|
+
return { type: Types.TextInput, version: 1, options };
|
2203
|
+
}
|
2204
|
+
function getTextInputPropControllerDataString(data) {
|
2205
|
+
return (0, import_ts_pattern26.match)(data).with(
|
2206
|
+
{ [ControlDataTypeKey]: TextInputPropControllerDataV1Type },
|
2207
|
+
(v1) => v1.value
|
2208
|
+
).otherwise((v0) => v0);
|
2209
|
+
}
|
2210
|
+
function createTextInputPropControllerDataFromString(value, definition) {
|
2211
|
+
return (0, import_ts_pattern26.match)(definition).with(
|
2212
|
+
{ version: 1 },
|
2213
|
+
() => ({
|
2214
|
+
[ControlDataTypeKey]: TextInputPropControllerDataV1Type,
|
2215
|
+
value
|
2216
|
+
})
|
2217
|
+
).otherwise(() => value);
|
2218
|
+
}
|
2219
|
+
|
2067
2220
|
// src/width/width.ts
|
2068
|
-
var
|
2069
|
-
var
|
2221
|
+
var import_ts_pattern27 = require("ts-pattern");
|
2222
|
+
var import_zod30 = require("zod");
|
2070
2223
|
var widthPropControllerDataV0Schema = responsiveLengthDataSchema;
|
2071
2224
|
var WidthPropControllerDataV1Type = "prop-controllers::width::v1";
|
2072
|
-
var widthPropControllerDataV1Schema =
|
2073
|
-
[ControlDataTypeKey]:
|
2225
|
+
var widthPropControllerDataV1Schema = import_zod30.z.object({
|
2226
|
+
[ControlDataTypeKey]: import_zod30.z.literal(WidthPropControllerDataV1Type),
|
2074
2227
|
value: responsiveLengthDataSchema
|
2075
2228
|
});
|
2076
|
-
var widthPropControllerDataSchema =
|
2229
|
+
var widthPropControllerDataSchema = import_zod30.z.union([
|
2077
2230
|
widthPropControllerDataV0Schema,
|
2078
2231
|
widthPropControllerDataV1Schema
|
2079
2232
|
]);
|
@@ -2086,15 +2239,15 @@ function Width(options = {}) {
|
|
2086
2239
|
}
|
2087
2240
|
Width.Format = WidthPropControllerFormat;
|
2088
2241
|
function getWidthPropControllerDataResponsiveLengthData(data) {
|
2089
|
-
return (0,
|
2242
|
+
return (0, import_ts_pattern27.match)(data).with(
|
2090
2243
|
{ [ControlDataTypeKey]: WidthPropControllerDataV1Type },
|
2091
2244
|
(v1) => v1.value
|
2092
2245
|
).otherwise((v0) => v0);
|
2093
2246
|
}
|
2094
2247
|
function createWidthPropControllerDataFromResponsiveLengthData(responsiveLengthData, definition) {
|
2095
|
-
return (0,
|
2248
|
+
return (0, import_ts_pattern27.match)(definition).with(
|
2096
2249
|
{ version: 1 },
|
2097
|
-
|
2250
|
+
import_ts_pattern27.P.nullish,
|
2098
2251
|
() => ({
|
2099
2252
|
[ControlDataTypeKey]: WidthPropControllerDataV1Type,
|
2100
2253
|
value: responsiveLengthData
|
@@ -2103,22 +2256,22 @@ function createWidthPropControllerDataFromResponsiveLengthData(responsiveLengthD
|
|
2103
2256
|
}
|
2104
2257
|
|
2105
2258
|
// src/video/video.ts
|
2106
|
-
var
|
2107
|
-
var
|
2108
|
-
var videoDataSchema =
|
2109
|
-
url:
|
2110
|
-
muted:
|
2111
|
-
playing:
|
2112
|
-
loop:
|
2113
|
-
controls:
|
2259
|
+
var import_zod31 = require("zod");
|
2260
|
+
var import_ts_pattern28 = require("ts-pattern");
|
2261
|
+
var videoDataSchema = import_zod31.z.object({
|
2262
|
+
url: import_zod31.z.string().optional(),
|
2263
|
+
muted: import_zod31.z.boolean().optional(),
|
2264
|
+
playing: import_zod31.z.boolean().optional(),
|
2265
|
+
loop: import_zod31.z.boolean().optional(),
|
2266
|
+
controls: import_zod31.z.boolean().optional()
|
2114
2267
|
});
|
2115
2268
|
var videoPropControllerDataV0Schema = videoDataSchema;
|
2116
2269
|
var VideoPropControllerDataV1Type = "prop-controllers::video::v1";
|
2117
|
-
var videoPropControllerDataV1Schema =
|
2118
|
-
[ControlDataTypeKey]:
|
2270
|
+
var videoPropControllerDataV1Schema = import_zod31.z.object({
|
2271
|
+
[ControlDataTypeKey]: import_zod31.z.literal(VideoPropControllerDataV1Type),
|
2119
2272
|
value: videoDataSchema
|
2120
2273
|
});
|
2121
|
-
var videoPropControllerDataSchema =
|
2274
|
+
var videoPropControllerDataSchema = import_zod31.z.union([
|
2122
2275
|
videoPropControllerDataV1Schema,
|
2123
2276
|
videoPropControllerDataV0Schema
|
2124
2277
|
]);
|
@@ -2126,15 +2279,15 @@ function Video(options = {}) {
|
|
2126
2279
|
return { type: Types.Video, version: 1, options };
|
2127
2280
|
}
|
2128
2281
|
function getVideoPropControllerDataVideoData(data) {
|
2129
|
-
return (0,
|
2282
|
+
return (0, import_ts_pattern28.match)(data).with(
|
2130
2283
|
{ [ControlDataTypeKey]: VideoPropControllerDataV1Type },
|
2131
2284
|
(v1) => v1.value
|
2132
2285
|
).otherwise((v0) => v0);
|
2133
2286
|
}
|
2134
2287
|
function createVideoPropControllerDataFromVideoData(value, definition) {
|
2135
|
-
return (0,
|
2288
|
+
return (0, import_ts_pattern28.match)(definition).with(
|
2136
2289
|
{ version: 1 },
|
2137
|
-
|
2290
|
+
import_ts_pattern28.P.nullish,
|
2138
2291
|
() => ({
|
2139
2292
|
[ControlDataTypeKey]: VideoPropControllerDataV1Type,
|
2140
2293
|
value
|
@@ -2172,10 +2325,13 @@ function createVideoPropControllerDataFromVideoData(value, definition) {
|
|
2172
2325
|
ResponsiveLengthPropControllerDataV1Type,
|
2173
2326
|
ResponsiveNumber,
|
2174
2327
|
ResponsiveOpacity,
|
2328
|
+
ResponsiveSelect,
|
2175
2329
|
Shadows,
|
2330
|
+
SocialLinks,
|
2176
2331
|
Table,
|
2177
2332
|
TableFormFields,
|
2178
2333
|
TextArea,
|
2334
|
+
TextInput,
|
2179
2335
|
TextStyle,
|
2180
2336
|
Types,
|
2181
2337
|
Video,
|
@@ -2219,9 +2375,11 @@ function createVideoPropControllerDataFromVideoData(value, definition) {
|
|
2219
2375
|
createResponsiveLengthPropControllerDataFromResponsiveLengthData,
|
2220
2376
|
createResponsiveValueSchema,
|
2221
2377
|
createShadowsPropControllerDataFromResponsiveShadowsData,
|
2378
|
+
createSocialLinksPropControllerDataFromSocialLinksData,
|
2222
2379
|
createTableFormFieldsPropControllerDataFromTableFormFieldsData,
|
2223
2380
|
createTablePropControllerDataFromTableId,
|
2224
2381
|
createTextAreaPropControllerDataFromString,
|
2382
|
+
createTextInputPropControllerDataFromString,
|
2225
2383
|
createTextStylePropControllerDataFromResponsiveTextStyleData,
|
2226
2384
|
createVideoPropControllerDataFromVideoData,
|
2227
2385
|
createWidthPropControllerDataFromResponsiveLengthData,
|
@@ -2265,10 +2423,13 @@ function createVideoPropControllerDataFromVideoData(value, definition) {
|
|
2265
2423
|
getResponsiveLengthPropControllerDataResponsiveLengthData,
|
2266
2424
|
getShadowsPropControllerDataResponsiveShadowsData,
|
2267
2425
|
getShadowsPropControllerDataSwatchIds,
|
2426
|
+
getSocialLinkTypes,
|
2427
|
+
getSocialLinksPropControllerDataSocialLinksData,
|
2268
2428
|
getTableFormFieldsPropControllerDataTableFormFieldsData,
|
2269
2429
|
getTablePropControllerDataTableId,
|
2270
2430
|
getTablePropControllerDataTableIds,
|
2271
2431
|
getTextAreaPropControllerDataString,
|
2432
|
+
getTextInputPropControllerDataString,
|
2272
2433
|
getTextStylePropControllerDataResponsiveTextStyleData,
|
2273
2434
|
getVideoPropControllerDataVideoData,
|
2274
2435
|
getWidthPropControllerDataResponsiveLengthData,
|
@@ -2292,11 +2453,15 @@ function createVideoPropControllerDataFromVideoData(value, definition) {
|
|
2292
2453
|
responsiveLengthPropControllerDataSchema,
|
2293
2454
|
responsiveNumberValueSchema,
|
2294
2455
|
responsiveOpacityValueSchema,
|
2456
|
+
responsiveSelectValueSchema,
|
2295
2457
|
shadowsPropControllerDataSchema,
|
2458
|
+
socialLinksPropControllerDataSchema,
|
2296
2459
|
tableFormFieldsPropControllerDataSchema,
|
2297
2460
|
tablePropControllerDataSchema,
|
2298
2461
|
textAreaPropControllerDataSchema,
|
2462
|
+
textInputPropControllerDataSchema,
|
2299
2463
|
textStylePropControllerDataSchema,
|
2464
|
+
typeArg,
|
2300
2465
|
versionedPropDef,
|
2301
2466
|
videoPropControllerDataSchema,
|
2302
2467
|
widthPropControllerDataSchema
|