@makeswift/runtime 0.16.0-canary.1 → 0.16.0-canary.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/dist/cjs/builder/serialization/control-serialization.js +2 -2
  2. package/dist/cjs/builder/serialization/control-serialization.js.map +1 -1
  3. package/dist/cjs/components/builtin/Box/register.js +5 -5
  4. package/dist/cjs/components/builtin/Box/register.js.map +1 -1
  5. package/dist/cjs/components/builtin/Button/Button.js.map +1 -1
  6. package/dist/cjs/components/builtin/Button/register.js +2 -2
  7. package/dist/cjs/components/builtin/Button/register.js.map +1 -1
  8. package/dist/cjs/components/builtin/Carousel/register.js +3 -3
  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 +6 -6
  12. package/dist/cjs/components/builtin/Countdown/register.js.map +1 -1
  13. package/dist/cjs/components/builtin/Divider/register.js +3 -3
  14. package/dist/cjs/components/builtin/Divider/register.js.map +1 -1
  15. package/dist/cjs/components/builtin/Embed/register.js +3 -2
  16. package/dist/cjs/components/builtin/Embed/register.js.map +1 -1
  17. package/dist/cjs/components/builtin/Form/Form.js.map +1 -1
  18. package/dist/cjs/components/builtin/Form/register.js +4 -4
  19. package/dist/cjs/components/builtin/Form/register.js.map +1 -1
  20. package/dist/cjs/components/builtin/Image/Image.js.map +1 -1
  21. package/dist/cjs/components/builtin/Image/register.js +3 -3
  22. package/dist/cjs/components/builtin/Image/register.js.map +1 -1
  23. package/dist/cjs/components/builtin/Navigation/register.js +3 -3
  24. package/dist/cjs/components/builtin/Navigation/register.js.map +1 -1
  25. package/dist/cjs/components/builtin/SocialLinks/register.js +4 -4
  26. package/dist/cjs/components/builtin/SocialLinks/register.js.map +1 -1
  27. package/dist/cjs/components/builtin/Text/register.js +5 -4
  28. package/dist/cjs/components/builtin/Text/register.js.map +1 -1
  29. package/dist/cjs/components/builtin/Video/Video.js.map +1 -1
  30. package/dist/cjs/components/builtin/Video/register.js +4 -4
  31. package/dist/cjs/components/builtin/Video/register.js.map +1 -1
  32. package/dist/cjs/components/hooks/index.js +9 -1
  33. package/dist/cjs/components/hooks/index.js.map +1 -1
  34. package/dist/cjs/{prop-controllers/copy/table.js → components/hooks/useDatePropControllerData.js} +11 -10
  35. package/dist/cjs/components/hooks/useDatePropControllerData.js.map +1 -0
  36. package/dist/cjs/components/hooks/useFontPropControllerData.js +34 -0
  37. package/dist/cjs/components/hooks/useFontPropControllerData.js.map +1 -0
  38. package/dist/cjs/components/hooks/useTablePropControllerData.js +34 -0
  39. package/dist/cjs/components/hooks/useTablePropControllerData.js.map +1 -0
  40. package/dist/cjs/components/hooks/useVideoPropControllerData.js +34 -0
  41. package/dist/cjs/components/hooks/useVideoPropControllerData.js.map +1 -0
  42. package/dist/cjs/components/utils/responsive-style.js.map +1 -1
  43. package/dist/cjs/controls/control.js +1 -1
  44. package/dist/cjs/controls/control.js.map +1 -1
  45. package/dist/cjs/global.d.js +1 -0
  46. package/dist/cjs/global.d.js.map +1 -1
  47. package/dist/cjs/jest-setup.js +30 -0
  48. package/dist/cjs/jest-setup.js.map +1 -0
  49. package/dist/cjs/next/api-handler/handlers/manifest.js +1 -1
  50. package/dist/cjs/prop-controllers/copy.js +2 -3
  51. package/dist/cjs/prop-controllers/copy.js.map +1 -1
  52. package/dist/cjs/prop-controllers/descriptors.js +0 -63
  53. package/dist/cjs/prop-controllers/descriptors.js.map +1 -1
  54. package/dist/cjs/prop-controllers/index.js.map +1 -1
  55. package/dist/cjs/prop-controllers/introspection.js +2 -3
  56. package/dist/cjs/prop-controllers/introspection.js.map +1 -1
  57. package/dist/cjs/runtimes/react/controls.js +68 -27
  58. package/dist/cjs/runtimes/react/controls.js.map +1 -1
  59. package/dist/cjs/utils/tests/breakpoint-test-util.js +35 -0
  60. package/dist/cjs/utils/tests/breakpoint-test-util.js.map +1 -0
  61. package/dist/cjs/utils/tests/element-data-test-test.js +74 -0
  62. package/dist/cjs/utils/tests/element-data-test-test.js.map +1 -0
  63. package/dist/esm/builder/serialization/control-serialization.js +2 -2
  64. package/dist/esm/builder/serialization/control-serialization.js.map +1 -1
  65. package/dist/esm/components/builtin/Box/register.js +14 -6
  66. package/dist/esm/components/builtin/Box/register.js.map +1 -1
  67. package/dist/esm/components/builtin/Button/Button.js.map +1 -1
  68. package/dist/esm/components/builtin/Button/register.js +3 -3
  69. package/dist/esm/components/builtin/Button/register.js.map +1 -1
  70. package/dist/esm/components/builtin/Carousel/register.js +4 -4
  71. package/dist/esm/components/builtin/Carousel/register.js.map +1 -1
  72. package/dist/esm/components/builtin/Countdown/Countdown.js.map +1 -1
  73. package/dist/esm/components/builtin/Countdown/register.js +13 -7
  74. package/dist/esm/components/builtin/Countdown/register.js.map +1 -1
  75. package/dist/esm/components/builtin/Divider/register.js +4 -4
  76. package/dist/esm/components/builtin/Divider/register.js.map +1 -1
  77. package/dist/esm/components/builtin/Embed/register.js +3 -2
  78. package/dist/esm/components/builtin/Embed/register.js.map +1 -1
  79. package/dist/esm/components/builtin/Form/Form.js.map +1 -1
  80. package/dist/esm/components/builtin/Form/register.js +12 -5
  81. package/dist/esm/components/builtin/Form/register.js.map +1 -1
  82. package/dist/esm/components/builtin/Image/Image.js.map +1 -1
  83. package/dist/esm/components/builtin/Image/register.js +13 -4
  84. package/dist/esm/components/builtin/Image/register.js.map +1 -1
  85. package/dist/esm/components/builtin/Navigation/register.js +6 -4
  86. package/dist/esm/components/builtin/Navigation/register.js.map +1 -1
  87. package/dist/esm/components/builtin/SocialLinks/register.js +5 -5
  88. package/dist/esm/components/builtin/SocialLinks/register.js.map +1 -1
  89. package/dist/esm/components/builtin/Text/register.js +5 -4
  90. package/dist/esm/components/builtin/Text/register.js.map +1 -1
  91. package/dist/esm/components/builtin/Video/Video.js.map +1 -1
  92. package/dist/esm/components/builtin/Video/register.js +5 -5
  93. package/dist/esm/components/builtin/Video/register.js.map +1 -1
  94. package/dist/esm/components/hooks/index.js +4 -0
  95. package/dist/esm/components/hooks/index.js.map +1 -1
  96. package/dist/esm/components/hooks/useDatePropControllerData.js +12 -0
  97. package/dist/esm/components/hooks/useDatePropControllerData.js.map +1 -0
  98. package/dist/esm/components/hooks/useFontPropControllerData.js +12 -0
  99. package/dist/esm/components/hooks/useFontPropControllerData.js.map +1 -0
  100. package/dist/esm/components/hooks/useTablePropControllerData.js +12 -0
  101. package/dist/esm/components/hooks/useTablePropControllerData.js.map +1 -0
  102. package/dist/esm/components/hooks/useVideoPropControllerData.js +12 -0
  103. package/dist/esm/components/hooks/useVideoPropControllerData.js.map +1 -0
  104. package/dist/esm/components/utils/responsive-style.js.map +1 -1
  105. package/dist/esm/controls/control.js +1 -1
  106. package/dist/esm/controls/control.js.map +1 -1
  107. package/dist/esm/global.d.js +1 -0
  108. package/dist/esm/global.d.js.map +1 -1
  109. package/dist/esm/jest-setup.js +29 -0
  110. package/dist/esm/jest-setup.js.map +1 -0
  111. package/dist/esm/next/api-handler/handlers/manifest.js +1 -1
  112. package/dist/esm/prop-controllers/copy.js +6 -4
  113. package/dist/esm/prop-controllers/copy.js.map +1 -1
  114. package/dist/esm/prop-controllers/descriptors.js +0 -53
  115. package/dist/esm/prop-controllers/descriptors.js.map +1 -1
  116. package/dist/esm/prop-controllers/index.js.map +1 -1
  117. package/dist/esm/prop-controllers/introspection.js +4 -4
  118. package/dist/esm/prop-controllers/introspection.js.map +1 -1
  119. package/dist/esm/runtimes/react/controls.js +61 -14
  120. package/dist/esm/runtimes/react/controls.js.map +1 -1
  121. package/dist/esm/utils/tests/breakpoint-test-util.js +9 -0
  122. package/dist/esm/utils/tests/breakpoint-test-util.js.map +1 -0
  123. package/dist/esm/utils/tests/element-data-test-test.js +49 -0
  124. package/dist/esm/utils/tests/element-data-test-test.js.map +1 -0
  125. package/dist/types/builder/serialization/control-serialization.d.ts +7 -7
  126. package/dist/types/builder/serialization/control-serialization.d.ts.map +1 -1
  127. package/dist/types/components/builtin/Box/register.d.ts.map +1 -1
  128. package/dist/types/components/builtin/Button/Button.d.ts +3 -3
  129. package/dist/types/components/builtin/Button/Button.d.ts.map +1 -1
  130. package/dist/types/components/builtin/Countdown/Countdown.d.ts +5 -4
  131. package/dist/types/components/builtin/Countdown/Countdown.d.ts.map +1 -1
  132. package/dist/types/components/builtin/Countdown/register.d.ts.map +1 -1
  133. package/dist/types/components/builtin/Embed/register.d.ts.map +1 -1
  134. package/dist/types/components/builtin/Form/Form.d.ts +2 -2
  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 +3 -3
  138. package/dist/types/components/builtin/Image/Image.d.ts.map +1 -1
  139. package/dist/types/components/builtin/Image/register.d.ts.map +1 -1
  140. package/dist/types/components/builtin/Navigation/register.d.ts.map +1 -1
  141. package/dist/types/components/builtin/Text/register.d.ts.map +1 -1
  142. package/dist/types/components/builtin/Video/Video.d.ts +3 -2
  143. package/dist/types/components/builtin/Video/Video.d.ts.map +1 -1
  144. package/dist/types/components/hooks/index.d.ts +4 -0
  145. package/dist/types/components/hooks/index.d.ts.map +1 -1
  146. package/dist/types/components/hooks/useDatePropControllerData.d.ts +3 -0
  147. package/dist/types/components/hooks/useDatePropControllerData.d.ts.map +1 -0
  148. package/dist/types/components/hooks/useFontPropControllerData.d.ts +3 -0
  149. package/dist/types/components/hooks/useFontPropControllerData.d.ts.map +1 -0
  150. package/dist/types/components/hooks/useTablePropControllerData.d.ts +3 -0
  151. package/dist/types/components/hooks/useTablePropControllerData.d.ts.map +1 -0
  152. package/dist/types/components/hooks/useVideoPropControllerData.d.ts +3 -0
  153. package/dist/types/components/hooks/useVideoPropControllerData.d.ts.map +1 -0
  154. package/dist/types/components/utils/responsive-style.d.ts +5 -5
  155. package/dist/types/components/utils/responsive-style.d.ts.map +1 -1
  156. package/dist/types/jest-setup.d.ts +2 -0
  157. package/dist/types/jest-setup.d.ts.map +1 -0
  158. package/dist/types/next/components/tests/page-border-prop-controller.test.d.ts +3 -0
  159. package/dist/types/next/components/tests/page-border-prop-controller.test.d.ts.map +1 -0
  160. package/dist/types/next/components/tests/page-date-prop-controller.test.d.ts +3 -0
  161. package/dist/types/next/components/tests/page-date-prop-controller.test.d.ts.map +1 -0
  162. package/dist/types/next/components/tests/page-font-prop-controller.test.d.ts +3 -0
  163. package/dist/types/next/components/tests/page-font-prop-controller.test.d.ts.map +1 -0
  164. package/dist/types/next/components/tests/page-margin-prop-controller.test.d.ts +3 -0
  165. package/dist/types/next/components/tests/page-margin-prop-controller.test.d.ts.map +1 -0
  166. package/dist/types/next/components/tests/page-padding-prop-controller.test.d.ts +3 -0
  167. package/dist/types/next/components/tests/page-padding-prop-controller.test.d.ts.map +1 -0
  168. package/dist/types/next/components/tests/page-table-prop-controller.test.d.ts +3 -0
  169. package/dist/types/next/components/tests/page-table-prop-controller.test.d.ts.map +1 -0
  170. package/dist/types/next/components/tests/page-video-prop-controller.test.d.ts +3 -0
  171. package/dist/types/next/components/tests/page-video-prop-controller.test.d.ts.map +1 -0
  172. package/dist/types/next/components/tests/page-width-prop-controller.test.d.ts +3 -0
  173. package/dist/types/next/components/tests/page-width-prop-controller.test.d.ts.map +1 -0
  174. package/dist/types/prop-controllers/copy.d.ts.map +1 -1
  175. package/dist/types/prop-controllers/descriptors.d.ts +18 -161
  176. package/dist/types/prop-controllers/descriptors.d.ts.map +1 -1
  177. package/dist/types/prop-controllers/index.d.ts +1 -1
  178. package/dist/types/prop-controllers/index.d.ts.map +1 -1
  179. package/dist/types/prop-controllers/introspection.d.ts.map +1 -1
  180. package/dist/types/runtimes/react/controls.d.ts +1 -5
  181. package/dist/types/runtimes/react/controls.d.ts.map +1 -1
  182. package/dist/types/slate/test-helpers/editor-v1.d.ts +2 -1
  183. package/dist/types/slate/test-helpers/editor-v1.d.ts.map +1 -1
  184. package/dist/types/slate/test-helpers/editor-v2-inline.d.ts +1 -0
  185. package/dist/types/slate/test-helpers/editor-v2-inline.d.ts.map +1 -1
  186. package/dist/types/slate/test-helpers/editor-v2.d.ts +1 -0
  187. package/dist/types/slate/test-helpers/editor-v2.d.ts.map +1 -1
  188. package/dist/types/state/react-page.test.d.ts +1 -0
  189. package/dist/types/state/react-page.test.d.ts.map +1 -1
  190. package/dist/types/utils/tests/breakpoint-test-util.d.ts +4 -0
  191. package/dist/types/utils/tests/breakpoint-test-util.d.ts.map +1 -0
  192. package/dist/types/utils/tests/element-data-test-test.d.ts +20 -0
  193. package/dist/types/utils/tests/element-data-test-test.d.ts.map +1 -0
  194. package/package.json +13 -6
  195. package/dist/cjs/prop-controllers/copy/table.js.map +0 -1
  196. package/dist/esm/prop-controllers/copy/table.js +0 -9
  197. package/dist/esm/prop-controllers/copy/table.js.map +0 -1
  198. package/dist/types/prop-controllers/copy/table.d.ts +0 -4
  199. package/dist/types/prop-controllers/copy/table.d.ts.map +0 -1
  200. package/dist/types/prop-controllers/copy/table.test.d.ts +0 -2
  201. package/dist/types/prop-controllers/copy/table.test.d.ts.map +0 -1
@@ -339,7 +339,7 @@ function serializeControl(control) {
339
339
  return serializeResponsiveSelectControl(control);
340
340
  case import_prop_controllers3.Types.ResponsiveLength:
341
341
  return serializeResponsiveLengthControl(control);
342
- case import_prop_controllers2.Props.Types.Date:
342
+ case import_prop_controllers3.Types.Date:
343
343
  return serializeDateControl(control);
344
344
  case import_prop_controllers3.Types.Link:
345
345
  return serializeLinkControl(control);
@@ -391,7 +391,7 @@ function deserializeControl(serializedControl) {
391
391
  return deserializeResponsiveSelectControl(serializedControl);
392
392
  case import_prop_controllers3.Types.ResponsiveLength:
393
393
  return deserializeResponsiveLengthControl(serializedControl);
394
- case import_prop_controllers2.Props.Types.Date:
394
+ case import_prop_controllers3.Types.Date:
395
395
  return deserializeDateControl(serializedControl);
396
396
  case import_prop_controllers3.Types.Link:
397
397
  return deserializeLinkControl(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 DateDescriptor as DateControl,\n DateValue as DateControlValue,\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 TextStyleDescriptor as TextStyleControl,\n TextStyleValue as TextStyleControlValue,\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 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} 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?: DateControlValue }\n\ntype SerializedDateControl<_T = DateControlValue> = {\n type: typeof Controls.Types.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 = DateControlValue> = {\n type: typeof Controls.Types.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 = TextStyleControlValue> = {\n type: typeof Controls.Types.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?: TextStyleControlValue\n label?: string\n hidden?: boolean\n}\n\ntype DeserializedTextStyleControl<_T = TextStyleControlValue> = {\n type: typeof Controls.Types.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 Controls.Types.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 Controls.Types.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 Controls.Types.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 Controls.Types.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;AACP,IAAAA,2BAqCO;AAMP,sBAGO;AACP,kBAAiF;AACjF,0BAAyE;AACzE,mBAGO;AACP,sBAAmE;AAEnE,oCAMO;AACP,IAAAA,2BAaO;AAeP,SAAS,sBAIP,SAOA;AACA,QAAM,EAAE,KAAK,IAAI,QAAQ;AACzB,QAAM,gBAAgC,CAAC;AACvC,QAAM,iBAAiB,CAAC;AAIxB,SAAO,QAAQ,IAAI,EAAE,QAAQ,CAAC,CAAC,KAAKC,QAAO,MAAM;AAC/C,UAAM,CAAC,mBAAmB,8BAA8B,IAAI,iBAAiBA,QAAO;AAEpF,mBAAe,GAAwB,IAAI;AAC3C,kBAAc,KAAK,GAAG,8BAA8B;AAAA,EACtD,CAAC;AAGD,SAAO,CAAC,EAAE,GAAG,SAAS,SAAS,EAAE,GAAG,QAAQ,SAAS,MAAM,eAAe,EAAE,GAAG,aAAa;AAC9F;AAeA,SAAS,wBAIP,SAIA;AACA,QAAM,EAAE,KAAK,IAAI,QAAQ;AACzB,QAAM,mBAAmB,CAAC;AAI1B,SAAO,QAAQ,IAAI,EAAE,QAAQ,CAAC,CAAC,KAAKA,QAAO,MAAM;AAC/C,qBAAiB,GAAwB,IAAI;AAAA,MAC3CA;AAAA,IACF;AAAA,EACF,CAAC;AAGD,SAAO,EAAE,GAAG,SAAS,SAAS,EAAE,GAAG,QAAQ,SAAS,MAAM,iBAAiB,EAAE;AAC/E;AAeA,SAAS,qBACP,SAC8D;AAC9D,QAAM,EAAE,MAAM,aAAa,IAAI,QAAQ;AACvC,QAAM,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IAEtD,KAAK,yBAAAA,MAAS,MAAM;AAClB,aAAO,wBAAwB,iBAAiB;AAAA,IAElD,KAAK,yBAAAA,MAAS,MAAM;AAClB,aAAO,2BAA2B,iBAAiB;AAAA,IAErD,KAAK;AACH,iBAAO,kDAA6B,iBAAiB;AAAA,IAEvD,KAAK;AACH,iBAAO,2CAA0B,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
+ {"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 TextStyleDescriptor as TextStyleControl,\n TextStyleValue as TextStyleControlValue,\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} 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 = TextStyleControlValue> = {\n type: typeof Controls.Types.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?: TextStyleControlValue\n label?: string\n hidden?: boolean\n}\n\ntype DeserializedTextStyleControl<_T = TextStyleControlValue> = {\n type: typeof Controls.Types.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 Controls.Types.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 Controls.Types.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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iB;AAAA,IAEvD,KAAK;AACH,iBAAO,2CAA0B,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"]}
@@ -52,8 +52,8 @@ function registerComponent(runtime) {
52
52
  props: {
53
53
  id: import_prop_controllers2.Props.ElementID(),
54
54
  backgrounds: import_prop_controllers2.Props.Backgrounds(),
55
- width: import_prop_controllers2.Props.Width({
56
- format: import_prop_controllers2.Props.Width.Format.ClassName,
55
+ width: (0, import_prop_controllers.Width)({
56
+ format: import_prop_controllers.Width.Format.ClassName,
57
57
  defaultValue: { value: 100, unit: "%" }
58
58
  }),
59
59
  height: import_prop_controllers2.Props.ResponsiveIconRadioGroup({
@@ -78,9 +78,9 @@ function registerComponent(runtime) {
78
78
  ],
79
79
  defaultValue: "flex-start"
80
80
  }),
81
- margin: import_prop_controllers2.Props.Margin({ format: import_prop_controllers2.Props.Margin.Format.ClassName }),
82
- padding: import_prop_controllers2.Props.Padding({
83
- format: import_prop_controllers2.Props.Padding.Format.ClassName,
81
+ margin: (0, import_prop_controllers.Margin)({ format: import_prop_controllers.Margin.Format.ClassName }),
82
+ padding: (0, import_prop_controllers.Padding)({
83
+ format: import_prop_controllers.Padding.Format.ClassName,
84
84
  preset: [
85
85
  {
86
86
  deviceId: (0, import_breakpoints.getBaseBreakpoint)(runtime.getBreakpoints()).id,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/builtin/Box/register.ts"],"sourcesContent":["import { Border, BorderRadius, Checkbox, Shadows } from '@makeswift/prop-controllers'\nimport { Props, ResponsiveValue } from '../../../prop-controllers'\nimport { ReactRuntime } from '../../../runtimes/react'\nimport { findBreakpointOverride, getBaseBreakpoint } from '../../../state/modules/breakpoints'\nimport { MakeswiftComponentType } from '../constants'\nimport {\n BoxAnimateIn,\n DEFAULT_BOX_ANIMATE_DELAY,\n DEFAULT_BOX_ANIMATE_DURATION,\n DEFAULT_ITEM_ANIMATE_DELAY,\n DEFAULT_ITEM_STAGGER_DURATION,\n} from './constants'\nimport { lazy } from 'react'\n\nexport function registerComponent(runtime: ReactRuntime) {\n function isHiddenBasedOnAnimationType(\n props: Record<string, unknown>,\n deviceId: string,\n property: 'boxAnimateType' | 'itemAnimateType',\n ): boolean {\n const animateIn = props[property] as ResponsiveValue<BoxAnimateIn>\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: Props.Width({\n format: Props.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: Props.Margin({ format: Props.Margin.Format.ClassName }),\n padding: Props.Padding({\n format: Props.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(),\n },\n },\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAAwD;AACxD,IAAAA,2BAAuC;AAEvC,yBAA0D;AAC1D,uBAAuC;AACvC,IAAAC,oBAMO;AACP,IAAAC,gBAAqB;AAEd,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;AAAA,QACpB,aAAa,+BAAM,YAAY;AAAA,QAC/B,OAAO,+BAAM,MAAM;AAAA,UACjB,QAAQ,+BAAM,MAAM,OAAO;AAAA,UAC3B,cAAc,EAAE,OAAO,KAAK,MAAM,IAAI;AAAA,QACxC,CAAC;AAAA,QACD,QAAQ,+BAAM,yBAAyB;AAAA,UACrC,OAAO;AAAA,UACP,SAAS;AAAA,YACP,EAAE,OAAO,QAAQ,OAAO,QAAQ,MAAM,eAAe;AAAA,YACrD,EAAE,OAAO,WAAW,OAAO,WAAW,MAAM,gBAAgB;AAAA,UAC9D;AAAA,UACA,cAAc;AAAA,QAChB,CAAC;AAAA,QACD,eAAe,+BAAM,yBAAyB;AAAA,UAC5C,OAAO;AA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O,UAAU;AAAA,YACpC,EAAE,OAAO,WAAW,OAAO,WAAW;AAAA,YACtC,EAAE,OAAO,aAAa,OAAO,aAAa;AAAA,UAC5C;AAAA,UACA,cAAc;AAAA,QAChB,CAAC;AAAA,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 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(),\n },\n },\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAQO;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,Q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,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 +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 TextStyleValue,\n WidthValue,\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 { LinkPropControllerValue } 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?: TextStyleValue\n width?: WidthValue\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;AAuEI;AAAA;AAAA;AAAA;AAvEJ,mBAOO;AACP,mBAAwB;AASxB,2BAA8B;AAC9B,kBAAqB;AAGrB,uBAAyB;AACzB,8BAIO;AACP,iBAAmB;AAqBnB,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,U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sBACd,YAAY;AAAA;AAAA,8BAER,aAAAC,aAAY,oCAAcD,MAAK,CAAC,EAAE,QAAQ,GAAG,EAAE,IAAI,CAAC;AAAA,8BACpD,aAAAC,aAAY,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 TextStyleValue,\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 { LinkPropControllerValue, ResponsiveLengthData } 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?: TextStyleValue\n width?: ResponsiveLengthData\n margin?: string\n}\n\ntype Props<T extends ElementType> = BaseProps<T> &\n Omit<ComponentPropsWithoutRef<typeof Link>, keyof BaseProps<T>>\n\nconst Button = forwardRef(function Button<T extends ElementType = 'button'>(\n {\n as,\n id,\n children,\n link,\n variant,\n shape,\n size,\n textColor,\n color,\n textStyle,\n width,\n margin,\n className,\n ...restOfProps\n }: Props<T>,\n ref: ForwardedRef<ElementRef<T>>,\n) {\n const Component = as ?? Link\n\n return (\n // @ts-ignore: `ref` prop doesn't match between `Link` and `T`.\n <Component\n {...restOfProps}\n ref={ref}\n id={id}\n className={cx(\n useStyle({\n display: 'table',\n border: 0,\n outline: 0,\n userSelect: 'none',\n cursor: 'pointer',\n fontFamily: 'inherit',\n textDecoration: 'none',\n textAlign: 'center',\n }),\n useStyle(useResponsiveWidth(width, 'auto')),\n margin,\n useStyle(\n useResponsiveStyle(\n [variant, shape, size, textColor, color] as const,\n ([\n variant = 'flat',\n shape = 'rounded',\n size = 'medium',\n textColor = { swatch: { hue: 0, saturation: 0, lightness: 100 }, alpha: 1 },\n color = { swatch: { hue: 0, saturation: 0, lightness: 0 }, alpha: 1 },\n ]) => {\n const fontSize = {\n value: { small: 12, medium: 14, large: 18 }[size],\n unit: 'px',\n }\n\n return {\n color: colorToString(textColor),\n borderRadius: `${{ square: 0, rounded: 4, pill: 500 }[shape]}px`,\n padding: `${{ small: '8px 12px', medium: '12px 16px', large: '16px 20px' }[size]}`,\n fontSize: `${fontSize.value}${fontSize.unit}`,\n ...{\n flat: {\n background: colorToString(color),\n border: 'none',\n transition: ['color', 'background', 'border', 'box-shadow']\n .map(property => `${property} 0.15s ease-in-out`)\n .join(', '),\n\n ':hover': {\n background: ColorHelper(colorToString(color)).darken(0.1).hex(),\n },\n\n ':active': {\n background: ColorHelper(colorToString(color)).darken(0.15).hex(),\n },\n },\n outline: {\n background: 'transparent',\n boxShadow: `inset 0 0 0 2px ${colorToString(color)}`,\n transition: ['color', 'background', 'box-shadow']\n .map(property => `${property} 0.15s ease-in-out`)\n .join(', '),\n\n ':hover': {\n boxShadow: `inset 0 0 0 2px ${ColorHelper(colorToString(color))\n .darken(0.1)\n .hex()}`,\n color: ColorHelper(colorToString(color)).darken(0.1).hex(),\n },\n\n ':active': {\n boxShadow: `inset 0 0 0 2px ${ColorHelper(colorToString(color))\n .darken(0.15)\n .hex()}`,\n color: ColorHelper(colorToString(color)).darken(0.15).hex(),\n },\n },\n shadow: {\n background: colorToString(color),\n boxShadow: '0 2px 4px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.2)',\n transition: ['transform', 'box-shadow']\n .map(property => `${property} 0.18s`)\n .join(', '),\n\n ':hover': {\n boxShadow:\n '0 10px 25px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.3)',\n transform: 'translateY(-1px)',\n },\n\n ':active': {\n boxShadow:\n '0 4px 12px rgba(0, 0, 0, 0.15), 0 4px 6px -3px rgba(0, 0, 0, 0.3)',\n transform: 'translateY(0px)',\n },\n },\n clear: {\n background: 'transparent',\n border: 'none',\n\n ':hover': {\n color: ColorHelper(colorToString(textColor)).alpha(0.5).toString(),\n },\n\n ':active': {\n color: ColorHelper(colorToString(textColor)).alpha(0.6).toString(),\n },\n },\n blocky: {\n background: colorToString(color),\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: ColorHelper(colorToString(color)).darken(0.25).hex(),\n boxShadow: `0 4px ${ColorHelper(colorToString(color)).darken(0.25).hex()}`,\n transition: ['transform', 'box-shadow']\n .map(property => `${property} 0.1s`)\n .join(', '),\n\n ':hover': {\n transform: 'translateY(2px)',\n boxShadow: `0 2px ${ColorHelper(colorToString(color)).darken(0.25).hex()}`,\n },\n\n ':active': {\n transform: 'translateY(4px)',\n boxShadow: `0 0 ${ColorHelper(colorToString(color)).darken(0.25).hex()}`,\n },\n },\n bubbly: {\n background: `linear-gradient(\n 180deg,\n ${ColorHelper(colorToString(color)).lighten(0.05).hex()},\n ${ColorHelper(colorToString(color)).darken(0.3).saturate(0.05).hex()}\n )`,\n position: 'relative',\n zIndex: '0',\n\n ':before': {\n position: 'absolute',\n content: '\"\"',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n zIndex: '-1',\n borderRadius: 'inherit',\n background: `linear-gradient(\n 180deg,\n ${ColorHelper(colorToString(color)).lighten(0.2).hex()},\n ${ColorHelper(colorToString(color)).darken(0.2).saturate(0.05).hex()}\n )`,\n opacity: '0',\n transition: 'opacity 0.15s',\n },\n\n ':hover': {\n ':before': {\n opacity: '1',\n },\n },\n\n ':active': {\n ':before': {\n opacity: '0.25',\n },\n },\n } as const,\n skewed: {\n position: 'relative',\n zIndex: '0',\n\n ':before': {\n position: 'absolute',\n content: '\"\"',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n zIndex: '-1',\n background: colorToString(color),\n transform: 'skewX(-12deg)',\n borderRadius: 'inherit',\n transition: 'transform 0.2s cubic-bezier(0.25, 0, 0.25, 1.75)',\n },\n\n ':hover:before': {\n transform: 'skew(0deg)',\n },\n\n ':active:before': {\n transform: 'skew(-8deg)',\n },\n } as const,\n }[variant],\n }\n },\n ),\n ),\n useStyle(useResponsiveTextStyle(textStyle)),\n className,\n )}\n link={link}\n >\n {children == null ? 'Button Text' : children}\n </Component>\n )\n})\n\nexport default Button\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAsEI;AAAA;AAAA;AAAA;AAtEJ,mBAOO;AACP,mBAAwB;AAQxB,2BAA8B;AAC9B,kBAAqB;AAGrB,uBAAyB;AACzB,8BAIO;AACP,iBAAmB;AAqBnB,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,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,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"]}
@@ -96,8 +96,8 @@ function registerComponent(runtime) {
96
96
  placeholder: "white"
97
97
  }),
98
98
  textStyle: import_prop_controllers2.Props.TextStyle(),
99
- width: import_prop_controllers2.Props.Width(),
100
- margin: import_prop_controllers2.Props.Margin({ format: import_prop_controllers2.Props.Margin.Format.ClassName })
99
+ width: (0, import_prop_controllers.Width)(),
100
+ margin: (0, import_prop_controllers.Margin)({ format: import_prop_controllers.Margin.Format.ClassName })
101
101
  }
102
102
  }
103
103
  );
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/builtin/Button/register.ts"],"sourcesContent":["import { Link, ResponsiveColor } from '@makeswift/prop-controllers'\nimport { Props, ResponsiveValue } from '../../../prop-controllers'\nimport { ReactRuntime } from '../../../runtimes/react'\nimport { findBreakpointOverride } from '../../../state/modules/breakpoints'\nimport { MakeswiftComponentType } from '../constants'\nimport { ButtonVariant } from './contants'\nimport { lazy } from 'react'\n\nexport function registerComponent(runtime: ReactRuntime) {\n return runtime.registerComponent(\n lazy(() => import('./Button')),\n {\n type: MakeswiftComponentType.Button,\n label: 'Button',\n props: {\n id: Props.ElementID(),\n children: Props.TextInput({ placeholder: 'Button text' }),\n link: Link({\n defaultValue: {\n type: 'OPEN_PAGE',\n payload: {\n pageId: null,\n openInNewTab: false,\n },\n },\n }),\n variant: Props.ResponsiveSelect({\n label: 'Style',\n labelOrientation: 'horizontal',\n options: [\n { value: 'flat', label: 'Flat' },\n { value: 'outline', label: 'Outline' },\n { value: 'shadow', label: 'Floating' },\n { value: 'clear', label: 'Clear' },\n { value: 'blocky', label: 'Blocky' },\n { value: 'bubbly', label: 'Bubbly' },\n { value: 'skewed', label: 'Skewed' },\n ],\n defaultValue: 'flat',\n }),\n shape: Props.ResponsiveIconRadioGroup({\n label: 'Shape',\n options: [\n { label: 'Pill', value: 'pill', icon: 'ButtonPill16' },\n { label: 'Rounded', value: 'rounded', icon: 'ButtonRounded16' },\n { label: 'Square', value: 'square', icon: 'ButtonSquare16' },\n ],\n defaultValue: 'rounded',\n }),\n size: Props.ResponsiveIconRadioGroup({\n label: 'Size',\n options: [\n { label: 'Small', value: 'small', icon: 'SizeSmall16' },\n { label: 'Medium', value: 'medium', icon: 'SizeMedium16' },\n { label: 'Large', value: 'large', icon: 'SizeLarge16' },\n ],\n defaultValue: 'medium',\n }),\n color: ResponsiveColor((props, device) => {\n const variant = props.variant as ResponsiveValue<ButtonVariant>\n const hidden =\n findBreakpointOverride<ButtonVariant>(runtime.getBreakpoints(), variant, device)\n ?.value === 'clear'\n\n return { placeholder: 'black', hidden }\n }),\n textColor: ResponsiveColor({\n label: 'Text color',\n placeholder: 'white',\n }),\n textStyle: Props.TextStyle(),\n width: Props.Width(),\n margin: Props.Margin({ format: Props.Margin.Format.ClassName }),\n },\n },\n )\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AAiB;AAAA,UAC7D;AAAA,UACA,cAAc;AAAA,QAChB,CAAC;AAAA,QACD,MAAM,+BAAM,yBAAyB;AAAA,UACnC,OAAO;AAAA,UACP,SAAS;AAAA,YACP,EAAE,OAAO,SAAS,OAAO,SAAS,MAAM,cAAc;AAAA,YACtD,EAAE,OAAO,UAAU,OAAO,UAAU,MAAM,eAAe;AAAA,YACzD,EAAE,OAAO,SAAS,OAAO,SAAS,MAAM,cAAc;AAAA,UACxD;AAAA,UACA,cAAc;AAAA,QAChB,CAAC;AAAA,QACD,WAAO,yCAAgB,CAAC,OAAO,WAAW;AACxC,gBAAM,UAAU,MAAM;AACtB,gBAAM,aACJ,2CAAsC,QAAQ,eAAe,GAAG,SAAS,MAAM,GAC3E,UAAU;AAEhB,iBAAO,EAAE,aAAa,SAAS,OAAO;AAAA,QACxC,CAAC;AAAA,QACD,eAAW,yCAAgB;AAAA,UACzB,OAAO;AAAA,UACP,aAAa;AAAA,QACf,CAAC;AAAA,QACD,WAAW,+BAAM,UAAU;AAAA,QAC3B,OAAO,+BAAM,MAAM;AAAA,QACnB,QAAQ,+BAAM,OAAO,EAAE,QAAQ,+BAAM,OAAO,OAAO,UAAU,CAAC;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AACF;","names":["import_prop_controllers","import_react"]}
1
+ {"version":3,"sources":["../../../../../src/components/builtin/Button/register.ts"],"sourcesContent":["import { Link, Margin, ResponsiveColor, Width } from '@makeswift/prop-controllers'\nimport { Props, ResponsiveSelectValue } from '../../../prop-controllers'\nimport { ReactRuntime } from '../../../runtimes/react'\nimport { findBreakpointOverride } from '../../../state/modules/breakpoints'\nimport { MakeswiftComponentType } from '../constants'\nimport { ButtonVariant } from './contants'\nimport { lazy } from 'react'\n\nexport function registerComponent(runtime: ReactRuntime) {\n return runtime.registerComponent(\n lazy(() => import('./Button')),\n {\n type: MakeswiftComponentType.Button,\n label: 'Button',\n props: {\n id: Props.ElementID(),\n children: Props.TextInput({ placeholder: 'Button text' }),\n link: Link({\n defaultValue: {\n type: 'OPEN_PAGE',\n payload: {\n pageId: null,\n openInNewTab: false,\n },\n },\n }),\n variant: Props.ResponsiveSelect({\n label: 'Style',\n labelOrientation: 'horizontal',\n options: [\n { value: 'flat', label: 'Flat' },\n { value: 'outline', label: 'Outline' },\n { value: 'shadow', label: 'Floating' },\n { value: 'clear', label: 'Clear' },\n { value: 'blocky', label: 'Blocky' },\n { value: 'bubbly', label: 'Bubbly' },\n { value: 'skewed', label: 'Skewed' },\n ],\n defaultValue: 'flat',\n }),\n shape: Props.ResponsiveIconRadioGroup({\n label: 'Shape',\n options: [\n { label: 'Pill', value: 'pill', icon: 'ButtonPill16' },\n { label: 'Rounded', value: 'rounded', icon: 'ButtonRounded16' },\n { label: 'Square', value: 'square', icon: 'ButtonSquare16' },\n ],\n defaultValue: 'rounded',\n }),\n size: Props.ResponsiveIconRadioGroup({\n label: 'Size',\n options: [\n { label: 'Small', value: 'small', icon: 'SizeSmall16' },\n { label: 'Medium', value: 'medium', icon: 'SizeMedium16' },\n { label: 'Large', value: 'large', icon: 'SizeLarge16' },\n ],\n defaultValue: 'medium',\n }),\n color: ResponsiveColor((props, device) => {\n const variant = props.variant as ResponsiveSelectValue<ButtonVariant> | undefined\n const hidden =\n findBreakpointOverride<ButtonVariant>(runtime.getBreakpoints(), variant, device)\n ?.value === 'clear'\n\n return { placeholder: 'black', hidden }\n }),\n textColor: ResponsiveColor({\n label: 'Text color',\n placeholder: 'white',\n }),\n textStyle: Props.TextStyle(),\n width: Width(),\n margin: Margin({ format: Margin.Format.ClassName }),\n },\n },\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAAqD;AACrD,IAAAA,2BAA6C;AAE7C,yBAAuC;AACvC,uBAAuC;AAEvC,IAAAC,gBAAqB;AAEd,SAAS,kBAAkB,SAAuB;AACvD,SAAO,QAAQ;AAAA,QACb,oBAAK,MAAM,6CAAO,UAA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AAO,SAAS,OAAO,SAAS,MAAM,cAAc;AAAA,UACxD;AAAA,UACA,cAAc;AAAA,QAChB,CAAC;AAAA,QACD,WAAO,yCAAgB,CAAC,OAAO,WAAW;AACxC,gBAAM,UAAU,MAAM;AACtB,gBAAM,aACJ,2CAAsC,QAAQ,eAAe,GAAG,SAAS,MAAM,GAC3E,UAAU;AAEhB,iBAAO,EAAE,aAAa,SAAS,OAAO;AAAA,QACxC,CAAC;AAAA,QACD,eAAW,yCAAgB;AAAA,UACzB,OAAO;AAAA,UACP,aAAa;AAAA,QACf,CAAC;AAAA,QACD,WAAW,+BAAM,UAAU;AAAA,QAC3B,WAAO,+BAAM;AAAA,QACb,YAAQ,gCAAO,EAAE,QAAQ,+BAAO,OAAO,UAAU,CAAC;AAAA,MACpD;AAAA,IACF;AAAA,EACF;AACF;","names":["import_prop_controllers","import_react"]}
@@ -55,11 +55,11 @@ function registerComponent(runtime) {
55
55
  { key: (0, import_uuid.v4)(), props: {} }
56
56
  ]
57
57
  }),
58
- width: import_prop_controllers.Props.Width({
59
- format: import_prop_controllers.Props.Width.Format.ClassName,
58
+ width: (0, import_prop_controllers2.Width)({
59
+ format: import_prop_controllers2.Width.Format.ClassName,
60
60
  defaultValue: { value: 400, unit: "px" }
61
61
  }),
62
- margin: import_prop_controllers.Props.Margin({ format: import_prop_controllers.Props.Margin.Format.ClassName }),
62
+ margin: (0, import_prop_controllers2.Margin)({ format: import_prop_controllers2.Margin.Format.ClassName }),
63
63
  pageSize: import_prop_controllers.Props.ResponsiveNumber((props) => {
64
64
  const images = props.images;
65
65
  const imagesLength = images?.length ?? 0;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/builtin/Carousel/register.ts"],"sourcesContent":["import { v4 as uuid } from 'uuid'\n\nimport { Props, ResponsiveValue } from '../../../prop-controllers'\nimport { ReactRuntime } from '../../../runtimes/react'\nimport { findBreakpointOverride } from '../../../state/modules/breakpoints'\nimport { BorderRadius, Number, ResponsiveColor } from '@makeswift/prop-controllers'\n\nimport { MakeswiftComponentType } from '../constants'\nimport { ComponentIcon } from '../../../state/modules/components-meta'\nimport { lazy } from 'react'\nimport {\n Border,\n Checkbox,\n checkboxPropControllerDataSchema,\n getCheckboxPropControllerDataBoolean,\n} from '@makeswift/prop-controllers'\n\nexport function registerComponent(runtime: ReactRuntime) {\n return runtime.registerComponent(\n lazy(() => import('./Carousel')),\n {\n type: MakeswiftComponentType.Carousel,\n label: 'Carousel',\n icon: ComponentIcon.Carousel,\n props: {\n id: Props.ElementID(),\n images: Props.Images({\n preset: [\n { key: uuid(), props: {} },\n { key: uuid(), props: {} },\n { key: uuid(), props: {} },\n ],\n }),\n width: Props.Width({\n format: Props.Width.Format.ClassName,\n defaultValue: { value: 400, unit: 'px' },\n }),\n margin: Props.Margin({ format: Props.Margin.Format.ClassName }),\n pageSize: Props.ResponsiveNumber(props => {\n const images = props.images as unknown[]\n const imagesLength = images?.length ?? 0\n\n return {\n label: 'Images shown',\n defaultValue: 1,\n min: 1,\n max: imagesLength,\n step: 1,\n }\n }),\n step: Props.ResponsiveNumber((props, device) => {\n const pageSize = props.pageSize as ResponsiveValue<number>\n const pageSizeValue =\n findBreakpointOverride(runtime.getBreakpoints(), pageSize, device)?.value ?? 1\n\n return {\n label: 'Step',\n defaultValue: 1,\n min: 1,\n max: pageSizeValue,\n step: 1,\n }\n }),\n slideAlignment: Props.ResponsiveIconRadioGroup({\n label: 'Alignment',\n options: [\n { label: 'Top', value: 'flex-start', icon: 'VerticalAlignStart16' },\n { label: 'Middle', value: 'center', icon: 'VerticalAlignMiddle16' },\n { label: 'Bottom', value: 'flex-end', icon: 'VerticalAlignEnd16' },\n ],\n defaultValue: 'center',\n }),\n gap: Props.GapX({\n label: 'Gap',\n step: 5,\n defaultValue: { value: 0, unit: 'px' },\n }),\n autoplay: Checkbox({ label: 'Autoplay' }),\n delay: Number(props => ({\n label: 'Delay',\n preset: 5,\n min: 1,\n step: 0.1,\n suffix: 'seconds',\n hidden: !getCheckboxPropControllerDataBoolean(\n checkboxPropControllerDataSchema.optional().catch(undefined).parse(props.autoplay),\n ),\n })),\n showArrows: Checkbox({ preset: true, label: 'Show arrows' }),\n arrowPosition: Props.ResponsiveIconRadioGroup(props => ({\n label: 'Arrow position',\n options: [\n { label: 'Inside', value: 'inside', icon: 'ArrowInside16' },\n { label: 'Center', value: 'center', icon: 'ArrowCenter16' },\n { label: 'Outside', value: 'outside', icon: 'ArrowOutside16' },\n ],\n defaultValue: 'inside',\n hidden:\n getCheckboxPropControllerDataBoolean(\n checkboxPropControllerDataSchema.optional().catch(undefined).parse(props.showArrows),\n ) === false,\n })),\n arrowColor: ResponsiveColor(props => ({\n label: 'Arrow color',\n placeholder: 'black',\n hidden:\n getCheckboxPropControllerDataBoolean(\n checkboxPropControllerDataSchema.optional().catch(undefined).parse(props.showArrows),\n ) === false,\n })),\n arrowBackground: ResponsiveColor(props => ({\n label: 'Arrow background',\n placeholder: 'white',\n hidden:\n getCheckboxPropControllerDataBoolean(\n checkboxPropControllerDataSchema.optional().catch(undefined).parse(props.showArrows),\n ) === false,\n })),\n showDots: Checkbox({ preset: true, label: 'Show dots' }),\n dotColor: ResponsiveColor(props => ({\n label: 'Dot color',\n placeholder: 'black',\n hidden:\n getCheckboxPropControllerDataBoolean(\n checkboxPropControllerDataSchema.optional().catch(undefined).parse(props.showDots),\n ) === false,\n })),\n slideBorder: Border({ format: Border.Format.ClassName }),\n slideBorderRadius: BorderRadius({ format: BorderRadius.Format.ClassName }),\n },\n },\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA2B;AAE3B,8BAAuC;AAEvC,yBAAuC;AACvC,IAAAA,2BAAsD;AAEtD,uBAAuC;AACvC,6BAA8B;AAC9B,IAAAC,gBAAqB;AACrB,IAAAD,2BAKO;AAEA,SAAS,kBAAkB,SAAuB;AACvD,SAAO,QAAQ;AAAA,QACb,oBAAK,MAAM,6CA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AAE;AAAA,QACF,qBAAiB,0CAAgB,YAAU;AAAA,UACzC,OAAO;AAAA,UACP,aAAa;AAAA,UACb,YACE;AAAA,YACE,0DAAiC,SAAS,EAAE,MAAM,MAAS,EAAE,MAAM,MAAM,UAAU;AAAA,UACrF,MAAM;AAAA,QACV,EAAE;AAAA,QACF,cAAU,mCAAS,EAAE,QAAQ,MAAM,OAAO,YAAY,CAAC;AAAA,QACvD,cAAU,0CAAgB,YAAU;AAAA,UAClC,OAAO;AAAA,UACP,aAAa;AAAA,UACb,YACE;AAAA,YACE,0DAAiC,SAAS,EAAE,MAAM,MAAS,EAAE,MAAM,MAAM,QAAQ;AAAA,UACnF,MAAM;AAAA,QACV,EAAE;AAAA,QACF,iBAAa,iCAAO,EAAE,QAAQ,gCAAO,OAAO,UAAU,CAAC;AAAA,QACvD,uBAAmB,uCAAa,EAAE,QAAQ,sCAAa,OAAO,UAAU,CAAC;AAAA,MAC3E;AAAA,IACF;AAAA,EACF;AACF;","names":["import_prop_controllers","import_react","uuid"]}
1
+ {"version":3,"sources":["../../../../../src/components/builtin/Carousel/register.ts"],"sourcesContent":["import { v4 as uuid } from 'uuid'\n\nimport { ImagesValue, Props, ResponsiveNumberValue } from '../../../prop-controllers'\nimport { ReactRuntime } from '../../../runtimes/react'\nimport { findBreakpointOverride } from '../../../state/modules/breakpoints'\nimport { BorderRadius, Margin, Number, ResponsiveColor, Width } from '@makeswift/prop-controllers'\n\nimport { MakeswiftComponentType } from '../constants'\nimport { ComponentIcon } from '../../../state/modules/components-meta'\nimport { lazy } from 'react'\nimport {\n Border,\n Checkbox,\n checkboxPropControllerDataSchema,\n getCheckboxPropControllerDataBoolean,\n} from '@makeswift/prop-controllers'\n\nexport function registerComponent(runtime: ReactRuntime) {\n return runtime.registerComponent(\n lazy(() => import('./Carousel')),\n {\n type: MakeswiftComponentType.Carousel,\n label: 'Carousel',\n icon: ComponentIcon.Carousel,\n props: {\n id: Props.ElementID(),\n images: Props.Images({\n preset: [\n { key: uuid(), props: {} },\n { key: uuid(), props: {} },\n { key: uuid(), props: {} },\n ],\n }),\n width: Width({\n format: Width.Format.ClassName,\n defaultValue: { value: 400, unit: 'px' },\n }),\n margin: Margin({ format: Margin.Format.ClassName }),\n pageSize: Props.ResponsiveNumber(props => {\n const images = props.images as ImagesValue | undefined\n const imagesLength = images?.length ?? 0\n\n return {\n label: 'Images shown',\n defaultValue: 1,\n min: 1,\n max: imagesLength,\n step: 1,\n }\n }),\n step: Props.ResponsiveNumber((props, device) => {\n const pageSize = props.pageSize as ResponsiveNumberValue | undefined\n const pageSizeValue =\n findBreakpointOverride(runtime.getBreakpoints(), pageSize, device)?.value ?? 1\n\n return {\n label: 'Step',\n defaultValue: 1,\n min: 1,\n max: pageSizeValue,\n step: 1,\n }\n }),\n slideAlignment: Props.ResponsiveIconRadioGroup({\n label: 'Alignment',\n options: [\n { label: 'Top', value: 'flex-start', icon: 'VerticalAlignStart16' },\n { label: 'Middle', value: 'center', icon: 'VerticalAlignMiddle16' },\n { label: 'Bottom', value: 'flex-end', icon: 'VerticalAlignEnd16' },\n ],\n defaultValue: 'center',\n }),\n gap: Props.GapX({\n label: 'Gap',\n step: 5,\n defaultValue: { value: 0, unit: 'px' },\n }),\n autoplay: Checkbox({ label: 'Autoplay' }),\n delay: Number(props => ({\n label: 'Delay',\n preset: 5,\n min: 1,\n step: 0.1,\n suffix: 'seconds',\n hidden: !getCheckboxPropControllerDataBoolean(\n checkboxPropControllerDataSchema.optional().catch(undefined).parse(props.autoplay),\n ),\n })),\n showArrows: Checkbox({ preset: true, label: 'Show arrows' }),\n arrowPosition: Props.ResponsiveIconRadioGroup(props => ({\n label: 'Arrow position',\n options: [\n { label: 'Inside', value: 'inside', icon: 'ArrowInside16' },\n { label: 'Center', value: 'center', icon: 'ArrowCenter16' },\n { label: 'Outside', value: 'outside', icon: 'ArrowOutside16' },\n ],\n defaultValue: 'inside',\n hidden:\n getCheckboxPropControllerDataBoolean(\n checkboxPropControllerDataSchema.optional().catch(undefined).parse(props.showArrows),\n ) === false,\n })),\n arrowColor: ResponsiveColor(props => ({\n label: 'Arrow color',\n placeholder: 'black',\n hidden:\n getCheckboxPropControllerDataBoolean(\n checkboxPropControllerDataSchema.optional().catch(undefined).parse(props.showArrows),\n ) === false,\n })),\n arrowBackground: ResponsiveColor(props => ({\n label: 'Arrow background',\n placeholder: 'white',\n hidden:\n getCheckboxPropControllerDataBoolean(\n checkboxPropControllerDataSchema.optional().catch(undefined).parse(props.showArrows),\n ) === false,\n })),\n showDots: Checkbox({ preset: true, label: 'Show dots' }),\n dotColor: ResponsiveColor(props => ({\n label: 'Dot color',\n placeholder: 'black',\n hidden:\n getCheckboxPropControllerDataBoolean(\n checkboxPropControllerDataSchema.optional().catch(undefined).parse(props.showDots),\n ) === false,\n })),\n slideBorder: Border({ format: Border.Format.ClassName }),\n slideBorderRadius: BorderRadius({ format: BorderRadius.Format.ClassName }),\n },\n },\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA2B;AAE3B,8BAA0D;AAE1D,yBAAuC;AACvC,IAAAA,2BAAqE;AAErE,uBAAuC;AACvC,6BAA8B;AAC9B,IAAAC,gBAAqB;AACrB,IAAAD,2BAKO;AAEA,SAAS,kBAAkB,SAAuB;AACvD,SAAO,QAAQ;AAAA,QACb,oBAAK,MAAM,6CAAO,YAAY,GAAC;AAAA,IAC/B;AAAA,MACE,MAAM,wCAAuB;AAAA,MAC7B,OAAO;AAAA,MACP,MAAM,qCAAc;AAAA,MACpB,OAAO;AAAA,QACL,IAAI,8BAAM,UAAU;AAAA,QACpB,QAAQ,8BAAM,OAAO;AAAA,UACnB,QAAQ;AAAA,YACN,EAAE,SAAK,YAAAE,IAAK,GAAG,OAAO,CAAC,EAAE;AAAA,YACzB,EAAE,SAAK,YAAAA,IAAK,GAAG,OAAO,CAAC,EAAE;AAAA,YACzB,EAAE,SAAK,YAAAA,IAAK,GAAG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