@makeswift/runtime 0.17.1 → 0.17.2-canary.1

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 (186) hide show
  1. package/README.md +13 -0
  2. package/dist/cjs/controls/control.js +10 -13
  3. package/dist/cjs/controls/control.js.map +1 -1
  4. package/dist/cjs/controls/image.js +0 -15
  5. package/dist/cjs/controls/image.js.map +1 -1
  6. package/dist/cjs/controls/index.js +3 -19
  7. package/dist/cjs/controls/index.js.map +1 -1
  8. package/dist/cjs/controls/list.js.map +1 -1
  9. package/dist/cjs/controls/rich-text/dto.js.map +1 -1
  10. package/dist/cjs/controls/rich-text-v2/introspection.js.map +1 -1
  11. package/dist/cjs/controls/shape.js.map +1 -1
  12. package/dist/cjs/controls/slot.js.map +1 -1
  13. package/dist/cjs/controls/style-v2.js.map +1 -1
  14. package/dist/cjs/controls/style.js +2 -2
  15. package/dist/cjs/controls/style.js.map +1 -1
  16. package/dist/cjs/next/api-handler/handlers/manifest.js +1 -1
  17. package/dist/cjs/prop-controllers/descriptors.js.map +1 -1
  18. package/dist/cjs/runtimes/react/controls/checkbox.js +1 -1
  19. package/dist/cjs/runtimes/react/controls/checkbox.js.map +1 -1
  20. package/dist/cjs/runtimes/react/controls/color.js.map +1 -1
  21. package/dist/cjs/runtimes/react/controls/control.js +18 -18
  22. package/dist/cjs/runtimes/react/controls/control.js.map +1 -1
  23. package/dist/cjs/runtimes/react/controls/icon-radio-group.js.map +1 -1
  24. package/dist/cjs/runtimes/react/controls/number.js +1 -1
  25. package/dist/cjs/runtimes/react/controls/number.js.map +1 -1
  26. package/dist/cjs/runtimes/react/controls/style-v2.js.map +1 -1
  27. package/dist/cjs/runtimes/react/controls/text-area.js +1 -1
  28. package/dist/cjs/runtimes/react/controls/text-area.js.map +1 -1
  29. package/dist/cjs/runtimes/react/controls/text-input.js +1 -1
  30. package/dist/cjs/runtimes/react/controls/text-input.js.map +1 -1
  31. package/dist/cjs/runtimes/react/controls.js +16 -16
  32. package/dist/cjs/runtimes/react/controls.js.map +1 -1
  33. package/dist/cjs/slate/InlinePlugin/types.js +4 -4
  34. package/dist/cjs/slate/InlinePlugin/types.js.map +1 -1
  35. package/dist/cjs/slate/LinkPlugin/index.js +2 -2
  36. package/dist/cjs/slate/LinkPlugin/index.js.map +1 -1
  37. package/dist/cjs/slate/LinkPlugin/linkPluginWithoutRenderElement.js +2 -2
  38. package/dist/cjs/slate/LinkPlugin/linkPluginWithoutRenderElement.js.map +1 -1
  39. package/dist/cjs/state/modules/breakpoints.js.map +1 -1
  40. package/dist/esm/controls/control.js +10 -7
  41. package/dist/esm/controls/control.js.map +1 -1
  42. package/dist/esm/controls/image.js +0 -12
  43. package/dist/esm/controls/image.js.map +1 -1
  44. package/dist/esm/controls/index.js +1 -9
  45. package/dist/esm/controls/index.js.map +1 -1
  46. package/dist/esm/controls/list.js.map +1 -1
  47. package/dist/esm/controls/rich-text/dto.js.map +1 -1
  48. package/dist/esm/controls/rich-text-v2/introspection.js.map +1 -1
  49. package/dist/esm/controls/shape.js.map +1 -1
  50. package/dist/esm/controls/slot.js.map +1 -1
  51. package/dist/esm/controls/style-v2.js.map +1 -1
  52. package/dist/esm/controls/style.js +1 -1
  53. package/dist/esm/controls/style.js.map +1 -1
  54. package/dist/esm/next/api-handler/handlers/manifest.js +1 -1
  55. package/dist/esm/prop-controllers/descriptors.js.map +1 -1
  56. package/dist/esm/runtimes/react/controls/checkbox.js +1 -1
  57. package/dist/esm/runtimes/react/controls/checkbox.js.map +1 -1
  58. package/dist/esm/runtimes/react/controls/color.js.map +1 -1
  59. package/dist/esm/runtimes/react/controls/control.js +6 -6
  60. package/dist/esm/runtimes/react/controls/control.js.map +1 -1
  61. package/dist/esm/runtimes/react/controls/icon-radio-group.js.map +1 -1
  62. package/dist/esm/runtimes/react/controls/number.js +1 -1
  63. package/dist/esm/runtimes/react/controls/number.js.map +1 -1
  64. package/dist/esm/runtimes/react/controls/style-v2.js.map +1 -1
  65. package/dist/esm/runtimes/react/controls/text-area.js +1 -1
  66. package/dist/esm/runtimes/react/controls/text-area.js.map +1 -1
  67. package/dist/esm/runtimes/react/controls/text-input.js +1 -1
  68. package/dist/esm/runtimes/react/controls/text-input.js.map +1 -1
  69. package/dist/esm/runtimes/react/controls.js +1 -5
  70. package/dist/esm/runtimes/react/controls.js.map +1 -1
  71. package/dist/esm/slate/InlinePlugin/types.js +1 -1
  72. package/dist/esm/slate/InlinePlugin/types.js.map +1 -1
  73. package/dist/esm/slate/LinkPlugin/index.js +1 -1
  74. package/dist/esm/slate/LinkPlugin/index.js.map +1 -1
  75. package/dist/esm/slate/LinkPlugin/linkPluginWithoutRenderElement.js +1 -1
  76. package/dist/esm/slate/LinkPlugin/linkPluginWithoutRenderElement.js.map +1 -1
  77. package/dist/esm/state/modules/breakpoints.js.map +1 -1
  78. package/dist/types/components/builtin/Button/Button.d.ts +2 -2
  79. package/dist/types/controls/__tests__/fixtures/shape.d.ts +3 -3
  80. package/dist/types/controls/__tests__/fixtures/shape.d.ts.map +1 -1
  81. package/dist/types/controls/control.d.ts +1 -9
  82. package/dist/types/controls/control.d.ts.map +1 -1
  83. package/dist/types/controls/image.d.ts +1 -38
  84. package/dist/types/controls/image.d.ts.map +1 -1
  85. package/dist/types/controls/index.d.ts +1 -9
  86. package/dist/types/controls/index.d.ts.map +1 -1
  87. package/dist/types/controls/list.d.ts +2 -11
  88. package/dist/types/controls/list.d.ts.map +1 -1
  89. package/dist/types/controls/shape.d.ts.map +1 -1
  90. package/dist/types/controls/slot.d.ts +1 -1
  91. package/dist/types/controls/slot.d.ts.map +1 -1
  92. package/dist/types/controls/style-v2.d.ts +1 -1
  93. package/dist/types/controls/style-v2.d.ts.map +1 -1
  94. package/dist/types/controls/style.d.ts +1 -1
  95. package/dist/types/controls/style.d.ts.map +1 -1
  96. package/dist/types/prop-controllers/descriptors.d.ts +2 -3
  97. package/dist/types/prop-controllers/descriptors.d.ts.map +1 -1
  98. package/dist/types/runtimes/react/controls/checkbox.d.ts +1 -1
  99. package/dist/types/runtimes/react/controls/checkbox.d.ts.map +1 -1
  100. package/dist/types/runtimes/react/controls/color.d.ts +1 -1
  101. package/dist/types/runtimes/react/controls/color.d.ts.map +1 -1
  102. package/dist/types/runtimes/react/controls/control.d.ts +2 -2
  103. package/dist/types/runtimes/react/controls/control.d.ts.map +1 -1
  104. package/dist/types/runtimes/react/controls/icon-radio-group.d.ts +1 -1
  105. package/dist/types/runtimes/react/controls/icon-radio-group.d.ts.map +1 -1
  106. package/dist/types/runtimes/react/controls/number.d.ts +1 -1
  107. package/dist/types/runtimes/react/controls/number.d.ts.map +1 -1
  108. package/dist/types/runtimes/react/controls/style-v2.d.ts.map +1 -1
  109. package/dist/types/runtimes/react/controls/text-area.d.ts +1 -1
  110. package/dist/types/runtimes/react/controls/text-area.d.ts.map +1 -1
  111. package/dist/types/runtimes/react/controls/text-input.d.ts +1 -1
  112. package/dist/types/runtimes/react/controls/text-input.d.ts.map +1 -1
  113. package/dist/types/runtimes/react/controls.d.ts.map +1 -1
  114. package/dist/types/slate/InlinePlugin/index.d.ts +2 -2
  115. package/dist/types/slate/InlinePlugin/types.d.ts +1 -1
  116. package/dist/types/slate/InlinePlugin/types.d.ts.map +1 -1
  117. package/dist/types/slate/LinkPlugin/getValue.d.ts +1 -1
  118. package/dist/types/slate/LinkPlugin/getValue.d.ts.map +1 -1
  119. package/dist/types/slate/LinkPlugin/index.d.ts +1 -1
  120. package/dist/types/slate/LinkPlugin/index.d.ts.map +1 -1
  121. package/dist/types/slate/LinkPlugin/linkPluginWithoutRenderElement.d.ts +1 -1
  122. package/dist/types/state/modules/breakpoints.d.ts +1 -1
  123. package/dist/types/state/modules/breakpoints.d.ts.map +1 -1
  124. package/dist/types/state/react-page.test.d.ts +0 -2
  125. package/dist/types/state/react-page.test.d.ts.map +1 -1
  126. package/package.json +2 -1
  127. package/dist/cjs/controls/checkbox.js +0 -41
  128. package/dist/cjs/controls/checkbox.js.map +0 -1
  129. package/dist/cjs/controls/color.js +0 -55
  130. package/dist/cjs/controls/color.js.map +0 -1
  131. package/dist/cjs/controls/combobox.js +0 -34
  132. package/dist/cjs/controls/combobox.js.map +0 -1
  133. package/dist/cjs/controls/control-data-type-key.js +0 -29
  134. package/dist/cjs/controls/control-data-type-key.js.map +0 -1
  135. package/dist/cjs/controls/icon-radio-group.js +0 -45
  136. package/dist/cjs/controls/icon-radio-group.js.map +0 -1
  137. package/dist/cjs/controls/link.js +0 -53
  138. package/dist/cjs/controls/link.js.map +0 -1
  139. package/dist/cjs/controls/number.js +0 -41
  140. package/dist/cjs/controls/number.js.map +0 -1
  141. package/dist/cjs/controls/text-area.js +0 -41
  142. package/dist/cjs/controls/text-area.js.map +0 -1
  143. package/dist/cjs/controls/text-input.js +0 -41
  144. package/dist/cjs/controls/text-input.js.map +0 -1
  145. package/dist/cjs/controls/types.js +0 -17
  146. package/dist/cjs/controls/types.js.map +0 -1
  147. package/dist/esm/controls/checkbox.js +0 -14
  148. package/dist/esm/controls/checkbox.js.map +0 -1
  149. package/dist/esm/controls/color.js +0 -27
  150. package/dist/esm/controls/color.js.map +0 -1
  151. package/dist/esm/controls/combobox.js +0 -9
  152. package/dist/esm/controls/combobox.js.map +0 -1
  153. package/dist/esm/controls/control-data-type-key.js +0 -5
  154. package/dist/esm/controls/control-data-type-key.js.map +0 -1
  155. package/dist/esm/controls/icon-radio-group.js +0 -19
  156. package/dist/esm/controls/icon-radio-group.js.map +0 -1
  157. package/dist/esm/controls/link.js +0 -27
  158. package/dist/esm/controls/link.js.map +0 -1
  159. package/dist/esm/controls/number.js +0 -14
  160. package/dist/esm/controls/number.js.map +0 -1
  161. package/dist/esm/controls/text-area.js +0 -14
  162. package/dist/esm/controls/text-area.js.map +0 -1
  163. package/dist/esm/controls/text-input.js +0 -14
  164. package/dist/esm/controls/text-input.js.map +0 -1
  165. package/dist/esm/controls/types.js +0 -1
  166. package/dist/esm/controls/types.js.map +0 -1
  167. package/dist/types/controls/checkbox.d.ts +0 -21
  168. package/dist/types/controls/checkbox.d.ts.map +0 -1
  169. package/dist/types/controls/color.d.ts +0 -25
  170. package/dist/types/controls/color.d.ts.map +0 -1
  171. package/dist/types/controls/combobox.d.ts +0 -22
  172. package/dist/types/controls/combobox.d.ts.map +0 -1
  173. package/dist/types/controls/control-data-type-key.d.ts +0 -2
  174. package/dist/types/controls/control-data-type-key.d.ts.map +0 -1
  175. package/dist/types/controls/icon-radio-group.d.ts +0 -32
  176. package/dist/types/controls/icon-radio-group.d.ts.map +0 -1
  177. package/dist/types/controls/link.d.ts +0 -52
  178. package/dist/types/controls/link.d.ts.map +0 -1
  179. package/dist/types/controls/number.d.ts +0 -26
  180. package/dist/types/controls/number.d.ts.map +0 -1
  181. package/dist/types/controls/text-area.d.ts +0 -22
  182. package/dist/types/controls/text-area.d.ts.map +0 -1
  183. package/dist/types/controls/text-input.d.ts +0 -22
  184. package/dist/types/controls/text-input.d.ts.map +0 -1
  185. package/dist/types/controls/types.d.ts +0 -14
  186. package/dist/types/controls/types.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/prop-controllers/descriptors.ts"],"sourcesContent":["import { ResponsiveColor } from '../runtimes/react/controls'\nimport { StyleControlFormattedValue } from '../runtimes/react/controls/style'\nimport type { Data } from '../state/react-page'\nimport { NumberControlDefinition } from '../controls/number'\nimport { NumberControlValue } from '../runtimes/react/controls/number'\nimport { StyleControlType } from '../controls/style'\nimport {\n CheckboxControlDefinition,\n ColorControlDefinition,\n ComboboxControlDefinition,\n ImageControlDefinition,\n LinkControlDefinition,\n ListControlDefinition,\n SelectControlDefinition,\n ShapeControlDefinition,\n SlotControlDefinition,\n TextAreaControlDefinition,\n TextInputControlDefinition,\n StyleControlDefinition,\n RichTextV2ControlDefinition,\n StyleV2ControlDefinition,\n TypographyControlDefinition,\n} from '../controls'\nimport { TextInputControlValue } from '../runtimes/react/controls/text-input'\nimport { TextAreaControlValue } from '../runtimes/react/controls/text-area'\nimport { ColorControlValue } from '../runtimes/react/controls/color'\nimport { SelectControlValue } from '../runtimes/react/controls/select'\nimport { CheckboxControlValue } from '../runtimes/react/controls/checkbox'\nimport { ResolveImageControlValue } from '../runtimes/react/controls/image'\nimport { ShapeControlValue } from '../runtimes/react/controls/shape'\nimport { ListControlValue } from '../runtimes/react/controls/list'\nimport { ComboboxControlValue } from '../runtimes/react/controls/combobox'\nimport { LinkControlValue } from '../runtimes/react/controls/link'\nimport { SlotControlValue } from '../runtimes/react/controls/slot'\nimport { RichTextControlDefinition } from '../controls/rich-text'\nimport { RichTextControlValue } from '../runtimes/react/controls/rich-text/rich-text'\nimport { RichTextV2ControlValue } from '../runtimes/react/controls/rich-text-v2'\nimport { StyleV2ControlFormattedValue } from '../runtimes/react/controls/style-v2'\nimport { IconRadioGroupControlDefinition } from '../controls/icon-radio-group'\nimport { IconRadioGroupControlValue } from '../runtimes/react/controls/icon-radio-group'\nimport { TypographyControlValue } from '../runtimes/react/controls/typography'\nimport {\n BorderDescriptor,\n CheckboxDescriptor,\n LinkDescriptor,\n ResolveLinkPropControllerValue,\n Types as PropControllerTypes,\n ResponsiveValueType,\n ShadowsDescriptor,\n ResolveShadowsPropControllerValue,\n ResponsiveValue,\n Options,\n ResponsiveLengthDescriptor,\n ResolveResponsiveLengthPropControllerValue,\n NumberDescriptor,\n ResolveNumberPropControllerValue,\n ResponsiveColorDescriptor,\n ResolveCheckboxPropControllerValue,\n BorderRadiusDescriptor,\n ResolveBorderPropControllerValue,\n ResolveBorderRadiusPropControllerValue,\n DateDescriptor,\n ResolveDatePropControllerValue,\n FontDescriptor,\n ResolveFontPropControllerValue,\n VideoDescriptor,\n ResolveVideoPropControllerValue,\n TableDescriptor,\n ResolveTablePropControllerValue,\n MarginDescriptor,\n ResolveMarginPropControllerValue,\n PaddingDescriptor,\n ResolvePaddingPropControllerValue,\n WidthDescriptor,\n ResolveWidthPropControllerValue,\n TextStyleDescriptor,\n ResolveTextStylePropControllerValue,\n NavigationLinksDescriptor,\n ResolveNavigationLinksPropControllerValue,\n TextAreaDescriptor,\n ResolveTextAreaPropControllerValue,\n ResolveGapXPropControllerValue,\n GapXDescriptor,\n ResolveGapYPropControllerValue,\n GapYDescriptor,\n ElementIDDescriptor,\n ResolveElementIDPropControllerValue,\n TableFormFieldsDescriptor,\n ResolveTableFormFieldsPropControllerValue,\n GridDescriptor,\n ResolveGridPropControllerValue,\n ImageDescriptor,\n ResolveImagePropControllerValue,\n ImagesDescriptor,\n ResolveImagesPropControllerValue,\n BackgroundsDescriptor,\n ResolveBackgroundsPropControllerValue,\n} from '@makeswift/prop-controllers'\nimport { DeletedPropControllerDescriptor } from './deleted'\n\nexport type { Data }\n\ntype IconName =\n | 'HeightAuto16'\n | 'HeightMatch16'\n | 'VerticalAlignStart16'\n | 'VerticalAlignMiddle16'\n | 'VerticalAlignEnd16'\n | 'VerticalAlignSpaceBetween16'\n | 'ButtonPill16'\n | 'ButtonRounded16'\n | 'ButtonSquare16'\n | 'SizeSmall16'\n | 'SizeMedium16'\n | 'SizeLarge16'\n | 'ArrowInside16'\n | 'ArrowCenter16'\n | 'ArrowOutside16'\n | 'CountdownSolid16'\n | 'CountdownSolidSplit16'\n | 'CountdownOutline16'\n | 'CountdownOutlineSplit16'\n | 'CountdownNaked16'\n | 'Sun16'\n | 'Moon16'\n | 'AlignLeft16'\n | 'AlignCenter16'\n | 'AlignRight16'\n | 'Star16'\n | 'StarCircle16'\n | 'StarRoundedSquare16'\n | 'StarSquare16'\n\nexport type Gap = { value: number; unit: 'px' }\n\nexport const Types = {\n ResponsiveIconRadioGroup: 'ResponsiveIconRadioGroup',\n ResponsiveNumber: 'ResponsiveNumber',\n ResponsiveOpacity: 'ResponsiveOpacity',\n ResponsiveSelect: 'ResponsiveSelect',\n SocialLinks: 'SocialLinks',\n TextInput: 'TextInput',\n Style: StyleControlType,\n} as const\n\nexport type IconRadioGroupOption<T extends string> = { value: T; label: string; icon: IconName }\n\nexport type ResponsiveIconRadioGroupValue<T extends string = string> = ResponsiveValue<T>\n\nexport type ResponsiveIconRadioGroupOptions<T extends string = string, U extends T = T> = Options<{\n label?: string\n options: IconRadioGroupOption<T>[]\n defaultValue?: U\n hidden?: boolean\n}>\n\nexport type ResponsiveIconRadioGroupDescriptor<\n T extends ResponsiveIconRadioGroupValue<string> = ResponsiveIconRadioGroupValue<string>,\n> = {\n type: typeof Types.ResponsiveIconRadioGroup\n options: ResponsiveIconRadioGroupOptions<ResponsiveValueType<T>>\n}\n\n// HACK(miguel): We have to use a layer of indirection with `_T` and `T` because otherwise the\n// values provided would undergo type widening. For some reason, the extra layer of indirection\n// reuslts in TypeScript not widening types. Note, this only happens when the returned value of this\n// function is passed to another as an argument, which is common with the `registerComponent` API.\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function ResponsiveIconRadioGroup<_T extends string, T extends _T, U extends T>(\n options: ResponsiveIconRadioGroupOptions<T, U>,\n): ResponsiveIconRadioGroupDescriptor<ResponsiveIconRadioGroupValue<T>> {\n return { type: Types.ResponsiveIconRadioGroup, options }\n}\n\nexport type ResponsiveNumberValue = ResponsiveValue<number>\n\nexport type ResponsiveNumberOptions = Options<{\n label?: string\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n suffix?: string\n hidden?: boolean\n}>\n\nexport type ResponsiveNumberDescriptor<_T = ResponsiveNumberValue> = {\n type: typeof Types.ResponsiveNumber\n options: ResponsiveNumberOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function ResponsiveNumber(\n options: ResponsiveNumberOptions = {},\n): ResponsiveNumberDescriptor {\n return { type: Types.ResponsiveNumber, options }\n}\n\nexport type ResponsiveOpacityValue = ResponsiveValue<number>\n\ntype ResponsiveOpacityOptions = Options<Record<string, never>>\n\ntype ResponsiveOpacityDescriptor<_T = ResponsiveOpacityValue> = {\n type: typeof Types.ResponsiveOpacity\n options: ResponsiveOpacityOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function ResponsiveOpacity(\n options: ResponsiveOpacityOptions = {},\n): ResponsiveOpacityDescriptor {\n return { type: Types.ResponsiveOpacity, options }\n}\n\nexport type ResponsiveSelectValue<T extends string = string> = ResponsiveValue<T>\n\nexport type SelectLabelOrientation = 'vertical' | 'horizontal'\n\nexport type SelectOption<T extends string> = { value: T; label: string }\n\nexport type ResponsiveSelectOptions<T extends string = string, U extends T = T> = Options<{\n label?: string\n labelOrientation?: SelectLabelOrientation\n options: SelectOption<T>[]\n defaultValue?: U\n hidden?: boolean\n}>\n\nexport type ResponsiveSelectDescriptor<\n T extends ResponsiveSelectValue<string> = ResponsiveSelectValue<string>,\n> = {\n type: typeof Types.ResponsiveSelect\n options: ResponsiveSelectOptions<ResponsiveValueType<T>>\n}\n\n// HACK(miguel): We have to use a layer of indirection with `_T` and `T` because otherwise the\n// values provided would undergo type widening. For some reason, the extra layer of indirection\n// reuslts in TypeScript not widening types. Note, this only happens when the returned value of this\n// function is passed to another as an argument, which is common with the `registerComponent` API.\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function ResponsiveSelect<_T extends string, T extends _T, U extends T>(\n options: ResponsiveSelectOptions<T, U>,\n): ResponsiveSelectDescriptor<ResponsiveSelectValue<T>> {\n return { type: Types.ResponsiveSelect, options }\n}\n\nexport const socialLinkTypesV0 = [\n 'angellist',\n 'codepen',\n 'discord',\n 'dribbble',\n 'facebook',\n 'github',\n 'instagram',\n 'linkedin',\n 'medium',\n 'pinterest',\n 'reddit',\n 'rss',\n 'snapchat',\n 'soundcloud',\n 'spotify',\n 'telegram',\n 'tumblr',\n 'twitch',\n 'twitter',\n 'vimeo',\n 'whatsapp',\n 'yelp',\n 'youtube',\n] as const\n\ntype SocialLinkTypeV0 = typeof socialLinkTypesV0[number]\n\nexport const socialLinkTypesV1 = [...socialLinkTypesV0, 'x', 'slack'] as const\n\ntype SocialLinkTypeV1 = typeof socialLinkTypesV1[number]\n\ntype SocialLinkV0 = { type: SocialLinkTypeV0; url: string }\n\ntype SocialLinkV1 = { type: SocialLinkTypeV1; url: string }\n\ntype SocialLinksLinkV0 = { id: string; payload: SocialLinkV0 }\n\ntype SocialLinksLinkV1 = { id: string; payload: SocialLinkV1 }\n\ntype SocialLinksValueV0 = { links: SocialLinksLinkV0[]; openInNewTab: boolean }\n\ntype SocialLinksValueV1 = { links: SocialLinksLinkV1[]; openInNewTab: boolean }\n\nexport type SocialLinksValue = SocialLinksValueV0 | SocialLinksValueV1\n\ntype SocialLinksOptions = Options<{ preset?: SocialLinksValueV1 }>\n\nexport type SocialLinksDescriptor<_T = SocialLinksValueV1> = {\n type: typeof Types.SocialLinks\n options: SocialLinksOptions\n version?: 1\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function SocialLinks(options: SocialLinksOptions = {}): SocialLinksDescriptor {\n return { type: Types.SocialLinks, options, version: 1 }\n}\n\nexport type TextInputValue = string\n\nexport type TextInputOptions = Options<{ label?: string; placeholder?: string; hidden?: boolean }>\n\nexport type TextInputDescriptor<_T = TextInputValue> = {\n type: typeof Types.TextInput\n options: TextInputOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function TextInput(options: TextInputOptions = {}): TextInputDescriptor {\n return { type: Types.TextInput, options }\n}\n\nexport type Descriptor<T extends Data = Data> =\n | DeletedPropControllerDescriptor<T>\n | BackgroundsDescriptor<T>\n | BorderDescriptor<T>\n | BorderRadiusDescriptor<T>\n | CheckboxDescriptor<T>\n | DateDescriptor<T>\n | ElementIDDescriptor<T>\n | FontDescriptor<T>\n | GapXDescriptor<T>\n | GapYDescriptor<T>\n | GridDescriptor<T>\n | ImageDescriptor<T>\n | ImagesDescriptor<T>\n | LinkDescriptor<T>\n | MarginDescriptor<T>\n | NavigationLinksDescriptor<T>\n | NumberDescriptor<T>\n | PaddingDescriptor<T>\n | ResponsiveColorDescriptor<T>\n | ResponsiveIconRadioGroupDescriptor<\n T extends ResponsiveIconRadioGroupValue<string> ? T : ResponsiveIconRadioGroupValue<string>\n >\n | ResponsiveLengthDescriptor<T>\n | ResponsiveNumberDescriptor<T>\n | ResponsiveOpacityDescriptor<T>\n | ResponsiveSelectDescriptor<\n T extends ResponsiveSelectValue<string> ? T : ResponsiveSelectValue<string>\n >\n | ShadowsDescriptor<T>\n | SocialLinksDescriptor<T>\n | TableDescriptor<T>\n | TableFormFieldsDescriptor<T>\n | TextAreaDescriptor<T>\n | TextInputDescriptor<T>\n | TextStyleDescriptor<T>\n | VideoDescriptor<T>\n | WidthDescriptor<T>\n | StyleControlDefinition\n | StyleV2ControlDefinition\n | NumberControlDefinition\n | CheckboxControlDefinition\n | TextInputControlDefinition\n | TextAreaControlDefinition\n | SelectControlDefinition\n | ColorControlDefinition\n | IconRadioGroupControlDefinition\n | ImageControlDefinition\n | ComboboxControlDefinition\n | ShapeControlDefinition\n | ListControlDefinition\n | LinkControlDefinition\n | SlotControlDefinition\n | RichTextControlDefinition\n | RichTextV2ControlDefinition\n | TypographyControlDefinition\n\nexport type PanelDescriptorType =\n | typeof PropControllerTypes.Backgrounds\n | typeof Types.ResponsiveIconRadioGroup\n | typeof PropControllerTypes.Margin\n | typeof PropControllerTypes.Padding\n | typeof PropControllerTypes.Shadows\n | typeof PropControllerTypes.Border\n | typeof PropControllerTypes.GapY\n | typeof PropControllerTypes.GapX\n | typeof PropControllerTypes.BorderRadius\n | typeof PropControllerTypes.Checkbox\n | typeof Types.TextInput\n | typeof PropControllerTypes.Link\n | typeof Types.ResponsiveSelect\n | typeof PropControllerTypes.ResponsiveColor\n | typeof PropControllerTypes.TextStyle\n | typeof PropControllerTypes.Images\n | typeof Types.ResponsiveNumber\n | typeof PropControllerTypes.Number\n | typeof PropControllerTypes.Date\n | typeof PropControllerTypes.Font\n | typeof PropControllerTypes.TextArea\n | typeof PropControllerTypes.Table\n | typeof PropControllerTypes.Image\n | typeof Types.ResponsiveOpacity\n | typeof Types.SocialLinks\n | typeof PropControllerTypes.Video\n | typeof PropControllerTypes.NavigationLinks\n\nexport type PanelDescriptor<T extends Data = Data> = Extract<\n Descriptor<T>,\n { type: PanelDescriptorType }\n>\n\nexport type DescriptorValueType<T extends Descriptor> = T extends NumberControlDefinition\n ? NumberControlValue<T>\n : T extends CheckboxControlDefinition\n ? CheckboxControlValue<T>\n : T extends TextInputControlDefinition\n ? TextInputControlValue<T>\n : T extends TextAreaControlDefinition\n ? TextAreaControlValue<T>\n : T extends SelectControlDefinition\n ? SelectControlValue<T>\n : T extends ColorControlDefinition\n ? ColorControlValue<T>\n : T extends StyleControlDefinition\n ? StyleControlFormattedValue\n : T extends StyleV2ControlDefinition\n ? StyleV2ControlFormattedValue\n : T extends IconRadioGroupControlDefinition\n ? IconRadioGroupControlValue<T>\n : T extends ImageControlDefinition\n ? ResolveImageControlValue<T>\n : T extends ComboboxControlDefinition\n ? ComboboxControlValue<T>\n : T extends ShapeControlDefinition\n ? ShapeControlValue<T>\n : T extends ListControlDefinition\n ? ListControlValue<T>\n : T extends LinkControlDefinition\n ? LinkControlValue<T>\n : T extends SlotControlDefinition\n ? SlotControlValue\n : T extends RichTextControlDefinition\n ? RichTextControlValue\n : T extends RichTextV2ControlDefinition\n ? RichTextV2ControlValue\n : T extends StyleV2ControlDefinition\n ? StyleV2ControlFormattedValue\n : T extends TypographyControlDefinition\n ? TypographyControlValue\n : T['type'] extends typeof PropControllerTypes.ResponsiveColor\n ? // TODO(miguel): We're not importing a resolver type from `@makeswift/prop-controllers` because\n // the resolved type is tightly coupled with the runtime (i.e., it's the result of an API call).\n // This means that we probably want to rethink how types are resolved and where that lives.\n ResponsiveColor | null | undefined\n : T['type'] extends typeof PropControllerTypes.Backgrounds\n ? ResolveBackgroundsPropControllerValue<\n Extract<T, { type: typeof PropControllerTypes.Backgrounds }>\n >\n : T['type'] extends typeof PropControllerTypes.Checkbox\n ? ResolveCheckboxPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Checkbox }>>\n : T['type'] extends typeof PropControllerTypes.Date\n ? ResolveDatePropControllerValue<Extract<T, { type: typeof PropControllerTypes.Date }>>\n : T['type'] extends typeof PropControllerTypes.ElementID\n ? ResolveElementIDPropControllerValue<Extract<T, { type: typeof PropControllerTypes.ElementID }>>\n : T['type'] extends typeof PropControllerTypes.Font\n ? ResolveFontPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Font }>>\n : T['type'] extends typeof PropControllerTypes.GapX\n ? ResolveGapXPropControllerValue<Extract<T, { type: typeof PropControllerTypes.GapX }>>\n : T['type'] extends typeof PropControllerTypes.GapY\n ? ResolveGapYPropControllerValue<Extract<T, { type: typeof PropControllerTypes.GapY }>>\n : T['type'] extends typeof PropControllerTypes.Grid\n ? ResolveGridPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Grid }>>\n : T['type'] extends typeof PropControllerTypes.Image\n ? ResolveImagePropControllerValue<Extract<T, { type: typeof PropControllerTypes.Image }>>\n : T['type'] extends typeof PropControllerTypes.Images\n ? ResolveImagesPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Images }>>\n : T['type'] extends typeof PropControllerTypes.Link\n ? ResolveLinkPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Link }>>\n : T['type'] extends typeof PropControllerTypes.Width\n ? ResolveWidthPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Width }>>\n : T['type'] extends typeof PropControllerTypes.Padding\n ? ResolvePaddingPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Padding }>>\n : T['type'] extends typeof PropControllerTypes.Margin\n ? ResolveMarginPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Margin }>>\n : T['type'] extends typeof PropControllerTypes.NavigationLinks\n ? ResolveNavigationLinksPropControllerValue<\n Extract<T, { type: typeof PropControllerTypes.NavigationLinks }>\n >\n : T['type'] extends typeof PropControllerTypes.BorderRadius\n ? ResolveBorderRadiusPropControllerValue<\n Extract<T, { type: typeof PropControllerTypes.BorderRadius }>\n >\n : T['type'] extends typeof PropControllerTypes.Shadows\n ? ResolveShadowsPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Shadows }>>\n : T['type'] extends typeof PropControllerTypes.ResponsiveLength\n ? ResolveResponsiveLengthPropControllerValue<\n Extract<T, { type: typeof PropControllerTypes.ResponsiveLength }>\n >\n : T['type'] extends typeof PropControllerTypes.Border\n ? ResolveBorderPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Border }>>\n : T['type'] extends typeof PropControllerTypes.Number\n ? ResolveNumberPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Number }>>\n : T['type'] extends typeof PropControllerTypes.Table\n ? ResolveTablePropControllerValue<Extract<T, { type: typeof PropControllerTypes.Table }>>\n : T['type'] extends typeof PropControllerTypes.TableFormFields\n ? ResolveTableFormFieldsPropControllerValue<\n Extract<T, { type: typeof PropControllerTypes.TableFormFields }>\n >\n : T['type'] extends typeof PropControllerTypes.TextStyle\n ? ResolveTextStylePropControllerValue<Extract<T, { type: typeof PropControllerTypes.TextStyle }>>\n : T['type'] extends typeof PropControllerTypes.TextArea\n ? ResolveTextAreaPropControllerValue<Extract<T, { type: typeof PropControllerTypes.TextArea }>>\n : T['type'] extends typeof PropControllerTypes.Video\n ? ResolveVideoPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Video }>>\n : T extends Descriptor<infer U>\n ? U | undefined\n : never\n\nexport type PanelDescriptorValueType<T extends PanelDescriptor> = T extends PanelDescriptor<infer U>\n ? U\n : never\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,IAAAA,gBAAiC;AAkI1B,MAAM,QAAQ;AAAA,EACnB,0BAA0B;AAAA,EAC1B,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,WAAW;AAAA,EACX,OAAO;AACT;AA4BO,SAAS,yBACd,SACsE;AACtE,SAAO,EAAE,MAAM,MAAM,0BAA0B,QAAQ;AACzD;AAuBO,SAAS,iBACd,UAAmC,CAAC,GACR;AAC5B,SAAO,EAAE,MAAM,MAAM,kBAAkB,QAAQ;AACjD;AAeO,SAAS,kBACd,UAAoC,CAAC,GACR;AAC7B,SAAO,EAAE,MAAM,MAAM,mBAAmB,QAAQ;AAClD;AA+BO,SAAS,iBACd,SACsD;AACtD,SAAO,EAAE,MAAM,MAAM,kBAAkB,QAAQ;AACjD;AAEO,MAAM,oBAAoB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAIO,MAAM,oBAAoB,CAAC,GAAG,mBAAmB,KAAK,OAAO;AA8B7D,SAAS,YAAY,UAA8B,CAAC,GAA0B;AACnF,SAAO,EAAE,MAAM,MAAM,aAAa,SAAS,SAAS,EAAE;AACxD;AAeO,SAAS,UAAU,UAA4B,CAAC,GAAwB;AAC7E,SAAO,EAAE,MAAM,MAAM,WAAW,QAAQ;AAC1C;","names":["import_style"]}
1
+ {"version":3,"sources":["../../../src/prop-controllers/descriptors.ts"],"sourcesContent":["import {\n CheckboxControlDefinition,\n IconRadioGroupControlDefinition,\n NumberControlDefinition,\n TextInputControlDefinition,\n TextAreaControlDefinition,\n} from '@makeswift/controls'\nimport { ResponsiveColor } from '../runtimes/react/controls'\nimport { StyleControlFormattedValue } from '../runtimes/react/controls/style'\nimport type { Data } from '../state/react-page'\nimport { NumberControlValue } from '../runtimes/react/controls/number'\nimport { StyleControlType } from '../controls/style'\nimport {\n ColorControlDefinition,\n ComboboxControlDefinition,\n ImageControlDefinition,\n LinkControlDefinition,\n ListControlDefinition,\n SelectControlDefinition,\n ShapeControlDefinition,\n SlotControlDefinition,\n StyleControlDefinition,\n RichTextV2ControlDefinition,\n StyleV2ControlDefinition,\n TypographyControlDefinition,\n} from '../controls'\nimport { TextInputControlValue } from '../runtimes/react/controls/text-input'\nimport { TextAreaControlValue } from '../runtimes/react/controls/text-area'\nimport { ColorControlValue } from '../runtimes/react/controls/color'\nimport { SelectControlValue } from '../runtimes/react/controls/select'\nimport { CheckboxControlValue } from '../runtimes/react/controls/checkbox'\nimport { ResolveImageControlValue } from '../runtimes/react/controls/image'\nimport { ShapeControlValue } from '../runtimes/react/controls/shape'\nimport { ListControlValue } from '../runtimes/react/controls/list'\nimport { ComboboxControlValue } from '../runtimes/react/controls/combobox'\nimport { LinkControlValue } from '../runtimes/react/controls/link'\nimport { SlotControlValue } from '../runtimes/react/controls/slot'\nimport { RichTextControlDefinition } from '../controls/rich-text'\nimport { RichTextControlValue } from '../runtimes/react/controls/rich-text/rich-text'\nimport { RichTextV2ControlValue } from '../runtimes/react/controls/rich-text-v2'\nimport { StyleV2ControlFormattedValue } from '../runtimes/react/controls/style-v2'\nimport { IconRadioGroupControlValue } from '../runtimes/react/controls/icon-radio-group'\nimport { TypographyControlValue } from '../runtimes/react/controls/typography'\nimport {\n BorderDescriptor,\n CheckboxDescriptor,\n LinkDescriptor,\n ResolveLinkPropControllerValue,\n Types as PropControllerTypes,\n ResponsiveValueType,\n ShadowsDescriptor,\n ResolveShadowsPropControllerValue,\n ResponsiveValue,\n Options,\n ResponsiveLengthDescriptor,\n ResolveResponsiveLengthPropControllerValue,\n NumberDescriptor,\n ResolveNumberPropControllerValue,\n ResponsiveColorDescriptor,\n ResolveCheckboxPropControllerValue,\n BorderRadiusDescriptor,\n ResolveBorderPropControllerValue,\n ResolveBorderRadiusPropControllerValue,\n DateDescriptor,\n ResolveDatePropControllerValue,\n FontDescriptor,\n ResolveFontPropControllerValue,\n VideoDescriptor,\n ResolveVideoPropControllerValue,\n TableDescriptor,\n ResolveTablePropControllerValue,\n MarginDescriptor,\n ResolveMarginPropControllerValue,\n PaddingDescriptor,\n ResolvePaddingPropControllerValue,\n WidthDescriptor,\n ResolveWidthPropControllerValue,\n TextStyleDescriptor,\n ResolveTextStylePropControllerValue,\n NavigationLinksDescriptor,\n ResolveNavigationLinksPropControllerValue,\n TextAreaDescriptor,\n ResolveTextAreaPropControllerValue,\n ResolveGapXPropControllerValue,\n GapXDescriptor,\n ResolveGapYPropControllerValue,\n GapYDescriptor,\n ElementIDDescriptor,\n ResolveElementIDPropControllerValue,\n TableFormFieldsDescriptor,\n ResolveTableFormFieldsPropControllerValue,\n GridDescriptor,\n ResolveGridPropControllerValue,\n ImageDescriptor,\n ResolveImagePropControllerValue,\n ImagesDescriptor,\n ResolveImagesPropControllerValue,\n BackgroundsDescriptor,\n ResolveBackgroundsPropControllerValue,\n} from '@makeswift/prop-controllers'\nimport { DeletedPropControllerDescriptor } from './deleted'\n\nexport type { Data }\n\ntype IconName =\n | 'HeightAuto16'\n | 'HeightMatch16'\n | 'VerticalAlignStart16'\n | 'VerticalAlignMiddle16'\n | 'VerticalAlignEnd16'\n | 'VerticalAlignSpaceBetween16'\n | 'ButtonPill16'\n | 'ButtonRounded16'\n | 'ButtonSquare16'\n | 'SizeSmall16'\n | 'SizeMedium16'\n | 'SizeLarge16'\n | 'ArrowInside16'\n | 'ArrowCenter16'\n | 'ArrowOutside16'\n | 'CountdownSolid16'\n | 'CountdownSolidSplit16'\n | 'CountdownOutline16'\n | 'CountdownOutlineSplit16'\n | 'CountdownNaked16'\n | 'Sun16'\n | 'Moon16'\n | 'AlignLeft16'\n | 'AlignCenter16'\n | 'AlignRight16'\n | 'Star16'\n | 'StarCircle16'\n | 'StarRoundedSquare16'\n | 'StarSquare16'\n\nexport type Gap = { value: number; unit: 'px' }\n\nexport const Types = {\n ResponsiveIconRadioGroup: 'ResponsiveIconRadioGroup',\n ResponsiveNumber: 'ResponsiveNumber',\n ResponsiveOpacity: 'ResponsiveOpacity',\n ResponsiveSelect: 'ResponsiveSelect',\n SocialLinks: 'SocialLinks',\n TextInput: 'TextInput',\n Style: StyleControlType,\n} as const\n\nexport type IconRadioGroupOption<T extends string> = { value: T; label: string; icon: IconName }\n\nexport type ResponsiveIconRadioGroupValue<T extends string = string> = ResponsiveValue<T>\n\nexport type ResponsiveIconRadioGroupOptions<T extends string = string, U extends T = T> = Options<{\n label?: string\n options: IconRadioGroupOption<T>[]\n defaultValue?: U\n hidden?: boolean\n}>\n\nexport type ResponsiveIconRadioGroupDescriptor<\n T extends ResponsiveIconRadioGroupValue<string> = ResponsiveIconRadioGroupValue<string>,\n> = {\n type: typeof Types.ResponsiveIconRadioGroup\n options: ResponsiveIconRadioGroupOptions<ResponsiveValueType<T>>\n}\n\n// HACK(miguel): We have to use a layer of indirection with `_T` and `T` because otherwise the\n// values provided would undergo type widening. For some reason, the extra layer of indirection\n// reuslts in TypeScript not widening types. Note, this only happens when the returned value of this\n// function is passed to another as an argument, which is common with the `registerComponent` API.\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function ResponsiveIconRadioGroup<_T extends string, T extends _T, U extends T>(\n options: ResponsiveIconRadioGroupOptions<T, U>,\n): ResponsiveIconRadioGroupDescriptor<ResponsiveIconRadioGroupValue<T>> {\n return { type: Types.ResponsiveIconRadioGroup, options }\n}\n\nexport type ResponsiveNumberValue = ResponsiveValue<number>\n\nexport type ResponsiveNumberOptions = Options<{\n label?: string\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n suffix?: string\n hidden?: boolean\n}>\n\nexport type ResponsiveNumberDescriptor<_T = ResponsiveNumberValue> = {\n type: typeof Types.ResponsiveNumber\n options: ResponsiveNumberOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function ResponsiveNumber(\n options: ResponsiveNumberOptions = {},\n): ResponsiveNumberDescriptor {\n return { type: Types.ResponsiveNumber, options }\n}\n\nexport type ResponsiveOpacityValue = ResponsiveValue<number>\n\ntype ResponsiveOpacityOptions = Options<Record<string, never>>\n\ntype ResponsiveOpacityDescriptor<_T = ResponsiveOpacityValue> = {\n type: typeof Types.ResponsiveOpacity\n options: ResponsiveOpacityOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function ResponsiveOpacity(\n options: ResponsiveOpacityOptions = {},\n): ResponsiveOpacityDescriptor {\n return { type: Types.ResponsiveOpacity, options }\n}\n\nexport type ResponsiveSelectValue<T extends string = string> = ResponsiveValue<T>\n\nexport type SelectLabelOrientation = 'vertical' | 'horizontal'\n\nexport type SelectOption<T extends string> = { value: T; label: string }\n\nexport type ResponsiveSelectOptions<T extends string = string, U extends T = T> = Options<{\n label?: string\n labelOrientation?: SelectLabelOrientation\n options: SelectOption<T>[]\n defaultValue?: U\n hidden?: boolean\n}>\n\nexport type ResponsiveSelectDescriptor<\n T extends ResponsiveSelectValue<string> = ResponsiveSelectValue<string>,\n> = {\n type: typeof Types.ResponsiveSelect\n options: ResponsiveSelectOptions<ResponsiveValueType<T>>\n}\n\n// HACK(miguel): We have to use a layer of indirection with `_T` and `T` because otherwise the\n// values provided would undergo type widening. For some reason, the extra layer of indirection\n// reuslts in TypeScript not widening types. Note, this only happens when the returned value of this\n// function is passed to another as an argument, which is common with the `registerComponent` API.\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function ResponsiveSelect<_T extends string, T extends _T, U extends T>(\n options: ResponsiveSelectOptions<T, U>,\n): ResponsiveSelectDescriptor<ResponsiveSelectValue<T>> {\n return { type: Types.ResponsiveSelect, options }\n}\n\nexport const socialLinkTypesV0 = [\n 'angellist',\n 'codepen',\n 'discord',\n 'dribbble',\n 'facebook',\n 'github',\n 'instagram',\n 'linkedin',\n 'medium',\n 'pinterest',\n 'reddit',\n 'rss',\n 'snapchat',\n 'soundcloud',\n 'spotify',\n 'telegram',\n 'tumblr',\n 'twitch',\n 'twitter',\n 'vimeo',\n 'whatsapp',\n 'yelp',\n 'youtube',\n] as const\n\ntype SocialLinkTypeV0 = typeof socialLinkTypesV0[number]\n\nexport const socialLinkTypesV1 = [...socialLinkTypesV0, 'x', 'slack'] as const\n\ntype SocialLinkTypeV1 = typeof socialLinkTypesV1[number]\n\ntype SocialLinkV0 = { type: SocialLinkTypeV0; url: string }\n\ntype SocialLinkV1 = { type: SocialLinkTypeV1; url: string }\n\ntype SocialLinksLinkV0 = { id: string; payload: SocialLinkV0 }\n\ntype SocialLinksLinkV1 = { id: string; payload: SocialLinkV1 }\n\ntype SocialLinksValueV0 = { links: SocialLinksLinkV0[]; openInNewTab: boolean }\n\ntype SocialLinksValueV1 = { links: SocialLinksLinkV1[]; openInNewTab: boolean }\n\nexport type SocialLinksValue = SocialLinksValueV0 | SocialLinksValueV1\n\ntype SocialLinksOptions = Options<{ preset?: SocialLinksValueV1 }>\n\nexport type SocialLinksDescriptor<_T = SocialLinksValueV1> = {\n type: typeof Types.SocialLinks\n options: SocialLinksOptions\n version?: 1\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function SocialLinks(options: SocialLinksOptions = {}): SocialLinksDescriptor {\n return { type: Types.SocialLinks, options, version: 1 }\n}\n\nexport type TextInputValue = string\n\nexport type TextInputOptions = Options<{ label?: string; placeholder?: string; hidden?: boolean }>\n\nexport type TextInputDescriptor<_T = TextInputValue> = {\n type: typeof Types.TextInput\n options: TextInputOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function TextInput(options: TextInputOptions = {}): TextInputDescriptor {\n return { type: Types.TextInput, options }\n}\n\nexport type Descriptor<T extends Data = Data> =\n | DeletedPropControllerDescriptor<T>\n | BackgroundsDescriptor<T>\n | BorderDescriptor<T>\n | BorderRadiusDescriptor<T>\n | CheckboxDescriptor<T>\n | DateDescriptor<T>\n | ElementIDDescriptor<T>\n | FontDescriptor<T>\n | GapXDescriptor<T>\n | GapYDescriptor<T>\n | GridDescriptor<T>\n | ImageDescriptor<T>\n | ImagesDescriptor<T>\n | LinkDescriptor<T>\n | MarginDescriptor<T>\n | NavigationLinksDescriptor<T>\n | NumberDescriptor<T>\n | PaddingDescriptor<T>\n | ResponsiveColorDescriptor<T>\n | ResponsiveIconRadioGroupDescriptor<\n T extends ResponsiveIconRadioGroupValue<string> ? T : ResponsiveIconRadioGroupValue<string>\n >\n | ResponsiveLengthDescriptor<T>\n | ResponsiveNumberDescriptor<T>\n | ResponsiveOpacityDescriptor<T>\n | ResponsiveSelectDescriptor<\n T extends ResponsiveSelectValue<string> ? T : ResponsiveSelectValue<string>\n >\n | ShadowsDescriptor<T>\n | SocialLinksDescriptor<T>\n | TableDescriptor<T>\n | TableFormFieldsDescriptor<T>\n | TextAreaDescriptor<T>\n | TextInputDescriptor<T>\n | TextStyleDescriptor<T>\n | VideoDescriptor<T>\n | WidthDescriptor<T>\n | StyleControlDefinition\n | StyleV2ControlDefinition\n | NumberControlDefinition\n | CheckboxControlDefinition\n | TextInputControlDefinition\n | TextAreaControlDefinition\n | SelectControlDefinition\n | ColorControlDefinition\n | IconRadioGroupControlDefinition\n | ImageControlDefinition\n | ComboboxControlDefinition\n | ShapeControlDefinition\n | ListControlDefinition\n | LinkControlDefinition\n | SlotControlDefinition\n | RichTextControlDefinition\n | RichTextV2ControlDefinition\n | TypographyControlDefinition\n\nexport type PanelDescriptorType =\n | typeof PropControllerTypes.Backgrounds\n | typeof Types.ResponsiveIconRadioGroup\n | typeof PropControllerTypes.Margin\n | typeof PropControllerTypes.Padding\n | typeof PropControllerTypes.Shadows\n | typeof PropControllerTypes.Border\n | typeof PropControllerTypes.GapY\n | typeof PropControllerTypes.GapX\n | typeof PropControllerTypes.BorderRadius\n | typeof PropControllerTypes.Checkbox\n | typeof Types.TextInput\n | typeof PropControllerTypes.Link\n | typeof Types.ResponsiveSelect\n | typeof PropControllerTypes.ResponsiveColor\n | typeof PropControllerTypes.TextStyle\n | typeof PropControllerTypes.Images\n | typeof Types.ResponsiveNumber\n | typeof PropControllerTypes.Number\n | typeof PropControllerTypes.Date\n | typeof PropControllerTypes.Font\n | typeof PropControllerTypes.TextArea\n | typeof PropControllerTypes.Table\n | typeof PropControllerTypes.Image\n | typeof Types.ResponsiveOpacity\n | typeof Types.SocialLinks\n | typeof PropControllerTypes.Video\n | typeof PropControllerTypes.NavigationLinks\n\nexport type PanelDescriptor<T extends Data = Data> = Extract<\n Descriptor<T>,\n { type: PanelDescriptorType }\n>\n\nexport type DescriptorValueType<T extends Descriptor> = T extends NumberControlDefinition\n ? NumberControlValue<T>\n : T extends CheckboxControlDefinition\n ? CheckboxControlValue<T>\n : T extends TextInputControlDefinition\n ? TextInputControlValue<T>\n : T extends TextAreaControlDefinition\n ? TextAreaControlValue<T>\n : T extends SelectControlDefinition\n ? SelectControlValue<T>\n : T extends ColorControlDefinition\n ? ColorControlValue<T>\n : T extends StyleControlDefinition\n ? StyleControlFormattedValue\n : T extends StyleV2ControlDefinition\n ? StyleV2ControlFormattedValue\n : T extends IconRadioGroupControlDefinition\n ? IconRadioGroupControlValue<T>\n : T extends ImageControlDefinition\n ? ResolveImageControlValue<T>\n : T extends ComboboxControlDefinition\n ? ComboboxControlValue<T>\n : T extends ShapeControlDefinition\n ? ShapeControlValue<T>\n : T extends ListControlDefinition\n ? ListControlValue<T>\n : T extends LinkControlDefinition\n ? LinkControlValue<T>\n : T extends SlotControlDefinition\n ? SlotControlValue\n : T extends RichTextControlDefinition\n ? RichTextControlValue\n : T extends RichTextV2ControlDefinition\n ? RichTextV2ControlValue\n : T extends StyleV2ControlDefinition\n ? StyleV2ControlFormattedValue\n : T extends TypographyControlDefinition\n ? TypographyControlValue\n : T['type'] extends typeof PropControllerTypes.ResponsiveColor\n ? // TODO(miguel): We're not importing a resolver type from `@makeswift/prop-controllers` because\n // the resolved type is tightly coupled with the runtime (i.e., it's the result of an API call).\n // This means that we probably want to rethink how types are resolved and where that lives.\n ResponsiveColor | null | undefined\n : T['type'] extends typeof PropControllerTypes.Backgrounds\n ? ResolveBackgroundsPropControllerValue<\n Extract<T, { type: typeof PropControllerTypes.Backgrounds }>\n >\n : T['type'] extends typeof PropControllerTypes.Checkbox\n ? ResolveCheckboxPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Checkbox }>>\n : T['type'] extends typeof PropControllerTypes.Date\n ? ResolveDatePropControllerValue<Extract<T, { type: typeof PropControllerTypes.Date }>>\n : T['type'] extends typeof PropControllerTypes.ElementID\n ? ResolveElementIDPropControllerValue<Extract<T, { type: typeof PropControllerTypes.ElementID }>>\n : T['type'] extends typeof PropControllerTypes.Font\n ? ResolveFontPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Font }>>\n : T['type'] extends typeof PropControllerTypes.GapX\n ? ResolveGapXPropControllerValue<Extract<T, { type: typeof PropControllerTypes.GapX }>>\n : T['type'] extends typeof PropControllerTypes.GapY\n ? ResolveGapYPropControllerValue<Extract<T, { type: typeof PropControllerTypes.GapY }>>\n : T['type'] extends typeof PropControllerTypes.Grid\n ? ResolveGridPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Grid }>>\n : T['type'] extends typeof PropControllerTypes.Image\n ? ResolveImagePropControllerValue<Extract<T, { type: typeof PropControllerTypes.Image }>>\n : T['type'] extends typeof PropControllerTypes.Images\n ? ResolveImagesPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Images }>>\n : T['type'] extends typeof PropControllerTypes.Link\n ? ResolveLinkPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Link }>>\n : T['type'] extends typeof PropControllerTypes.Width\n ? ResolveWidthPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Width }>>\n : T['type'] extends typeof PropControllerTypes.Padding\n ? ResolvePaddingPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Padding }>>\n : T['type'] extends typeof PropControllerTypes.Margin\n ? ResolveMarginPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Margin }>>\n : T['type'] extends typeof PropControllerTypes.NavigationLinks\n ? ResolveNavigationLinksPropControllerValue<\n Extract<T, { type: typeof PropControllerTypes.NavigationLinks }>\n >\n : T['type'] extends typeof PropControllerTypes.BorderRadius\n ? ResolveBorderRadiusPropControllerValue<\n Extract<T, { type: typeof PropControllerTypes.BorderRadius }>\n >\n : T['type'] extends typeof PropControllerTypes.Shadows\n ? ResolveShadowsPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Shadows }>>\n : T['type'] extends typeof PropControllerTypes.ResponsiveLength\n ? ResolveResponsiveLengthPropControllerValue<\n Extract<T, { type: typeof PropControllerTypes.ResponsiveLength }>\n >\n : T['type'] extends typeof PropControllerTypes.Border\n ? ResolveBorderPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Border }>>\n : T['type'] extends typeof PropControllerTypes.Number\n ? ResolveNumberPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Number }>>\n : T['type'] extends typeof PropControllerTypes.Table\n ? ResolveTablePropControllerValue<Extract<T, { type: typeof PropControllerTypes.Table }>>\n : T['type'] extends typeof PropControllerTypes.TableFormFields\n ? ResolveTableFormFieldsPropControllerValue<\n Extract<T, { type: typeof PropControllerTypes.TableFormFields }>\n >\n : T['type'] extends typeof PropControllerTypes.TextStyle\n ? ResolveTextStylePropControllerValue<Extract<T, { type: typeof PropControllerTypes.TextStyle }>>\n : T['type'] extends typeof PropControllerTypes.TextArea\n ? ResolveTextAreaPropControllerValue<Extract<T, { type: typeof PropControllerTypes.TextArea }>>\n : T['type'] extends typeof PropControllerTypes.Video\n ? ResolveVideoPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Video }>>\n : T extends Descriptor<infer U>\n ? U | undefined\n : never\n\nexport type PanelDescriptorValueType<T extends PanelDescriptor> = T extends PanelDescriptor<infer U>\n ? U\n : never\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,IAAAA,gBAAiC;AA8H1B,MAAM,QAAQ;AAAA,EACnB,0BAA0B;AAAA,EAC1B,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,WAAW;AAAA,EACX,OAAO;AACT;AA4BO,SAAS,yBACd,SACsE;AACtE,SAAO,EAAE,MAAM,MAAM,0BAA0B,QAAQ;AACzD;AAuBO,SAAS,iBACd,UAAmC,CAAC,GACR;AAC5B,SAAO,EAAE,MAAM,MAAM,kBAAkB,QAAQ;AACjD;AAeO,SAAS,kBACd,UAAoC,CAAC,GACR;AAC7B,SAAO,EAAE,MAAM,MAAM,mBAAmB,QAAQ;AAClD;AA+BO,SAAS,iBACd,SACsD;AACtD,SAAO,EAAE,MAAM,MAAM,kBAAkB,QAAQ;AACjD;AAEO,MAAM,oBAAoB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAIO,MAAM,oBAAoB,CAAC,GAAG,mBAAmB,KAAK,OAAO;AA8B7D,SAAS,YAAY,UAA8B,CAAC,GAA0B;AACnF,SAAO,EAAE,MAAM,MAAM,aAAa,SAAS,SAAS,EAAE;AACxD;AAeO,SAAS,UAAU,UAA4B,CAAC,GAAwB;AAC7E,SAAO,EAAE,MAAM,MAAM,WAAW,QAAQ;AAC1C;","names":["import_style"]}
@@ -22,7 +22,7 @@ __export(checkbox_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(checkbox_exports);
24
24
  var import_ts_pattern = require("ts-pattern");
25
- var import_controls = require("../../../controls");
25
+ var import_controls = require("@makeswift/controls");
26
26
  function useCheckboxControlValue(data, definition) {
27
27
  const value = (0, import_ts_pattern.match)(data).with({ [import_controls.CheckboxControlDataTypeKey]: import_controls.CheckboxControlDataTypeValueV1 }, (val) => val.value).otherwise((val) => val) ?? definition.config.defaultValue;
28
28
  return value;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/runtimes/react/controls/checkbox.ts"],"sourcesContent":["import { match } from 'ts-pattern'\nimport {\n CheckboxControlData,\n CheckboxControlDataTypeKey,\n CheckboxControlDataTypeValueV1,\n CheckboxControlDefinition,\n} from '../../../controls'\n\nexport type CheckboxControlValue<T extends CheckboxControlDefinition> =\n undefined extends T['config']['defaultValue'] ? boolean | undefined : boolean\n\nexport function useCheckboxControlValue<T extends CheckboxControlDefinition>(\n data: CheckboxControlData | undefined,\n definition: T,\n): CheckboxControlValue<T> {\n const value: boolean | undefined =\n match(data)\n .with({ [CheckboxControlDataTypeKey]: CheckboxControlDataTypeValueV1 }, val => val.value)\n .otherwise(val => val) ?? definition.config.defaultValue\n\n return value as CheckboxControlValue<T>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAsB;AACtB,sBAKO;AAKA,SAAS,wBACd,MACA,YACyB;AACzB,QAAM,YACJ,yBAAM,IAAI,EACP,KAAK,EAAE,CAAC,0CAA0B,GAAG,+CAA+B,GAAG,SAAO,IAAI,KAAK,EACvF,UAAU,SAAO,GAAG,KAAK,WAAW,OAAO;AAEhD,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../../../src/runtimes/react/controls/checkbox.ts"],"sourcesContent":["import { match } from 'ts-pattern'\nimport {\n CheckboxControlData,\n CheckboxControlDataTypeKey,\n CheckboxControlDataTypeValueV1,\n CheckboxControlDefinition,\n} from '@makeswift/controls'\n\nexport type CheckboxControlValue<T extends CheckboxControlDefinition> =\n undefined extends T['config']['defaultValue'] ? boolean | undefined : boolean\n\nexport function useCheckboxControlValue<T extends CheckboxControlDefinition>(\n data: CheckboxControlData | undefined,\n definition: T,\n): CheckboxControlValue<T> {\n const value: boolean | undefined =\n match(data)\n .with({ [CheckboxControlDataTypeKey]: CheckboxControlDataTypeValueV1 }, val => val.value)\n .otherwise(val => val) ?? definition.config.defaultValue\n\n return value as CheckboxControlValue<T>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAsB;AACtB,sBAKO;AAKA,SAAS,wBACd,MACA,YACyB;AACzB,QAAM,YACJ,yBAAM,IAAI,EACP,KAAK,EAAE,CAAC,0CAA0B,GAAG,+CAA+B,GAAG,SAAO,IAAI,KAAK,EACvF,UAAU,SAAO,GAAG,KAAK,WAAW,OAAO;AAEhD,SAAO;AACT;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/runtimes/react/controls/color.ts"],"sourcesContent":["import Color from 'color'\nimport { ColorControlData, ColorControlDefinition } from '../../../controls/color'\nimport { useSwatch } from '../hooks/makeswift-api'\n\nexport type ColorControlValue<T extends ColorControlDefinition> =\n undefined extends T['config']['defaultValue'] ? string | undefined : string\n\nexport function useColorValue<T extends ColorControlDefinition>(\n data: ColorControlData | undefined,\n definition: T,\n): ColorControlValue<any> {\n const swatchId = data?.swatchId ?? null\n const swatch = useSwatch(swatchId)\n const alpha = data?.alpha ?? 1\n\n if (swatch == null) {\n const { defaultValue } = definition.config\n\n if (defaultValue === undefined) return undefined as ColorControlValue<T>\n\n let defaultColor\n try {\n defaultColor = Color(definition.config.defaultValue)\n } catch {\n defaultColor = Color()\n }\n\n return defaultColor.rgb().string()\n }\n\n return Color({ h: swatch.hue, s: swatch.saturation, l: swatch.lightness })\n .alpha(alpha)\n .rgb()\n .string()\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAElB,2BAA0B;AAKnB,SAAS,cACd,MACA,YACwB;AACxB,QAAM,WAAW,MAAM,YAAY;AACnC,QAAM,aAAS,gCAAU,QAAQ;AACjC,QAAM,QAAQ,MAAM,SAAS;AAE7B,MAAI,UAAU,MAAM;AAClB,UAAM,EAAE,aAAa,IAAI,WAAW;AAEpC,QAAI,iBAAiB;AAAW,aAAO;AAEvC,QAAI;AACJ,QAAI;AACF,yBAAe,aAAAA,SAAM,WAAW,OAAO,YAAY;AAAA,IACrD,QAAQ;AACN,yBAAe,aAAAA,SAAM;AAAA,IACvB;AAEA,WAAO,aAAa,IAAI,EAAE,OAAO;AAAA,EACnC;AAEA,aAAO,aAAAA,SAAM,EAAE,GAAG,OAAO,KAAK,GAAG,OAAO,YAAY,GAAG,OAAO,UAAU,CAAC,EACtE,MAAM,KAAK,EACX,IAAI,EACJ,OAAO;AACZ;","names":["Color"]}
1
+ {"version":3,"sources":["../../../../../src/runtimes/react/controls/color.ts"],"sourcesContent":["import Color from 'color'\nimport { ColorControlData, ColorControlDefinition } from '@makeswift/controls'\nimport { useSwatch } from '../hooks/makeswift-api'\n\nexport type ColorControlValue<T extends ColorControlDefinition> =\n undefined extends T['config']['defaultValue'] ? string | undefined : string\n\nexport function useColorValue<T extends ColorControlDefinition>(\n data: ColorControlData | undefined,\n definition: T,\n): ColorControlValue<any> {\n const swatchId = data?.swatchId ?? null\n const swatch = useSwatch(swatchId)\n const alpha = data?.alpha ?? 1\n\n if (swatch == null) {\n const { defaultValue } = definition.config\n\n if (defaultValue === undefined) return undefined as ColorControlValue<T>\n\n let defaultColor\n try {\n defaultColor = Color(definition.config.defaultValue)\n } catch {\n defaultColor = Color()\n }\n\n return defaultColor.rgb().string()\n }\n\n return Color({ h: swatch.hue, s: swatch.saturation, l: swatch.lightness })\n .alpha(alpha)\n .rgb()\n .string()\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAElB,2BAA0B;AAKnB,SAAS,cACd,MACA,YACwB;AACxB,QAAM,WAAW,MAAM,YAAY;AACnC,QAAM,aAAS,gCAAU,QAAQ;AACjC,QAAM,QAAQ,MAAM,SAAS;AAE7B,MAAI,UAAU,MAAM;AAClB,UAAM,EAAE,aAAa,IAAI,WAAW;AAEpC,QAAI,iBAAiB;AAAW,aAAO;AAEvC,QAAI;AACJ,QAAI;AACF,yBAAe,aAAAA,SAAM,WAAW,OAAO,YAAY;AAAA,IACrD,QAAQ;AACN,yBAAe,aAAAA,SAAM;AAAA,IACvB;AAEA,WAAO,aAAa,IAAI,EAAE,OAAO;AAAA,EACnC;AAEA,aAAO,aAAAA,SAAM,EAAE,GAAG,OAAO,KAAK,GAAG,OAAO,YAAY,GAAG,OAAO,UAAU,CAAC,EACtE,MAAM,KAAK,EACX,IAAI,EACJ,OAAO;AACZ;","names":["Color"]}
@@ -22,13 +22,13 @@ __export(control_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(control_exports);
24
24
  var import_jsx_runtime = require("react/jsx-runtime");
25
- var import_controls = require("../../../controls");
26
- var import_icon_radio_group = require("../../../controls/icon-radio-group");
25
+ var import_controls = require("@makeswift/controls");
26
+ var import_controls2 = require("../../../controls");
27
27
  var import_components = require("../components");
28
28
  var import_checkbox = require("./checkbox");
29
29
  var import_color = require("./color");
30
30
  var import_combobox = require("./combobox");
31
- var import_icon_radio_group2 = require("./icon-radio-group");
31
+ var import_icon_radio_group = require("./icon-radio-group");
32
32
  var import_image = require("./image");
33
33
  var import_link = require("./link");
34
34
  var import_list = require("./list");
@@ -90,7 +90,7 @@ function ControlValue({
90
90
  },
91
91
  definition.type
92
92
  );
93
- case import_controls.SelectControlType:
93
+ case import_controls2.SelectControlType:
94
94
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
95
95
  import_components.RenderHook,
96
96
  {
@@ -100,7 +100,7 @@ function ControlValue({
100
100
  },
101
101
  definition.type
102
102
  );
103
- case import_controls.ColorControlType:
103
+ case import_controls2.ColorControlType:
104
104
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
105
105
  import_components.RenderHook,
106
106
  {
@@ -110,17 +110,17 @@ function ControlValue({
110
110
  },
111
111
  definition.type
112
112
  );
113
- case import_icon_radio_group.IconRadioGroupControlType:
113
+ case import_controls2.IconRadioGroupControlType:
114
114
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
115
115
  import_components.RenderHook,
116
116
  {
117
- hook: import_icon_radio_group2.useIconRadioGroupValue,
117
+ hook: import_icon_radio_group.useIconRadioGroupValue,
118
118
  parameters: [data, definition],
119
119
  children: (value) => children(value)
120
120
  },
121
121
  definition.type
122
122
  );
123
- case import_controls.ImageControlType:
123
+ case import_controls2.ImageControlType:
124
124
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
125
125
  import_components.RenderHook,
126
126
  {
@@ -130,7 +130,7 @@ function ControlValue({
130
130
  },
131
131
  definition.type
132
132
  );
133
- case import_controls.LinkControlType:
133
+ case import_controls2.LinkControlType:
134
134
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
135
135
  import_components.RenderHook,
136
136
  {
@@ -140,7 +140,7 @@ function ControlValue({
140
140
  },
141
141
  definition.type
142
142
  );
143
- case import_controls.ComboboxControlType:
143
+ case import_controls2.ComboboxControlType:
144
144
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
145
145
  import_components.RenderHook,
146
146
  {
@@ -150,7 +150,7 @@ function ControlValue({
150
150
  },
151
151
  definition.type
152
152
  );
153
- case import_controls.ShapeControlType:
153
+ case import_controls2.ShapeControlType:
154
154
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
155
155
  import_shape.ShapeControlValue,
156
156
  {
@@ -160,7 +160,7 @@ function ControlValue({
160
160
  children: (value) => children(value)
161
161
  }
162
162
  );
163
- case import_controls.ListControlType:
163
+ case import_controls2.ListControlType:
164
164
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
165
165
  import_list.ListControlValue,
166
166
  {
@@ -170,7 +170,7 @@ function ControlValue({
170
170
  children: (value) => children(value)
171
171
  }
172
172
  );
173
- case import_controls.StyleV2ControlType:
173
+ case import_controls2.StyleV2ControlType:
174
174
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
175
175
  import_style_v2.StyleV2ControlValue,
176
176
  {
@@ -181,7 +181,7 @@ function ControlValue({
181
181
  },
182
182
  definition.type
183
183
  );
184
- case import_controls.SlotControlType:
184
+ case import_controls2.SlotControlType:
185
185
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
186
186
  import_components.RenderHook,
187
187
  {
@@ -191,7 +191,7 @@ function ControlValue({
191
191
  },
192
192
  definition.type
193
193
  );
194
- case import_controls.RichTextControlType:
194
+ case import_controls2.RichTextControlType:
195
195
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
196
196
  import_components.RenderHook,
197
197
  {
@@ -201,7 +201,7 @@ function ControlValue({
201
201
  },
202
202
  definition.type
203
203
  );
204
- case import_controls.RichTextV2ControlType:
204
+ case import_controls2.RichTextV2ControlType:
205
205
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
206
206
  import_components.RenderHook,
207
207
  {
@@ -215,7 +215,7 @@ function ControlValue({
215
215
  },
216
216
  definition.type
217
217
  );
218
- case import_controls.StyleControlType:
218
+ case import_controls2.StyleControlType:
219
219
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
220
220
  import_components.RenderHook,
221
221
  {
@@ -225,7 +225,7 @@ function ControlValue({
225
225
  },
226
226
  definition.type
227
227
  );
228
- case import_controls.TypographyControlType:
228
+ case import_controls2.TypographyControlType:
229
229
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
230
230
  import_components.RenderHook,
231
231
  {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/runtimes/react/controls/control.tsx"],"sourcesContent":["import {\n CheckboxControlData,\n CheckboxControlDefinition,\n CheckboxControlType,\n ColorControlData,\n ColorControlDefinition,\n ColorControlType,\n ComboboxControlData,\n ComboboxControlDefinition,\n ComboboxControlType,\n ControlDefinition,\n ControlDefinitionData,\n ImageControlData,\n ImageControlDefinition,\n ImageControlType,\n LinkControlData,\n LinkControlDefinition,\n LinkControlType,\n ListControl,\n ListControlData,\n ListControlDefinition,\n ListControlType,\n NumberControlData,\n NumberControlDefinition,\n NumberControlType,\n RichTextControl,\n RichTextControlData,\n RichTextControlDefinition,\n RichTextControlType,\n RichTextV2Control,\n RichTextV2ControlData,\n RichTextV2ControlDefinition,\n RichTextV2ControlType,\n SelectControlData,\n SelectControlDefinition,\n SelectControlType,\n ShapeControl,\n ShapeControlData,\n ShapeControlDefinition,\n ShapeControlType,\n SlotControl,\n SlotControlData,\n SlotControlDefinition,\n SlotControlType,\n StyleControl,\n StyleControlData,\n StyleControlDefinition,\n StyleControlType,\n StyleV2Control,\n StyleV2ControlData,\n StyleV2ControlDefinition,\n StyleV2ControlType,\n TextAreaControlData,\n TextAreaControlDefinition,\n TextAreaControlType,\n TextInputControlData,\n TextInputControlDefinition,\n TextInputControlType,\n TypographyControlData,\n TypographyControlDefinition,\n TypographyControlType,\n} from '../../../controls'\nimport {\n IconRadioGroupControlData,\n IconRadioGroupControlDefinition,\n IconRadioGroupControlType,\n} from '../../../controls/icon-radio-group'\nimport { AnyPropController } from '../../../prop-controllers/instances'\nimport { RenderHook } from '../components'\nimport { CheckboxControlValue, useCheckboxControlValue } from './checkbox'\nimport { ColorControlValue, useColorValue } from './color'\nimport { ComboboxControlValue, useComboboxControlValue } from './combobox'\nimport { IconRadioGroupControlValue, useIconRadioGroupValue } from './icon-radio-group'\nimport { ResolveImageControlValue, useImageControlValue } from './image'\nimport { LinkControlValue, useLinkControlValue } from './link'\nimport { ListControlValue } from './list'\nimport { NumberControlValue, useNumber } from './number'\nimport { RichTextControlValue, useRichText } from './rich-text/rich-text'\nimport { RichTextV2ControlValue, useRichTextV2 } from './rich-text-v2'\nimport { SelectControlValue, useSelectControlValue } from './select'\nimport { ShapeControlValue } from './shape'\nimport { SlotControlValue, useSlot } from './slot'\nimport { StyleControlFormattedValue, useFormattedStyle } from './style'\nimport { StyleV2ControlFormattedValue, StyleV2ControlValue } from './style-v2'\nimport { TextAreaControlValue, useTextAreaValue } from './text-area'\nimport { TextInputControlValue, useTextInputValue } from './text-input'\nimport { TypographyControlValue, useTypographyValue } from './typography'\n\nexport type ControlDefinitionValue<T extends ControlDefinition> =\n T extends CheckboxControlDefinition\n ? CheckboxControlValue<T>\n : T extends NumberControlDefinition\n ? NumberControlValue<T>\n : T extends TextInputControlDefinition\n ? TextInputControlValue<T>\n : T extends TextAreaControlDefinition\n ? TextAreaControlValue<T>\n : T extends SelectControlDefinition\n ? SelectControlValue<T>\n : T extends ColorControlDefinition\n ? ColorControlValue<T>\n : T extends ImageControlDefinition\n ? ResolveImageControlValue<T>\n : T extends IconRadioGroupControlDefinition\n ? IconRadioGroupControlValue<T>\n : T extends LinkControlDefinition\n ? LinkControlValue<T>\n : T extends ComboboxControlDefinition\n ? ComboboxControlValue<T>\n : T extends ShapeControlDefinition\n ? ShapeControlValue<T>\n : T extends ListControlDefinition\n ? ListControlValue<T>\n : T extends SlotControlDefinition\n ? SlotControlValue\n : T extends RichTextControlDefinition\n ? RichTextControlValue\n : T extends RichTextV2ControlDefinition\n ? RichTextV2ControlValue\n : T extends StyleControlDefinition\n ? StyleControlFormattedValue\n : T extends StyleV2ControlDefinition\n ? StyleV2ControlFormattedValue\n : T extends TypographyControlDefinition\n ? TypographyControlValue\n : never\n\ntype ControlValueProps<T extends ControlDefinition> = {\n definition: T\n data: ControlDefinitionData<T> | undefined\n children(value: ControlDefinitionValue<T>): JSX.Element\n control?: AnyPropController\n}\n\nexport function ControlValue<T extends ControlDefinition>({\n data,\n definition,\n children,\n control,\n}: ControlValueProps<T>): JSX.Element {\n switch (definition.type) {\n case CheckboxControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useCheckboxControlValue}\n parameters={[data as CheckboxControlData, definition]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case NumberControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useNumber}\n parameters={[data as NumberControlData, definition]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case TextInputControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useTextInputValue}\n parameters={[data as TextInputControlData, definition]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case TextAreaControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useTextAreaValue}\n parameters={[data as TextAreaControlData, definition]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case SelectControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useSelectControlValue}\n parameters={[data as SelectControlData, definition]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case ColorControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useColorValue}\n parameters={[data as ColorControlData, definition]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case IconRadioGroupControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useIconRadioGroupValue}\n parameters={[data as IconRadioGroupControlData, definition]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case ImageControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useImageControlValue}\n parameters={[data as ImageControlData, definition]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case LinkControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useLinkControlValue}\n parameters={[data as LinkControlData, definition]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case ComboboxControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useComboboxControlValue}\n parameters={[data as ComboboxControlData]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case ShapeControlType:\n return (\n <ShapeControlValue\n definition={definition}\n data={data as ShapeControlData}\n control={control as ShapeControl}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </ShapeControlValue>\n )\n\n case ListControlType:\n return (\n <ListControlValue\n definition={definition}\n data={data as ListControlData}\n control={control as ListControl}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </ListControlValue>\n )\n\n case StyleV2ControlType:\n return (\n <StyleV2ControlValue\n key={definition.type}\n data={data as StyleV2ControlData}\n definition={definition}\n control={control as StyleV2Control}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </StyleV2ControlValue>\n )\n\n case SlotControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useSlot}\n parameters={[data as unknown as SlotControlData, control as SlotControl]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case RichTextControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useRichText}\n parameters={[data as unknown as RichTextControlData, control as RichTextControl]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case RichTextV2ControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useRichTextV2}\n parameters={[\n data as unknown as RichTextV2ControlData,\n definition,\n control as RichTextV2Control,\n ]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case StyleControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useFormattedStyle}\n parameters={[data as unknown as StyleControlData, definition, control as StyleControl]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case TypographyControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useTypographyValue}\n parameters={[data as unknown as TypographyControlData[number]]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n default:\n return children(data as ControlDefinitionValue<T>)\n }\n}\n"],"mappings":"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","names":["import_icon_radio_group"]}
1
+ {"version":3,"sources":["../../../../../src/runtimes/react/controls/control.tsx"],"sourcesContent":["import {\n CheckboxControlData,\n CheckboxControlDefinition,\n CheckboxControlType,\n NumberControlData,\n NumberControlDefinition,\n NumberControlType,\n TextInputControlData,\n TextInputControlDefinition,\n TextInputControlType,\n TextAreaControlData,\n TextAreaControlDefinition,\n TextAreaControlType,\n} from '@makeswift/controls'\nimport {\n ColorControlData,\n ColorControlDefinition,\n ColorControlType,\n ComboboxControlData,\n ComboboxControlDefinition,\n ComboboxControlType,\n ControlDefinition,\n ControlDefinitionData,\n IconRadioGroupControlData,\n IconRadioGroupControlDefinition,\n IconRadioGroupControlType,\n ImageControlData,\n ImageControlDefinition,\n ImageControlType,\n LinkControlData,\n LinkControlDefinition,\n LinkControlType,\n ListControl,\n ListControlData,\n ListControlDefinition,\n ListControlType,\n RichTextControl,\n RichTextControlData,\n RichTextControlDefinition,\n RichTextControlType,\n RichTextV2Control,\n RichTextV2ControlData,\n RichTextV2ControlDefinition,\n RichTextV2ControlType,\n SelectControlData,\n SelectControlDefinition,\n SelectControlType,\n ShapeControl,\n ShapeControlData,\n ShapeControlDefinition,\n ShapeControlType,\n SlotControl,\n SlotControlData,\n SlotControlDefinition,\n SlotControlType,\n StyleControl,\n StyleControlData,\n StyleControlDefinition,\n StyleControlType,\n StyleV2Control,\n StyleV2ControlData,\n StyleV2ControlDefinition,\n StyleV2ControlType,\n TypographyControlData,\n TypographyControlDefinition,\n TypographyControlType,\n} from '../../../controls'\n\nimport { AnyPropController } from '../../../prop-controllers/instances'\nimport { RenderHook } from '../components'\nimport { CheckboxControlValue, useCheckboxControlValue } from './checkbox'\nimport { ColorControlValue, useColorValue } from './color'\nimport { ComboboxControlValue, useComboboxControlValue } from './combobox'\nimport { IconRadioGroupControlValue, useIconRadioGroupValue } from './icon-radio-group'\nimport { ResolveImageControlValue, useImageControlValue } from './image'\nimport { LinkControlValue, useLinkControlValue } from './link'\nimport { ListControlValue } from './list'\nimport { NumberControlValue, useNumber } from './number'\nimport { RichTextControlValue, useRichText } from './rich-text/rich-text'\nimport { RichTextV2ControlValue, useRichTextV2 } from './rich-text-v2'\nimport { SelectControlValue, useSelectControlValue } from './select'\nimport { ShapeControlValue } from './shape'\nimport { SlotControlValue, useSlot } from './slot'\nimport { StyleControlFormattedValue, useFormattedStyle } from './style'\nimport { StyleV2ControlFormattedValue, StyleV2ControlValue } from './style-v2'\nimport { TextAreaControlValue, useTextAreaValue } from './text-area'\nimport { TextInputControlValue, useTextInputValue } from './text-input'\nimport { TypographyControlValue, useTypographyValue } from './typography'\n\nexport type ControlDefinitionValue<T extends ControlDefinition> =\n T extends CheckboxControlDefinition\n ? CheckboxControlValue<T>\n : T extends NumberControlDefinition\n ? NumberControlValue<T>\n : T extends TextInputControlDefinition\n ? TextInputControlValue<T>\n : T extends TextAreaControlDefinition\n ? TextAreaControlValue<T>\n : T extends SelectControlDefinition\n ? SelectControlValue<T>\n : T extends ColorControlDefinition\n ? ColorControlValue<T>\n : T extends ImageControlDefinition\n ? ResolveImageControlValue<T>\n : T extends IconRadioGroupControlDefinition\n ? IconRadioGroupControlValue<T>\n : T extends LinkControlDefinition\n ? LinkControlValue<T>\n : T extends ComboboxControlDefinition\n ? ComboboxControlValue<T>\n : T extends ShapeControlDefinition\n ? ShapeControlValue<T>\n : T extends ListControlDefinition\n ? ListControlValue<T>\n : T extends SlotControlDefinition\n ? SlotControlValue\n : T extends RichTextControlDefinition\n ? RichTextControlValue\n : T extends RichTextV2ControlDefinition\n ? RichTextV2ControlValue\n : T extends StyleControlDefinition\n ? StyleControlFormattedValue\n : T extends StyleV2ControlDefinition\n ? StyleV2ControlFormattedValue\n : T extends TypographyControlDefinition\n ? TypographyControlValue\n : never\n\ntype ControlValueProps<T extends ControlDefinition> = {\n definition: T\n data: ControlDefinitionData<T> | undefined\n children(value: ControlDefinitionValue<T>): JSX.Element\n control?: AnyPropController\n}\n\nexport function ControlValue<T extends ControlDefinition>({\n data,\n definition,\n children,\n control,\n}: ControlValueProps<T>): JSX.Element {\n switch (definition.type) {\n case CheckboxControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useCheckboxControlValue}\n parameters={[data as CheckboxControlData, definition]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case NumberControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useNumber}\n parameters={[data as NumberControlData, definition]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case TextInputControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useTextInputValue}\n parameters={[data as TextInputControlData, definition]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case TextAreaControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useTextAreaValue}\n parameters={[data as TextAreaControlData, definition]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case SelectControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useSelectControlValue}\n parameters={[data as SelectControlData, definition]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case ColorControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useColorValue}\n parameters={[data as ColorControlData, definition]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case IconRadioGroupControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useIconRadioGroupValue}\n parameters={[data as IconRadioGroupControlData, definition]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case ImageControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useImageControlValue}\n parameters={[data as ImageControlData, definition]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case LinkControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useLinkControlValue}\n parameters={[data as LinkControlData, definition]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case ComboboxControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useComboboxControlValue}\n parameters={[data as ComboboxControlData]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case ShapeControlType:\n return (\n <ShapeControlValue\n definition={definition}\n data={data as ShapeControlData}\n control={control as ShapeControl}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </ShapeControlValue>\n )\n\n case ListControlType:\n return (\n <ListControlValue\n definition={definition}\n data={data as ListControlData}\n control={control as ListControl}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </ListControlValue>\n )\n\n case StyleV2ControlType:\n return (\n <StyleV2ControlValue\n key={definition.type}\n data={data as StyleV2ControlData}\n definition={definition}\n control={control as StyleV2Control}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </StyleV2ControlValue>\n )\n\n case SlotControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useSlot}\n parameters={[data as unknown as SlotControlData, control as SlotControl]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case RichTextControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useRichText}\n parameters={[data as unknown as RichTextControlData, control as RichTextControl]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case RichTextV2ControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useRichTextV2}\n parameters={[\n data as unknown as RichTextV2ControlData,\n definition,\n control as RichTextV2Control,\n ]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case StyleControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useFormattedStyle}\n parameters={[data as unknown as StyleControlData, definition, control as StyleControl]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n case TypographyControlType:\n return (\n <RenderHook\n key={definition.type}\n hook={useTypographyValue}\n parameters={[data as unknown as TypographyControlData[number]]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n\n default:\n return children(data as ControlDefinitionValue<T>)\n }\n}\n"],"mappings":"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","names":["import_controls"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/runtimes/react/controls/icon-radio-group.ts"],"sourcesContent":["import {\n IconRadioGroupControlData,\n IconRadioGroupControlDefinition,\n} from '../../../controls/icon-radio-group'\n\nexport type IconRadioGroupControlValue<T extends IconRadioGroupControlDefinition> =\n undefined extends T['config']['defaultValue']\n ? IconRadioGroupControlData | undefined\n : IconRadioGroupControlData\n\nexport function useIconRadioGroupValue<T extends IconRadioGroupControlDefinition>(\n iconRadioGroupControlData: IconRadioGroupControlData | undefined,\n controlDefinition: T,\n): IconRadioGroupControlValue<T> {\n return (iconRadioGroupControlData ??\n controlDefinition.config.defaultValue) as IconRadioGroupControlValue<T>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,SAAS,uBACd,2BACA,mBAC+B;AAC/B,SAAQ,6BACN,kBAAkB,OAAO;AAC7B;","names":[]}
1
+ {"version":3,"sources":["../../../../../src/runtimes/react/controls/icon-radio-group.ts"],"sourcesContent":["import { IconRadioGroupControlData, IconRadioGroupControlDefinition } from '@makeswift/controls'\n\nexport type IconRadioGroupControlValue<T extends IconRadioGroupControlDefinition> =\n undefined extends T['config']['defaultValue']\n ? IconRadioGroupControlData | undefined\n : IconRadioGroupControlData\n\nexport function useIconRadioGroupValue<T extends IconRadioGroupControlDefinition>(\n iconRadioGroupControlData: IconRadioGroupControlData | undefined,\n controlDefinition: T,\n): IconRadioGroupControlValue<T> {\n return (iconRadioGroupControlData ??\n controlDefinition.config.defaultValue) as IconRadioGroupControlValue<T>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOO,SAAS,uBACd,2BACA,mBAC+B;AAC/B,SAAQ,6BACN,kBAAkB,OAAO;AAC7B;","names":[]}
@@ -22,7 +22,7 @@ __export(number_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(number_exports);
24
24
  var import_ts_pattern = require("ts-pattern");
25
- var import_controls = require("../../../controls");
25
+ var import_controls = require("@makeswift/controls");
26
26
  function useNumber(data, definition) {
27
27
  const value = (0, import_ts_pattern.match)(data).with({ [import_controls.NumberControlDataTypeKey]: import_controls.NumberControlDataTypeValueV1 }, (val) => val.value).otherwise((val) => val) ?? definition.config.defaultValue;
28
28
  return value;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/runtimes/react/controls/number.ts"],"sourcesContent":["import { match } from 'ts-pattern'\nimport {\n NumberControlData,\n NumberControlDataTypeKey,\n NumberControlDataTypeValueV1,\n NumberControlDefinition,\n} from '../../../controls'\n\nexport type NumberControlValue<T extends NumberControlDefinition> =\n undefined extends T['config']['defaultValue'] ? number | undefined : number\n\nexport function useNumber<T extends NumberControlDefinition>(\n data: NumberControlData | undefined,\n definition: T,\n): NumberControlValue<T> {\n const value: number | undefined =\n match(data)\n .with({ [NumberControlDataTypeKey]: NumberControlDataTypeValueV1 }, val => val.value)\n .otherwise(val => val) ?? definition.config.defaultValue\n\n return value as NumberControlValue<T>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAsB;AACtB,sBAKO;AAKA,SAAS,UACd,MACA,YACuB;AACvB,QAAM,YACJ,yBAAM,IAAI,EACP,KAAK,EAAE,CAAC,wCAAwB,GAAG,6CAA6B,GAAG,SAAO,IAAI,KAAK,EACnF,UAAU,SAAO,GAAG,KAAK,WAAW,OAAO;AAEhD,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../../../src/runtimes/react/controls/number.ts"],"sourcesContent":["import { match } from 'ts-pattern'\nimport {\n NumberControlData,\n NumberControlDataTypeKey,\n NumberControlDataTypeValueV1,\n NumberControlDefinition,\n} from '@makeswift/controls'\n\nexport type NumberControlValue<T extends NumberControlDefinition> =\n undefined extends T['config']['defaultValue'] ? number | undefined : number\n\nexport function useNumber<T extends NumberControlDefinition>(\n data: NumberControlData | undefined,\n definition: T,\n): NumberControlValue<T> {\n const value: number | undefined =\n match(data)\n .with({ [NumberControlDataTypeKey]: NumberControlDataTypeValueV1 }, val => val.value)\n .otherwise(val => val) ?? definition.config.defaultValue\n\n return value as NumberControlValue<T>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAsB;AACtB,sBAKO;AAKA,SAAS,UACd,MACA,YACuB;AACvB,QAAM,YACJ,yBAAM,IAAI,EACP,KAAK,EAAE,CAAC,wCAAwB,GAAG,6CAA6B,GAAG,SAAO,IAAI,KAAK,EACnF,UAAU,SAAO,GAAG,KAAK,WAAW,OAAO;AAEhD,SAAO;AACT;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/runtimes/react/controls/style-v2.tsx"],"sourcesContent":["import { StyleV2Control, StyleV2ControlData, StyleV2ControlDefinition } from '../../../controls'\nimport { useStyle } from '../use-style'\nimport {\n findBreakpointOverride,\n getBaseBreakpoint,\n getBreakpointMediaQuery,\n mergeOrCoalesceFallbacks,\n} from '../../../state/modules/breakpoints'\nimport { CSSObject } from '@emotion/css'\n\nimport { ControlDefinitionValue, ControlValue } from './control'\nimport { RenderHook } from '../components'\nimport { DeviceOverride } from '../../../controls/types'\nimport { useBreakpoints } from '../hooks/use-breakpoints'\n\nfunction useStyleControlCssObject(\n styleControlData: StyleV2ControlData,\n controlDefinition: StyleV2ControlDefinition,\n): CSSObject {\n const breakpoints = useBreakpoints()\n\n return {\n ...controlDefinition.config.getStyle(\n findBreakpointOverride(\n breakpoints,\n styleControlData,\n getBaseBreakpoint(breakpoints).id,\n mergeOrCoalesceFallbacks,\n )?.value,\n ),\n ...breakpoints.reduce((styles, breakpoint) => {\n return {\n ...styles,\n [getBreakpointMediaQuery(breakpoint)]: controlDefinition.config.getStyle(\n findBreakpointOverride(\n breakpoints,\n styleControlData,\n breakpoint.id,\n mergeOrCoalesceFallbacks,\n )?.value,\n ),\n }\n }, {}),\n }\n}\n\nexport type StyleV2ControlFormattedValue = string\n\nexport function useFormattedStyleV2<T extends StyleV2ControlDefinition>(\n styleControlData: StyleV2ControlData,\n controlDefinition: T,\n): StyleV2ControlFormattedValue {\n const styles = useStyleControlCssObject(styleControlData, controlDefinition)\n\n return useStyle(styles)\n}\n\ntype StyleV2ControlValueProps<T extends StyleV2ControlDefinition> = {\n definition: T\n data: StyleV2ControlData | undefined\n children(value: string): JSX.Element\n control?: StyleV2Control\n}\n\nexport function StyleV2ControlValue<T extends StyleV2ControlDefinition>({\n definition,\n data,\n children,\n control,\n}: StyleV2ControlValueProps<T>): JSX.Element {\n return (data ?? []).reduceRight(\n (renderFn, deviceOverrideData: DeviceOverride<any>) => responsiveValue => {\n return (\n <ControlValue\n definition={definition.config.type}\n data={deviceOverrideData.value}\n control={control?.control}\n >\n {value => renderFn([{ ...deviceOverrideData, value }, ...responsiveValue])}\n </ControlValue>\n )\n },\n (value: StyleV2ControlData) => {\n return (\n <RenderHook\n key={definition.type}\n hook={useFormattedStyleV2}\n parameters={[value, definition]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n },\n )([])\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyEQ;AAxER,uBAAyB;AACzB,yBAKO;AAGP,qBAAqD;AACrD,wBAA2B;AAE3B,6BAA+B;AAE/B,SAAS,yBACP,kBACA,mBACW;AACX,QAAM,kBAAc,uCAAe;AAEnC,SAAO;AAAA,IACL,GAAG,kBAAkB,OAAO;AAAA,UAC1B;AAAA,QACE;AAAA,QACA;AAAA,YACA,sCAAkB,WAAW,EAAE;AAAA,QAC/B;AAAA,MACF,GAAG;AAAA,IACL;AAAA,IACA,GAAG,YAAY,OAAO,CAAC,QAAQ,eAAe;AAC5C,aAAO;AAAA,QACL,GAAG;AAAA,QACH,KAAC,4CAAwB,UAAU,CAAC,GAAG,kBAAkB,OAAO;AAAA,cAC9D;AAAA,YACE;AAAA,YACA;AAAA,YACA,WAAW;AAAA,YACX;AAAA,UACF,GAAG;AAAA,QACL;AAAA,MACF;AAAA,IACF,GAAG,CAAC,CAAC;AAAA,EACP;AACF;AAIO,SAAS,oBACd,kBACA,mBAC8B;AAC9B,QAAM,SAAS,yBAAyB,kBAAkB,iBAAiB;AAE3E,aAAO,2BAAS,MAAM;AACxB;AASO,SAAS,oBAAwD;AAAA,EACtE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA6C;AAC3C,UAAQ,QAAQ,CAAC,GAAG;AAAA,IAClB,CAAC,UAAU,uBAA4C,qBAAmB;AACxE,aACE;AAAA,QAAC;AAAA;AAAA,UACC,YAAY,WAAW,OAAO;AAAA,UAC9B,MAAM,mBAAmB;AAAA,UACzB,SAAS,SAAS;AAAA,UAEjB,qBAAS,SAAS,CAAC,EAAE,GAAG,oBAAoB,MAAM,GAAG,GAAG,eAAe,CAAC;AAAA;AAAA,MAC3E;AAAA,IAEJ;AAAA,IACA,CAAC,UAA8B;AAC7B,aACE;AAAA,QAAC;AAAA;AAAA,UAEC,MAAM;AAAA,UACN,YAAY,CAAC,OAAO,UAAU;AAAA,UAE7B,WAAAA,WAAS,SAASA,MAAkC;AAAA;AAAA,QAJhD,WAAW;AAAA,MAKlB;AAAA,IAEJ;AAAA,EACF,EAAE,CAAC,CAAC;AACN;","names":["value"]}
1
+ {"version":3,"sources":["../../../../../src/runtimes/react/controls/style-v2.tsx"],"sourcesContent":["import { DeviceOverride } from '@makeswift/controls'\nimport { StyleV2Control, StyleV2ControlData, StyleV2ControlDefinition } from '../../../controls'\nimport { useStyle } from '../use-style'\nimport {\n findBreakpointOverride,\n getBaseBreakpoint,\n getBreakpointMediaQuery,\n mergeOrCoalesceFallbacks,\n} from '../../../state/modules/breakpoints'\nimport { CSSObject } from '@emotion/css'\n\nimport { ControlDefinitionValue, ControlValue } from './control'\nimport { RenderHook } from '../components'\nimport { useBreakpoints } from '../hooks/use-breakpoints'\n\nfunction useStyleControlCssObject(\n styleControlData: StyleV2ControlData,\n controlDefinition: StyleV2ControlDefinition,\n): CSSObject {\n const breakpoints = useBreakpoints()\n\n return {\n ...controlDefinition.config.getStyle(\n findBreakpointOverride(\n breakpoints,\n styleControlData,\n getBaseBreakpoint(breakpoints).id,\n mergeOrCoalesceFallbacks,\n )?.value,\n ),\n ...breakpoints.reduce((styles, breakpoint) => {\n return {\n ...styles,\n [getBreakpointMediaQuery(breakpoint)]: controlDefinition.config.getStyle(\n findBreakpointOverride(\n breakpoints,\n styleControlData,\n breakpoint.id,\n mergeOrCoalesceFallbacks,\n )?.value,\n ),\n }\n }, {}),\n }\n}\n\nexport type StyleV2ControlFormattedValue = string\n\nexport function useFormattedStyleV2<T extends StyleV2ControlDefinition>(\n styleControlData: StyleV2ControlData,\n controlDefinition: T,\n): StyleV2ControlFormattedValue {\n const styles = useStyleControlCssObject(styleControlData, controlDefinition)\n\n return useStyle(styles)\n}\n\ntype StyleV2ControlValueProps<T extends StyleV2ControlDefinition> = {\n definition: T\n data: StyleV2ControlData | undefined\n children(value: string): JSX.Element\n control?: StyleV2Control\n}\n\nexport function StyleV2ControlValue<T extends StyleV2ControlDefinition>({\n definition,\n data,\n children,\n control,\n}: StyleV2ControlValueProps<T>): JSX.Element {\n return (data ?? []).reduceRight(\n (renderFn, deviceOverrideData: DeviceOverride<any>) => responsiveValue => {\n return (\n <ControlValue\n definition={definition.config.type}\n data={deviceOverrideData.value}\n control={control?.control}\n >\n {value => renderFn([{ ...deviceOverrideData, value }, ...responsiveValue])}\n </ControlValue>\n )\n },\n (value: StyleV2ControlData) => {\n return (\n <RenderHook\n key={definition.type}\n hook={useFormattedStyleV2}\n parameters={[value, definition]}\n >\n {value => children(value as ControlDefinitionValue<T>)}\n </RenderHook>\n )\n },\n )([])\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyEQ;AAvER,uBAAyB;AACzB,yBAKO;AAGP,qBAAqD;AACrD,wBAA2B;AAC3B,6BAA+B;AAE/B,SAAS,yBACP,kBACA,mBACW;AACX,QAAM,kBAAc,uCAAe;AAEnC,SAAO;AAAA,IACL,GAAG,kBAAkB,OAAO;AAAA,UAC1B;AAAA,QACE;AAAA,QACA;AAAA,YACA,sCAAkB,WAAW,EAAE;AAAA,QAC/B;AAAA,MACF,GAAG;AAAA,IACL;AAAA,IACA,GAAG,YAAY,OAAO,CAAC,QAAQ,eAAe;AAC5C,aAAO;AAAA,QACL,GAAG;AAAA,QACH,KAAC,4CAAwB,UAAU,CAAC,GAAG,kBAAkB,OAAO;AAAA,cAC9D;AAAA,YACE;AAAA,YACA;AAAA,YACA,WAAW;AAAA,YACX;AAAA,UACF,GAAG;AAAA,QACL;AAAA,MACF;AAAA,IACF,GAAG,CAAC,CAAC;AAAA,EACP;AACF;AAIO,SAAS,oBACd,kBACA,mBAC8B;AAC9B,QAAM,SAAS,yBAAyB,kBAAkB,iBAAiB;AAE3E,aAAO,2BAAS,MAAM;AACxB;AASO,SAAS,oBAAwD;AAAA,EACtE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA6C;AAC3C,UAAQ,QAAQ,CAAC,GAAG;AAAA,IAClB,CAAC,UAAU,uBAA4C,qBAAmB;AACxE,aACE;AAAA,QAAC;AAAA;AAAA,UACC,YAAY,WAAW,OAAO;AAAA,UAC9B,MAAM,mBAAmB;AAAA,UACzB,SAAS,SAAS;AAAA,UAEjB,qBAAS,SAAS,CAAC,EAAE,GAAG,oBAAoB,MAAM,GAAG,GAAG,eAAe,CAAC;AAAA;AAAA,MAC3E;AAAA,IAEJ;AAAA,IACA,CAAC,UAA8B;AAC7B,aACE;AAAA,QAAC;AAAA;AAAA,UAEC,MAAM;AAAA,UACN,YAAY,CAAC,OAAO,UAAU;AAAA,UAE7B,WAAAA,WAAS,SAASA,MAAkC;AAAA;AAAA,QAJhD,WAAW;AAAA,MAKlB;AAAA,IAEJ;AAAA,EACF,EAAE,CAAC,CAAC;AACN;","names":["value"]}
@@ -22,7 +22,7 @@ __export(text_area_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(text_area_exports);
24
24
  var import_ts_pattern = require("ts-pattern");
25
- var import_controls = require("../../../controls");
25
+ var import_controls = require("@makeswift/controls");
26
26
  function useTextAreaValue(data, definition) {
27
27
  const value = (0, import_ts_pattern.match)(data).with({ [import_controls.TextAreaControlDataTypeKey]: import_controls.TextAreaControlDataTypeValueV1 }, (val) => val.value).otherwise((val) => val) ?? definition.config.defaultValue;
28
28
  return value;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/runtimes/react/controls/text-area.ts"],"sourcesContent":["import { match } from 'ts-pattern'\nimport {\n TextAreaControlData,\n TextAreaControlDataTypeKey,\n TextAreaControlDataTypeValueV1,\n TextAreaControlDefinition,\n} from '../../../controls'\n\nexport type TextAreaControlValue<T extends TextAreaControlDefinition> =\n undefined extends T['config']['defaultValue'] ? string | undefined : string\n\nexport function useTextAreaValue<T extends TextAreaControlDefinition>(\n data: TextAreaControlData | undefined,\n definition: T,\n): TextAreaControlValue<T> {\n const value: string | undefined =\n match(data)\n .with({ [TextAreaControlDataTypeKey]: TextAreaControlDataTypeValueV1 }, val => val.value)\n .otherwise(val => val) ?? definition.config.defaultValue\n\n return value as TextAreaControlValue<T>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAsB;AACtB,sBAKO;AAKA,SAAS,iBACd,MACA,YACyB;AACzB,QAAM,YACJ,yBAAM,IAAI,EACP,KAAK,EAAE,CAAC,0CAA0B,GAAG,+CAA+B,GAAG,SAAO,IAAI,KAAK,EACvF,UAAU,SAAO,GAAG,KAAK,WAAW,OAAO;AAEhD,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../../../src/runtimes/react/controls/text-area.ts"],"sourcesContent":["import { match } from 'ts-pattern'\nimport {\n TextAreaControlData,\n TextAreaControlDataTypeKey,\n TextAreaControlDataTypeValueV1,\n TextAreaControlDefinition,\n} from '@makeswift/controls'\n\nexport type TextAreaControlValue<T extends TextAreaControlDefinition> =\n undefined extends T['config']['defaultValue'] ? string | undefined : string\n\nexport function useTextAreaValue<T extends TextAreaControlDefinition>(\n data: TextAreaControlData | undefined,\n definition: T,\n): TextAreaControlValue<T> {\n const value: string | undefined =\n match(data)\n .with({ [TextAreaControlDataTypeKey]: TextAreaControlDataTypeValueV1 }, val => val.value)\n .otherwise(val => val) ?? definition.config.defaultValue\n\n return value as TextAreaControlValue<T>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAsB;AACtB,sBAKO;AAKA,SAAS,iBACd,MACA,YACyB;AACzB,QAAM,YACJ,yBAAM,IAAI,EACP,KAAK,EAAE,CAAC,0CAA0B,GAAG,+CAA+B,GAAG,SAAO,IAAI,KAAK,EACvF,UAAU,SAAO,GAAG,KAAK,WAAW,OAAO;AAEhD,SAAO;AACT;","names":[]}
@@ -22,7 +22,7 @@ __export(text_input_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(text_input_exports);
24
24
  var import_ts_pattern = require("ts-pattern");
25
- var import_controls = require("../../../controls");
25
+ var import_controls = require("@makeswift/controls");
26
26
  function useTextInputValue(data, definition) {
27
27
  const value = (0, import_ts_pattern.match)(data).with({ [import_controls.TextInputControlDataTypeKey]: import_controls.TextInputControlDataTypeValueV1 }, (val) => val.value).otherwise((val) => val) ?? definition.config.defaultValue;
28
28
  return value;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/runtimes/react/controls/text-input.ts"],"sourcesContent":["import { match } from 'ts-pattern'\nimport {\n TextInputControlData,\n TextInputControlDataTypeKey,\n TextInputControlDataTypeValueV1,\n TextInputControlDefinition,\n} from '../../../controls'\n\nexport type TextInputControlValue<T extends TextInputControlDefinition> =\n undefined extends T['config']['defaultValue'] ? string | undefined : string\n\nexport function useTextInputValue<T extends TextInputControlDefinition>(\n data: TextInputControlData | undefined,\n definition: T,\n): TextInputControlValue<T> {\n const value: string | undefined =\n match(data)\n .with({ [TextInputControlDataTypeKey]: TextInputControlDataTypeValueV1 }, val => val.value)\n .otherwise(val => val) ?? definition.config.defaultValue\n\n return value as TextInputControlValue<T>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAsB;AACtB,sBAKO;AAKA,SAAS,kBACd,MACA,YAC0B;AAC1B,QAAM,YACJ,yBAAM,IAAI,EACP,KAAK,EAAE,CAAC,2CAA2B,GAAG,gDAAgC,GAAG,SAAO,IAAI,KAAK,EACzF,UAAU,SAAO,GAAG,KAAK,WAAW,OAAO;AAEhD,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../../../src/runtimes/react/controls/text-input.ts"],"sourcesContent":["import { match } from 'ts-pattern'\nimport {\n TextInputControlData,\n TextInputControlDataTypeKey,\n TextInputControlDataTypeValueV1,\n TextInputControlDefinition,\n} from '@makeswift/controls'\n\nexport type TextInputControlValue<T extends TextInputControlDefinition> =\n undefined extends T['config']['defaultValue'] ? string | undefined : string\n\nexport function useTextInputValue<T extends TextInputControlDefinition>(\n data: TextInputControlData | undefined,\n definition: T,\n): TextInputControlValue<T> {\n const value: string | undefined =\n match(data)\n .with({ [TextInputControlDataTypeKey]: TextInputControlDataTypeValueV1 }, val => val.value)\n .otherwise(val => val) ?? definition.config.defaultValue\n\n return value as TextInputControlValue<T>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAsB;AACtB,sBAKO;AAKA,SAAS,kBACd,MACA,YAC0B;AAC1B,QAAM,YACJ,yBAAM,IAAI,EACP,KAAK,EAAE,CAAC,2CAA2B,GAAG,gDAAgC,GAAG,SAAO,IAAI,KAAK,EACzF,UAAU,SAAO,GAAG,KAAK,WAAW,OAAO;AAEhD,SAAO;AACT;","names":[]}
@@ -36,10 +36,11 @@ __export(controls_exports, {
36
36
  module.exports = __toCommonJS(controls_exports);
37
37
  var import_jsx_runtime = require("react/jsx-runtime");
38
38
  var import_react = require("react");
39
+ var import_controls = require("@makeswift/controls");
39
40
  var ReactPage = __toESM(require("../../state/react-page"));
40
41
  var import_hooks = require("../../components/hooks");
41
42
  var import_responsive_style = require("../../components/utils/responsive-style");
42
- var import_controls = require("../../controls");
43
+ var import_controls2 = require("../../controls");
43
44
  var import_style = require("./controls/style");
44
45
  var import_control = require("./controls/control");
45
46
  var import_components = require("./components");
@@ -47,7 +48,6 @@ var import_slot = require("./controls/slot");
47
48
  var import_use_style = require("./use-style");
48
49
  var import_rich_text = require("./controls/rich-text/rich-text");
49
50
  var import_rich_text_v2 = require("./controls/rich-text-v2");
50
- var import_icon_radio_group = require("../../controls/icon-radio-group");
51
51
  var import_use_store = require("./hooks/use-store");
52
52
  var import_use_document_key = require("./hooks/use-document-key");
53
53
  var import_use_selector = require("./hooks/use-selector");
@@ -109,16 +109,16 @@ function PropsValue({ element, children }) {
109
109
  case import_controls.NumberControlType:
110
110
  case import_controls.TextInputControlType:
111
111
  case import_controls.TextAreaControlType:
112
- case import_controls.SelectControlType:
113
- case import_controls.ColorControlType:
114
- case import_icon_radio_group.IconRadioGroupControlType:
115
- case import_controls.ImageControlType:
116
- case import_controls.ComboboxControlType:
117
- case import_controls.ShapeControlType:
118
- case import_controls.ListControlType:
119
- case import_controls.LinkControlType:
120
- case import_controls.StyleV2ControlType:
121
- case import_controls.TypographyControlType:
112
+ case import_controls2.SelectControlType:
113
+ case import_controls2.ColorControlType:
114
+ case import_controls.IconRadioGroupControlType:
115
+ case import_controls2.ImageControlType:
116
+ case import_controls2.ComboboxControlType:
117
+ case import_controls2.ShapeControlType:
118
+ case import_controls2.ListControlType:
119
+ case import_controls2.LinkControlType:
120
+ case import_controls2.StyleV2ControlType:
121
+ case import_controls2.TypographyControlType:
122
122
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
123
123
  import_control.ControlValue,
124
124
  {
@@ -128,7 +128,7 @@ function PropsValue({ element, children }) {
128
128
  children: (value) => renderFn({ ...propsValue, [propName]: value })
129
129
  }
130
130
  );
131
- case import_controls.StyleControlType: {
131
+ case import_controls2.StyleControlType: {
132
132
  const control = propControllers?.[propName] ?? null;
133
133
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
134
134
  import_components.RenderHook,
@@ -140,7 +140,7 @@ function PropsValue({ element, children }) {
140
140
  descriptor.type
141
141
  );
142
142
  }
143
- case import_controls.RichTextControlType: {
143
+ case import_controls2.RichTextControlType: {
144
144
  const control = propControllers?.[propName] ?? null;
145
145
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
146
146
  import_components.RenderHook,
@@ -152,7 +152,7 @@ function PropsValue({ element, children }) {
152
152
  descriptor.type
153
153
  );
154
154
  }
155
- case import_controls.RichTextV2ControlType: {
155
+ case import_controls2.RichTextV2ControlType: {
156
156
  const control = propControllers?.[propName] ?? null;
157
157
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
158
158
  import_components.RenderHook,
@@ -164,7 +164,7 @@ function PropsValue({ element, children }) {
164
164
  descriptor.type
165
165
  );
166
166
  }
167
- case import_controls.SlotControlType: {
167
+ case import_controls2.SlotControlType: {
168
168
  const control = propControllers?.[propName] ?? null;
169
169
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
170
170
  import_components.RenderHook,