@makeswift/prop-controllers 0.3.0-canary.2 → 0.3.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 +95 -50
- package/dist/types/data.d.ts +23 -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 +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/prop-controllers.d.ts +3 -0
- package/dist/types/prop-controllers.d.ts.map +1 -1
- package/dist/types/responsive-icon-radio-group/index.d.ts +2 -0
- package/dist/types/responsive-icon-radio-group/index.d.ts.map +1 -0
- package/dist/types/responsive-icon-radio-group/responsive-icon-radio-group.d.ts +76 -0
- package/dist/types/responsive-icon-radio-group/responsive-icon-radio-group.d.ts.map +1 -0
- package/dist/types/responsive-icon-radio-group/responsive-icon-radio-group.test.d.ts +2 -0
- package/dist/types/responsive-icon-radio-group/responsive-icon-radio-group.test.d.ts.map +1 -0
- 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/versioned.d.ts +121 -241
- package/dist/types/versioned.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -45,10 +45,12 @@ __export(src_exports, {
|
|
45
45
|
PaddingPropControllerFormat: () => PaddingPropControllerFormat,
|
46
46
|
PropDef: () => PropDef,
|
47
47
|
ResponsiveColor: () => ResponsiveColor,
|
48
|
+
ResponsiveIconRadioGroup: () => ResponsiveIconRadioGroup,
|
48
49
|
ResponsiveLength: () => ResponsiveLength,
|
49
50
|
ResponsiveLengthPropControllerDataV1Type: () => ResponsiveLengthPropControllerDataV1Type,
|
50
51
|
ResponsiveNumber: () => ResponsiveNumber,
|
51
52
|
ResponsiveOpacity: () => ResponsiveOpacity,
|
53
|
+
ResponsiveSelect: () => ResponsiveSelect,
|
52
54
|
Shadows: () => Shadows,
|
53
55
|
SocialLinks: () => SocialLinks,
|
54
56
|
Table: () => Table,
|
@@ -173,9 +175,11 @@ __export(src_exports, {
|
|
173
175
|
paddingPropControllerDataSchema: () => paddingPropControllerDataSchema,
|
174
176
|
responsiveColorPropControllerDataSchema: () => responsiveColorPropControllerDataSchema,
|
175
177
|
responsiveGapDataSchema: () => responsiveGapDataSchema,
|
178
|
+
responsiveIconRadioGroupValueSchema: () => responsiveIconRadioGroupValueSchema,
|
176
179
|
responsiveLengthPropControllerDataSchema: () => responsiveLengthPropControllerDataSchema,
|
177
180
|
responsiveNumberValueSchema: () => responsiveNumberValueSchema,
|
178
181
|
responsiveOpacityValueSchema: () => responsiveOpacityValueSchema,
|
182
|
+
responsiveSelectValueSchema: () => responsiveSelectValueSchema,
|
179
183
|
shadowsPropControllerDataSchema: () => shadowsPropControllerDataSchema,
|
180
184
|
socialLinksPropControllerDataSchema: () => socialLinksPropControllerDataSchema,
|
181
185
|
tableFormFieldsPropControllerDataSchema: () => tableFormFieldsPropControllerDataSchema,
|
@@ -183,6 +187,7 @@ __export(src_exports, {
|
|
183
187
|
textAreaPropControllerDataSchema: () => textAreaPropControllerDataSchema,
|
184
188
|
textInputPropControllerDataSchema: () => textInputPropControllerDataSchema,
|
185
189
|
textStylePropControllerDataSchema: () => textStylePropControllerDataSchema,
|
190
|
+
typeArg: () => typeArg,
|
186
191
|
versionedPropDef: () => versionedPropDef,
|
187
192
|
videoPropControllerDataSchema: () => videoPropControllerDataSchema,
|
188
193
|
widthPropControllerDataSchema: () => widthPropControllerDataSchema
|
@@ -214,9 +219,11 @@ var Types = {
|
|
214
219
|
Number: "Number",
|
215
220
|
Shadows: "Shadows",
|
216
221
|
ResponsiveColor: "ResponsiveColor",
|
222
|
+
ResponsiveIconRadioGroup: "ResponsiveIconRadioGroup",
|
217
223
|
ResponsiveLength: "ResponsiveLength",
|
218
224
|
ResponsiveNumber: "ResponsiveNumber",
|
219
225
|
ResponsiveOpacity: "ResponsiveOpacity",
|
226
|
+
ResponsiveSelect: "ResponsiveSelect",
|
220
227
|
SocialLinks: "SocialLinks",
|
221
228
|
TextArea: "TextArea",
|
222
229
|
TextInput: "TextInput",
|
@@ -289,84 +296,117 @@ var imageDataSchema = import_zod2.z.union([imageDataV0Schema, imageDataV1Schema]
|
|
289
296
|
var responsiveNumberValueSchema = createResponsiveValueSchema(
|
290
297
|
import_zod2.z.number()
|
291
298
|
);
|
299
|
+
var responsiveSelectValueSchema = createResponsiveValueSchema(
|
300
|
+
import_zod2.z.string()
|
301
|
+
);
|
302
|
+
var responsiveIconRadioGroupValueSchema = createResponsiveValueSchema(
|
303
|
+
import_zod2.z.string()
|
304
|
+
);
|
292
305
|
|
293
306
|
// src/versioned.ts
|
294
307
|
var import_ts_pattern = require("ts-pattern");
|
295
308
|
var import_zod3 = require("zod");
|
296
|
-
var PropDef = class
|
309
|
+
var PropDef = class {
|
310
|
+
__associated_types__;
|
311
|
+
};
|
312
|
+
var TypeArg = class {
|
297
313
|
__associated_types__;
|
298
|
-
_callable;
|
299
|
-
constructor() {
|
300
|
-
super("...args", "return this._callable.__call__(...args)");
|
301
|
-
this._callable = this.bind(this);
|
302
|
-
return this._callable;
|
303
|
-
}
|
304
314
|
};
|
305
|
-
var
|
315
|
+
var typeArg = () => new TypeArg();
|
316
|
+
var versionedPropDef = (type, valueSchema, discriminator3, _rawOptionsType, _ctor) => {
|
306
317
|
const schemaV0 = valueSchema;
|
307
318
|
const schemaV1 = import_zod3.z.object({
|
308
|
-
[ControlDataTypeKey]: import_zod3.z.literal(
|
319
|
+
[ControlDataTypeKey]: import_zod3.z.literal(discriminator3.dataKey),
|
309
320
|
value: valueSchema
|
310
321
|
});
|
311
322
|
const schema = import_zod3.z.union([schemaV0, schemaV1]);
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
() => ({
|
337
|
-
[ControlDataTypeKey]: discriminator.dataKey,
|
338
|
-
value: data
|
339
|
-
})
|
340
|
-
).otherwise(() => data);
|
341
|
-
}
|
342
|
-
}
|
343
|
-
return new Def();
|
323
|
+
const r = (options) => {
|
324
|
+
return {
|
325
|
+
type,
|
326
|
+
version: discriminator3.version,
|
327
|
+
options: options ?? {}
|
328
|
+
};
|
329
|
+
};
|
330
|
+
r.schema = schema;
|
331
|
+
r.type = type;
|
332
|
+
r.discriminator = discriminator3;
|
333
|
+
r.fromPropData = (propData) => (0, import_ts_pattern.match)(propData).with(
|
334
|
+
{
|
335
|
+
[ControlDataTypeKey]: discriminator3.dataKey
|
336
|
+
},
|
337
|
+
(v1) => v1.value
|
338
|
+
).otherwise((v0) => v0);
|
339
|
+
r.toPropData = (data, descriptor) => (0, import_ts_pattern.match)(descriptor).with(
|
340
|
+
{ version: discriminator3.version },
|
341
|
+
() => ({
|
342
|
+
[ControlDataTypeKey]: discriminator3.dataKey,
|
343
|
+
value: data
|
344
|
+
})
|
345
|
+
).otherwise(() => data);
|
346
|
+
return r;
|
344
347
|
};
|
345
348
|
|
346
349
|
// src/gap-x/gap-x.ts
|
347
|
-
var GapX = versionedPropDef(
|
350
|
+
var GapX = versionedPropDef(
|
351
|
+
Types.GapX,
|
352
|
+
responsiveGapDataSchema,
|
353
|
+
{
|
354
|
+
version: 1,
|
355
|
+
dataKey: "prop-controllers::gap-x::v1"
|
356
|
+
},
|
357
|
+
typeArg()
|
358
|
+
);
|
359
|
+
|
360
|
+
// src/responsive-icon-radio-group/responsive-icon-radio-group.ts
|
361
|
+
var discriminator = {
|
348
362
|
version: 1,
|
349
|
-
dataKey: "prop-controllers::
|
350
|
-
}
|
363
|
+
dataKey: "prop-controllers::responsive-icon-radio-group::v1"
|
364
|
+
};
|
365
|
+
var ResponsiveIconRadioGroup = versionedPropDef(
|
366
|
+
Types.ResponsiveIconRadioGroup,
|
367
|
+
responsiveIconRadioGroupValueSchema,
|
368
|
+
discriminator,
|
369
|
+
typeArg(),
|
370
|
+
typeArg()
|
371
|
+
);
|
351
372
|
|
352
373
|
// src/responsive-number/responsive-number.ts
|
353
|
-
var ResponsiveNumber = versionedPropDef(
|
354
|
-
|
355
|
-
|
356
|
-
|
374
|
+
var ResponsiveNumber = versionedPropDef(
|
375
|
+
Types.ResponsiveNumber,
|
376
|
+
responsiveNumberValueSchema,
|
377
|
+
{
|
378
|
+
version: 1,
|
379
|
+
dataKey: "prop-controllers::responsive-number::v1"
|
380
|
+
},
|
381
|
+
typeArg()
|
382
|
+
);
|
357
383
|
|
358
384
|
// src/responsive-opacity/responsive-opacity.ts
|
359
385
|
var import_zod4 = require("zod");
|
360
386
|
var responsiveOpacityValueSchema = createResponsiveValueSchema(
|
361
387
|
import_zod4.z.number()
|
362
388
|
);
|
363
|
-
var ResponsiveOpacity = versionedPropDef(
|
389
|
+
var ResponsiveOpacity = versionedPropDef(
|
364
390
|
Types.ResponsiveOpacity,
|
365
391
|
responsiveOpacityValueSchema,
|
366
392
|
{
|
367
393
|
version: 1,
|
368
394
|
dataKey: "prop-controllers::responsive-opacity::v1"
|
369
|
-
}
|
395
|
+
},
|
396
|
+
typeArg()
|
397
|
+
);
|
398
|
+
|
399
|
+
// src/responsive-select/responsive-select.ts
|
400
|
+
var discriminator2 = {
|
401
|
+
version: 1,
|
402
|
+
dataKey: "prop-controllers::responsive-select::v1"
|
403
|
+
};
|
404
|
+
var ResponsiveSelect = versionedPropDef(
|
405
|
+
Types.ResponsiveSelect,
|
406
|
+
responsiveSelectValueSchema,
|
407
|
+
discriminator2,
|
408
|
+
typeArg(),
|
409
|
+
typeArg()
|
370
410
|
);
|
371
411
|
|
372
412
|
// src/backgrounds/backgrounds.ts
|
@@ -2300,10 +2340,12 @@ function createVideoPropControllerDataFromVideoData(value, definition) {
|
|
2300
2340
|
PaddingPropControllerFormat,
|
2301
2341
|
PropDef,
|
2302
2342
|
ResponsiveColor,
|
2343
|
+
ResponsiveIconRadioGroup,
|
2303
2344
|
ResponsiveLength,
|
2304
2345
|
ResponsiveLengthPropControllerDataV1Type,
|
2305
2346
|
ResponsiveNumber,
|
2306
2347
|
ResponsiveOpacity,
|
2348
|
+
ResponsiveSelect,
|
2307
2349
|
Shadows,
|
2308
2350
|
SocialLinks,
|
2309
2351
|
Table,
|
@@ -2428,9 +2470,11 @@ function createVideoPropControllerDataFromVideoData(value, definition) {
|
|
2428
2470
|
paddingPropControllerDataSchema,
|
2429
2471
|
responsiveColorPropControllerDataSchema,
|
2430
2472
|
responsiveGapDataSchema,
|
2473
|
+
responsiveIconRadioGroupValueSchema,
|
2431
2474
|
responsiveLengthPropControllerDataSchema,
|
2432
2475
|
responsiveNumberValueSchema,
|
2433
2476
|
responsiveOpacityValueSchema,
|
2477
|
+
responsiveSelectValueSchema,
|
2434
2478
|
shadowsPropControllerDataSchema,
|
2435
2479
|
socialLinksPropControllerDataSchema,
|
2436
2480
|
tableFormFieldsPropControllerDataSchema,
|
@@ -2438,6 +2482,7 @@ function createVideoPropControllerDataFromVideoData(value, definition) {
|
|
2438
2482
|
textAreaPropControllerDataSchema,
|
2439
2483
|
textInputPropControllerDataSchema,
|
2440
2484
|
textStylePropControllerDataSchema,
|
2485
|
+
typeArg,
|
2441
2486
|
versionedPropDef,
|
2442
2487
|
videoPropControllerDataSchema,
|
2443
2488
|
widthPropControllerDataSchema
|
package/dist/types/data.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import { z } from 'zod';
|
2
|
+
import { type ResponsiveValue } from './prop-controllers';
|
2
3
|
export declare const colorDataSchema: z.ZodObject<{
|
3
4
|
swatchId: z.ZodString;
|
4
5
|
alpha: z.ZodNumber;
|
@@ -135,4 +136,26 @@ export declare const responsiveNumberValueSchema: z.ZodArray<z.ZodObject<{
|
|
135
136
|
deviceId: string;
|
136
137
|
}>, "many">;
|
137
138
|
export type ResponsiveNumberValue = z.infer<typeof responsiveNumberValueSchema>;
|
139
|
+
export declare const responsiveSelectValueSchema: z.ZodArray<z.ZodObject<{
|
140
|
+
deviceId: z.ZodString;
|
141
|
+
value: z.ZodString;
|
142
|
+
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
143
|
+
value: string;
|
144
|
+
deviceId: string;
|
145
|
+
}, {
|
146
|
+
value: string;
|
147
|
+
deviceId: string;
|
148
|
+
}>, "many">;
|
149
|
+
export type ResponsiveSelectValue<T extends string = string> = ResponsiveValue<T>;
|
150
|
+
export declare const responsiveIconRadioGroupValueSchema: z.ZodArray<z.ZodObject<{
|
151
|
+
deviceId: z.ZodString;
|
152
|
+
value: z.ZodString;
|
153
|
+
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
154
|
+
value: string;
|
155
|
+
deviceId: string;
|
156
|
+
}, {
|
157
|
+
value: string;
|
158
|
+
deviceId: string;
|
159
|
+
}>, "many">;
|
160
|
+
export type ResponsiveIconRadioGroupValue<T extends string = string> = ResponsiveValue<T>;
|
138
161
|
//# sourceMappingURL=data.d.ts.map
|
package/dist/types/data.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRo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