@makeswift/runtime 0.16.0-canary.3 → 0.16.0-canary.5

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 (191) hide show
  1. package/dist/cjs/builder/serialization/control-serialization.js +11 -10
  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 -2
  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/Carousel/Carousel.js.map +1 -1
  8. package/dist/cjs/components/builtin/Carousel/register.js +1 -1
  9. package/dist/cjs/components/builtin/Carousel/register.js.map +1 -1
  10. package/dist/cjs/components/builtin/Countdown/Countdown.js.map +1 -1
  11. package/dist/cjs/components/builtin/Countdown/register.js +1 -1
  12. package/dist/cjs/components/builtin/Countdown/register.js.map +1 -1
  13. package/dist/cjs/components/builtin/Embed/Embed.js.map +1 -1
  14. package/dist/cjs/components/builtin/Embed/register.js +1 -1
  15. package/dist/cjs/components/builtin/Embed/register.js.map +1 -1
  16. package/dist/cjs/components/builtin/Form/Form.js.map +1 -1
  17. package/dist/cjs/components/builtin/Form/register.js +1 -1
  18. package/dist/cjs/components/builtin/Form/register.js.map +1 -1
  19. package/dist/cjs/components/builtin/Image/Image.js.map +1 -1
  20. package/dist/cjs/components/builtin/Navigation/Navigation.js.map +1 -1
  21. package/dist/cjs/components/builtin/Navigation/components/MobileMenu/index.js.map +1 -1
  22. package/dist/cjs/components/builtin/Navigation/register.js +2 -2
  23. package/dist/cjs/components/builtin/Navigation/register.js.map +1 -1
  24. package/dist/cjs/components/builtin/Root/Root.js.map +1 -1
  25. package/dist/cjs/components/builtin/Root/register.js +6 -5
  26. package/dist/cjs/components/builtin/Root/register.js.map +1 -1
  27. package/dist/cjs/components/builtin/SocialLinks/SocialLinks.js.map +1 -1
  28. package/dist/cjs/components/builtin/SocialLinks/register.js +1 -1
  29. package/dist/cjs/components/builtin/SocialLinks/register.js.map +1 -1
  30. package/dist/cjs/components/hooks/useGapXPropControllerData.js +34 -0
  31. package/dist/cjs/components/hooks/useGapXPropControllerData.js.map +1 -0
  32. package/dist/cjs/components/hooks/useGapYPropControllerData.js +34 -0
  33. package/dist/cjs/components/hooks/useGapYPropControllerData.js.map +1 -0
  34. package/dist/cjs/components/hooks/useLinkPropControllerData.js +1 -1
  35. package/dist/cjs/components/hooks/useLinkPropControllerData.js.map +1 -1
  36. package/dist/cjs/components/hooks/useNavigationLinksPropControllerData.js +34 -0
  37. package/dist/cjs/components/hooks/useNavigationLinksPropControllerData.js.map +1 -0
  38. package/dist/cjs/components/hooks/useTextAreaPropControllerData.js +34 -0
  39. package/dist/cjs/components/hooks/useTextAreaPropControllerData.js.map +1 -0
  40. package/dist/cjs/components/shared/Link/index.js.map +1 -1
  41. package/dist/cjs/controls/control.js +3 -3
  42. package/dist/cjs/controls/control.js.map +1 -1
  43. package/dist/cjs/next/api-handler/handlers/manifest.js +1 -1
  44. package/dist/cjs/prop-controllers/copy.js +2 -3
  45. package/dist/cjs/prop-controllers/copy.js.map +1 -1
  46. package/dist/cjs/prop-controllers/deleted.js +33 -0
  47. package/dist/cjs/prop-controllers/deleted.js.map +1 -0
  48. package/dist/cjs/prop-controllers/descriptors.js +0 -109
  49. package/dist/cjs/prop-controllers/descriptors.js.map +1 -1
  50. package/dist/cjs/prop-controllers/index.js +3 -0
  51. package/dist/cjs/prop-controllers/index.js.map +1 -1
  52. package/dist/cjs/prop-controllers/introspection.js +4 -72
  53. package/dist/cjs/prop-controllers/introspection.js.map +1 -1
  54. package/dist/cjs/runtimes/react/components/PreviewProvider.js +4 -0
  55. package/dist/cjs/runtimes/react/components/PreviewProvider.js.map +1 -1
  56. package/dist/cjs/runtimes/react/controls.js +44 -0
  57. package/dist/cjs/runtimes/react/controls.js.map +1 -1
  58. package/dist/cjs/state/react-builder-preview.js +95 -38
  59. package/dist/cjs/state/react-builder-preview.js.map +1 -1
  60. package/dist/esm/builder/serialization/control-serialization.js +13 -10
  61. package/dist/esm/builder/serialization/control-serialization.js.map +1 -1
  62. package/dist/esm/components/builtin/Box/Box.js.map +1 -1
  63. package/dist/esm/components/builtin/Box/register.js +4 -2
  64. package/dist/esm/components/builtin/Box/register.js.map +1 -1
  65. package/dist/esm/components/builtin/Button/Button.js.map +1 -1
  66. package/dist/esm/components/builtin/Carousel/Carousel.js.map +1 -1
  67. package/dist/esm/components/builtin/Carousel/register.js +9 -2
  68. package/dist/esm/components/builtin/Carousel/register.js.map +1 -1
  69. package/dist/esm/components/builtin/Countdown/Countdown.js.map +1 -1
  70. package/dist/esm/components/builtin/Countdown/register.js +2 -1
  71. package/dist/esm/components/builtin/Countdown/register.js.map +1 -1
  72. package/dist/esm/components/builtin/Embed/Embed.js.map +1 -1
  73. package/dist/esm/components/builtin/Embed/register.js +2 -2
  74. package/dist/esm/components/builtin/Embed/register.js.map +1 -1
  75. package/dist/esm/components/builtin/Form/Form.js.map +1 -1
  76. package/dist/esm/components/builtin/Form/register.js +2 -1
  77. package/dist/esm/components/builtin/Form/register.js.map +1 -1
  78. package/dist/esm/components/builtin/Image/Image.js.map +1 -1
  79. package/dist/esm/components/builtin/Navigation/Navigation.js.map +1 -1
  80. package/dist/esm/components/builtin/Navigation/components/MobileMenu/index.js.map +1 -1
  81. package/dist/esm/components/builtin/Navigation/register.js +5 -3
  82. package/dist/esm/components/builtin/Navigation/register.js.map +1 -1
  83. package/dist/esm/components/builtin/Root/Root.js.map +1 -1
  84. package/dist/esm/components/builtin/Root/register.js +3 -2
  85. package/dist/esm/components/builtin/Root/register.js.map +1 -1
  86. package/dist/esm/components/builtin/SocialLinks/SocialLinks.js.map +1 -1
  87. package/dist/esm/components/builtin/SocialLinks/register.js +2 -2
  88. package/dist/esm/components/builtin/SocialLinks/register.js.map +1 -1
  89. package/dist/esm/components/hooks/useGapXPropControllerData.js +12 -0
  90. package/dist/esm/components/hooks/useGapXPropControllerData.js.map +1 -0
  91. package/dist/esm/components/hooks/useGapYPropControllerData.js +12 -0
  92. package/dist/esm/components/hooks/useGapYPropControllerData.js.map +1 -0
  93. package/dist/esm/components/hooks/useLinkPropControllerData.js +2 -2
  94. package/dist/esm/components/hooks/useLinkPropControllerData.js.map +1 -1
  95. package/dist/esm/components/hooks/useNavigationLinksPropControllerData.js +12 -0
  96. package/dist/esm/components/hooks/useNavigationLinksPropControllerData.js.map +1 -0
  97. package/dist/esm/components/hooks/useTextAreaPropControllerData.js +12 -0
  98. package/dist/esm/components/hooks/useTextAreaPropControllerData.js.map +1 -0
  99. package/dist/esm/components/shared/Link/index.js.map +1 -1
  100. package/dist/esm/controls/control.js +3 -3
  101. package/dist/esm/controls/control.js.map +1 -1
  102. package/dist/esm/next/api-handler/handlers/manifest.js +1 -1
  103. package/dist/esm/prop-controllers/copy.js +4 -4
  104. package/dist/esm/prop-controllers/copy.js.map +1 -1
  105. package/dist/esm/prop-controllers/deleted.js +9 -0
  106. package/dist/esm/prop-controllers/deleted.js.map +1 -0
  107. package/dist/esm/prop-controllers/descriptors.js +0 -96
  108. package/dist/esm/prop-controllers/descriptors.js.map +1 -1
  109. package/dist/esm/prop-controllers/index.js +2 -0
  110. package/dist/esm/prop-controllers/index.js.map +1 -1
  111. package/dist/esm/prop-controllers/introspection.js +7 -83
  112. package/dist/esm/prop-controllers/introspection.js.map +1 -1
  113. package/dist/esm/runtimes/react/components/PreviewProvider.js +4 -0
  114. package/dist/esm/runtimes/react/components/PreviewProvider.js.map +1 -1
  115. package/dist/esm/runtimes/react/controls.js +44 -0
  116. package/dist/esm/runtimes/react/controls.js.map +1 -1
  117. package/dist/esm/state/react-builder-preview.js +105 -45
  118. package/dist/esm/state/react-builder-preview.js.map +1 -1
  119. package/dist/types/builder/serialization/control-serialization.d.ts +24 -23
  120. package/dist/types/builder/serialization/control-serialization.d.ts.map +1 -1
  121. package/dist/types/components/builtin/Box/Box.d.ts +15 -3
  122. package/dist/types/components/builtin/Box/Box.d.ts.map +1 -1
  123. package/dist/types/components/builtin/Box/register.d.ts.map +1 -1
  124. package/dist/types/components/builtin/Button/Button.d.ts +12 -12
  125. package/dist/types/components/builtin/Button/Button.d.ts.map +1 -1
  126. package/dist/types/components/builtin/Carousel/Carousel.d.ts +3 -2
  127. package/dist/types/components/builtin/Carousel/Carousel.d.ts.map +1 -1
  128. package/dist/types/components/builtin/Carousel/register.d.ts.map +1 -1
  129. package/dist/types/components/builtin/Countdown/Countdown.d.ts +3 -3
  130. package/dist/types/components/builtin/Countdown/Countdown.d.ts.map +1 -1
  131. package/dist/types/components/builtin/Countdown/register.d.ts.map +1 -1
  132. package/dist/types/components/builtin/Embed/Embed.d.ts +2 -2
  133. package/dist/types/components/builtin/Embed/Embed.d.ts.map +1 -1
  134. package/dist/types/components/builtin/Form/Form.d.ts +4 -4
  135. package/dist/types/components/builtin/Form/Form.d.ts.map +1 -1
  136. package/dist/types/components/builtin/Form/register.d.ts.map +1 -1
  137. package/dist/types/components/builtin/Image/Image.d.ts +2 -2
  138. package/dist/types/components/builtin/Image/Image.d.ts.map +1 -1
  139. package/dist/types/components/builtin/Navigation/Navigation.d.ts +5 -5
  140. package/dist/types/components/builtin/Navigation/Navigation.d.ts.map +1 -1
  141. package/dist/types/components/builtin/Navigation/components/MobileMenu/index.d.ts +2 -3
  142. package/dist/types/components/builtin/Navigation/components/MobileMenu/index.d.ts.map +1 -1
  143. package/dist/types/components/builtin/Navigation/register.d.ts.map +1 -1
  144. package/dist/types/components/builtin/Root/Root.d.ts +4 -3
  145. package/dist/types/components/builtin/Root/Root.d.ts.map +1 -1
  146. package/dist/types/components/builtin/Root/register.d.ts.map +1 -1
  147. package/dist/types/components/builtin/SocialLinks/SocialLinks.d.ts +3 -2
  148. package/dist/types/components/builtin/SocialLinks/SocialLinks.d.ts.map +1 -1
  149. package/dist/types/components/hooks/useGapXPropControllerData.d.ts +3 -0
  150. package/dist/types/components/hooks/useGapXPropControllerData.d.ts.map +1 -0
  151. package/dist/types/components/hooks/useGapYPropControllerData.d.ts +3 -0
  152. package/dist/types/components/hooks/useGapYPropControllerData.d.ts.map +1 -0
  153. package/dist/types/components/hooks/useLinkPropControllerData.d.ts +2 -2
  154. package/dist/types/components/hooks/useLinkPropControllerData.d.ts.map +1 -1
  155. package/dist/types/components/hooks/useNavigationLinksPropControllerData.d.ts +3 -0
  156. package/dist/types/components/hooks/useNavigationLinksPropControllerData.d.ts.map +1 -0
  157. package/dist/types/components/hooks/useTextAreaPropControllerData.d.ts +3 -0
  158. package/dist/types/components/hooks/useTextAreaPropControllerData.d.ts.map +1 -0
  159. package/dist/types/components/shared/Link/index.d.ts +2 -2
  160. package/dist/types/components/shared/Link/index.d.ts.map +1 -1
  161. package/dist/types/next/components/tests/page-gap-x-prop-controller.test.d.ts +3 -0
  162. package/dist/types/next/components/tests/page-gap-x-prop-controller.test.d.ts.map +1 -0
  163. package/dist/types/next/components/tests/page-gap-y-prop-controller.test.d.ts +3 -0
  164. package/dist/types/next/components/tests/page-gap-y-prop-controller.test.d.ts.map +1 -0
  165. package/dist/types/next/components/tests/page-link-prop-controller.test.d.ts +3 -0
  166. package/dist/types/next/components/tests/page-link-prop-controller.test.d.ts.map +1 -0
  167. package/dist/types/next/components/tests/page-navigation-links-prop-controller.test.d.ts +3 -0
  168. package/dist/types/next/components/tests/page-navigation-links-prop-controller.test.d.ts.map +1 -0
  169. package/dist/types/next/components/tests/page-text-area-prop-controller.test.d.ts +3 -0
  170. package/dist/types/next/components/tests/page-text-area-prop-controller.test.d.ts.map +1 -0
  171. package/dist/types/prop-controllers/copy.d.ts.map +1 -1
  172. package/dist/types/prop-controllers/deleted.d.ts +51 -0
  173. package/dist/types/prop-controllers/deleted.d.ts.map +1 -0
  174. package/dist/types/prop-controllers/descriptors.d.ts +14 -188
  175. package/dist/types/prop-controllers/descriptors.d.ts.map +1 -1
  176. package/dist/types/prop-controllers/index.d.ts +2 -1
  177. package/dist/types/prop-controllers/index.d.ts.map +1 -1
  178. package/dist/types/prop-controllers/introspection.d.ts.map +1 -1
  179. package/dist/types/runtimes/react/components/PreviewProvider.d.ts.map +1 -1
  180. package/dist/types/runtimes/react/controls.d.ts.map +1 -1
  181. package/dist/types/state/react-builder-preview.d.ts +11 -3
  182. package/dist/types/state/react-builder-preview.d.ts.map +1 -1
  183. package/package.json +2 -2
  184. package/dist/cjs/prop-controllers/copy/navigation-links.js +0 -58
  185. package/dist/cjs/prop-controllers/copy/navigation-links.js.map +0 -1
  186. package/dist/esm/prop-controllers/copy/navigation-links.js +0 -34
  187. package/dist/esm/prop-controllers/copy/navigation-links.js.map +0 -1
  188. package/dist/types/prop-controllers/copy/navigation-links.d.ts +0 -4
  189. package/dist/types/prop-controllers/copy/navigation-links.d.ts.map +0 -1
  190. package/dist/types/prop-controllers/copy/navigation-links.test.d.ts +0 -2
  191. package/dist/types/prop-controllers/copy/navigation-links.test.d.ts.map +0 -1
@@ -26,6 +26,7 @@ __export(control_serialization_exports, {
26
26
  module.exports = __toCommonJS(control_serialization_exports);
27
27
  var import_controls = require("../../controls");
28
28
  var import_prop_controllers2 = require("../../prop-controllers");
29
+ var import_deleted = require("../../prop-controllers/deleted");
29
30
  var import_combobox = require("./controls/combobox");
30
31
  var import_list = require("./controls/list");
31
32
  var import_rich_text_v2 = require("./controls/rich-text-v2");
@@ -317,15 +318,15 @@ function serializeControl(control) {
317
318
  switch (control.type) {
318
319
  case import_prop_controllers3.Types.Checkbox:
319
320
  return serializeCheckboxControl(control);
320
- case import_prop_controllers2.Props.Types.List:
321
+ case import_deleted.DELETED_PROP_CONTROLLER_TYPES.List:
321
322
  return serializeListControl(control);
322
- case import_prop_controllers2.Props.Types.Shape:
323
+ case import_deleted.DELETED_PROP_CONTROLLER_TYPES.Shape:
323
324
  return serializeShapeControl(control);
324
- case import_prop_controllers2.Props.Types.Typeahead:
325
+ case import_deleted.DELETED_PROP_CONTROLLER_TYPES.Typeahead:
325
326
  return serializeTypeaheadControl(control);
326
- case import_prop_controllers2.Props.Types.GapX:
327
+ case import_prop_controllers3.Types.GapX:
327
328
  return serializeGapXControl(control);
328
- case import_prop_controllers2.Props.Types.GapY:
329
+ case import_prop_controllers3.Types.GapY:
329
330
  return serializeGapYControl(control);
330
331
  case import_prop_controllers3.Types.ResponsiveColor:
331
332
  return serializeResponsiveColorControl(control);
@@ -369,15 +370,15 @@ function deserializeControl(serializedControl) {
369
370
  switch (serializedControl.type) {
370
371
  case import_prop_controllers3.Types.Checkbox:
371
372
  return deserializeCheckboxControl(serializedControl);
372
- case import_prop_controllers2.Props.Types.List:
373
+ case import_deleted.DELETED_PROP_CONTROLLER_TYPES.List:
373
374
  return deserializeListControl(serializedControl);
374
- case import_prop_controllers2.Props.Types.Shape:
375
+ case import_deleted.DELETED_PROP_CONTROLLER_TYPES.Shape:
375
376
  return deserializeShapeControl(serializedControl);
376
- case import_prop_controllers2.Props.Types.Typeahead:
377
+ case import_deleted.DELETED_PROP_CONTROLLER_TYPES.Typeahead:
377
378
  return deserializeTypeaheadControl(serializedControl);
378
- case import_prop_controllers2.Props.Types.GapX:
379
+ case import_prop_controllers3.Types.GapX:
379
380
  return deserializeGapXControl(serializedControl);
380
- case import_prop_controllers2.Props.Types.GapY:
381
+ case import_prop_controllers3.Types.GapY:
381
382
  return deserializeGapYControl(serializedControl);
382
383
  case import_prop_controllers3.Types.ResponsiveColor:
383
384
  return deserializeResponsiveColorControl(serializedControl);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/builder/serialization/control-serialization.ts"],"sourcesContent":["import {\n ResponsiveLengthOptions,\n ResponsiveLengthPropControllerData,\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} from '../../controls'\nimport {\n Data,\n Device,\n Gap,\n GapXDescriptor as GapXControl,\n GapXValue as GapXControlValue,\n GapYDescriptor as GapYControl,\n GapYValue as GapYControlValue,\n ImageDescriptor as ImageControl,\n ImageValue as ImageControlValue,\n ListDescriptor as ListControl,\n ListOptions as ListControlConfig,\n ListValue as ListControlValue,\n ResponsiveNumberDescriptor as ResponsiveNumberControl,\n ResponsiveNumberValue as ResponsiveNumberControlValue,\n ResponsiveIconRadioGroupDescriptor as ResponsiveIconRadioGroupControl,\n ResponsiveIconRadioGroupValue as ResponsiveIconRadioGroupControlValue,\n ResponsiveSelectDescriptor as ResponsiveSelectControl,\n ResponsiveSelectValue as ResponsiveSelectControlValue,\n RichTextDescriptor as RichTextControl,\n RichTextValue as RichTextControlValue,\n ShapeDescriptor as ShapeControl,\n ShapeValue as ShapeControlValue,\n TextInputDescriptor as TextInputControl,\n TextInputValue as TextInputControlValue,\n TypeaheadDescriptor as TypeaheadControl,\n TypeaheadOptions as TypeaheadControlConfig,\n TypeaheadValue as TypeaheadControlValue,\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 IconRadioGroupOption,\n SelectLabelOrientation,\n SelectOption,\n} 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 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} 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 Controls.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 Controls.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 Controls.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 Controls.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 Controls.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 Controls.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\ntype DeserializedConfig<T> =\n | T\n | DeserializedFunction<(props: Record<string, unknown>, deviceMode: Device) => T>\n\ntype GapXControlConfig = {\n preset?: GapXControlValue\n label?: string\n defaultValue?: Gap\n min?: number\n max?: number\n step?: number\n hidden?: boolean\n}\n\ntype SerializedGapXControl<_T = GapXControlValue> = {\n type: typeof Controls.Types.GapX\n options: SerializedConfig<GapXControlConfig>\n}\n\nfunction serializeGapXControl(control: GapXControl): [SerializedGapXControl, 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 DeserializedGapXControl<_T = GapXControlValue> = {\n type: typeof Controls.Types.GapX\n options: DeserializedConfig<GapXControlConfig>\n}\n\nfunction deserializeGapXControl(serializedControl: SerializedGapXControl): DeserializedGapXControl {\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?: GapYControlValue\n label?: string\n defaultValue?: Gap\n min?: number\n max?: number\n step?: number\n hidden?: boolean\n}\n\ntype SerializedGapYControl<_T = GapYControlValue> = {\n type: typeof Controls.Types.GapY\n options: SerializedConfig<GapYControlConfig>\n}\n\nfunction serializeGapYControl(control: GapYControl): [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 = GapYControlValue> = {\n type: typeof Controls.Types.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 ResponsiveNumberControlConfig = {\n preset?: ResponsiveNumberControlValue\n label?: string\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n hidden?: boolean\n}\n\ntype SerializedResponsiveNumberControl<_T = ResponsiveNumberControlValue> = {\n type: typeof Controls.Types.ResponsiveNumber\n options: SerializedConfig<ResponsiveNumberControlConfig>\n}\n\nfunction serializeResponsiveNumberControl(\n control: ResponsiveNumberControl,\n): [SerializedResponsiveNumberControl, 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 DeserializedResponsiveNumberControl<_T = ResponsiveNumberControlValue> = {\n type: typeof Controls.Types.ResponsiveNumber\n options: DeserializedConfig<ResponsiveNumberControlConfig>\n}\n\nfunction deserializeResponsiveNumberControl(\n serializedControl: SerializedResponsiveNumberControl,\n): DeserializedResponsiveNumberControl {\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 SerializedTextInputControl<_T = TextInputControlValue> = {\n type: typeof Controls.Types.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 Controls.Types.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 SerializedResponsiveSelectControl<_T = ResponsiveSelectControlValue> = {\n type: typeof Controls.Types.ResponsiveSelect\n options: SerializedConfig<ResponsiveSelectControlConfig>\n}\n\nfunction serializeResponsiveSelectControl(\n control: ResponsiveSelectControl,\n): [SerializedResponsiveSelectControl, 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 ResponsiveSelectControlConfig<T extends string = string, U extends T = T> = {\n label?: string\n labelOrientation?: SelectLabelOrientation\n options: SelectOption<T>[]\n defaultValue?: U\n hidden?: boolean\n}\n\ntype DeserializedResponsiveSelectControl<_T = ResponsiveSelectControlValue> = {\n type: typeof Controls.Types.ResponsiveSelect\n options: DeserializedConfig<ResponsiveSelectControlConfig>\n}\n\nfunction deserializeResponsiveSelectControl(\n serializedControl: SerializedResponsiveSelectControl,\n): DeserializedResponsiveSelectControl {\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 Controls.Types.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 Controls.Types.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 Controls.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 Controls.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 | GapXControl<T>\n | GapYControl<T>\n | ResponsiveNumberControl<T>\n | CheckboxControl<T>\n | ResponsiveColorDescriptor<T>\n | NumberDescriptor<T>\n | ResponsiveIconRadioGroupControl<\n T extends ResponsiveIconRadioGroupControlValue ? T : ResponsiveIconRadioGroupControlValue\n >\n | ResponsiveSelectControl<\n T extends ResponsiveSelectControlValue ? T : ResponsiveSelectControlValue\n >\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 | SerializedGapXControl<T>\n | SerializedGapYControl<T>\n | SerializedResponsiveNumberControl<T>\n | SerializedCheckboxControl<T>\n | SerializedResponsiveColorControl<T>\n | SerializedNumberControl<T>\n | SerializedResponsiveIconRadioGroupControl<T>\n | SerializedResponsiveSelectControl<T>\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 | GapXControl<T>\n | GapYControl<T>\n | ResponsiveNumberControl<T>\n | CheckboxControl<T>\n | ResponsiveColorDescriptor<T>\n | NumberDescriptor<T>\n | ResponsiveIconRadioGroupControl<\n T extends ResponsiveIconRadioGroupControlValue ? T : ResponsiveIconRadioGroupControlValue\n >\n | ResponsiveSelectControl<\n T extends ResponsiveSelectControlValue ? T : ResponsiveSelectControlValue\n >\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 | DeserializedGapXControl<T>\n | DeserializedGapYControl<T>\n | DeserializedResponsiveNumberControl<T>\n | DeserializedCheckboxControl<T>\n | DeserializedResponsiveColorControl<T>\n | DeserializedNumberControl<T>\n | DeserializedResponsiveIconRadioGroupControl<T>\n | DeserializedResponsiveSelectControl<T>\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 Controls.Types.List:\n return serializeListControl(control)\n\n case Controls.Types.Shape:\n return serializeShapeControl(control)\n\n case Controls.Types.Typeahead:\n return serializeTypeaheadControl(control)\n\n case Controls.Types.GapX:\n return serializeGapXControl(control)\n\n case Controls.Types.GapY:\n return serializeGapYControl(control)\n\n case PropControllerTypes.ResponsiveColor:\n return serializeResponsiveColorControl(control)\n\n case Controls.Types.ResponsiveNumber:\n return serializeResponsiveNumberControl(control)\n\n case PropControllerTypes.Number:\n return serializeNumberControl(control)\n\n case Controls.Types.ResponsiveIconRadioGroup:\n return serializeResponsiveIconRadioGroupControl(control)\n\n case Controls.Types.ResponsiveSelect:\n return serializeResponsiveSelectControl(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 Controls.Types.TextInput:\n return serializeTextInputControl(control)\n\n case PropControllerTypes.TextStyle:\n return serializeTextStyleControl(control)\n\n case Controls.Types.Image:\n return serializeImageControl(control)\n\n case Controls.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 Controls.Types.List:\n return deserializeListControl(serializedControl)\n\n case Controls.Types.Shape:\n return deserializeShapeControl(serializedControl)\n\n case Controls.Types.Typeahead:\n return deserializeTypeaheadControl(serializedControl)\n\n case Controls.Types.GapX:\n return deserializeGapXControl(serializedControl)\n\n case Controls.Types.GapY:\n return deserializeGapYControl(serializedControl)\n\n case PropControllerTypes.ResponsiveColor:\n return deserializeResponsiveColorControl(serializedControl)\n\n case Controls.Types.ResponsiveNumber:\n return deserializeResponsiveNumberControl(serializedControl)\n\n case PropControllerTypes.Number:\n return deserializeNumberControl(serializedControl)\n\n case Controls.Types.ResponsiveIconRadioGroup:\n return deserializeResponsiveIconRadioGroupControl(serializedControl)\n\n case Controls.Types.ResponsiveSelect:\n return deserializeResponsiveSelectControl(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 Controls.Types.TextInput:\n return deserializeTextInputControl(serializedControl)\n\n case PropControllerTypes.TextStyle:\n return deserializeTextStyleControl(serializedControl)\n\n case Controls.Types.Image:\n return deserializeImageControl(serializedControl)\n\n case Controls.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;AAIA,sBAWO;AAC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O,gDAAkC,iBAAiB;AAAA,IAE5D,KAAK;AACH,iBAAO,8CAAiC,iBAAiB;AAAA,IAE3D;AACE,aAAO;AAAA,EACX;AACF;AAEO,SAAS,kBACd,UACqD;AACrD,SAAO,OAAO,QAAQ,QAAQ,EAAE;AAAA,IAC9B,CAAC,CAAC,aAAa,gBAAgB,GAAG,CAAC,KAAK,OAAO,MAAM;AACnD,YAAM,CAAC,mBAAmB,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 GapXDescriptor,\n GapXPropControllerData,\n GapYDescriptor,\n GapYPropControllerData,\n ResponsiveLengthOptions,\n ResponsiveLengthPropControllerData,\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} from '../../controls'\nimport {\n Data,\n Device,\n ImageDescriptor as ImageControl,\n ImageValue as ImageControlValue,\n ResponsiveNumberDescriptor as ResponsiveNumberControl,\n ResponsiveNumberValue as ResponsiveNumberControlValue,\n ResponsiveIconRadioGroupDescriptor as ResponsiveIconRadioGroupControl,\n ResponsiveIconRadioGroupValue as ResponsiveIconRadioGroupControlValue,\n ResponsiveSelectDescriptor as ResponsiveSelectControl,\n ResponsiveSelectValue as ResponsiveSelectControlValue,\n RichTextDescriptor as RichTextControl,\n RichTextValue as RichTextControlValue,\n TextInputDescriptor as TextInputControl,\n TextInputValue as TextInputControlValue,\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 DeletedPropControllerDescriptor,\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} from '../../prop-controllers/deleted'\nimport {\n IconRadioGroupOption,\n SelectLabelOrientation,\n SelectOption,\n} 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 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} 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\ntype DeserializedConfig<T> =\n | T\n | DeserializedFunction<(props: Record<string, unknown>, deviceMode: Device) => T>\n\ntype GapXControlConfig = {\n preset?: GapXPropControllerData\n label?: string\n defaultValue?: GapData\n min?: number\n max?: number\n step?: number\n hidden?: boolean\n}\n\ntype SerializedGapXControl<_T = GapXPropControllerData> = {\n type: typeof PropControllerTypes.GapX\n options: SerializedConfig<GapXControlConfig>\n}\n\nfunction serializeGapXControl(control: GapXDescriptor): [SerializedGapXControl, 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 DeserializedGapXControl<_T = GapXPropControllerData> = {\n type: typeof PropControllerTypes.GapX\n options: DeserializedConfig<GapXControlConfig>\n}\n\nfunction deserializeGapXControl(serializedControl: SerializedGapXControl): DeserializedGapXControl {\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 ResponsiveNumberControlConfig = {\n preset?: ResponsiveNumberControlValue\n label?: string\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n hidden?: boolean\n}\n\ntype SerializedResponsiveNumberControl<_T = ResponsiveNumberControlValue> = {\n type: typeof Controls.Types.ResponsiveNumber\n options: SerializedConfig<ResponsiveNumberControlConfig>\n}\n\nfunction serializeResponsiveNumberControl(\n control: ResponsiveNumberControl,\n): [SerializedResponsiveNumberControl, 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 DeserializedResponsiveNumberControl<_T = ResponsiveNumberControlValue> = {\n type: typeof Controls.Types.ResponsiveNumber\n options: DeserializedConfig<ResponsiveNumberControlConfig>\n}\n\nfunction deserializeResponsiveNumberControl(\n serializedControl: SerializedResponsiveNumberControl,\n): DeserializedResponsiveNumberControl {\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 SerializedTextInputControl<_T = TextInputControlValue> = {\n type: typeof Controls.Types.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 Controls.Types.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 SerializedResponsiveSelectControl<_T = ResponsiveSelectControlValue> = {\n type: typeof Controls.Types.ResponsiveSelect\n options: SerializedConfig<ResponsiveSelectControlConfig>\n}\n\nfunction serializeResponsiveSelectControl(\n control: ResponsiveSelectControl,\n): [SerializedResponsiveSelectControl, 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 ResponsiveSelectControlConfig<T extends string = string, U extends T = T> = {\n label?: string\n labelOrientation?: SelectLabelOrientation\n options: SelectOption<T>[]\n defaultValue?: U\n hidden?: boolean\n}\n\ntype DeserializedResponsiveSelectControl<_T = ResponsiveSelectControlValue> = {\n type: typeof Controls.Types.ResponsiveSelect\n options: DeserializedConfig<ResponsiveSelectControlConfig>\n}\n\nfunction deserializeResponsiveSelectControl(\n serializedControl: SerializedResponsiveSelectControl,\n): DeserializedResponsiveSelectControl {\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 Controls.Types.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 Controls.Types.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 Controls.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 Controls.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 | GapXDescriptor<T>\n | GapYDescriptor<T>\n | ResponsiveNumberControl<T>\n | CheckboxControl<T>\n | ResponsiveColorDescriptor<T>\n | NumberDescriptor<T>\n | ResponsiveIconRadioGroupControl<\n T extends ResponsiveIconRadioGroupControlValue ? T : ResponsiveIconRadioGroupControlValue\n >\n | ResponsiveSelectControl<\n T extends ResponsiveSelectControlValue ? T : ResponsiveSelectControlValue\n >\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 | SerializedGapXControl<T>\n | SerializedGapYControl<T>\n | SerializedResponsiveNumberControl<T>\n | SerializedCheckboxControl<T>\n | SerializedResponsiveColorControl<T>\n | SerializedNumberControl<T>\n | SerializedResponsiveIconRadioGroupControl<T>\n | SerializedResponsiveSelectControl<T>\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 | GapXDescriptor<T>\n | GapYDescriptor<T>\n | ResponsiveNumberControl<T>\n | CheckboxControl<T>\n | ResponsiveColorDescriptor<T>\n | NumberDescriptor<T>\n | ResponsiveIconRadioGroupControl<\n T extends ResponsiveIconRadioGroupControlValue ? T : ResponsiveIconRadioGroupControlValue\n >\n | ResponsiveSelectControl<\n T extends ResponsiveSelectControlValue ? T : ResponsiveSelectControlValue\n >\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 | DeserializedGapXControl<T>\n | DeserializedGapYControl<T>\n | DeserializedResponsiveNumberControl<T>\n | DeserializedCheckboxControl<T>\n | DeserializedResponsiveColorControl<T>\n | DeserializedNumberControl<T>\n | DeserializedResponsiveIconRadioGroupControl<T>\n | DeserializedResponsiveSelectControl<T>\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> | DeletedPropControllerDescriptor<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 serializeGapXControl(control)\n\n case PropControllerTypes.GapY:\n return serializeGapYControl(control)\n\n case PropControllerTypes.ResponsiveColor:\n return serializeResponsiveColorControl(control)\n\n case Controls.Types.ResponsiveNumber:\n return serializeResponsiveNumberControl(control)\n\n case PropControllerTypes.Number:\n return serializeNumberControl(control)\n\n case Controls.Types.ResponsiveIconRadioGroup:\n return serializeResponsiveIconRadioGroupControl(control)\n\n case Controls.Types.ResponsiveSelect:\n return serializeResponsiveSelectControl(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 Controls.Types.TextInput:\n return serializeTextInputControl(control)\n\n case PropControllerTypes.TextStyle:\n return serializeTextStyleControl(control)\n\n case Controls.Types.Image:\n return serializeImageControl(control)\n\n case Controls.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 deserializeGapXControl(serializedControl)\n\n case PropControllerTypes.GapY:\n return deserializeGapYControl(serializedControl)\n\n case PropControllerTypes.ResponsiveColor:\n return deserializeResponsiveColorControl(serializedControl)\n\n case Controls.Types.ResponsiveNumber:\n return deserializeResponsiveNumberControl(serializedControl)\n\n case PropControllerTypes.Number:\n return deserializeNumberControl(serializedControl)\n\n case Controls.Types.ResponsiveIconRadioGroup:\n return deserializeResponsiveIconRadioGroupControl(serializedControl)\n\n case Controls.Types.ResponsiveSelect:\n return deserializeResponsiveSelectControl(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 Controls.Types.TextInput:\n return deserializeTextInputControl(serializedControl)\n\n case PropControllerTypes.TextStyle:\n return deserializeTextStyleControl(serializedControl)\n\n case Controls.Types.Image:\n return deserializeImageControl(serializedControl)\n\n case Controls.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])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0B,iBAAiB;AAAA,IAEpD,KAAK;AACH,iBAAO,sDAAqC,iBAAiB;AAAA,IAE/D,KAAK;AACH,iBAAO,gDAAkC,iBAAiB;AAAA,IAE5D,KAAK;AACH,iBAAO,8CAAiC,iBAAiB;AAAA,IAE3D;AACE,aAAO;AAAA,EACX;AACF;AAEO,SAAS,kBACd,UACqD;AACrD,SAAO,OAAO,QAAQ,QAAQ,EAAE;AAAA,IAC9B,CAAC,CAAC,aAAa,gBAAgB,GAAG,CAAC,KAAK,OAAO,MAAM;AACnD,YAAM,CAAC,mBAAmB,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 +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 {\n ElementIDValue,\n ResponsiveIconRadioGroupValue,\n GridValue,\n GapYValue,\n GapXValue,\n BackgroundsValue,\n} 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'\n\ntype Props = {\n id?: ElementIDValue\n backgrounds?: BackgroundsValue\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?: GapYValue\n columnGap?: GapXValue\n hidePlaceholder?: boolean\n children?: GridValue\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;AAuMc;AArMd,mBAQO;AACP,iBAAmB;AACnB,kBAA2B;AAE3B,IAAAA,gBAAwB;AACxB,yBAAwB;AACxB,wBAA8E;AAS9E,uBAAiD;AACjD,kCAAiC;AACjC,8BAAmC;AACnC,uBAAyB;AACzB,uBAAyB;AAqBzB,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,CAA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,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 {\n ElementIDValue,\n ResponsiveIconRadioGroupValue,\n GridValue,\n BackgroundsValue,\n} 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 { ResponsiveGapData } from '@makeswift/prop-controllers'\n\ntype Props = {\n id?: ElementIDValue\n backgrounds?: BackgroundsValue\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?: GridValue\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;AAsMc;AApMd,mBAQO;AACP,iBAAmB;AAC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;AAAA,QACA;AAAA,QACA;AAAA,YACA,2BAAS,EAAE,SAAS,OAAO,CAAC;AAAA,YAC5B,+BAAS,4CAAmB,CAAC,MAAM,GAAG,CAAC,CAAC,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"]}
@@ -96,10 +96,10 @@ function registerComponent(runtime) {
96
96
  border: (0, import_prop_controllers.Border)({ format: import_prop_controllers.Border.Format.ClassName }),
97
97
  borderRadius: (0, import_prop_controllers.BorderRadius)({ format: import_prop_controllers.BorderRadius.Format.ClassName }),
98
98
  boxShadow: (0, import_prop_controllers.Shadows)({ format: import_prop_controllers.Shadows.Format.ClassName }),
99
- rowGap: import_prop_controllers2.Props.GapY((props) => ({
99
+ rowGap: (0, import_prop_controllers.GapY)((props) => ({
100
100
  hidden: props.children == null
101
101
  })),
102
- columnGap: import_prop_controllers2.Props.GapX((props) => ({
102
+ columnGap: (0, import_prop_controllers.GapX)((props) => ({
103
103
  hidden: props.children == null
104
104
  })),
105
105
  boxAnimateType: import_prop_controllers2.Props.ResponsiveSelect({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/builtin/Box/register.ts"],"sourcesContent":["import {\n Border,\n BorderRadius,\n Checkbox,\n Margin,\n Padding,\n Shadows,\n Width,\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'\nimport { ResponsiveSelectValue } from '../../../prop-controllers/descriptors'\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 = props[property] as ResponsiveSelectValue<BoxAnimateIn> | undefined\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: Props.ElementID(),\n backgrounds: Props.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: Props.GapY(props => ({\n hidden: props.children == null,\n })),\n columnGap: Props.GapX(props => ({\n hidden: props.children == null,\n })),\n boxAnimateType: Props.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: Props.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: Props.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: Props.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: Props.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: Props.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: Props.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: Props.Grid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QACD,qBAAqB,+BAAM,iBAAiB,CAAC,OAAO,YAAY;AAAA,UAC9D,OAAO;AAAA,UACP,cAAc;AAAA,UACd,KAAK;AAAA,UACL,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,QAAQ,6BAA6B,OAAO,MAAM;AAAA,QACpD,EAAE;AAAA,QACF,kBAAkB,+BAAM,iBAAiB,CAAC,OAAO,YAAY;AAAA,UAC3D,OAAO;AAAA,UACP,cAAc;AAAA,UACd,KAAK;AAAA,UACL,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,QAAQ,6BAA6B,OAAO,MAAM;AAAA,QACpD,EAAE;AAAA,QACF,qBAAqB,+BAAM,iBAAiB,CAAC,OAAO,YAAY;AAAA,UAC9D,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,UAAU,+BAAM,KAAK;AAAA,MACvB;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 Border,\n BorderRadius,\n Checkbox,\n GapX,\n GapY,\n Margin,\n Padding,\n Shadows,\n Width,\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'\nimport { ResponsiveSelectValue } from '../../../prop-controllers/descriptors'\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 = props[property] as ResponsiveSelectValue<BoxAnimateIn> | undefined\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: Props.ElementID(),\n backgrounds: Props.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: Props.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: Props.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: Props.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: Props.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: Props.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: Props.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: Props.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: Props.Grid(),\n },\n },\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAUO;AACP,IAAAA,2BAAsB;AAEtB,yBAA0D;AAC1D,uBAAuC;AACvC,IAAAC,oBAMO;AACP,IAAAC,gBAAqB;AAGd,SAAS,kBAAkB,SAAuB;AACvD,WAAS,6BACP,OACA,UACA,UACS;AACT,UAAM,YAAY,MAAM,QAAQ;AAChC,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,IAAI,+BAAM,UAAU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AA,QACF,UAAU,+BAAM,KAAK;AAAA,MACvB;AAAA,IACF;AAAA,EACF;AACF;","names":["import_prop_controllers","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 {\n ElementIDValue,\n ResponsiveSelectValue,\n ResponsiveIconRadioGroupValue,\n} 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 LinkPropControllerValue,\n ResponsiveLengthData,\n ResponsiveTextStyleData,\n} from '@makeswift/prop-controllers'\n\ntype BaseProps<T extends ElementType> = {\n as?: T\n id?: ElementIDValue\n children?: ReactNode\n link?: LinkPropControllerValue\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;AAyEI;AAAA;AAAA;AAAA;AAzEJ,mBAOO;AACP,mBAAwB;AAOxB,2BAA8B;AAC9B,kBAAqB;AAGrB,uBAAyB;AACzB,8BAIO;AACP,iBAAmB;AAyBnB,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;AAAA,MACA;AAAA,MACA,eAAW;AAAA,YACT,2BAAS;AAAA,UACP,SAAS;AAAA,UACT,QAAQ;AAAA,UACR,SAAS;AAAA,UACT,YAAY;AAAA,UACZ,QAAQ;AAAA,UACR,YAAY;AAAA,UACZ,gBAAgB;AAAA,UAChB,WAAW;AAAA,QACb,CAAC;AAAA,YACD,+BAAS,4CA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AAY,oCAAcD,MAAK,CAAC,EAAE,OAAO,GAAG,EAAE,SAAS,IAAI,EAAE,IAAI,CAAC;AAAA;AAAA,sBAEtE,SAAS;AAAA,sBACT,YAAY;AAAA,oBACd;AAAA,oBAEA,UAAU;AAAA,sBACR,WAAW;AAAA,wBACT,SAAS;AAAA,sBACX;AAAA,oBACF;AAAA,oBAEA,WAAW;AAAA,sBACT,WAAW;AAAA,wBACT,SAAS;AAAA,sBACX;AAAA,oBACF;AAAA,kBACF;AAAA,kBACA,QAAQ;AAAA,oBACN,UAAU;AAAA,oBACV,QAAQ;AAAA,oBAER,WAAW;AAAA,sBACT,UAAU;AAAA,sBACV,SAAS;AAAA,sBACT,KAAK;AAAA,sBACL,OAAO;AAAA,sBACP,QAAQ;AAAA,sBACR,MAAM;AAAA,sBACN,QAAQ;AAAA,sBACR,gBAAY,oCAAcA,MAAK;AAAA,sBAC/B,WAAW;AAAA,sBACX,cAAc;AAAA,sBACd,YAAY;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 {\n ElementIDValue,\n ResponsiveSelectValue,\n ResponsiveIconRadioGroupValue,\n} 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 LinkData,\n ResponsiveLengthData,\n ResponsiveTextStyleData,\n} from '@makeswift/prop-controllers'\n\ntype BaseProps<T extends ElementType> = {\n as?: T\n id?: ElementIDValue\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;AAyEI;AAAA;AAAA;AAAA;AAzEJ,mBAOO;AACP,mBAAwB;AAOxB,2BAA8B;AAC9B,kBAAqB;AAGrB,uBAAyB;AACzB,8BAIO;AACP,iBAAmB;AAyBnB,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;AAAA,MACA;AAAA,MACA,eAAW;AAAA,YACT,2BAAS;AAAA,UACP,SAAS;AAAA,UACT,QAAQ;AAAA,UACR,SAAS;AAAA,UACT,YAAY;AAAA,UACZ,QAAQ;AAAA,UACR,YAAY;AAAA,UACZ,gBAAgB;AAAA,UAChB,WAAW;AAAA,QACb,CAAC;AAAA,YACD,+BAAS,4CAAmB,OAAO,MAAM,CAAC;AAAA,QAC1C;AAAA,YACA;AAAA,cACE;AAAA,YACE,CAAC,SAAS,OAAO,MAAM,WAAW,KAAK;AAAA,YACvC,CAAC;AAAA,cACCC,WAAU;AAAA,cACVC,SAAQ;AAAA,cACRC,QAAO;AAAA,cACPC,aAAY,EAAE,QAAQ,EAAE,KAAK,GAAG,YAAY,GAAG,WAAW,IAAI,GAAG,OAAO,EAAE;AAAA,cAC1EC,SAAQ,EAAE,QAAQ,EAAE,KAAK,GAAG,YAAY,GAAG,WAAW,EAAE,GAAG,OAAO,EAA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