@makeswift/runtime 0.18.0-canary.6 → 0.18.0-canary.8

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.
Files changed (95) hide show
  1. package/dist/cjs/builder/serialization/control-serialization.js +4 -19
  2. package/dist/cjs/builder/serialization/control-serialization.js.map +1 -1
  3. package/dist/cjs/components/builtin/Box/Box.js.map +1 -1
  4. package/dist/cjs/components/builtin/Box/register.js +2 -3
  5. package/dist/cjs/components/builtin/Box/register.js.map +1 -1
  6. package/dist/cjs/components/builtin/Button/Button.js.map +1 -1
  7. package/dist/cjs/components/builtin/Button/register.js +2 -3
  8. package/dist/cjs/components/builtin/Button/register.js.map +1 -1
  9. package/dist/cjs/components/builtin/Carousel/Carousel.js.map +1 -1
  10. package/dist/cjs/components/builtin/Carousel/register.js +33 -34
  11. package/dist/cjs/components/builtin/Carousel/register.js.map +1 -1
  12. package/dist/cjs/components/builtin/Countdown/Countdown.js.map +1 -1
  13. package/dist/cjs/components/builtin/Countdown/register.js +19 -20
  14. package/dist/cjs/components/builtin/Countdown/register.js.map +1 -1
  15. package/dist/cjs/components/builtin/Form/Form.js.map +1 -1
  16. package/dist/cjs/components/builtin/Form/register.js +22 -23
  17. package/dist/cjs/components/builtin/Form/register.js.map +1 -1
  18. package/dist/cjs/components/builtin/Navigation/Navigation.js.map +1 -1
  19. package/dist/cjs/components/builtin/Navigation/register.js +28 -29
  20. package/dist/cjs/components/builtin/Navigation/register.js.map +1 -1
  21. package/dist/cjs/components/builtin/SocialLinks/SocialLinks.js.map +1 -1
  22. package/dist/cjs/components/builtin/SocialLinks/register.js +19 -20
  23. package/dist/cjs/components/builtin/SocialLinks/register.js.map +1 -1
  24. package/dist/cjs/next/api-handler/handlers/manifest.js +1 -1
  25. package/dist/cjs/next/components/tests/page-prop-controller.js +4 -4
  26. package/dist/cjs/next/components/tests/page-prop-controller.js.map +1 -1
  27. package/dist/cjs/prop-controllers/descriptors.js +0 -6
  28. package/dist/cjs/prop-controllers/descriptors.js.map +1 -1
  29. package/dist/cjs/prop-controllers/index.js.map +1 -1
  30. package/dist/cjs/runtimes/react/controls.js +20 -0
  31. package/dist/cjs/runtimes/react/controls.js.map +1 -1
  32. package/dist/esm/builder/serialization/control-serialization.js +4 -21
  33. package/dist/esm/builder/serialization/control-serialization.js.map +1 -1
  34. package/dist/esm/components/builtin/Box/Box.js.map +1 -1
  35. package/dist/esm/components/builtin/Box/register.js +3 -3
  36. package/dist/esm/components/builtin/Box/register.js.map +1 -1
  37. package/dist/esm/components/builtin/Button/Button.js.map +1 -1
  38. package/dist/esm/components/builtin/Button/register.js +3 -3
  39. package/dist/esm/components/builtin/Button/register.js.map +1 -1
  40. package/dist/esm/components/builtin/Carousel/Carousel.js.map +1 -1
  41. package/dist/esm/components/builtin/Carousel/register.js +3 -3
  42. package/dist/esm/components/builtin/Carousel/register.js.map +1 -1
  43. package/dist/esm/components/builtin/Countdown/Countdown.js.map +1 -1
  44. package/dist/esm/components/builtin/Countdown/register.js +4 -4
  45. package/dist/esm/components/builtin/Countdown/register.js.map +1 -1
  46. package/dist/esm/components/builtin/Form/Form.js.map +1 -1
  47. package/dist/esm/components/builtin/Form/register.js +5 -5
  48. package/dist/esm/components/builtin/Form/register.js.map +1 -1
  49. package/dist/esm/components/builtin/Navigation/Navigation.js.map +1 -1
  50. package/dist/esm/components/builtin/Navigation/register.js +2 -2
  51. package/dist/esm/components/builtin/Navigation/register.js.map +1 -1
  52. package/dist/esm/components/builtin/SocialLinks/SocialLinks.js.map +1 -1
  53. package/dist/esm/components/builtin/SocialLinks/register.js +4 -4
  54. package/dist/esm/components/builtin/SocialLinks/register.js.map +1 -1
  55. package/dist/esm/next/api-handler/handlers/manifest.js +1 -1
  56. package/dist/esm/next/components/tests/page-prop-controller.js +7 -5
  57. package/dist/esm/next/components/tests/page-prop-controller.js.map +1 -1
  58. package/dist/esm/prop-controllers/descriptors.js +0 -5
  59. package/dist/esm/prop-controllers/descriptors.js.map +1 -1
  60. package/dist/esm/prop-controllers/index.js.map +1 -1
  61. package/dist/esm/runtimes/react/controls.js +22 -0
  62. package/dist/esm/runtimes/react/controls.js.map +1 -1
  63. package/dist/types/builder/serialization/control-serialization.d.ts +4 -19
  64. package/dist/types/builder/serialization/control-serialization.d.ts.map +1 -1
  65. package/dist/types/components/builtin/Box/Box.d.ts +1 -1
  66. package/dist/types/components/builtin/Box/Box.d.ts.map +1 -1
  67. package/dist/types/components/builtin/Button/Button.d.ts +1 -2
  68. package/dist/types/components/builtin/Button/Button.d.ts.map +1 -1
  69. package/dist/types/components/builtin/Carousel/Carousel.d.ts +1 -2
  70. package/dist/types/components/builtin/Carousel/Carousel.d.ts.map +1 -1
  71. package/dist/types/components/builtin/Carousel/register.d.ts.map +1 -1
  72. package/dist/types/components/builtin/Countdown/Countdown.d.ts +1 -2
  73. package/dist/types/components/builtin/Countdown/Countdown.d.ts.map +1 -1
  74. package/dist/types/components/builtin/Countdown/register.d.ts.map +1 -1
  75. package/dist/types/components/builtin/Form/Form.d.ts +1 -2
  76. package/dist/types/components/builtin/Form/Form.d.ts.map +1 -1
  77. package/dist/types/components/builtin/Form/register.d.ts.map +1 -1
  78. package/dist/types/components/builtin/Navigation/Navigation.d.ts +1 -2
  79. package/dist/types/components/builtin/Navigation/Navigation.d.ts.map +1 -1
  80. package/dist/types/components/builtin/Navigation/register.d.ts.map +1 -1
  81. package/dist/types/components/builtin/SocialLinks/SocialLinks.d.ts +1 -2
  82. package/dist/types/components/builtin/SocialLinks/SocialLinks.d.ts.map +1 -1
  83. package/dist/types/components/builtin/SocialLinks/register.d.ts.map +1 -1
  84. package/dist/types/next/components/tests/page-prop-controller.d.ts +3 -3
  85. package/dist/types/next/components/tests/page-prop-controller.d.ts.map +1 -1
  86. package/dist/types/next/components/tests/page-responsive-icon-radio-group-prop-controller.test.d.ts +3 -0
  87. package/dist/types/next/components/tests/page-responsive-icon-radio-group-prop-controller.test.d.ts.map +1 -0
  88. package/dist/types/next/components/tests/page-responsive-select-prop-controller.test.d.ts +3 -0
  89. package/dist/types/next/components/tests/page-responsive-select-prop-controller.test.d.ts.map +1 -0
  90. package/dist/types/prop-controllers/descriptors.d.ts +4 -27
  91. package/dist/types/prop-controllers/descriptors.d.ts.map +1 -1
  92. package/dist/types/prop-controllers/index.d.ts +1 -1
  93. package/dist/types/prop-controllers/index.d.ts.map +1 -1
  94. package/dist/types/runtimes/react/controls.d.ts.map +1 -1
  95. package/package.json +2 -2
@@ -25,7 +25,6 @@ __export(control_serialization_exports, {
25
25
  });
26
26
  module.exports = __toCommonJS(control_serialization_exports);
27
27
  var import_controls = require("../../controls");
28
- var import_prop_controllers2 = require("../../prop-controllers");
29
28
  var import_deleted = require("../../prop-controllers/deleted");
30
29
  var import_combobox = require("./controls/combobox");
31
30
  var import_list = require("./controls/list");
@@ -174,20 +173,6 @@ function deserializeNumberControl(serializedControl) {
174
173
  const deserializedOptions = (0, import_function_serialization.deserializeFunction)(options);
175
174
  return { ...serializedControl, options: deserializedOptions };
176
175
  }
177
- function serializeResponsiveIconRadioGroupControl(control) {
178
- const { options } = control;
179
- if (typeof options !== "function")
180
- return [{ ...control, options }, []];
181
- const serializedOptions = (0, import_function_serialization.serializeFunction)(options);
182
- return [{ ...control, options: serializedOptions }, [serializedOptions]];
183
- }
184
- function deserializeResponsiveIconRadioGroupControl(serializedControl) {
185
- const { options } = serializedControl;
186
- if (!(0, import_function_serialization.isSerializedFunction)(options))
187
- return { ...serializedControl, options };
188
- const deserializedOptions = (0, import_function_serialization.deserializeFunction)(options);
189
- return { ...serializedControl, options: deserializedOptions };
190
- }
191
176
  function serializeDateControl(control) {
192
177
  const { options } = control;
193
178
  if (typeof options !== "function")
@@ -306,8 +291,8 @@ function serializeControl(control) {
306
291
  return serializeControlDef(control);
307
292
  case import_prop_controllers3.Types.Number:
308
293
  return serializeNumberControl(control);
309
- case import_prop_controllers2.Props.Types.ResponsiveIconRadioGroup:
310
- return serializeResponsiveIconRadioGroupControl(control);
294
+ case import_prop_controllers3.Types.ResponsiveIconRadioGroup:
295
+ return serializeControlDef(control);
311
296
  case import_prop_controllers3.Types.ResponsiveSelect:
312
297
  return serializeControlDef(control);
313
298
  case import_prop_controllers3.Types.ResponsiveLength:
@@ -358,8 +343,8 @@ function deserializeControl(serializedControl) {
358
343
  return deserializeControlDef(serializedControl);
359
344
  case import_prop_controllers3.Types.Number:
360
345
  return deserializeNumberControl(serializedControl);
361
- case import_prop_controllers2.Props.Types.ResponsiveIconRadioGroup:
362
- return deserializeResponsiveIconRadioGroupControl(serializedControl);
346
+ case import_prop_controllers3.Types.ResponsiveIconRadioGroup:
347
+ return deserializeControlDef(serializedControl);
363
348
  case import_prop_controllers3.Types.ResponsiveSelect:
364
349
  return deserializeControlDef(serializedControl);
365
350
  case import_prop_controllers3.Types.ResponsiveLength:
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/builder/serialization/control-serialization.ts"],"sourcesContent":["import {\n GapData,\n GapX,\n GapYDescriptor,\n GapYPropControllerData,\n ResponsiveLengthOptions,\n ResponsiveLengthPropControllerData,\n ResponsiveNumber,\n ResponsiveSelect,\n type Descriptor,\n type PropDef,\n type OptionsType,\n} from '@makeswift/prop-controllers'\nimport {\n ComboboxControlDefinition,\n ComboboxControlType,\n ListControlDefinition,\n ListControlType,\n RichTextV2ControlDefinition,\n RichTextV2ControlType,\n ShapeControlDefinition,\n ShapeControlType,\n StyleV2ControlDefinition,\n StyleV2ControlType,\n RichTextValue as RichTextControlValue,\n} from '../../controls'\nimport {\n Data,\n Device,\n ResponsiveIconRadioGroupDescriptor as ResponsiveIconRadioGroupControl,\n ResponsiveIconRadioGroupValue as ResponsiveIconRadioGroupControlValue,\n PanelDescriptor as PanelControl,\n PanelDescriptorType as PanelControlType,\n PanelDescriptorValueType as PanelControlValueType,\n PropControllerDescriptor as Control,\n Props as Controls,\n} from '../../prop-controllers'\nimport {\n DELETED_PROP_CONTROLLER_TYPES,\n ListDescriptor as ListControl,\n ListOptions as ListControlConfig,\n ListValue as ListControlValue,\n ShapeDescriptor as ShapeControl,\n ShapeValue as ShapeControlValue,\n TypeaheadDescriptor as TypeaheadControl,\n TypeaheadOptions as TypeaheadControlConfig,\n TypeaheadValue as TypeaheadControlValue,\n RichTextDescriptor as RichTextControl,\n} from '../../prop-controllers/deleted'\nimport { IconRadioGroupOption } from '../../prop-controllers/descriptors'\nimport {\n deserializeComboboxControlDefinition,\n serializeComboboxControlDefinition,\n} from './controls/combobox'\nimport { deserializeListControlDefinition, serializeListControlDefinition } from './controls/list'\nimport { deserializeRichTextControlV2, serializeRichTextControlV2 } from './controls/rich-text-v2'\nimport {\n deserializeShapeControlDefinition,\n serializeShapeControlDefinition,\n} from './controls/shape'\nimport { deserializeStyleV2Control, serializeStyleV2Control } from './controls/style-v2'\nimport { Deserialize, Serialize } from './controls/types'\nimport {\n DeserializedFunction,\n deserializeFunction,\n isSerializedFunction,\n SerializedFunction,\n serializeFunction,\n} from './function-serialization'\nimport {\n LinkData,\n DateDescriptor as DateControl,\n DatePropControllerData,\n Types as PropControllerTypes,\n ImageDescriptor as ImageControl,\n ImageData as ImageControlValue,\n LinkDescriptor as LinkControl,\n LinkPropControllerData,\n ResponsiveLengthDescriptor,\n NumberOptions,\n NumberPropControllerData,\n NumberDescriptor,\n ResponsiveColorPropControllerData,\n ResponsiveColorDescriptor,\n CheckboxPropControllerData,\n CheckboxDescriptor as CheckboxControl,\n TextStyleDescriptor as TextStyleControl,\n TextStylePropControllerData,\n TextInputDescriptor as TextInputControl,\n} from '@makeswift/prop-controllers'\n\ntype SerializedShapeControlConfig<T extends Record<string, SerializedPanelControl>> = {\n type: T\n preset?: { [K in keyof T]?: SerializedPanelControlValueType<T[K]> }\n}\n\ntype SerializedShapeControl<\n _T extends Record<string, Data>,\n U extends Record<string, SerializedPanelControl>,\n> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.Shape\n options: SerializedShapeControlConfig<U>\n}\n\nfunction serializeShapeControl<\n T extends Record<string, Data>,\n U extends Record<string, PanelControl>,\n>(\n control: ShapeControl<T, U>,\n): [\n SerializedShapeControl<\n T,\n { [K in keyof U]: SerializedPanelControl<PanelControlValueType<U[K]>> }\n >,\n Transferable[],\n] {\n const { type } = control.options\n const transferables: Transferable[] = []\n const serializedType = {} as {\n [K in keyof U]: SerializedPanelControl<PanelControlValueType<U[K]>>\n }\n\n Object.entries(type).forEach(([key, control]) => {\n const [serializedControl, serializedControlTransferables] = serializeControl(control)\n\n serializedType[key as keyof typeof type] = serializedControl as SerializedPanelControl\n transferables.push(...serializedControlTransferables)\n })\n\n // @ts-expect-error: preset types are incompatible\n return [{ ...control, options: { ...control.options, type: serializedType } }, transferables]\n}\n\ntype DeserializedShapeControlConfig<T extends Record<string, DeserializedPanelControl>> = {\n type: T\n preset?: { [K in keyof T]?: DeserializedPanelControlValueType<T[K]> }\n}\n\ntype DeserializedShapeControl<\n _T extends Record<string, Data>,\n U extends Record<string, DeserializedPanelControl>,\n> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.Shape\n options: DeserializedShapeControlConfig<U>\n}\n\nfunction deserializeShapeControl<\n T extends Record<string, Data>,\n U extends Record<string, SerializedPanelControl>,\n>(\n control: SerializedShapeControl<T, U>,\n): DeserializedShapeControl<\n T,\n { [K in keyof U]: DeserializedPanelControl<SerializedPanelControlValueType<U[K]>> }\n> {\n const { type } = control.options\n const deserializedType = {} as {\n [K in keyof U]: DeserializedPanelControl<SerializedPanelControlValueType<U[K]>>\n }\n\n Object.entries(type).forEach(([key, control]) => {\n deserializedType[key as keyof typeof type] = deserializeControl(\n control,\n ) as DeserializedPanelControl\n })\n\n // @ts-expect-error: preset types are incompatible\n return { ...control, options: { ...control.options, type: deserializedType } }\n}\n\ntype SerializedListControlConfig<T extends Data> = {\n type: SerializedPanelControl<T>\n label?: string\n getItemLabel?: SerializedFunction<Exclude<ListControlConfig<T>['getItemLabel'], undefined>>\n preset?: ListControlValue<T>\n defaultValue?: ListControlValue<T>\n}\n\ntype SerializedListControl<T extends ListControlValue = ListControlValue> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.List\n options: SerializedListControlConfig<T extends ListControlValue<infer U> ? U : never>\n}\n\nfunction serializeListControl<T extends Data>(\n control: ListControl<ListControlValue<T>>,\n): [SerializedListControl<ListControlValue<T>>, Transferable[]] {\n const { type, getItemLabel } = control.options\n const transferables: Transferable[] = []\n\n const [serializedType, serializedTypeTransferables] = serializeControl(type)\n const serializedGetItemLabel = getItemLabel && serializeFunction(getItemLabel)\n\n transferables.push(...serializedTypeTransferables)\n if (serializedGetItemLabel != null) transferables.push(serializedGetItemLabel)\n\n return [\n {\n ...control,\n options: {\n ...control.options,\n type: serializedType as SerializedPanelControl,\n getItemLabel: serializedGetItemLabel,\n },\n },\n transferables,\n ]\n}\n\ntype DeserializedListControlConfig<T extends Data> = {\n type: DeserializedPanelControl<T>\n label?: string\n getItemLabel?: DeserializedFunction<Exclude<ListControlConfig<T>['getItemLabel'], undefined>>\n preset?: ListControlValue<T>\n defaultValue?: ListControlValue<T>\n}\n\ntype DeserializedListControl<T extends ListControlValue = ListControlValue> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.List\n options: DeserializedListControlConfig<T extends ListControlValue<infer U> ? U : never>\n}\n\nfunction deserializeListControl<T extends Data>(\n serializedControl: SerializedListControl<ListControlValue<T>>,\n): DeserializedListControl<ListControlValue<T>> {\n const { type, getItemLabel } = serializedControl.options\n\n const deserializedType = deserializeControl(type) as DeserializedPanelControl\n const deserializedGetItemLabel = getItemLabel && deserializeFunction(getItemLabel)\n\n return {\n ...serializedControl,\n options: {\n ...serializedControl.options,\n type: deserializedType,\n getItemLabel: deserializedGetItemLabel,\n },\n }\n}\n\ntype SerializedTypeaheadControlConfig<T extends Data> = {\n getItems: SerializedFunction<TypeaheadControlConfig<T>['getItems']>\n label?: string\n preset?: TypeaheadControlValue<T>\n defaultValue?: TypeaheadControlValue<T>\n}\n\ntype SerializedTypeaheadControl<T extends TypeaheadControlValue = TypeaheadControlValue> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.Typeahead\n options: SerializedTypeaheadControlConfig<T['value']>\n}\n\nfunction serializeTypeaheadControl<T extends Data>(\n control: TypeaheadControl<TypeaheadControlValue<T>>,\n): [SerializedTypeaheadControl<TypeaheadControlValue<T>>, Transferable[]] {\n const { getItems } = control.options\n\n const serializedGetItems = getItems && serializeFunction(getItems)\n\n return [\n { ...control, options: { ...control.options, getItems: serializedGetItems } },\n serializedGetItems == null ? [] : [serializedGetItems],\n ]\n}\n\ntype DeserializedTypeaheadControlConfig<T extends Data> = {\n getItems: DeserializedFunction<TypeaheadControlConfig<T>['getItems']>\n label?: string\n preset?: TypeaheadControlValue<T>\n defaultValue?: TypeaheadControlValue<T>\n}\n\ntype DeserializedTypeaheadControl<T extends TypeaheadControlValue = TypeaheadControlValue> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.Typeahead\n options: DeserializedTypeaheadControlConfig<T['value']>\n}\n\nfunction deserializeTypeaheadControl<T extends Data>(\n serializedControl: SerializedTypeaheadControl<TypeaheadControlValue<T>>,\n): DeserializedTypeaheadControl<TypeaheadControlValue<T>> {\n const { getItems } = serializedControl.options\n\n const deserializedGetItems = getItems && deserializeFunction(getItems)\n\n return {\n ...serializedControl,\n options: { ...serializedControl.options, getItems: deserializedGetItems },\n }\n}\n\ntype SerializedConfig<T> =\n | T\n | SerializedFunction<(props: Record<string, unknown>, deviceMode: Device) => T>\n\nexport type DeserializedConfig<T> =\n | T\n | DeserializedFunction<(props: Record<string, unknown>, deviceMode: Device) => T>\n\ntype SerializedControlDef<P extends PropDef> = Descriptor<P> & {\n options: SerializedConfig<OptionsType<P>>\n}\n\nfunction serializeControlDef<P extends PropDef>(\n control: Descriptor<P>,\n): [SerializedControlDef<P>, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\nexport type DeserializedControlDef<P extends PropDef> = Descriptor<P> & {\n options: DeserializedConfig<OptionsType<P>>\n}\n\nfunction deserializeControlDef<P extends PropDef>(\n serializedControl: SerializedControlDef<P>,\n): DeserializedControlDef<P> {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype GapYControlConfig = {\n preset?: GapYPropControllerData\n label?: string\n defaultValue?: GapData\n min?: number\n max?: number\n step?: number\n hidden?: boolean\n}\n\ntype SerializedGapYControl<_T = GapYPropControllerData> = {\n type: typeof PropControllerTypes.GapY\n options: SerializedConfig<GapYControlConfig>\n}\n\nfunction serializeGapYControl(control: GapYDescriptor): [SerializedGapYControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedGapYControl<_T = GapYPropControllerData> = {\n type: typeof PropControllerTypes.GapY\n options: DeserializedConfig<GapYControlConfig>\n}\n\nfunction deserializeGapYControl(serializedControl: SerializedGapYControl): DeserializedGapYControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype CheckboxControlConfig = {\n preset?: CheckboxPropControllerData\n label: string\n hidden?: boolean\n}\n\ntype SerializedCheckboxControl<_T = CheckboxPropControllerData> = {\n type: typeof PropControllerTypes.Checkbox\n options: SerializedConfig<CheckboxControlConfig>\n}\n\nfunction serializeCheckboxControl(\n control: CheckboxControl,\n): [SerializedCheckboxControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedCheckboxControl<_T = CheckboxPropControllerData> = {\n type: typeof PropControllerTypes.Checkbox\n options: DeserializedConfig<CheckboxControlConfig>\n}\n\nfunction deserializeCheckboxControl(\n serializedControl: SerializedCheckboxControl,\n): DeserializedCheckboxControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype ResponsiveColorControlConfig = { label?: string; placeholder?: string; hidden?: boolean }\n\ntype SerializedResponsiveColorControl<_T = ResponsiveColorPropControllerData> = {\n type: typeof PropControllerTypes.ResponsiveColor\n options: SerializedConfig<ResponsiveColorControlConfig>\n}\n\nfunction serializeResponsiveColorControl(\n control: ResponsiveColorDescriptor,\n): [SerializedResponsiveColorControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedResponsiveColorControl<_T = ResponsiveColorPropControllerData> = {\n type: typeof PropControllerTypes.ResponsiveColor\n options: DeserializedConfig<ResponsiveColorControlConfig>\n}\n\nfunction deserializeResponsiveColorControl(\n serializedControl: SerializedResponsiveColorControl,\n): DeserializedResponsiveColorControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\ntype SerializedNumberControl<_T = NumberPropControllerData> = {\n type: typeof PropControllerTypes.Number\n options: SerializedConfig<NumberOptions>\n}\n\nfunction serializeNumberControl(\n control: NumberDescriptor,\n): [SerializedNumberControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedNumberControl<_T = NumberPropControllerData> = {\n type: typeof PropControllerTypes.Number\n options: DeserializedConfig<NumberOptions>\n}\n\nfunction deserializeNumberControl(\n serializedControl: SerializedNumberControl,\n): DeserializedNumberControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\ntype ResponsiveIconRadioGroupControlConfig<T extends string = string, U extends T = T> = {\n label?: string\n options: IconRadioGroupOption<T>[]\n defaultValue?: U\n hidden?: boolean\n}\n\ntype SerializedResponsiveIconRadioGroupControl<_T = ResponsiveIconRadioGroupControlValue> = {\n type: typeof Controls.Types.ResponsiveIconRadioGroup\n options: SerializedConfig<ResponsiveIconRadioGroupControlConfig>\n}\n\nfunction serializeResponsiveIconRadioGroupControl(\n control: ResponsiveIconRadioGroupControl,\n): [SerializedResponsiveIconRadioGroupControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedResponsiveIconRadioGroupControl<_T = ResponsiveIconRadioGroupControlValue> = {\n type: typeof Controls.Types.ResponsiveIconRadioGroup\n options: DeserializedConfig<ResponsiveIconRadioGroupControlConfig>\n}\n\nfunction deserializeResponsiveIconRadioGroupControl(\n serializedControl: SerializedResponsiveIconRadioGroupControl,\n): DeserializedResponsiveIconRadioGroupControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype DateControlConfig = { preset?: DatePropControllerData }\n\ntype SerializedDateControl<_T = DatePropControllerData> = {\n type: typeof PropControllerTypes.Date\n options: SerializedConfig<DateControlConfig>\n}\n\nfunction serializeDateControl(control: DateControl): [SerializedDateControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedDateControl<_T = DatePropControllerData> = {\n type: typeof PropControllerTypes.Date\n options: DeserializedConfig<DateControlConfig>\n}\n\nfunction deserializeDateControl(serializedControl: SerializedDateControl): DeserializedDateControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype LinkControlConfig = {\n preset?: LinkPropControllerData\n label?: string\n defaultValue?: LinkPropControllerData\n options?: { value: LinkData['type']; label: string }[]\n hidden?: boolean\n}\n\ntype SerializedLinkControl<_T = LinkPropControllerData> = {\n type: typeof PropControllerTypes.Link\n options: SerializedConfig<LinkControlConfig>\n}\n\nfunction serializeLinkControl(control: LinkControl): [SerializedLinkControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedLinkControl<_T = LinkPropControllerData> = {\n type: typeof PropControllerTypes.Link\n options: DeserializedConfig<LinkControlConfig>\n}\n\nfunction deserializeLinkControl(serializedControl: SerializedLinkControl): DeserializedLinkControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype TextInputControlConfig = { label?: string; placeholder?: string; hidden?: boolean }\n\ntype TextInputControlValue = string\n\ntype SerializedTextInputControl<_T = TextInputControlValue> = {\n type: typeof PropControllerTypes.TextInput\n options: SerializedConfig<TextInputControlConfig>\n}\n\nfunction serializeTextInputControl(\n control: TextInputControl,\n): [SerializedTextInputControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedTextInputControl<_T = TextInputControlValue> = {\n type: typeof PropControllerTypes.TextInput\n options: DeserializedConfig<TextInputControlConfig>\n}\n\nfunction deserializeTextInputControl(\n serializedControl: SerializedTextInputControl,\n): DeserializedTextInputControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype SerializedResponsiveLengthControl<_T = ResponsiveLengthPropControllerData> = {\n type: typeof PropControllerTypes.ResponsiveLength\n options: SerializedConfig<ResponsiveLengthOptions>\n}\n\nfunction serializeResponsiveLengthControl(\n control: ResponsiveLengthDescriptor,\n): [SerializedResponsiveLengthControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedResponsiveLengthControl<_T = ResponsiveLengthPropControllerData> = {\n type: typeof PropControllerTypes.ResponsiveLength\n options: DeserializedConfig<ResponsiveLengthOptions>\n}\n\nfunction deserializeResponsiveLengthControl(\n serializedControl: SerializedResponsiveLengthControl,\n): DeserializedResponsiveLengthControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype SerializedTextStyleControl<_T = TextStylePropControllerData> = {\n type: typeof PropControllerTypes.TextStyle\n options: SerializedConfig<TextStyleControlConfig>\n}\n\nfunction serializeTextStyleControl(\n control: TextStyleControl,\n): [SerializedTextStyleControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype TextStyleControlConfig = {\n preset?: TextStylePropControllerData\n label?: string\n hidden?: boolean\n}\n\ntype DeserializedTextStyleControl<_T = TextStylePropControllerData> = {\n type: typeof PropControllerTypes.TextStyle\n options: DeserializedConfig<TextStyleControlConfig>\n}\n\nfunction deserializeTextStyleControl(\n serializedControl: SerializedTextStyleControl,\n): DeserializedTextStyleControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype ImageControlConfig = { label?: string; hidden?: boolean }\n\ntype SerializedImageControl<_T = ImageControlValue> = {\n type: typeof PropControllerTypes.Image\n options: SerializedConfig<ImageControlConfig>\n}\n\nfunction serializeImageControl(control: ImageControl): [SerializedImageControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedImageControl<_T = ImageControlValue> = {\n type: typeof PropControllerTypes.Image\n options: DeserializedConfig<ImageControlConfig>\n}\n\nfunction deserializeImageControl(\n serializedControl: SerializedImageControl,\n): DeserializedImageControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype RichTextControlConfig = { preset?: RichTextControlValue }\n\ntype SerializedRichTextControl<_T = RichTextControlValue> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.RichText\n options: SerializedConfig<RichTextControlConfig>\n}\n\nfunction serializeRichTextControl(\n control: RichTextControl,\n): [SerializedRichTextControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedRichTextControl<_T = RichTextControlValue> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.RichText\n options: DeserializedConfig<RichTextControlConfig>\n}\n\nfunction deserializeRichTextControl(\n serializedControl: SerializedRichTextControl,\n): DeserializedRichTextControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\nexport type SerializedControl<T extends Data = Data> =\n | Exclude<\n Control<T>,\n | ListControl<T extends ListControlValue ? T : ListControlValue>\n | ShapeControl<T extends ShapeControlValue ? T : ShapeControlValue, any>\n | TypeaheadControl<T extends TypeaheadControlValue ? T : TypeaheadControlValue>\n | Descriptor<typeof GapX>\n | GapYDescriptor<T>\n | Descriptor<typeof ResponsiveNumber>\n | CheckboxControl<T>\n | ResponsiveColorDescriptor<T>\n | NumberDescriptor<T>\n | ResponsiveIconRadioGroupControl<\n T extends ResponsiveIconRadioGroupControlValue ? T : ResponsiveIconRadioGroupControlValue\n >\n | Descriptor<typeof ResponsiveSelect>\n | ResponsiveLengthDescriptor<T>\n | DateControl<T>\n | LinkControl<T>\n | TextInputControl<T>\n | TextStyleControl<T>\n | ImageControl<T>\n | RichTextControl<T>\n | RichTextV2ControlDefinition\n | ComboboxControlDefinition\n | ShapeControlDefinition\n | ListControlDefinition\n | StyleV2ControlDefinition\n >\n | SerializedListControl<T extends ListControlValue ? T : ListControlValue>\n | SerializedShapeControl<T extends ShapeControlValue ? T : ShapeControlValue, any>\n | SerializedTypeaheadControl<T extends TypeaheadControlValue ? T : TypeaheadControlValue>\n | SerializedControlDef<typeof GapX>\n | SerializedGapYControl<T>\n | SerializedControlDef<typeof ResponsiveNumber>\n | SerializedCheckboxControl<T>\n | SerializedResponsiveColorControl<T>\n | SerializedNumberControl<T>\n | SerializedResponsiveIconRadioGroupControl<T>\n | SerializedControlDef<typeof ResponsiveSelect>\n | SerializedResponsiveLengthControl<T>\n | SerializedDateControl<T>\n | SerializedLinkControl<T>\n | SerializedTextInputControl<T>\n | SerializedTextStyleControl<T>\n | SerializedImageControl<T>\n | SerializedRichTextControl<T>\n | Serialize<RichTextV2ControlDefinition>\n | Serialize<ComboboxControlDefinition>\n | Serialize<ShapeControlDefinition>\n | Serialize<ListControlDefinition>\n | Serialize<StyleV2ControlDefinition>\n\ntype SerializedPanelControl<T extends Data = Data> = Extract<\n SerializedControl<T>,\n { type: PanelControlType }\n>\n\ntype SerializedPanelControlValueType<T extends SerializedPanelControl> =\n T extends SerializedPanelControl<infer U> ? U : never\n\nexport type DeserializedControl<T extends Data = Data> =\n | Exclude<\n Control<T>,\n | ListControl<T extends ListControlValue ? T : ListControlValue>\n | ShapeControl<T extends ShapeControlValue ? T : ShapeControlValue, any>\n | TypeaheadControl<T extends TypeaheadControlValue ? T : TypeaheadControlValue>\n | Descriptor<typeof GapX>\n | GapYDescriptor<T>\n | Descriptor<typeof ResponsiveNumber>\n | CheckboxControl<T>\n | ResponsiveColorDescriptor<T>\n | NumberDescriptor<T>\n | ResponsiveIconRadioGroupControl<\n T extends ResponsiveIconRadioGroupControlValue ? T : ResponsiveIconRadioGroupControlValue\n >\n | Descriptor<typeof ResponsiveSelect>\n | ResponsiveLengthDescriptor<T>\n | DateControl<T>\n | LinkControl<T>\n | TextInputControl<T>\n | TextStyleControl<T>\n | ImageControl<T>\n | RichTextControl<T>\n | RichTextV2ControlDefinition\n | ComboboxControlDefinition\n | ShapeControlDefinition\n | ListControlDefinition\n | StyleV2ControlDefinition\n >\n | DeserializedListControl<T extends ListControlValue ? T : ListControlValue>\n | DeserializedShapeControl<T extends ShapeControlValue ? T : ShapeControlValue, any>\n | DeserializedTypeaheadControl<T extends TypeaheadControlValue ? T : TypeaheadControlValue>\n | DeserializedControlDef<typeof GapX>\n | DeserializedGapYControl<T>\n | DeserializedControlDef<typeof ResponsiveNumber>\n | DeserializedCheckboxControl<T>\n | DeserializedResponsiveColorControl<T>\n | DeserializedNumberControl<T>\n | DeserializedResponsiveIconRadioGroupControl<T>\n | DeserializedControlDef<typeof ResponsiveSelect>\n | DeserializedResponsiveLengthControl<T>\n | DeserializedDateControl<T>\n | DeserializedLinkControl<T>\n | DeserializedTextInputControl<T>\n | DeserializedTextStyleControl<T>\n | DeserializedImageControl<T>\n | DeserializedRichTextControl<T>\n | Deserialize<Serialize<RichTextV2ControlDefinition>>\n | Deserialize<Serialize<ComboboxControlDefinition>>\n | Deserialize<Serialize<ShapeControlDefinition>>\n | Deserialize<Serialize<ListControlDefinition>>\n | Deserialize<Serialize<StyleV2ControlDefinition>>\n\nexport type DeserializedPanelControl<T extends Data = Data> = Extract<\n DeserializedControl<T>,\n { type: PanelControlType }\n>\n\ntype DeserializedPanelControlValueType<T extends DeserializedPanelControl> =\n T extends DeserializedPanelControl<infer U> ? U : never\n\nexport function serializeControl<T extends Data>(\n control: Control<T>,\n): [SerializedControl<T>, Transferable[]] {\n switch (control.type) {\n case PropControllerTypes.Checkbox:\n return serializeCheckboxControl(control)\n\n case DELETED_PROP_CONTROLLER_TYPES.List:\n return serializeListControl(control)\n\n case DELETED_PROP_CONTROLLER_TYPES.Shape:\n return serializeShapeControl(control)\n\n case DELETED_PROP_CONTROLLER_TYPES.Typeahead:\n return serializeTypeaheadControl(control)\n\n case PropControllerTypes.GapX:\n return serializeControlDef<typeof GapX>(control)\n\n case PropControllerTypes.GapY:\n return serializeGapYControl(control)\n\n case PropControllerTypes.ResponsiveColor:\n return serializeResponsiveColorControl(control)\n\n case PropControllerTypes.ResponsiveNumber:\n return serializeControlDef<typeof ResponsiveNumber>(control)\n\n case PropControllerTypes.Number:\n return serializeNumberControl(control)\n\n case Controls.Types.ResponsiveIconRadioGroup:\n return serializeResponsiveIconRadioGroupControl(control)\n\n case PropControllerTypes.ResponsiveSelect:\n return serializeControlDef<typeof ResponsiveSelect>(control)\n\n case PropControllerTypes.ResponsiveLength:\n return serializeResponsiveLengthControl(control)\n\n case PropControllerTypes.Date:\n return serializeDateControl(control)\n\n case PropControllerTypes.Link:\n return serializeLinkControl(control)\n\n case PropControllerTypes.TextInput:\n return serializeTextInputControl(control)\n\n case PropControllerTypes.TextStyle:\n return serializeTextStyleControl(control)\n\n case PropControllerTypes.Image:\n return serializeImageControl(control)\n\n case DELETED_PROP_CONTROLLER_TYPES.RichText:\n return serializeRichTextControl(control)\n\n case RichTextV2ControlType:\n return serializeRichTextControlV2(control)\n\n case StyleV2ControlType:\n return serializeStyleV2Control(control)\n\n case ComboboxControlType:\n return serializeComboboxControlDefinition(control)\n\n case ShapeControlType:\n return serializeShapeControlDefinition(control)\n\n case ListControlType:\n return serializeListControlDefinition(control)\n\n default:\n return [control, []]\n }\n}\n\nexport function deserializeControl<T extends Data>(\n serializedControl: SerializedControl<T>,\n): DeserializedControl<T> {\n switch (serializedControl.type) {\n case PropControllerTypes.Checkbox:\n return deserializeCheckboxControl(serializedControl)\n\n case DELETED_PROP_CONTROLLER_TYPES.List:\n return deserializeListControl(serializedControl)\n\n case DELETED_PROP_CONTROLLER_TYPES.Shape:\n return deserializeShapeControl(serializedControl)\n\n case DELETED_PROP_CONTROLLER_TYPES.Typeahead:\n return deserializeTypeaheadControl(serializedControl)\n\n case PropControllerTypes.GapX:\n return deserializeControlDef<typeof GapX>(serializedControl)\n\n case PropControllerTypes.GapY:\n return deserializeGapYControl(serializedControl)\n\n case PropControllerTypes.ResponsiveColor:\n return deserializeResponsiveColorControl(serializedControl)\n\n case PropControllerTypes.ResponsiveNumber:\n return deserializeControlDef<typeof ResponsiveNumber>(serializedControl)\n\n case PropControllerTypes.Number:\n return deserializeNumberControl(serializedControl)\n\n case Controls.Types.ResponsiveIconRadioGroup:\n return deserializeResponsiveIconRadioGroupControl(serializedControl)\n\n case PropControllerTypes.ResponsiveSelect:\n return deserializeControlDef<typeof ResponsiveSelect>(serializedControl)\n\n case PropControllerTypes.ResponsiveLength:\n return deserializeResponsiveLengthControl(serializedControl)\n\n case PropControllerTypes.Date:\n return deserializeDateControl(serializedControl)\n\n case PropControllerTypes.Link:\n return deserializeLinkControl(serializedControl)\n\n case PropControllerTypes.TextInput:\n return deserializeTextInputControl(serializedControl)\n\n case PropControllerTypes.TextStyle:\n return deserializeTextStyleControl(serializedControl)\n\n case PropControllerTypes.Image:\n return deserializeImageControl(serializedControl)\n\n case DELETED_PROP_CONTROLLER_TYPES.RichText:\n return deserializeRichTextControl(serializedControl)\n\n case RichTextV2ControlType:\n return deserializeRichTextControlV2(serializedControl)\n\n case StyleV2ControlType:\n return deserializeStyleV2Control(serializedControl)\n\n case ComboboxControlType:\n return deserializeComboboxControlDefinition(serializedControl)\n\n case ShapeControlType:\n return deserializeShapeControlDefinition(serializedControl)\n\n case ListControlType:\n return deserializeListControlDefinition(serializedControl)\n\n default:\n return serializedControl\n }\n}\n\nexport function serializeControls(\n controls: Record<string, Control>,\n): [Record<string, SerializedControl>, Transferable[]] {\n return Object.entries(controls).reduce(\n ([accControls, accTransferables], [key, control]) => {\n const [serializedControl, transferables] = serializeControl(control)\n\n return [{ ...accControls, [key]: serializedControl }, [...accTransferables, ...transferables]]\n },\n [{}, []] as [Record<string, SerializedControl>, Transferable[]],\n )\n}\n\nexport function deserializeControls(\n serializedControls: Record<string, SerializedControl>,\n): Record<string, DeserializedControl> {\n return Object.entries(serializedControls).reduce(\n (deserializedControls, [key, serializedControl]) => {\n return { ...deserializedControls, [key]: deserializeControl(serializedControl) }\n },\n {} as Record<string, DeserializedControl>,\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA,sBAYO;AACP,IAAAA,2BAUO;AACP,qBAWO;AAEP,sBAGO;AACP,kBAAiF;AACjF,0BAAyE;AACzE,mBAGO;AACP,sBAAmE;AAEnE,oCAMO;AACP,IAAAA,2BAoBO;AAeP,SAAS,sBAIP,SAOA;AACA,QAAM,EAAE,KAAK,IAAI,QAAQ;AACzB,QAAM,gBAAgC,CAAC;AACvC,QAAM,iBAAiB,CAAC;AAIxB,SAAO,QAAQ,IAAI,EAAE,QAAQ,CAAC,CAAC,KAAKC,QAAO,MAAM;AAC/C,UAAM,CAAC,mBAAmB,8BAA8B,IAAI,iBAAiBA,QAAO;AAEpF,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B,aAAa,IAAI,iBAAiB,OAAO;AAEnE,aAAO,CAAC,EAAE,GAAG,aAAa,CAAC,GAAG,GAAG,kBAAkB,GAAG,CAAC,GAAG,kBAAkB,GAAG,aAAa,CAAC;AAAA,IAC/F;AAAA,IACA,CAAC,CAAC,GAAG,CAAC,CAAC;AAAA,EACT;AACF;AAEO,SAAS,oBACd,oBACqC;AACrC,SAAO,OAAO,QAAQ,kBAAkB,EAAE;AAAA,IACxC,CAAC,sBAAsB,CAAC,KAAK,iBAAiB,MAAM;AAClD,aAAO,EAAE,GAAG,sBAAsB,CAAC,GAAG,GAAG,mBAAmB,iBAAiB,EAAE;AAAA,IACjF;AAAA,IACA,CAAC;AAAA,EACH;AACF;","names":["import_prop_controllers","control","PropControllerTypes","Controls"]}
1
+ {"version":3,"sources":["../../../../src/builder/serialization/control-serialization.ts"],"sourcesContent":["import {\n GapData,\n GapX,\n GapYDescriptor,\n GapYPropControllerData,\n ResponsiveLengthOptions,\n ResponsiveLengthPropControllerData,\n ResponsiveIconRadioGroup,\n ResponsiveNumber,\n ResponsiveSelect,\n type Descriptor,\n type PropDef,\n type OptionsType,\n} from '@makeswift/prop-controllers'\nimport {\n ComboboxControlDefinition,\n ComboboxControlType,\n ListControlDefinition,\n ListControlType,\n RichTextV2ControlDefinition,\n RichTextV2ControlType,\n ShapeControlDefinition,\n ShapeControlType,\n StyleV2ControlDefinition,\n StyleV2ControlType,\n RichTextValue as RichTextControlValue,\n} from '../../controls'\nimport {\n Data,\n Device,\n PanelDescriptor as PanelControl,\n PanelDescriptorType as PanelControlType,\n PanelDescriptorValueType as PanelControlValueType,\n PropControllerDescriptor as Control,\n} from '../../prop-controllers'\nimport {\n DELETED_PROP_CONTROLLER_TYPES,\n ListDescriptor as ListControl,\n ListOptions as ListControlConfig,\n ListValue as ListControlValue,\n ShapeDescriptor as ShapeControl,\n ShapeValue as ShapeControlValue,\n TypeaheadDescriptor as TypeaheadControl,\n TypeaheadOptions as TypeaheadControlConfig,\n TypeaheadValue as TypeaheadControlValue,\n RichTextDescriptor as RichTextControl,\n} from '../../prop-controllers/deleted'\nimport {\n deserializeComboboxControlDefinition,\n serializeComboboxControlDefinition,\n} from './controls/combobox'\nimport { deserializeListControlDefinition, serializeListControlDefinition } from './controls/list'\nimport { deserializeRichTextControlV2, serializeRichTextControlV2 } from './controls/rich-text-v2'\nimport {\n deserializeShapeControlDefinition,\n serializeShapeControlDefinition,\n} from './controls/shape'\nimport { deserializeStyleV2Control, serializeStyleV2Control } from './controls/style-v2'\nimport { Deserialize, Serialize } from './controls/types'\nimport {\n DeserializedFunction,\n deserializeFunction,\n isSerializedFunction,\n SerializedFunction,\n serializeFunction,\n} from './function-serialization'\nimport {\n LinkData,\n DateDescriptor as DateControl,\n DatePropControllerData,\n Types as PropControllerTypes,\n ImageDescriptor as ImageControl,\n ImageData as ImageControlValue,\n LinkDescriptor as LinkControl,\n LinkPropControllerData,\n ResponsiveLengthDescriptor,\n NumberOptions,\n NumberPropControllerData,\n NumberDescriptor,\n ResponsiveColorPropControllerData,\n ResponsiveColorDescriptor,\n CheckboxPropControllerData,\n CheckboxDescriptor as CheckboxControl,\n TextStyleDescriptor as TextStyleControl,\n TextStylePropControllerData,\n TextInputDescriptor as TextInputControl,\n} from '@makeswift/prop-controllers'\n\ntype SerializedShapeControlConfig<T extends Record<string, SerializedPanelControl>> = {\n type: T\n preset?: { [K in keyof T]?: SerializedPanelControlValueType<T[K]> }\n}\n\ntype SerializedShapeControl<\n _T extends Record<string, Data>,\n U extends Record<string, SerializedPanelControl>,\n> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.Shape\n options: SerializedShapeControlConfig<U>\n}\n\nfunction serializeShapeControl<\n T extends Record<string, Data>,\n U extends Record<string, PanelControl>,\n>(\n control: ShapeControl<T, U>,\n): [\n SerializedShapeControl<\n T,\n { [K in keyof U]: SerializedPanelControl<PanelControlValueType<U[K]>> }\n >,\n Transferable[],\n] {\n const { type } = control.options\n const transferables: Transferable[] = []\n const serializedType = {} as {\n [K in keyof U]: SerializedPanelControl<PanelControlValueType<U[K]>>\n }\n\n Object.entries(type).forEach(([key, control]) => {\n const [serializedControl, serializedControlTransferables] = serializeControl(control)\n\n serializedType[key as keyof typeof type] = serializedControl as SerializedPanelControl\n transferables.push(...serializedControlTransferables)\n })\n\n // @ts-expect-error: preset types are incompatible\n return [{ ...control, options: { ...control.options, type: serializedType } }, transferables]\n}\n\ntype DeserializedShapeControlConfig<T extends Record<string, DeserializedPanelControl>> = {\n type: T\n preset?: { [K in keyof T]?: DeserializedPanelControlValueType<T[K]> }\n}\n\ntype DeserializedShapeControl<\n _T extends Record<string, Data>,\n U extends Record<string, DeserializedPanelControl>,\n> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.Shape\n options: DeserializedShapeControlConfig<U>\n}\n\nfunction deserializeShapeControl<\n T extends Record<string, Data>,\n U extends Record<string, SerializedPanelControl>,\n>(\n control: SerializedShapeControl<T, U>,\n): DeserializedShapeControl<\n T,\n { [K in keyof U]: DeserializedPanelControl<SerializedPanelControlValueType<U[K]>> }\n> {\n const { type } = control.options\n const deserializedType = {} as {\n [K in keyof U]: DeserializedPanelControl<SerializedPanelControlValueType<U[K]>>\n }\n\n Object.entries(type).forEach(([key, control]) => {\n deserializedType[key as keyof typeof type] = deserializeControl(\n control,\n ) as DeserializedPanelControl\n })\n\n // @ts-expect-error: preset types are incompatible\n return { ...control, options: { ...control.options, type: deserializedType } }\n}\n\ntype SerializedListControlConfig<T extends Data> = {\n type: SerializedPanelControl<T>\n label?: string\n getItemLabel?: SerializedFunction<Exclude<ListControlConfig<T>['getItemLabel'], undefined>>\n preset?: ListControlValue<T>\n defaultValue?: ListControlValue<T>\n}\n\ntype SerializedListControl<T extends ListControlValue = ListControlValue> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.List\n options: SerializedListControlConfig<T extends ListControlValue<infer U> ? U : never>\n}\n\nfunction serializeListControl<T extends Data>(\n control: ListControl<ListControlValue<T>>,\n): [SerializedListControl<ListControlValue<T>>, Transferable[]] {\n const { type, getItemLabel } = control.options\n const transferables: Transferable[] = []\n\n const [serializedType, serializedTypeTransferables] = serializeControl(type)\n const serializedGetItemLabel = getItemLabel && serializeFunction(getItemLabel)\n\n transferables.push(...serializedTypeTransferables)\n if (serializedGetItemLabel != null) transferables.push(serializedGetItemLabel)\n\n return [\n {\n ...control,\n options: {\n ...control.options,\n type: serializedType as SerializedPanelControl,\n getItemLabel: serializedGetItemLabel,\n },\n },\n transferables,\n ]\n}\n\ntype DeserializedListControlConfig<T extends Data> = {\n type: DeserializedPanelControl<T>\n label?: string\n getItemLabel?: DeserializedFunction<Exclude<ListControlConfig<T>['getItemLabel'], undefined>>\n preset?: ListControlValue<T>\n defaultValue?: ListControlValue<T>\n}\n\ntype DeserializedListControl<T extends ListControlValue = ListControlValue> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.List\n options: DeserializedListControlConfig<T extends ListControlValue<infer U> ? U : never>\n}\n\nfunction deserializeListControl<T extends Data>(\n serializedControl: SerializedListControl<ListControlValue<T>>,\n): DeserializedListControl<ListControlValue<T>> {\n const { type, getItemLabel } = serializedControl.options\n\n const deserializedType = deserializeControl(type) as DeserializedPanelControl\n const deserializedGetItemLabel = getItemLabel && deserializeFunction(getItemLabel)\n\n return {\n ...serializedControl,\n options: {\n ...serializedControl.options,\n type: deserializedType,\n getItemLabel: deserializedGetItemLabel,\n },\n }\n}\n\ntype SerializedTypeaheadControlConfig<T extends Data> = {\n getItems: SerializedFunction<TypeaheadControlConfig<T>['getItems']>\n label?: string\n preset?: TypeaheadControlValue<T>\n defaultValue?: TypeaheadControlValue<T>\n}\n\ntype SerializedTypeaheadControl<T extends TypeaheadControlValue = TypeaheadControlValue> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.Typeahead\n options: SerializedTypeaheadControlConfig<T['value']>\n}\n\nfunction serializeTypeaheadControl<T extends Data>(\n control: TypeaheadControl<TypeaheadControlValue<T>>,\n): [SerializedTypeaheadControl<TypeaheadControlValue<T>>, Transferable[]] {\n const { getItems } = control.options\n\n const serializedGetItems = getItems && serializeFunction(getItems)\n\n return [\n { ...control, options: { ...control.options, getItems: serializedGetItems } },\n serializedGetItems == null ? [] : [serializedGetItems],\n ]\n}\n\ntype DeserializedTypeaheadControlConfig<T extends Data> = {\n getItems: DeserializedFunction<TypeaheadControlConfig<T>['getItems']>\n label?: string\n preset?: TypeaheadControlValue<T>\n defaultValue?: TypeaheadControlValue<T>\n}\n\ntype DeserializedTypeaheadControl<T extends TypeaheadControlValue = TypeaheadControlValue> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.Typeahead\n options: DeserializedTypeaheadControlConfig<T['value']>\n}\n\nfunction deserializeTypeaheadControl<T extends Data>(\n serializedControl: SerializedTypeaheadControl<TypeaheadControlValue<T>>,\n): DeserializedTypeaheadControl<TypeaheadControlValue<T>> {\n const { getItems } = serializedControl.options\n\n const deserializedGetItems = getItems && deserializeFunction(getItems)\n\n return {\n ...serializedControl,\n options: { ...serializedControl.options, getItems: deserializedGetItems },\n }\n}\n\ntype SerializedConfig<T> =\n | T\n | SerializedFunction<(props: Record<string, unknown>, deviceMode: Device) => T>\n\nexport type DeserializedConfig<T> =\n | T\n | DeserializedFunction<(props: Record<string, unknown>, deviceMode: Device) => T>\n\ntype SerializedControlDef<P extends PropDef> = Descriptor<P> & {\n options: SerializedConfig<OptionsType<P>>\n}\n\nfunction serializeControlDef<P extends PropDef>(\n control: Descriptor<P>,\n): [SerializedControlDef<P>, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\nexport type DeserializedControlDef<P extends PropDef> = Descriptor<P> & {\n options: DeserializedConfig<OptionsType<P>>\n}\n\nfunction deserializeControlDef<P extends PropDef>(\n serializedControl: SerializedControlDef<P>,\n): DeserializedControlDef<P> {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype GapYControlConfig = {\n preset?: GapYPropControllerData\n label?: string\n defaultValue?: GapData\n min?: number\n max?: number\n step?: number\n hidden?: boolean\n}\n\ntype SerializedGapYControl<_T = GapYPropControllerData> = {\n type: typeof PropControllerTypes.GapY\n options: SerializedConfig<GapYControlConfig>\n}\n\nfunction serializeGapYControl(control: GapYDescriptor): [SerializedGapYControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedGapYControl<_T = GapYPropControllerData> = {\n type: typeof PropControllerTypes.GapY\n options: DeserializedConfig<GapYControlConfig>\n}\n\nfunction deserializeGapYControl(serializedControl: SerializedGapYControl): DeserializedGapYControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype CheckboxControlConfig = {\n preset?: CheckboxPropControllerData\n label: string\n hidden?: boolean\n}\n\ntype SerializedCheckboxControl<_T = CheckboxPropControllerData> = {\n type: typeof PropControllerTypes.Checkbox\n options: SerializedConfig<CheckboxControlConfig>\n}\n\nfunction serializeCheckboxControl(\n control: CheckboxControl,\n): [SerializedCheckboxControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedCheckboxControl<_T = CheckboxPropControllerData> = {\n type: typeof PropControllerTypes.Checkbox\n options: DeserializedConfig<CheckboxControlConfig>\n}\n\nfunction deserializeCheckboxControl(\n serializedControl: SerializedCheckboxControl,\n): DeserializedCheckboxControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype ResponsiveColorControlConfig = { label?: string; placeholder?: string; hidden?: boolean }\n\ntype SerializedResponsiveColorControl<_T = ResponsiveColorPropControllerData> = {\n type: typeof PropControllerTypes.ResponsiveColor\n options: SerializedConfig<ResponsiveColorControlConfig>\n}\n\nfunction serializeResponsiveColorControl(\n control: ResponsiveColorDescriptor,\n): [SerializedResponsiveColorControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedResponsiveColorControl<_T = ResponsiveColorPropControllerData> = {\n type: typeof PropControllerTypes.ResponsiveColor\n options: DeserializedConfig<ResponsiveColorControlConfig>\n}\n\nfunction deserializeResponsiveColorControl(\n serializedControl: SerializedResponsiveColorControl,\n): DeserializedResponsiveColorControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\ntype SerializedNumberControl<_T = NumberPropControllerData> = {\n type: typeof PropControllerTypes.Number\n options: SerializedConfig<NumberOptions>\n}\n\nfunction serializeNumberControl(\n control: NumberDescriptor,\n): [SerializedNumberControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedNumberControl<_T = NumberPropControllerData> = {\n type: typeof PropControllerTypes.Number\n options: DeserializedConfig<NumberOptions>\n}\n\nfunction deserializeNumberControl(\n serializedControl: SerializedNumberControl,\n): DeserializedNumberControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype DateControlConfig = { preset?: DatePropControllerData }\n\ntype SerializedDateControl<_T = DatePropControllerData> = {\n type: typeof PropControllerTypes.Date\n options: SerializedConfig<DateControlConfig>\n}\n\nfunction serializeDateControl(control: DateControl): [SerializedDateControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedDateControl<_T = DatePropControllerData> = {\n type: typeof PropControllerTypes.Date\n options: DeserializedConfig<DateControlConfig>\n}\n\nfunction deserializeDateControl(serializedControl: SerializedDateControl): DeserializedDateControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype LinkControlConfig = {\n preset?: LinkPropControllerData\n label?: string\n defaultValue?: LinkPropControllerData\n options?: { value: LinkData['type']; label: string }[]\n hidden?: boolean\n}\n\ntype SerializedLinkControl<_T = LinkPropControllerData> = {\n type: typeof PropControllerTypes.Link\n options: SerializedConfig<LinkControlConfig>\n}\n\nfunction serializeLinkControl(control: LinkControl): [SerializedLinkControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedLinkControl<_T = LinkPropControllerData> = {\n type: typeof PropControllerTypes.Link\n options: DeserializedConfig<LinkControlConfig>\n}\n\nfunction deserializeLinkControl(serializedControl: SerializedLinkControl): DeserializedLinkControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype TextInputControlConfig = { label?: string; placeholder?: string; hidden?: boolean }\n\ntype TextInputControlValue = string\n\ntype SerializedTextInputControl<_T = TextInputControlValue> = {\n type: typeof PropControllerTypes.TextInput\n options: SerializedConfig<TextInputControlConfig>\n}\n\nfunction serializeTextInputControl(\n control: TextInputControl,\n): [SerializedTextInputControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedTextInputControl<_T = TextInputControlValue> = {\n type: typeof PropControllerTypes.TextInput\n options: DeserializedConfig<TextInputControlConfig>\n}\n\nfunction deserializeTextInputControl(\n serializedControl: SerializedTextInputControl,\n): DeserializedTextInputControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype SerializedResponsiveLengthControl<_T = ResponsiveLengthPropControllerData> = {\n type: typeof PropControllerTypes.ResponsiveLength\n options: SerializedConfig<ResponsiveLengthOptions>\n}\n\nfunction serializeResponsiveLengthControl(\n control: ResponsiveLengthDescriptor,\n): [SerializedResponsiveLengthControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedResponsiveLengthControl<_T = ResponsiveLengthPropControllerData> = {\n type: typeof PropControllerTypes.ResponsiveLength\n options: DeserializedConfig<ResponsiveLengthOptions>\n}\n\nfunction deserializeResponsiveLengthControl(\n serializedControl: SerializedResponsiveLengthControl,\n): DeserializedResponsiveLengthControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype SerializedTextStyleControl<_T = TextStylePropControllerData> = {\n type: typeof PropControllerTypes.TextStyle\n options: SerializedConfig<TextStyleControlConfig>\n}\n\nfunction serializeTextStyleControl(\n control: TextStyleControl,\n): [SerializedTextStyleControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype TextStyleControlConfig = {\n preset?: TextStylePropControllerData\n label?: string\n hidden?: boolean\n}\n\ntype DeserializedTextStyleControl<_T = TextStylePropControllerData> = {\n type: typeof PropControllerTypes.TextStyle\n options: DeserializedConfig<TextStyleControlConfig>\n}\n\nfunction deserializeTextStyleControl(\n serializedControl: SerializedTextStyleControl,\n): DeserializedTextStyleControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype ImageControlConfig = { label?: string; hidden?: boolean }\n\ntype SerializedImageControl<_T = ImageControlValue> = {\n type: typeof PropControllerTypes.Image\n options: SerializedConfig<ImageControlConfig>\n}\n\nfunction serializeImageControl(control: ImageControl): [SerializedImageControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedImageControl<_T = ImageControlValue> = {\n type: typeof PropControllerTypes.Image\n options: DeserializedConfig<ImageControlConfig>\n}\n\nfunction deserializeImageControl(\n serializedControl: SerializedImageControl,\n): DeserializedImageControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype RichTextControlConfig = { preset?: RichTextControlValue }\n\ntype SerializedRichTextControl<_T = RichTextControlValue> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.RichText\n options: SerializedConfig<RichTextControlConfig>\n}\n\nfunction serializeRichTextControl(\n control: RichTextControl,\n): [SerializedRichTextControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedRichTextControl<_T = RichTextControlValue> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.RichText\n options: DeserializedConfig<RichTextControlConfig>\n}\n\nfunction deserializeRichTextControl(\n serializedControl: SerializedRichTextControl,\n): DeserializedRichTextControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\nexport type SerializedControl<T extends Data = Data> =\n | Exclude<\n Control<T>,\n | ListControl<T extends ListControlValue ? T : ListControlValue>\n | ShapeControl<T extends ShapeControlValue ? T : ShapeControlValue, any>\n | TypeaheadControl<T extends TypeaheadControlValue ? T : TypeaheadControlValue>\n | Descriptor<typeof GapX>\n | GapYDescriptor<T>\n | Descriptor<typeof ResponsiveNumber>\n | CheckboxControl<T>\n | ResponsiveColorDescriptor<T>\n | NumberDescriptor<T>\n | Descriptor<typeof ResponsiveIconRadioGroup>\n | Descriptor<typeof ResponsiveSelect>\n | ResponsiveLengthDescriptor<T>\n | DateControl<T>\n | LinkControl<T>\n | TextInputControl<T>\n | TextStyleControl<T>\n | ImageControl<T>\n | RichTextControl<T>\n | RichTextV2ControlDefinition\n | ComboboxControlDefinition\n | ShapeControlDefinition\n | ListControlDefinition\n | StyleV2ControlDefinition\n >\n | SerializedListControl<T extends ListControlValue ? T : ListControlValue>\n | SerializedShapeControl<T extends ShapeControlValue ? T : ShapeControlValue, any>\n | SerializedTypeaheadControl<T extends TypeaheadControlValue ? T : TypeaheadControlValue>\n | SerializedControlDef<typeof GapX>\n | SerializedGapYControl<T>\n | SerializedControlDef<typeof ResponsiveNumber>\n | SerializedCheckboxControl<T>\n | SerializedResponsiveColorControl<T>\n | SerializedNumberControl<T>\n | SerializedControlDef<typeof ResponsiveIconRadioGroup>\n | SerializedControlDef<typeof ResponsiveSelect>\n | SerializedResponsiveLengthControl<T>\n | SerializedDateControl<T>\n | SerializedLinkControl<T>\n | SerializedTextInputControl<T>\n | SerializedTextStyleControl<T>\n | SerializedImageControl<T>\n | SerializedRichTextControl<T>\n | Serialize<RichTextV2ControlDefinition>\n | Serialize<ComboboxControlDefinition>\n | Serialize<ShapeControlDefinition>\n | Serialize<ListControlDefinition>\n | Serialize<StyleV2ControlDefinition>\n\ntype SerializedPanelControl<T extends Data = Data> = Extract<\n SerializedControl<T>,\n { type: PanelControlType }\n>\n\ntype SerializedPanelControlValueType<T extends SerializedPanelControl> =\n T extends SerializedPanelControl<infer U> ? U : never\n\nexport type DeserializedControl<T extends Data = Data> =\n | Exclude<\n Control<T>,\n | ListControl<T extends ListControlValue ? T : ListControlValue>\n | ShapeControl<T extends ShapeControlValue ? T : ShapeControlValue, any>\n | TypeaheadControl<T extends TypeaheadControlValue ? T : TypeaheadControlValue>\n | Descriptor<typeof GapX>\n | GapYDescriptor<T>\n | Descriptor<typeof ResponsiveNumber>\n | CheckboxControl<T>\n | ResponsiveColorDescriptor<T>\n | NumberDescriptor<T>\n | Descriptor<typeof ResponsiveIconRadioGroup>\n | Descriptor<typeof ResponsiveSelect>\n | ResponsiveLengthDescriptor<T>\n | DateControl<T>\n | LinkControl<T>\n | TextInputControl<T>\n | TextStyleControl<T>\n | ImageControl<T>\n | RichTextControl<T>\n | RichTextV2ControlDefinition\n | ComboboxControlDefinition\n | ShapeControlDefinition\n | ListControlDefinition\n | StyleV2ControlDefinition\n >\n | DeserializedListControl<T extends ListControlValue ? T : ListControlValue>\n | DeserializedShapeControl<T extends ShapeControlValue ? T : ShapeControlValue, any>\n | DeserializedTypeaheadControl<T extends TypeaheadControlValue ? T : TypeaheadControlValue>\n | DeserializedControlDef<typeof GapX>\n | DeserializedGapYControl<T>\n | DeserializedControlDef<typeof ResponsiveNumber>\n | DeserializedCheckboxControl<T>\n | DeserializedResponsiveColorControl<T>\n | DeserializedNumberControl<T>\n | DeserializedControlDef<typeof ResponsiveIconRadioGroup>\n | DeserializedControlDef<typeof ResponsiveSelect>\n | DeserializedResponsiveLengthControl<T>\n | DeserializedDateControl<T>\n | DeserializedLinkControl<T>\n | DeserializedTextInputControl<T>\n | DeserializedTextStyleControl<T>\n | DeserializedImageControl<T>\n | DeserializedRichTextControl<T>\n | Deserialize<Serialize<RichTextV2ControlDefinition>>\n | Deserialize<Serialize<ComboboxControlDefinition>>\n | Deserialize<Serialize<ShapeControlDefinition>>\n | Deserialize<Serialize<ListControlDefinition>>\n | Deserialize<Serialize<StyleV2ControlDefinition>>\n\nexport type DeserializedPanelControl<T extends Data = Data> = Extract<\n DeserializedControl<T>,\n { type: PanelControlType }\n>\n\ntype DeserializedPanelControlValueType<T extends DeserializedPanelControl> =\n T extends DeserializedPanelControl<infer U> ? U : never\n\nexport function serializeControl<T extends Data>(\n control: Control<T>,\n): [SerializedControl<T>, Transferable[]] {\n switch (control.type) {\n case PropControllerTypes.Checkbox:\n return serializeCheckboxControl(control)\n\n case DELETED_PROP_CONTROLLER_TYPES.List:\n return serializeListControl(control)\n\n case DELETED_PROP_CONTROLLER_TYPES.Shape:\n return serializeShapeControl(control)\n\n case DELETED_PROP_CONTROLLER_TYPES.Typeahead:\n return serializeTypeaheadControl(control)\n\n case PropControllerTypes.GapX:\n return serializeControlDef<typeof GapX>(control)\n\n case PropControllerTypes.GapY:\n return serializeGapYControl(control)\n\n case PropControllerTypes.ResponsiveColor:\n return serializeResponsiveColorControl(control)\n\n case PropControllerTypes.ResponsiveNumber:\n return serializeControlDef<typeof ResponsiveNumber>(control)\n\n case PropControllerTypes.Number:\n return serializeNumberControl(control)\n\n case PropControllerTypes.ResponsiveIconRadioGroup:\n return serializeControlDef<typeof ResponsiveIconRadioGroup>(control)\n\n case PropControllerTypes.ResponsiveSelect:\n return serializeControlDef<typeof ResponsiveSelect>(control)\n\n case PropControllerTypes.ResponsiveLength:\n return serializeResponsiveLengthControl(control)\n\n case PropControllerTypes.Date:\n return serializeDateControl(control)\n\n case PropControllerTypes.Link:\n return serializeLinkControl(control)\n\n case PropControllerTypes.TextInput:\n return serializeTextInputControl(control)\n\n case PropControllerTypes.TextStyle:\n return serializeTextStyleControl(control)\n\n case PropControllerTypes.Image:\n return serializeImageControl(control)\n\n case DELETED_PROP_CONTROLLER_TYPES.RichText:\n return serializeRichTextControl(control)\n\n case RichTextV2ControlType:\n return serializeRichTextControlV2(control)\n\n case StyleV2ControlType:\n return serializeStyleV2Control(control)\n\n case ComboboxControlType:\n return serializeComboboxControlDefinition(control)\n\n case ShapeControlType:\n return serializeShapeControlDefinition(control)\n\n case ListControlType:\n return serializeListControlDefinition(control)\n\n default:\n return [control, []]\n }\n}\n\nexport function deserializeControl<T extends Data>(\n serializedControl: SerializedControl<T>,\n): DeserializedControl<T> {\n switch (serializedControl.type) {\n case PropControllerTypes.Checkbox:\n return deserializeCheckboxControl(serializedControl)\n\n case DELETED_PROP_CONTROLLER_TYPES.List:\n return deserializeListControl(serializedControl)\n\n case DELETED_PROP_CONTROLLER_TYPES.Shape:\n return deserializeShapeControl(serializedControl)\n\n case DELETED_PROP_CONTROLLER_TYPES.Typeahead:\n return deserializeTypeaheadControl(serializedControl)\n\n case PropControllerTypes.GapX:\n return deserializeControlDef<typeof GapX>(serializedControl)\n\n case PropControllerTypes.GapY:\n return deserializeGapYControl(serializedControl)\n\n case PropControllerTypes.ResponsiveColor:\n return deserializeResponsiveColorControl(serializedControl)\n\n case PropControllerTypes.ResponsiveNumber:\n return deserializeControlDef<typeof ResponsiveNumber>(serializedControl)\n\n case PropControllerTypes.Number:\n return deserializeNumberControl(serializedControl)\n\n case PropControllerTypes.ResponsiveIconRadioGroup:\n return deserializeControlDef<typeof ResponsiveIconRadioGroup>(serializedControl)\n\n case PropControllerTypes.ResponsiveSelect:\n return deserializeControlDef<typeof ResponsiveSelect>(serializedControl)\n\n case PropControllerTypes.ResponsiveLength:\n return deserializeResponsiveLengthControl(serializedControl)\n\n case PropControllerTypes.Date:\n return deserializeDateControl(serializedControl)\n\n case PropControllerTypes.Link:\n return deserializeLinkControl(serializedControl)\n\n case PropControllerTypes.TextInput:\n return deserializeTextInputControl(serializedControl)\n\n case PropControllerTypes.TextStyle:\n return deserializeTextStyleControl(serializedControl)\n\n case PropControllerTypes.Image:\n return deserializeImageControl(serializedControl)\n\n case DELETED_PROP_CONTROLLER_TYPES.RichText:\n return deserializeRichTextControl(serializedControl)\n\n case RichTextV2ControlType:\n return deserializeRichTextControlV2(serializedControl)\n\n case StyleV2ControlType:\n return deserializeStyleV2Control(serializedControl)\n\n case ComboboxControlType:\n return deserializeComboboxControlDefinition(serializedControl)\n\n case ShapeControlType:\n return deserializeShapeControlDefinition(serializedControl)\n\n case ListControlType:\n return deserializeListControlDefinition(serializedControl)\n\n default:\n return serializedControl\n }\n}\n\nexport function serializeControls(\n controls: Record<string, Control>,\n): [Record<string, SerializedControl>, Transferable[]] {\n return Object.entries(controls).reduce(\n ([accControls, accTransferables], [key, control]) => {\n const [serializedControl, transferables] = serializeControl(control)\n\n return [{ ...accControls, [key]: serializedControl }, [...accTransferables, ...transferables]]\n },\n [{}, []] as [Record<string, SerializedControl>, Transferable[]],\n )\n}\n\nexport function deserializeControls(\n serializedControls: Record<string, SerializedControl>,\n): Record<string, DeserializedControl> {\n return Object.entries(serializedControls).reduce(\n (deserializedControls, [key, serializedControl]) => {\n return { ...deserializedControls, [key]: deserializeControl(serializedControl) }\n },\n {} as Record<string, DeserializedControl>,\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcA,sBAYO;AASP,qBAWO;AACP,sBAGO;AACP,kBAAiF;AACjF,0BAAyE;AACzE,mBAGO;AACP,sBAAmE;AAEnE,oCAMO;AACP,IAAAA,2BAoBO;AAeP,SAAS,sBAIP,SAOA;AACA,QAAM,EAAE,KAAK,IAAI,QAAQ;AAC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BAAiB,MAAM;AAClD,aAAO,EAAE,GAAG,sBAAsB,CAAC,GAAG,GAAG,mBAAmB,iBAAiB,EAAE;AAAA,IACjF;AAAA,IACA,CAAC;AAAA,EACH;AACF;","names":["import_prop_controllers","control","PropControllerTypes"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/builtin/Box/Box.tsx"],"sourcesContent":["'use client'\n\nimport {\n forwardRef,\n Ref,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react'\nimport { cx } from '@emotion/css'\nimport { v4 as uuid } from 'uuid'\n\nimport { Element } from '../../../runtimes/react'\nimport Placeholder from './components/Placeholder'\nimport { areBoxAnimationPropsEqual, BoxAnimationProps, useBoxAnimation } from './animations'\nimport { ResponsiveIconRadioGroupValue } from '../../../prop-controllers/descriptors'\nimport { BoxModelHandle, parse, createBox } from '../../../box-model'\nimport BackgroundsContainer from '../../shared/BackgroundsContainer'\nimport { useResponsiveStyle } from '../../utils/responsive-style'\nimport { GridItem } from '../../shared/grid-item'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { GridData, ResponsiveBackgroundsData, ResponsiveGapData } from '@makeswift/prop-controllers'\n\ntype Props = {\n id?: string\n backgrounds?: ResponsiveBackgroundsData\n width?: string\n height?: ResponsiveIconRadioGroupValue<'auto' | 'stretch'>\n verticalAlign?: ResponsiveIconRadioGroupValue<\n 'flex-start' | 'center' | 'flex-end' | 'space-between'\n >\n margin?: string\n padding?: string\n border?: string\n borderRadius?: string\n boxShadow?: string\n rowGap?: ResponsiveGapData\n columnGap?: ResponsiveGapData\n hidePlaceholder?: boolean\n children?: GridData\n} & BoxAnimationProps\n\nconst Box = forwardRef(function Box(\n {\n id,\n backgrounds,\n width,\n height,\n margin,\n padding,\n border,\n children,\n borderRadius,\n boxShadow,\n rowGap,\n columnGap,\n hidePlaceholder,\n verticalAlign,\n boxAnimateType,\n boxAnimateDuration,\n boxAnimateDelay,\n itemAnimateDelay,\n itemAnimateType,\n itemAnimateDuration,\n itemStaggerDuration,\n }: Props,\n ref: Ref<BoxModelHandle>,\n) {\n const innerRef = useRef<HTMLDivElement | null>(null)\n const boxElementObjectRef = useRef<HTMLElement | null>(null)\n const [animationClassName, replayAnimation, setElement] = useBoxAnimation(\n boxAnimateType,\n boxAnimateDuration,\n boxAnimateDelay,\n itemAnimateType,\n )\n const boxElementCallbackRef = useCallback((current: HTMLElement | null) => {\n boxElementObjectRef.current = current\n\n setElement(current)\n }, [])\n\n useImperativeHandle(\n ref,\n () => ({\n getDomNode() {\n return boxElementObjectRef.current\n },\n getBoxModel() {\n const paddingBoxElement = innerRef.current\n const borderBoxElement = innerRef.current\n const marginBoxElement = boxElementObjectRef.current\n const borderBox = innerRef.current?.getBoundingClientRect()\n const paddingBoxComputedStyle =\n paddingBoxElement?.ownerDocument.defaultView?.getComputedStyle(paddingBoxElement)\n const borderBoxComputedStyle =\n borderBoxElement?.ownerDocument.defaultView?.getComputedStyle(borderBoxElement)\n const marginBoxComputedStyle =\n marginBoxElement?.ownerDocument.defaultView?.getComputedStyle(marginBoxElement)\n const padding = paddingBoxComputedStyle && {\n top: parse(paddingBoxComputedStyle.paddingTop),\n right: parse(paddingBoxComputedStyle.paddingRight),\n bottom: parse(paddingBoxComputedStyle.paddingBottom),\n left: parse(paddingBoxComputedStyle.paddingLeft),\n }\n const border = borderBoxComputedStyle && {\n top: parse(borderBoxComputedStyle.borderTopWidth),\n right: parse(borderBoxComputedStyle.borderRightWidth),\n bottom: parse(borderBoxComputedStyle.borderBottomWidth),\n left: parse(borderBoxComputedStyle.borderLeftWidth),\n }\n const margin = marginBoxComputedStyle && {\n top: parse(marginBoxComputedStyle.marginTop),\n right: parse(marginBoxComputedStyle.marginRight),\n bottom: parse(marginBoxComputedStyle.marginBottom),\n left: parse(marginBoxComputedStyle.marginLeft),\n }\n\n return borderBox ? createBox({ borderBox, padding, border, margin }) : null\n },\n }),\n [],\n )\n\n const gridItemClassName = useStyle(\n useResponsiveStyle([verticalAlign], ([alignItems = 'flex-start']) => ({ alignItems })),\n )\n\n const [key, setKey] = useState(() => uuid())\n\n const animationProps = {\n boxAnimateType,\n boxAnimateDuration,\n boxAnimateDelay,\n itemAnimateType,\n itemAnimateDuration,\n itemAnimateDelay,\n itemStaggerDuration,\n }\n\n const prevAnimationProps = useRef(animationProps)\n useEffect(() => {\n if (!areBoxAnimationPropsEqual(prevAnimationProps.current, animationProps)) {\n replayAnimation()\n setKey(uuid())\n prevAnimationProps.current = animationProps\n }\n }, [replayAnimation, animationProps])\n\n return (\n <BackgroundsContainer\n ref={boxElementCallbackRef}\n id={id}\n className={cx(\n width,\n margin,\n borderRadius,\n useStyle({ display: 'flex' }),\n useStyle(useResponsiveStyle([height], ([alignSelf = 'auto']) => ({ alignSelf }))),\n animationClassName,\n )}\n backgrounds={backgrounds}\n >\n <div\n ref={innerRef}\n key={key}\n className={cx(\n padding,\n boxShadow,\n border,\n useStyle({ display: 'flex', flexWrap: 'wrap', width: '100%' }),\n useStyle(\n useResponsiveStyle([verticalAlign], ([alignContent = 'flex-start']) => ({\n alignContent,\n })),\n ),\n )}\n >\n {children && children.elements.length > 0 ? (\n children.elements.map((child, index) => (\n <GridItem\n key={child.key}\n className={gridItemClassName}\n grid={children.columns}\n index={index}\n itemAnimateDuration={itemAnimateDuration}\n itemAnimateDelay={itemAnimateDelay}\n itemStaggerDuration={itemStaggerDuration}\n columnGap={columnGap}\n rowGap={rowGap}\n >\n <Element element={child} />\n </GridItem>\n ))\n ) : (\n <Placeholder hide={hidePlaceholder} />\n )}\n </div>\n </BackgroundsContainer>\n )\n})\n\nexport default Box\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiMc;AA/Ld,mBAQO;AACP,iBAAmB;AACnB,kBAA2B;AAE3B,IAAAA,gBAAwB;AACxB,yBAAwB;AACxB,wBAA8E;AAE9E,uBAAiD;AACjD,kCAAiC;AACjC,8BAAmC;AACnC,uBAA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AAC,YAAY,MAAM,OAAO,EAAE,UAAU,EAAE,CAAC;AAAA,QAChF;AAAA,MACF;AAAA,MACA;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,KAAK;AAAA,UAEL,eAAW;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,gBACA,2BAAS,EAAE,SAAS,QAAQ,UAAU,QAAQ,OAAO,OAAO,CAAC;AAAA,gBAC7D;AAAA,kBACE,4CAAmB,CAAC,aAAa,GAAG,CAAC,CAAC,eAAe,YAAY,OAAO;AAAA,gBACtE;AAAA,cACF,EAAE;AAAA,YACJ;AAAA,UACF;AAAA,UAEC,sBAAY,SAAS,SAAS,SAAS,IACtC,SAAS,SAAS,IAAI,CAAC,OAAO,UAC5B;AAAA,YAAC;AAAA;AAAA,cAEC,WAAW;AAAA,cACX,MAAM,SAAS;AAAA,cACf;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cAEA,sDAAC,yBAAQ,SAAS,OAAO;AAAA;AAAA,YAVpB,MAAM;AAAA,UAWb,CACD,IAED,4CAAC,mBAAAC,SAAA,EAAY,MAAM,iBAAiB;AAAA;AAAA,QA9BjC;AAAA,MAgCP;AAAA;AAAA,EACF;AAEJ,CAAC;AAED,IAAO,cAAQ;","names":["import_react","Box","padding","border","margin","uuid","BackgroundsContainer","Placeholder"]}
1
+ {"version":3,"sources":["../../../../../src/components/builtin/Box/Box.tsx"],"sourcesContent":["'use client'\n\nimport {\n forwardRef,\n Ref,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react'\nimport { cx } from '@emotion/css'\nimport { v4 as uuid } from 'uuid'\n\nimport { Element } from '../../../runtimes/react'\nimport Placeholder from './components/Placeholder'\nimport { areBoxAnimationPropsEqual, BoxAnimationProps, useBoxAnimation } from './animations'\nimport { BoxModelHandle, parse, createBox } from '../../../box-model'\nimport BackgroundsContainer from '../../shared/BackgroundsContainer'\nimport { useResponsiveStyle } from '../../utils/responsive-style'\nimport { GridItem } from '../../shared/grid-item'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport {\n type GridData,\n type ResponsiveBackgroundsData,\n type ResponsiveGapData,\n type ResponsiveIconRadioGroupValue,\n} from '@makeswift/prop-controllers'\n\ntype Props = {\n id?: string\n backgrounds?: ResponsiveBackgroundsData\n width?: string\n height?: ResponsiveIconRadioGroupValue<'auto' | 'stretch'>\n verticalAlign?: ResponsiveIconRadioGroupValue<\n 'flex-start' | 'center' | 'flex-end' | 'space-between'\n >\n margin?: string\n padding?: string\n border?: string\n borderRadius?: string\n boxShadow?: string\n rowGap?: ResponsiveGapData\n columnGap?: ResponsiveGapData\n hidePlaceholder?: boolean\n children?: GridData\n} & BoxAnimationProps\n\nconst Box = forwardRef(function Box(\n {\n id,\n backgrounds,\n width,\n height,\n margin,\n padding,\n border,\n children,\n borderRadius,\n boxShadow,\n rowGap,\n columnGap,\n hidePlaceholder,\n verticalAlign,\n boxAnimateType,\n boxAnimateDuration,\n boxAnimateDelay,\n itemAnimateDelay,\n itemAnimateType,\n itemAnimateDuration,\n itemStaggerDuration,\n }: Props,\n ref: Ref<BoxModelHandle>,\n) {\n const innerRef = useRef<HTMLDivElement | null>(null)\n const boxElementObjectRef = useRef<HTMLElement | null>(null)\n const [animationClassName, replayAnimation, setElement] = useBoxAnimation(\n boxAnimateType,\n boxAnimateDuration,\n boxAnimateDelay,\n itemAnimateType,\n )\n const boxElementCallbackRef = useCallback((current: HTMLElement | null) => {\n boxElementObjectRef.current = current\n\n setElement(current)\n }, [])\n\n useImperativeHandle(\n ref,\n () => ({\n getDomNode() {\n return boxElementObjectRef.current\n },\n getBoxModel() {\n const paddingBoxElement = innerRef.current\n const borderBoxElement = innerRef.current\n const marginBoxElement = boxElementObjectRef.current\n const borderBox = innerRef.current?.getBoundingClientRect()\n const paddingBoxComputedStyle =\n paddingBoxElement?.ownerDocument.defaultView?.getComputedStyle(paddingBoxElement)\n const borderBoxComputedStyle =\n borderBoxElement?.ownerDocument.defaultView?.getComputedStyle(borderBoxElement)\n const marginBoxComputedStyle =\n marginBoxElement?.ownerDocument.defaultView?.getComputedStyle(marginBoxElement)\n const padding = paddingBoxComputedStyle && {\n top: parse(paddingBoxComputedStyle.paddingTop),\n right: parse(paddingBoxComputedStyle.paddingRight),\n bottom: parse(paddingBoxComputedStyle.paddingBottom),\n left: parse(paddingBoxComputedStyle.paddingLeft),\n }\n const border = borderBoxComputedStyle && {\n top: parse(borderBoxComputedStyle.borderTopWidth),\n right: parse(borderBoxComputedStyle.borderRightWidth),\n bottom: parse(borderBoxComputedStyle.borderBottomWidth),\n left: parse(borderBoxComputedStyle.borderLeftWidth),\n }\n const margin = marginBoxComputedStyle && {\n top: parse(marginBoxComputedStyle.marginTop),\n right: parse(marginBoxComputedStyle.marginRight),\n bottom: parse(marginBoxComputedStyle.marginBottom),\n left: parse(marginBoxComputedStyle.marginLeft),\n }\n\n return borderBox ? createBox({ borderBox, padding, border, margin }) : null\n },\n }),\n [],\n )\n\n const gridItemClassName = useStyle(\n useResponsiveStyle([verticalAlign], ([alignItems = 'flex-start']) => ({ alignItems })),\n )\n\n const [key, setKey] = useState(() => uuid())\n\n const animationProps = {\n boxAnimateType,\n boxAnimateDuration,\n boxAnimateDelay,\n itemAnimateType,\n itemAnimateDuration,\n itemAnimateDelay,\n itemStaggerDuration,\n }\n\n const prevAnimationProps = useRef(animationProps)\n useEffect(() => {\n if (!areBoxAnimationPropsEqual(prevAnimationProps.current, animationProps)) {\n replayAnimation()\n setKey(uuid())\n prevAnimationProps.current = animationProps\n }\n }, [replayAnimation, animationProps])\n\n return (\n <BackgroundsContainer\n ref={boxElementCallbackRef}\n id={id}\n className={cx(\n width,\n margin,\n borderRadius,\n useStyle({ display: 'flex' }),\n useStyle(useResponsiveStyle([height], ([alignSelf = 'auto']) => ({ alignSelf }))),\n animationClassName,\n )}\n backgrounds={backgrounds}\n >\n <div\n ref={innerRef}\n key={key}\n className={cx(\n padding,\n boxShadow,\n border,\n useStyle({ display: 'flex', flexWrap: 'wrap', width: '100%' }),\n useStyle(\n useResponsiveStyle([verticalAlign], ([alignContent = 'flex-start']) => ({\n alignContent,\n })),\n ),\n )}\n >\n {children && children.elements.length > 0 ? (\n children.elements.map((child, index) => (\n <GridItem\n key={child.key}\n className={gridItemClassName}\n grid={children.columns}\n index={index}\n itemAnimateDuration={itemAnimateDuration}\n itemAnimateDelay={itemAnimateDelay}\n itemStaggerDuration={itemStaggerDuration}\n columnGap={columnGap}\n rowGap={rowGap}\n >\n <Element element={child} />\n </GridItem>\n ))\n ) : (\n <Placeholder hide={hidePlaceholder} />\n )}\n </div>\n </BackgroundsContainer>\n )\n})\n\nexport default Box\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqMc;AAnMd,mBAQO;AACP,iBAAmB;AACnB,kBAA2B;AAE3B,IAAAA,gBAAwB;AACxB,yBAAwB;AACxB,wBAA8E;AAC9E,uBAAiD;AACjD,kCAAiC;AACjC,8BAAmC;AACnC,uBAAyB;AACzB,uBAAyB;AA2BzB,MAAM,UAAM,yBAAW,SAASC,KAC9B;AAAA,EACE;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,GACA,KACA;AACA,QAAM,eAAW,qBAA8B,IAAI;AACnD,QAAM,0BAAsB,qBAA2B,IAAI;AAC3D,QAAM,CAAC,oBAAoB,iBAAiB,UAAU,QAAI;AAAA,IACxD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA,QAAM,4BAAwB,0BAAY,CAAC,YAAgC;AACzE,wBAAoB,UAAU;AAE9B,eAAW,OAAO;AAAA,EACpB,GAAG,C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AA,cACA;AAAA,cACA;AAAA,cAEA,sDAAC,yBAAQ,SAAS,OAAO;AAAA;AAAA,YAVpB,MAAM;AAAA,UAWb,CACD,IAED,4CAAC,mBAAAC,SAAA,EAAY,MAAM,iBAAiB;AAAA;AAAA,QA9BjC;AAAA,MAgCP;AAAA;AAAA,EACF;AAEJ,CAAC;AAED,IAAO,cAAQ;","names":["import_react","Box","padding","border","margin","uuid","BackgroundsContainer","Placeholder"]}
@@ -32,7 +32,6 @@ __export(register_exports, {
32
32
  });
33
33
  module.exports = __toCommonJS(register_exports);
34
34
  var import_prop_controllers = require("@makeswift/prop-controllers");
35
- var import_prop_controllers2 = require("../../../prop-controllers");
36
35
  var import_breakpoints = require("../../../state/modules/breakpoints");
37
36
  var import_constants = require("../constants");
38
37
  var import_constants2 = require("./constants");
@@ -58,7 +57,7 @@ function registerComponent(runtime) {
58
57
  format: import_prop_controllers.Width.Format.ClassName,
59
58
  defaultValue: { value: 100, unit: "%" }
60
59
  }),
61
- height: import_prop_controllers2.Props.ResponsiveIconRadioGroup({
60
+ height: (0, import_prop_controllers.ResponsiveIconRadioGroup)({
62
61
  label: "Height",
63
62
  options: [
64
63
  { value: "auto", label: "Auto", icon: "HeightAuto16" },
@@ -66,7 +65,7 @@ function registerComponent(runtime) {
66
65
  ],
67
66
  defaultValue: "auto"
68
67
  }),
69
- verticalAlign: import_prop_controllers2.Props.ResponsiveIconRadioGroup({
68
+ verticalAlign: (0, import_prop_controllers.ResponsiveIconRadioGroup)({
70
69
  label: "Align items",
71
70
  options: [
72
71
  { value: "flex-start", label: "Top", icon: "VerticalAlignStart16" },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/builtin/Box/register.ts"],"sourcesContent":["import {\n Backgrounds,\n Border,\n BorderRadius,\n Checkbox,\n ElementID,\n GapX,\n GapY,\n Grid,\n Margin,\n Padding,\n ResponsiveNumber,\n ResponsiveSelect,\n Shadows,\n Width,\n type PropData,\n} from '@makeswift/prop-controllers'\nimport { Props } from '../../../prop-controllers'\nimport { ReactRuntime } from '../../../runtimes/react'\nimport { findBreakpointOverride, getBaseBreakpoint } from '../../../state/modules/breakpoints'\nimport { MakeswiftComponentType } from '../constants'\nimport {\n BoxAnimateIn,\n DEFAULT_BOX_ANIMATE_DELAY,\n DEFAULT_BOX_ANIMATE_DURATION,\n DEFAULT_ITEM_ANIMATE_DELAY,\n DEFAULT_ITEM_STAGGER_DURATION,\n} from './constants'\nimport { lazy } from 'react'\n\nexport function registerComponent(runtime: ReactRuntime) {\n function isHiddenBasedOnAnimationType(\n props: Record<string, unknown>,\n deviceId: string,\n property: 'boxAnimateType' | 'itemAnimateType',\n ): boolean {\n const animateIn = ResponsiveSelect.fromPropData<BoxAnimateIn>(\n props[property] as PropData<typeof ResponsiveSelect> | undefined,\n )\n return (\n (findBreakpointOverride<BoxAnimateIn>(runtime.getBreakpoints(), animateIn, deviceId)?.value ??\n 'none') === 'none'\n )\n }\n const isHiddenBasedOnBoxAnimation = (props: Record<string, unknown>, deviceId: string) =>\n isHiddenBasedOnAnimationType(props, deviceId, 'boxAnimateType')\n const isHiddenBasedOnItemAnimation = (props: Record<string, unknown>, deviceId: string) =>\n isHiddenBasedOnAnimationType(props, deviceId, 'itemAnimateType')\n\n return runtime.registerComponent(\n lazy(() => import('./Box')),\n {\n type: MakeswiftComponentType.Box,\n label: 'Box',\n props: {\n id: ElementID(),\n backgrounds: Backgrounds(),\n width: Width({\n format: Width.Format.ClassName,\n defaultValue: { value: 100, unit: '%' },\n }),\n height: Props.ResponsiveIconRadioGroup({\n label: 'Height',\n options: [\n { value: 'auto', label: 'Auto', icon: 'HeightAuto16' },\n { value: 'stretch', label: 'Stretch', icon: 'HeightMatch16' },\n ],\n defaultValue: 'auto',\n }),\n verticalAlign: Props.ResponsiveIconRadioGroup({\n label: 'Align items',\n options: [\n { value: 'flex-start', label: 'Top', icon: 'VerticalAlignStart16' },\n { value: 'center', label: 'Middle', icon: 'VerticalAlignMiddle16' },\n { value: 'flex-end', label: 'Bottom', icon: 'VerticalAlignEnd16' },\n {\n value: 'space-between',\n label: 'Space between',\n icon: 'VerticalAlignSpaceBetween16',\n },\n ],\n defaultValue: 'flex-start',\n }),\n margin: Margin({ format: Margin.Format.ClassName }),\n padding: Padding({\n format: Padding.Format.ClassName,\n preset: [\n {\n deviceId: getBaseBreakpoint(runtime.getBreakpoints()).id,\n value: {\n paddingTop: { value: 10, unit: 'px' },\n paddingRight: { value: 10, unit: 'px' },\n paddingBottom: { value: 10, unit: 'px' },\n paddingLeft: { value: 10, unit: 'px' },\n },\n },\n ],\n }),\n border: Border({ format: Border.Format.ClassName }),\n borderRadius: BorderRadius({ format: BorderRadius.Format.ClassName }),\n boxShadow: Shadows({ format: Shadows.Format.ClassName }),\n rowGap: GapY(props => ({\n hidden: props.children == null,\n })),\n columnGap: GapX(props => ({\n hidden: props.children == null,\n })),\n boxAnimateType: ResponsiveSelect({\n label: 'Animate box in',\n labelOrientation: 'vertical',\n options: [\n { value: 'none', label: 'None' },\n { value: 'fadeIn', label: 'Fade in' },\n { value: 'fadeRight', label: 'Fade right' },\n { value: 'fadeDown', label: 'Fade down' },\n { value: 'fadeLeft', label: 'Fade left' },\n { value: 'fadeUp', label: 'Fade up' },\n { value: 'blurIn', label: 'Blur in' },\n { value: 'scaleUp', label: 'Scale up' },\n { value: 'scaleDown', label: 'Scale down' },\n ],\n defaultValue: 'none',\n }),\n boxAnimateDuration: ResponsiveNumber((props, device) => ({\n label: 'Box duration',\n defaultValue: DEFAULT_BOX_ANIMATE_DURATION,\n min: 0.1,\n step: 0.05,\n suffix: 's',\n hidden: isHiddenBasedOnBoxAnimation(props, device),\n })),\n boxAnimateDelay: ResponsiveNumber((props, device) => ({\n label: 'Box delay',\n defaultValue: DEFAULT_BOX_ANIMATE_DELAY,\n min: 0,\n step: 0.05,\n suffix: 's',\n hidden: isHiddenBasedOnBoxAnimation(props, device),\n })),\n itemAnimateType: ResponsiveSelect({\n label: 'Animate items in',\n labelOrientation: 'vertical',\n options: [\n { value: 'none', label: 'None' },\n { value: 'fadeIn', label: 'Fade in' },\n { value: 'fadeRight', label: 'Fade right' },\n { value: 'fadeDown', label: 'Fade down' },\n { value: 'fadeLeft', label: 'Fade left' },\n { value: 'fadeUp', label: 'Fade up' },\n { value: 'blurIn', label: 'Blur in' },\n { value: 'scaleUp', label: 'Scale up' },\n { value: 'scaleDown', label: 'Scale down' },\n ],\n defaultValue: 'none',\n }),\n itemAnimateDuration: ResponsiveNumber((props, device) => ({\n label: 'Items duration',\n defaultValue: DEFAULT_BOX_ANIMATE_DURATION,\n min: 0.1,\n step: 0.05,\n suffix: 's',\n hidden: isHiddenBasedOnItemAnimation(props, device),\n })),\n itemAnimateDelay: ResponsiveNumber((props, device) => ({\n label: 'Items delay',\n defaultValue: DEFAULT_ITEM_ANIMATE_DELAY,\n min: 0,\n step: 0.05,\n suffix: 's',\n hidden: isHiddenBasedOnItemAnimation(props, device),\n })),\n itemStaggerDuration: ResponsiveNumber((props, device) => ({\n label: 'Stagger',\n min: 0,\n step: 0.05,\n suffix: 's',\n defaultValue: DEFAULT_ITEM_STAGGER_DURATION,\n hidden: isHiddenBasedOnItemAnimation(props, device),\n })),\n hidePlaceholder: Checkbox(props => ({\n label: 'Hide placeholder',\n hidden: props.children != null,\n })),\n children: Grid(),\n },\n },\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAgBO;AACP,IAAAA,2BAAsB;AAEtB,yBAA0D;AAC1D,uBAAuC;AACvC,IAAAC,oBAMO;AACP,IAAAC,gBAAqB;AAEd,SAAS,kBAAkB,SAAuB;AACvD,WAAS,6BACP,OACA,UACA,UACS;AACT,UAAM,YAAY,yCAAiB;AAAA,MACjC,MAAM,QAAQ;AAAA,IAChB;AACA,gBACG,2CAAqC,QAAQ,eAAe,GAAG,WAAW,QAAQ,GAAG,SACpF,YAAY;AAAA,EAElB;AACA,QAAM,8BAA8B,CAA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;AAAA,UACL,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,cAAc;AAAA,UACd,QAAQ,6BAA6B,OAAO,MAAM;AAAA,QACpD,EAAE;AAAA,QACF,qBAAiB,kCAAS,YAAU;AAAA,UAClC,OAAO;AAAA,UACP,QAAQ,MAAM,YAAY;AAAA,QAC5B,EAAE;AAAA,QACF,cAAU,8BAAK;AAAA,MACjB;AAAA,IACF;AAAA,EACF;AACF;","names":["import_prop_controllers","import_constants","import_react"]}
1
+ {"version":3,"sources":["../../../../../src/components/builtin/Box/register.ts"],"sourcesContent":["import {\n Backgrounds,\n Border,\n BorderRadius,\n Checkbox,\n ElementID,\n GapX,\n GapY,\n Grid,\n Margin,\n Padding,\n ResponsiveIconRadioGroup,\n ResponsiveNumber,\n ResponsiveSelect,\n Shadows,\n Width,\n type PropData,\n} from '@makeswift/prop-controllers'\nimport { ReactRuntime } from '../../../runtimes/react'\nimport { findBreakpointOverride, getBaseBreakpoint } from '../../../state/modules/breakpoints'\nimport { MakeswiftComponentType } from '../constants'\nimport {\n BoxAnimateIn,\n DEFAULT_BOX_ANIMATE_DELAY,\n DEFAULT_BOX_ANIMATE_DURATION,\n DEFAULT_ITEM_ANIMATE_DELAY,\n DEFAULT_ITEM_STAGGER_DURATION,\n} from './constants'\nimport { lazy } from 'react'\n\nexport function registerComponent(runtime: ReactRuntime) {\n function isHiddenBasedOnAnimationType(\n props: Record<string, unknown>,\n deviceId: string,\n property: 'boxAnimateType' | 'itemAnimateType',\n ): boolean {\n const animateIn = ResponsiveSelect.fromPropData<BoxAnimateIn>(\n props[property] as PropData<typeof ResponsiveSelect> | undefined,\n )\n return (\n (findBreakpointOverride<BoxAnimateIn>(runtime.getBreakpoints(), animateIn, deviceId)?.value ??\n 'none') === 'none'\n )\n }\n const isHiddenBasedOnBoxAnimation = (props: Record<string, unknown>, deviceId: string) =>\n isHiddenBasedOnAnimationType(props, deviceId, 'boxAnimateType')\n const isHiddenBasedOnItemAnimation = (props: Record<string, unknown>, deviceId: string) =>\n isHiddenBasedOnAnimationType(props, deviceId, 'itemAnimateType')\n\n return runtime.registerComponent(\n lazy(() => import('./Box')),\n {\n type: MakeswiftComponentType.Box,\n label: 'Box',\n props: {\n id: ElementID(),\n backgrounds: Backgrounds(),\n width: Width({\n format: Width.Format.ClassName,\n defaultValue: { value: 100, unit: '%' },\n }),\n height: ResponsiveIconRadioGroup({\n label: 'Height',\n options: [\n { value: 'auto', label: 'Auto', icon: 'HeightAuto16' },\n { value: 'stretch', label: 'Stretch', icon: 'HeightMatch16' },\n ],\n defaultValue: 'auto',\n }),\n verticalAlign: ResponsiveIconRadioGroup({\n label: 'Align items',\n options: [\n { value: 'flex-start', label: 'Top', icon: 'VerticalAlignStart16' },\n { value: 'center', label: 'Middle', icon: 'VerticalAlignMiddle16' },\n { value: 'flex-end', label: 'Bottom', icon: 'VerticalAlignEnd16' },\n {\n value: 'space-between',\n label: 'Space between',\n icon: 'VerticalAlignSpaceBetween16',\n },\n ],\n defaultValue: 'flex-start',\n }),\n margin: Margin({ format: Margin.Format.ClassName }),\n padding: Padding({\n format: Padding.Format.ClassName,\n preset: [\n {\n deviceId: getBaseBreakpoint(runtime.getBreakpoints()).id,\n value: {\n paddingTop: { value: 10, unit: 'px' },\n paddingRight: { value: 10, unit: 'px' },\n paddingBottom: { value: 10, unit: 'px' },\n paddingLeft: { value: 10, unit: 'px' },\n },\n },\n ],\n }),\n border: Border({ format: Border.Format.ClassName }),\n borderRadius: BorderRadius({ format: BorderRadius.Format.ClassName }),\n boxShadow: Shadows({ format: Shadows.Format.ClassName }),\n rowGap: GapY(props => ({\n hidden: props.children == null,\n })),\n columnGap: GapX(props => ({\n hidden: props.children == null,\n })),\n boxAnimateType: ResponsiveSelect({\n label: 'Animate box in',\n labelOrientation: 'vertical',\n options: [\n { value: 'none', label: 'None' },\n { value: 'fadeIn', label: 'Fade in' },\n { value: 'fadeRight', label: 'Fade right' },\n { value: 'fadeDown', label: 'Fade down' },\n { value: 'fadeLeft', label: 'Fade left' },\n { value: 'fadeUp', label: 'Fade up' },\n { value: 'blurIn', label: 'Blur in' },\n { value: 'scaleUp', label: 'Scale up' },\n { value: 'scaleDown', label: 'Scale down' },\n ],\n defaultValue: 'none',\n }),\n boxAnimateDuration: ResponsiveNumber((props, device) => ({\n label: 'Box duration',\n defaultValue: DEFAULT_BOX_ANIMATE_DURATION,\n min: 0.1,\n step: 0.05,\n suffix: 's',\n hidden: isHiddenBasedOnBoxAnimation(props, device),\n })),\n boxAnimateDelay: ResponsiveNumber((props, device) => ({\n label: 'Box delay',\n defaultValue: DEFAULT_BOX_ANIMATE_DELAY,\n min: 0,\n step: 0.05,\n suffix: 's',\n hidden: isHiddenBasedOnBoxAnimation(props, device),\n })),\n itemAnimateType: ResponsiveSelect({\n label: 'Animate items in',\n labelOrientation: 'vertical',\n options: [\n { value: 'none', label: 'None' },\n { value: 'fadeIn', label: 'Fade in' },\n { value: 'fadeRight', label: 'Fade right' },\n { value: 'fadeDown', label: 'Fade down' },\n { value: 'fadeLeft', label: 'Fade left' },\n { value: 'fadeUp', label: 'Fade up' },\n { value: 'blurIn', label: 'Blur in' },\n { value: 'scaleUp', label: 'Scale up' },\n { value: 'scaleDown', label: 'Scale down' },\n ],\n defaultValue: 'none',\n }),\n itemAnimateDuration: ResponsiveNumber((props, device) => ({\n label: 'Items duration',\n defaultValue: DEFAULT_BOX_ANIMATE_DURATION,\n min: 0.1,\n step: 0.05,\n suffix: 's',\n hidden: isHiddenBasedOnItemAnimation(props, device),\n })),\n itemAnimateDelay: ResponsiveNumber((props, device) => ({\n label: 'Items delay',\n defaultValue: DEFAULT_ITEM_ANIMATE_DELAY,\n min: 0,\n step: 0.05,\n suffix: 's',\n hidden: isHiddenBasedOnItemAnimation(props, device),\n })),\n itemStaggerDuration: ResponsiveNumber((props, device) => ({\n label: 'Stagger',\n min: 0,\n step: 0.05,\n suffix: 's',\n defaultValue: DEFAULT_ITEM_STAGGER_DURATION,\n hidden: isHiddenBasedOnItemAnimation(props, device),\n })),\n hidePlaceholder: Checkbox(props => ({\n label: 'Hide placeholder',\n hidden: props.children != null,\n })),\n children: Grid(),\n },\n },\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAiBO;AAEP,yBAA0D;AAC1D,uBAAuC;AACvC,IAAAA,oBAMO;AACP,IAAAC,gBAAqB;AAEd,SAAS,kBAAkB,SAAuB;AACvD,WAAS,6BACP,OACA,UACA,UACS;AACT,UAAM,YAAY,yCAAiB;AAAA,MACjC,MAAM,QAAQ;AAAA,IAChB;AACA,gBACG,2CAAqC,QAAQ,eAAe,GAAG,WAAW,QAAQ,GAAG,SACpF,YAAY;AAAA,EAElB;AACA,QAAM,8BAA8B,CAAC,OAAgC,aACnE,6BAA6B,OAAO,UAAU,gBAAgB;AAChE,QAAM,+BAA+B,CAAC,OAAgC,aACpE,6BAA6B,OAAO,UAAU,iBAAiB;AAEjE,SAAO,QAAQ;AAAA,QACb,oBAAK,MAAM,6CAAO,OAAO,GAAC;AAAA,IAC1B;AAAA,MACE,MAAM,wCAAuB;AAAA,MAC7B,OAAO;AAAA,MACP,OAAO;AAAA,QACL,QAAI,mCAAU;AAAA,QACd,iBAAa,qCAAY;AAAA,QACzB,WAAO,+BAAM;AAAA,UACX,QAAQ,8BAAM,OAAO;AAAA,UACrB,cAAc,EAAE,OAAO,KAAK,MAAM,IAAI;AAAA,QACxC,CAAC;AAAA,QACD,YAAQ,kDAAyB;AAAA,UAC/B,OAAO;AAAA,UACP,SAAS;AAAA,YACP,EAAE,OAAO,QAAQ,OAAO,QAAQ,MAAM,eAAe;AAAA,YACrD,EAAE,OAAO,WAAW,OAAO,WAAW,MAAM,gBAAgB;AAAA,UAC9D;AAAA,UACA,cAAc;AAAA,QAChB,CAAC;AAAA,QACD,mBAAe,kDAAyB;AAAA,UACtC,OAAO;AAAA,UACP,SAAS;AAAA,YACP,EAAE,OAAO,cAAc,OAAO,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;AAAA,QAChB,CAAC;AAAA,QACD,yBAAqB,0CAAiB,CAAC,OAAO,YAAY;AAAA,UACxD,OAAO;AAAA,UACP,cAAc;AAAA,UACd,KAAK;AAAA,UACL,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,QAAQ,6BAA6B,OAAO,MAAM;AAAA,QACpD,EAAE;AAAA,QACF,sBAAkB,0CAAiB,CAAC,OAAO,YAAY;AAAA,UACrD,OAAO;AAAA,UACP,cAAc;AAAA,UACd,KAAK;AAAA,UACL,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,QAAQ,6BAA6B,OAAO,MAAM;AAAA,QACpD,EAAE;AAAA,QACF,yBAAqB,0CAAiB,CAAC,OAAO,YAAY;AAAA,UACxD,OAAO;AAAA,UACP,KAAK;AAAA,UACL,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,cAAc;AAAA,UACd,QAAQ,6BAA6B,OAAO,MAAM;AAAA,QACpD,EAAE;AAAA,QACF,qBAAiB,kCAAS,YAAU;AAAA,UAClC,OAAO;AAAA,UACP,QAAQ,MAAM,YAAY;AAAA,QAC5B,EAAE;AAAA,QACF,cAAU,8BAAK;AAAA,MACjB;AAAA,IACF;AAAA,EACF;AACF;","names":["import_constants","import_react"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/builtin/Button/Button.tsx"],"sourcesContent":["import {\n ComponentPropsWithoutRef,\n ElementRef,\n ElementType,\n ForwardedRef,\n forwardRef,\n ReactNode,\n} from 'react'\nimport ColorHelper from 'color'\n\nimport { ResponsiveIconRadioGroupValue } from '../../../prop-controllers/descriptors'\nimport { colorToString } from '../../utils/colorToString'\nimport { Link } from '../../shared/Link'\nimport { ResponsiveColor } from '../../../runtimes/react/controls'\nimport { ButtonVariant } from './contants'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport {\n useResponsiveStyle,\n useResponsiveTextStyle,\n useResponsiveWidth,\n} from '../../utils/responsive-style'\nimport { cx } from '@emotion/css'\nimport {\n type LinkData,\n type ResponsiveLengthData,\n type ResponsiveTextStyleData,\n type ResponsiveSelectValue,\n} from '@makeswift/prop-controllers'\n\ntype BaseProps<T extends ElementType> = {\n as?: T\n id?: string\n children?: ReactNode\n link?: LinkData\n variant?: ResponsiveSelectValue<ButtonVariant>\n shape?: ResponsiveIconRadioGroupValue<'pill' | 'rounded' | 'square'>\n size?: ResponsiveIconRadioGroupValue<'small' | 'medium' | 'large'>\n color?: ResponsiveColor | null\n textColor?: ResponsiveColor | null\n textStyle?: ResponsiveTextStyleData\n width?: ResponsiveLengthData\n margin?: string\n}\n\ntype Props<T extends ElementType> = BaseProps<T> &\n Omit<ComponentPropsWithoutRef<typeof Link>, keyof BaseProps<T>>\n\nconst Button = forwardRef(function Button<T extends ElementType = 'button'>(\n {\n as,\n id,\n children,\n link,\n variant,\n shape,\n size,\n textColor,\n color,\n textStyle,\n width,\n margin,\n className,\n ...restOfProps\n }: Props<T>,\n ref: ForwardedRef<ElementRef<T>>,\n) {\n const Component = as ?? Link\n\n return (\n // @ts-ignore: `ref` prop doesn't match between `Link` and `T`.\n <Component\n {...restOfProps}\n ref={ref}\n id={id}\n className={cx(\n useStyle({\n display: 'table',\n border: 0,\n outline: 0,\n userSelect: 'none',\n cursor: 'pointer',\n fontFamily: 'inherit',\n textDecoration: 'none',\n textAlign: 'center',\n }),\n useStyle(useResponsiveWidth(width, 'auto')),\n margin,\n useStyle(\n useResponsiveStyle(\n [variant, shape, size, textColor, color] as const,\n ([\n variant = 'flat',\n shape = 'rounded',\n size = 'medium',\n textColor = { swatch: { hue: 0, saturation: 0, lightness: 100 }, alpha: 1 },\n color = { swatch: { hue: 0, saturation: 0, lightness: 0 }, alpha: 1 },\n ]) => {\n const fontSize = {\n value: { small: 12, medium: 14, large: 18 }[size],\n unit: 'px',\n }\n\n return {\n color: colorToString(textColor),\n borderRadius: `${{ square: 0, rounded: 4, pill: 500 }[shape]}px`,\n padding: `${{ small: '8px 12px', medium: '12px 16px', large: '16px 20px' }[size]}`,\n fontSize: `${fontSize.value}${fontSize.unit}`,\n ...{\n flat: {\n background: colorToString(color),\n border: 'none',\n transition: ['color', 'background', 'border', 'box-shadow']\n .map(property => `${property} 0.15s ease-in-out`)\n .join(', '),\n\n ':hover': {\n background: ColorHelper(colorToString(color)).darken(0.1).hex(),\n },\n\n ':active': {\n background: ColorHelper(colorToString(color)).darken(0.15).hex(),\n },\n },\n outline: {\n background: 'transparent',\n boxShadow: `inset 0 0 0 2px ${colorToString(color)}`,\n transition: ['color', 'background', 'box-shadow']\n .map(property => `${property} 0.15s ease-in-out`)\n .join(', '),\n\n ':hover': {\n boxShadow: `inset 0 0 0 2px ${ColorHelper(colorToString(color))\n .darken(0.1)\n .hex()}`,\n color: ColorHelper(colorToString(color)).darken(0.1).hex(),\n },\n\n ':active': {\n boxShadow: `inset 0 0 0 2px ${ColorHelper(colorToString(color))\n .darken(0.15)\n .hex()}`,\n color: ColorHelper(colorToString(color)).darken(0.15).hex(),\n },\n },\n shadow: {\n background: colorToString(color),\n boxShadow: '0 2px 4px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.2)',\n transition: ['transform', 'box-shadow']\n .map(property => `${property} 0.18s`)\n .join(', '),\n\n ':hover': {\n boxShadow:\n '0 10px 25px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.3)',\n transform: 'translateY(-1px)',\n },\n\n ':active': {\n boxShadow:\n '0 4px 12px rgba(0, 0, 0, 0.15), 0 4px 6px -3px rgba(0, 0, 0, 0.3)',\n transform: 'translateY(0px)',\n },\n },\n clear: {\n background: 'transparent',\n border: 'none',\n\n ':hover': {\n color: ColorHelper(colorToString(textColor)).alpha(0.5).toString(),\n },\n\n ':active': {\n color: ColorHelper(colorToString(textColor)).alpha(0.6).toString(),\n },\n },\n blocky: {\n background: colorToString(color),\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: ColorHelper(colorToString(color)).darken(0.25).hex(),\n boxShadow: `0 4px ${ColorHelper(colorToString(color)).darken(0.25).hex()}`,\n transition: ['transform', 'box-shadow']\n .map(property => `${property} 0.1s`)\n .join(', '),\n\n ':hover': {\n transform: 'translateY(2px)',\n boxShadow: `0 2px ${ColorHelper(colorToString(color)).darken(0.25).hex()}`,\n },\n\n ':active': {\n transform: 'translateY(4px)',\n boxShadow: `0 0 ${ColorHelper(colorToString(color)).darken(0.25).hex()}`,\n },\n },\n bubbly: {\n background: `linear-gradient(\n 180deg,\n ${ColorHelper(colorToString(color)).lighten(0.05).hex()},\n ${ColorHelper(colorToString(color)).darken(0.3).saturate(0.05).hex()}\n )`,\n position: 'relative',\n zIndex: '0',\n\n ':before': {\n position: 'absolute',\n content: '\"\"',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n zIndex: '-1',\n borderRadius: 'inherit',\n background: `linear-gradient(\n 180deg,\n ${ColorHelper(colorToString(color)).lighten(0.2).hex()},\n ${ColorHelper(colorToString(color)).darken(0.2).saturate(0.05).hex()}\n )`,\n opacity: '0',\n transition: 'opacity 0.15s',\n },\n\n ':hover': {\n ':before': {\n opacity: '1',\n },\n },\n\n ':active': {\n ':before': {\n opacity: '0.25',\n },\n },\n } as const,\n skewed: {\n position: 'relative',\n zIndex: '0',\n\n ':before': {\n position: 'absolute',\n content: '\"\"',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n zIndex: '-1',\n background: colorToString(color),\n transform: 'skewX(-12deg)',\n borderRadius: 'inherit',\n transition: 'transform 0.2s cubic-bezier(0.25, 0, 0.25, 1.75)',\n },\n\n ':hover:before': {\n transform: 'skew(0deg)',\n },\n\n ':active:before': {\n transform: 'skew(-8deg)',\n },\n } as const,\n }[variant],\n }\n },\n ),\n ),\n useStyle(useResponsiveTextStyle(textStyle)),\n className,\n )}\n link={link}\n >\n {children == null ? 'Button Text' : children}\n </Component>\n )\n})\n\nexport default Button\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAsEI;AAAA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AAY;AAAA,oBACd;AAAA,oBAEA,iBAAiB;AAAA,sBACf,WAAW;AAAA,oBACb;AAAA,oBAEA,kBAAkB;AAAA,sBAChB,WAAW;AAAA,oBACb;AAAA,kBACF;AAAA,gBACF,EAAEJ,QAAO;AAAA,cACX;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,YACA,+BAAS,gDAAuB,SAAS,CAAC;AAAA,QAC1C;AAAA,MACF;AAAA,MACA;AAAA,MAEC,sBAAY,OAAO,gBAAgB;AAAA;AAAA,EACtC;AAEJ,CAAC;AAED,IAAO,iBAAQ;","names":["Button","variant","shape","size","textColor","color","ColorHelper"]}
1
+ {"version":3,"sources":["../../../../../src/components/builtin/Button/Button.tsx"],"sourcesContent":["import {\n ComponentPropsWithoutRef,\n ElementRef,\n ElementType,\n ForwardedRef,\n forwardRef,\n ReactNode,\n} from 'react'\nimport ColorHelper from 'color'\n\nimport { colorToString } from '../../utils/colorToString'\nimport { Link } from '../../shared/Link'\nimport { ResponsiveColor } from '../../../runtimes/react/controls'\nimport { ButtonVariant } from './contants'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport {\n useResponsiveStyle,\n useResponsiveTextStyle,\n useResponsiveWidth,\n} from '../../utils/responsive-style'\nimport { cx } from '@emotion/css'\nimport {\n type LinkData,\n type ResponsiveLengthData,\n type ResponsiveTextStyleData,\n type ResponsiveSelectValue,\n type ResponsiveIconRadioGroupValue,\n} from '@makeswift/prop-controllers'\n\ntype BaseProps<T extends ElementType> = {\n as?: T\n id?: string\n children?: ReactNode\n link?: LinkData\n variant?: ResponsiveSelectValue<ButtonVariant>\n shape?: ResponsiveIconRadioGroupValue<'pill' | 'rounded' | 'square'>\n size?: ResponsiveIconRadioGroupValue<'small' | 'medium' | 'large'>\n color?: ResponsiveColor | null\n textColor?: ResponsiveColor | null\n textStyle?: ResponsiveTextStyleData\n width?: ResponsiveLengthData\n margin?: string\n}\n\ntype Props<T extends ElementType> = BaseProps<T> &\n Omit<ComponentPropsWithoutRef<typeof Link>, keyof BaseProps<T>>\n\nconst Button = forwardRef(function Button<T extends ElementType = 'button'>(\n {\n as,\n id,\n children,\n link,\n variant,\n shape,\n size,\n textColor,\n color,\n textStyle,\n width,\n margin,\n className,\n ...restOfProps\n }: Props<T>,\n ref: ForwardedRef<ElementRef<T>>,\n) {\n const Component = as ?? Link\n\n return (\n // @ts-ignore: `ref` prop doesn't match between `Link` and `T`.\n <Component\n {...restOfProps}\n ref={ref}\n id={id}\n className={cx(\n useStyle({\n display: 'table',\n border: 0,\n outline: 0,\n userSelect: 'none',\n cursor: 'pointer',\n fontFamily: 'inherit',\n textDecoration: 'none',\n textAlign: 'center',\n }),\n useStyle(useResponsiveWidth(width, 'auto')),\n margin,\n useStyle(\n useResponsiveStyle(\n [variant, shape, size, textColor, color] as const,\n ([\n variant = 'flat',\n shape = 'rounded',\n size = 'medium',\n textColor = { swatch: { hue: 0, saturation: 0, lightness: 100 }, alpha: 1 },\n color = { swatch: { hue: 0, saturation: 0, lightness: 0 }, alpha: 1 },\n ]) => {\n const fontSize = {\n value: { small: 12, medium: 14, large: 18 }[size],\n unit: 'px',\n }\n\n return {\n color: colorToString(textColor),\n borderRadius: `${{ square: 0, rounded: 4, pill: 500 }[shape]}px`,\n padding: `${{ small: '8px 12px', medium: '12px 16px', large: '16px 20px' }[size]}`,\n fontSize: `${fontSize.value}${fontSize.unit}`,\n ...{\n flat: {\n background: colorToString(color),\n border: 'none',\n transition: ['color', 'background', 'border', 'box-shadow']\n .map(property => `${property} 0.15s ease-in-out`)\n .join(', '),\n\n ':hover': {\n background: ColorHelper(colorToString(color)).darken(0.1).hex(),\n },\n\n ':active': {\n background: ColorHelper(colorToString(color)).darken(0.15).hex(),\n },\n },\n outline: {\n background: 'transparent',\n boxShadow: `inset 0 0 0 2px ${colorToString(color)}`,\n transition: ['color', 'background', 'box-shadow']\n .map(property => `${property} 0.15s ease-in-out`)\n .join(', '),\n\n ':hover': {\n boxShadow: `inset 0 0 0 2px ${ColorHelper(colorToString(color))\n .darken(0.1)\n .hex()}`,\n color: ColorHelper(colorToString(color)).darken(0.1).hex(),\n },\n\n ':active': {\n boxShadow: `inset 0 0 0 2px ${ColorHelper(colorToString(color))\n .darken(0.15)\n .hex()}`,\n color: ColorHelper(colorToString(color)).darken(0.15).hex(),\n },\n },\n shadow: {\n background: colorToString(color),\n boxShadow: '0 2px 4px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.2)',\n transition: ['transform', 'box-shadow']\n .map(property => `${property} 0.18s`)\n .join(', '),\n\n ':hover': {\n boxShadow:\n '0 10px 25px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.3)',\n transform: 'translateY(-1px)',\n },\n\n ':active': {\n boxShadow:\n '0 4px 12px rgba(0, 0, 0, 0.15), 0 4px 6px -3px rgba(0, 0, 0, 0.3)',\n transform: 'translateY(0px)',\n },\n },\n clear: {\n background: 'transparent',\n border: 'none',\n\n ':hover': {\n color: ColorHelper(colorToString(textColor)).alpha(0.5).toString(),\n },\n\n ':active': {\n color: ColorHelper(colorToString(textColor)).alpha(0.6).toString(),\n },\n },\n blocky: {\n background: colorToString(color),\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: ColorHelper(colorToString(color)).darken(0.25).hex(),\n boxShadow: `0 4px ${ColorHelper(colorToString(color)).darken(0.25).hex()}`,\n transition: ['transform', 'box-shadow']\n .map(property => `${property} 0.1s`)\n .join(', '),\n\n ':hover': {\n transform: 'translateY(2px)',\n boxShadow: `0 2px ${ColorHelper(colorToString(color)).darken(0.25).hex()}`,\n },\n\n ':active': {\n transform: 'translateY(4px)',\n boxShadow: `0 0 ${ColorHelper(colorToString(color)).darken(0.25).hex()}`,\n },\n },\n bubbly: {\n background: `linear-gradient(\n 180deg,\n ${ColorHelper(colorToString(color)).lighten(0.05).hex()},\n ${ColorHelper(colorToString(color)).darken(0.3).saturate(0.05).hex()}\n )`,\n position: 'relative',\n zIndex: '0',\n\n ':before': {\n position: 'absolute',\n content: '\"\"',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n zIndex: '-1',\n borderRadius: 'inherit',\n background: `linear-gradient(\n 180deg,\n ${ColorHelper(colorToString(color)).lighten(0.2).hex()},\n ${ColorHelper(colorToString(color)).darken(0.2).saturate(0.05).hex()}\n )`,\n opacity: '0',\n transition: 'opacity 0.15s',\n },\n\n ':hover': {\n ':before': {\n opacity: '1',\n },\n },\n\n ':active': {\n ':before': {\n opacity: '0.25',\n },\n },\n } as const,\n skewed: {\n position: 'relative',\n zIndex: '0',\n\n ':before': {\n position: 'absolute',\n content: '\"\"',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n zIndex: '-1',\n background: colorToString(color),\n transform: 'skewX(-12deg)',\n borderRadius: 'inherit',\n transition: 'transform 0.2s cubic-bezier(0.25, 0, 0.25, 1.75)',\n },\n\n ':hover:before': {\n transform: 'skew(0deg)',\n },\n\n ':active:before': {\n transform: 'skew(-8deg)',\n },\n } as const,\n }[variant],\n }\n },\n ),\n ),\n useStyle(useResponsiveTextStyle(textStyle)),\n className,\n )}\n link={link}\n >\n {children == null ? 'Button Text' : children}\n </Component>\n )\n})\n\nexport default Button\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAsEI;AAAA;AAAA;AAAA;AAtEJ,mBAOO;AACP,mBAAwB;AAExB,2BAA8B;AAC9B,kBAAqB;AAGrB,uBAAyB;AACzB,8BAIO;AACP,iBAAmB;AA2BnB,MAAM,aAAS,yBAAW,SAASA,QACjC;AAAA,EACE;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,GAAG;AACL,GACA,KACA;AACA,QAAM,YAAY,MAAM;AAExB,SAEE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ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 +32,6 @@ __export(register_exports, {
32
32
  });
33
33
  module.exports = __toCommonJS(register_exports);
34
34
  var import_prop_controllers = require("@makeswift/prop-controllers");
35
- var import_prop_controllers2 = require("../../../prop-controllers");
36
35
  var import_breakpoints = require("../../../state/modules/breakpoints");
37
36
  var import_constants = require("../constants");
38
37
  var import_react2 = require("react");
@@ -68,7 +67,7 @@ function registerComponent(runtime) {
68
67
  ],
69
68
  defaultValue: "flat"
70
69
  }),
71
- shape: import_prop_controllers2.Props.ResponsiveIconRadioGroup({
70
+ shape: (0, import_prop_controllers.ResponsiveIconRadioGroup)({
72
71
  label: "Shape",
73
72
  options: [
74
73
  { label: "Pill", value: "pill", icon: "ButtonPill16" },
@@ -77,7 +76,7 @@ function registerComponent(runtime) {
77
76
  ],
78
77
  defaultValue: "rounded"
79
78
  }),
80
- size: import_prop_controllers2.Props.ResponsiveIconRadioGroup({
79
+ size: (0, import_prop_controllers.ResponsiveIconRadioGroup)({
81
80
  label: "Size",
82
81
  options: [
83
82
  { label: "Small", value: "small", icon: "SizeSmall16" },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/builtin/Button/register.ts"],"sourcesContent":["import {\n ElementID,\n Link,\n Margin,\n ResponsiveColor,\n ResponsiveSelect,\n TextInput,\n TextStyle,\n Width,\n type PropData,\n} from '@makeswift/prop-controllers'\nimport { Props } from '../../../prop-controllers'\nimport { ReactRuntime } from '../../../runtimes/react'\nimport { findBreakpointOverride } from '../../../state/modules/breakpoints'\nimport { MakeswiftComponentType } from '../constants'\nimport { ButtonVariant } from './contants'\nimport { lazy } from 'react'\n\nexport function registerComponent(runtime: ReactRuntime) {\n return runtime.registerComponent(\n lazy(() => import('./Button')),\n {\n type: MakeswiftComponentType.Button,\n label: 'Button',\n props: {\n id: ElementID(),\n children: TextInput({ placeholder: 'Button text' }),\n link: Link({\n defaultValue: {\n type: 'OPEN_PAGE',\n payload: {\n pageId: null,\n openInNewTab: false,\n },\n },\n }),\n variant: ResponsiveSelect({\n label: 'Style',\n labelOrientation: 'horizontal',\n options: [\n { value: 'flat', label: 'Flat' },\n { value: 'outline', label: 'Outline' },\n { value: 'shadow', label: 'Floating' },\n { value: 'clear', label: 'Clear' },\n { value: 'blocky', label: 'Blocky' },\n { value: 'bubbly', label: 'Bubbly' },\n { value: 'skewed', label: 'Skewed' },\n ],\n defaultValue: 'flat',\n }),\n shape: Props.ResponsiveIconRadioGroup({\n label: 'Shape',\n options: [\n { label: 'Pill', value: 'pill', icon: 'ButtonPill16' },\n { label: 'Rounded', value: 'rounded', icon: 'ButtonRounded16' },\n { label: 'Square', value: 'square', icon: 'ButtonSquare16' },\n ],\n defaultValue: 'rounded',\n }),\n size: Props.ResponsiveIconRadioGroup({\n label: 'Size',\n options: [\n { label: 'Small', value: 'small', icon: 'SizeSmall16' },\n { label: 'Medium', value: 'medium', icon: 'SizeMedium16' },\n { label: 'Large', value: 'large', icon: 'SizeLarge16' },\n ],\n defaultValue: 'medium',\n }),\n color: ResponsiveColor((props, device) => {\n const variant = ResponsiveSelect.fromPropData<ButtonVariant>(\n props.variant as PropData<typeof ResponsiveSelect> | undefined,\n )\n const hidden =\n findBreakpointOverride<ButtonVariant>(runtime.getBreakpoints(), variant, device)\n ?.value === 'clear'\n\n return { placeholder: 'black', hidden }\n }),\n textColor: ResponsiveColor({\n label: 'Text color',\n placeholder: 'white',\n }),\n textStyle: TextStyle(),\n width: Width(),\n margin: Margin({ format: Margin.Format.ClassName }),\n },\n },\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAUO;AACP,IAAAA,2BAAsB;AAEtB,yBAAuC;AACvC,uBAAuC;AAEvC,IAAAC,gBAAqB;AAEd,SAAS,kBAAkB,SAAuB;AACvD,SAAO,QAAQ;AAAA,QACb,oBAAK,MAAM,6CAAO,UAAU,GAAC;AAAA,IAC7B;AAAA,MACE,MAAM,wCAAuB;AAAA,MAC7B,OAAO;AAAA,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AAO,yCAAgB,CAAC,OAAO,WAAW;AACxC,gBAAM,UAAU,yCAAiB;AAAA,YAC/B,MAAM;AAAA,UACR;AACA,gBAAM,aACJ,2CAAsC,QAAQ,eAAe,GAAG,SAAS,MAAM,GAC3E,UAAU;AAEhB,iBAAO,EAAE,aAAa,SAAS,OAAO;AAAA,QACxC,CAAC;AAAA,QACD,eAAW,yCAAgB;AAAA,UACzB,OAAO;AAAA,UACP,aAAa;AAAA,QACf,CAAC;AAAA,QACD,eAAW,mCAAU;AAAA,QACrB,WAAO,+BAAM;AAAA,QACb,YAAQ,gCAAO,EAAE,QAAQ,+BAAO,OAAO,UAAU,CAAC;AAAA,MACpD;AAAA,IACF;AAAA,EACF;AACF;","names":["import_prop_controllers","import_react"]}
1
+ {"version":3,"sources":["../../../../../src/components/builtin/Button/register.ts"],"sourcesContent":["import {\n ElementID,\n Link,\n Margin,\n ResponsiveColor,\n ResponsiveIconRadioGroup,\n ResponsiveSelect,\n TextInput,\n TextStyle,\n Width,\n type PropData,\n} from '@makeswift/prop-controllers'\nimport { ReactRuntime } from '../../../runtimes/react'\nimport { findBreakpointOverride } from '../../../state/modules/breakpoints'\nimport { MakeswiftComponentType } from '../constants'\nimport { ButtonVariant } from './contants'\nimport { lazy } from 'react'\n\nexport function registerComponent(runtime: ReactRuntime) {\n return runtime.registerComponent(\n lazy(() => import('./Button')),\n {\n type: MakeswiftComponentType.Button,\n label: 'Button',\n props: {\n id: ElementID(),\n children: TextInput({ placeholder: 'Button text' }),\n link: Link({\n defaultValue: {\n type: 'OPEN_PAGE',\n payload: {\n pageId: null,\n openInNewTab: false,\n },\n },\n }),\n variant: ResponsiveSelect({\n label: 'Style',\n labelOrientation: 'horizontal',\n options: [\n { value: 'flat', label: 'Flat' },\n { value: 'outline', label: 'Outline' },\n { value: 'shadow', label: 'Floating' },\n { value: 'clear', label: 'Clear' },\n { value: 'blocky', label: 'Blocky' },\n { value: 'bubbly', label: 'Bubbly' },\n { value: 'skewed', label: 'Skewed' },\n ],\n defaultValue: 'flat',\n }),\n shape: ResponsiveIconRadioGroup({\n label: 'Shape',\n options: [\n { label: 'Pill', value: 'pill', icon: 'ButtonPill16' },\n { label: 'Rounded', value: 'rounded', icon: 'ButtonRounded16' },\n { label: 'Square', value: 'square', icon: 'ButtonSquare16' },\n ],\n defaultValue: 'rounded',\n }),\n size: ResponsiveIconRadioGroup({\n label: 'Size',\n options: [\n { label: 'Small', value: 'small', icon: 'SizeSmall16' },\n { label: 'Medium', value: 'medium', icon: 'SizeMedium16' },\n { label: 'Large', value: 'large', icon: 'SizeLarge16' },\n ],\n defaultValue: 'medium',\n }),\n color: ResponsiveColor((props, device) => {\n const variant = ResponsiveSelect.fromPropData<ButtonVariant>(\n props.variant as PropData<typeof ResponsiveSelect> | undefined,\n )\n const hidden =\n findBreakpointOverride<ButtonVariant>(runtime.getBreakpoints(), variant, device)\n ?.value === 'clear'\n\n return { placeholder: 'black', hidden }\n }),\n textColor: ResponsiveColor({\n label: 'Text color',\n placeholder: 'white',\n }),\n textStyle: TextStyle(),\n width: Width(),\n margin: Margin({ format: Margin.Format.ClassName }),\n },\n },\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAWO;AAEP,yBAAuC;AACvC,uBAAuC;AAEvC,IAAAA,gBAAqB;AAEd,SAAS,kBAAkB,SAAuB;AACvD,SAAO,QAAQ;AAAA,QACb,oBAAK,MAAM,6CAAO,UAAU,GAAC;AAAA,IAC7B;AAAA,MACE,MAAM,wCAAuB;AAAA,MAC7B,OAAO;AAAA,MACP,OAAO;AAAA,QACL,QAAI,mCAAU;AAAA,QACd,cAAU,mCAAU,EAAE,aAAa,cAAc,CAAC;AAAA,QAClD,UAAM,8BAAK;AAAA,UACT,cAAc;AAAA,YACZ,MAAM;AAAA,YACN,SAAS;AAAA,cACP,QAAQ;AAAA,cACR,cAAc;AAAA,YAChB;AAAA,UACF;AAAA,QACF,CAA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