@makeswift/runtime 0.16.0-canary.2 → 0.16.0-canary.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/builder/serialization/control-serialization.js +2 -2
- package/dist/cjs/builder/serialization/control-serialization.js.map +1 -1
- package/dist/cjs/components/builtin/Button/Button.js.map +1 -1
- package/dist/cjs/components/builtin/Button/register.js +1 -1
- package/dist/cjs/components/builtin/Button/register.js.map +1 -1
- package/dist/cjs/components/builtin/Form/Form.js.map +1 -1
- package/dist/cjs/components/builtin/Form/context/FormContext.js.map +1 -1
- package/dist/cjs/components/builtin/Form/register.js +2 -2
- package/dist/cjs/components/builtin/Form/register.js.map +1 -1
- package/dist/cjs/components/builtin/Navigation/Navigation.js.map +1 -1
- package/dist/cjs/components/builtin/Navigation/components/DropDownButton/index.js.map +1 -1
- package/dist/cjs/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.js.map +1 -1
- package/dist/cjs/components/builtin/Navigation/register.js +1 -1
- package/dist/cjs/components/builtin/Navigation/register.js.map +1 -1
- package/dist/cjs/components/builtin/Text/Text.js +4 -3
- package/dist/cjs/components/builtin/Text/Text.js.map +1 -1
- package/dist/cjs/components/hooks/useTextStylePropControllerData.js +34 -0
- package/dist/cjs/components/hooks/useTextStylePropControllerData.js.map +1 -0
- package/dist/cjs/components/utils/responsive-style.js.map +1 -1
- package/dist/cjs/next/api-handler/handlers/manifest.js +1 -1
- package/dist/cjs/prop-controllers/descriptors.js +0 -6
- package/dist/cjs/prop-controllers/descriptors.js.map +1 -1
- package/dist/cjs/prop-controllers/index.js.map +1 -1
- package/dist/cjs/runtimes/react/controls.js +11 -0
- package/dist/cjs/runtimes/react/controls.js.map +1 -1
- package/dist/esm/builder/serialization/control-serialization.js +2 -2
- package/dist/esm/builder/serialization/control-serialization.js.map +1 -1
- package/dist/esm/components/builtin/Button/Button.js.map +1 -1
- package/dist/esm/components/builtin/Button/register.js +2 -2
- package/dist/esm/components/builtin/Button/register.js.map +1 -1
- package/dist/esm/components/builtin/Form/Form.js.map +1 -1
- package/dist/esm/components/builtin/Form/context/FormContext.js.map +1 -1
- package/dist/esm/components/builtin/Form/register.js +3 -2
- package/dist/esm/components/builtin/Form/register.js.map +1 -1
- package/dist/esm/components/builtin/Navigation/Navigation.js.map +1 -1
- package/dist/esm/components/builtin/Navigation/components/DropDownButton/index.js.map +1 -1
- package/dist/esm/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.js.map +1 -1
- package/dist/esm/components/builtin/Navigation/register.js +3 -2
- package/dist/esm/components/builtin/Navigation/register.js.map +1 -1
- package/dist/esm/components/builtin/Text/Text.js +4 -3
- package/dist/esm/components/builtin/Text/Text.js.map +1 -1
- package/dist/esm/components/hooks/useTextStylePropControllerData.js +12 -0
- package/dist/esm/components/hooks/useTextStylePropControllerData.js.map +1 -0
- package/dist/esm/components/utils/responsive-style.js.map +1 -1
- package/dist/esm/next/api-handler/handlers/manifest.js +1 -1
- package/dist/esm/prop-controllers/descriptors.js +0 -5
- package/dist/esm/prop-controllers/descriptors.js.map +1 -1
- package/dist/esm/prop-controllers/index.js.map +1 -1
- package/dist/esm/runtimes/react/controls.js +11 -0
- package/dist/esm/runtimes/react/controls.js.map +1 -1
- package/dist/types/builder/serialization/control-serialization.d.ts +7 -7
- package/dist/types/builder/serialization/control-serialization.d.ts.map +1 -1
- package/dist/types/components/builtin/Button/Button.d.ts +3 -3
- package/dist/types/components/builtin/Button/Button.d.ts.map +1 -1
- package/dist/types/components/builtin/Form/Form.d.ts +4 -4
- package/dist/types/components/builtin/Form/Form.d.ts.map +1 -1
- package/dist/types/components/builtin/Form/context/FormContext.d.ts +2 -3
- package/dist/types/components/builtin/Form/context/FormContext.d.ts.map +1 -1
- package/dist/types/components/builtin/Form/register.d.ts.map +1 -1
- package/dist/types/components/builtin/Navigation/Navigation.d.ts +3 -3
- package/dist/types/components/builtin/Navigation/Navigation.d.ts.map +1 -1
- package/dist/types/components/builtin/Navigation/components/DropDownButton/index.d.ts +2 -3
- package/dist/types/components/builtin/Navigation/components/DropDownButton/index.d.ts.map +1 -1
- package/dist/types/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts +2 -3
- package/dist/types/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts.map +1 -1
- package/dist/types/components/builtin/Navigation/register.d.ts.map +1 -1
- package/dist/types/components/builtin/Text/Text.d.ts +2 -1
- package/dist/types/components/builtin/Text/Text.d.ts.map +1 -1
- package/dist/types/components/hooks/useTextStylePropControllerData.d.ts +3 -0
- package/dist/types/components/hooks/useTextStylePropControllerData.d.ts.map +1 -0
- package/dist/types/components/utils/responsive-style.d.ts +2 -3
- package/dist/types/components/utils/responsive-style.d.ts.map +1 -1
- package/dist/types/next/components/tests/page-text-style-prop-controller.test.d.ts +3 -0
- package/dist/types/next/components/tests/page-text-style-prop-controller.test.d.ts.map +1 -0
- package/dist/types/prop-controllers/descriptors.d.ts +7 -32
- package/dist/types/prop-controllers/descriptors.d.ts.map +1 -1
- package/dist/types/prop-controllers/index.d.ts +1 -1
- package/dist/types/prop-controllers/index.d.ts.map +1 -1
- package/dist/types/runtimes/react/controls.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -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 { Element, Data, MergeTranslatableDataContext } 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, RichTextDTO } 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 getElementChildren,\n getFileIds,\n getPageIds,\n getSwatchIds,\n getTypographyIds,\n} from './introspection'\nimport {\n BorderDescriptor,\n CheckboxDescriptor,\n LinkData,\n LinkDescriptor,\n LinkPropControllerValue,\n Types as PropControllerTypes,\n ColorData as Color,\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} from '@makeswift/prop-controllers'\n\nexport type { Data }\n\n// See https://github.com/microsoft/TypeScript/issues/15300\nexport type IndexSignatureHack<T> = T extends Record<string, any>\n ? { [K in keyof T]: IndexSignatureHack<T[K]> }\n : T\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\ntype TextStyle = {\n fontFamily?: string | null | undefined\n letterSpacing: number | null | undefined\n fontSize: { value: number; unit: 'px' } | null | undefined\n fontWeight: number | null | undefined\n textTransform: 'uppercase'[]\n fontStyle: 'italic'[]\n}\n\nexport const Types = {\n Backgrounds: 'Backgrounds',\n ElementID: 'ElementID',\n GapX: 'GapX',\n GapY: 'GapY',\n Grid: 'Grid',\n Image: 'Image',\n Images: 'Images',\n List: 'List',\n NavigationLinks: 'NavigationLinks',\n ResponsiveIconRadioGroup: 'ResponsiveIconRadioGroup',\n ResponsiveNumber: 'ResponsiveNumber',\n ResponsiveOpacity: 'ResponsiveOpacity',\n ResponsiveSelect: 'ResponsiveSelect',\n RichText: 'RichText',\n Shape: 'Shape',\n SocialLinks: 'SocialLinks',\n TableFormFields: 'TableFormFields',\n Typeahead: 'Typeahead',\n TextArea: 'TextArea',\n TextInput: 'TextInput',\n TextStyle: 'TextStyle',\n Style: StyleControlType,\n} as const\n\ntype ColorBackground = { type: 'color'; id: string; payload: Color | null }\n\ntype GradientStop = { id: string; location: number; color: Color | null }\n\ntype Gradient = { angle?: number; isRadial?: boolean; stops: GradientStop[] }\n\ntype GradientBackground = { type: 'gradient'; id: string; payload: Gradient }\n\ntype BackgroundImagePosition = { x: number; y: number }\n\ntype BackgroundImageSize = 'cover' | 'contain' | 'auto'\n\ntype BackgroundImageRepeat = 'no-repeat' | 'repeat-x' | 'repeat-y' | 'repeat'\n\ntype BackgroundImageV0 = {\n imageId: ImageValueV0\n position: BackgroundImagePosition\n size?: BackgroundImageSize\n repeat?: BackgroundImageRepeat\n opacity?: number\n parallax?: number\n priority?: boolean\n}\n\ntype BackgroundImageV1 = {\n version: 1\n image: ImageValueV1\n position: BackgroundImagePosition\n size?: BackgroundImageSize\n repeat?: BackgroundImageRepeat\n opacity?: number\n parallax?: number\n priority?: boolean\n}\n\nexport type BackgroundImage = BackgroundImageV0 | BackgroundImageV1\n\ntype ImageBackgroundV0 = { type: 'image'; id: string; payload: BackgroundImageV0 }\n\ntype ImageBackgroundV1 = { type: 'image-v1'; id: string; payload: BackgroundImageV1 }\n\nexport type ImageBackground = ImageBackgroundV0 | ImageBackgroundV1\n\ntype BackgroundVideoAspectRatio = 'wide' | 'standard'\n\ntype BackgroundVideo = {\n url?: string\n maskColor?: Color | null\n opacity?: number\n zoom?: number\n aspectRatio?: BackgroundVideoAspectRatio\n parallax?: number\n}\n\ntype VideoBackground = { type: 'video'; id: string; payload: BackgroundVideo }\n\ntype Background = ColorBackground | GradientBackground | ImageBackground | VideoBackground\n\nexport type BackgroundsValue = ResponsiveValue<Background[]>\n\ntype BackgroundsOptions = Options<Record<string, never>>\n\nexport type BackgroundsDescriptor<_T = BackgroundsValue> = {\n type: typeof Types.Backgrounds\n version?: 1\n options: BackgroundsOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Backgrounds(options: BackgroundsOptions = {}): BackgroundsDescriptor {\n return { type: Types.Backgrounds, version: 1, options }\n}\n\nexport type ElementIDValue = string\n\ntype ElementIDOptions = Options<Record<string, never>>\n\ntype ElementIDDescriptor<_T = ElementIDValue> = {\n type: typeof Types.ElementID\n options: ElementIDOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function ElementID(options: ElementIDOptions = {}): ElementIDDescriptor {\n return { type: Types.ElementID, options }\n}\n\nexport type GapXValue = ResponsiveValue<Gap>\n\nexport type GapXOptions = Options<{\n preset?: GapXValue\n label?: string\n defaultValue?: Gap\n min?: number\n max?: number\n step?: number\n hidden?: boolean\n}>\n\nexport type GapXDescriptor<_T = GapXValue> = { type: typeof Types.GapX; options: GapXOptions }\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function GapX(options: GapXOptions = {}): GapXDescriptor {\n return { type: Types.GapX, options }\n}\n\nexport type GapYValue = ResponsiveValue<Gap>\n\nexport type GapYOptions = Options<{\n preset?: GapYValue\n label?: string\n defaultValue?: Gap\n step?: number\n min?: number\n max?: number\n hidden?: boolean\n}>\n\nexport type GapYDescriptor<_T = GapYValue> = { type: typeof Types.GapY; options: GapYOptions }\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function GapY(options: GapYOptions = {}): GapYDescriptor {\n return { type: Types.GapY, options }\n}\n\ntype GridColumn = { count: number; spans: number[][] }\n\nexport type GridValue = { elements: Element[]; columns: ResponsiveValue<GridColumn> }\n\ntype GridOptions = Options<Record<string, never>>\n\ntype GridDescriptor<_T = GridValue> = { type: typeof Types.Grid; options: GridOptions }\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Grid(options: GridOptions = {}): GridDescriptor {\n return { type: Types.Grid, options }\n}\n\nexport function mergeGridPropControllerTranslatedData(\n data: GridValue,\n context: MergeTranslatableDataContext,\n) {\n return {\n ...data,\n elements: data.elements.map(element => context.mergeTranslatedData(element)),\n }\n}\n\nexport type ImageValueV0 = string\n\ntype ImageValueV1MakeswiftFile = {\n version: 1\n type: 'makeswift-file'\n id: string\n}\n\ntype ImageValueV1ExternalFile = {\n version: 1\n type: 'external-file'\n url: string\n width?: number | null\n height?: number | null\n}\n\nexport type ImageValueV1 = ImageValueV1MakeswiftFile | ImageValueV1ExternalFile\n\nexport type ImageValue = ImageValueV0 | ImageValueV1\n\nexport type ImageOptions = Options<{ label?: string; hidden?: boolean }>\n\nexport type ImageDescriptor<_T = ImageValue> = {\n type: typeof Types.Image\n version?: 1\n options: ImageOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Image(options: ImageOptions = {}): ImageDescriptor {\n return { type: Types.Image, version: 1, options }\n}\n\nexport type ImagesValueV0Item = {\n key: string\n props: {\n link?: LinkData\n file?: ImageValueV0\n altText?: string\n }\n}\n\nexport type ImagesValueV1Item = {\n key: string\n version: 1\n props: {\n link?: LinkData\n file?: ImageValueV1\n altText?: string\n }\n}\n\nexport type ImagesValueItem = ImagesValueV0Item | ImagesValueV1Item\n\nexport type ImagesValue = ImagesValueItem[]\n\ntype ImagesOptions = Options<{ preset?: ImagesValue }>\n\nexport type ImagesDescriptor<_T = ImagesValue> = {\n type: typeof Types.Images\n version?: 1\n options: ImagesOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Images(options: ImagesOptions = {}): ImagesDescriptor {\n return { type: Types.Images, version: 1, options }\n}\n\ntype ListValueItem<T extends Data> = { id: string; value?: T }\n\nexport type ListValue<T extends Data = Data> = ListValueItem<T>[]\n\nexport type ListOptions<T extends Data> = {\n type: PanelDescriptor<T>\n label?: string\n getItemLabel?: ((value: T | undefined) => string) | ((value: T | undefined) => Promise<string>)\n preset?: ListValue<T>\n defaultValue?: ListValue<T>\n}\n\nexport type ListDescriptor<T extends ListValue = ListValue> = {\n type: typeof Types.List\n options: ListOptions<T extends ListValue<infer U> ? U : never>\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function List<T extends Data>(options: ListOptions<T>): ListDescriptor<ListValue<T>> {\n return { type: Types.List, options }\n}\n\nexport function introspectListPropControllerData<T>(\n descriptor: ListDescriptor,\n value: ListValue | undefined,\n func: (definition: Descriptor, data: Data) => T[],\n): T[] {\n if (value == null) return []\n\n return value.flatMap(item => (item.value ? func(descriptor.options.type, item.value) : []))\n}\n\nexport function getListPropControllerElementChildren<T>(\n descriptor: ListDescriptor<T extends ListValue<Data> ? T : ListValue<Data>>,\n value: ListValue | undefined,\n) {\n return introspectListPropControllerData(descriptor, value, getElementChildren)\n}\n\nexport function getListPropControllerSwatchIds<T>(\n descriptor: ListDescriptor<T extends ListValue<Data> ? T : ListValue<Data>>,\n value: ListValue | undefined,\n) {\n return introspectListPropControllerData(descriptor, value, getSwatchIds)\n}\n\nexport function getListPropControllerFileIds<T>(\n descriptor: ListDescriptor<T extends ListValue<Data> ? T : ListValue<Data>>,\n value: ListValue | undefined,\n) {\n return introspectListPropControllerData(descriptor, value, getFileIds)\n}\n\nexport function getListPropControllerTypographyIds<T>(\n descriptor: ListDescriptor<T extends ListValue<Data> ? T : ListValue<Data>>,\n value: ListValue | undefined,\n) {\n return introspectListPropControllerData(descriptor, value, getTypographyIds)\n}\n\nexport function getListPropControllerPageIds<T>(\n descriptor: ListDescriptor<T extends ListValue<Data> ? T : ListValue<Data>>,\n value: ListValue | undefined,\n) {\n return introspectListPropControllerData(descriptor, value, getPageIds)\n}\n\ntype ButtonVariant = 'flat' | 'outline' | 'shadow' | 'clear' | 'blocky' | 'bubbly' | 'skewed'\n\ntype ButtonShape = 'pill' | 'rounded' | 'square'\n\ntype ButtonSize = 'small' | 'medium' | 'large'\n\nexport type NavigationButton = {\n id: string\n type: 'button'\n payload: {\n label: string\n link?: LinkData\n variant?: ResponsiveValue<ButtonVariant>\n shape?: ResponsiveValue<ButtonShape>\n size?: ResponsiveValue<ButtonSize>\n textColor?: ResponsiveValue<Color>\n color?: ResponsiveValue<Color>\n textStyle?: ResponsiveValue<TextStyle>\n }\n}\n\ntype NavigationDropdownCaretType = 'caret' | 'plus' | 'arrow-down' | 'chevron-down'\n\ntype NavigationDropdownLink = {\n id: string\n payload: {\n label: string\n link?: LinkData\n color?: ResponsiveValue<Color>\n textStyle?: ResponsiveValue<TextStyle>\n }\n}\n\ntype NavigationDropdown = {\n id: string\n type: 'dropdown'\n payload: {\n label: string\n caret?: NavigationDropdownCaretType\n links?: NavigationDropdownLink[]\n variant?: ResponsiveValue<ButtonVariant>\n shape?: ResponsiveValue<ButtonShape>\n size?: ResponsiveValue<ButtonSize>\n textColor?: ResponsiveValue<Color>\n color?: ResponsiveValue<Color>\n textStyle?: ResponsiveValue<TextStyle>\n }\n}\n\nexport type NavigationLinksValue = (NavigationButton | NavigationDropdown)[]\n\ntype NavigationLinksOptions = Options<Record<string, never>>\n\ntype NavigationLinksDescriptor<_T = NavigationLinksValue> = {\n type: typeof Types.NavigationLinks\n options: NavigationLinksOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function NavigationLinks(options: NavigationLinksOptions = {}): NavigationLinksDescriptor {\n return { type: Types.NavigationLinks, options }\n}\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 type RichTextValue = IndexSignatureHack<RichTextDTO>\n\nexport type RichTextOptions = Options<{ preset?: RichTextValue }>\n\nexport type RichTextDescriptor<_T extends Data = RichTextValue> = {\n type: typeof Types.RichText\n options: RichTextOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function RichText(options: RichTextOptions = {}): RichTextDescriptor {\n return { type: Types.RichText, options }\n}\n\nexport type ShapeValue<T extends Data = Data> = Record<string, T>\n\ntype ShapeOptions<T extends Record<string, PanelDescriptor>> = {\n type: T\n preset?: { [K in keyof T]?: DescriptorValueType<T[K]> }\n}\n\nexport type ShapeDescriptor<\n _T extends Record<string, Data>,\n U extends Record<string, PanelDescriptor>,\n> = {\n type: typeof Types.Shape\n options: ShapeOptions<U>\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Shape<T extends Record<string, PanelDescriptor>>(\n options: ShapeOptions<T>,\n): ShapeDescriptor<{ [K in keyof T]?: DescriptorValueType<T[K]> }, T> {\n return { type: Types.Shape, options }\n}\n\nexport function introspectShapePropControllerData<T>(\n descriptor: ShapeDescriptor<Record<string, Data>, Record<string, PanelDescriptor>>,\n value: ShapeValue | undefined,\n func: (definition: Descriptor, data: Data) => T[],\n): T[] {\n if (value == null) return []\n\n return Object.entries(descriptor.options.type).flatMap(([key, definition]) =>\n func(definition, value[key]),\n )\n}\n\nexport function getShapePropControllerElementChildren(\n descriptor: ShapeDescriptor<Record<string, Data>, Record<string, PanelDescriptor>>,\n value: ShapeValue | undefined,\n): Element[] {\n return introspectShapePropControllerData(descriptor, value, getElementChildren)\n}\n\nexport function getShapePropControllerFileIds(\n descriptor: ShapeDescriptor<Record<string, Data>, Record<string, PanelDescriptor>>,\n value: ShapeValue | undefined,\n): string[] {\n return introspectShapePropControllerData(descriptor, value, getFileIds)\n}\n\nexport function getShapePropControllerTypographyIds(\n descriptor: ShapeDescriptor<Record<string, Data>, Record<string, PanelDescriptor>>,\n value: ShapeValue | undefined,\n): string[] {\n return introspectShapePropControllerData(descriptor, value, getTypographyIds)\n}\n\nexport function getShapePropControllerPageIds(\n descriptor: ShapeDescriptor<Record<string, Data>, Record<string, PanelDescriptor>>,\n value: ShapeValue | undefined,\n): string[] {\n return introspectShapePropControllerData(descriptor, value, getPageIds)\n}\n\nexport function getShapePropControllerSwatchIds(\n descriptor: ShapeDescriptor<Record<string, Data>, Record<string, PanelDescriptor>>,\n value: ShapeValue | undefined,\n): string[] {\n return introspectShapePropControllerData(descriptor, value, getSwatchIds)\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\ntype TableFormField = {\n id: string\n tableColumnId: string\n label?: string\n placeholder?: string\n defaultValue?: string | boolean | string[]\n required?: boolean\n hidden?: boolean\n type?: 'select' | 'radio'\n hideLabel?: boolean\n autofill?: boolean\n}\n\ntype Grid = { count: number; spans: number[][] }\n\nexport type TableFormFieldsValue = { fields: TableFormField[]; grid: ResponsiveValue<Grid> }\n\ntype TableFormFieldsOptions = Options<{ preset?: TableFormFieldsValue }>\n\nexport type TableFormFieldsDescriptor<_T = TableFormFieldsValue> = {\n type: typeof Types.TableFormFields\n options: TableFormFieldsOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function TableFormFields(options: TableFormFieldsOptions = {}): TableFormFieldsDescriptor {\n return { type: Types.TableFormFields, options }\n}\n\nexport type TypeaheadValue<T extends Data = Data> = {\n id: string\n label: string\n value: T\n}\n\nexport type TypeaheadOptions<T extends Data> = {\n getItems: (query: string) => Promise<TypeaheadValue<T>[]>\n label?: string\n preset?: TypeaheadValue<T>\n defaultValue?: TypeaheadValue<T>\n}\n\nexport type TypeaheadDescriptor<T extends TypeaheadValue = TypeaheadValue> = {\n type: typeof Types.Typeahead\n options: TypeaheadOptions<T extends TypeaheadValue<infer U> ? U : never>\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Typeahead<T extends Data>(\n options: TypeaheadOptions<T>,\n): TypeaheadDescriptor<TypeaheadValue<T>> {\n return { type: Types.Typeahead, options }\n}\n\nexport type TextAreaValue = string\n\ntype TextAreaOptions = Options<{ preset?: TextAreaValue; label?: string; rows?: number }>\n\ntype TextAreaDescriptor<_T = TextAreaValue> = {\n type: typeof Types.TextArea\n options: TextAreaOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function TextArea(options: TextAreaOptions = {}): TextAreaDescriptor {\n return { type: Types.TextArea, options }\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 TextStyleValue = ResponsiveValue<TextStyle>\n\nexport type TextStyleOptions = Options<{\n preset?: TextStyleValue\n label?: string\n hidden?: boolean\n}>\n\nexport type TextStyleDescriptor<_T = TextStyleValue> = {\n type: typeof Types.TextStyle\n options: TextStyleOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function TextStyle(options: TextStyleOptions = {}): TextStyleDescriptor {\n return { type: Types.TextStyle, options }\n}\n\nexport type Descriptor<T extends Data = Data> =\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 | ListDescriptor<T extends ListValue ? T : ListValue>\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 | RichTextDescriptor<T>\n | ShadowsDescriptor<T>\n | ShapeDescriptor<T extends ShapeValue ? T : ShapeValue, any>\n | SocialLinksDescriptor<T>\n | TableDescriptor<T>\n | TableFormFieldsDescriptor<T>\n | TypeaheadDescriptor<T extends TypeaheadValue ? T : TypeaheadValue>\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 Types.Backgrounds\n | typeof Types.ResponsiveIconRadioGroup\n | typeof PropControllerTypes.Margin\n | typeof PropControllerTypes.Padding\n | typeof PropControllerTypes.Shadows\n | typeof PropControllerTypes.Border\n | typeof Types.GapY\n | typeof Types.GapX\n | typeof PropControllerTypes.BorderRadius\n | typeof PropControllerTypes.Checkbox\n | typeof Types.TextInput\n | typeof PropControllerTypes.Link\n | typeof Types.List\n | typeof Types.Shape\n | typeof Types.ResponsiveSelect\n | typeof PropControllerTypes.ResponsiveColor\n | typeof Types.TextStyle\n | typeof Types.Images\n | typeof Types.ResponsiveNumber\n | typeof PropControllerTypes.Number\n | typeof PropControllerTypes.Date\n | typeof PropControllerTypes.Font\n | typeof Types.TextArea\n | typeof PropControllerTypes.Table\n | typeof Types.Typeahead\n | typeof Types.RichText\n | typeof Types.Image\n | typeof Types.ResponsiveOpacity\n | typeof Types.SocialLinks\n | typeof PropControllerTypes.Video\n | typeof Types.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.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.Font\n ? ResolveFontPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Font }>>\n : T['type'] extends typeof PropControllerTypes.Link\n ? LinkPropControllerValue\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.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.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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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SAAS,UACd,SACwC;AACxC,SAAO,EAAE,MAAM,MAAM,WAAW,QAAQ;AAC1C;AAeO,SAAS,SAAS,UAA2B,CAAC,GAAuB;AAC1E,SAAO,EAAE,MAAM,MAAM,UAAU,QAAQ;AACzC;AAeO,SAAS,UAAU,UAA4B,CAAC,GAAwB;AAC7E,SAAO,EAAE,MAAM,MAAM,WAAW,QAAQ;AAC1C;AAmBO,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 { ResponsiveColor } from '../runtimes/react/controls'\nimport { StyleControlFormattedValue } from '../runtimes/react/controls/style'\nimport type { Element, Data, MergeTranslatableDataContext } 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, RichTextDTO } 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 getElementChildren,\n getFileIds,\n getPageIds,\n getSwatchIds,\n getTypographyIds,\n} from './introspection'\nimport {\n BorderDescriptor,\n CheckboxDescriptor,\n LinkData,\n LinkDescriptor,\n LinkPropControllerValue,\n Types as PropControllerTypes,\n ColorData as Color,\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 TextStyleData,\n TextStyleDescriptor,\n ResolveTextStylePropControllerValue,\n} from '@makeswift/prop-controllers'\n\nexport type { Data }\n\n// See https://github.com/microsoft/TypeScript/issues/15300\nexport type IndexSignatureHack<T> = T extends Record<string, any>\n ? { [K in keyof T]: IndexSignatureHack<T[K]> }\n : T\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 Backgrounds: 'Backgrounds',\n ElementID: 'ElementID',\n GapX: 'GapX',\n GapY: 'GapY',\n Grid: 'Grid',\n Image: 'Image',\n Images: 'Images',\n List: 'List',\n NavigationLinks: 'NavigationLinks',\n ResponsiveIconRadioGroup: 'ResponsiveIconRadioGroup',\n ResponsiveNumber: 'ResponsiveNumber',\n ResponsiveOpacity: 'ResponsiveOpacity',\n ResponsiveSelect: 'ResponsiveSelect',\n RichText: 'RichText',\n Shape: 'Shape',\n SocialLinks: 'SocialLinks',\n TableFormFields: 'TableFormFields',\n Typeahead: 'Typeahead',\n TextArea: 'TextArea',\n TextInput: 'TextInput',\n Style: StyleControlType,\n} as const\n\ntype ColorBackground = { type: 'color'; id: string; payload: Color | null }\n\ntype GradientStop = { id: string; location: number; color: Color | null }\n\ntype Gradient = { angle?: number; isRadial?: boolean; stops: GradientStop[] }\n\ntype GradientBackground = { type: 'gradient'; id: string; payload: Gradient }\n\ntype BackgroundImagePosition = { x: number; y: number }\n\ntype BackgroundImageSize = 'cover' | 'contain' | 'auto'\n\ntype BackgroundImageRepeat = 'no-repeat' | 'repeat-x' | 'repeat-y' | 'repeat'\n\ntype BackgroundImageV0 = {\n imageId: ImageValueV0\n position: BackgroundImagePosition\n size?: BackgroundImageSize\n repeat?: BackgroundImageRepeat\n opacity?: number\n parallax?: number\n priority?: boolean\n}\n\ntype BackgroundImageV1 = {\n version: 1\n image: ImageValueV1\n position: BackgroundImagePosition\n size?: BackgroundImageSize\n repeat?: BackgroundImageRepeat\n opacity?: number\n parallax?: number\n priority?: boolean\n}\n\nexport type BackgroundImage = BackgroundImageV0 | BackgroundImageV1\n\ntype ImageBackgroundV0 = { type: 'image'; id: string; payload: BackgroundImageV0 }\n\ntype ImageBackgroundV1 = { type: 'image-v1'; id: string; payload: BackgroundImageV1 }\n\nexport type ImageBackground = ImageBackgroundV0 | ImageBackgroundV1\n\ntype BackgroundVideoAspectRatio = 'wide' | 'standard'\n\ntype BackgroundVideo = {\n url?: string\n maskColor?: Color | null\n opacity?: number\n zoom?: number\n aspectRatio?: BackgroundVideoAspectRatio\n parallax?: number\n}\n\ntype VideoBackground = { type: 'video'; id: string; payload: BackgroundVideo }\n\ntype Background = ColorBackground | GradientBackground | ImageBackground | VideoBackground\n\nexport type BackgroundsValue = ResponsiveValue<Background[]>\n\ntype BackgroundsOptions = Options<Record<string, never>>\n\nexport type BackgroundsDescriptor<_T = BackgroundsValue> = {\n type: typeof Types.Backgrounds\n version?: 1\n options: BackgroundsOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Backgrounds(options: BackgroundsOptions = {}): BackgroundsDescriptor {\n return { type: Types.Backgrounds, version: 1, options }\n}\n\nexport type ElementIDValue = string\n\ntype ElementIDOptions = Options<Record<string, never>>\n\ntype ElementIDDescriptor<_T = ElementIDValue> = {\n type: typeof Types.ElementID\n options: ElementIDOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function ElementID(options: ElementIDOptions = {}): ElementIDDescriptor {\n return { type: Types.ElementID, options }\n}\n\nexport type GapXValue = ResponsiveValue<Gap>\n\nexport type GapXOptions = Options<{\n preset?: GapXValue\n label?: string\n defaultValue?: Gap\n min?: number\n max?: number\n step?: number\n hidden?: boolean\n}>\n\nexport type GapXDescriptor<_T = GapXValue> = { type: typeof Types.GapX; options: GapXOptions }\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function GapX(options: GapXOptions = {}): GapXDescriptor {\n return { type: Types.GapX, options }\n}\n\nexport type GapYValue = ResponsiveValue<Gap>\n\nexport type GapYOptions = Options<{\n preset?: GapYValue\n label?: string\n defaultValue?: Gap\n step?: number\n min?: number\n max?: number\n hidden?: boolean\n}>\n\nexport type GapYDescriptor<_T = GapYValue> = { type: typeof Types.GapY; options: GapYOptions }\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function GapY(options: GapYOptions = {}): GapYDescriptor {\n return { type: Types.GapY, options }\n}\n\ntype GridColumn = { count: number; spans: number[][] }\n\nexport type GridValue = { elements: Element[]; columns: ResponsiveValue<GridColumn> }\n\ntype GridOptions = Options<Record<string, never>>\n\ntype GridDescriptor<_T = GridValue> = { type: typeof Types.Grid; options: GridOptions }\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Grid(options: GridOptions = {}): GridDescriptor {\n return { type: Types.Grid, options }\n}\n\nexport function mergeGridPropControllerTranslatedData(\n data: GridValue,\n context: MergeTranslatableDataContext,\n) {\n return {\n ...data,\n elements: data.elements.map(element => context.mergeTranslatedData(element)),\n }\n}\n\nexport type ImageValueV0 = string\n\ntype ImageValueV1MakeswiftFile = {\n version: 1\n type: 'makeswift-file'\n id: string\n}\n\ntype ImageValueV1ExternalFile = {\n version: 1\n type: 'external-file'\n url: string\n width?: number | null\n height?: number | null\n}\n\nexport type ImageValueV1 = ImageValueV1MakeswiftFile | ImageValueV1ExternalFile\n\nexport type ImageValue = ImageValueV0 | ImageValueV1\n\nexport type ImageOptions = Options<{ label?: string; hidden?: boolean }>\n\nexport type ImageDescriptor<_T = ImageValue> = {\n type: typeof Types.Image\n version?: 1\n options: ImageOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Image(options: ImageOptions = {}): ImageDescriptor {\n return { type: Types.Image, version: 1, options }\n}\n\nexport type ImagesValueV0Item = {\n key: string\n props: {\n link?: LinkData\n file?: ImageValueV0\n altText?: string\n }\n}\n\nexport type ImagesValueV1Item = {\n key: string\n version: 1\n props: {\n link?: LinkData\n file?: ImageValueV1\n altText?: string\n }\n}\n\nexport type ImagesValueItem = ImagesValueV0Item | ImagesValueV1Item\n\nexport type ImagesValue = ImagesValueItem[]\n\ntype ImagesOptions = Options<{ preset?: ImagesValue }>\n\nexport type ImagesDescriptor<_T = ImagesValue> = {\n type: typeof Types.Images\n version?: 1\n options: ImagesOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Images(options: ImagesOptions = {}): ImagesDescriptor {\n return { type: Types.Images, version: 1, options }\n}\n\ntype ListValueItem<T extends Data> = { id: string; value?: T }\n\nexport type ListValue<T extends Data = Data> = ListValueItem<T>[]\n\nexport type ListOptions<T extends Data> = {\n type: PanelDescriptor<T>\n label?: string\n getItemLabel?: ((value: T | undefined) => string) | ((value: T | undefined) => Promise<string>)\n preset?: ListValue<T>\n defaultValue?: ListValue<T>\n}\n\nexport type ListDescriptor<T extends ListValue = ListValue> = {\n type: typeof Types.List\n options: ListOptions<T extends ListValue<infer U> ? U : never>\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function List<T extends Data>(options: ListOptions<T>): ListDescriptor<ListValue<T>> {\n return { type: Types.List, options }\n}\n\nexport function introspectListPropControllerData<T>(\n descriptor: ListDescriptor,\n value: ListValue | undefined,\n func: (definition: Descriptor, data: Data) => T[],\n): T[] {\n if (value == null) return []\n\n return value.flatMap(item => (item.value ? func(descriptor.options.type, item.value) : []))\n}\n\nexport function getListPropControllerElementChildren<T>(\n descriptor: ListDescriptor<T extends ListValue<Data> ? T : ListValue<Data>>,\n value: ListValue | undefined,\n) {\n return introspectListPropControllerData(descriptor, value, getElementChildren)\n}\n\nexport function getListPropControllerSwatchIds<T>(\n descriptor: ListDescriptor<T extends ListValue<Data> ? T : ListValue<Data>>,\n value: ListValue | undefined,\n) {\n return introspectListPropControllerData(descriptor, value, getSwatchIds)\n}\n\nexport function getListPropControllerFileIds<T>(\n descriptor: ListDescriptor<T extends ListValue<Data> ? T : ListValue<Data>>,\n value: ListValue | undefined,\n) {\n return introspectListPropControllerData(descriptor, value, getFileIds)\n}\n\nexport function getListPropControllerTypographyIds<T>(\n descriptor: ListDescriptor<T extends ListValue<Data> ? T : ListValue<Data>>,\n value: ListValue | undefined,\n) {\n return introspectListPropControllerData(descriptor, value, getTypographyIds)\n}\n\nexport function getListPropControllerPageIds<T>(\n descriptor: ListDescriptor<T extends ListValue<Data> ? T : ListValue<Data>>,\n value: ListValue | undefined,\n) {\n return introspectListPropControllerData(descriptor, value, getPageIds)\n}\n\ntype ButtonVariant = 'flat' | 'outline' | 'shadow' | 'clear' | 'blocky' | 'bubbly' | 'skewed'\n\ntype ButtonShape = 'pill' | 'rounded' | 'square'\n\ntype ButtonSize = 'small' | 'medium' | 'large'\n\nexport type NavigationButton = {\n id: string\n type: 'button'\n payload: {\n label: string\n link?: LinkData\n variant?: ResponsiveValue<ButtonVariant>\n shape?: ResponsiveValue<ButtonShape>\n size?: ResponsiveValue<ButtonSize>\n textColor?: ResponsiveValue<Color>\n color?: ResponsiveValue<Color>\n textStyle?: ResponsiveValue<TextStyleData>\n }\n}\n\ntype NavigationDropdownCaretType = 'caret' | 'plus' | 'arrow-down' | 'chevron-down'\n\ntype NavigationDropdownLink = {\n id: string\n payload: {\n label: string\n link?: LinkData\n color?: ResponsiveValue<Color>\n textStyle?: ResponsiveValue<TextStyleData>\n }\n}\n\ntype NavigationDropdown = {\n id: string\n type: 'dropdown'\n payload: {\n label: string\n caret?: NavigationDropdownCaretType\n links?: NavigationDropdownLink[]\n variant?: ResponsiveValue<ButtonVariant>\n shape?: ResponsiveValue<ButtonShape>\n size?: ResponsiveValue<ButtonSize>\n textColor?: ResponsiveValue<Color>\n color?: ResponsiveValue<Color>\n textStyle?: ResponsiveValue<TextStyleData>\n }\n}\n\nexport type NavigationLinksValue = (NavigationButton | NavigationDropdown)[]\n\ntype NavigationLinksOptions = Options<Record<string, never>>\n\ntype NavigationLinksDescriptor<_T = NavigationLinksValue> = {\n type: typeof Types.NavigationLinks\n options: NavigationLinksOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function NavigationLinks(options: NavigationLinksOptions = {}): NavigationLinksDescriptor {\n return { type: Types.NavigationLinks, options }\n}\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 type RichTextValue = IndexSignatureHack<RichTextDTO>\n\nexport type RichTextOptions = Options<{ preset?: RichTextValue }>\n\nexport type RichTextDescriptor<_T extends Data = RichTextValue> = {\n type: typeof Types.RichText\n options: RichTextOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function RichText(options: RichTextOptions = {}): RichTextDescriptor {\n return { type: Types.RichText, options }\n}\n\nexport type ShapeValue<T extends Data = Data> = Record<string, T>\n\ntype ShapeOptions<T extends Record<string, PanelDescriptor>> = {\n type: T\n preset?: { [K in keyof T]?: DescriptorValueType<T[K]> }\n}\n\nexport type ShapeDescriptor<\n _T extends Record<string, Data>,\n U extends Record<string, PanelDescriptor>,\n> = {\n type: typeof Types.Shape\n options: ShapeOptions<U>\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Shape<T extends Record<string, PanelDescriptor>>(\n options: ShapeOptions<T>,\n): ShapeDescriptor<{ [K in keyof T]?: DescriptorValueType<T[K]> }, T> {\n return { type: Types.Shape, options }\n}\n\nexport function introspectShapePropControllerData<T>(\n descriptor: ShapeDescriptor<Record<string, Data>, Record<string, PanelDescriptor>>,\n value: ShapeValue | undefined,\n func: (definition: Descriptor, data: Data) => T[],\n): T[] {\n if (value == null) return []\n\n return Object.entries(descriptor.options.type).flatMap(([key, definition]) =>\n func(definition, value[key]),\n )\n}\n\nexport function getShapePropControllerElementChildren(\n descriptor: ShapeDescriptor<Record<string, Data>, Record<string, PanelDescriptor>>,\n value: ShapeValue | undefined,\n): Element[] {\n return introspectShapePropControllerData(descriptor, value, getElementChildren)\n}\n\nexport function getShapePropControllerFileIds(\n descriptor: ShapeDescriptor<Record<string, Data>, Record<string, PanelDescriptor>>,\n value: ShapeValue | undefined,\n): string[] {\n return introspectShapePropControllerData(descriptor, value, getFileIds)\n}\n\nexport function getShapePropControllerTypographyIds(\n descriptor: ShapeDescriptor<Record<string, Data>, Record<string, PanelDescriptor>>,\n value: ShapeValue | undefined,\n): string[] {\n return introspectShapePropControllerData(descriptor, value, getTypographyIds)\n}\n\nexport function getShapePropControllerPageIds(\n descriptor: ShapeDescriptor<Record<string, Data>, Record<string, PanelDescriptor>>,\n value: ShapeValue | undefined,\n): string[] {\n return introspectShapePropControllerData(descriptor, value, getPageIds)\n}\n\nexport function getShapePropControllerSwatchIds(\n descriptor: ShapeDescriptor<Record<string, Data>, Record<string, PanelDescriptor>>,\n value: ShapeValue | undefined,\n): string[] {\n return introspectShapePropControllerData(descriptor, value, getSwatchIds)\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\ntype TableFormField = {\n id: string\n tableColumnId: string\n label?: string\n placeholder?: string\n defaultValue?: string | boolean | string[]\n required?: boolean\n hidden?: boolean\n type?: 'select' | 'radio'\n hideLabel?: boolean\n autofill?: boolean\n}\n\ntype Grid = { count: number; spans: number[][] }\n\nexport type TableFormFieldsValue = { fields: TableFormField[]; grid: ResponsiveValue<Grid> }\n\ntype TableFormFieldsOptions = Options<{ preset?: TableFormFieldsValue }>\n\nexport type TableFormFieldsDescriptor<_T = TableFormFieldsValue> = {\n type: typeof Types.TableFormFields\n options: TableFormFieldsOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function TableFormFields(options: TableFormFieldsOptions = {}): TableFormFieldsDescriptor {\n return { type: Types.TableFormFields, options }\n}\n\nexport type TypeaheadValue<T extends Data = Data> = {\n id: string\n label: string\n value: T\n}\n\nexport type TypeaheadOptions<T extends Data> = {\n getItems: (query: string) => Promise<TypeaheadValue<T>[]>\n label?: string\n preset?: TypeaheadValue<T>\n defaultValue?: TypeaheadValue<T>\n}\n\nexport type TypeaheadDescriptor<T extends TypeaheadValue = TypeaheadValue> = {\n type: typeof Types.Typeahead\n options: TypeaheadOptions<T extends TypeaheadValue<infer U> ? U : never>\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Typeahead<T extends Data>(\n options: TypeaheadOptions<T>,\n): TypeaheadDescriptor<TypeaheadValue<T>> {\n return { type: Types.Typeahead, options }\n}\n\nexport type TextAreaValue = string\n\ntype TextAreaOptions = Options<{ preset?: TextAreaValue; label?: string; rows?: number }>\n\ntype TextAreaDescriptor<_T = TextAreaValue> = {\n type: typeof Types.TextArea\n options: TextAreaOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function TextArea(options: TextAreaOptions = {}): TextAreaDescriptor {\n return { type: Types.TextArea, options }\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 | 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 | ListDescriptor<T extends ListValue ? T : ListValue>\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 | RichTextDescriptor<T>\n | ShadowsDescriptor<T>\n | ShapeDescriptor<T extends ShapeValue ? T : ShapeValue, any>\n | SocialLinksDescriptor<T>\n | TableDescriptor<T>\n | TableFormFieldsDescriptor<T>\n | TypeaheadDescriptor<T extends TypeaheadValue ? T : TypeaheadValue>\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 Types.Backgrounds\n | typeof Types.ResponsiveIconRadioGroup\n | typeof PropControllerTypes.Margin\n | typeof PropControllerTypes.Padding\n | typeof PropControllerTypes.Shadows\n | typeof PropControllerTypes.Border\n | typeof Types.GapY\n | typeof Types.GapX\n | typeof PropControllerTypes.BorderRadius\n | typeof PropControllerTypes.Checkbox\n | typeof Types.TextInput\n | typeof PropControllerTypes.Link\n | typeof Types.List\n | typeof Types.Shape\n | typeof Types.ResponsiveSelect\n | typeof PropControllerTypes.ResponsiveColor\n | typeof PropControllerTypes.TextStyle\n | typeof Types.Images\n | typeof Types.ResponsiveNumber\n | typeof PropControllerTypes.Number\n | typeof PropControllerTypes.Date\n | typeof PropControllerTypes.Font\n | typeof Types.TextArea\n | typeof PropControllerTypes.Table\n | typeof Types.Typeahead\n | typeof Types.RichText\n | typeof Types.Image\n | typeof Types.ResponsiveOpacity\n | typeof Types.SocialLinks\n | typeof PropControllerTypes.Video\n | typeof Types.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.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.Font\n ? ResolveFontPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Font }>>\n : T['type'] extends typeof PropControllerTypes.Link\n ? LinkPropControllerValue\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.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.TextStyle\n ? ResolveTextStylePropControllerValue<Extract<T, { type: typeof PropControllerTypes.TextStyle }>>\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,IAAAA,gBAAiC;AAoCjC,2BAMO;AAkFA,MAAM,QAAQ;AAAA,EACnB,aAAa;AAAA,EACb,WAAW;AAAA,EACX,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,iBAAiB;AAAA,EACjB,0BAA0B;AAAA,EAC1B,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,UAAU;AAAA,EACV,OAAO;AAAA,EACP,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX,UAAU;AAAA,EACV,WAAW;AAAA,EACX,OAAO;AACT;AA0EO,SAAS,YAAY,UAA8B,CAAC,GAA0B;AACnF,SAAO,EAAE,MAAM,MAAM,aAAa,SAAS,GAAG,QAAQ;AACxD;AAeO,SAAS,UAAU,UAA4B,CAAC,GAAwB;AAC7E,SAAO,EAAE,MAAM,MAAM,WAAW,QAAQ;AAC1C;AAoBO,SAAS,KAAK,UAAuB,CAAC,GAAmB;AAC9D,SAA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A,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;AA8BO,SAAS,gBAAgB,UAAkC,CAAC,GAA8B;AAC/F,SAAO,EAAE,MAAM,MAAM,iBAAiB,QAAQ;AAChD;AAwBO,SAAS,UACd,SACwC;AACxC,SAAO,EAAE,MAAM,MAAM,WAAW,QAAQ;AAC1C;AAeO,SAAS,SAAS,UAA2B,CAAC,GAAuB;AAC1E,SAAO,EAAE,MAAM,MAAM,UAAU,QAAQ;AACzC;AAeO,SAAS,UAAU,UAA4B,CAAC,GAAwB;AAC7E,SAAO,EAAE,MAAM,MAAM,WAAW,QAAQ;AAC1C;","names":["import_style"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/prop-controllers/index.ts"],"sourcesContent":["export type {\n Data,\n Descriptor as PropControllerDescriptor,\n DescriptorValueType as PropControllerDescriptorValueType,\n Gap,\n GapXDescriptor,\n GapXOptions,\n GapXValue,\n GapYDescriptor,\n GapYOptions,\n GapYValue,\n ResponsiveNumberDescriptor,\n ResponsiveNumberOptions,\n ResponsiveNumberValue,\n ResponsiveIconRadioGroupDescriptor,\n ResponsiveIconRadioGroupValue,\n ResponsiveSelectDescriptor,\n ResponsiveSelectValue,\n ImageDescriptor,\n ImageValue,\n ImageValueV0,\n ImageValueV1,\n ImagesDescriptor,\n ImagesValueV0Item,\n ImagesValueV1Item,\n ImagesValueItem,\n ImagesValue,\n ImageBackground,\n BackgroundsDescriptor,\n BackgroundImage,\n ListDescriptor,\n ListValue,\n ListOptions,\n RichTextDescriptor,\n RichTextValue,\n ShapeDescriptor,\n ShapeValue,\n TextInputDescriptor,\n TextInputValue,\n
|
|
1
|
+
{"version":3,"sources":["../../../src/prop-controllers/index.ts"],"sourcesContent":["export type {\n Data,\n Descriptor as PropControllerDescriptor,\n DescriptorValueType as PropControllerDescriptorValueType,\n Gap,\n GapXDescriptor,\n GapXOptions,\n GapXValue,\n GapYDescriptor,\n GapYOptions,\n GapYValue,\n ResponsiveNumberDescriptor,\n ResponsiveNumberOptions,\n ResponsiveNumberValue,\n ResponsiveIconRadioGroupDescriptor,\n ResponsiveIconRadioGroupValue,\n ResponsiveSelectDescriptor,\n ResponsiveSelectValue,\n ImageDescriptor,\n ImageValue,\n ImageValueV0,\n ImageValueV1,\n ImagesDescriptor,\n ImagesValueV0Item,\n ImagesValueV1Item,\n ImagesValueItem,\n ImagesValue,\n ImageBackground,\n BackgroundsDescriptor,\n BackgroundImage,\n ListDescriptor,\n ListValue,\n ListOptions,\n RichTextDescriptor,\n RichTextValue,\n ShapeDescriptor,\n ShapeValue,\n TextInputDescriptor,\n TextInputValue,\n TypeaheadDescriptor,\n TypeaheadValue,\n TypeaheadOptions,\n PanelDescriptor,\n PanelDescriptorType,\n PanelDescriptorValueType,\n SocialLinksDescriptor,\n SocialLinksValue,\n} from './descriptors'\nexport type {\n ResponsiveValueType,\n Device,\n DeviceOverride,\n ResponsiveValue,\n} from '@makeswift/prop-controllers'\nexport { socialLinkTypesV0, socialLinkTypesV1 } from './descriptors'\nexport * as Props from './descriptors'\nexport type {\n PropControllerMessage,\n RichTextPropControllerMessage,\n TableFormFieldsMessage,\n} from './instances'\nexport { RichTextPropControllerMessageType, TableFormFieldsMessageType } from './instances'\nexport * as Introspection from './introspection'\nexport { copy as imageCopy } from './copy/image'\nexport { copy as imagesCopy } from './copy/images'\nexport { copy as backgroundsCopy } from './copy/backgrounds'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsDA,yBAAqD;AACrD,YAAuB;AAMvB,uBAA8E;AAC9E,oBAA+B;AAC/B,mBAAkC;AAClC,oBAAmC;AACnC,yBAAwC;","names":[]}
|
|
@@ -55,6 +55,7 @@ var import_prop_controllers = require("@makeswift/prop-controllers");
|
|
|
55
55
|
var import_useResponsiveLengthPropControllerData = require("../../components/hooks/useResponsiveLengthPropControllerData");
|
|
56
56
|
var import_useNumberPropControllerData = require("../../components/hooks/useNumberPropControllerData");
|
|
57
57
|
var import_useResponsiveColorPropControllerData = require("../../components/hooks/useResponsiveColorPropControllerData");
|
|
58
|
+
var import_useTextStylePropControllerData = require("../../components/hooks/useTextStylePropControllerData");
|
|
58
59
|
function useWidthStyle(data, descriptor) {
|
|
59
60
|
const value = (0, import_prop_controllers.getWidthPropControllerDataResponsiveLengthData)(data);
|
|
60
61
|
return (0, import_use_style.useStyle)((0, import_responsive_style.useResponsiveWidth)(value, descriptor.options.defaultValue));
|
|
@@ -349,6 +350,16 @@ function PropsValue({ element, children }) {
|
|
|
349
350
|
},
|
|
350
351
|
descriptor.type
|
|
351
352
|
);
|
|
353
|
+
case import_prop_controllers.Types.TextStyle:
|
|
354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
355
|
+
import_components.RenderHook,
|
|
356
|
+
{
|
|
357
|
+
hook: import_useTextStylePropControllerData.useTextStylePropControllerData,
|
|
358
|
+
parameters: [props[propName]],
|
|
359
|
+
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
360
|
+
},
|
|
361
|
+
descriptor.type
|
|
362
|
+
);
|
|
352
363
|
default:
|
|
353
364
|
return renderFn({ ...propsValue, [propName]: props[propName] });
|
|
354
365
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/runtimes/react/controls.tsx"],"sourcesContent":["import { useRef } from 'react'\n\nimport * as ReactPage from '../../state/react-page'\n\nimport {\n useBoxShadow,\n useBorder as useBorderData,\n useLinkPropControllerData,\n useCheckboxPropControllerData,\n useDatePropControllerData,\n useFontPropControllerData,\n useVideoPropControllerData,\n useTablePropControllerData,\n} from '../../components/hooks'\nimport type { ColorValue } from '../../components/utils/types'\nimport {\n useResponsiveBorder,\n useResponsiveBorderRadius,\n useResponsiveMargin,\n useResponsivePadding,\n useResponsiveShadow,\n useResponsiveWidth,\n} from '../../components/utils/responsive-style'\nimport {\n CheckboxControlType,\n ColorControlType,\n ComboboxControlType,\n ImageControlType,\n LinkControlType,\n ListControlType,\n NumberControlType,\n SelectControlType,\n ShapeControlType,\n SlotControl,\n SlotControlType,\n StyleControlType,\n TextAreaControlType,\n TextInputControlType,\n RichTextControl,\n RichTextControlType,\n StyleControl,\n RichTextV2Control,\n RichTextV2ControlType,\n StyleV2ControlType,\n TypographyControlType,\n} from '../../controls'\nimport { useFormattedStyle } from './controls/style'\nimport { ControlValue } from './controls/control'\nimport { RenderHook } from './components'\nimport { useSlot } from './controls/slot'\nimport { useStyle } from './use-style'\nimport { useRichText } from './controls/rich-text/rich-text'\nimport { useRichTextV2 } from './controls/rich-text-v2'\nimport { IconRadioGroupControlType } from '../../controls/icon-radio-group'\nimport { useStore } from './hooks/use-store'\nimport { useDocumentKey } from './hooks/use-document-key'\nimport { useSelector } from './hooks/use-selector'\nimport {\n Types as PropControllerTypes,\n getShadowsPropControllerDataResponsiveShadowsData,\n ShadowsPropControllerData,\n Shadows,\n ResponsiveValue,\n BorderPropControllerFormat,\n ResponsiveBorderData,\n BorderPropControllerData,\n getBorderPropControllerDataResponsiveBorderData,\n getBorderRadiusPropControllerDataResponsiveBorderRadiusData,\n BorderRadiusPropControllerData,\n BorderRadiusPropControllerFormat,\n MarginPropControllerFormat,\n MarginPropControllerData,\n getMarginPropControllerDataResponsiveMarginData,\n PaddingPropControllerData,\n getPaddingPropControllerDataResponsivePaddingData,\n PaddingPropControllerFormat,\n WidthPropControllerData,\n getWidthPropControllerDataResponsiveLengthData,\n WidthPropControllerFormat,\n WidthDescriptor,\n} from '@makeswift/prop-controllers'\nimport { useResponsiveLengthPropControllerData } from '../../components/hooks/useResponsiveLengthPropControllerData'\nimport { useNumberPropControllerData } from '../../components/hooks/useNumberPropControllerData'\nimport { useResponsiveColorPropControllerData } from '../../components/hooks/useResponsiveColorPropControllerData'\n\nexport type ResponsiveColor = ResponsiveValue<ColorValue>\n\nfunction useWidthStyle(\n data: WidthPropControllerData | undefined,\n descriptor: WidthDescriptor,\n): string {\n const value = getWidthPropControllerDataResponsiveLengthData(data)\n\n return useStyle(useResponsiveWidth(value, descriptor.options.defaultValue))\n}\n\nfunction usePaddingStyle(data: PaddingPropControllerData | undefined): string {\n const value = getPaddingPropControllerDataResponsivePaddingData(data)\n\n return useStyle(useResponsivePadding(value))\n}\n\nfunction useMarginStyle(data: MarginPropControllerData | undefined): string {\n const value = getMarginPropControllerDataResponsiveMarginData(data)\n\n return useStyle(useResponsiveMargin(value))\n}\n\nexport function useBorderRadiusStyle(data: BorderRadiusPropControllerData | undefined): string {\n const value = getBorderRadiusPropControllerDataResponsiveBorderRadiusData(data)\n\n return useStyle(useResponsiveBorderRadius(value))\n}\n\nexport function useShadowsStyle(data: ShadowsPropControllerData | undefined): string {\n return useStyle(useResponsiveShadow(useBoxShadow(data) ?? undefined))\n}\n\nexport function useBorderStyle(\n data: BorderPropControllerData | undefined,\n): string | ResponsiveBorderData | undefined {\n const value = getBorderPropControllerDataResponsiveBorderData(data)\n const borderData = useBorderData(value)\n\n return useStyle(useResponsiveBorder(borderData ?? undefined))\n}\n\ntype PropsValueProps = {\n element: ReactPage.ElementData\n children(props: Record<string, unknown>): JSX.Element\n}\n\nexport function PropsValue({ element, children }: PropsValueProps): JSX.Element {\n const store = useStore()\n const propControllerDescriptorsRef = useRef(\n ReactPage.getComponentPropControllerDescriptors(store.getState(), element.type) ?? {},\n )\n const props = element.props as Record<string, any>\n const documentKey = useDocumentKey()\n\n const propControllers = useSelector(state => {\n if (documentKey == null) return null\n\n return ReactPage.getPropControllers(state, documentKey, element.key)\n })\n\n return Object.entries(propControllerDescriptorsRef.current).reduceRight(\n (renderFn, [propName, descriptor]) =>\n propsValue => {\n switch (descriptor.type) {\n case CheckboxControlType:\n case NumberControlType:\n case TextInputControlType:\n case TextAreaControlType:\n case SelectControlType:\n case ColorControlType:\n case IconRadioGroupControlType:\n case ImageControlType:\n case ComboboxControlType:\n case ShapeControlType:\n case ListControlType:\n case LinkControlType:\n case StyleV2ControlType:\n case TypographyControlType:\n return (\n <ControlValue\n definition={descriptor}\n data={props[propName]}\n control={propControllers?.[propName]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </ControlValue>\n )\n\n case StyleControlType: {\n const control = (propControllers?.[propName] ?? null) as StyleControl | null\n\n return (\n <RenderHook\n key={descriptor.type}\n hook={useFormattedStyle}\n parameters={[props[propName], descriptor, control]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n }\n\n case RichTextControlType: {\n const control = (propControllers?.[propName] ?? null) as RichTextControl | null\n\n return (\n <RenderHook\n key={descriptor.type}\n hook={useRichText}\n parameters={[props[propName], control]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n }\n\n case RichTextV2ControlType: {\n const control = (propControllers?.[propName] ?? null) as RichTextV2Control | null\n\n return (\n <RenderHook\n key={descriptor.type}\n hook={useRichTextV2}\n parameters={[props[propName], descriptor, control]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n }\n\n case SlotControlType: {\n const control = (propControllers?.[propName] ?? null) as SlotControl | null\n\n return (\n <RenderHook\n key={descriptor.type}\n hook={useSlot}\n parameters={[props[propName], control]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n }\n\n case PropControllerTypes.Width:\n switch (descriptor.options.format) {\n case WidthPropControllerFormat.ClassName:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useWidthStyle}\n parameters={[props[propName], descriptor]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n default:\n return renderFn({ ...propsValue, [propName]: props[propName] })\n }\n\n case PropControllerTypes.Padding:\n switch (descriptor.options.format) {\n case PaddingPropControllerFormat.ClassName:\n return (\n <RenderHook\n key={descriptor.type}\n hook={usePaddingStyle}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n default:\n return renderFn({ ...propsValue, [propName]: props[propName] })\n }\n\n case PropControllerTypes.Margin:\n switch (descriptor.options.format) {\n case MarginPropControllerFormat.ClassName:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useMarginStyle}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n default:\n return renderFn({ ...propsValue, [propName]: props[propName] })\n }\n\n case PropControllerTypes.BorderRadius:\n switch (descriptor.options.format) {\n case BorderRadiusPropControllerFormat.ClassName:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useBorderRadiusStyle}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n default:\n return renderFn({ ...propsValue, [propName]: props[propName] })\n }\n\n case PropControllerTypes.Number:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useNumberPropControllerData}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n case PropControllerTypes.ResponsiveLength:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useResponsiveLengthPropControllerData}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n case PropControllerTypes.Shadows:\n switch (descriptor.options.format) {\n case Shadows.Format.ClassName:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useShadowsStyle}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n case Shadows.Format.ResponsiveValue:\n default:\n return renderFn({\n ...propsValue,\n [propName]: getShadowsPropControllerDataResponsiveShadowsData(props[propName]),\n })\n }\n\n case PropControllerTypes.Border:\n switch (descriptor.options.format) {\n case BorderPropControllerFormat.ClassName:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useBorderStyle}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n default:\n return renderFn({ ...propsValue, [propName]: props[propName] })\n }\n\n case PropControllerTypes.ResponsiveColor:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useResponsiveColorPropControllerData}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n case PropControllerTypes.Link:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useLinkPropControllerData}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n case PropControllerTypes.Checkbox:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useCheckboxPropControllerData}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n case PropControllerTypes.Date:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useDatePropControllerData}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n case PropControllerTypes.Font:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useFontPropControllerData}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n case PropControllerTypes.Video:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useVideoPropControllerData}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n case PropControllerTypes.Table:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useTablePropControllerData}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </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AAA,cAE3B,qBAAS,SAAS,EAAE,GAAG,YAAY,CAAC,QAAQ,GAAG,MAAM,CAAC;AAAA;AAAA,YAJlD,WAAW;AAAA,UAKlB;AAAA,QAGJ,KAAK,wBAAAA,MAAoB;AACvB,iBACE;AAAA,YAAC;AAAA;AAAA,cAEC,MAAM;AAAA,cACN,YAAY,CAAC,MAAM,QAAQ,CAAC;AAAA,cAE3B,qBAAS,SAAS,EAAE,GAAG,YAAY,CAAC,QAAQ,GAAG,MAAM,CAAC;AAAA;AAAA,YAJlD,WAAW;AAAA,UAKlB;AAAA,QAGJ,KAAK,wBAAAA,MAAoB;AACvB,iBACE;AAAA,YAAC;AAAA;AAAA,cAEC,MAAM;AAAA,cACN,YAAY,CAAC,MAAM,QAAQ,CAAC;AAAA,cAE3B,qBAAS,SAAS,EAAE,GAAG,YAAY,CAAC,QAAQ,GAAG,MAAM,CAAC;AAAA;AAAA,YAJlD,WAAW;AAAA,UAKlB;AAAA,QAGJ;AACE,iBAAO,SAAS,EAAE,GAAG,YAAY,CAAC,QAAQ,GAAG,MAAM,QAAQ,EAAE,CAAC;AAAA,MAClE;AAAA,IACF;AAAA,IACF;AAAA,EACF,EAAE,CAAC,CAAC;AACN;","names":["useBorderData","PropControllerTypes"]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/runtimes/react/controls.tsx"],"sourcesContent":["import { useRef } from 'react'\n\nimport * as ReactPage from '../../state/react-page'\n\nimport {\n useBoxShadow,\n useBorder as useBorderData,\n useLinkPropControllerData,\n useCheckboxPropControllerData,\n useDatePropControllerData,\n useFontPropControllerData,\n useVideoPropControllerData,\n useTablePropControllerData,\n} from '../../components/hooks'\nimport type { ColorValue } from '../../components/utils/types'\nimport {\n useResponsiveBorder,\n useResponsiveBorderRadius,\n useResponsiveMargin,\n useResponsivePadding,\n useResponsiveShadow,\n useResponsiveWidth,\n} from '../../components/utils/responsive-style'\nimport {\n CheckboxControlType,\n ColorControlType,\n ComboboxControlType,\n ImageControlType,\n LinkControlType,\n ListControlType,\n NumberControlType,\n SelectControlType,\n ShapeControlType,\n SlotControl,\n SlotControlType,\n StyleControlType,\n TextAreaControlType,\n TextInputControlType,\n RichTextControl,\n RichTextControlType,\n StyleControl,\n RichTextV2Control,\n RichTextV2ControlType,\n StyleV2ControlType,\n TypographyControlType,\n} from '../../controls'\nimport { useFormattedStyle } from './controls/style'\nimport { ControlValue } from './controls/control'\nimport { RenderHook } from './components'\nimport { useSlot } from './controls/slot'\nimport { useStyle } from './use-style'\nimport { useRichText } from './controls/rich-text/rich-text'\nimport { useRichTextV2 } from './controls/rich-text-v2'\nimport { IconRadioGroupControlType } from '../../controls/icon-radio-group'\nimport { useStore } from './hooks/use-store'\nimport { useDocumentKey } from './hooks/use-document-key'\nimport { useSelector } from './hooks/use-selector'\nimport {\n Types as PropControllerTypes,\n getShadowsPropControllerDataResponsiveShadowsData,\n ShadowsPropControllerData,\n Shadows,\n ResponsiveValue,\n BorderPropControllerFormat,\n ResponsiveBorderData,\n BorderPropControllerData,\n getBorderPropControllerDataResponsiveBorderData,\n getBorderRadiusPropControllerDataResponsiveBorderRadiusData,\n BorderRadiusPropControllerData,\n BorderRadiusPropControllerFormat,\n MarginPropControllerFormat,\n MarginPropControllerData,\n getMarginPropControllerDataResponsiveMarginData,\n PaddingPropControllerData,\n getPaddingPropControllerDataResponsivePaddingData,\n PaddingPropControllerFormat,\n WidthPropControllerData,\n getWidthPropControllerDataResponsiveLengthData,\n WidthPropControllerFormat,\n WidthDescriptor,\n} from '@makeswift/prop-controllers'\nimport { useResponsiveLengthPropControllerData } from '../../components/hooks/useResponsiveLengthPropControllerData'\nimport { useNumberPropControllerData } from '../../components/hooks/useNumberPropControllerData'\nimport { useResponsiveColorPropControllerData } from '../../components/hooks/useResponsiveColorPropControllerData'\nimport { useTextStylePropControllerData } from '../../components/hooks/useTextStylePropControllerData'\n\nexport type ResponsiveColor = ResponsiveValue<ColorValue>\n\nfunction useWidthStyle(\n data: WidthPropControllerData | undefined,\n descriptor: WidthDescriptor,\n): string {\n const value = getWidthPropControllerDataResponsiveLengthData(data)\n\n return useStyle(useResponsiveWidth(value, descriptor.options.defaultValue))\n}\n\nfunction usePaddingStyle(data: PaddingPropControllerData | undefined): string {\n const value = getPaddingPropControllerDataResponsivePaddingData(data)\n\n return useStyle(useResponsivePadding(value))\n}\n\nfunction useMarginStyle(data: MarginPropControllerData | undefined): string {\n const value = getMarginPropControllerDataResponsiveMarginData(data)\n\n return useStyle(useResponsiveMargin(value))\n}\n\nexport function useBorderRadiusStyle(data: BorderRadiusPropControllerData | undefined): string {\n const value = getBorderRadiusPropControllerDataResponsiveBorderRadiusData(data)\n\n return useStyle(useResponsiveBorderRadius(value))\n}\n\nexport function useShadowsStyle(data: ShadowsPropControllerData | undefined): string {\n return useStyle(useResponsiveShadow(useBoxShadow(data) ?? undefined))\n}\n\nexport function useBorderStyle(\n data: BorderPropControllerData | undefined,\n): string | ResponsiveBorderData | undefined {\n const value = getBorderPropControllerDataResponsiveBorderData(data)\n const borderData = useBorderData(value)\n\n return useStyle(useResponsiveBorder(borderData ?? undefined))\n}\n\ntype PropsValueProps = {\n element: ReactPage.ElementData\n children(props: Record<string, unknown>): JSX.Element\n}\n\nexport function PropsValue({ element, children }: PropsValueProps): JSX.Element {\n const store = useStore()\n const propControllerDescriptorsRef = useRef(\n ReactPage.getComponentPropControllerDescriptors(store.getState(), element.type) ?? {},\n )\n const props = element.props as Record<string, any>\n const documentKey = useDocumentKey()\n\n const propControllers = useSelector(state => {\n if (documentKey == null) return null\n\n return ReactPage.getPropControllers(state, documentKey, element.key)\n })\n\n return Object.entries(propControllerDescriptorsRef.current).reduceRight(\n (renderFn, [propName, descriptor]) =>\n propsValue => {\n switch (descriptor.type) {\n case CheckboxControlType:\n case NumberControlType:\n case TextInputControlType:\n case TextAreaControlType:\n case SelectControlType:\n case ColorControlType:\n case IconRadioGroupControlType:\n case ImageControlType:\n case ComboboxControlType:\n case ShapeControlType:\n case ListControlType:\n case LinkControlType:\n case StyleV2ControlType:\n case TypographyControlType:\n return (\n <ControlValue\n definition={descriptor}\n data={props[propName]}\n control={propControllers?.[propName]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </ControlValue>\n )\n\n case StyleControlType: {\n const control = (propControllers?.[propName] ?? null) as StyleControl | null\n\n return (\n <RenderHook\n key={descriptor.type}\n hook={useFormattedStyle}\n parameters={[props[propName], descriptor, control]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n }\n\n case RichTextControlType: {\n const control = (propControllers?.[propName] ?? null) as RichTextControl | null\n\n return (\n <RenderHook\n key={descriptor.type}\n hook={useRichText}\n parameters={[props[propName], control]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n }\n\n case RichTextV2ControlType: {\n const control = (propControllers?.[propName] ?? null) as RichTextV2Control | null\n\n return (\n <RenderHook\n key={descriptor.type}\n hook={useRichTextV2}\n parameters={[props[propName], descriptor, control]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n }\n\n case SlotControlType: {\n const control = (propControllers?.[propName] ?? null) as SlotControl | null\n\n return (\n <RenderHook\n key={descriptor.type}\n hook={useSlot}\n parameters={[props[propName], control]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n }\n\n case PropControllerTypes.Width:\n switch (descriptor.options.format) {\n case WidthPropControllerFormat.ClassName:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useWidthStyle}\n parameters={[props[propName], descriptor]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n default:\n return renderFn({ ...propsValue, [propName]: props[propName] })\n }\n\n case PropControllerTypes.Padding:\n switch (descriptor.options.format) {\n case PaddingPropControllerFormat.ClassName:\n return (\n <RenderHook\n key={descriptor.type}\n hook={usePaddingStyle}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n default:\n return renderFn({ ...propsValue, [propName]: props[propName] })\n }\n\n case PropControllerTypes.Margin:\n switch (descriptor.options.format) {\n case MarginPropControllerFormat.ClassName:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useMarginStyle}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n default:\n return renderFn({ ...propsValue, [propName]: props[propName] })\n }\n\n case PropControllerTypes.BorderRadius:\n switch (descriptor.options.format) {\n case BorderRadiusPropControllerFormat.ClassName:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useBorderRadiusStyle}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n default:\n return renderFn({ ...propsValue, [propName]: props[propName] })\n }\n\n case PropControllerTypes.Number:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useNumberPropControllerData}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n case PropControllerTypes.ResponsiveLength:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useResponsiveLengthPropControllerData}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n case PropControllerTypes.Shadows:\n switch (descriptor.options.format) {\n case Shadows.Format.ClassName:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useShadowsStyle}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n case Shadows.Format.ResponsiveValue:\n default:\n return renderFn({\n ...propsValue,\n [propName]: getShadowsPropControllerDataResponsiveShadowsData(props[propName]),\n })\n }\n\n case PropControllerTypes.Border:\n switch (descriptor.options.format) {\n case BorderPropControllerFormat.ClassName:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useBorderStyle}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n default:\n return renderFn({ ...propsValue, [propName]: props[propName] })\n }\n\n case PropControllerTypes.ResponsiveColor:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useResponsiveColorPropControllerData}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n case PropControllerTypes.Link:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useLinkPropControllerData}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n case PropControllerTypes.Checkbox:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useCheckboxPropControllerData}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n case PropControllerTypes.Date:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useDatePropControllerData}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n case PropControllerTypes.Font:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useFontPropControllerData}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n case PropControllerTypes.Video:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useVideoPropControllerData}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n case PropControllerTypes.Table:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useTablePropControllerData}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n case PropControllerTypes.TextStyle:\n return (\n <RenderHook\n key={descriptor.type}\n hook={useTextStylePropControllerData}\n parameters={[props[propName]]}\n >\n {value => renderFn({ ...propsValue, [propName]: value })}\n </RenderHook>\n )\n\n default:\n return renderFn({ ...propsValue, [propName]: props[propName] })\n }\n },\n children,\n )({})\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA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K,wBAAAA,MAAoB;AACvB,iBACE;AAAA,YAAC;AAAA;AAAA,cAEC,MAAM;AAAA,cACN,YAAY,CAAC,MAAM,QAAQ,CAAC;AAAA,cAE3B,qBAAS,SAAS,EAAE,GAAG,YAAY,CAAC,QAAQ,GAAG,MAAM,CAAC;AAAA;AAAA,YAJlD,WAAW;AAAA,UAKlB;AAAA,QAGJ,KAAK,wBAAAA,MAAoB;AACvB,iBACE;AAAA,YAAC;AAAA;AAAA,cAEC,MAAM;AAAA,cACN,YAAY,CAAC,MAAM,QAAQ,CAAC;AAAA,cAE3B,qBAAS,SAAS,EAAE,GAAG,YAAY,CAAC,QAAQ,GAAG,MAAM,CAAC;AAAA;AAAA,YAJlD,WAAW;AAAA,UAKlB;AAAA,QAGJ,KAAK,wBAAAA,MAAoB;AACvB,iBACE;AAAA,YAAC;AAAA;AAAA,cAEC,MAAM;AAAA,cACN,YAAY,CAAC,MAAM,QAAQ,CAAC;AAAA,cAE3B,qBAAS,SAAS,EAAE,GAAG,YAAY,CAAC,QAAQ,GAAG,MAAM,CAAC;AAAA;AAAA,YAJlD,WAAW;AAAA,UAKlB;AAAA,QAGJ;AACE,iBAAO,SAAS,EAAE,GAAG,YAAY,CAAC,QAAQ,GAAG,MAAM,QAAQ,EAAE,CAAC;AAAA,MAClE;AAAA,IACF;AAAA,IACF;AAAA,EACF,EAAE,CAAC,CAAC;AACN;","names":["useBorderData","PropControllerTypes"]}
|
|
@@ -339,7 +339,7 @@ function serializeControl(control) {
|
|
|
339
339
|
return serializeLinkControl(control);
|
|
340
340
|
case Controls.Types.TextInput:
|
|
341
341
|
return serializeTextInputControl(control);
|
|
342
|
-
case
|
|
342
|
+
case PropControllerTypes.TextStyle:
|
|
343
343
|
return serializeTextStyleControl(control);
|
|
344
344
|
case Controls.Types.Image:
|
|
345
345
|
return serializeImageControl(control);
|
|
@@ -391,7 +391,7 @@ function deserializeControl(serializedControl) {
|
|
|
391
391
|
return deserializeLinkControl(serializedControl);
|
|
392
392
|
case Controls.Types.TextInput:
|
|
393
393
|
return deserializeTextInputControl(serializedControl);
|
|
394
|
-
case
|
|
394
|
+
case PropControllerTypes.TextStyle:
|
|
395
395
|
return deserializeTextStyleControl(serializedControl);
|
|
396
396
|
case Controls.Types.Image:
|
|
397
397
|
return deserializeImageControl(serializedControl);
|