@makeswift/prop-controllers 0.4.15-canary.0 → 0.4.15-canary.2
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/cjs/checkbox/checkbox.js.map +1 -1
- package/dist/cjs/date/date.js.map +1 -1
- package/dist/cjs/element-id/element-id.js.map +1 -1
- package/dist/cjs/gap-y/gap-y.js.map +1 -1
- package/dist/cjs/social-links/social-links.js.map +1 -1
- package/dist/cjs/video/video.js.map +1 -1
- package/dist/cjs/width/width.js.map +1 -1
- package/dist/esm/checkbox/checkbox.js.map +1 -1
- package/dist/esm/date/date.js.map +1 -1
- package/dist/esm/element-id/element-id.js.map +1 -1
- package/dist/esm/gap-y/gap-y.js.map +1 -1
- package/dist/esm/social-links/social-links.js.map +1 -1
- package/dist/esm/video/video.js.map +1 -1
- package/dist/esm/width/width.js.map +1 -1
- package/dist/types/width/width.d.ts +1 -1
- package/dist/types/width/width.d.ts.map +1 -1
- package/package.json +6 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/checkbox/checkbox.ts"],"sourcesContent":["import { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst checkboxPropControllerDataV0Schema = z.boolean()\n\nexport type CheckboxPropControllerDataV0 = z.infer<\n typeof checkboxPropControllerDataV0Schema\n>\n\nexport const CheckboxPropControllerDataV1Type = 'prop-controllers::checkbox::v1'\n\nconst checkboxPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(CheckboxPropControllerDataV1Type),\n value: z.boolean(),\n})\n\nexport type CheckboxPropControllerDataV1 = z.infer<\n typeof checkboxPropControllerDataV1Schema\n>\n\nexport const checkboxPropControllerDataSchema = z.union([\n checkboxPropControllerDataV0Schema,\n checkboxPropControllerDataV1Schema,\n])\n\nexport type CheckboxPropControllerData = z.infer<\n typeof checkboxPropControllerDataSchema\n>\n\nexport type CheckboxOptions = Options<{\n preset?: CheckboxPropControllerData\n label: string\n hidden?: boolean\n}>\n\ntype CheckboxDescriptorV0<_T = CheckboxPropControllerDataV0> = {\n type: typeof Types.Checkbox\n options: CheckboxOptions\n}\n\ntype CheckboxDescriptorV1<\n _T = CheckboxPropControllerData,\n U extends CheckboxOptions = CheckboxOptions,\n> = {\n type: typeof Types.Checkbox\n version: 1\n options: U\n}\n\nexport type CheckboxDescriptor<_T = CheckboxPropControllerData> =\n | CheckboxDescriptorV0\n | CheckboxDescriptorV1\n\nexport type ResolveCheckboxPropControllerValue<T extends CheckboxDescriptor> =\n T extends CheckboxDescriptor ? boolean | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function Checkbox(options: CheckboxOptions): CheckboxDescriptorV1 {\n return { type: Types.Checkbox, version: 1, options }\n}\n\nexport function getCheckboxPropControllerDataBoolean(\n data: CheckboxPropControllerData | undefined,\n): boolean | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: CheckboxPropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createCheckboxPropControllerDataFromBoolean(\n value: boolean,\n definition?: CheckboxDescriptor,\n): CheckboxPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n P.nullish,\n () =>\n ({\n [ControlDataTypeKey]: CheckboxPropControllerDataV1Type,\n value,\n } as const
|
|
1
|
+
{"version":3,"sources":["../../../src/checkbox/checkbox.ts"],"sourcesContent":["import { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst checkboxPropControllerDataV0Schema = z.boolean()\n\nexport type CheckboxPropControllerDataV0 = z.infer<\n typeof checkboxPropControllerDataV0Schema\n>\n\nexport const CheckboxPropControllerDataV1Type = 'prop-controllers::checkbox::v1'\n\nconst checkboxPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(CheckboxPropControllerDataV1Type),\n value: z.boolean(),\n})\n\nexport type CheckboxPropControllerDataV1 = z.infer<\n typeof checkboxPropControllerDataV1Schema\n>\n\nexport const checkboxPropControllerDataSchema = z.union([\n checkboxPropControllerDataV0Schema,\n checkboxPropControllerDataV1Schema,\n])\n\nexport type CheckboxPropControllerData = z.infer<\n typeof checkboxPropControllerDataSchema\n>\n\nexport type CheckboxOptions = Options<{\n preset?: CheckboxPropControllerData\n label: string\n hidden?: boolean\n}>\n\ntype CheckboxDescriptorV0<_T = CheckboxPropControllerDataV0> = {\n type: typeof Types.Checkbox\n options: CheckboxOptions\n}\n\ntype CheckboxDescriptorV1<\n _T = CheckboxPropControllerData,\n U extends CheckboxOptions = CheckboxOptions,\n> = {\n type: typeof Types.Checkbox\n version: 1\n options: U\n}\n\nexport type CheckboxDescriptor<_T = CheckboxPropControllerData> =\n | CheckboxDescriptorV0\n | CheckboxDescriptorV1\n\nexport type ResolveCheckboxPropControllerValue<T extends CheckboxDescriptor> =\n T extends CheckboxDescriptor ? boolean | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function Checkbox(options: CheckboxOptions): CheckboxDescriptorV1 {\n return { type: Types.Checkbox, version: 1, options }\n}\n\nexport function getCheckboxPropControllerDataBoolean(\n data: CheckboxPropControllerData | undefined,\n): boolean | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: CheckboxPropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createCheckboxPropControllerDataFromBoolean(\n value: boolean,\n definition?: CheckboxDescriptor,\n): CheckboxPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n P.nullish,\n () =>\n ({\n [ControlDataTypeKey]: CheckboxPropControllerDataV1Type,\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,wBAAyB;AAEzB,MAAM,qCAAqC,aAAE,QAAQ;AAM9C,MAAM,mCAAmC;AAEhD,MAAM,qCAAqC,aAAE,OAAO;AAAA,EAClD,CAAC,0CAAkB,GAAG,aAAE,QAAQ,gCAAgC;AAAA,EAChE,OAAO,aAAE,QAAQ;AACnB,CAAC;AAMM,MAAM,mCAAmC,aAAE,MAAM;AAAA,EACtD;AAAA,EACA;AACF,CAAC;AAqCM,SAAS,SAAS,SAAgD;AACvE,SAAO,EAAE,MAAM,8BAAM,UAAU,SAAS,GAAG,QAAQ;AACrD;AAEO,SAAS,qCACd,MACqB;AACrB,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,4CACd,OACA,YAC4B;AAC5B,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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/date/date.ts"],"sourcesContent":["import { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst datePropControllerDataV0Schema = z.string()\n\nexport type DatePropControllerDataV0 = z.infer<\n typeof datePropControllerDataV0Schema\n>\n\nexport const DatePropControllerDataV1Type = 'prop-controllers::date::v1'\n\nconst datePropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(DatePropControllerDataV1Type),\n value: z.string(),\n})\n\nexport type DatePropControllerDataV1 = z.infer<\n typeof datePropControllerDataV1Schema\n>\n\nexport const datePropControllerDataSchema = z.union([\n datePropControllerDataV0Schema,\n datePropControllerDataV1Schema,\n])\n\nexport type DatePropControllerData = z.infer<\n typeof datePropControllerDataSchema\n>\n\nexport type DateOptions = Options<{\n preset?: DatePropControllerData\n}>\n\ntype DateDescriptorV0<_T = DatePropControllerDataV0> = {\n type: typeof Types.Date\n options: DateOptions\n}\n\ntype DateDescriptorV1<\n _T = DatePropControllerData,\n U extends DateOptions = DateOptions,\n> = {\n type: typeof Types.Date\n version: 1\n options: U\n}\n\nexport type DateDescriptor<_T = DatePropControllerData> =\n | DateDescriptorV0\n | DateDescriptorV1\n\nexport type ResolveDatePropControllerValue<T extends DateDescriptor> =\n T extends DateDescriptor ? string | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function Date(options: DateOptions = {}): DateDescriptorV1 {\n return { type: Types.Date, version: 1, options }\n}\n\nexport function getDatePropControllerDataString(\n data: DatePropControllerData | undefined,\n): string | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: DatePropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createDatePropControllerDataFromString(\n value: string,\n definition?: DateDescriptor,\n): DatePropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n P.nullish,\n () =>\n ({\n [ControlDataTypeKey]: DatePropControllerDataV1Type,\n value,\n } as const
|
|
1
|
+
{"version":3,"sources":["../../../src/date/date.ts"],"sourcesContent":["import { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst datePropControllerDataV0Schema = z.string()\n\nexport type DatePropControllerDataV0 = z.infer<\n typeof datePropControllerDataV0Schema\n>\n\nexport const DatePropControllerDataV1Type = 'prop-controllers::date::v1'\n\nconst datePropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(DatePropControllerDataV1Type),\n value: z.string(),\n})\n\nexport type DatePropControllerDataV1 = z.infer<\n typeof datePropControllerDataV1Schema\n>\n\nexport const datePropControllerDataSchema = z.union([\n datePropControllerDataV0Schema,\n datePropControllerDataV1Schema,\n])\n\nexport type DatePropControllerData = z.infer<\n typeof datePropControllerDataSchema\n>\n\nexport type DateOptions = Options<{\n preset?: DatePropControllerData\n}>\n\ntype DateDescriptorV0<_T = DatePropControllerDataV0> = {\n type: typeof Types.Date\n options: DateOptions\n}\n\ntype DateDescriptorV1<\n _T = DatePropControllerData,\n U extends DateOptions = DateOptions,\n> = {\n type: typeof Types.Date\n version: 1\n options: U\n}\n\nexport type DateDescriptor<_T = DatePropControllerData> =\n | DateDescriptorV0\n | DateDescriptorV1\n\nexport type ResolveDatePropControllerValue<T extends DateDescriptor> =\n T extends DateDescriptor ? string | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function Date(options: DateOptions = {}): DateDescriptorV1 {\n return { type: Types.Date, version: 1, options }\n}\n\nexport function getDatePropControllerDataString(\n data: DatePropControllerData | undefined,\n): string | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: DatePropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createDatePropControllerDataFromString(\n value: string,\n definition?: DateDescriptor,\n): DatePropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n P.nullish,\n () =>\n ({\n [ControlDataTypeKey]: DatePropControllerDataV1Type,\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,wBAAyB;AAEzB,MAAM,iCAAiC,aAAE,OAAO;AAMzC,MAAM,+BAA+B;AAE5C,MAAM,iCAAiC,aAAE,OAAO;AAAA,EAC9C,CAAC,0CAAkB,GAAG,aAAE,QAAQ,4BAA4B;AAAA,EAC5D,OAAO,aAAE,OAAO;AAClB,CAAC;AAMM,MAAM,+BAA+B,aAAE,MAAM;AAAA,EAClD;AAAA,EACA;AACF,CAAC;AAmCM,SAAS,KAAK,UAAuB,CAAC,GAAqB;AAChE,SAAO,EAAE,MAAM,8BAAM,MAAM,SAAS,GAAG,QAAQ;AACjD;AAEO,SAAS,gCACd,MACoB;AACpB,aAAO,yBAAM,IAAI,EACd;AAAA,IACC,EAAE,CAAC,0CAAkB,GAAG,6BAA6B;AAAA,IACrD,CAAC,OAAO,GAAG;AAAA,EACb,EACC,UAAU,CAAC,OAAO,EAAE;AACzB;AAEO,SAAS,uCACd,OACA,YACwB;AACxB,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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/element-id/element-id.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n ControlDataTypeKey,\n CopyContext,\n Options,\n Types,\n} from '../prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst elementIDSchema = z.string()\n\ntype ElementID = z.infer<typeof elementIDSchema>\n\nconst elementIDPropControllerDataV0Schema = elementIDSchema\n\nexport type ElementIDPropControllerDataV0 = z.infer<\n typeof elementIDPropControllerDataV0Schema\n>\n\nexport const ElementIDPropControllerDataV1Type =\n 'prop-controllers::element-id::v1'\n\nconst elementIDPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(ElementIDPropControllerDataV1Type),\n value: elementIDSchema,\n})\n\nexport type ElementIDPropControllerDataV1 = z.infer<\n typeof elementIDPropControllerDataV1Schema\n>\n\nexport const elementIDPropControllerDataSchema = z.union([\n elementIDPropControllerDataV0Schema,\n elementIDPropControllerDataV1Schema,\n])\n\nexport type ElementIDPropControllerData = z.infer<\n typeof elementIDPropControllerDataSchema\n>\n\nexport type ElementIDOptions = Options<Record<string, never>>\n\ntype ElementIDDescriptorV0<_T = ElementIDPropControllerDataV0> = {\n type: typeof Types.ElementID\n options: ElementIDOptions\n}\n\ntype ElementIDDescriptorV1<\n _T = ElementIDPropControllerData,\n U extends ElementIDOptions = ElementIDOptions,\n> = {\n type: typeof Types.ElementID\n version: 1\n options: U\n}\n\nexport type ElementIDDescriptor<_T = ElementIDPropControllerData> =\n | ElementIDDescriptorV0\n | ElementIDDescriptorV1\n\nexport type ResolveElementIDPropControllerValue<T extends ElementIDDescriptor> =\n T extends ElementIDDescriptor ? ElementID | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function ElementID(\n options: ElementIDOptions = {},\n): ElementIDDescriptorV1 {\n return { type: Types.ElementID, version: 1, options }\n}\n\nexport function getElementIDPropControllerDataElementID(\n data: ElementIDPropControllerData | undefined,\n): ElementID | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: ElementIDPropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createElementIDPropControllerDataFromElementID(\n value: ElementID,\n definition: ElementIDDescriptor,\n): ElementIDPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n P.nullish,\n () =>\n ({\n [ControlDataTypeKey]: ElementIDPropControllerDataV1Type,\n value,\n } as const
|
|
1
|
+
{"version":3,"sources":["../../../src/element-id/element-id.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n ControlDataTypeKey,\n CopyContext,\n Options,\n Types,\n} from '../prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst elementIDSchema = z.string()\n\ntype ElementID = z.infer<typeof elementIDSchema>\n\nconst elementIDPropControllerDataV0Schema = elementIDSchema\n\nexport type ElementIDPropControllerDataV0 = z.infer<\n typeof elementIDPropControllerDataV0Schema\n>\n\nexport const ElementIDPropControllerDataV1Type =\n 'prop-controllers::element-id::v1'\n\nconst elementIDPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(ElementIDPropControllerDataV1Type),\n value: elementIDSchema,\n})\n\nexport type ElementIDPropControllerDataV1 = z.infer<\n typeof elementIDPropControllerDataV1Schema\n>\n\nexport const elementIDPropControllerDataSchema = z.union([\n elementIDPropControllerDataV0Schema,\n elementIDPropControllerDataV1Schema,\n])\n\nexport type ElementIDPropControllerData = z.infer<\n typeof elementIDPropControllerDataSchema\n>\n\nexport type ElementIDOptions = Options<Record<string, never>>\n\ntype ElementIDDescriptorV0<_T = ElementIDPropControllerDataV0> = {\n type: typeof Types.ElementID\n options: ElementIDOptions\n}\n\ntype ElementIDDescriptorV1<\n _T = ElementIDPropControllerData,\n U extends ElementIDOptions = ElementIDOptions,\n> = {\n type: typeof Types.ElementID\n version: 1\n options: U\n}\n\nexport type ElementIDDescriptor<_T = ElementIDPropControllerData> =\n | ElementIDDescriptorV0\n | ElementIDDescriptorV1\n\nexport type ResolveElementIDPropControllerValue<T extends ElementIDDescriptor> =\n T extends ElementIDDescriptor ? ElementID | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function ElementID(\n options: ElementIDOptions = {},\n): ElementIDDescriptorV1 {\n return { type: Types.ElementID, version: 1, options }\n}\n\nexport function getElementIDPropControllerDataElementID(\n data: ElementIDPropControllerData | undefined,\n): ElementID | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: ElementIDPropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createElementIDPropControllerDataFromElementID(\n value: ElementID,\n definition: ElementIDDescriptor,\n): ElementIDPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n P.nullish,\n () =>\n ({\n [ControlDataTypeKey]: ElementIDPropControllerDataV1Type,\n value,\n }) as const,\n )\n .otherwise(() => value)\n}\n\nfunction copyElementID(\n data: ElementID | undefined,\n context: CopyContext,\n): ElementID | undefined {\n if (data == null) return data\n\n if (context.replacementContext.elementHtmlIds.has(data)) return undefined\n\n context.replacementContext.elementHtmlIds.add(data)\n\n return data\n}\n\nexport function copyElementIDPropControllerData(\n data: ElementIDPropControllerData | undefined,\n context: CopyContext,\n): ElementIDPropControllerData | undefined {\n return match(data)\n .with(undefined, () => undefined)\n .with({ [ControlDataTypeKey]: ElementIDPropControllerDataV1Type }, (v1) => {\n const value = copyElementID(v1.value, context)\n\n if (value == null) return undefined\n\n return {\n [ControlDataTypeKey]: ElementIDPropControllerDataV1Type,\n value,\n } as const\n })\n .otherwise((v0) => copyElementID(v0, context))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAkB;AAClB,8BAKO;AACP,wBAAyB;AAEzB,MAAM,kBAAkB,aAAE,OAAO;AAIjC,MAAM,sCAAsC;AAMrC,MAAM,oCACX;AAEF,MAAM,sCAAsC,aAAE,OAAO;AAAA,EACnD,CAAC,0CAAkB,GAAG,aAAE,QAAQ,iCAAiC;AAAA,EACjE,OAAO;AACT,CAAC;AAMM,MAAM,oCAAoC,aAAE,MAAM;AAAA,EACvD;AAAA,EACA;AACF,CAAC;AAiCM,SAAS,UACd,UAA4B,CAAC,GACN;AACvB,SAAO,EAAE,MAAM,8BAAM,WAAW,SAAS,GAAG,QAAQ;AACtD;AAEO,SAAS,wCACd,MACuB;AACvB,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,+CACd,OACA,YAC6B;AAC7B,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;AAEA,SAAS,cACP,MACA,SACuB;AACvB,MAAI,QAAQ;AAAM,WAAO;AAEzB,MAAI,QAAQ,mBAAmB,eAAe,IAAI,IAAI;AAAG,WAAO;AAEhE,UAAQ,mBAAmB,eAAe,IAAI,IAAI;AAElD,SAAO;AACT;AAEO,SAAS,gCACd,MACA,SACyC;AACzC,aAAO,yBAAM,IAAI,EACd,KAAK,QAAW,MAAM,MAAS,EAC/B,KAAK,EAAE,CAAC,0CAAkB,GAAG,kCAAkC,GAAG,CAAC,OAAO;AACzE,UAAM,QAAQ,cAAc,GAAG,OAAO,OAAO;AAE7C,QAAI,SAAS;AAAM,aAAO;AAE1B,WAAO;AAAA,MACL,CAAC,0CAAkB,GAAG;AAAA,MACtB;AAAA,IACF;AAAA,EACF,CAAC,EACA,UAAU,CAAC,OAAO,cAAc,IAAI,OAAO,CAAC;AACjD;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/gap-y/gap-y.ts"],"sourcesContent":["import { match } from 'ts-pattern'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { z } from 'zod'\nimport { GapData, ResponsiveGapData, responsiveGapDataSchema } from '../data'\n\nconst gapYPropControllerDataV0Schema = responsiveGapDataSchema\n\nexport type GapYPropControllerDataV0 = z.infer<\n typeof gapYPropControllerDataV0Schema\n>\n\nexport const GapYPropControllerDataV1Type = 'prop-controllers::gap-y::v1'\n\nconst gapYPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(GapYPropControllerDataV1Type),\n value: responsiveGapDataSchema,\n})\n\nexport type GapYPropControllerDataV1 = z.infer<\n typeof gapYPropControllerDataV1Schema\n>\n\nexport const gapYPropControllerDataSchema = z.union([\n gapYPropControllerDataV0Schema,\n gapYPropControllerDataV1Schema,\n])\n\nexport type GapYPropControllerData = z.infer<\n typeof gapYPropControllerDataSchema\n>\n\nexport type GapYOptions = Options<{\n preset?: ResponsiveGapData\n label?: string\n defaultValue?: GapData\n min?: number\n max?: number\n step?: number\n hidden?: boolean\n}>\n\ntype GapYDescriptorV0<\n _T = GapYPropControllerDataV0,\n U extends GapYOptions = GapYOptions,\n> = {\n type: typeof Types.GapY\n options: U\n}\n\ntype GapYDescriptorV1<\n _T = GapYPropControllerData,\n U extends GapYOptions = GapYOptions,\n> = {\n type: typeof Types.GapY\n version: 1\n options: U\n}\n\nexport type GapYDescriptor<\n _T = GapYPropControllerData,\n U extends GapYOptions = GapYOptions,\n> = GapYDescriptorV0<_T, U> | GapYDescriptorV1<_T, U>\n\nexport type ResolveGapYPropControllerValue<T extends GapYDescriptor> =\n T extends GapYDescriptor ? ResponsiveGapData | undefined : never\n\n/**\n * @deprecated Imports from `@makeswift/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function GapY(\n options: GapYOptions = {},\n): GapYDescriptor<GapYPropControllerData> {\n return { type: Types.GapY, version: 1, options }\n}\n\nexport function getGapYPropControllerDataResponsiveGapData(\n data: GapYPropControllerData | undefined,\n): ResponsiveGapData | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: GapYPropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createGapYPropControllerDataFromResponsiveGapData(\n responsiveGapData: ResponsiveGapData,\n definition: GapYDescriptor,\n): GapYPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n () =>\n ({\n [ControlDataTypeKey]: GapYPropControllerDataV1Type,\n value: responsiveGapData,\n } as const
|
|
1
|
+
{"version":3,"sources":["../../../src/gap-y/gap-y.ts"],"sourcesContent":["import { match } from 'ts-pattern'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { z } from 'zod'\nimport { GapData, ResponsiveGapData, responsiveGapDataSchema } from '../data'\n\nconst gapYPropControllerDataV0Schema = responsiveGapDataSchema\n\nexport type GapYPropControllerDataV0 = z.infer<\n typeof gapYPropControllerDataV0Schema\n>\n\nexport const GapYPropControllerDataV1Type = 'prop-controllers::gap-y::v1'\n\nconst gapYPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(GapYPropControllerDataV1Type),\n value: responsiveGapDataSchema,\n})\n\nexport type GapYPropControllerDataV1 = z.infer<\n typeof gapYPropControllerDataV1Schema\n>\n\nexport const gapYPropControllerDataSchema = z.union([\n gapYPropControllerDataV0Schema,\n gapYPropControllerDataV1Schema,\n])\n\nexport type GapYPropControllerData = z.infer<\n typeof gapYPropControllerDataSchema\n>\n\nexport type GapYOptions = Options<{\n preset?: ResponsiveGapData\n label?: string\n defaultValue?: GapData\n min?: number\n max?: number\n step?: number\n hidden?: boolean\n}>\n\ntype GapYDescriptorV0<\n _T = GapYPropControllerDataV0,\n U extends GapYOptions = GapYOptions,\n> = {\n type: typeof Types.GapY\n options: U\n}\n\ntype GapYDescriptorV1<\n _T = GapYPropControllerData,\n U extends GapYOptions = GapYOptions,\n> = {\n type: typeof Types.GapY\n version: 1\n options: U\n}\n\nexport type GapYDescriptor<\n _T = GapYPropControllerData,\n U extends GapYOptions = GapYOptions,\n> = GapYDescriptorV0<_T, U> | GapYDescriptorV1<_T, U>\n\nexport type ResolveGapYPropControllerValue<T extends GapYDescriptor> =\n T extends GapYDescriptor ? ResponsiveGapData | undefined : never\n\n/**\n * @deprecated Imports from `@makeswift/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function GapY(\n options: GapYOptions = {},\n): GapYDescriptor<GapYPropControllerData> {\n return { type: Types.GapY, version: 1, options }\n}\n\nexport function getGapYPropControllerDataResponsiveGapData(\n data: GapYPropControllerData | undefined,\n): ResponsiveGapData | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: GapYPropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createGapYPropControllerDataFromResponsiveGapData(\n responsiveGapData: ResponsiveGapData,\n definition: GapYDescriptor,\n): GapYPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n () =>\n ({\n [ControlDataTypeKey]: GapYPropControllerDataV1Type,\n value: responsiveGapData,\n }) as const,\n )\n .otherwise(() => responsiveGapData)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAsB;AACtB,8BAAmD;AACnD,iBAAkB;AAClB,kBAAoE;AAEpE,MAAM,iCAAiC;AAMhC,MAAM,+BAA+B;AAE5C,MAAM,iCAAiC,aAAE,OAAO;AAAA,EAC9C,CAAC,0CAAkB,GAAG,aAAE,QAAQ,4BAA4B;AAAA,EAC5D,OAAO;AACT,CAAC;AAMM,MAAM,+BAA+B,aAAE,MAAM;AAAA,EAClD;AAAA,EACA;AACF,CAAC;AA6CM,SAAS,KACd,UAAuB,CAAC,GACgB;AACxC,SAAO,EAAE,MAAM,8BAAM,MAAM,SAAS,GAAG,QAAQ;AACjD;AAEO,SAAS,2CACd,MAC+B;AAC/B,aAAO,yBAAM,IAAI,EACd;AAAA,IACC,EAAE,CAAC,0CAAkB,GAAG,6BAA6B;AAAA,IACrD,CAAC,OAAO,GAAG;AAAA,EACb,EACC,UAAU,CAAC,OAAO,EAAE;AACzB;AAEO,SAAS,kDACd,mBACA,YACwB;AACxB,aAAO,yBAAM,UAAU,EACpB;AAAA,IACC,EAAE,SAAS,EAAE;AAAA,IACb,OACG;AAAA,MACC,CAAC,0CAAkB,GAAG;AAAA,MACtB,OAAO;AAAA,IACT;AAAA,EACJ,EACC,UAAU,MAAM,iBAAiB;AACtC;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/social-links/social-links.ts"],"sourcesContent":["import { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst socialLinkTypesV0 = [\n 'angellist',\n 'codepen',\n 'discord',\n 'dribbble',\n 'facebook',\n 'github',\n 'instagram',\n 'linkedin',\n 'medium',\n 'pinterest',\n 'reddit',\n 'rss',\n 'snapchat',\n 'soundcloud',\n 'spotify',\n 'telegram',\n 'tumblr',\n 'twitch',\n 'twitter',\n 'vimeo',\n 'whatsapp',\n 'yelp',\n 'youtube',\n] as const\n\nconst socialLinkTypesV1 = [...socialLinkTypesV0, 'x', 'slack'] as const\n\nconst socialLinkV0Schema = z.object({\n type: z.enum(socialLinkTypesV0),\n url: z.string(),\n})\n\nconst socialLinkV1Schema = z.object({\n type: z.enum(socialLinkTypesV1),\n url: z.string(),\n})\n\nconst socialLinksLinkV0Schema = z.object({\n id: z.string(),\n payload: socialLinkV0Schema,\n})\n\nconst socialLinksLinkV1Schema = z.object({\n id: z.string(),\n payload: socialLinkV1Schema,\n})\n\nconst socialLinksDataV0Schema = z.object({\n links: z.array(socialLinksLinkV0Schema),\n openInNewTab: z.boolean(),\n})\n\nconst socialLinksDataV1Schema = z.object({\n links: z.array(socialLinksLinkV1Schema),\n openInNewTab: z.boolean(),\n})\n\nexport const socialLinksDataSchema = z.union([\n socialLinksDataV0Schema,\n socialLinksDataV1Schema,\n])\n\nexport type SocialLinksData = z.infer<typeof socialLinksDataSchema>\n\nconst socialLinksPropControllerDataV1Schema = socialLinksDataSchema\n\nexport type SocialLinksPropControllerDataV1 = z.infer<\n typeof socialLinksPropControllerDataV1Schema\n>\n\nexport const SocialLinksPropControllerDataV2Type =\n 'prop-controllers::social-links::v2'\n\nconst socialLinksPropControllerDataV2Schema = z.object({\n [ControlDataTypeKey]: z.literal(SocialLinksPropControllerDataV2Type),\n value: socialLinksDataSchema,\n})\n\nexport type SocialLinksPropControllerDataV2 = z.infer<\n typeof socialLinksPropControllerDataV2Schema\n>\n\nexport const socialLinksPropControllerDataSchema = z.union([\n socialLinksPropControllerDataV1Schema,\n socialLinksPropControllerDataV2Schema,\n])\n\nexport type SocialLinksPropControllerData = z.infer<\n typeof socialLinksPropControllerDataSchema\n>\n\nexport type SocialLinksOptions = Options<{\n preset?: SocialLinksPropControllerData\n}>\n\ntype SocialLinksDescriptorV1<_T = SocialLinksPropControllerDataV1> = {\n type: typeof Types.SocialLinks\n version?: 1\n options: SocialLinksOptions\n}\n\ntype SocialLinksDescriptorV2<_T = SocialLinksPropControllerData> = {\n type: typeof Types.SocialLinks\n version: 2\n options: SocialLinksOptions\n}\n\nexport type SocialLinksDescriptor<_T = SocialLinksPropControllerData> =\n | SocialLinksDescriptorV1\n | SocialLinksDescriptorV2\n\nexport type ResolveSocialLinksPropControllerValue<\n T extends SocialLinksDescriptor,\n> = T extends SocialLinksDescriptor ? SocialLinksData | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function SocialLinks(\n options: SocialLinksOptions = {},\n): SocialLinksDescriptorV2 {\n return { type: Types.SocialLinks, version: 2, options }\n}\n\nexport function getSocialLinkTypes(descriptor: SocialLinksDescriptor) {\n return match(descriptor)\n .with({ version: P.union(1, 2) }, () => socialLinkTypesV1)\n .otherwise(() => socialLinkTypesV0)\n}\n\nexport function getSocialLinksPropControllerDataSocialLinksData(\n data: SocialLinksPropControllerData | undefined,\n): SocialLinksData | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: SocialLinksPropControllerDataV2Type },\n (v2) => v2.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createSocialLinksPropControllerDataFromSocialLinksData(\n data: SocialLinksData,\n definition: SocialLinksDescriptor,\n): SocialLinksPropControllerData {\n return match(definition)\n .with(\n { version: 2 },\n () =>\n ({\n [ControlDataTypeKey]: SocialLinksPropControllerDataV2Type,\n value: data,\n } as const
|
|
1
|
+
{"version":3,"sources":["../../../src/social-links/social-links.ts"],"sourcesContent":["import { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst socialLinkTypesV0 = [\n 'angellist',\n 'codepen',\n 'discord',\n 'dribbble',\n 'facebook',\n 'github',\n 'instagram',\n 'linkedin',\n 'medium',\n 'pinterest',\n 'reddit',\n 'rss',\n 'snapchat',\n 'soundcloud',\n 'spotify',\n 'telegram',\n 'tumblr',\n 'twitch',\n 'twitter',\n 'vimeo',\n 'whatsapp',\n 'yelp',\n 'youtube',\n] as const\n\nconst socialLinkTypesV1 = [...socialLinkTypesV0, 'x', 'slack'] as const\n\nconst socialLinkV0Schema = z.object({\n type: z.enum(socialLinkTypesV0),\n url: z.string(),\n})\n\nconst socialLinkV1Schema = z.object({\n type: z.enum(socialLinkTypesV1),\n url: z.string(),\n})\n\nconst socialLinksLinkV0Schema = z.object({\n id: z.string(),\n payload: socialLinkV0Schema,\n})\n\nconst socialLinksLinkV1Schema = z.object({\n id: z.string(),\n payload: socialLinkV1Schema,\n})\n\nconst socialLinksDataV0Schema = z.object({\n links: z.array(socialLinksLinkV0Schema),\n openInNewTab: z.boolean(),\n})\n\nconst socialLinksDataV1Schema = z.object({\n links: z.array(socialLinksLinkV1Schema),\n openInNewTab: z.boolean(),\n})\n\nexport const socialLinksDataSchema = z.union([\n socialLinksDataV0Schema,\n socialLinksDataV1Schema,\n])\n\nexport type SocialLinksData = z.infer<typeof socialLinksDataSchema>\n\nconst socialLinksPropControllerDataV1Schema = socialLinksDataSchema\n\nexport type SocialLinksPropControllerDataV1 = z.infer<\n typeof socialLinksPropControllerDataV1Schema\n>\n\nexport const SocialLinksPropControllerDataV2Type =\n 'prop-controllers::social-links::v2'\n\nconst socialLinksPropControllerDataV2Schema = z.object({\n [ControlDataTypeKey]: z.literal(SocialLinksPropControllerDataV2Type),\n value: socialLinksDataSchema,\n})\n\nexport type SocialLinksPropControllerDataV2 = z.infer<\n typeof socialLinksPropControllerDataV2Schema\n>\n\nexport const socialLinksPropControllerDataSchema = z.union([\n socialLinksPropControllerDataV1Schema,\n socialLinksPropControllerDataV2Schema,\n])\n\nexport type SocialLinksPropControllerData = z.infer<\n typeof socialLinksPropControllerDataSchema\n>\n\nexport type SocialLinksOptions = Options<{\n preset?: SocialLinksPropControllerData\n}>\n\ntype SocialLinksDescriptorV1<_T = SocialLinksPropControllerDataV1> = {\n type: typeof Types.SocialLinks\n version?: 1\n options: SocialLinksOptions\n}\n\ntype SocialLinksDescriptorV2<_T = SocialLinksPropControllerData> = {\n type: typeof Types.SocialLinks\n version: 2\n options: SocialLinksOptions\n}\n\nexport type SocialLinksDescriptor<_T = SocialLinksPropControllerData> =\n | SocialLinksDescriptorV1\n | SocialLinksDescriptorV2\n\nexport type ResolveSocialLinksPropControllerValue<\n T extends SocialLinksDescriptor,\n> = T extends SocialLinksDescriptor ? SocialLinksData | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function SocialLinks(\n options: SocialLinksOptions = {},\n): SocialLinksDescriptorV2 {\n return { type: Types.SocialLinks, version: 2, options }\n}\n\nexport function getSocialLinkTypes(descriptor: SocialLinksDescriptor) {\n return match(descriptor)\n .with({ version: P.union(1, 2) }, () => socialLinkTypesV1)\n .otherwise(() => socialLinkTypesV0)\n}\n\nexport function getSocialLinksPropControllerDataSocialLinksData(\n data: SocialLinksPropControllerData | undefined,\n): SocialLinksData | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: SocialLinksPropControllerDataV2Type },\n (v2) => v2.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createSocialLinksPropControllerDataFromSocialLinksData(\n data: SocialLinksData,\n definition: SocialLinksDescriptor,\n): SocialLinksPropControllerData {\n return match(definition)\n .with(\n { version: 2 },\n () =>\n ({\n [ControlDataTypeKey]: SocialLinksPropControllerDataV2Type,\n value: data,\n }) as const,\n )\n .otherwise(() => data)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAkB;AAClB,8BAAmD;AACnD,wBAAyB;AAEzB,MAAM,oBAAoB;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,oBAAoB,CAAC,GAAG,mBAAmB,KAAK,OAAO;AAE7D,MAAM,qBAAqB,aAAE,OAAO;AAAA,EAClC,MAAM,aAAE,KAAK,iBAAiB;AAAA,EAC9B,KAAK,aAAE,OAAO;AAChB,CAAC;AAED,MAAM,qBAAqB,aAAE,OAAO;AAAA,EAClC,MAAM,aAAE,KAAK,iBAAiB;AAAA,EAC9B,KAAK,aAAE,OAAO;AAChB,CAAC;AAED,MAAM,0BAA0B,aAAE,OAAO;AAAA,EACvC,IAAI,aAAE,OAAO;AAAA,EACb,SAAS;AACX,CAAC;AAED,MAAM,0BAA0B,aAAE,OAAO;AAAA,EACvC,IAAI,aAAE,OAAO;AAAA,EACb,SAAS;AACX,CAAC;AAED,MAAM,0BAA0B,aAAE,OAAO;AAAA,EACvC,OAAO,aAAE,MAAM,uBAAuB;AAAA,EACtC,cAAc,aAAE,QAAQ;AAC1B,CAAC;AAED,MAAM,0BAA0B,aAAE,OAAO;AAAA,EACvC,OAAO,aAAE,MAAM,uBAAuB;AAAA,EACtC,cAAc,aAAE,QAAQ;AAC1B,CAAC;AAEM,MAAM,wBAAwB,aAAE,MAAM;AAAA,EAC3C;AAAA,EACA;AACF,CAAC;AAID,MAAM,wCAAwC;AAMvC,MAAM,sCACX;AAEF,MAAM,wCAAwC,aAAE,OAAO;AAAA,EACrD,CAAC,0CAAkB,GAAG,aAAE,QAAQ,mCAAmC;AAAA,EACnE,OAAO;AACT,CAAC;AAMM,MAAM,sCAAsC,aAAE,MAAM;AAAA,EACzD;AAAA,EACA;AACF,CAAC;AAkCM,SAAS,YACd,UAA8B,CAAC,GACN;AACzB,SAAO,EAAE,MAAM,8BAAM,aAAa,SAAS,GAAG,QAAQ;AACxD;AAEO,SAAS,mBAAmB,YAAmC;AACpE,aAAO,yBAAM,UAAU,EACpB,KAAK,EAAE,SAAS,oBAAE,MAAM,GAAG,CAAC,EAAE,GAAG,MAAM,iBAAiB,EACxD,UAAU,MAAM,iBAAiB;AACtC;AAEO,SAAS,gDACd,MAC6B;AAC7B,aAAO,yBAAM,IAAI,EACd;AAAA,IACC,EAAE,CAAC,0CAAkB,GAAG,oCAAoC;AAAA,IAC5D,CAAC,OAAO,GAAG;AAAA,EACb,EACC,UAAU,CAAC,OAAO,EAAE;AACzB;AAEO,SAAS,uDACd,MACA,YAC+B;AAC/B,aAAO,yBAAM,UAAU,EACpB;AAAA,IACC,EAAE,SAAS,EAAE;AAAA,IACb,OACG;AAAA,MACC,CAAC,0CAAkB,GAAG;AAAA,MACtB,OAAO;AAAA,IACT;AAAA,EACJ,EACC,UAAU,MAAM,IAAI;AACzB;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/video/video.ts"],"sourcesContent":["import { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst videoDataSchema = z.object({\n url: z.string().optional(),\n muted: z.boolean().optional(),\n playing: z.boolean().optional(),\n loop: z.boolean().optional(),\n controls: z.boolean().optional(),\n})\n\nexport type VideoData = z.infer<typeof videoDataSchema>\n\nconst videoPropControllerDataV0Schema = videoDataSchema\n\nexport type VideoPropControllerDataV0 = z.infer<\n typeof videoPropControllerDataV0Schema\n>\n\nexport const VideoPropControllerDataV1Type = 'prop-controllers::video::v1'\n\nconst videoPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(VideoPropControllerDataV1Type),\n value: videoDataSchema,\n})\n\nexport type VideoPropControllerDataV1 = z.infer<\n typeof videoPropControllerDataV1Schema\n>\n\nexport const videoPropControllerDataSchema = z.union([\n videoPropControllerDataV1Schema,\n videoPropControllerDataV0Schema,\n])\n\nexport type VideoPropControllerData = z.infer<\n typeof videoPropControllerDataSchema\n>\n\nexport type VideoOptions = Options<{\n preset?: VideoPropControllerData\n}>\n\ntype VideoDescriptorV0<_T = VideoPropControllerDataV0> = {\n type: typeof Types.Video\n options: VideoOptions\n}\n\ntype VideoDescriptorV1<\n _T = VideoPropControllerData,\n U extends VideoOptions = VideoOptions,\n> = {\n type: typeof Types.Video\n version: 1\n options: U\n}\n\nexport type VideoDescriptor<_T = VideoPropControllerData> =\n | VideoDescriptorV0\n | VideoDescriptorV1\n\nexport type ResolveVideoPropControllerValue<T extends VideoDescriptor> =\n T extends VideoDescriptor ? VideoData | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function Video(options: VideoOptions = {}): VideoDescriptorV1 {\n return { type: Types.Video, version: 1, options }\n}\n\nexport function getVideoPropControllerDataVideoData(\n data: VideoPropControllerData | undefined,\n): VideoData | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: VideoPropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createVideoPropControllerDataFromVideoData(\n value: VideoData,\n definition?: VideoDescriptor,\n): VideoPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n P.nullish,\n () =>\n ({\n [ControlDataTypeKey]: VideoPropControllerDataV1Type,\n value,\n } as const
|
|
1
|
+
{"version":3,"sources":["../../../src/video/video.ts"],"sourcesContent":["import { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst videoDataSchema = z.object({\n url: z.string().optional(),\n muted: z.boolean().optional(),\n playing: z.boolean().optional(),\n loop: z.boolean().optional(),\n controls: z.boolean().optional(),\n})\n\nexport type VideoData = z.infer<typeof videoDataSchema>\n\nconst videoPropControllerDataV0Schema = videoDataSchema\n\nexport type VideoPropControllerDataV0 = z.infer<\n typeof videoPropControllerDataV0Schema\n>\n\nexport const VideoPropControllerDataV1Type = 'prop-controllers::video::v1'\n\nconst videoPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(VideoPropControllerDataV1Type),\n value: videoDataSchema,\n})\n\nexport type VideoPropControllerDataV1 = z.infer<\n typeof videoPropControllerDataV1Schema\n>\n\nexport const videoPropControllerDataSchema = z.union([\n videoPropControllerDataV1Schema,\n videoPropControllerDataV0Schema,\n])\n\nexport type VideoPropControllerData = z.infer<\n typeof videoPropControllerDataSchema\n>\n\nexport type VideoOptions = Options<{\n preset?: VideoPropControllerData\n}>\n\ntype VideoDescriptorV0<_T = VideoPropControllerDataV0> = {\n type: typeof Types.Video\n options: VideoOptions\n}\n\ntype VideoDescriptorV1<\n _T = VideoPropControllerData,\n U extends VideoOptions = VideoOptions,\n> = {\n type: typeof Types.Video\n version: 1\n options: U\n}\n\nexport type VideoDescriptor<_T = VideoPropControllerData> =\n | VideoDescriptorV0\n | VideoDescriptorV1\n\nexport type ResolveVideoPropControllerValue<T extends VideoDescriptor> =\n T extends VideoDescriptor ? VideoData | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function Video(options: VideoOptions = {}): VideoDescriptorV1 {\n return { type: Types.Video, version: 1, options }\n}\n\nexport function getVideoPropControllerDataVideoData(\n data: VideoPropControllerData | undefined,\n): VideoData | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: VideoPropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createVideoPropControllerDataFromVideoData(\n value: VideoData,\n definition?: VideoDescriptor,\n): VideoPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n P.nullish,\n () =>\n ({\n [ControlDataTypeKey]: VideoPropControllerDataV1Type,\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,wBAAyB;AAEzB,MAAM,kBAAkB,aAAE,OAAO;AAAA,EAC/B,KAAK,aAAE,OAAO,EAAE,SAAS;AAAA,EACzB,OAAO,aAAE,QAAQ,EAAE,SAAS;AAAA,EAC5B,SAAS,aAAE,QAAQ,EAAE,SAAS;AAAA,EAC9B,MAAM,aAAE,QAAQ,EAAE,SAAS;AAAA,EAC3B,UAAU,aAAE,QAAQ,EAAE,SAAS;AACjC,CAAC;AAID,MAAM,kCAAkC;AAMjC,MAAM,gCAAgC;AAE7C,MAAM,kCAAkC,aAAE,OAAO;AAAA,EAC/C,CAAC,0CAAkB,GAAG,aAAE,QAAQ,6BAA6B;AAAA,EAC7D,OAAO;AACT,CAAC;AAMM,MAAM,gCAAgC,aAAE,MAAM;AAAA,EACnD;AAAA,EACA;AACF,CAAC;AAmCM,SAAS,MAAM,UAAwB,CAAC,GAAsB;AACnE,SAAO,EAAE,MAAM,8BAAM,OAAO,SAAS,GAAG,QAAQ;AAClD;AAEO,SAAS,oCACd,MACuB;AACvB,aAAO,yBAAM,IAAI,EACd;AAAA,IACC,EAAE,CAAC,0CAAkB,GAAG,8BAA8B;AAAA,IACtD,CAAC,OAAO,GAAG;AAAA,EACb,EACC,UAAU,CAAC,OAAO,EAAE;AACzB;AAEO,SAAS,2CACd,OACA,YACyB;AACzB,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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/width/width.ts"],"sourcesContent":["import { P, match } from 'ts-pattern'\nimport { ControlDataTypeKey, ResolveOptions, Types } from '../prop-controllers'\nimport { z } from 'zod'\nimport { LengthData } from '../data'\nimport {\n ResponsiveLengthData,\n responsiveLengthDataSchema,\n} from '../responsive-length'\n\nconst widthPropControllerDataV0Schema = responsiveLengthDataSchema\n\nexport type WidthPropControllerDataV0 = z.infer<\n typeof widthPropControllerDataV0Schema\n>\n\nexport const WidthPropControllerDataV1Type = 'prop-controllers::width::v1'\n\nconst widthPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(WidthPropControllerDataV1Type),\n value: responsiveLengthDataSchema,\n})\n\nexport type WidthPropControllerDataV1 = z.infer<\n typeof widthPropControllerDataV1Schema\n>\n\nexport const widthPropControllerDataSchema = z.union([\n widthPropControllerDataV0Schema,\n widthPropControllerDataV1Schema,\n])\n\nexport type WidthPropControllerData = z.infer<\n typeof widthPropControllerDataSchema\n>\n\nexport const WidthPropControllerFormat = {\n ClassName: 'makeswift::prop-controllers::width::format::class-name',\n ResponsiveValue:\n 'makeswift::prop-controllers::width::format::responsive-value',\n} as const\n\nexport type WidthPropControllerFormat =\n typeof WidthPropControllerFormat[keyof typeof WidthPropControllerFormat]\n\ntype WidthOptions = {\n preset?: WidthPropControllerData\n defaultValue?: LengthData\n format?: WidthPropControllerFormat\n}\n\ntype WidthDescriptorV0<\n _T = WidthPropControllerDataV0,\n U extends WidthOptions = WidthOptions,\n> = {\n type: typeof Types.Width\n options: U\n}\n\ntype WidthDescriptorV1<\n _T = WidthPropControllerData,\n U extends WidthOptions = WidthOptions,\n> = {\n type: typeof Types.Width\n version: 1\n options: U\n}\n\nexport type WidthDescriptor<\n _T = WidthPropControllerData,\n U extends WidthOptions = WidthOptions,\n> = WidthDescriptorV0<_T, U> | WidthDescriptorV1<_T, U>\n\nexport type ResolveWidthPropControllerValue<T extends WidthDescriptor> =\n T extends WidthDescriptor\n ? undefined extends ResolveOptions<T['options']>['format']\n ? ResponsiveLengthData | undefined\n : ResolveOptions<\n
|
|
1
|
+
{"version":3,"sources":["../../../src/width/width.ts"],"sourcesContent":["import { P, match } from 'ts-pattern'\nimport { ControlDataTypeKey, ResolveOptions, Types } from '../prop-controllers'\nimport { z } from 'zod'\nimport { LengthData } from '../data'\nimport {\n ResponsiveLengthData,\n responsiveLengthDataSchema,\n} from '../responsive-length'\n\nconst widthPropControllerDataV0Schema = responsiveLengthDataSchema\n\nexport type WidthPropControllerDataV0 = z.infer<\n typeof widthPropControllerDataV0Schema\n>\n\nexport const WidthPropControllerDataV1Type = 'prop-controllers::width::v1'\n\nconst widthPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(WidthPropControllerDataV1Type),\n value: responsiveLengthDataSchema,\n})\n\nexport type WidthPropControllerDataV1 = z.infer<\n typeof widthPropControllerDataV1Schema\n>\n\nexport const widthPropControllerDataSchema = z.union([\n widthPropControllerDataV0Schema,\n widthPropControllerDataV1Schema,\n])\n\nexport type WidthPropControllerData = z.infer<\n typeof widthPropControllerDataSchema\n>\n\nexport const WidthPropControllerFormat = {\n ClassName: 'makeswift::prop-controllers::width::format::class-name',\n ResponsiveValue:\n 'makeswift::prop-controllers::width::format::responsive-value',\n} as const\n\nexport type WidthPropControllerFormat =\n (typeof WidthPropControllerFormat)[keyof typeof WidthPropControllerFormat]\n\ntype WidthOptions = {\n preset?: WidthPropControllerData\n defaultValue?: LengthData\n format?: WidthPropControllerFormat\n}\n\ntype WidthDescriptorV0<\n _T = WidthPropControllerDataV0,\n U extends WidthOptions = WidthOptions,\n> = {\n type: typeof Types.Width\n options: U\n}\n\ntype WidthDescriptorV1<\n _T = WidthPropControllerData,\n U extends WidthOptions = WidthOptions,\n> = {\n type: typeof Types.Width\n version: 1\n options: U\n}\n\nexport type WidthDescriptor<\n _T = WidthPropControllerData,\n U extends WidthOptions = WidthOptions,\n> = WidthDescriptorV0<_T, U> | WidthDescriptorV1<_T, U>\n\nexport type ResolveWidthPropControllerValue<T extends WidthDescriptor> =\n T extends WidthDescriptor\n ? undefined extends ResolveOptions<T['options']>['format']\n ? ResponsiveLengthData | undefined\n : ResolveOptions<\n T['options']\n >['format'] extends typeof WidthPropControllerFormat.ClassName\n ? string\n : ResolveOptions<\n T['options']\n >['format'] extends typeof WidthPropControllerFormat.ResponsiveValue\n ? ResponsiveLengthData | undefined\n : never\n : never\n\n/**\n * @deprecated Imports from `@makeswift/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Width<T extends WidthOptions>(\n options: T & WidthOptions = {} as T,\n): WidthDescriptor<WidthPropControllerData, T> {\n return { type: Types.Width, version: 1, options }\n}\n\nWidth.Format = WidthPropControllerFormat\n\nexport function getWidthPropControllerDataResponsiveLengthData(\n data: WidthPropControllerData | undefined,\n): ResponsiveLengthData | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: WidthPropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createWidthPropControllerDataFromResponsiveLengthData(\n responsiveLengthData: ResponsiveLengthData,\n definition?: WidthDescriptor,\n): WidthPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n P.nullish,\n () =>\n ({\n [ControlDataTypeKey]: WidthPropControllerDataV1Type,\n value: responsiveLengthData,\n }) as const,\n )\n .otherwise(() => responsiveLengthData)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAyB;AACzB,8BAA0D;AAC1D,iBAAkB;AAElB,+BAGO;AAEP,MAAM,kCAAkC;AAMjC,MAAM,gCAAgC;AAE7C,MAAM,kCAAkC,aAAE,OAAO;AAAA,EAC/C,CAAC,0CAAkB,GAAG,aAAE,QAAQ,6BAA6B;AAAA,EAC7D,OAAO;AACT,CAAC;AAMM,MAAM,gCAAgC,aAAE,MAAM;AAAA,EACnD;AAAA,EACA;AACF,CAAC;AAMM,MAAM,4BAA4B;AAAA,EACvC,WAAW;AAAA,EACX,iBACE;AACJ;AAoDO,SAAS,MACd,UAA4B,CAAC,GACgB;AAC7C,SAAO,EAAE,MAAM,8BAAM,OAAO,SAAS,GAAG,QAAQ;AAClD;AAEA,MAAM,SAAS;AAER,SAAS,+CACd,MACkC;AAClC,aAAO,yBAAM,IAAI,EACd;AAAA,IACC,EAAE,CAAC,0CAAkB,GAAG,8BAA8B;AAAA,IACtD,CAAC,OAAO,GAAG;AAAA,EACb,EACC,UAAU,CAAC,OAAO,EAAE;AACzB;AAEO,SAAS,sDACd,sBACA,YACyB;AACzB,aAAO,yBAAM,UAAU,EACpB;AAAA,IACC,EAAE,SAAS,EAAE;AAAA,IACb,oBAAE;AAAA,IACF,OACG;AAAA,MACC,CAAC,0CAAkB,GAAG;AAAA,MACtB,OAAO;AAAA,IACT;AAAA,EACJ,EACC,UAAU,MAAM,oBAAoB;AACzC;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/checkbox/checkbox.ts"],"sourcesContent":["import { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst checkboxPropControllerDataV0Schema = z.boolean()\n\nexport type CheckboxPropControllerDataV0 = z.infer<\n typeof checkboxPropControllerDataV0Schema\n>\n\nexport const CheckboxPropControllerDataV1Type = 'prop-controllers::checkbox::v1'\n\nconst checkboxPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(CheckboxPropControllerDataV1Type),\n value: z.boolean(),\n})\n\nexport type CheckboxPropControllerDataV1 = z.infer<\n typeof checkboxPropControllerDataV1Schema\n>\n\nexport const checkboxPropControllerDataSchema = z.union([\n checkboxPropControllerDataV0Schema,\n checkboxPropControllerDataV1Schema,\n])\n\nexport type CheckboxPropControllerData = z.infer<\n typeof checkboxPropControllerDataSchema\n>\n\nexport type CheckboxOptions = Options<{\n preset?: CheckboxPropControllerData\n label: string\n hidden?: boolean\n}>\n\ntype CheckboxDescriptorV0<_T = CheckboxPropControllerDataV0> = {\n type: typeof Types.Checkbox\n options: CheckboxOptions\n}\n\ntype CheckboxDescriptorV1<\n _T = CheckboxPropControllerData,\n U extends CheckboxOptions = CheckboxOptions,\n> = {\n type: typeof Types.Checkbox\n version: 1\n options: U\n}\n\nexport type CheckboxDescriptor<_T = CheckboxPropControllerData> =\n | CheckboxDescriptorV0\n | CheckboxDescriptorV1\n\nexport type ResolveCheckboxPropControllerValue<T extends CheckboxDescriptor> =\n T extends CheckboxDescriptor ? boolean | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function Checkbox(options: CheckboxOptions): CheckboxDescriptorV1 {\n return { type: Types.Checkbox, version: 1, options }\n}\n\nexport function getCheckboxPropControllerDataBoolean(\n data: CheckboxPropControllerData | undefined,\n): boolean | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: CheckboxPropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createCheckboxPropControllerDataFromBoolean(\n value: boolean,\n definition?: CheckboxDescriptor,\n): CheckboxPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n P.nullish,\n () =>\n ({\n [ControlDataTypeKey]: CheckboxPropControllerDataV1Type,\n value,\n } as const
|
|
1
|
+
{"version":3,"sources":["../../../src/checkbox/checkbox.ts"],"sourcesContent":["import { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst checkboxPropControllerDataV0Schema = z.boolean()\n\nexport type CheckboxPropControllerDataV0 = z.infer<\n typeof checkboxPropControllerDataV0Schema\n>\n\nexport const CheckboxPropControllerDataV1Type = 'prop-controllers::checkbox::v1'\n\nconst checkboxPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(CheckboxPropControllerDataV1Type),\n value: z.boolean(),\n})\n\nexport type CheckboxPropControllerDataV1 = z.infer<\n typeof checkboxPropControllerDataV1Schema\n>\n\nexport const checkboxPropControllerDataSchema = z.union([\n checkboxPropControllerDataV0Schema,\n checkboxPropControllerDataV1Schema,\n])\n\nexport type CheckboxPropControllerData = z.infer<\n typeof checkboxPropControllerDataSchema\n>\n\nexport type CheckboxOptions = Options<{\n preset?: CheckboxPropControllerData\n label: string\n hidden?: boolean\n}>\n\ntype CheckboxDescriptorV0<_T = CheckboxPropControllerDataV0> = {\n type: typeof Types.Checkbox\n options: CheckboxOptions\n}\n\ntype CheckboxDescriptorV1<\n _T = CheckboxPropControllerData,\n U extends CheckboxOptions = CheckboxOptions,\n> = {\n type: typeof Types.Checkbox\n version: 1\n options: U\n}\n\nexport type CheckboxDescriptor<_T = CheckboxPropControllerData> =\n | CheckboxDescriptorV0\n | CheckboxDescriptorV1\n\nexport type ResolveCheckboxPropControllerValue<T extends CheckboxDescriptor> =\n T extends CheckboxDescriptor ? boolean | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function Checkbox(options: CheckboxOptions): CheckboxDescriptorV1 {\n return { type: Types.Checkbox, version: 1, options }\n}\n\nexport function getCheckboxPropControllerDataBoolean(\n data: CheckboxPropControllerData | undefined,\n): boolean | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: CheckboxPropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createCheckboxPropControllerDataFromBoolean(\n value: boolean,\n definition?: CheckboxDescriptor,\n): CheckboxPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n P.nullish,\n () =>\n ({\n [ControlDataTypeKey]: CheckboxPropControllerDataV1Type,\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,qCAAqC,EAAE,QAAQ;AAM9C,MAAM,mCAAmC;AAEhD,MAAM,qCAAqC,EAAE,OAAO;AAAA,EAClD,CAAC,kBAAkB,GAAG,EAAE,QAAQ,gCAAgC;AAAA,EAChE,OAAO,EAAE,QAAQ;AACnB,CAAC;AAMM,MAAM,mCAAmC,EAAE,MAAM;AAAA,EACtD;AAAA,EACA;AACF,CAAC;AAqCM,SAAS,SAAS,SAAgD;AACvE,SAAO,EAAE,MAAM,MAAM,UAAU,SAAS,GAAG,QAAQ;AACrD;AAEO,SAAS,qCACd,MACqB;AACrB,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,4CACd,OACA,YAC4B;AAC5B,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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/date/date.ts"],"sourcesContent":["import { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst datePropControllerDataV0Schema = z.string()\n\nexport type DatePropControllerDataV0 = z.infer<\n typeof datePropControllerDataV0Schema\n>\n\nexport const DatePropControllerDataV1Type = 'prop-controllers::date::v1'\n\nconst datePropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(DatePropControllerDataV1Type),\n value: z.string(),\n})\n\nexport type DatePropControllerDataV1 = z.infer<\n typeof datePropControllerDataV1Schema\n>\n\nexport const datePropControllerDataSchema = z.union([\n datePropControllerDataV0Schema,\n datePropControllerDataV1Schema,\n])\n\nexport type DatePropControllerData = z.infer<\n typeof datePropControllerDataSchema\n>\n\nexport type DateOptions = Options<{\n preset?: DatePropControllerData\n}>\n\ntype DateDescriptorV0<_T = DatePropControllerDataV0> = {\n type: typeof Types.Date\n options: DateOptions\n}\n\ntype DateDescriptorV1<\n _T = DatePropControllerData,\n U extends DateOptions = DateOptions,\n> = {\n type: typeof Types.Date\n version: 1\n options: U\n}\n\nexport type DateDescriptor<_T = DatePropControllerData> =\n | DateDescriptorV0\n | DateDescriptorV1\n\nexport type ResolveDatePropControllerValue<T extends DateDescriptor> =\n T extends DateDescriptor ? string | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function Date(options: DateOptions = {}): DateDescriptorV1 {\n return { type: Types.Date, version: 1, options }\n}\n\nexport function getDatePropControllerDataString(\n data: DatePropControllerData | undefined,\n): string | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: DatePropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createDatePropControllerDataFromString(\n value: string,\n definition?: DateDescriptor,\n): DatePropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n P.nullish,\n () =>\n ({\n [ControlDataTypeKey]: DatePropControllerDataV1Type,\n value,\n } as const
|
|
1
|
+
{"version":3,"sources":["../../../src/date/date.ts"],"sourcesContent":["import { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst datePropControllerDataV0Schema = z.string()\n\nexport type DatePropControllerDataV0 = z.infer<\n typeof datePropControllerDataV0Schema\n>\n\nexport const DatePropControllerDataV1Type = 'prop-controllers::date::v1'\n\nconst datePropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(DatePropControllerDataV1Type),\n value: z.string(),\n})\n\nexport type DatePropControllerDataV1 = z.infer<\n typeof datePropControllerDataV1Schema\n>\n\nexport const datePropControllerDataSchema = z.union([\n datePropControllerDataV0Schema,\n datePropControllerDataV1Schema,\n])\n\nexport type DatePropControllerData = z.infer<\n typeof datePropControllerDataSchema\n>\n\nexport type DateOptions = Options<{\n preset?: DatePropControllerData\n}>\n\ntype DateDescriptorV0<_T = DatePropControllerDataV0> = {\n type: typeof Types.Date\n options: DateOptions\n}\n\ntype DateDescriptorV1<\n _T = DatePropControllerData,\n U extends DateOptions = DateOptions,\n> = {\n type: typeof Types.Date\n version: 1\n options: U\n}\n\nexport type DateDescriptor<_T = DatePropControllerData> =\n | DateDescriptorV0\n | DateDescriptorV1\n\nexport type ResolveDatePropControllerValue<T extends DateDescriptor> =\n T extends DateDescriptor ? string | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function Date(options: DateOptions = {}): DateDescriptorV1 {\n return { type: Types.Date, version: 1, options }\n}\n\nexport function getDatePropControllerDataString(\n data: DatePropControllerData | undefined,\n): string | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: DatePropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createDatePropControllerDataFromString(\n value: string,\n definition?: DateDescriptor,\n): DatePropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n P.nullish,\n () =>\n ({\n [ControlDataTypeKey]: DatePropControllerDataV1Type,\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,iCAAiC,EAAE,OAAO;AAMzC,MAAM,+BAA+B;AAE5C,MAAM,iCAAiC,EAAE,OAAO;AAAA,EAC9C,CAAC,kBAAkB,GAAG,EAAE,QAAQ,4BAA4B;AAAA,EAC5D,OAAO,EAAE,OAAO;AAClB,CAAC;AAMM,MAAM,+BAA+B,EAAE,MAAM;AAAA,EAClD;AAAA,EACA;AACF,CAAC;AAmCM,SAAS,KAAK,UAAuB,CAAC,GAAqB;AAChE,SAAO,EAAE,MAAM,MAAM,MAAM,SAAS,GAAG,QAAQ;AACjD;AAEO,SAAS,gCACd,MACoB;AACpB,SAAO,MAAM,IAAI,EACd;AAAA,IACC,EAAE,CAAC,kBAAkB,GAAG,6BAA6B;AAAA,IACrD,CAAC,OAAO,GAAG;AAAA,EACb,EACC,UAAU,CAAC,OAAO,EAAE;AACzB;AAEO,SAAS,uCACd,OACA,YACwB;AACxB,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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/element-id/element-id.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n ControlDataTypeKey,\n CopyContext,\n Options,\n Types,\n} from '../prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst elementIDSchema = z.string()\n\ntype ElementID = z.infer<typeof elementIDSchema>\n\nconst elementIDPropControllerDataV0Schema = elementIDSchema\n\nexport type ElementIDPropControllerDataV0 = z.infer<\n typeof elementIDPropControllerDataV0Schema\n>\n\nexport const ElementIDPropControllerDataV1Type =\n 'prop-controllers::element-id::v1'\n\nconst elementIDPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(ElementIDPropControllerDataV1Type),\n value: elementIDSchema,\n})\n\nexport type ElementIDPropControllerDataV1 = z.infer<\n typeof elementIDPropControllerDataV1Schema\n>\n\nexport const elementIDPropControllerDataSchema = z.union([\n elementIDPropControllerDataV0Schema,\n elementIDPropControllerDataV1Schema,\n])\n\nexport type ElementIDPropControllerData = z.infer<\n typeof elementIDPropControllerDataSchema\n>\n\nexport type ElementIDOptions = Options<Record<string, never>>\n\ntype ElementIDDescriptorV0<_T = ElementIDPropControllerDataV0> = {\n type: typeof Types.ElementID\n options: ElementIDOptions\n}\n\ntype ElementIDDescriptorV1<\n _T = ElementIDPropControllerData,\n U extends ElementIDOptions = ElementIDOptions,\n> = {\n type: typeof Types.ElementID\n version: 1\n options: U\n}\n\nexport type ElementIDDescriptor<_T = ElementIDPropControllerData> =\n | ElementIDDescriptorV0\n | ElementIDDescriptorV1\n\nexport type ResolveElementIDPropControllerValue<T extends ElementIDDescriptor> =\n T extends ElementIDDescriptor ? ElementID | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function ElementID(\n options: ElementIDOptions = {},\n): ElementIDDescriptorV1 {\n return { type: Types.ElementID, version: 1, options }\n}\n\nexport function getElementIDPropControllerDataElementID(\n data: ElementIDPropControllerData | undefined,\n): ElementID | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: ElementIDPropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createElementIDPropControllerDataFromElementID(\n value: ElementID,\n definition: ElementIDDescriptor,\n): ElementIDPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n P.nullish,\n () =>\n ({\n [ControlDataTypeKey]: ElementIDPropControllerDataV1Type,\n value,\n } as const
|
|
1
|
+
{"version":3,"sources":["../../../src/element-id/element-id.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n ControlDataTypeKey,\n CopyContext,\n Options,\n Types,\n} from '../prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst elementIDSchema = z.string()\n\ntype ElementID = z.infer<typeof elementIDSchema>\n\nconst elementIDPropControllerDataV0Schema = elementIDSchema\n\nexport type ElementIDPropControllerDataV0 = z.infer<\n typeof elementIDPropControllerDataV0Schema\n>\n\nexport const ElementIDPropControllerDataV1Type =\n 'prop-controllers::element-id::v1'\n\nconst elementIDPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(ElementIDPropControllerDataV1Type),\n value: elementIDSchema,\n})\n\nexport type ElementIDPropControllerDataV1 = z.infer<\n typeof elementIDPropControllerDataV1Schema\n>\n\nexport const elementIDPropControllerDataSchema = z.union([\n elementIDPropControllerDataV0Schema,\n elementIDPropControllerDataV1Schema,\n])\n\nexport type ElementIDPropControllerData = z.infer<\n typeof elementIDPropControllerDataSchema\n>\n\nexport type ElementIDOptions = Options<Record<string, never>>\n\ntype ElementIDDescriptorV0<_T = ElementIDPropControllerDataV0> = {\n type: typeof Types.ElementID\n options: ElementIDOptions\n}\n\ntype ElementIDDescriptorV1<\n _T = ElementIDPropControllerData,\n U extends ElementIDOptions = ElementIDOptions,\n> = {\n type: typeof Types.ElementID\n version: 1\n options: U\n}\n\nexport type ElementIDDescriptor<_T = ElementIDPropControllerData> =\n | ElementIDDescriptorV0\n | ElementIDDescriptorV1\n\nexport type ResolveElementIDPropControllerValue<T extends ElementIDDescriptor> =\n T extends ElementIDDescriptor ? ElementID | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function ElementID(\n options: ElementIDOptions = {},\n): ElementIDDescriptorV1 {\n return { type: Types.ElementID, version: 1, options }\n}\n\nexport function getElementIDPropControllerDataElementID(\n data: ElementIDPropControllerData | undefined,\n): ElementID | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: ElementIDPropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createElementIDPropControllerDataFromElementID(\n value: ElementID,\n definition: ElementIDDescriptor,\n): ElementIDPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n P.nullish,\n () =>\n ({\n [ControlDataTypeKey]: ElementIDPropControllerDataV1Type,\n value,\n }) as const,\n )\n .otherwise(() => value)\n}\n\nfunction copyElementID(\n data: ElementID | undefined,\n context: CopyContext,\n): ElementID | undefined {\n if (data == null) return data\n\n if (context.replacementContext.elementHtmlIds.has(data)) return undefined\n\n context.replacementContext.elementHtmlIds.add(data)\n\n return data\n}\n\nexport function copyElementIDPropControllerData(\n data: ElementIDPropControllerData | undefined,\n context: CopyContext,\n): ElementIDPropControllerData | undefined {\n return match(data)\n .with(undefined, () => undefined)\n .with({ [ControlDataTypeKey]: ElementIDPropControllerDataV1Type }, (v1) => {\n const value = copyElementID(v1.value, context)\n\n if (value == null) return undefined\n\n return {\n [ControlDataTypeKey]: ElementIDPropControllerDataV1Type,\n value,\n } as const\n })\n .otherwise((v0) => copyElementID(v0, context))\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAClB;AAAA,EACE;AAAA,EAGA;AAAA,OACK;AACP,SAAS,GAAG,aAAa;AAEzB,MAAM,kBAAkB,EAAE,OAAO;AAIjC,MAAM,sCAAsC;AAMrC,MAAM,oCACX;AAEF,MAAM,sCAAsC,EAAE,OAAO;AAAA,EACnD,CAAC,kBAAkB,GAAG,EAAE,QAAQ,iCAAiC;AAAA,EACjE,OAAO;AACT,CAAC;AAMM,MAAM,oCAAoC,EAAE,MAAM;AAAA,EACvD;AAAA,EACA;AACF,CAAC;AAiCM,SAAS,UACd,UAA4B,CAAC,GACN;AACvB,SAAO,EAAE,MAAM,MAAM,WAAW,SAAS,GAAG,QAAQ;AACtD;AAEO,SAAS,wCACd,MACuB;AACvB,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,+CACd,OACA,YAC6B;AAC7B,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;AAEA,SAAS,cACP,MACA,SACuB;AACvB,MAAI,QAAQ;AAAM,WAAO;AAEzB,MAAI,QAAQ,mBAAmB,eAAe,IAAI,IAAI;AAAG,WAAO;AAEhE,UAAQ,mBAAmB,eAAe,IAAI,IAAI;AAElD,SAAO;AACT;AAEO,SAAS,gCACd,MACA,SACyC;AACzC,SAAO,MAAM,IAAI,EACd,KAAK,QAAW,MAAM,MAAS,EAC/B,KAAK,EAAE,CAAC,kBAAkB,GAAG,kCAAkC,GAAG,CAAC,OAAO;AACzE,UAAM,QAAQ,cAAc,GAAG,OAAO,OAAO;AAE7C,QAAI,SAAS;AAAM,aAAO;AAE1B,WAAO;AAAA,MACL,CAAC,kBAAkB,GAAG;AAAA,MACtB;AAAA,IACF;AAAA,EACF,CAAC,EACA,UAAU,CAAC,OAAO,cAAc,IAAI,OAAO,CAAC;AACjD;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/gap-y/gap-y.ts"],"sourcesContent":["import { match } from 'ts-pattern'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { z } from 'zod'\nimport { GapData, ResponsiveGapData, responsiveGapDataSchema } from '../data'\n\nconst gapYPropControllerDataV0Schema = responsiveGapDataSchema\n\nexport type GapYPropControllerDataV0 = z.infer<\n typeof gapYPropControllerDataV0Schema\n>\n\nexport const GapYPropControllerDataV1Type = 'prop-controllers::gap-y::v1'\n\nconst gapYPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(GapYPropControllerDataV1Type),\n value: responsiveGapDataSchema,\n})\n\nexport type GapYPropControllerDataV1 = z.infer<\n typeof gapYPropControllerDataV1Schema\n>\n\nexport const gapYPropControllerDataSchema = z.union([\n gapYPropControllerDataV0Schema,\n gapYPropControllerDataV1Schema,\n])\n\nexport type GapYPropControllerData = z.infer<\n typeof gapYPropControllerDataSchema\n>\n\nexport type GapYOptions = Options<{\n preset?: ResponsiveGapData\n label?: string\n defaultValue?: GapData\n min?: number\n max?: number\n step?: number\n hidden?: boolean\n}>\n\ntype GapYDescriptorV0<\n _T = GapYPropControllerDataV0,\n U extends GapYOptions = GapYOptions,\n> = {\n type: typeof Types.GapY\n options: U\n}\n\ntype GapYDescriptorV1<\n _T = GapYPropControllerData,\n U extends GapYOptions = GapYOptions,\n> = {\n type: typeof Types.GapY\n version: 1\n options: U\n}\n\nexport type GapYDescriptor<\n _T = GapYPropControllerData,\n U extends GapYOptions = GapYOptions,\n> = GapYDescriptorV0<_T, U> | GapYDescriptorV1<_T, U>\n\nexport type ResolveGapYPropControllerValue<T extends GapYDescriptor> =\n T extends GapYDescriptor ? ResponsiveGapData | undefined : never\n\n/**\n * @deprecated Imports from `@makeswift/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function GapY(\n options: GapYOptions = {},\n): GapYDescriptor<GapYPropControllerData> {\n return { type: Types.GapY, version: 1, options }\n}\n\nexport function getGapYPropControllerDataResponsiveGapData(\n data: GapYPropControllerData | undefined,\n): ResponsiveGapData | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: GapYPropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createGapYPropControllerDataFromResponsiveGapData(\n responsiveGapData: ResponsiveGapData,\n definition: GapYDescriptor,\n): GapYPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n () =>\n ({\n [ControlDataTypeKey]: GapYPropControllerDataV1Type,\n value: responsiveGapData,\n } as const
|
|
1
|
+
{"version":3,"sources":["../../../src/gap-y/gap-y.ts"],"sourcesContent":["import { match } from 'ts-pattern'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { z } from 'zod'\nimport { GapData, ResponsiveGapData, responsiveGapDataSchema } from '../data'\n\nconst gapYPropControllerDataV0Schema = responsiveGapDataSchema\n\nexport type GapYPropControllerDataV0 = z.infer<\n typeof gapYPropControllerDataV0Schema\n>\n\nexport const GapYPropControllerDataV1Type = 'prop-controllers::gap-y::v1'\n\nconst gapYPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(GapYPropControllerDataV1Type),\n value: responsiveGapDataSchema,\n})\n\nexport type GapYPropControllerDataV1 = z.infer<\n typeof gapYPropControllerDataV1Schema\n>\n\nexport const gapYPropControllerDataSchema = z.union([\n gapYPropControllerDataV0Schema,\n gapYPropControllerDataV1Schema,\n])\n\nexport type GapYPropControllerData = z.infer<\n typeof gapYPropControllerDataSchema\n>\n\nexport type GapYOptions = Options<{\n preset?: ResponsiveGapData\n label?: string\n defaultValue?: GapData\n min?: number\n max?: number\n step?: number\n hidden?: boolean\n}>\n\ntype GapYDescriptorV0<\n _T = GapYPropControllerDataV0,\n U extends GapYOptions = GapYOptions,\n> = {\n type: typeof Types.GapY\n options: U\n}\n\ntype GapYDescriptorV1<\n _T = GapYPropControllerData,\n U extends GapYOptions = GapYOptions,\n> = {\n type: typeof Types.GapY\n version: 1\n options: U\n}\n\nexport type GapYDescriptor<\n _T = GapYPropControllerData,\n U extends GapYOptions = GapYOptions,\n> = GapYDescriptorV0<_T, U> | GapYDescriptorV1<_T, U>\n\nexport type ResolveGapYPropControllerValue<T extends GapYDescriptor> =\n T extends GapYDescriptor ? ResponsiveGapData | undefined : never\n\n/**\n * @deprecated Imports from `@makeswift/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function GapY(\n options: GapYOptions = {},\n): GapYDescriptor<GapYPropControllerData> {\n return { type: Types.GapY, version: 1, options }\n}\n\nexport function getGapYPropControllerDataResponsiveGapData(\n data: GapYPropControllerData | undefined,\n): ResponsiveGapData | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: GapYPropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createGapYPropControllerDataFromResponsiveGapData(\n responsiveGapData: ResponsiveGapData,\n definition: GapYDescriptor,\n): GapYPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n () =>\n ({\n [ControlDataTypeKey]: GapYPropControllerDataV1Type,\n value: responsiveGapData,\n }) as const,\n )\n .otherwise(() => responsiveGapData)\n}\n"],"mappings":"AAAA,SAAS,aAAa;AACtB,SAAS,oBAA6B,aAAa;AACnD,SAAS,SAAS;AAClB,SAAqC,+BAA+B;AAEpE,MAAM,iCAAiC;AAMhC,MAAM,+BAA+B;AAE5C,MAAM,iCAAiC,EAAE,OAAO;AAAA,EAC9C,CAAC,kBAAkB,GAAG,EAAE,QAAQ,4BAA4B;AAAA,EAC5D,OAAO;AACT,CAAC;AAMM,MAAM,+BAA+B,EAAE,MAAM;AAAA,EAClD;AAAA,EACA;AACF,CAAC;AA6CM,SAAS,KACd,UAAuB,CAAC,GACgB;AACxC,SAAO,EAAE,MAAM,MAAM,MAAM,SAAS,GAAG,QAAQ;AACjD;AAEO,SAAS,2CACd,MAC+B;AAC/B,SAAO,MAAM,IAAI,EACd;AAAA,IACC,EAAE,CAAC,kBAAkB,GAAG,6BAA6B;AAAA,IACrD,CAAC,OAAO,GAAG;AAAA,EACb,EACC,UAAU,CAAC,OAAO,EAAE;AACzB;AAEO,SAAS,kDACd,mBACA,YACwB;AACxB,SAAO,MAAM,UAAU,EACpB;AAAA,IACC,EAAE,SAAS,EAAE;AAAA,IACb,OACG;AAAA,MACC,CAAC,kBAAkB,GAAG;AAAA,MACtB,OAAO;AAAA,IACT;AAAA,EACJ,EACC,UAAU,MAAM,iBAAiB;AACtC;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/social-links/social-links.ts"],"sourcesContent":["import { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst socialLinkTypesV0 = [\n 'angellist',\n 'codepen',\n 'discord',\n 'dribbble',\n 'facebook',\n 'github',\n 'instagram',\n 'linkedin',\n 'medium',\n 'pinterest',\n 'reddit',\n 'rss',\n 'snapchat',\n 'soundcloud',\n 'spotify',\n 'telegram',\n 'tumblr',\n 'twitch',\n 'twitter',\n 'vimeo',\n 'whatsapp',\n 'yelp',\n 'youtube',\n] as const\n\nconst socialLinkTypesV1 = [...socialLinkTypesV0, 'x', 'slack'] as const\n\nconst socialLinkV0Schema = z.object({\n type: z.enum(socialLinkTypesV0),\n url: z.string(),\n})\n\nconst socialLinkV1Schema = z.object({\n type: z.enum(socialLinkTypesV1),\n url: z.string(),\n})\n\nconst socialLinksLinkV0Schema = z.object({\n id: z.string(),\n payload: socialLinkV0Schema,\n})\n\nconst socialLinksLinkV1Schema = z.object({\n id: z.string(),\n payload: socialLinkV1Schema,\n})\n\nconst socialLinksDataV0Schema = z.object({\n links: z.array(socialLinksLinkV0Schema),\n openInNewTab: z.boolean(),\n})\n\nconst socialLinksDataV1Schema = z.object({\n links: z.array(socialLinksLinkV1Schema),\n openInNewTab: z.boolean(),\n})\n\nexport const socialLinksDataSchema = z.union([\n socialLinksDataV0Schema,\n socialLinksDataV1Schema,\n])\n\nexport type SocialLinksData = z.infer<typeof socialLinksDataSchema>\n\nconst socialLinksPropControllerDataV1Schema = socialLinksDataSchema\n\nexport type SocialLinksPropControllerDataV1 = z.infer<\n typeof socialLinksPropControllerDataV1Schema\n>\n\nexport const SocialLinksPropControllerDataV2Type =\n 'prop-controllers::social-links::v2'\n\nconst socialLinksPropControllerDataV2Schema = z.object({\n [ControlDataTypeKey]: z.literal(SocialLinksPropControllerDataV2Type),\n value: socialLinksDataSchema,\n})\n\nexport type SocialLinksPropControllerDataV2 = z.infer<\n typeof socialLinksPropControllerDataV2Schema\n>\n\nexport const socialLinksPropControllerDataSchema = z.union([\n socialLinksPropControllerDataV1Schema,\n socialLinksPropControllerDataV2Schema,\n])\n\nexport type SocialLinksPropControllerData = z.infer<\n typeof socialLinksPropControllerDataSchema\n>\n\nexport type SocialLinksOptions = Options<{\n preset?: SocialLinksPropControllerData\n}>\n\ntype SocialLinksDescriptorV1<_T = SocialLinksPropControllerDataV1> = {\n type: typeof Types.SocialLinks\n version?: 1\n options: SocialLinksOptions\n}\n\ntype SocialLinksDescriptorV2<_T = SocialLinksPropControllerData> = {\n type: typeof Types.SocialLinks\n version: 2\n options: SocialLinksOptions\n}\n\nexport type SocialLinksDescriptor<_T = SocialLinksPropControllerData> =\n | SocialLinksDescriptorV1\n | SocialLinksDescriptorV2\n\nexport type ResolveSocialLinksPropControllerValue<\n T extends SocialLinksDescriptor,\n> = T extends SocialLinksDescriptor ? SocialLinksData | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function SocialLinks(\n options: SocialLinksOptions = {},\n): SocialLinksDescriptorV2 {\n return { type: Types.SocialLinks, version: 2, options }\n}\n\nexport function getSocialLinkTypes(descriptor: SocialLinksDescriptor) {\n return match(descriptor)\n .with({ version: P.union(1, 2) }, () => socialLinkTypesV1)\n .otherwise(() => socialLinkTypesV0)\n}\n\nexport function getSocialLinksPropControllerDataSocialLinksData(\n data: SocialLinksPropControllerData | undefined,\n): SocialLinksData | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: SocialLinksPropControllerDataV2Type },\n (v2) => v2.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createSocialLinksPropControllerDataFromSocialLinksData(\n data: SocialLinksData,\n definition: SocialLinksDescriptor,\n): SocialLinksPropControllerData {\n return match(definition)\n .with(\n { version: 2 },\n () =>\n ({\n [ControlDataTypeKey]: SocialLinksPropControllerDataV2Type,\n value: data,\n } as const
|
|
1
|
+
{"version":3,"sources":["../../../src/social-links/social-links.ts"],"sourcesContent":["import { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst socialLinkTypesV0 = [\n 'angellist',\n 'codepen',\n 'discord',\n 'dribbble',\n 'facebook',\n 'github',\n 'instagram',\n 'linkedin',\n 'medium',\n 'pinterest',\n 'reddit',\n 'rss',\n 'snapchat',\n 'soundcloud',\n 'spotify',\n 'telegram',\n 'tumblr',\n 'twitch',\n 'twitter',\n 'vimeo',\n 'whatsapp',\n 'yelp',\n 'youtube',\n] as const\n\nconst socialLinkTypesV1 = [...socialLinkTypesV0, 'x', 'slack'] as const\n\nconst socialLinkV0Schema = z.object({\n type: z.enum(socialLinkTypesV0),\n url: z.string(),\n})\n\nconst socialLinkV1Schema = z.object({\n type: z.enum(socialLinkTypesV1),\n url: z.string(),\n})\n\nconst socialLinksLinkV0Schema = z.object({\n id: z.string(),\n payload: socialLinkV0Schema,\n})\n\nconst socialLinksLinkV1Schema = z.object({\n id: z.string(),\n payload: socialLinkV1Schema,\n})\n\nconst socialLinksDataV0Schema = z.object({\n links: z.array(socialLinksLinkV0Schema),\n openInNewTab: z.boolean(),\n})\n\nconst socialLinksDataV1Schema = z.object({\n links: z.array(socialLinksLinkV1Schema),\n openInNewTab: z.boolean(),\n})\n\nexport const socialLinksDataSchema = z.union([\n socialLinksDataV0Schema,\n socialLinksDataV1Schema,\n])\n\nexport type SocialLinksData = z.infer<typeof socialLinksDataSchema>\n\nconst socialLinksPropControllerDataV1Schema = socialLinksDataSchema\n\nexport type SocialLinksPropControllerDataV1 = z.infer<\n typeof socialLinksPropControllerDataV1Schema\n>\n\nexport const SocialLinksPropControllerDataV2Type =\n 'prop-controllers::social-links::v2'\n\nconst socialLinksPropControllerDataV2Schema = z.object({\n [ControlDataTypeKey]: z.literal(SocialLinksPropControllerDataV2Type),\n value: socialLinksDataSchema,\n})\n\nexport type SocialLinksPropControllerDataV2 = z.infer<\n typeof socialLinksPropControllerDataV2Schema\n>\n\nexport const socialLinksPropControllerDataSchema = z.union([\n socialLinksPropControllerDataV1Schema,\n socialLinksPropControllerDataV2Schema,\n])\n\nexport type SocialLinksPropControllerData = z.infer<\n typeof socialLinksPropControllerDataSchema\n>\n\nexport type SocialLinksOptions = Options<{\n preset?: SocialLinksPropControllerData\n}>\n\ntype SocialLinksDescriptorV1<_T = SocialLinksPropControllerDataV1> = {\n type: typeof Types.SocialLinks\n version?: 1\n options: SocialLinksOptions\n}\n\ntype SocialLinksDescriptorV2<_T = SocialLinksPropControllerData> = {\n type: typeof Types.SocialLinks\n version: 2\n options: SocialLinksOptions\n}\n\nexport type SocialLinksDescriptor<_T = SocialLinksPropControllerData> =\n | SocialLinksDescriptorV1\n | SocialLinksDescriptorV2\n\nexport type ResolveSocialLinksPropControllerValue<\n T extends SocialLinksDescriptor,\n> = T extends SocialLinksDescriptor ? SocialLinksData | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function SocialLinks(\n options: SocialLinksOptions = {},\n): SocialLinksDescriptorV2 {\n return { type: Types.SocialLinks, version: 2, options }\n}\n\nexport function getSocialLinkTypes(descriptor: SocialLinksDescriptor) {\n return match(descriptor)\n .with({ version: P.union(1, 2) }, () => socialLinkTypesV1)\n .otherwise(() => socialLinkTypesV0)\n}\n\nexport function getSocialLinksPropControllerDataSocialLinksData(\n data: SocialLinksPropControllerData | undefined,\n): SocialLinksData | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: SocialLinksPropControllerDataV2Type },\n (v2) => v2.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createSocialLinksPropControllerDataFromSocialLinksData(\n data: SocialLinksData,\n definition: SocialLinksDescriptor,\n): SocialLinksPropControllerData {\n return match(definition)\n .with(\n { version: 2 },\n () =>\n ({\n [ControlDataTypeKey]: SocialLinksPropControllerDataV2Type,\n value: data,\n }) as const,\n )\n .otherwise(() => data)\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAClB,SAAS,oBAA6B,aAAa;AACnD,SAAS,GAAG,aAAa;AAEzB,MAAM,oBAAoB;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,oBAAoB,CAAC,GAAG,mBAAmB,KAAK,OAAO;AAE7D,MAAM,qBAAqB,EAAE,OAAO;AAAA,EAClC,MAAM,EAAE,KAAK,iBAAiB;AAAA,EAC9B,KAAK,EAAE,OAAO;AAChB,CAAC;AAED,MAAM,qBAAqB,EAAE,OAAO;AAAA,EAClC,MAAM,EAAE,KAAK,iBAAiB;AAAA,EAC9B,KAAK,EAAE,OAAO;AAChB,CAAC;AAED,MAAM,0BAA0B,EAAE,OAAO;AAAA,EACvC,IAAI,EAAE,OAAO;AAAA,EACb,SAAS;AACX,CAAC;AAED,MAAM,0BAA0B,EAAE,OAAO;AAAA,EACvC,IAAI,EAAE,OAAO;AAAA,EACb,SAAS;AACX,CAAC;AAED,MAAM,0BAA0B,EAAE,OAAO;AAAA,EACvC,OAAO,EAAE,MAAM,uBAAuB;AAAA,EACtC,cAAc,EAAE,QAAQ;AAC1B,CAAC;AAED,MAAM,0BAA0B,EAAE,OAAO;AAAA,EACvC,OAAO,EAAE,MAAM,uBAAuB;AAAA,EACtC,cAAc,EAAE,QAAQ;AAC1B,CAAC;AAEM,MAAM,wBAAwB,EAAE,MAAM;AAAA,EAC3C;AAAA,EACA;AACF,CAAC;AAID,MAAM,wCAAwC;AAMvC,MAAM,sCACX;AAEF,MAAM,wCAAwC,EAAE,OAAO;AAAA,EACrD,CAAC,kBAAkB,GAAG,EAAE,QAAQ,mCAAmC;AAAA,EACnE,OAAO;AACT,CAAC;AAMM,MAAM,sCAAsC,EAAE,MAAM;AAAA,EACzD;AAAA,EACA;AACF,CAAC;AAkCM,SAAS,YACd,UAA8B,CAAC,GACN;AACzB,SAAO,EAAE,MAAM,MAAM,aAAa,SAAS,GAAG,QAAQ;AACxD;AAEO,SAAS,mBAAmB,YAAmC;AACpE,SAAO,MAAM,UAAU,EACpB,KAAK,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC,EAAE,GAAG,MAAM,iBAAiB,EACxD,UAAU,MAAM,iBAAiB;AACtC;AAEO,SAAS,gDACd,MAC6B;AAC7B,SAAO,MAAM,IAAI,EACd;AAAA,IACC,EAAE,CAAC,kBAAkB,GAAG,oCAAoC;AAAA,IAC5D,CAAC,OAAO,GAAG;AAAA,EACb,EACC,UAAU,CAAC,OAAO,EAAE;AACzB;AAEO,SAAS,uDACd,MACA,YAC+B;AAC/B,SAAO,MAAM,UAAU,EACpB;AAAA,IACC,EAAE,SAAS,EAAE;AAAA,IACb,OACG;AAAA,MACC,CAAC,kBAAkB,GAAG;AAAA,MACtB,OAAO;AAAA,IACT;AAAA,EACJ,EACC,UAAU,MAAM,IAAI;AACzB;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/video/video.ts"],"sourcesContent":["import { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst videoDataSchema = z.object({\n url: z.string().optional(),\n muted: z.boolean().optional(),\n playing: z.boolean().optional(),\n loop: z.boolean().optional(),\n controls: z.boolean().optional(),\n})\n\nexport type VideoData = z.infer<typeof videoDataSchema>\n\nconst videoPropControllerDataV0Schema = videoDataSchema\n\nexport type VideoPropControllerDataV0 = z.infer<\n typeof videoPropControllerDataV0Schema\n>\n\nexport const VideoPropControllerDataV1Type = 'prop-controllers::video::v1'\n\nconst videoPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(VideoPropControllerDataV1Type),\n value: videoDataSchema,\n})\n\nexport type VideoPropControllerDataV1 = z.infer<\n typeof videoPropControllerDataV1Schema\n>\n\nexport const videoPropControllerDataSchema = z.union([\n videoPropControllerDataV1Schema,\n videoPropControllerDataV0Schema,\n])\n\nexport type VideoPropControllerData = z.infer<\n typeof videoPropControllerDataSchema\n>\n\nexport type VideoOptions = Options<{\n preset?: VideoPropControllerData\n}>\n\ntype VideoDescriptorV0<_T = VideoPropControllerDataV0> = {\n type: typeof Types.Video\n options: VideoOptions\n}\n\ntype VideoDescriptorV1<\n _T = VideoPropControllerData,\n U extends VideoOptions = VideoOptions,\n> = {\n type: typeof Types.Video\n version: 1\n options: U\n}\n\nexport type VideoDescriptor<_T = VideoPropControllerData> =\n | VideoDescriptorV0\n | VideoDescriptorV1\n\nexport type ResolveVideoPropControllerValue<T extends VideoDescriptor> =\n T extends VideoDescriptor ? VideoData | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function Video(options: VideoOptions = {}): VideoDescriptorV1 {\n return { type: Types.Video, version: 1, options }\n}\n\nexport function getVideoPropControllerDataVideoData(\n data: VideoPropControllerData | undefined,\n): VideoData | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: VideoPropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createVideoPropControllerDataFromVideoData(\n value: VideoData,\n definition?: VideoDescriptor,\n): VideoPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n P.nullish,\n () =>\n ({\n [ControlDataTypeKey]: VideoPropControllerDataV1Type,\n value,\n } as const
|
|
1
|
+
{"version":3,"sources":["../../../src/video/video.ts"],"sourcesContent":["import { z } from 'zod'\nimport { ControlDataTypeKey, Options, Types } from '../prop-controllers'\nimport { P, match } from 'ts-pattern'\n\nconst videoDataSchema = z.object({\n url: z.string().optional(),\n muted: z.boolean().optional(),\n playing: z.boolean().optional(),\n loop: z.boolean().optional(),\n controls: z.boolean().optional(),\n})\n\nexport type VideoData = z.infer<typeof videoDataSchema>\n\nconst videoPropControllerDataV0Schema = videoDataSchema\n\nexport type VideoPropControllerDataV0 = z.infer<\n typeof videoPropControllerDataV0Schema\n>\n\nexport const VideoPropControllerDataV1Type = 'prop-controllers::video::v1'\n\nconst videoPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(VideoPropControllerDataV1Type),\n value: videoDataSchema,\n})\n\nexport type VideoPropControllerDataV1 = z.infer<\n typeof videoPropControllerDataV1Schema\n>\n\nexport const videoPropControllerDataSchema = z.union([\n videoPropControllerDataV1Schema,\n videoPropControllerDataV0Schema,\n])\n\nexport type VideoPropControllerData = z.infer<\n typeof videoPropControllerDataSchema\n>\n\nexport type VideoOptions = Options<{\n preset?: VideoPropControllerData\n}>\n\ntype VideoDescriptorV0<_T = VideoPropControllerDataV0> = {\n type: typeof Types.Video\n options: VideoOptions\n}\n\ntype VideoDescriptorV1<\n _T = VideoPropControllerData,\n U extends VideoOptions = VideoOptions,\n> = {\n type: typeof Types.Video\n version: 1\n options: U\n}\n\nexport type VideoDescriptor<_T = VideoPropControllerData> =\n | VideoDescriptorV0\n | VideoDescriptorV1\n\nexport type ResolveVideoPropControllerValue<T extends VideoDescriptor> =\n T extends VideoDescriptor ? VideoData | undefined : never\n\n/**\n * @deprecated Imports from @makeswift/prop-controllers are deprecated. Use\n * @makeswift/runtime/controls instead.\n */\nexport function Video(options: VideoOptions = {}): VideoDescriptorV1 {\n return { type: Types.Video, version: 1, options }\n}\n\nexport function getVideoPropControllerDataVideoData(\n data: VideoPropControllerData | undefined,\n): VideoData | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: VideoPropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createVideoPropControllerDataFromVideoData(\n value: VideoData,\n definition?: VideoDescriptor,\n): VideoPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n P.nullish,\n () =>\n ({\n [ControlDataTypeKey]: VideoPropControllerDataV1Type,\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,kBAAkB,EAAE,OAAO;AAAA,EAC/B,KAAK,EAAE,OAAO,EAAE,SAAS;AAAA,EACzB,OAAO,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC5B,SAAS,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC9B,MAAM,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC3B,UAAU,EAAE,QAAQ,EAAE,SAAS;AACjC,CAAC;AAID,MAAM,kCAAkC;AAMjC,MAAM,gCAAgC;AAE7C,MAAM,kCAAkC,EAAE,OAAO;AAAA,EAC/C,CAAC,kBAAkB,GAAG,EAAE,QAAQ,6BAA6B;AAAA,EAC7D,OAAO;AACT,CAAC;AAMM,MAAM,gCAAgC,EAAE,MAAM;AAAA,EACnD;AAAA,EACA;AACF,CAAC;AAmCM,SAAS,MAAM,UAAwB,CAAC,GAAsB;AACnE,SAAO,EAAE,MAAM,MAAM,OAAO,SAAS,GAAG,QAAQ;AAClD;AAEO,SAAS,oCACd,MACuB;AACvB,SAAO,MAAM,IAAI,EACd;AAAA,IACC,EAAE,CAAC,kBAAkB,GAAG,8BAA8B;AAAA,IACtD,CAAC,OAAO,GAAG;AAAA,EACb,EACC,UAAU,CAAC,OAAO,EAAE;AACzB;AAEO,SAAS,2CACd,OACA,YACyB;AACzB,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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/width/width.ts"],"sourcesContent":["import { P, match } from 'ts-pattern'\nimport { ControlDataTypeKey, ResolveOptions, Types } from '../prop-controllers'\nimport { z } from 'zod'\nimport { LengthData } from '../data'\nimport {\n ResponsiveLengthData,\n responsiveLengthDataSchema,\n} from '../responsive-length'\n\nconst widthPropControllerDataV0Schema = responsiveLengthDataSchema\n\nexport type WidthPropControllerDataV0 = z.infer<\n typeof widthPropControllerDataV0Schema\n>\n\nexport const WidthPropControllerDataV1Type = 'prop-controllers::width::v1'\n\nconst widthPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(WidthPropControllerDataV1Type),\n value: responsiveLengthDataSchema,\n})\n\nexport type WidthPropControllerDataV1 = z.infer<\n typeof widthPropControllerDataV1Schema\n>\n\nexport const widthPropControllerDataSchema = z.union([\n widthPropControllerDataV0Schema,\n widthPropControllerDataV1Schema,\n])\n\nexport type WidthPropControllerData = z.infer<\n typeof widthPropControllerDataSchema\n>\n\nexport const WidthPropControllerFormat = {\n ClassName: 'makeswift::prop-controllers::width::format::class-name',\n ResponsiveValue:\n 'makeswift::prop-controllers::width::format::responsive-value',\n} as const\n\nexport type WidthPropControllerFormat =\n typeof WidthPropControllerFormat[keyof typeof WidthPropControllerFormat]\n\ntype WidthOptions = {\n preset?: WidthPropControllerData\n defaultValue?: LengthData\n format?: WidthPropControllerFormat\n}\n\ntype WidthDescriptorV0<\n _T = WidthPropControllerDataV0,\n U extends WidthOptions = WidthOptions,\n> = {\n type: typeof Types.Width\n options: U\n}\n\ntype WidthDescriptorV1<\n _T = WidthPropControllerData,\n U extends WidthOptions = WidthOptions,\n> = {\n type: typeof Types.Width\n version: 1\n options: U\n}\n\nexport type WidthDescriptor<\n _T = WidthPropControllerData,\n U extends WidthOptions = WidthOptions,\n> = WidthDescriptorV0<_T, U> | WidthDescriptorV1<_T, U>\n\nexport type ResolveWidthPropControllerValue<T extends WidthDescriptor> =\n T extends WidthDescriptor\n ? undefined extends ResolveOptions<T['options']>['format']\n ? ResponsiveLengthData | undefined\n : ResolveOptions<\n
|
|
1
|
+
{"version":3,"sources":["../../../src/width/width.ts"],"sourcesContent":["import { P, match } from 'ts-pattern'\nimport { ControlDataTypeKey, ResolveOptions, Types } from '../prop-controllers'\nimport { z } from 'zod'\nimport { LengthData } from '../data'\nimport {\n ResponsiveLengthData,\n responsiveLengthDataSchema,\n} from '../responsive-length'\n\nconst widthPropControllerDataV0Schema = responsiveLengthDataSchema\n\nexport type WidthPropControllerDataV0 = z.infer<\n typeof widthPropControllerDataV0Schema\n>\n\nexport const WidthPropControllerDataV1Type = 'prop-controllers::width::v1'\n\nconst widthPropControllerDataV1Schema = z.object({\n [ControlDataTypeKey]: z.literal(WidthPropControllerDataV1Type),\n value: responsiveLengthDataSchema,\n})\n\nexport type WidthPropControllerDataV1 = z.infer<\n typeof widthPropControllerDataV1Schema\n>\n\nexport const widthPropControllerDataSchema = z.union([\n widthPropControllerDataV0Schema,\n widthPropControllerDataV1Schema,\n])\n\nexport type WidthPropControllerData = z.infer<\n typeof widthPropControllerDataSchema\n>\n\nexport const WidthPropControllerFormat = {\n ClassName: 'makeswift::prop-controllers::width::format::class-name',\n ResponsiveValue:\n 'makeswift::prop-controllers::width::format::responsive-value',\n} as const\n\nexport type WidthPropControllerFormat =\n (typeof WidthPropControllerFormat)[keyof typeof WidthPropControllerFormat]\n\ntype WidthOptions = {\n preset?: WidthPropControllerData\n defaultValue?: LengthData\n format?: WidthPropControllerFormat\n}\n\ntype WidthDescriptorV0<\n _T = WidthPropControllerDataV0,\n U extends WidthOptions = WidthOptions,\n> = {\n type: typeof Types.Width\n options: U\n}\n\ntype WidthDescriptorV1<\n _T = WidthPropControllerData,\n U extends WidthOptions = WidthOptions,\n> = {\n type: typeof Types.Width\n version: 1\n options: U\n}\n\nexport type WidthDescriptor<\n _T = WidthPropControllerData,\n U extends WidthOptions = WidthOptions,\n> = WidthDescriptorV0<_T, U> | WidthDescriptorV1<_T, U>\n\nexport type ResolveWidthPropControllerValue<T extends WidthDescriptor> =\n T extends WidthDescriptor\n ? undefined extends ResolveOptions<T['options']>['format']\n ? ResponsiveLengthData | undefined\n : ResolveOptions<\n T['options']\n >['format'] extends typeof WidthPropControllerFormat.ClassName\n ? string\n : ResolveOptions<\n T['options']\n >['format'] extends typeof WidthPropControllerFormat.ResponsiveValue\n ? ResponsiveLengthData | undefined\n : never\n : never\n\n/**\n * @deprecated Imports from `@makeswift/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Width<T extends WidthOptions>(\n options: T & WidthOptions = {} as T,\n): WidthDescriptor<WidthPropControllerData, T> {\n return { type: Types.Width, version: 1, options }\n}\n\nWidth.Format = WidthPropControllerFormat\n\nexport function getWidthPropControllerDataResponsiveLengthData(\n data: WidthPropControllerData | undefined,\n): ResponsiveLengthData | undefined {\n return match(data)\n .with(\n { [ControlDataTypeKey]: WidthPropControllerDataV1Type },\n (v1) => v1.value,\n )\n .otherwise((v0) => v0)\n}\n\nexport function createWidthPropControllerDataFromResponsiveLengthData(\n responsiveLengthData: ResponsiveLengthData,\n definition?: WidthDescriptor,\n): WidthPropControllerData {\n return match(definition)\n .with(\n { version: 1 },\n P.nullish,\n () =>\n ({\n [ControlDataTypeKey]: WidthPropControllerDataV1Type,\n value: responsiveLengthData,\n }) as const,\n )\n .otherwise(() => responsiveLengthData)\n}\n"],"mappings":"AAAA,SAAS,GAAG,aAAa;AACzB,SAAS,oBAAoC,aAAa;AAC1D,SAAS,SAAS;AAElB;AAAA,EAEE;AAAA,OACK;AAEP,MAAM,kCAAkC;AAMjC,MAAM,gCAAgC;AAE7C,MAAM,kCAAkC,EAAE,OAAO;AAAA,EAC/C,CAAC,kBAAkB,GAAG,EAAE,QAAQ,6BAA6B;AAAA,EAC7D,OAAO;AACT,CAAC;AAMM,MAAM,gCAAgC,EAAE,MAAM;AAAA,EACnD;AAAA,EACA;AACF,CAAC;AAMM,MAAM,4BAA4B;AAAA,EACvC,WAAW;AAAA,EACX,iBACE;AACJ;AAoDO,SAAS,MACd,UAA4B,CAAC,GACgB;AAC7C,SAAO,EAAE,MAAM,MAAM,OAAO,SAAS,GAAG,QAAQ;AAClD;AAEA,MAAM,SAAS;AAER,SAAS,+CACd,MACkC;AAClC,SAAO,MAAM,IAAI,EACd;AAAA,IACC,EAAE,CAAC,kBAAkB,GAAG,8BAA8B;AAAA,IACtD,CAAC,OAAO,GAAG;AAAA,EACb,EACC,UAAU,CAAC,OAAO,EAAE;AACzB;AAEO,SAAS,sDACd,sBACA,YACyB;AACzB,SAAO,MAAM,UAAU,EACpB;AAAA,IACC,EAAE,SAAS,EAAE;AAAA,IACb,EAAE;AAAA,IACF,OACG;AAAA,MACC,CAAC,kBAAkB,GAAG;AAAA,MACtB,OAAO;AAAA,IACT;AAAA,EACJ,EACC,UAAU,MAAM,oBAAoB;AACzC;","names":[]}
|
|
@@ -151,7 +151,7 @@ export declare const WidthPropControllerFormat: {
|
|
|
151
151
|
readonly ClassName: "makeswift::prop-controllers::width::format::class-name";
|
|
152
152
|
readonly ResponsiveValue: "makeswift::prop-controllers::width::format::responsive-value";
|
|
153
153
|
};
|
|
154
|
-
export type WidthPropControllerFormat = typeof WidthPropControllerFormat[keyof typeof WidthPropControllerFormat];
|
|
154
|
+
export type WidthPropControllerFormat = (typeof WidthPropControllerFormat)[keyof typeof WidthPropControllerFormat];
|
|
155
155
|
type WidthOptions = {
|
|
156
156
|
preset?: WidthPropControllerData;
|
|
157
157
|
defaultValue?: LengthData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"width.d.ts","sourceRoot":"","sources":["../../../src/width/width.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,cAAc,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAC/E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EACL,oBAAoB,EAErB,MAAM,sBAAsB,CAAA;AAE7B,QAAA,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;WAA6B,CAAA;AAElE,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAA;AAED,eAAO,MAAM,6BAA6B,gCAAgC,CAAA;AAE1E,QAAA,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGnC,CAAA;AAEF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAA;AAED,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGxC,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAA;AAED,eAAO,MAAM,yBAAyB;;;CAI5B,CAAA;AAEV,MAAM,MAAM,yBAAyB,GACnC,OAAO,yBAAyB,CAAC,MAAM,OAAO,yBAAyB,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"width.d.ts","sourceRoot":"","sources":["../../../src/width/width.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,cAAc,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAC/E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EACL,oBAAoB,EAErB,MAAM,sBAAsB,CAAA;AAE7B,QAAA,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;WAA6B,CAAA;AAElE,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAA;AAED,eAAO,MAAM,6BAA6B,gCAAgC,CAAA;AAE1E,QAAA,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGnC,CAAA;AAEF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAA;AAED,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGxC,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAA;AAED,eAAO,MAAM,yBAAyB;;;CAI5B,CAAA;AAEV,MAAM,MAAM,yBAAyB,GACnC,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,OAAO,yBAAyB,CAAC,CAAA;AAE5E,KAAK,YAAY,GAAG;IAClB,MAAM,CAAC,EAAE,uBAAuB,CAAA;IAChC,YAAY,CAAC,EAAE,UAAU,CAAA;IACzB,MAAM,CAAC,EAAE,yBAAyB,CAAA;CACnC,CAAA;AAED,KAAK,iBAAiB,CACpB,EAAE,GAAG,yBAAyB,EAC9B,CAAC,SAAS,YAAY,GAAG,YAAY,IACnC;IACF,IAAI,EAAE,OAAO,KAAK,CAAC,KAAK,CAAA;IACxB,OAAO,EAAE,CAAC,CAAA;CACX,CAAA;AAED,KAAK,iBAAiB,CACpB,EAAE,GAAG,uBAAuB,EAC5B,CAAC,SAAS,YAAY,GAAG,YAAY,IACnC;IACF,IAAI,EAAE,OAAO,KAAK,CAAC,KAAK,CAAA;IACxB,OAAO,EAAE,CAAC,CAAA;IACV,OAAO,EAAE,CAAC,CAAA;CACX,CAAA;AAED,MAAM,MAAM,eAAe,CACzB,EAAE,GAAG,uBAAuB,EAC5B,CAAC,SAAS,YAAY,GAAG,YAAY,IACnC,iBAAiB,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,iBAAiB,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AAEvD,MAAM,MAAM,+BAA+B,CAAC,CAAC,SAAS,eAAe,IACnE,CAAC,SAAS,eAAe,GACrB,SAAS,SAAS,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,GACtD,oBAAoB,GAAG,SAAS,GAChC,cAAc,CACV,CAAC,CAAC,SAAS,CAAC,CACb,CAAC,QAAQ,CAAC,SAAS,OAAO,yBAAyB,CAAC,SAAS,GAC9D,MAAM,GACN,cAAc,CACV,CAAC,CAAC,SAAS,CAAC,CACb,CAAC,QAAQ,CAAC,SAAS,OAAO,yBAAyB,CAAC,eAAe,GACpE,oBAAoB,GAAG,SAAS,GAChC,KAAK,GACX,KAAK,CAAA;AAEX;;;GAGG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,YAAY,EAC1C,OAAO,GAAE,CAAC,GAAG,YAAsB,GAClC,eAAe,CAAC,uBAAuB,EAAE,CAAC,CAAC,CAE7C;yBAJe,KAAK;;;;;;AAQrB,wBAAgB,8CAA8C,CAC5D,IAAI,EAAE,uBAAuB,GAAG,SAAS,GACxC,oBAAoB,GAAG,SAAS,CAOlC;AAED,wBAAgB,qDAAqD,CACnE,oBAAoB,EAAE,oBAAoB,EAC1C,UAAU,CAAC,EAAE,eAAe,GAC3B,uBAAuB,CAYzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@makeswift/prop-controllers",
|
|
3
|
-
"version": "0.4.15-canary.
|
|
3
|
+
"version": "0.4.15-canary.2",
|
|
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.21-canary.
|
|
18
|
+
"@makeswift/controls": "0.1.21-canary.2"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@swc/jest": "^0.2.36",
|
|
@@ -23,12 +23,14 @@
|
|
|
23
23
|
"concurrently": "^8.2.2",
|
|
24
24
|
"jest": "^29.7.0",
|
|
25
25
|
"tsup": "^8.0.2",
|
|
26
|
-
"typescript": "^5.1.6"
|
|
26
|
+
"typescript": "^5.1.6",
|
|
27
|
+
"eslint-config": "0.0.0"
|
|
27
28
|
},
|
|
28
29
|
"scripts": {
|
|
29
30
|
"dev": "concurrently -k 'tsc --watch --preserveWatchOutput' 'tsup --watch'",
|
|
30
31
|
"clean": "rm -rf dist",
|
|
31
32
|
"build": "tsc && tsup",
|
|
32
|
-
"test": "jest"
|
|
33
|
+
"test": "jest",
|
|
34
|
+
"lint": "eslint ."
|
|
33
35
|
}
|
|
34
36
|
}
|