@makeswift/prop-controllers 0.4.12-canary.1 → 0.4.13-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,6 +24,7 @@ __export(number_exports, {
24
24
  numberPropControllerDataSchema: () => numberPropControllerDataSchema
25
25
  });
26
26
  module.exports = __toCommonJS(number_exports);
27
+ var import_controls = require("@makeswift/controls");
27
28
  var import_zod = require("zod");
28
29
  var import_prop_controllers = require("./prop-controllers");
29
30
  var import_ts_pattern = require("ts-pattern");
@@ -33,17 +34,22 @@ const numberPropControllerDataV1Schema = import_zod.z.object({
33
34
  [import_prop_controllers.ControlDataTypeKey]: import_zod.z.literal(NumberPropControllerDataV1Type),
34
35
  value: import_zod.z.number()
35
36
  });
37
+ const numberInteropDataSchema = import_zod.z.object({
38
+ [import_prop_controllers.ControlDataTypeKey]: import_zod.z.enum(import_controls.AcceptedNumberDataTypes),
39
+ value: import_zod.z.number()
40
+ });
36
41
  const numberPropControllerDataSchema = import_zod.z.union([
37
42
  numberPropControllerDataV0Schema,
38
- numberPropControllerDataV1Schema
43
+ numberPropControllerDataV1Schema,
44
+ numberInteropDataSchema
39
45
  ]);
40
46
  function Number(options = {}) {
41
47
  return { type: import_prop_controllers.Types.Number, version: 1, options };
42
48
  }
43
49
  function getNumberPropControllerDataNumber(data) {
44
50
  return (0, import_ts_pattern.match)(data).with(
45
- { [import_prop_controllers.ControlDataTypeKey]: NumberPropControllerDataV1Type },
46
- (v1) => v1.value
51
+ { [import_prop_controllers.ControlDataTypeKey]: import_ts_pattern.P.union(...import_controls.AcceptedNumberDataTypes) },
52
+ (versioned) => versioned.value
47
53
  ).otherwise((v0) => v0);
48
54
  }
49
55
  function createNumberPropControllerDataFromNumber(value, definition) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/number.ts"],"sourcesContent":["import { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from './prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst numberPropControllerDataV0Schema = z.number()\n\ntype NumberPropControllerDataV0 = z.infer<\n typeof numberPropControllerDataV0Schema\n>\n\nconst NumberPropControllerDataV1Type = 'prop-controllers::number::v1'\n\nconst numberPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(NumberPropControllerDataV1Type),\n value: z.number(),\n})\n\ntype NumberPropControllerDataV1 = z.infer<\n typeof numberPropControllerDataV1Schema\n>\n\nexport const numberPropControllerDataSchema = z.union([\n numberPropControllerDataV0Schema,\n numberPropControllerDataV1Schema,\n])\n\nexport type NumberPropControllerData = z.infer<\n typeof numberPropControllerDataSchema\n>\n\nexport type NumberOptions = Options<{\n preset?: NumberPropControllerData\n label?: string\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n suffix?: string\n hidden?: boolean\n}>\n\ntype NumberDescriptorV0<_T = NumberPropControllerDataV0> = {\n type: typeof Types.Number\n options: NumberOptions\n}\n\ntype NumberDescriptorV1<_T = NumberPropControllerDataV1> = {\n type: typeof Types.Number\n version: 1\n options: NumberOptions\n}\n\nexport type NumberDescriptor<_T = NumberPropControllerData> =\n | NumberDescriptorV0\n | NumberDescriptorV1\n\nexport type ResolveNumberPropControllerValue<T extends NumberDescriptor> =\n T extends NumberDescriptor ? number | undefined : never\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Number(options: NumberOptions = {}): NumberDescriptorV1 {\n return { type: Types.Number, version: 1, options }\n}\n\nexport function getNumberPropControllerDataNumber(\n data: NumberPropControllerData,\n): number {\n return match(data)\n .with(\n { [ControlDataTypeKey]: NumberPropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createNumberPropControllerDataFromNumber(\n value: number,\n definition?: NumberDescriptor,\n): NumberPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n P.nullish,\n () =>\n ({\n [ControlDataTypeKey]: NumberPropControllerDataV1Type,\n value,\n } as const),\n )\n .otherwise(() => value)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAkB;AAClB,8BAAmD;AACnD,wBAAyB;AAEzB,MAAM,mCAAmC,aAAE,OAAO;AAMlD,MAAM,iCAAiC;AAEvC,MAAM,mCAAmC,aAAE,OAAO;AAAA,EAChD,CAAC,0CAAkB,GAAG,aAAE,QAAQ,8BAA8B;AAAA,EAC9D,OAAO,aAAE,OAAO;AAClB,CAAC;AAMM,MAAM,iCAAiC,aAAE,MAAM;AAAA,EACpD;AAAA,EACA;AACF,CAAC;AAuCM,SAAS,OAAO,UAAyB,CAAC,GAAuB;AACtE,SAAO,EAAE,MAAM,8BAAM,QAAQ,SAAS,GAAG,QAAQ;AACnD;AAEO,SAAS,kCACd,MACQ;AACR,aAAO,yBAAM,IAAI,EACd;AAAA,IACC,EAAE,CAAC,0CAAkB,GAAG,+BAA+B;AAAA,IACvD,CAAC,OAAO,GAAG;AAAA,EACb,EACC,UAAU,CAAC,OAAO,EAAE;AACzB;AAEO,SAAS,yCACd,OACA,YAC0B;AAC1B,aAAO,yBAAM,UAAU,EACpB;AAAA,IACC,EAAE,SAAS,EAAE;AAAA,IACb,oBAAE;AAAA,IACF,OACG;AAAA,MACC,CAAC,0CAAkB,GAAG;AAAA,MACtB;AAAA,IACF;AAAA,EACJ,EACC,UAAU,MAAM,KAAK;AAC1B;","names":[]}
1
+ {"version":3,"sources":["../../src/number.ts"],"sourcesContent":["import { AcceptedNumberDataTypes } from '@makeswift/controls'\nimport { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from './prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst numberPropControllerDataV0Schema = z.number()\n\ntype NumberPropControllerDataV0 = z.infer<\n typeof numberPropControllerDataV0Schema\n>\n\nconst NumberPropControllerDataV1Type = 'prop-controllers::number::v1'\n\nconst numberPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(NumberPropControllerDataV1Type),\n value: z.number(),\n})\n\ntype NumberPropControllerDataV1 = z.infer<\n typeof numberPropControllerDataV1Schema\n>\n\nconst numberInteropDataSchema = z.object({\n [ControlDataTypeKey]: z.enum(AcceptedNumberDataTypes),\n value: z.number(),\n})\n\nexport const numberPropControllerDataSchema = z.union([\n numberPropControllerDataV0Schema,\n numberPropControllerDataV1Schema,\n numberInteropDataSchema,\n])\n\nexport type NumberPropControllerData = z.infer<\n typeof numberPropControllerDataSchema\n>\n\nexport type NumberOptions = Options<{\n preset?: NumberPropControllerData\n label?: string\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n suffix?: string\n hidden?: boolean\n}>\n\ntype NumberDescriptorV0<_T = NumberPropControllerDataV0> = {\n type: typeof Types.Number\n options: NumberOptions\n}\n\ntype NumberDescriptorV1<_T = NumberPropControllerDataV1> = {\n type: typeof Types.Number\n version: 1\n options: NumberOptions\n}\n\nexport type NumberDescriptor<_T = NumberPropControllerData> =\n | NumberDescriptorV0\n | NumberDescriptorV1\n\nexport type ResolveNumberPropControllerValue<T extends NumberDescriptor> =\n T extends NumberDescriptor ? number | undefined : never\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Number(options: NumberOptions = {}): NumberDescriptorV1 {\n return { type: Types.Number, version: 1, options }\n}\n\nexport function getNumberPropControllerDataNumber(\n data: NumberPropControllerData,\n): number {\n return match(data)\n .with(\n { [ControlDataTypeKey]: P.union(...AcceptedNumberDataTypes) },\n (versioned) => versioned.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createNumberPropControllerDataFromNumber(\n value: number,\n definition?: NumberDescriptor,\n): NumberPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n P.nullish,\n () =>\n ({\n [ControlDataTypeKey]: NumberPropControllerDataV1Type,\n value,\n }) as const,\n )\n .otherwise(() => value)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAwC;AACxC,iBAAkB;AAClB,8BAAmD;AACnD,wBAAyB;AAEzB,MAAM,mCAAmC,aAAE,OAAO;AAMlD,MAAM,iCAAiC;AAEvC,MAAM,mCAAmC,aAAE,OAAO;AAAA,EAChD,CAAC,0CAAkB,GAAG,aAAE,QAAQ,8BAA8B;AAAA,EAC9D,OAAO,aAAE,OAAO;AAClB,CAAC;AAMD,MAAM,0BAA0B,aAAE,OAAO;AAAA,EACvC,CAAC,0CAAkB,GAAG,aAAE,KAAK,uCAAuB;AAAA,EACpD,OAAO,aAAE,OAAO;AAClB,CAAC;AAEM,MAAM,iCAAiC,aAAE,MAAM;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAuCM,SAAS,OAAO,UAAyB,CAAC,GAAuB;AACtE,SAAO,EAAE,MAAM,8BAAM,QAAQ,SAAS,GAAG,QAAQ;AACnD;AAEO,SAAS,kCACd,MACQ;AACR,aAAO,yBAAM,IAAI,EACd;AAAA,IACC,EAAE,CAAC,0CAAkB,GAAG,oBAAE,MAAM,GAAG,uCAAuB,EAAE;AAAA,IAC5D,CAAC,cAAc,UAAU;AAAA,EAC3B,EACC,UAAU,CAAC,OAAO,EAAE;AACzB;AAEO,SAAS,yCACd,OACA,YAC0B;AAC1B,aAAO,yBAAM,UAAU,EACpB;AAAA,IACC,EAAE,SAAS,EAAE;AAAA,IACb,oBAAE;AAAA,IACF,OACG;AAAA,MACC,CAAC,0CAAkB,GAAG;AAAA,MACtB;AAAA,IACF;AAAA,EACJ,EACC,UAAU,MAAM,KAAK;AAC1B;","names":[]}
@@ -25,6 +25,7 @@ __export(text_area_exports, {
25
25
  textAreaPropControllerDataSchema: () => textAreaPropControllerDataSchema
26
26
  });
27
27
  module.exports = __toCommonJS(text_area_exports);
28
+ var import_controls = require("@makeswift/controls");
28
29
  var import_zod = require("zod");
29
30
  var import_prop_controllers = require("../prop-controllers");
30
31
  var import_ts_pattern = require("ts-pattern");
@@ -34,17 +35,22 @@ const textAreaPropControllerDataV1Schema = import_zod.z.object({
34
35
  [import_prop_controllers.ControlDataTypeKey]: import_zod.z.literal(TextAreaPropControllerDataV1Type),
35
36
  value: import_zod.z.string()
36
37
  });
38
+ const textAreaInteropDataSchema = import_zod.z.object({
39
+ [import_prop_controllers.ControlDataTypeKey]: import_zod.z.enum(import_controls.AcceptedTextDataTypes),
40
+ value: import_zod.z.string()
41
+ });
37
42
  const textAreaPropControllerDataSchema = import_zod.z.union([
38
43
  textAreaPropControllerDataV0Schema,
39
- textAreaPropControllerDataV1Schema
44
+ textAreaPropControllerDataV1Schema,
45
+ textAreaInteropDataSchema
40
46
  ]);
41
47
  function TextArea(options = {}) {
42
48
  return { type: import_prop_controllers.Types.TextArea, version: 1, options };
43
49
  }
44
50
  function getTextAreaPropControllerDataString(data) {
45
51
  return (0, import_ts_pattern.match)(data).with(
46
- { [import_prop_controllers.ControlDataTypeKey]: TextAreaPropControllerDataV1Type },
47
- (v1) => v1.value
52
+ { [import_prop_controllers.ControlDataTypeKey]: import_ts_pattern.P.union(...import_controls.AcceptedTextDataTypes) },
53
+ (versioned) => versioned.value
48
54
  ).otherwise((v0) => v0);
49
55
  }
50
56
  function createTextAreaPropControllerDataFromString(value, definition) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/text-area/text-area.ts"],"sourcesContent":["import { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { match } from 'ts-pattern'\n\nconst textAreaPropControllerDataV0Schema = z.string()\n\nexport type TextAreaPropControllerDataV0 = z.infer<\n typeof textAreaPropControllerDataV0Schema\n>\n\nexport const TextAreaPropControllerDataV1Type =\n 'prop-controllers::text-area::v1'\n\nconst textAreaPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(TextAreaPropControllerDataV1Type),\n value: z.string(),\n})\n\nexport type TextAreaPropControllerDataV1 = z.infer<\n typeof textAreaPropControllerDataV1Schema\n>\n\nexport const textAreaPropControllerDataSchema = z.union([\n textAreaPropControllerDataV0Schema,\n textAreaPropControllerDataV1Schema,\n])\n\nexport type TextAreaPropControllerData = z.infer<\n typeof textAreaPropControllerDataSchema\n>\n\nexport type TextAreaOptions = Options<{\n preset?: TextAreaPropControllerData\n label?: string\n rows?: number\n}>\n\ntype TextAreaDescriptorV0<_T = TextAreaPropControllerDataV0> = {\n type: typeof Types.TextArea\n options: TextAreaOptions\n}\n\ntype TextAreaDescriptorV1<\n _T = TextAreaPropControllerData,\n U extends TextAreaOptions = TextAreaOptions,\n> = {\n type: typeof Types.TextArea\n version: 1\n options: U\n}\n\nexport type TextAreaDescriptor<_T = TextAreaPropControllerData> =\n | TextAreaDescriptorV0\n | TextAreaDescriptorV1\n\nexport type ResolveTextAreaPropControllerValue<T extends TextAreaDescriptor> =\n T extends TextAreaDescriptor ? string | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function TextArea(options: TextAreaOptions = {}): TextAreaDescriptorV1 {\n return { type: Types.TextArea, version: 1, options }\n}\n\nexport function getTextAreaPropControllerDataString(\n data: TextAreaPropControllerData | undefined,\n): string | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: TextAreaPropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createTextAreaPropControllerDataFromString(\n value: string,\n definition: TextAreaDescriptor,\n): TextAreaPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n () =>\n ({\n [ControlDataTypeKey]: TextAreaPropControllerDataV1Type,\n value,\n } as const),\n )\n .otherwise(() => value)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAkB;AAClB,8BAAmD;AACnD,wBAAsB;AAEtB,MAAM,qCAAqC,aAAE,OAAO;AAM7C,MAAM,mCACX;AAEF,MAAM,qCAAqC,aAAE,OAAO;AAAA,EAClD,CAAC,0CAAkB,GAAG,aAAE,QAAQ,gCAAgC;AAAA,EAChE,OAAO,aAAE,OAAO;AAClB,CAAC;AAMM,MAAM,mCAAmC,aAAE,MAAM;AAAA,EACtD;AAAA,EACA;AACF,CAAC;AAqCM,SAAS,SAAS,UAA2B,CAAC,GAAyB;AAC5E,SAAO,EAAE,MAAM,8BAAM,UAAU,SAAS,GAAG,QAAQ;AACrD;AAEO,SAAS,oCACd,MACoB;AACpB,aAAO,yBAAM,IAAI,EACd;AAAA,IACC,EAAE,CAAC,0CAAkB,GAAG,iCAAiC;AAAA,IACzD,CAAC,OAAO,GAAG;AAAA,EACb,EACC,UAAU,CAAC,OAAO,EAAE;AACzB;AAEO,SAAS,2CACd,OACA,YAC4B;AAC5B,aAAO,yBAAM,UAAU,EACpB;AAAA,IACC,EAAE,SAAS,EAAE;AAAA,IACb,OACG;AAAA,MACC,CAAC,0CAAkB,GAAG;AAAA,MACtB;AAAA,IACF;AAAA,EACJ,EACC,UAAU,MAAM,KAAK;AAC1B;","names":[]}
1
+ {"version":3,"sources":["../../../src/text-area/text-area.ts"],"sourcesContent":["import { AcceptedTextDataTypes } from '@makeswift/controls'\nimport { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst textAreaPropControllerDataV0Schema = z.string()\n\nexport type TextAreaPropControllerDataV0 = z.infer<\n typeof textAreaPropControllerDataV0Schema\n>\n\nexport const TextAreaPropControllerDataV1Type =\n 'prop-controllers::text-area::v1'\n\nconst textAreaPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(TextAreaPropControllerDataV1Type),\n value: z.string(),\n})\n\nexport type TextAreaPropControllerDataV1 = z.infer<\n typeof textAreaPropControllerDataV1Schema\n>\n\nconst textAreaInteropDataSchema = z.object({\n [ControlDataTypeKey]: z.enum(AcceptedTextDataTypes),\n value: z.string(),\n})\n\nexport const textAreaPropControllerDataSchema = z.union([\n textAreaPropControllerDataV0Schema,\n textAreaPropControllerDataV1Schema,\n textAreaInteropDataSchema,\n])\n\nexport type TextAreaPropControllerData = z.infer<\n typeof textAreaPropControllerDataSchema\n>\n\nexport type TextAreaOptions = Options<{\n preset?: TextAreaPropControllerData\n label?: string\n rows?: number\n}>\n\ntype TextAreaDescriptorV0<_T = TextAreaPropControllerDataV0> = {\n type: typeof Types.TextArea\n options: TextAreaOptions\n}\n\ntype TextAreaDescriptorV1<\n _T = TextAreaPropControllerData,\n U extends TextAreaOptions = TextAreaOptions,\n> = {\n type: typeof Types.TextArea\n version: 1\n options: U\n}\n\nexport type TextAreaDescriptor<_T = TextAreaPropControllerData> =\n | TextAreaDescriptorV0\n | TextAreaDescriptorV1\n\nexport type ResolveTextAreaPropControllerValue<T extends TextAreaDescriptor> =\n T extends TextAreaDescriptor ? string | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function TextArea(options: TextAreaOptions = {}): TextAreaDescriptorV1 {\n return { type: Types.TextArea, version: 1, options }\n}\n\nexport function getTextAreaPropControllerDataString(\n data: TextAreaPropControllerData | undefined,\n): string | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: P.union(...AcceptedTextDataTypes) },\n (versioned) => versioned.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createTextAreaPropControllerDataFromString(\n value: string,\n definition: TextAreaDescriptor,\n): TextAreaPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n () =>\n ({\n [ControlDataTypeKey]: TextAreaPropControllerDataV1Type,\n value,\n }) as const,\n )\n .otherwise(() => value)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAsC;AACtC,iBAAkB;AAClB,8BAAmD;AACnD,wBAAyB;AAEzB,MAAM,qCAAqC,aAAE,OAAO;AAM7C,MAAM,mCACX;AAEF,MAAM,qCAAqC,aAAE,OAAO;AAAA,EAClD,CAAC,0CAAkB,GAAG,aAAE,QAAQ,gCAAgC;AAAA,EAChE,OAAO,aAAE,OAAO;AAClB,CAAC;AAMD,MAAM,4BAA4B,aAAE,OAAO;AAAA,EACzC,CAAC,0CAAkB,GAAG,aAAE,KAAK,qCAAqB;AAAA,EAClD,OAAO,aAAE,OAAO;AAClB,CAAC;AAEM,MAAM,mCAAmC,aAAE,MAAM;AAAA,EACtD;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAqCM,SAAS,SAAS,UAA2B,CAAC,GAAyB;AAC5E,SAAO,EAAE,MAAM,8BAAM,UAAU,SAAS,GAAG,QAAQ;AACrD;AAEO,SAAS,oCACd,MACoB;AACpB,aAAO,yBAAM,IAAI,EACd;AAAA,IACC,EAAE,CAAC,0CAAkB,GAAG,oBAAE,MAAM,GAAG,qCAAqB,EAAE;AAAA,IAC1D,CAAC,cAAc,UAAU;AAAA,EAC3B,EACC,UAAU,CAAC,OAAO,EAAE;AACzB;AAEO,SAAS,2CACd,OACA,YAC4B;AAC5B,aAAO,yBAAM,UAAU,EACpB;AAAA,IACC,EAAE,SAAS,EAAE;AAAA,IACb,OACG;AAAA,MACC,CAAC,0CAAkB,GAAG;AAAA,MACtB;AAAA,IACF;AAAA,EACJ,EACC,UAAU,MAAM,KAAK;AAC1B;","names":[]}
@@ -25,6 +25,7 @@ __export(text_input_exports, {
25
25
  textInputPropControllerDataSchema: () => textInputPropControllerDataSchema
26
26
  });
27
27
  module.exports = __toCommonJS(text_input_exports);
28
+ var import_controls = require("@makeswift/controls");
28
29
  var import_zod = require("zod");
29
30
  var import_prop_controllers = require("../prop-controllers");
30
31
  var import_ts_pattern = require("ts-pattern");
@@ -34,17 +35,22 @@ const textInputPropControllerDataV1Schema = import_zod.z.object({
34
35
  [import_prop_controllers.ControlDataTypeKey]: import_zod.z.literal(TextInputPropControllerDataV1Type),
35
36
  value: import_zod.z.string()
36
37
  });
38
+ const textInputInteropDataSchema = import_zod.z.object({
39
+ [import_prop_controllers.ControlDataTypeKey]: import_zod.z.enum(import_controls.AcceptedTextDataTypes),
40
+ value: import_zod.z.string()
41
+ });
37
42
  const textInputPropControllerDataSchema = import_zod.z.union([
38
43
  textInputPropControllerDataV0Schema,
39
- textInputPropControllerDataV1Schema
44
+ textInputPropControllerDataV1Schema,
45
+ textInputInteropDataSchema
40
46
  ]);
41
47
  function TextInput(options = {}) {
42
48
  return { type: import_prop_controllers.Types.TextInput, version: 1, options };
43
49
  }
44
50
  function getTextInputPropControllerDataString(data) {
45
51
  return (0, import_ts_pattern.match)(data).with(
46
- { [import_prop_controllers.ControlDataTypeKey]: TextInputPropControllerDataV1Type },
47
- (v1) => v1.value
52
+ { [import_prop_controllers.ControlDataTypeKey]: import_ts_pattern.P.union(...import_controls.AcceptedTextDataTypes) },
53
+ (versioned) => versioned.value
48
54
  ).otherwise((v0) => v0);
49
55
  }
50
56
  function createTextInputPropControllerDataFromString(value, definition) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/text-input/text-input.ts"],"sourcesContent":["import { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { match } from 'ts-pattern'\n\nconst textInputPropControllerDataV0Schema = z.string()\n\nexport type TextInputPropControllerDataV0 = z.infer<\n typeof textInputPropControllerDataV0Schema\n>\n\nexport const TextInputPropControllerDataV1Type =\n 'prop-controllers::text-input::v1'\n\nconst textInputPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(TextInputPropControllerDataV1Type),\n value: z.string(),\n})\n\nexport type TextInputPropControllerDataV1 = z.infer<\n typeof textInputPropControllerDataV1Schema\n>\n\nexport const textInputPropControllerDataSchema = z.union([\n textInputPropControllerDataV0Schema,\n textInputPropControllerDataV1Schema,\n])\n\nexport type TextInputPropControllerData = z.infer<\n typeof textInputPropControllerDataSchema\n>\n\nexport type TextInputOptions = Options<{\n label?: string\n placeholder?: string\n hidden?: boolean\n}>\n\ntype TextInputDescriptorV0<_T = TextInputPropControllerDataV0> = {\n type: typeof Types.TextInput\n options: TextInputOptions\n}\n\ntype TextInputDescriptorV1<\n _T = TextInputPropControllerData,\n U extends TextInputOptions = TextInputOptions,\n> = {\n type: typeof Types.TextInput\n version: 1\n options: U\n}\n\nexport type TextInputDescriptor<_T = TextInputPropControllerData> =\n | TextInputDescriptorV0\n | TextInputDescriptorV1\n\nexport type ResolveTextInputPropControllerValue<T extends TextInputDescriptor> =\n T extends TextInputDescriptor ? string | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function TextInput(\n options: TextInputOptions = {},\n): TextInputDescriptorV1 {\n return { type: Types.TextInput, version: 1, options }\n}\n\nexport function getTextInputPropControllerDataString(\n data: TextInputPropControllerData | undefined,\n): string | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: TextInputPropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createTextInputPropControllerDataFromString(\n value: string,\n definition: TextInputDescriptor,\n): TextInputPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n () =>\n ({\n [ControlDataTypeKey]: TextInputPropControllerDataV1Type,\n value,\n } as const),\n )\n .otherwise(() => value)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAkB;AAClB,8BAAmD;AACnD,wBAAsB;AAEtB,MAAM,sCAAsC,aAAE,OAAO;AAM9C,MAAM,oCACX;AAEF,MAAM,sCAAsC,aAAE,OAAO;AAAA,EACnD,CAAC,0CAAkB,GAAG,aAAE,QAAQ,iCAAiC;AAAA,EACjE,OAAO,aAAE,OAAO;AAClB,CAAC;AAMM,MAAM,oCAAoC,aAAE,MAAM;AAAA,EACvD;AAAA,EACA;AACF,CAAC;AAqCM,SAAS,UACd,UAA4B,CAAC,GACN;AACvB,SAAO,EAAE,MAAM,8BAAM,WAAW,SAAS,GAAG,QAAQ;AACtD;AAEO,SAAS,qCACd,MACoB;AACpB,aAAO,yBAAM,IAAI,EACd;AAAA,IACC,EAAE,CAAC,0CAAkB,GAAG,kCAAkC;AAAA,IAC1D,CAAC,OAAO,GAAG;AAAA,EACb,EACC,UAAU,CAAC,OAAO,EAAE;AACzB;AAEO,SAAS,4CACd,OACA,YAC6B;AAC7B,aAAO,yBAAM,UAAU,EACpB;AAAA,IACC,EAAE,SAAS,EAAE;AAAA,IACb,OACG;AAAA,MACC,CAAC,0CAAkB,GAAG;AAAA,MACtB;AAAA,IACF;AAAA,EACJ,EACC,UAAU,MAAM,KAAK;AAC1B;","names":[]}
1
+ {"version":3,"sources":["../../../src/text-input/text-input.ts"],"sourcesContent":["import { AcceptedTextDataTypes } from '@makeswift/controls'\nimport { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst textInputPropControllerDataV0Schema = z.string()\n\nexport type TextInputPropControllerDataV0 = z.infer<\n typeof textInputPropControllerDataV0Schema\n>\n\nexport const TextInputPropControllerDataV1Type =\n 'prop-controllers::text-input::v1'\n\nconst textInputPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(TextInputPropControllerDataV1Type),\n value: z.string(),\n})\n\nexport type TextInputPropControllerDataV1 = z.infer<\n typeof textInputPropControllerDataV1Schema\n>\n\nconst textInputInteropDataSchema = z.object({\n [ControlDataTypeKey]: z.enum(AcceptedTextDataTypes),\n value: z.string(),\n})\n\nexport const textInputPropControllerDataSchema = z.union([\n textInputPropControllerDataV0Schema,\n textInputPropControllerDataV1Schema,\n textInputInteropDataSchema,\n])\n\nexport type TextInputPropControllerData = z.infer<\n typeof textInputPropControllerDataSchema\n>\n\nexport type TextInputOptions = Options<{\n label?: string\n placeholder?: string\n hidden?: boolean\n}>\n\ntype TextInputDescriptorV0<_T = TextInputPropControllerDataV0> = {\n type: typeof Types.TextInput\n options: TextInputOptions\n}\n\ntype TextInputDescriptorV1<\n _T = TextInputPropControllerData,\n U extends TextInputOptions = TextInputOptions,\n> = {\n type: typeof Types.TextInput\n version: 1\n options: U\n}\n\nexport type TextInputDescriptor<_T = TextInputPropControllerData> =\n | TextInputDescriptorV0\n | TextInputDescriptorV1\n\nexport type ResolveTextInputPropControllerValue<T extends TextInputDescriptor> =\n T extends TextInputDescriptor ? string | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function TextInput(\n options: TextInputOptions = {},\n): TextInputDescriptorV1 {\n return { type: Types.TextInput, version: 1, options }\n}\n\nexport function getTextInputPropControllerDataString(\n data: TextInputPropControllerData | undefined,\n): string | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: P.union(...AcceptedTextDataTypes) },\n (versioned) => versioned.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createTextInputPropControllerDataFromString(\n value: string,\n definition: TextInputDescriptor,\n): TextInputPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n () =>\n ({\n [ControlDataTypeKey]: TextInputPropControllerDataV1Type,\n value,\n }) as const,\n )\n .otherwise(() => value)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAsC;AACtC,iBAAkB;AAClB,8BAAmD;AACnD,wBAAyB;AAEzB,MAAM,sCAAsC,aAAE,OAAO;AAM9C,MAAM,oCACX;AAEF,MAAM,sCAAsC,aAAE,OAAO;AAAA,EACnD,CAAC,0CAAkB,GAAG,aAAE,QAAQ,iCAAiC;AAAA,EACjE,OAAO,aAAE,OAAO;AAClB,CAAC;AAMD,MAAM,6BAA6B,aAAE,OAAO;AAAA,EAC1C,CAAC,0CAAkB,GAAG,aAAE,KAAK,qCAAqB;AAAA,EAClD,OAAO,aAAE,OAAO;AAClB,CAAC;AAEM,MAAM,oCAAoC,aAAE,MAAM;AAAA,EACvD;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAqCM,SAAS,UACd,UAA4B,CAAC,GACN;AACvB,SAAO,EAAE,MAAM,8BAAM,WAAW,SAAS,GAAG,QAAQ;AACtD;AAEO,SAAS,qCACd,MACoB;AACpB,aAAO,yBAAM,IAAI,EACd;AAAA,IACC,EAAE,CAAC,0CAAkB,GAAG,oBAAE,MAAM,GAAG,qCAAqB,EAAE;AAAA,IAC1D,CAAC,cAAc,UAAU;AAAA,EAC3B,EACC,UAAU,CAAC,OAAO,EAAE;AACzB;AAEO,SAAS,4CACd,OACA,YAC6B;AAC7B,aAAO,yBAAM,UAAU,EACpB;AAAA,IACC,EAAE,SAAS,EAAE;AAAA,IACb,OACG;AAAA,MACC,CAAC,0CAAkB,GAAG;AAAA,MACtB;AAAA,IACF;AAAA,EACJ,EACC,UAAU,MAAM,KAAK;AAC1B;","names":[]}
@@ -1,3 +1,4 @@
1
+ import { AcceptedNumberDataTypes } from "@makeswift/controls";
1
2
  import { z } from "zod";
2
3
  import { ControlDataTypeKey, Types } from "./prop-controllers";
3
4
  import { P, match } from "ts-pattern";
@@ -7,17 +8,22 @@ const numberPropControllerDataV1Schema = z.object({
7
8
  [ControlDataTypeKey]: z.literal(NumberPropControllerDataV1Type),
8
9
  value: z.number()
9
10
  });
11
+ const numberInteropDataSchema = z.object({
12
+ [ControlDataTypeKey]: z.enum(AcceptedNumberDataTypes),
13
+ value: z.number()
14
+ });
10
15
  const numberPropControllerDataSchema = z.union([
11
16
  numberPropControllerDataV0Schema,
12
- numberPropControllerDataV1Schema
17
+ numberPropControllerDataV1Schema,
18
+ numberInteropDataSchema
13
19
  ]);
14
20
  function Number(options = {}) {
15
21
  return { type: Types.Number, version: 1, options };
16
22
  }
17
23
  function getNumberPropControllerDataNumber(data) {
18
24
  return match(data).with(
19
- { [ControlDataTypeKey]: NumberPropControllerDataV1Type },
20
- (v1) => v1.value
25
+ { [ControlDataTypeKey]: P.union(...AcceptedNumberDataTypes) },
26
+ (versioned) => versioned.value
21
27
  ).otherwise((v0) => v0);
22
28
  }
23
29
  function createNumberPropControllerDataFromNumber(value, definition) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/number.ts"],"sourcesContent":["import { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from './prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst numberPropControllerDataV0Schema = z.number()\n\ntype NumberPropControllerDataV0 = z.infer<\n typeof numberPropControllerDataV0Schema\n>\n\nconst NumberPropControllerDataV1Type = 'prop-controllers::number::v1'\n\nconst numberPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(NumberPropControllerDataV1Type),\n value: z.number(),\n})\n\ntype NumberPropControllerDataV1 = z.infer<\n typeof numberPropControllerDataV1Schema\n>\n\nexport const numberPropControllerDataSchema = z.union([\n numberPropControllerDataV0Schema,\n numberPropControllerDataV1Schema,\n])\n\nexport type NumberPropControllerData = z.infer<\n typeof numberPropControllerDataSchema\n>\n\nexport type NumberOptions = Options<{\n preset?: NumberPropControllerData\n label?: string\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n suffix?: string\n hidden?: boolean\n}>\n\ntype NumberDescriptorV0<_T = NumberPropControllerDataV0> = {\n type: typeof Types.Number\n options: NumberOptions\n}\n\ntype NumberDescriptorV1<_T = NumberPropControllerDataV1> = {\n type: typeof Types.Number\n version: 1\n options: NumberOptions\n}\n\nexport type NumberDescriptor<_T = NumberPropControllerData> =\n | NumberDescriptorV0\n | NumberDescriptorV1\n\nexport type ResolveNumberPropControllerValue<T extends NumberDescriptor> =\n T extends NumberDescriptor ? number | undefined : never\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Number(options: NumberOptions = {}): NumberDescriptorV1 {\n return { type: Types.Number, version: 1, options }\n}\n\nexport function getNumberPropControllerDataNumber(\n data: NumberPropControllerData,\n): number {\n return match(data)\n .with(\n { [ControlDataTypeKey]: NumberPropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createNumberPropControllerDataFromNumber(\n value: number,\n definition?: NumberDescriptor,\n): NumberPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n P.nullish,\n () =>\n ({\n [ControlDataTypeKey]: NumberPropControllerDataV1Type,\n value,\n } as const),\n )\n .otherwise(() => value)\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAClB,SAAS,oBAA6B,aAAa;AACnD,SAAS,GAAG,aAAa;AAEzB,MAAM,mCAAmC,EAAE,OAAO;AAMlD,MAAM,iCAAiC;AAEvC,MAAM,mCAAmC,EAAE,OAAO;AAAA,EAChD,CAAC,kBAAkB,GAAG,EAAE,QAAQ,8BAA8B;AAAA,EAC9D,OAAO,EAAE,OAAO;AAClB,CAAC;AAMM,MAAM,iCAAiC,EAAE,MAAM;AAAA,EACpD;AAAA,EACA;AACF,CAAC;AAuCM,SAAS,OAAO,UAAyB,CAAC,GAAuB;AACtE,SAAO,EAAE,MAAM,MAAM,QAAQ,SAAS,GAAG,QAAQ;AACnD;AAEO,SAAS,kCACd,MACQ;AACR,SAAO,MAAM,IAAI,EACd;AAAA,IACC,EAAE,CAAC,kBAAkB,GAAG,+BAA+B;AAAA,IACvD,CAAC,OAAO,GAAG;AAAA,EACb,EACC,UAAU,CAAC,OAAO,EAAE;AACzB;AAEO,SAAS,yCACd,OACA,YAC0B;AAC1B,SAAO,MAAM,UAAU,EACpB;AAAA,IACC,EAAE,SAAS,EAAE;AAAA,IACb,EAAE;AAAA,IACF,OACG;AAAA,MACC,CAAC,kBAAkB,GAAG;AAAA,MACtB;AAAA,IACF;AAAA,EACJ,EACC,UAAU,MAAM,KAAK;AAC1B;","names":[]}
1
+ {"version":3,"sources":["../../src/number.ts"],"sourcesContent":["import { AcceptedNumberDataTypes } from '@makeswift/controls'\nimport { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from './prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst numberPropControllerDataV0Schema = z.number()\n\ntype NumberPropControllerDataV0 = z.infer<\n typeof numberPropControllerDataV0Schema\n>\n\nconst NumberPropControllerDataV1Type = 'prop-controllers::number::v1'\n\nconst numberPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(NumberPropControllerDataV1Type),\n value: z.number(),\n})\n\ntype NumberPropControllerDataV1 = z.infer<\n typeof numberPropControllerDataV1Schema\n>\n\nconst numberInteropDataSchema = z.object({\n [ControlDataTypeKey]: z.enum(AcceptedNumberDataTypes),\n value: z.number(),\n})\n\nexport const numberPropControllerDataSchema = z.union([\n numberPropControllerDataV0Schema,\n numberPropControllerDataV1Schema,\n numberInteropDataSchema,\n])\n\nexport type NumberPropControllerData = z.infer<\n typeof numberPropControllerDataSchema\n>\n\nexport type NumberOptions = Options<{\n preset?: NumberPropControllerData\n label?: string\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n suffix?: string\n hidden?: boolean\n}>\n\ntype NumberDescriptorV0<_T = NumberPropControllerDataV0> = {\n type: typeof Types.Number\n options: NumberOptions\n}\n\ntype NumberDescriptorV1<_T = NumberPropControllerDataV1> = {\n type: typeof Types.Number\n version: 1\n options: NumberOptions\n}\n\nexport type NumberDescriptor<_T = NumberPropControllerData> =\n | NumberDescriptorV0\n | NumberDescriptorV1\n\nexport type ResolveNumberPropControllerValue<T extends NumberDescriptor> =\n T extends NumberDescriptor ? number | undefined : never\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Number(options: NumberOptions = {}): NumberDescriptorV1 {\n return { type: Types.Number, version: 1, options }\n}\n\nexport function getNumberPropControllerDataNumber(\n data: NumberPropControllerData,\n): number {\n return match(data)\n .with(\n { [ControlDataTypeKey]: P.union(...AcceptedNumberDataTypes) },\n (versioned) => versioned.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createNumberPropControllerDataFromNumber(\n value: number,\n definition?: NumberDescriptor,\n): NumberPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n P.nullish,\n () =>\n ({\n [ControlDataTypeKey]: NumberPropControllerDataV1Type,\n value,\n }) as const,\n )\n .otherwise(() => value)\n}\n"],"mappings":"AAAA,SAAS,+BAA+B;AACxC,SAAS,SAAS;AAClB,SAAS,oBAA6B,aAAa;AACnD,SAAS,GAAG,aAAa;AAEzB,MAAM,mCAAmC,EAAE,OAAO;AAMlD,MAAM,iCAAiC;AAEvC,MAAM,mCAAmC,EAAE,OAAO;AAAA,EAChD,CAAC,kBAAkB,GAAG,EAAE,QAAQ,8BAA8B;AAAA,EAC9D,OAAO,EAAE,OAAO;AAClB,CAAC;AAMD,MAAM,0BAA0B,EAAE,OAAO;AAAA,EACvC,CAAC,kBAAkB,GAAG,EAAE,KAAK,uBAAuB;AAAA,EACpD,OAAO,EAAE,OAAO;AAClB,CAAC;AAEM,MAAM,iCAAiC,EAAE,MAAM;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAuCM,SAAS,OAAO,UAAyB,CAAC,GAAuB;AACtE,SAAO,EAAE,MAAM,MAAM,QAAQ,SAAS,GAAG,QAAQ;AACnD;AAEO,SAAS,kCACd,MACQ;AACR,SAAO,MAAM,IAAI,EACd;AAAA,IACC,EAAE,CAAC,kBAAkB,GAAG,EAAE,MAAM,GAAG,uBAAuB,EAAE;AAAA,IAC5D,CAAC,cAAc,UAAU;AAAA,EAC3B,EACC,UAAU,CAAC,OAAO,EAAE;AACzB;AAEO,SAAS,yCACd,OACA,YAC0B;AAC1B,SAAO,MAAM,UAAU,EACpB;AAAA,IACC,EAAE,SAAS,EAAE;AAAA,IACb,EAAE;AAAA,IACF,OACG;AAAA,MACC,CAAC,kBAAkB,GAAG;AAAA,MACtB;AAAA,IACF;AAAA,EACJ,EACC,UAAU,MAAM,KAAK;AAC1B;","names":[]}
@@ -1,23 +1,29 @@
1
+ import { AcceptedTextDataTypes } from "@makeswift/controls";
1
2
  import { z } from "zod";
2
3
  import { ControlDataTypeKey, Types } from "../prop-controllers";
3
- import { match } from "ts-pattern";
4
+ import { P, match } from "ts-pattern";
4
5
  const textAreaPropControllerDataV0Schema = z.string();
5
6
  const TextAreaPropControllerDataV1Type = "prop-controllers::text-area::v1";
6
7
  const textAreaPropControllerDataV1Schema = z.object({
7
8
  [ControlDataTypeKey]: z.literal(TextAreaPropControllerDataV1Type),
8
9
  value: z.string()
9
10
  });
11
+ const textAreaInteropDataSchema = z.object({
12
+ [ControlDataTypeKey]: z.enum(AcceptedTextDataTypes),
13
+ value: z.string()
14
+ });
10
15
  const textAreaPropControllerDataSchema = z.union([
11
16
  textAreaPropControllerDataV0Schema,
12
- textAreaPropControllerDataV1Schema
17
+ textAreaPropControllerDataV1Schema,
18
+ textAreaInteropDataSchema
13
19
  ]);
14
20
  function TextArea(options = {}) {
15
21
  return { type: Types.TextArea, version: 1, options };
16
22
  }
17
23
  function getTextAreaPropControllerDataString(data) {
18
24
  return match(data).with(
19
- { [ControlDataTypeKey]: TextAreaPropControllerDataV1Type },
20
- (v1) => v1.value
25
+ { [ControlDataTypeKey]: P.union(...AcceptedTextDataTypes) },
26
+ (versioned) => versioned.value
21
27
  ).otherwise((v0) => v0);
22
28
  }
23
29
  function createTextAreaPropControllerDataFromString(value, definition) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/text-area/text-area.ts"],"sourcesContent":["import { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { match } from 'ts-pattern'\n\nconst textAreaPropControllerDataV0Schema = z.string()\n\nexport type TextAreaPropControllerDataV0 = z.infer<\n typeof textAreaPropControllerDataV0Schema\n>\n\nexport const TextAreaPropControllerDataV1Type =\n 'prop-controllers::text-area::v1'\n\nconst textAreaPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(TextAreaPropControllerDataV1Type),\n value: z.string(),\n})\n\nexport type TextAreaPropControllerDataV1 = z.infer<\n typeof textAreaPropControllerDataV1Schema\n>\n\nexport const textAreaPropControllerDataSchema = z.union([\n textAreaPropControllerDataV0Schema,\n textAreaPropControllerDataV1Schema,\n])\n\nexport type TextAreaPropControllerData = z.infer<\n typeof textAreaPropControllerDataSchema\n>\n\nexport type TextAreaOptions = Options<{\n preset?: TextAreaPropControllerData\n label?: string\n rows?: number\n}>\n\ntype TextAreaDescriptorV0<_T = TextAreaPropControllerDataV0> = {\n type: typeof Types.TextArea\n options: TextAreaOptions\n}\n\ntype TextAreaDescriptorV1<\n _T = TextAreaPropControllerData,\n U extends TextAreaOptions = TextAreaOptions,\n> = {\n type: typeof Types.TextArea\n version: 1\n options: U\n}\n\nexport type TextAreaDescriptor<_T = TextAreaPropControllerData> =\n | TextAreaDescriptorV0\n | TextAreaDescriptorV1\n\nexport type ResolveTextAreaPropControllerValue<T extends TextAreaDescriptor> =\n T extends TextAreaDescriptor ? string | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function TextArea(options: TextAreaOptions = {}): TextAreaDescriptorV1 {\n return { type: Types.TextArea, version: 1, options }\n}\n\nexport function getTextAreaPropControllerDataString(\n data: TextAreaPropControllerData | undefined,\n): string | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: TextAreaPropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createTextAreaPropControllerDataFromString(\n value: string,\n definition: TextAreaDescriptor,\n): TextAreaPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n () =>\n ({\n [ControlDataTypeKey]: TextAreaPropControllerDataV1Type,\n value,\n } as const),\n )\n .otherwise(() => value)\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAClB,SAAS,oBAA6B,aAAa;AACnD,SAAS,aAAa;AAEtB,MAAM,qCAAqC,EAAE,OAAO;AAM7C,MAAM,mCACX;AAEF,MAAM,qCAAqC,EAAE,OAAO;AAAA,EAClD,CAAC,kBAAkB,GAAG,EAAE,QAAQ,gCAAgC;AAAA,EAChE,OAAO,EAAE,OAAO;AAClB,CAAC;AAMM,MAAM,mCAAmC,EAAE,MAAM;AAAA,EACtD;AAAA,EACA;AACF,CAAC;AAqCM,SAAS,SAAS,UAA2B,CAAC,GAAyB;AAC5E,SAAO,EAAE,MAAM,MAAM,UAAU,SAAS,GAAG,QAAQ;AACrD;AAEO,SAAS,oCACd,MACoB;AACpB,SAAO,MAAM,IAAI,EACd;AAAA,IACC,EAAE,CAAC,kBAAkB,GAAG,iCAAiC;AAAA,IACzD,CAAC,OAAO,GAAG;AAAA,EACb,EACC,UAAU,CAAC,OAAO,EAAE;AACzB;AAEO,SAAS,2CACd,OACA,YAC4B;AAC5B,SAAO,MAAM,UAAU,EACpB;AAAA,IACC,EAAE,SAAS,EAAE;AAAA,IACb,OACG;AAAA,MACC,CAAC,kBAAkB,GAAG;AAAA,MACtB;AAAA,IACF;AAAA,EACJ,EACC,UAAU,MAAM,KAAK;AAC1B;","names":[]}
1
+ {"version":3,"sources":["../../../src/text-area/text-area.ts"],"sourcesContent":["import { AcceptedTextDataTypes } from '@makeswift/controls'\nimport { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst textAreaPropControllerDataV0Schema = z.string()\n\nexport type TextAreaPropControllerDataV0 = z.infer<\n typeof textAreaPropControllerDataV0Schema\n>\n\nexport const TextAreaPropControllerDataV1Type =\n 'prop-controllers::text-area::v1'\n\nconst textAreaPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(TextAreaPropControllerDataV1Type),\n value: z.string(),\n})\n\nexport type TextAreaPropControllerDataV1 = z.infer<\n typeof textAreaPropControllerDataV1Schema\n>\n\nconst textAreaInteropDataSchema = z.object({\n [ControlDataTypeKey]: z.enum(AcceptedTextDataTypes),\n value: z.string(),\n})\n\nexport const textAreaPropControllerDataSchema = z.union([\n textAreaPropControllerDataV0Schema,\n textAreaPropControllerDataV1Schema,\n textAreaInteropDataSchema,\n])\n\nexport type TextAreaPropControllerData = z.infer<\n typeof textAreaPropControllerDataSchema\n>\n\nexport type TextAreaOptions = Options<{\n preset?: TextAreaPropControllerData\n label?: string\n rows?: number\n}>\n\ntype TextAreaDescriptorV0<_T = TextAreaPropControllerDataV0> = {\n type: typeof Types.TextArea\n options: TextAreaOptions\n}\n\ntype TextAreaDescriptorV1<\n _T = TextAreaPropControllerData,\n U extends TextAreaOptions = TextAreaOptions,\n> = {\n type: typeof Types.TextArea\n version: 1\n options: U\n}\n\nexport type TextAreaDescriptor<_T = TextAreaPropControllerData> =\n | TextAreaDescriptorV0\n | TextAreaDescriptorV1\n\nexport type ResolveTextAreaPropControllerValue<T extends TextAreaDescriptor> =\n T extends TextAreaDescriptor ? string | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function TextArea(options: TextAreaOptions = {}): TextAreaDescriptorV1 {\n return { type: Types.TextArea, version: 1, options }\n}\n\nexport function getTextAreaPropControllerDataString(\n data: TextAreaPropControllerData | undefined,\n): string | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: P.union(...AcceptedTextDataTypes) },\n (versioned) => versioned.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createTextAreaPropControllerDataFromString(\n value: string,\n definition: TextAreaDescriptor,\n): TextAreaPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n () =>\n ({\n [ControlDataTypeKey]: TextAreaPropControllerDataV1Type,\n value,\n }) as const,\n )\n .otherwise(() => value)\n}\n"],"mappings":"AAAA,SAAS,6BAA6B;AACtC,SAAS,SAAS;AAClB,SAAS,oBAA6B,aAAa;AACnD,SAAS,GAAG,aAAa;AAEzB,MAAM,qCAAqC,EAAE,OAAO;AAM7C,MAAM,mCACX;AAEF,MAAM,qCAAqC,EAAE,OAAO;AAAA,EAClD,CAAC,kBAAkB,GAAG,EAAE,QAAQ,gCAAgC;AAAA,EAChE,OAAO,EAAE,OAAO;AAClB,CAAC;AAMD,MAAM,4BAA4B,EAAE,OAAO;AAAA,EACzC,CAAC,kBAAkB,GAAG,EAAE,KAAK,qBAAqB;AAAA,EAClD,OAAO,EAAE,OAAO;AAClB,CAAC;AAEM,MAAM,mCAAmC,EAAE,MAAM;AAAA,EACtD;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAqCM,SAAS,SAAS,UAA2B,CAAC,GAAyB;AAC5E,SAAO,EAAE,MAAM,MAAM,UAAU,SAAS,GAAG,QAAQ;AACrD;AAEO,SAAS,oCACd,MACoB;AACpB,SAAO,MAAM,IAAI,EACd;AAAA,IACC,EAAE,CAAC,kBAAkB,GAAG,EAAE,MAAM,GAAG,qBAAqB,EAAE;AAAA,IAC1D,CAAC,cAAc,UAAU;AAAA,EAC3B,EACC,UAAU,CAAC,OAAO,EAAE;AACzB;AAEO,SAAS,2CACd,OACA,YAC4B;AAC5B,SAAO,MAAM,UAAU,EACpB;AAAA,IACC,EAAE,SAAS,EAAE;AAAA,IACb,OACG;AAAA,MACC,CAAC,kBAAkB,GAAG;AAAA,MACtB;AAAA,IACF;AAAA,EACJ,EACC,UAAU,MAAM,KAAK;AAC1B;","names":[]}
@@ -1,23 +1,29 @@
1
+ import { AcceptedTextDataTypes } from "@makeswift/controls";
1
2
  import { z } from "zod";
2
3
  import { ControlDataTypeKey, Types } from "../prop-controllers";
3
- import { match } from "ts-pattern";
4
+ import { P, match } from "ts-pattern";
4
5
  const textInputPropControllerDataV0Schema = z.string();
5
6
  const TextInputPropControllerDataV1Type = "prop-controllers::text-input::v1";
6
7
  const textInputPropControllerDataV1Schema = z.object({
7
8
  [ControlDataTypeKey]: z.literal(TextInputPropControllerDataV1Type),
8
9
  value: z.string()
9
10
  });
11
+ const textInputInteropDataSchema = z.object({
12
+ [ControlDataTypeKey]: z.enum(AcceptedTextDataTypes),
13
+ value: z.string()
14
+ });
10
15
  const textInputPropControllerDataSchema = z.union([
11
16
  textInputPropControllerDataV0Schema,
12
- textInputPropControllerDataV1Schema
17
+ textInputPropControllerDataV1Schema,
18
+ textInputInteropDataSchema
13
19
  ]);
14
20
  function TextInput(options = {}) {
15
21
  return { type: Types.TextInput, version: 1, options };
16
22
  }
17
23
  function getTextInputPropControllerDataString(data) {
18
24
  return match(data).with(
19
- { [ControlDataTypeKey]: TextInputPropControllerDataV1Type },
20
- (v1) => v1.value
25
+ { [ControlDataTypeKey]: P.union(...AcceptedTextDataTypes) },
26
+ (versioned) => versioned.value
21
27
  ).otherwise((v0) => v0);
22
28
  }
23
29
  function createTextInputPropControllerDataFromString(value, definition) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/text-input/text-input.ts"],"sourcesContent":["import { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { match } from 'ts-pattern'\n\nconst textInputPropControllerDataV0Schema = z.string()\n\nexport type TextInputPropControllerDataV0 = z.infer<\n typeof textInputPropControllerDataV0Schema\n>\n\nexport const TextInputPropControllerDataV1Type =\n 'prop-controllers::text-input::v1'\n\nconst textInputPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(TextInputPropControllerDataV1Type),\n value: z.string(),\n})\n\nexport type TextInputPropControllerDataV1 = z.infer<\n typeof textInputPropControllerDataV1Schema\n>\n\nexport const textInputPropControllerDataSchema = z.union([\n textInputPropControllerDataV0Schema,\n textInputPropControllerDataV1Schema,\n])\n\nexport type TextInputPropControllerData = z.infer<\n typeof textInputPropControllerDataSchema\n>\n\nexport type TextInputOptions = Options<{\n label?: string\n placeholder?: string\n hidden?: boolean\n}>\n\ntype TextInputDescriptorV0<_T = TextInputPropControllerDataV0> = {\n type: typeof Types.TextInput\n options: TextInputOptions\n}\n\ntype TextInputDescriptorV1<\n _T = TextInputPropControllerData,\n U extends TextInputOptions = TextInputOptions,\n> = {\n type: typeof Types.TextInput\n version: 1\n options: U\n}\n\nexport type TextInputDescriptor<_T = TextInputPropControllerData> =\n | TextInputDescriptorV0\n | TextInputDescriptorV1\n\nexport type ResolveTextInputPropControllerValue<T extends TextInputDescriptor> =\n T extends TextInputDescriptor ? string | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function TextInput(\n options: TextInputOptions = {},\n): TextInputDescriptorV1 {\n return { type: Types.TextInput, version: 1, options }\n}\n\nexport function getTextInputPropControllerDataString(\n data: TextInputPropControllerData | undefined,\n): string | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: TextInputPropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createTextInputPropControllerDataFromString(\n value: string,\n definition: TextInputDescriptor,\n): TextInputPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n () =>\n ({\n [ControlDataTypeKey]: TextInputPropControllerDataV1Type,\n value,\n } as const),\n )\n .otherwise(() => value)\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAClB,SAAS,oBAA6B,aAAa;AACnD,SAAS,aAAa;AAEtB,MAAM,sCAAsC,EAAE,OAAO;AAM9C,MAAM,oCACX;AAEF,MAAM,sCAAsC,EAAE,OAAO;AAAA,EACnD,CAAC,kBAAkB,GAAG,EAAE,QAAQ,iCAAiC;AAAA,EACjE,OAAO,EAAE,OAAO;AAClB,CAAC;AAMM,MAAM,oCAAoC,EAAE,MAAM;AAAA,EACvD;AAAA,EACA;AACF,CAAC;AAqCM,SAAS,UACd,UAA4B,CAAC,GACN;AACvB,SAAO,EAAE,MAAM,MAAM,WAAW,SAAS,GAAG,QAAQ;AACtD;AAEO,SAAS,qCACd,MACoB;AACpB,SAAO,MAAM,IAAI,EACd;AAAA,IACC,EAAE,CAAC,kBAAkB,GAAG,kCAAkC;AAAA,IAC1D,CAAC,OAAO,GAAG;AAAA,EACb,EACC,UAAU,CAAC,OAAO,EAAE;AACzB;AAEO,SAAS,4CACd,OACA,YAC6B;AAC7B,SAAO,MAAM,UAAU,EACpB;AAAA,IACC,EAAE,SAAS,EAAE;AAAA,IACb,OACG;AAAA,MACC,CAAC,kBAAkB,GAAG;AAAA,MACtB;AAAA,IACF;AAAA,EACJ,EACC,UAAU,MAAM,KAAK;AAC1B;","names":[]}
1
+ {"version":3,"sources":["../../../src/text-input/text-input.ts"],"sourcesContent":["import { AcceptedTextDataTypes } from '@makeswift/controls'\nimport { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst textInputPropControllerDataV0Schema = z.string()\n\nexport type TextInputPropControllerDataV0 = z.infer<\n typeof textInputPropControllerDataV0Schema\n>\n\nexport const TextInputPropControllerDataV1Type =\n 'prop-controllers::text-input::v1'\n\nconst textInputPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(TextInputPropControllerDataV1Type),\n value: z.string(),\n})\n\nexport type TextInputPropControllerDataV1 = z.infer<\n typeof textInputPropControllerDataV1Schema\n>\n\nconst textInputInteropDataSchema = z.object({\n [ControlDataTypeKey]: z.enum(AcceptedTextDataTypes),\n value: z.string(),\n})\n\nexport const textInputPropControllerDataSchema = z.union([\n textInputPropControllerDataV0Schema,\n textInputPropControllerDataV1Schema,\n textInputInteropDataSchema,\n])\n\nexport type TextInputPropControllerData = z.infer<\n typeof textInputPropControllerDataSchema\n>\n\nexport type TextInputOptions = Options<{\n label?: string\n placeholder?: string\n hidden?: boolean\n}>\n\ntype TextInputDescriptorV0<_T = TextInputPropControllerDataV0> = {\n type: typeof Types.TextInput\n options: TextInputOptions\n}\n\ntype TextInputDescriptorV1<\n _T = TextInputPropControllerData,\n U extends TextInputOptions = TextInputOptions,\n> = {\n type: typeof Types.TextInput\n version: 1\n options: U\n}\n\nexport type TextInputDescriptor<_T = TextInputPropControllerData> =\n | TextInputDescriptorV0\n | TextInputDescriptorV1\n\nexport type ResolveTextInputPropControllerValue<T extends TextInputDescriptor> =\n T extends TextInputDescriptor ? string | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function TextInput(\n options: TextInputOptions = {},\n): TextInputDescriptorV1 {\n return { type: Types.TextInput, version: 1, options }\n}\n\nexport function getTextInputPropControllerDataString(\n data: TextInputPropControllerData | undefined,\n): string | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: P.union(...AcceptedTextDataTypes) },\n (versioned) => versioned.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createTextInputPropControllerDataFromString(\n value: string,\n definition: TextInputDescriptor,\n): TextInputPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n () =>\n ({\n [ControlDataTypeKey]: TextInputPropControllerDataV1Type,\n value,\n }) as const,\n )\n .otherwise(() => value)\n}\n"],"mappings":"AAAA,SAAS,6BAA6B;AACtC,SAAS,SAAS;AAClB,SAAS,oBAA6B,aAAa;AACnD,SAAS,GAAG,aAAa;AAEzB,MAAM,sCAAsC,EAAE,OAAO;AAM9C,MAAM,oCACX;AAEF,MAAM,sCAAsC,EAAE,OAAO;AAAA,EACnD,CAAC,kBAAkB,GAAG,EAAE,QAAQ,iCAAiC;AAAA,EACjE,OAAO,EAAE,OAAO;AAClB,CAAC;AAMD,MAAM,6BAA6B,EAAE,OAAO;AAAA,EAC1C,CAAC,kBAAkB,GAAG,EAAE,KAAK,qBAAqB;AAAA,EAClD,OAAO,EAAE,OAAO;AAClB,CAAC;AAEM,MAAM,oCAAoC,EAAE,MAAM;AAAA,EACvD;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAqCM,SAAS,UACd,UAA4B,CAAC,GACN;AACvB,SAAO,EAAE,MAAM,MAAM,WAAW,SAAS,GAAG,QAAQ;AACtD;AAEO,SAAS,qCACd,MACoB;AACpB,SAAO,MAAM,IAAI,EACd;AAAA,IACC,EAAE,CAAC,kBAAkB,GAAG,EAAE,MAAM,GAAG,qBAAqB,EAAE;AAAA,IAC1D,CAAC,cAAc,UAAU;AAAA,EAC3B,EACC,UAAU,CAAC,OAAO,EAAE;AACzB;AAEO,SAAS,4CACd,OACA,YAC6B;AAC7B,SAAO,MAAM,UAAU,EACpB;AAAA,IACC,EAAE,SAAS,EAAE;AAAA,IACb,OACG;AAAA,MACC,CAAC,kBAAkB,GAAG;AAAA,MACtB;AAAA,IACF;AAAA,EACJ,EACC,UAAU,MAAM,KAAK;AAC1B;","names":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interop.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interop.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/interop.test.ts"],"names":[],"mappings":""}
@@ -22,6 +22,15 @@ export declare const numberPropControllerDataSchema: z.ZodUnion<[z.ZodNumber, z.
22
22
  }, {
23
23
  value: number;
24
24
  "@@makeswift/type": "prop-controllers::number::v1";
25
+ }>, z.ZodObject<{
26
+ "@@makeswift/type": z.ZodEnum<["number", "number::v1", "prop-controllers::number::v1"]>;
27
+ value: z.ZodNumber;
28
+ }, "strip", z.ZodTypeAny, {
29
+ value: number;
30
+ "@@makeswift/type": "number" | "prop-controllers::number::v1" | "number::v1";
31
+ }, {
32
+ value: number;
33
+ "@@makeswift/type": "number" | "prop-controllers::number::v1" | "number::v1";
25
34
  }>]>;
26
35
  export type NumberPropControllerData = z.infer<typeof numberPropControllerDataSchema>;
27
36
  export type NumberOptions = Options<{
@@ -1 +1 @@
1
- {"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../src/number.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAsB,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAGvE,QAAA,MAAM,gCAAgC,aAAa,CAAA;AAEnD,KAAK,0BAA0B,GAAG,CAAC,CAAC,KAAK,CACvC,OAAO,gCAAgC,CACxC,CAAA;AAID,QAAA,MAAM,gCAAgC;;;;;;;;;EAGpC,CAAA;AAEF,KAAK,0BAA0B,GAAG,CAAC,CAAC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E,CAAC,CAAA;IACV,OAAO,EAAE,aAAa,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,gBAAgB,CAAC,EAAE,GAAG,wBAAwB,IACtD,kBAAkB,GAClB,kBAAkB,CAAA;AAEtB,MAAM,MAAM,gCAAgC,CAAC,CAAC,SAAS,gBAAgB,IACrE,CAAC,SAAS,gBAAgB,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,CAAA;AAEzD;;;GAGG;AACH,wBAAgB,MAAM,CAAC,OAAO,GAAE,aAAkB,GAAG,kBAAkB,CAEtE;AAED,wBAAgB,iCAAiC,CAC/C,IAAI,EAAE,wBAAwB,GAC7B,MAAM,CAOR;AAED,wBAAgB,wCAAwC,CACtD,KAAK,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,gBAAgB,GAC5B,wBAAwB,CAY1B"}
@@ -23,6 +23,15 @@ export declare const textAreaPropControllerDataSchema: z.ZodUnion<[z.ZodString,
23
23
  }, {
24
24
  value: string;
25
25
  "@@makeswift/type": "prop-controllers::text-area::v1";
26
+ }>, z.ZodObject<{
27
+ "@@makeswift/type": z.ZodEnum<["text", "text-input::v1", "text-area::v1", "prop-controllers::text-input::v1", "prop-controllers::text-area::v1"]>;
28
+ value: z.ZodString;
29
+ }, "strip", z.ZodTypeAny, {
30
+ value: string;
31
+ "@@makeswift/type": "prop-controllers::text-area::v1" | "text" | "text-input::v1" | "text-area::v1" | "prop-controllers::text-input::v1";
32
+ }, {
33
+ value: string;
34
+ "@@makeswift/type": "prop-controllers::text-area::v1" | "text" | "text-input::v1" | "text-area::v1" | "prop-controllers::text-input::v1";
26
35
  }>]>;
27
36
  export type TextAreaPropControllerData = z.infer<typeof textAreaPropControllerDataSchema>;
28
37
  export type TextAreaOptions = Options<{
@@ -1 +1 @@
1
- {"version":3,"file":"text-area.d.ts","sourceRoot":"","sources":["../../../src/text-area/text-area.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAA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,0BAA0B,EAC/B,CAAC,SAAS,eAAe,GAAG,eAAe,IACzC;IACF,IAAI,EAAE,OAAO,KAAK,CAAC,QAAQ,CAAA;IAC3B,OAAO,EAAE,CAAC,CAAA;IACV,OAAO,EAAE,CAAC,CAAA;CACX,CAAA;AAED,MAAM,MAAM,kBAAkB,CAAC,EAAE,GAAG,0BAA0B,IAC1D,oBAAoB,GACpB,oBAAoB,CAAA;AAExB,MAAM,MAAM,kCAAkC,CAAC,CAAC,SAAS,kBAAkB,IACzE,CAAC,SAAS,kBAAkB,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,CAAA;AAE3D;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,OAAO,GAAE,eAAoB,GAAG,oBAAoB,CAE5E;AAED,wBAAgB,mCAAmC,CACjD,IAAI,EAAE,0BAA0B,GAAG,SAAS,GAC3C,MAAM,GAAG,SAAS,CAOpB;AAED,wBAAgB,0CAA0C,CACxD,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,kBAAkB,GAC7B,0BAA0B,CAW5B"}
@@ -23,6 +23,15 @@ export declare const textInputPropControllerDataSchema: z.ZodUnion<[z.ZodString,
23
23
  }, {
24
24
  value: string;
25
25
  "@@makeswift/type": "prop-controllers::text-input::v1";
26
+ }>, z.ZodObject<{
27
+ "@@makeswift/type": z.ZodEnum<["text", "text-input::v1", "text-area::v1", "prop-controllers::text-input::v1", "prop-controllers::text-area::v1"]>;
28
+ value: z.ZodString;
29
+ }, "strip", z.ZodTypeAny, {
30
+ value: string;
31
+ "@@makeswift/type": "prop-controllers::text-area::v1" | "text" | "text-input::v1" | "text-area::v1" | "prop-controllers::text-input::v1";
32
+ }, {
33
+ value: string;
34
+ "@@makeswift/type": "prop-controllers::text-area::v1" | "text" | "text-input::v1" | "text-area::v1" | "prop-controllers::text-input::v1";
26
35
  }>]>;
27
36
  export type TextInputPropControllerData = z.infer<typeof textInputPropControllerDataSchema>;
28
37
  export type TextInputOptions = Options<{
@@ -1 +1 @@
1
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,6BAA6B,IAAI;IAC/D,IAAI,EAAE,OAAO,KAAK,CAAC,SAAS,CAAA;IAC5B,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,KAAK,qBAAqB,CACxB,EAAE,GAAG,2BAA2B,EAChC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,IAC3C;IACF,IAAI,EAAE,OAAO,KAAK,CAAC,SAAS,CAAA;IAC5B,OAAO,EAAE,CAAC,CAAA;IACV,OAAO,EAAE,CAAC,CAAA;CACX,CAAA;AAED,MAAM,MAAM,mBAAmB,CAAC,EAAE,GAAG,2BAA2B,IAC5D,qBAAqB,GACrB,qBAAqB,CAAA;AAEzB,MAAM,MAAM,mCAAmC,CAAC,CAAC,SAAS,mBAAmB,IAC3E,CAAC,SAAS,mBAAmB,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,CAAA;AAE5D;;;GAGG;AACH,wBAAgB,SAAS,CACvB,OAAO,GAAE,gBAAqB,GAC7B,qBAAqB,CAEvB;AAED,wBAAgB,oCAAoC,CAClD,IAAI,EAAE,2BAA2B,GAAG,SAAS,GAC5C,MAAM,GAAG,SAAS,CAOpB;AAED,wBAAgB,2CAA2C,CACzD,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,mBAAmB,GAC9B,2BAA2B,CAW7B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makeswift/prop-controllers",
3
- "version": "0.4.12-canary.1",
3
+ "version": "0.4.13-canary.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "url": "makeswift/makeswift",
@@ -15,7 +15,7 @@
15
15
  "dependencies": {
16
16
  "ts-pattern": "^5.0.8",
17
17
  "zod": "^3.21.4",
18
- "@makeswift/controls": "0.1.18-canary.1"
18
+ "@makeswift/controls": "0.1.19-canary.0"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@swc/jest": "^0.2.36",