@makeswift/runtime 0.17.0-canary.0 → 0.17.0-canary.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/Box/Box.js.map +1 -1
- package/dist/cjs/components/builtin/Box/register.js +1 -1
- package/dist/cjs/components/builtin/Box/register.js.map +1 -1
- package/dist/cjs/components/builtin/Root/Root.js.map +1 -1
- package/dist/cjs/components/builtin/Root/register.js +1 -1
- package/dist/cjs/components/builtin/Root/register.js.map +1 -1
- package/dist/cjs/controls/control.js +5 -4
- package/dist/cjs/controls/control.js.map +1 -1
- package/dist/cjs/controls/data.js +65 -0
- package/dist/cjs/controls/data.js.map +1 -0
- package/dist/cjs/controls/list.js.map +1 -1
- package/dist/cjs/controls/rich-text/dto-types.js.map +1 -1
- package/dist/cjs/controls/utils.js +42 -0
- package/dist/cjs/controls/utils.js.map +1 -0
- package/dist/cjs/next/api-handler/handlers/manifest.js +1 -1
- package/dist/cjs/prop-controllers/copy/rich-text.js.map +1 -1
- package/dist/cjs/prop-controllers/copy.js +4 -4
- package/dist/cjs/prop-controllers/copy.js.map +1 -1
- package/dist/cjs/prop-controllers/deleted.js +1 -0
- package/dist/cjs/prop-controllers/deleted.js.map +1 -1
- package/dist/cjs/prop-controllers/descriptors.js +0 -20
- package/dist/cjs/prop-controllers/descriptors.js.map +1 -1
- package/dist/cjs/prop-controllers/index.js.map +1 -1
- package/dist/cjs/prop-controllers/instances.js +0 -3
- package/dist/cjs/prop-controllers/instances.js.map +1 -1
- package/dist/cjs/prop-controllers/introspection.js +6 -5
- package/dist/cjs/prop-controllers/introspection.js.map +1 -1
- package/dist/cjs/runtimes/react/controls/rich-text/EditableText/editable-text.js.map +1 -1
- package/dist/cjs/runtimes/react/controls/rich-text/EditableText/useSyncWithBuilder.js.map +1 -1
- package/dist/cjs/runtimes/react/controls/rich-text/ReadOnlyText.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/cjs/utils/index-signature-hack.js +17 -0
- package/dist/cjs/utils/index-signature-hack.js.map +1 -0
- 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/Box/Box.js.map +1 -1
- package/dist/esm/components/builtin/Box/register.js +2 -1
- package/dist/esm/components/builtin/Box/register.js.map +1 -1
- package/dist/esm/components/builtin/Root/Root.js.map +1 -1
- package/dist/esm/components/builtin/Root/register.js +2 -2
- package/dist/esm/components/builtin/Root/register.js.map +1 -1
- package/dist/esm/controls/control.js +7 -6
- package/dist/esm/controls/control.js.map +1 -1
- package/dist/esm/controls/data.js +37 -0
- package/dist/esm/controls/data.js.map +1 -0
- package/dist/esm/controls/list.js.map +1 -1
- package/dist/esm/controls/rich-text/dto-types.js.map +1 -1
- package/dist/esm/controls/utils.js +18 -0
- package/dist/esm/controls/utils.js.map +1 -0
- package/dist/esm/next/api-handler/handlers/manifest.js +1 -1
- package/dist/esm/prop-controllers/copy/rich-text.js.map +1 -1
- package/dist/esm/prop-controllers/copy.js +6 -5
- package/dist/esm/prop-controllers/copy.js.map +1 -1
- package/dist/esm/prop-controllers/deleted.js +1 -0
- package/dist/esm/prop-controllers/deleted.js.map +1 -1
- package/dist/esm/prop-controllers/descriptors.js +0 -17
- package/dist/esm/prop-controllers/descriptors.js.map +1 -1
- package/dist/esm/prop-controllers/index.js.map +1 -1
- package/dist/esm/prop-controllers/instances.js +0 -3
- package/dist/esm/prop-controllers/instances.js.map +1 -1
- package/dist/esm/prop-controllers/introspection.js +8 -6
- package/dist/esm/prop-controllers/introspection.js.map +1 -1
- package/dist/esm/runtimes/react/controls/rich-text/EditableText/editable-text.js.map +1 -1
- package/dist/esm/runtimes/react/controls/rich-text/EditableText/useSyncWithBuilder.js.map +1 -1
- package/dist/esm/runtimes/react/controls/rich-text/ReadOnlyText.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/esm/utils/index-signature-hack.js +1 -0
- package/dist/esm/utils/index-signature-hack.js.map +1 -0
- package/dist/types/builder/serialization/control-serialization.d.ts +6 -6
- package/dist/types/builder/serialization/control-serialization.d.ts.map +1 -1
- package/dist/types/components/builtin/Box/Box.d.ts +19 -2
- package/dist/types/components/builtin/Box/Box.d.ts.map +1 -1
- package/dist/types/components/builtin/Box/register.d.ts.map +1 -1
- package/dist/types/components/builtin/Root/Root.d.ts +3 -3
- package/dist/types/components/builtin/Root/Root.d.ts.map +1 -1
- package/dist/types/components/hooks/useImagePropControllerData .d.ts +3 -0
- package/dist/types/components/hooks/useImagePropControllerData .d.ts.map +1 -0
- package/dist/types/components/hooks/useNumberPropControllerData copy.d.ts +3 -0
- package/dist/types/components/hooks/useNumberPropControllerData copy.d.ts.map +1 -0
- package/dist/types/controls/control.d.ts +2 -1
- package/dist/types/controls/control.d.ts.map +1 -1
- package/dist/types/controls/data.d.ts +91 -0
- package/dist/types/controls/data.d.ts.map +1 -0
- package/dist/types/controls/list.d.ts +1 -1
- package/dist/types/controls/list.d.ts.map +1 -1
- package/dist/types/controls/rich-text/dto-types.d.ts +2 -0
- package/dist/types/controls/rich-text/dto-types.d.ts.map +1 -1
- package/dist/types/controls/slot.test.d.ts +2 -0
- package/dist/types/controls/slot.test.d.ts.map +1 -0
- package/dist/types/controls/utils.d.ts +15 -0
- package/dist/types/controls/utils.d.ts.map +1 -0
- package/dist/types/next/components/tests/page-font-prop-controller.test copy.d.ts +3 -0
- package/dist/types/next/components/tests/page-font-prop-controller.test copy.d.ts.map +1 -0
- package/dist/types/next/components/tests/page-image-prop-controller.test.d.ts +3 -0
- package/dist/types/next/components/tests/page-image-prop-controller.test.d.ts.map +1 -0
- package/dist/types/next/components/tests/page-slot-control.test.d.ts +3 -0
- package/dist/types/next/components/tests/page-slot-control.test.d.ts.map +1 -0
- package/dist/types/next/components/tests/page-slot-prop-controller.test.d.ts +3 -0
- package/dist/types/next/components/tests/page-slot-prop-controller.test.d.ts.map +1 -0
- package/dist/types/prop-controllers/copy/rich-text.d.ts +1 -1
- package/dist/types/prop-controllers/copy/rich-text.d.ts.map +1 -1
- package/dist/types/prop-controllers/copy.d.ts.map +1 -1
- package/dist/types/prop-controllers/deleted.d.ts +10 -1
- package/dist/types/prop-controllers/deleted.d.ts.map +1 -1
- package/dist/types/prop-controllers/descriptors.d.ts +8 -45
- 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/prop-controllers/instances.d.ts +1 -4
- package/dist/types/prop-controllers/instances.d.ts.map +1 -1
- package/dist/types/prop-controllers/introspection.d.ts.map +1 -1
- package/dist/types/runtimes/react/controls/rich-text/EditableText/editable-text.d.ts +1 -1
- package/dist/types/runtimes/react/controls/rich-text/EditableText/editable-text.d.ts.map +1 -1
- package/dist/types/runtimes/react/controls/rich-text/EditableText/useSyncWithBuilder.d.ts +1 -1
- package/dist/types/runtimes/react/controls/rich-text/EditableText/useSyncWithBuilder.d.ts.map +1 -1
- package/dist/types/runtimes/react/controls/rich-text/ReadOnlyText.d.ts +1 -1
- package/dist/types/runtimes/react/controls/rich-text/ReadOnlyText.d.ts.map +1 -1
- package/dist/types/runtimes/react/controls.d.ts.map +1 -1
- package/dist/types/utils/index-signature-hack.d.ts +4 -0
- package/dist/types/utils/index-signature-hack.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -350,7 +350,7 @@ function serializeControl(control) {
|
|
|
350
350
|
return serializeTextStyleControl(control);
|
|
351
351
|
case import_prop_controllers2.Props.Types.Image:
|
|
352
352
|
return serializeImageControl(control);
|
|
353
|
-
case
|
|
353
|
+
case import_deleted.DELETED_PROP_CONTROLLER_TYPES.RichText:
|
|
354
354
|
return serializeRichTextControl(control);
|
|
355
355
|
case import_controls.RichTextV2ControlType:
|
|
356
356
|
return (0, import_rich_text_v2.serializeRichTextControlV2)(control);
|
|
@@ -402,7 +402,7 @@ function deserializeControl(serializedControl) {
|
|
|
402
402
|
return deserializeTextStyleControl(serializedControl);
|
|
403
403
|
case import_prop_controllers2.Props.Types.Image:
|
|
404
404
|
return deserializeImageControl(serializedControl);
|
|
405
|
-
case
|
|
405
|
+
case import_deleted.DELETED_PROP_CONTROLLER_TYPES.RichText:
|
|
406
406
|
return deserializeRichTextControl(serializedControl);
|
|
407
407
|
case import_controls.RichTextV2ControlType:
|
|
408
408
|
return (0, import_rich_text_v2.deserializeRichTextControlV2)(serializedControl);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/builder/serialization/control-serialization.ts"],"sourcesContent":["import {\n GapData,\n GapXDescriptor,\n GapXPropControllerData,\n GapYDescriptor,\n GapYPropControllerData,\n ResponsiveLengthOptions,\n ResponsiveLengthPropControllerData,\n} from '@makeswift/prop-controllers'\nimport {\n ComboboxControlDefinition,\n ComboboxControlType,\n ListControlDefinition,\n ListControlType,\n RichTextV2ControlDefinition,\n RichTextV2ControlType,\n ShapeControlDefinition,\n ShapeControlType,\n StyleV2ControlDefinition,\n StyleV2ControlType,\n} from '../../controls'\nimport {\n Data,\n Device,\n ImageDescriptor as ImageControl,\n ImageValue as ImageControlValue,\n ResponsiveNumberDescriptor as ResponsiveNumberControl,\n ResponsiveNumberValue as ResponsiveNumberControlValue,\n ResponsiveIconRadioGroupDescriptor as ResponsiveIconRadioGroupControl,\n ResponsiveIconRadioGroupValue as ResponsiveIconRadioGroupControlValue,\n ResponsiveSelectDescriptor as ResponsiveSelectControl,\n ResponsiveSelectValue as ResponsiveSelectControlValue,\n RichTextDescriptor as RichTextControl,\n RichTextValue as RichTextControlValue,\n TextInputDescriptor as TextInputControl,\n TextInputValue as TextInputControlValue,\n PanelDescriptor as PanelControl,\n PanelDescriptorType as PanelControlType,\n PanelDescriptorValueType as PanelControlValueType,\n PropControllerDescriptor as Control,\n Props as Controls,\n} from '../../prop-controllers'\nimport {\n DELETED_PROP_CONTROLLER_TYPES,\n DeletedPropControllerDescriptor,\n ListDescriptor as ListControl,\n ListOptions as ListControlConfig,\n ListValue as ListControlValue,\n ShapeDescriptor as ShapeControl,\n ShapeValue as ShapeControlValue,\n TypeaheadDescriptor as TypeaheadControl,\n TypeaheadOptions as TypeaheadControlConfig,\n TypeaheadValue as TypeaheadControlValue,\n} from '../../prop-controllers/deleted'\nimport {\n IconRadioGroupOption,\n SelectLabelOrientation,\n SelectOption,\n} from '../../prop-controllers/descriptors'\nimport {\n deserializeComboboxControlDefinition,\n serializeComboboxControlDefinition,\n} from './controls/combobox'\nimport { deserializeListControlDefinition, serializeListControlDefinition } from './controls/list'\nimport { deserializeRichTextControlV2, serializeRichTextControlV2 } from './controls/rich-text-v2'\nimport {\n deserializeShapeControlDefinition,\n serializeShapeControlDefinition,\n} from './controls/shape'\nimport { deserializeStyleV2Control, serializeStyleV2Control } from './controls/style-v2'\nimport { Deserialize, Serialize } from './controls/types'\nimport {\n DeserializedFunction,\n deserializeFunction,\n isSerializedFunction,\n SerializedFunction,\n serializeFunction,\n} from './function-serialization'\nimport {\n LinkData,\n DateDescriptor as DateControl,\n DatePropControllerData,\n Types as PropControllerTypes,\n LinkDescriptor as LinkControl,\n LinkPropControllerData,\n ResponsiveLengthDescriptor,\n NumberOptions,\n NumberPropControllerData,\n NumberDescriptor,\n ResponsiveColorPropControllerData,\n ResponsiveColorDescriptor,\n CheckboxPropControllerData,\n CheckboxDescriptor as CheckboxControl,\n TextStyleDescriptor as TextStyleControl,\n TextStylePropControllerData,\n} from '@makeswift/prop-controllers'\n\ntype SerializedShapeControlConfig<T extends Record<string, SerializedPanelControl>> = {\n type: T\n preset?: { [K in keyof T]?: SerializedPanelControlValueType<T[K]> }\n}\n\ntype SerializedShapeControl<\n _T extends Record<string, Data>,\n U extends Record<string, SerializedPanelControl>,\n> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.Shape\n options: SerializedShapeControlConfig<U>\n}\n\nfunction serializeShapeControl<\n T extends Record<string, Data>,\n U extends Record<string, PanelControl>,\n>(\n control: ShapeControl<T, U>,\n): [\n SerializedShapeControl<\n T,\n { [K in keyof U]: SerializedPanelControl<PanelControlValueType<U[K]>> }\n >,\n Transferable[],\n] {\n const { type } = control.options\n const transferables: Transferable[] = []\n const serializedType = {} as {\n [K in keyof U]: SerializedPanelControl<PanelControlValueType<U[K]>>\n }\n\n Object.entries(type).forEach(([key, control]) => {\n const [serializedControl, serializedControlTransferables] = serializeControl(control)\n\n serializedType[key as keyof typeof type] = serializedControl as SerializedPanelControl\n transferables.push(...serializedControlTransferables)\n })\n\n // @ts-expect-error: preset types are incompatible\n return [{ ...control, options: { ...control.options, type: serializedType } }, transferables]\n}\n\ntype DeserializedShapeControlConfig<T extends Record<string, DeserializedPanelControl>> = {\n type: T\n preset?: { [K in keyof T]?: DeserializedPanelControlValueType<T[K]> }\n}\n\ntype DeserializedShapeControl<\n _T extends Record<string, Data>,\n U extends Record<string, DeserializedPanelControl>,\n> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.Shape\n options: DeserializedShapeControlConfig<U>\n}\n\nfunction deserializeShapeControl<\n T extends Record<string, Data>,\n U extends Record<string, SerializedPanelControl>,\n>(\n control: SerializedShapeControl<T, U>,\n): DeserializedShapeControl<\n T,\n { [K in keyof U]: DeserializedPanelControl<SerializedPanelControlValueType<U[K]>> }\n> {\n const { type } = control.options\n const deserializedType = {} as {\n [K in keyof U]: DeserializedPanelControl<SerializedPanelControlValueType<U[K]>>\n }\n\n Object.entries(type).forEach(([key, control]) => {\n deserializedType[key as keyof typeof type] = deserializeControl(\n control,\n ) as DeserializedPanelControl\n })\n\n // @ts-expect-error: preset types are incompatible\n return { ...control, options: { ...control.options, type: deserializedType } }\n}\n\ntype SerializedListControlConfig<T extends Data> = {\n type: SerializedPanelControl<T>\n label?: string\n getItemLabel?: SerializedFunction<Exclude<ListControlConfig<T>['getItemLabel'], undefined>>\n preset?: ListControlValue<T>\n defaultValue?: ListControlValue<T>\n}\n\ntype SerializedListControl<T extends ListControlValue = ListControlValue> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.List\n options: SerializedListControlConfig<T extends ListControlValue<infer U> ? U : never>\n}\n\nfunction serializeListControl<T extends Data>(\n control: ListControl<ListControlValue<T>>,\n): [SerializedListControl<ListControlValue<T>>, Transferable[]] {\n const { type, getItemLabel } = control.options\n const transferables: Transferable[] = []\n\n const [serializedType, serializedTypeTransferables] = serializeControl(type)\n const serializedGetItemLabel = getItemLabel && serializeFunction(getItemLabel)\n\n transferables.push(...serializedTypeTransferables)\n if (serializedGetItemLabel != null) transferables.push(serializedGetItemLabel)\n\n return [\n {\n ...control,\n options: {\n ...control.options,\n type: serializedType as SerializedPanelControl,\n getItemLabel: serializedGetItemLabel,\n },\n },\n transferables,\n ]\n}\n\ntype DeserializedListControlConfig<T extends Data> = {\n type: DeserializedPanelControl<T>\n label?: string\n getItemLabel?: DeserializedFunction<Exclude<ListControlConfig<T>['getItemLabel'], undefined>>\n preset?: ListControlValue<T>\n defaultValue?: ListControlValue<T>\n}\n\ntype DeserializedListControl<T extends ListControlValue = ListControlValue> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.List\n options: DeserializedListControlConfig<T extends ListControlValue<infer U> ? U : never>\n}\n\nfunction deserializeListControl<T extends Data>(\n serializedControl: SerializedListControl<ListControlValue<T>>,\n): DeserializedListControl<ListControlValue<T>> {\n const { type, getItemLabel } = serializedControl.options\n\n const deserializedType = deserializeControl(type) as DeserializedPanelControl\n const deserializedGetItemLabel = getItemLabel && deserializeFunction(getItemLabel)\n\n return {\n ...serializedControl,\n options: {\n ...serializedControl.options,\n type: deserializedType,\n getItemLabel: deserializedGetItemLabel,\n },\n }\n}\n\ntype SerializedTypeaheadControlConfig<T extends Data> = {\n getItems: SerializedFunction<TypeaheadControlConfig<T>['getItems']>\n label?: string\n preset?: TypeaheadControlValue<T>\n defaultValue?: TypeaheadControlValue<T>\n}\n\ntype SerializedTypeaheadControl<T extends TypeaheadControlValue = TypeaheadControlValue> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.Typeahead\n options: SerializedTypeaheadControlConfig<T['value']>\n}\n\nfunction serializeTypeaheadControl<T extends Data>(\n control: TypeaheadControl<TypeaheadControlValue<T>>,\n): [SerializedTypeaheadControl<TypeaheadControlValue<T>>, Transferable[]] {\n const { getItems } = control.options\n\n const serializedGetItems = getItems && serializeFunction(getItems)\n\n return [\n { ...control, options: { ...control.options, getItems: serializedGetItems } },\n serializedGetItems == null ? [] : [serializedGetItems],\n ]\n}\n\ntype DeserializedTypeaheadControlConfig<T extends Data> = {\n getItems: DeserializedFunction<TypeaheadControlConfig<T>['getItems']>\n label?: string\n preset?: TypeaheadControlValue<T>\n defaultValue?: TypeaheadControlValue<T>\n}\n\ntype DeserializedTypeaheadControl<T extends TypeaheadControlValue = TypeaheadControlValue> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.Typeahead\n options: DeserializedTypeaheadControlConfig<T['value']>\n}\n\nfunction deserializeTypeaheadControl<T extends Data>(\n serializedControl: SerializedTypeaheadControl<TypeaheadControlValue<T>>,\n): DeserializedTypeaheadControl<TypeaheadControlValue<T>> {\n const { getItems } = serializedControl.options\n\n const deserializedGetItems = getItems && deserializeFunction(getItems)\n\n return {\n ...serializedControl,\n options: { ...serializedControl.options, getItems: deserializedGetItems },\n }\n}\n\ntype SerializedConfig<T> =\n | T\n | SerializedFunction<(props: Record<string, unknown>, deviceMode: Device) => T>\n\ntype DeserializedConfig<T> =\n | T\n | DeserializedFunction<(props: Record<string, unknown>, deviceMode: Device) => T>\n\ntype GapXControlConfig = {\n preset?: GapXPropControllerData\n label?: string\n defaultValue?: GapData\n min?: number\n max?: number\n step?: number\n hidden?: boolean\n}\n\ntype SerializedGapXControl<_T = GapXPropControllerData> = {\n type: typeof PropControllerTypes.GapX\n options: SerializedConfig<GapXControlConfig>\n}\n\nfunction serializeGapXControl(control: GapXDescriptor): [SerializedGapXControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedGapXControl<_T = GapXPropControllerData> = {\n type: typeof PropControllerTypes.GapX\n options: DeserializedConfig<GapXControlConfig>\n}\n\nfunction deserializeGapXControl(serializedControl: SerializedGapXControl): DeserializedGapXControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype GapYControlConfig = {\n preset?: GapYPropControllerData\n label?: string\n defaultValue?: GapData\n min?: number\n max?: number\n step?: number\n hidden?: boolean\n}\n\ntype SerializedGapYControl<_T = GapYPropControllerData> = {\n type: typeof PropControllerTypes.GapY\n options: SerializedConfig<GapYControlConfig>\n}\n\nfunction serializeGapYControl(control: GapYDescriptor): [SerializedGapYControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedGapYControl<_T = GapYPropControllerData> = {\n type: typeof PropControllerTypes.GapY\n options: DeserializedConfig<GapYControlConfig>\n}\n\nfunction deserializeGapYControl(serializedControl: SerializedGapYControl): DeserializedGapYControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype ResponsiveNumberControlConfig = {\n preset?: ResponsiveNumberControlValue\n label?: string\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n hidden?: boolean\n}\n\ntype SerializedResponsiveNumberControl<_T = ResponsiveNumberControlValue> = {\n type: typeof Controls.Types.ResponsiveNumber\n options: SerializedConfig<ResponsiveNumberControlConfig>\n}\n\nfunction serializeResponsiveNumberControl(\n control: ResponsiveNumberControl,\n): [SerializedResponsiveNumberControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedResponsiveNumberControl<_T = ResponsiveNumberControlValue> = {\n type: typeof Controls.Types.ResponsiveNumber\n options: DeserializedConfig<ResponsiveNumberControlConfig>\n}\n\nfunction deserializeResponsiveNumberControl(\n serializedControl: SerializedResponsiveNumberControl,\n): DeserializedResponsiveNumberControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype CheckboxControlConfig = {\n preset?: CheckboxPropControllerData\n label: string\n hidden?: boolean\n}\n\ntype SerializedCheckboxControl<_T = CheckboxPropControllerData> = {\n type: typeof PropControllerTypes.Checkbox\n options: SerializedConfig<CheckboxControlConfig>\n}\n\nfunction serializeCheckboxControl(\n control: CheckboxControl,\n): [SerializedCheckboxControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedCheckboxControl<_T = CheckboxPropControllerData> = {\n type: typeof PropControllerTypes.Checkbox\n options: DeserializedConfig<CheckboxControlConfig>\n}\n\nfunction deserializeCheckboxControl(\n serializedControl: SerializedCheckboxControl,\n): DeserializedCheckboxControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype ResponsiveColorControlConfig = { label?: string; placeholder?: string; hidden?: boolean }\n\ntype SerializedResponsiveColorControl<_T = ResponsiveColorPropControllerData> = {\n type: typeof PropControllerTypes.ResponsiveColor\n options: SerializedConfig<ResponsiveColorControlConfig>\n}\n\nfunction serializeResponsiveColorControl(\n control: ResponsiveColorDescriptor,\n): [SerializedResponsiveColorControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedResponsiveColorControl<_T = ResponsiveColorPropControllerData> = {\n type: typeof PropControllerTypes.ResponsiveColor\n options: DeserializedConfig<ResponsiveColorControlConfig>\n}\n\nfunction deserializeResponsiveColorControl(\n serializedControl: SerializedResponsiveColorControl,\n): DeserializedResponsiveColorControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\ntype SerializedNumberControl<_T = NumberPropControllerData> = {\n type: typeof PropControllerTypes.Number\n options: SerializedConfig<NumberOptions>\n}\n\nfunction serializeNumberControl(\n control: NumberDescriptor,\n): [SerializedNumberControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedNumberControl<_T = NumberPropControllerData> = {\n type: typeof PropControllerTypes.Number\n options: DeserializedConfig<NumberOptions>\n}\n\nfunction deserializeNumberControl(\n serializedControl: SerializedNumberControl,\n): DeserializedNumberControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\ntype ResponsiveIconRadioGroupControlConfig<T extends string = string, U extends T = T> = {\n label?: string\n options: IconRadioGroupOption<T>[]\n defaultValue?: U\n hidden?: boolean\n}\n\ntype SerializedResponsiveIconRadioGroupControl<_T = ResponsiveIconRadioGroupControlValue> = {\n type: typeof Controls.Types.ResponsiveIconRadioGroup\n options: SerializedConfig<ResponsiveIconRadioGroupControlConfig>\n}\n\nfunction serializeResponsiveIconRadioGroupControl(\n control: ResponsiveIconRadioGroupControl,\n): [SerializedResponsiveIconRadioGroupControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedResponsiveIconRadioGroupControl<_T = ResponsiveIconRadioGroupControlValue> = {\n type: typeof Controls.Types.ResponsiveIconRadioGroup\n options: DeserializedConfig<ResponsiveIconRadioGroupControlConfig>\n}\n\nfunction deserializeResponsiveIconRadioGroupControl(\n serializedControl: SerializedResponsiveIconRadioGroupControl,\n): DeserializedResponsiveIconRadioGroupControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype DateControlConfig = { preset?: DatePropControllerData }\n\ntype SerializedDateControl<_T = DatePropControllerData> = {\n type: typeof PropControllerTypes.Date\n options: SerializedConfig<DateControlConfig>\n}\n\nfunction serializeDateControl(control: DateControl): [SerializedDateControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedDateControl<_T = DatePropControllerData> = {\n type: typeof PropControllerTypes.Date\n options: DeserializedConfig<DateControlConfig>\n}\n\nfunction deserializeDateControl(serializedControl: SerializedDateControl): DeserializedDateControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype LinkControlConfig = {\n preset?: LinkPropControllerData\n label?: string\n defaultValue?: LinkPropControllerData\n options?: { value: LinkData['type']; label: string }[]\n hidden?: boolean\n}\n\ntype SerializedLinkControl<_T = LinkPropControllerData> = {\n type: typeof PropControllerTypes.Link\n options: SerializedConfig<LinkControlConfig>\n}\n\nfunction serializeLinkControl(control: LinkControl): [SerializedLinkControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedLinkControl<_T = LinkPropControllerData> = {\n type: typeof PropControllerTypes.Link\n options: DeserializedConfig<LinkControlConfig>\n}\n\nfunction deserializeLinkControl(serializedControl: SerializedLinkControl): DeserializedLinkControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype TextInputControlConfig = { label?: string; placeholder?: string; hidden?: boolean }\n\ntype SerializedTextInputControl<_T = TextInputControlValue> = {\n type: typeof Controls.Types.TextInput\n options: SerializedConfig<TextInputControlConfig>\n}\n\nfunction serializeTextInputControl(\n control: TextInputControl,\n): [SerializedTextInputControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedTextInputControl<_T = TextInputControlValue> = {\n type: typeof Controls.Types.TextInput\n options: DeserializedConfig<TextInputControlConfig>\n}\n\nfunction deserializeTextInputControl(\n serializedControl: SerializedTextInputControl,\n): DeserializedTextInputControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype SerializedResponsiveSelectControl<_T = ResponsiveSelectControlValue> = {\n type: typeof Controls.Types.ResponsiveSelect\n options: SerializedConfig<ResponsiveSelectControlConfig>\n}\n\nfunction serializeResponsiveSelectControl(\n control: ResponsiveSelectControl,\n): [SerializedResponsiveSelectControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype ResponsiveSelectControlConfig<T extends string = string, U extends T = T> = {\n label?: string\n labelOrientation?: SelectLabelOrientation\n options: SelectOption<T>[]\n defaultValue?: U\n hidden?: boolean\n}\n\ntype DeserializedResponsiveSelectControl<_T = ResponsiveSelectControlValue> = {\n type: typeof Controls.Types.ResponsiveSelect\n options: DeserializedConfig<ResponsiveSelectControlConfig>\n}\n\nfunction deserializeResponsiveSelectControl(\n serializedControl: SerializedResponsiveSelectControl,\n): DeserializedResponsiveSelectControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype SerializedResponsiveLengthControl<_T = ResponsiveLengthPropControllerData> = {\n type: typeof PropControllerTypes.ResponsiveLength\n options: SerializedConfig<ResponsiveLengthOptions>\n}\n\nfunction serializeResponsiveLengthControl(\n control: ResponsiveLengthDescriptor,\n): [SerializedResponsiveLengthControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedResponsiveLengthControl<_T = ResponsiveLengthPropControllerData> = {\n type: typeof PropControllerTypes.ResponsiveLength\n options: DeserializedConfig<ResponsiveLengthOptions>\n}\n\nfunction deserializeResponsiveLengthControl(\n serializedControl: SerializedResponsiveLengthControl,\n): DeserializedResponsiveLengthControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype SerializedTextStyleControl<_T = TextStylePropControllerData> = {\n type: typeof PropControllerTypes.TextStyle\n options: SerializedConfig<TextStyleControlConfig>\n}\n\nfunction serializeTextStyleControl(\n control: TextStyleControl,\n): [SerializedTextStyleControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype TextStyleControlConfig = {\n preset?: TextStylePropControllerData\n label?: string\n hidden?: boolean\n}\n\ntype DeserializedTextStyleControl<_T = TextStylePropControllerData> = {\n type: typeof PropControllerTypes.TextStyle\n options: DeserializedConfig<TextStyleControlConfig>\n}\n\nfunction deserializeTextStyleControl(\n serializedControl: SerializedTextStyleControl,\n): DeserializedTextStyleControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype ImageControlConfig = { label?: string; hidden?: boolean }\n\ntype SerializedImageControl<_T = ImageControlValue> = {\n type: typeof Controls.Types.Image\n options: SerializedConfig<ImageControlConfig>\n}\n\nfunction serializeImageControl(control: ImageControl): [SerializedImageControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedImageControl<_T = ImageControlValue> = {\n type: typeof Controls.Types.Image\n options: DeserializedConfig<ImageControlConfig>\n}\n\nfunction deserializeImageControl(\n serializedControl: SerializedImageControl,\n): DeserializedImageControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype RichTextControlConfig = { preset?: RichTextControlValue }\n\ntype SerializedRichTextControl<_T = RichTextControlValue> = {\n type: typeof Controls.Types.RichText\n options: SerializedConfig<RichTextControlConfig>\n}\n\nfunction serializeRichTextControl(\n control: RichTextControl,\n): [SerializedRichTextControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedRichTextControl<_T = RichTextControlValue> = {\n type: typeof Controls.Types.RichText\n options: DeserializedConfig<RichTextControlConfig>\n}\n\nfunction deserializeRichTextControl(\n serializedControl: SerializedRichTextControl,\n): DeserializedRichTextControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\nexport type SerializedControl<T extends Data = Data> =\n | Exclude<\n Control<T>,\n | ListControl<T extends ListControlValue ? T : ListControlValue>\n | ShapeControl<T extends ShapeControlValue ? T : ShapeControlValue, any>\n | TypeaheadControl<T extends TypeaheadControlValue ? T : TypeaheadControlValue>\n | GapXDescriptor<T>\n | GapYDescriptor<T>\n | ResponsiveNumberControl<T>\n | CheckboxControl<T>\n | ResponsiveColorDescriptor<T>\n | NumberDescriptor<T>\n | ResponsiveIconRadioGroupControl<\n T extends ResponsiveIconRadioGroupControlValue ? T : ResponsiveIconRadioGroupControlValue\n >\n | ResponsiveSelectControl<\n T extends ResponsiveSelectControlValue ? T : ResponsiveSelectControlValue\n >\n | ResponsiveLengthDescriptor<T>\n | DateControl<T>\n | LinkControl<T>\n | TextInputControl<T>\n | TextStyleControl<T>\n | ImageControl<T>\n | RichTextControl<T>\n | RichTextV2ControlDefinition\n | ComboboxControlDefinition\n | ShapeControlDefinition\n | ListControlDefinition\n | StyleV2ControlDefinition\n >\n | SerializedListControl<T extends ListControlValue ? T : ListControlValue>\n | SerializedShapeControl<T extends ShapeControlValue ? T : ShapeControlValue, any>\n | SerializedTypeaheadControl<T extends TypeaheadControlValue ? T : TypeaheadControlValue>\n | SerializedGapXControl<T>\n | SerializedGapYControl<T>\n | SerializedResponsiveNumberControl<T>\n | SerializedCheckboxControl<T>\n | SerializedResponsiveColorControl<T>\n | SerializedNumberControl<T>\n | SerializedResponsiveIconRadioGroupControl<T>\n | SerializedResponsiveSelectControl<T>\n | SerializedResponsiveLengthControl<T>\n | SerializedDateControl<T>\n | SerializedLinkControl<T>\n | SerializedTextInputControl<T>\n | SerializedTextStyleControl<T>\n | SerializedImageControl<T>\n | SerializedRichTextControl<T>\n | Serialize<RichTextV2ControlDefinition>\n | Serialize<ComboboxControlDefinition>\n | Serialize<ShapeControlDefinition>\n | Serialize<ListControlDefinition>\n | Serialize<StyleV2ControlDefinition>\n\ntype SerializedPanelControl<T extends Data = Data> = Extract<\n SerializedControl<T>,\n { type: PanelControlType }\n>\n\ntype SerializedPanelControlValueType<T extends SerializedPanelControl> =\n T extends SerializedPanelControl<infer U> ? U : never\n\nexport type DeserializedControl<T extends Data = Data> =\n | Exclude<\n Control<T>,\n | ListControl<T extends ListControlValue ? T : ListControlValue>\n | ShapeControl<T extends ShapeControlValue ? T : ShapeControlValue, any>\n | TypeaheadControl<T extends TypeaheadControlValue ? T : TypeaheadControlValue>\n | GapXDescriptor<T>\n | GapYDescriptor<T>\n | ResponsiveNumberControl<T>\n | CheckboxControl<T>\n | ResponsiveColorDescriptor<T>\n | NumberDescriptor<T>\n | ResponsiveIconRadioGroupControl<\n T extends ResponsiveIconRadioGroupControlValue ? T : ResponsiveIconRadioGroupControlValue\n >\n | ResponsiveSelectControl<\n T extends ResponsiveSelectControlValue ? T : ResponsiveSelectControlValue\n >\n | ResponsiveLengthDescriptor<T>\n | DateControl<T>\n | LinkControl<T>\n | TextInputControl<T>\n | TextStyleControl<T>\n | ImageControl<T>\n | RichTextControl<T>\n | RichTextV2ControlDefinition\n | ComboboxControlDefinition\n | ShapeControlDefinition\n | ListControlDefinition\n | StyleV2ControlDefinition\n >\n | DeserializedListControl<T extends ListControlValue ? T : ListControlValue>\n | DeserializedShapeControl<T extends ShapeControlValue ? T : ShapeControlValue, any>\n | DeserializedTypeaheadControl<T extends TypeaheadControlValue ? T : TypeaheadControlValue>\n | DeserializedGapXControl<T>\n | DeserializedGapYControl<T>\n | DeserializedResponsiveNumberControl<T>\n | DeserializedCheckboxControl<T>\n | DeserializedResponsiveColorControl<T>\n | DeserializedNumberControl<T>\n | DeserializedResponsiveIconRadioGroupControl<T>\n | DeserializedResponsiveSelectControl<T>\n | DeserializedResponsiveLengthControl<T>\n | DeserializedDateControl<T>\n | DeserializedLinkControl<T>\n | DeserializedTextInputControl<T>\n | DeserializedTextStyleControl<T>\n | DeserializedImageControl<T>\n | DeserializedRichTextControl<T>\n | Deserialize<Serialize<RichTextV2ControlDefinition>>\n | Deserialize<Serialize<ComboboxControlDefinition>>\n | Deserialize<Serialize<ShapeControlDefinition>>\n | Deserialize<Serialize<ListControlDefinition>>\n | Deserialize<Serialize<StyleV2ControlDefinition>>\n\nexport type DeserializedPanelControl<T extends Data = Data> = Extract<\n DeserializedControl<T>,\n { type: PanelControlType }\n>\n\ntype DeserializedPanelControlValueType<T extends DeserializedPanelControl> =\n T extends DeserializedPanelControl<infer U> ? U : never\n\nexport function serializeControl<T extends Data>(\n control: Control<T> | DeletedPropControllerDescriptor<T>,\n): [SerializedControl<T>, Transferable[]] {\n switch (control.type) {\n case PropControllerTypes.Checkbox:\n return serializeCheckboxControl(control)\n\n case DELETED_PROP_CONTROLLER_TYPES.List:\n return serializeListControl(control)\n\n case DELETED_PROP_CONTROLLER_TYPES.Shape:\n return serializeShapeControl(control)\n\n case DELETED_PROP_CONTROLLER_TYPES.Typeahead:\n return serializeTypeaheadControl(control)\n\n case PropControllerTypes.GapX:\n return serializeGapXControl(control)\n\n case PropControllerTypes.GapY:\n return serializeGapYControl(control)\n\n case PropControllerTypes.ResponsiveColor:\n return serializeResponsiveColorControl(control)\n\n case Controls.Types.ResponsiveNumber:\n return serializeResponsiveNumberControl(control)\n\n case PropControllerTypes.Number:\n return serializeNumberControl(control)\n\n case Controls.Types.ResponsiveIconRadioGroup:\n return serializeResponsiveIconRadioGroupControl(control)\n\n case Controls.Types.ResponsiveSelect:\n return serializeResponsiveSelectControl(control)\n\n case PropControllerTypes.ResponsiveLength:\n return serializeResponsiveLengthControl(control)\n\n case PropControllerTypes.Date:\n return serializeDateControl(control)\n\n case PropControllerTypes.Link:\n return serializeLinkControl(control)\n\n case Controls.Types.TextInput:\n return serializeTextInputControl(control)\n\n case PropControllerTypes.TextStyle:\n return serializeTextStyleControl(control)\n\n case Controls.Types.Image:\n return serializeImageControl(control)\n\n case Controls.Types.RichText:\n return serializeRichTextControl(control)\n\n case RichTextV2ControlType:\n return serializeRichTextControlV2(control)\n\n case StyleV2ControlType:\n return serializeStyleV2Control(control)\n\n case ComboboxControlType:\n return serializeComboboxControlDefinition(control)\n\n case ShapeControlType:\n return serializeShapeControlDefinition(control)\n\n case ListControlType:\n return serializeListControlDefinition(control)\n\n default:\n return [control, []]\n }\n}\n\nexport function deserializeControl<T extends Data>(\n serializedControl: SerializedControl<T>,\n): DeserializedControl<T> {\n switch (serializedControl.type) {\n case PropControllerTypes.Checkbox:\n return deserializeCheckboxControl(serializedControl)\n\n case DELETED_PROP_CONTROLLER_TYPES.List:\n return deserializeListControl(serializedControl)\n\n case DELETED_PROP_CONTROLLER_TYPES.Shape:\n return deserializeShapeControl(serializedControl)\n\n case DELETED_PROP_CONTROLLER_TYPES.Typeahead:\n return deserializeTypeaheadControl(serializedControl)\n\n case PropControllerTypes.GapX:\n return deserializeGapXControl(serializedControl)\n\n case PropControllerTypes.GapY:\n return deserializeGapYControl(serializedControl)\n\n case PropControllerTypes.ResponsiveColor:\n return deserializeResponsiveColorControl(serializedControl)\n\n case Controls.Types.ResponsiveNumber:\n return deserializeResponsiveNumberControl(serializedControl)\n\n case PropControllerTypes.Number:\n return deserializeNumberControl(serializedControl)\n\n case Controls.Types.ResponsiveIconRadioGroup:\n return deserializeResponsiveIconRadioGroupControl(serializedControl)\n\n case Controls.Types.ResponsiveSelect:\n return deserializeResponsiveSelectControl(serializedControl)\n\n case PropControllerTypes.ResponsiveLength:\n return deserializeResponsiveLengthControl(serializedControl)\n\n case PropControllerTypes.Date:\n return deserializeDateControl(serializedControl)\n\n case PropControllerTypes.Link:\n return deserializeLinkControl(serializedControl)\n\n case Controls.Types.TextInput:\n return deserializeTextInputControl(serializedControl)\n\n case PropControllerTypes.TextStyle:\n return deserializeTextStyleControl(serializedControl)\n\n case Controls.Types.Image:\n return deserializeImageControl(serializedControl)\n\n case Controls.Types.RichText:\n return deserializeRichTextControl(serializedControl)\n\n case RichTextV2ControlType:\n return deserializeRichTextControlV2(serializedControl)\n\n case StyleV2ControlType:\n return deserializeStyleV2Control(serializedControl)\n\n case ComboboxControlType:\n return deserializeComboboxControlDefinition(serializedControl)\n\n case ShapeControlType:\n return deserializeShapeControlDefinition(serializedControl)\n\n case ListControlType:\n return deserializeListControlDefinition(serializedControl)\n\n default:\n return serializedControl\n }\n}\n\nexport function serializeControls(\n controls: Record<string, Control>,\n): [Record<string, SerializedControl>, Transferable[]] {\n return Object.entries(controls).reduce(\n ([accControls, accTransferables], [key, control]) => {\n const [serializedControl, transferables] = serializeControl(control)\n\n return [{ ...accControls, [key]: serializedControl }, [...accTransferables, ...transferables]]\n },\n [{}, []] as [Record<string, SerializedControl>, Transferable[]],\n )\n}\n\nexport function deserializeControls(\n serializedControls: Record<string, SerializedControl>,\n): Record<string, DeserializedControl> {\n return Object.entries(serializedControls).reduce(\n (deserializedControls, [key, serializedControl]) => {\n return { ...deserializedControls, [key]: deserializeControl(serializedControl) }\n },\n {} as Record<string, DeserializedControl>,\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,sBAWO;AACP,IAAAA,2BAoBO;AACP,qBAWO;AAMP,sBAGO;AACP,kBAAiF;AACjF,0BAAyE;AACzE,mBAGO;AACP,sBAAmE;A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C9B,CAAC,CAAC,aAAa,gBAAgB,GAAG,CAAC,KAAK,OAAO,MAAM;AACnD,YAAM,CAAC,mBAAmB,aAAa,IAAI,iBAAiB,OAAO;AAEnE,aAAO,CAAC,EAAE,GAAG,aAAa,CAAC,GAAG,GAAG,kBAAkB,GAAG,CAAC,GAAG,kBAAkB,GAAG,aAAa,CAAC;AAAA,IAC/F;AAAA,IACA,CAAC,CAAC,GAAG,CAAC,CAAC;AAAA,EACT;AACF;AAEO,SAAS,oBACd,oBACqC;AACrC,SAAO,OAAO,QAAQ,kBAAkB,EAAE;AAAA,IACxC,CAAC,sBAAsB,CAAC,KAAK,iBAAiB,MAAM;AAClD,aAAO,EAAE,GAAG,sBAAsB,CAAC,GAAG,GAAG,mBAAmB,iBAAiB,EAAE;AAAA,IACjF;AAAA,IACA,CAAC;AAAA,EACH;AACF;","names":["import_prop_controllers","control","PropControllerTypes","Controls"]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/builder/serialization/control-serialization.ts"],"sourcesContent":["import {\n GapData,\n GapXDescriptor,\n GapXPropControllerData,\n GapYDescriptor,\n GapYPropControllerData,\n ResponsiveLengthOptions,\n ResponsiveLengthPropControllerData,\n} from '@makeswift/prop-controllers'\nimport {\n ComboboxControlDefinition,\n ComboboxControlType,\n ListControlDefinition,\n ListControlType,\n RichTextV2ControlDefinition,\n RichTextV2ControlType,\n ShapeControlDefinition,\n ShapeControlType,\n StyleV2ControlDefinition,\n StyleV2ControlType,\n RichTextValue as RichTextControlValue,\n} from '../../controls'\nimport {\n Data,\n Device,\n ImageDescriptor as ImageControl,\n ImageValue as ImageControlValue,\n ResponsiveNumberDescriptor as ResponsiveNumberControl,\n ResponsiveNumberValue as ResponsiveNumberControlValue,\n ResponsiveIconRadioGroupDescriptor as ResponsiveIconRadioGroupControl,\n ResponsiveIconRadioGroupValue as ResponsiveIconRadioGroupControlValue,\n ResponsiveSelectDescriptor as ResponsiveSelectControl,\n ResponsiveSelectValue as ResponsiveSelectControlValue,\n TextInputDescriptor as TextInputControl,\n TextInputValue as TextInputControlValue,\n PanelDescriptor as PanelControl,\n PanelDescriptorType as PanelControlType,\n PanelDescriptorValueType as PanelControlValueType,\n PropControllerDescriptor as Control,\n Props as Controls,\n} from '../../prop-controllers'\nimport {\n DELETED_PROP_CONTROLLER_TYPES,\n ListDescriptor as ListControl,\n ListOptions as ListControlConfig,\n ListValue as ListControlValue,\n ShapeDescriptor as ShapeControl,\n ShapeValue as ShapeControlValue,\n TypeaheadDescriptor as TypeaheadControl,\n TypeaheadOptions as TypeaheadControlConfig,\n TypeaheadValue as TypeaheadControlValue,\n RichTextDescriptor as RichTextControl,\n} from '../../prop-controllers/deleted'\nimport {\n IconRadioGroupOption,\n SelectLabelOrientation,\n SelectOption,\n} from '../../prop-controllers/descriptors'\nimport {\n deserializeComboboxControlDefinition,\n serializeComboboxControlDefinition,\n} from './controls/combobox'\nimport { deserializeListControlDefinition, serializeListControlDefinition } from './controls/list'\nimport { deserializeRichTextControlV2, serializeRichTextControlV2 } from './controls/rich-text-v2'\nimport {\n deserializeShapeControlDefinition,\n serializeShapeControlDefinition,\n} from './controls/shape'\nimport { deserializeStyleV2Control, serializeStyleV2Control } from './controls/style-v2'\nimport { Deserialize, Serialize } from './controls/types'\nimport {\n DeserializedFunction,\n deserializeFunction,\n isSerializedFunction,\n SerializedFunction,\n serializeFunction,\n} from './function-serialization'\nimport {\n LinkData,\n DateDescriptor as DateControl,\n DatePropControllerData,\n Types as PropControllerTypes,\n LinkDescriptor as LinkControl,\n LinkPropControllerData,\n ResponsiveLengthDescriptor,\n NumberOptions,\n NumberPropControllerData,\n NumberDescriptor,\n ResponsiveColorPropControllerData,\n ResponsiveColorDescriptor,\n CheckboxPropControllerData,\n CheckboxDescriptor as CheckboxControl,\n TextStyleDescriptor as TextStyleControl,\n TextStylePropControllerData,\n} from '@makeswift/prop-controllers'\n\ntype SerializedShapeControlConfig<T extends Record<string, SerializedPanelControl>> = {\n type: T\n preset?: { [K in keyof T]?: SerializedPanelControlValueType<T[K]> }\n}\n\ntype SerializedShapeControl<\n _T extends Record<string, Data>,\n U extends Record<string, SerializedPanelControl>,\n> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.Shape\n options: SerializedShapeControlConfig<U>\n}\n\nfunction serializeShapeControl<\n T extends Record<string, Data>,\n U extends Record<string, PanelControl>,\n>(\n control: ShapeControl<T, U>,\n): [\n SerializedShapeControl<\n T,\n { [K in keyof U]: SerializedPanelControl<PanelControlValueType<U[K]>> }\n >,\n Transferable[],\n] {\n const { type } = control.options\n const transferables: Transferable[] = []\n const serializedType = {} as {\n [K in keyof U]: SerializedPanelControl<PanelControlValueType<U[K]>>\n }\n\n Object.entries(type).forEach(([key, control]) => {\n const [serializedControl, serializedControlTransferables] = serializeControl(control)\n\n serializedType[key as keyof typeof type] = serializedControl as SerializedPanelControl\n transferables.push(...serializedControlTransferables)\n })\n\n // @ts-expect-error: preset types are incompatible\n return [{ ...control, options: { ...control.options, type: serializedType } }, transferables]\n}\n\ntype DeserializedShapeControlConfig<T extends Record<string, DeserializedPanelControl>> = {\n type: T\n preset?: { [K in keyof T]?: DeserializedPanelControlValueType<T[K]> }\n}\n\ntype DeserializedShapeControl<\n _T extends Record<string, Data>,\n U extends Record<string, DeserializedPanelControl>,\n> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.Shape\n options: DeserializedShapeControlConfig<U>\n}\n\nfunction deserializeShapeControl<\n T extends Record<string, Data>,\n U extends Record<string, SerializedPanelControl>,\n>(\n control: SerializedShapeControl<T, U>,\n): DeserializedShapeControl<\n T,\n { [K in keyof U]: DeserializedPanelControl<SerializedPanelControlValueType<U[K]>> }\n> {\n const { type } = control.options\n const deserializedType = {} as {\n [K in keyof U]: DeserializedPanelControl<SerializedPanelControlValueType<U[K]>>\n }\n\n Object.entries(type).forEach(([key, control]) => {\n deserializedType[key as keyof typeof type] = deserializeControl(\n control,\n ) as DeserializedPanelControl\n })\n\n // @ts-expect-error: preset types are incompatible\n return { ...control, options: { ...control.options, type: deserializedType } }\n}\n\ntype SerializedListControlConfig<T extends Data> = {\n type: SerializedPanelControl<T>\n label?: string\n getItemLabel?: SerializedFunction<Exclude<ListControlConfig<T>['getItemLabel'], undefined>>\n preset?: ListControlValue<T>\n defaultValue?: ListControlValue<T>\n}\n\ntype SerializedListControl<T extends ListControlValue = ListControlValue> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.List\n options: SerializedListControlConfig<T extends ListControlValue<infer U> ? U : never>\n}\n\nfunction serializeListControl<T extends Data>(\n control: ListControl<ListControlValue<T>>,\n): [SerializedListControl<ListControlValue<T>>, Transferable[]] {\n const { type, getItemLabel } = control.options\n const transferables: Transferable[] = []\n\n const [serializedType, serializedTypeTransferables] = serializeControl(type)\n const serializedGetItemLabel = getItemLabel && serializeFunction(getItemLabel)\n\n transferables.push(...serializedTypeTransferables)\n if (serializedGetItemLabel != null) transferables.push(serializedGetItemLabel)\n\n return [\n {\n ...control,\n options: {\n ...control.options,\n type: serializedType as SerializedPanelControl,\n getItemLabel: serializedGetItemLabel,\n },\n },\n transferables,\n ]\n}\n\ntype DeserializedListControlConfig<T extends Data> = {\n type: DeserializedPanelControl<T>\n label?: string\n getItemLabel?: DeserializedFunction<Exclude<ListControlConfig<T>['getItemLabel'], undefined>>\n preset?: ListControlValue<T>\n defaultValue?: ListControlValue<T>\n}\n\ntype DeserializedListControl<T extends ListControlValue = ListControlValue> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.List\n options: DeserializedListControlConfig<T extends ListControlValue<infer U> ? U : never>\n}\n\nfunction deserializeListControl<T extends Data>(\n serializedControl: SerializedListControl<ListControlValue<T>>,\n): DeserializedListControl<ListControlValue<T>> {\n const { type, getItemLabel } = serializedControl.options\n\n const deserializedType = deserializeControl(type) as DeserializedPanelControl\n const deserializedGetItemLabel = getItemLabel && deserializeFunction(getItemLabel)\n\n return {\n ...serializedControl,\n options: {\n ...serializedControl.options,\n type: deserializedType,\n getItemLabel: deserializedGetItemLabel,\n },\n }\n}\n\ntype SerializedTypeaheadControlConfig<T extends Data> = {\n getItems: SerializedFunction<TypeaheadControlConfig<T>['getItems']>\n label?: string\n preset?: TypeaheadControlValue<T>\n defaultValue?: TypeaheadControlValue<T>\n}\n\ntype SerializedTypeaheadControl<T extends TypeaheadControlValue = TypeaheadControlValue> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.Typeahead\n options: SerializedTypeaheadControlConfig<T['value']>\n}\n\nfunction serializeTypeaheadControl<T extends Data>(\n control: TypeaheadControl<TypeaheadControlValue<T>>,\n): [SerializedTypeaheadControl<TypeaheadControlValue<T>>, Transferable[]] {\n const { getItems } = control.options\n\n const serializedGetItems = getItems && serializeFunction(getItems)\n\n return [\n { ...control, options: { ...control.options, getItems: serializedGetItems } },\n serializedGetItems == null ? [] : [serializedGetItems],\n ]\n}\n\ntype DeserializedTypeaheadControlConfig<T extends Data> = {\n getItems: DeserializedFunction<TypeaheadControlConfig<T>['getItems']>\n label?: string\n preset?: TypeaheadControlValue<T>\n defaultValue?: TypeaheadControlValue<T>\n}\n\ntype DeserializedTypeaheadControl<T extends TypeaheadControlValue = TypeaheadControlValue> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.Typeahead\n options: DeserializedTypeaheadControlConfig<T['value']>\n}\n\nfunction deserializeTypeaheadControl<T extends Data>(\n serializedControl: SerializedTypeaheadControl<TypeaheadControlValue<T>>,\n): DeserializedTypeaheadControl<TypeaheadControlValue<T>> {\n const { getItems } = serializedControl.options\n\n const deserializedGetItems = getItems && deserializeFunction(getItems)\n\n return {\n ...serializedControl,\n options: { ...serializedControl.options, getItems: deserializedGetItems },\n }\n}\n\ntype SerializedConfig<T> =\n | T\n | SerializedFunction<(props: Record<string, unknown>, deviceMode: Device) => T>\n\ntype DeserializedConfig<T> =\n | T\n | DeserializedFunction<(props: Record<string, unknown>, deviceMode: Device) => T>\n\ntype GapXControlConfig = {\n preset?: GapXPropControllerData\n label?: string\n defaultValue?: GapData\n min?: number\n max?: number\n step?: number\n hidden?: boolean\n}\n\ntype SerializedGapXControl<_T = GapXPropControllerData> = {\n type: typeof PropControllerTypes.GapX\n options: SerializedConfig<GapXControlConfig>\n}\n\nfunction serializeGapXControl(control: GapXDescriptor): [SerializedGapXControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedGapXControl<_T = GapXPropControllerData> = {\n type: typeof PropControllerTypes.GapX\n options: DeserializedConfig<GapXControlConfig>\n}\n\nfunction deserializeGapXControl(serializedControl: SerializedGapXControl): DeserializedGapXControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype GapYControlConfig = {\n preset?: GapYPropControllerData\n label?: string\n defaultValue?: GapData\n min?: number\n max?: number\n step?: number\n hidden?: boolean\n}\n\ntype SerializedGapYControl<_T = GapYPropControllerData> = {\n type: typeof PropControllerTypes.GapY\n options: SerializedConfig<GapYControlConfig>\n}\n\nfunction serializeGapYControl(control: GapYDescriptor): [SerializedGapYControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedGapYControl<_T = GapYPropControllerData> = {\n type: typeof PropControllerTypes.GapY\n options: DeserializedConfig<GapYControlConfig>\n}\n\nfunction deserializeGapYControl(serializedControl: SerializedGapYControl): DeserializedGapYControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype ResponsiveNumberControlConfig = {\n preset?: ResponsiveNumberControlValue\n label?: string\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n hidden?: boolean\n}\n\ntype SerializedResponsiveNumberControl<_T = ResponsiveNumberControlValue> = {\n type: typeof Controls.Types.ResponsiveNumber\n options: SerializedConfig<ResponsiveNumberControlConfig>\n}\n\nfunction serializeResponsiveNumberControl(\n control: ResponsiveNumberControl,\n): [SerializedResponsiveNumberControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedResponsiveNumberControl<_T = ResponsiveNumberControlValue> = {\n type: typeof Controls.Types.ResponsiveNumber\n options: DeserializedConfig<ResponsiveNumberControlConfig>\n}\n\nfunction deserializeResponsiveNumberControl(\n serializedControl: SerializedResponsiveNumberControl,\n): DeserializedResponsiveNumberControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype CheckboxControlConfig = {\n preset?: CheckboxPropControllerData\n label: string\n hidden?: boolean\n}\n\ntype SerializedCheckboxControl<_T = CheckboxPropControllerData> = {\n type: typeof PropControllerTypes.Checkbox\n options: SerializedConfig<CheckboxControlConfig>\n}\n\nfunction serializeCheckboxControl(\n control: CheckboxControl,\n): [SerializedCheckboxControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedCheckboxControl<_T = CheckboxPropControllerData> = {\n type: typeof PropControllerTypes.Checkbox\n options: DeserializedConfig<CheckboxControlConfig>\n}\n\nfunction deserializeCheckboxControl(\n serializedControl: SerializedCheckboxControl,\n): DeserializedCheckboxControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype ResponsiveColorControlConfig = { label?: string; placeholder?: string; hidden?: boolean }\n\ntype SerializedResponsiveColorControl<_T = ResponsiveColorPropControllerData> = {\n type: typeof PropControllerTypes.ResponsiveColor\n options: SerializedConfig<ResponsiveColorControlConfig>\n}\n\nfunction serializeResponsiveColorControl(\n control: ResponsiveColorDescriptor,\n): [SerializedResponsiveColorControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedResponsiveColorControl<_T = ResponsiveColorPropControllerData> = {\n type: typeof PropControllerTypes.ResponsiveColor\n options: DeserializedConfig<ResponsiveColorControlConfig>\n}\n\nfunction deserializeResponsiveColorControl(\n serializedControl: SerializedResponsiveColorControl,\n): DeserializedResponsiveColorControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\ntype SerializedNumberControl<_T = NumberPropControllerData> = {\n type: typeof PropControllerTypes.Number\n options: SerializedConfig<NumberOptions>\n}\n\nfunction serializeNumberControl(\n control: NumberDescriptor,\n): [SerializedNumberControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedNumberControl<_T = NumberPropControllerData> = {\n type: typeof PropControllerTypes.Number\n options: DeserializedConfig<NumberOptions>\n}\n\nfunction deserializeNumberControl(\n serializedControl: SerializedNumberControl,\n): DeserializedNumberControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\ntype ResponsiveIconRadioGroupControlConfig<T extends string = string, U extends T = T> = {\n label?: string\n options: IconRadioGroupOption<T>[]\n defaultValue?: U\n hidden?: boolean\n}\n\ntype SerializedResponsiveIconRadioGroupControl<_T = ResponsiveIconRadioGroupControlValue> = {\n type: typeof Controls.Types.ResponsiveIconRadioGroup\n options: SerializedConfig<ResponsiveIconRadioGroupControlConfig>\n}\n\nfunction serializeResponsiveIconRadioGroupControl(\n control: ResponsiveIconRadioGroupControl,\n): [SerializedResponsiveIconRadioGroupControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedResponsiveIconRadioGroupControl<_T = ResponsiveIconRadioGroupControlValue> = {\n type: typeof Controls.Types.ResponsiveIconRadioGroup\n options: DeserializedConfig<ResponsiveIconRadioGroupControlConfig>\n}\n\nfunction deserializeResponsiveIconRadioGroupControl(\n serializedControl: SerializedResponsiveIconRadioGroupControl,\n): DeserializedResponsiveIconRadioGroupControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype DateControlConfig = { preset?: DatePropControllerData }\n\ntype SerializedDateControl<_T = DatePropControllerData> = {\n type: typeof PropControllerTypes.Date\n options: SerializedConfig<DateControlConfig>\n}\n\nfunction serializeDateControl(control: DateControl): [SerializedDateControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedDateControl<_T = DatePropControllerData> = {\n type: typeof PropControllerTypes.Date\n options: DeserializedConfig<DateControlConfig>\n}\n\nfunction deserializeDateControl(serializedControl: SerializedDateControl): DeserializedDateControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype LinkControlConfig = {\n preset?: LinkPropControllerData\n label?: string\n defaultValue?: LinkPropControllerData\n options?: { value: LinkData['type']; label: string }[]\n hidden?: boolean\n}\n\ntype SerializedLinkControl<_T = LinkPropControllerData> = {\n type: typeof PropControllerTypes.Link\n options: SerializedConfig<LinkControlConfig>\n}\n\nfunction serializeLinkControl(control: LinkControl): [SerializedLinkControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedLinkControl<_T = LinkPropControllerData> = {\n type: typeof PropControllerTypes.Link\n options: DeserializedConfig<LinkControlConfig>\n}\n\nfunction deserializeLinkControl(serializedControl: SerializedLinkControl): DeserializedLinkControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype TextInputControlConfig = { label?: string; placeholder?: string; hidden?: boolean }\n\ntype SerializedTextInputControl<_T = TextInputControlValue> = {\n type: typeof Controls.Types.TextInput\n options: SerializedConfig<TextInputControlConfig>\n}\n\nfunction serializeTextInputControl(\n control: TextInputControl,\n): [SerializedTextInputControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedTextInputControl<_T = TextInputControlValue> = {\n type: typeof Controls.Types.TextInput\n options: DeserializedConfig<TextInputControlConfig>\n}\n\nfunction deserializeTextInputControl(\n serializedControl: SerializedTextInputControl,\n): DeserializedTextInputControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype SerializedResponsiveSelectControl<_T = ResponsiveSelectControlValue> = {\n type: typeof Controls.Types.ResponsiveSelect\n options: SerializedConfig<ResponsiveSelectControlConfig>\n}\n\nfunction serializeResponsiveSelectControl(\n control: ResponsiveSelectControl,\n): [SerializedResponsiveSelectControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype ResponsiveSelectControlConfig<T extends string = string, U extends T = T> = {\n label?: string\n labelOrientation?: SelectLabelOrientation\n options: SelectOption<T>[]\n defaultValue?: U\n hidden?: boolean\n}\n\ntype DeserializedResponsiveSelectControl<_T = ResponsiveSelectControlValue> = {\n type: typeof Controls.Types.ResponsiveSelect\n options: DeserializedConfig<ResponsiveSelectControlConfig>\n}\n\nfunction deserializeResponsiveSelectControl(\n serializedControl: SerializedResponsiveSelectControl,\n): DeserializedResponsiveSelectControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype SerializedResponsiveLengthControl<_T = ResponsiveLengthPropControllerData> = {\n type: typeof PropControllerTypes.ResponsiveLength\n options: SerializedConfig<ResponsiveLengthOptions>\n}\n\nfunction serializeResponsiveLengthControl(\n control: ResponsiveLengthDescriptor,\n): [SerializedResponsiveLengthControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedResponsiveLengthControl<_T = ResponsiveLengthPropControllerData> = {\n type: typeof PropControllerTypes.ResponsiveLength\n options: DeserializedConfig<ResponsiveLengthOptions>\n}\n\nfunction deserializeResponsiveLengthControl(\n serializedControl: SerializedResponsiveLengthControl,\n): DeserializedResponsiveLengthControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype SerializedTextStyleControl<_T = TextStylePropControllerData> = {\n type: typeof PropControllerTypes.TextStyle\n options: SerializedConfig<TextStyleControlConfig>\n}\n\nfunction serializeTextStyleControl(\n control: TextStyleControl,\n): [SerializedTextStyleControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype TextStyleControlConfig = {\n preset?: TextStylePropControllerData\n label?: string\n hidden?: boolean\n}\n\ntype DeserializedTextStyleControl<_T = TextStylePropControllerData> = {\n type: typeof PropControllerTypes.TextStyle\n options: DeserializedConfig<TextStyleControlConfig>\n}\n\nfunction deserializeTextStyleControl(\n serializedControl: SerializedTextStyleControl,\n): DeserializedTextStyleControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype ImageControlConfig = { label?: string; hidden?: boolean }\n\ntype SerializedImageControl<_T = ImageControlValue> = {\n type: typeof Controls.Types.Image\n options: SerializedConfig<ImageControlConfig>\n}\n\nfunction serializeImageControl(control: ImageControl): [SerializedImageControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedImageControl<_T = ImageControlValue> = {\n type: typeof Controls.Types.Image\n options: DeserializedConfig<ImageControlConfig>\n}\n\nfunction deserializeImageControl(\n serializedControl: SerializedImageControl,\n): DeserializedImageControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\ntype RichTextControlConfig = { preset?: RichTextControlValue }\n\ntype SerializedRichTextControl<_T = RichTextControlValue> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.RichText\n options: SerializedConfig<RichTextControlConfig>\n}\n\nfunction serializeRichTextControl(\n control: RichTextControl,\n): [SerializedRichTextControl, Transferable[]] {\n const { options } = control\n\n if (typeof options !== 'function') return [{ ...control, options }, []]\n\n const serializedOptions = serializeFunction(options)\n\n return [{ ...control, options: serializedOptions }, [serializedOptions]]\n}\n\ntype DeserializedRichTextControl<_T = RichTextControlValue> = {\n type: typeof DELETED_PROP_CONTROLLER_TYPES.RichText\n options: DeserializedConfig<RichTextControlConfig>\n}\n\nfunction deserializeRichTextControl(\n serializedControl: SerializedRichTextControl,\n): DeserializedRichTextControl {\n const { options } = serializedControl\n\n if (!isSerializedFunction(options)) return { ...serializedControl, options }\n\n const deserializedOptions = deserializeFunction(options)\n\n return { ...serializedControl, options: deserializedOptions }\n}\n\nexport type SerializedControl<T extends Data = Data> =\n | Exclude<\n Control<T>,\n | ListControl<T extends ListControlValue ? T : ListControlValue>\n | ShapeControl<T extends ShapeControlValue ? T : ShapeControlValue, any>\n | TypeaheadControl<T extends TypeaheadControlValue ? T : TypeaheadControlValue>\n | GapXDescriptor<T>\n | GapYDescriptor<T>\n | ResponsiveNumberControl<T>\n | CheckboxControl<T>\n | ResponsiveColorDescriptor<T>\n | NumberDescriptor<T>\n | ResponsiveIconRadioGroupControl<\n T extends ResponsiveIconRadioGroupControlValue ? T : ResponsiveIconRadioGroupControlValue\n >\n | ResponsiveSelectControl<\n T extends ResponsiveSelectControlValue ? T : ResponsiveSelectControlValue\n >\n | ResponsiveLengthDescriptor<T>\n | DateControl<T>\n | LinkControl<T>\n | TextInputControl<T>\n | TextStyleControl<T>\n | ImageControl<T>\n | RichTextControl<T>\n | RichTextV2ControlDefinition\n | ComboboxControlDefinition\n | ShapeControlDefinition\n | ListControlDefinition\n | StyleV2ControlDefinition\n >\n | SerializedListControl<T extends ListControlValue ? T : ListControlValue>\n | SerializedShapeControl<T extends ShapeControlValue ? T : ShapeControlValue, any>\n | SerializedTypeaheadControl<T extends TypeaheadControlValue ? T : TypeaheadControlValue>\n | SerializedGapXControl<T>\n | SerializedGapYControl<T>\n | SerializedResponsiveNumberControl<T>\n | SerializedCheckboxControl<T>\n | SerializedResponsiveColorControl<T>\n | SerializedNumberControl<T>\n | SerializedResponsiveIconRadioGroupControl<T>\n | SerializedResponsiveSelectControl<T>\n | SerializedResponsiveLengthControl<T>\n | SerializedDateControl<T>\n | SerializedLinkControl<T>\n | SerializedTextInputControl<T>\n | SerializedTextStyleControl<T>\n | SerializedImageControl<T>\n | SerializedRichTextControl<T>\n | Serialize<RichTextV2ControlDefinition>\n | Serialize<ComboboxControlDefinition>\n | Serialize<ShapeControlDefinition>\n | Serialize<ListControlDefinition>\n | Serialize<StyleV2ControlDefinition>\n\ntype SerializedPanelControl<T extends Data = Data> = Extract<\n SerializedControl<T>,\n { type: PanelControlType }\n>\n\ntype SerializedPanelControlValueType<T extends SerializedPanelControl> =\n T extends SerializedPanelControl<infer U> ? U : never\n\nexport type DeserializedControl<T extends Data = Data> =\n | Exclude<\n Control<T>,\n | ListControl<T extends ListControlValue ? T : ListControlValue>\n | ShapeControl<T extends ShapeControlValue ? T : ShapeControlValue, any>\n | TypeaheadControl<T extends TypeaheadControlValue ? T : TypeaheadControlValue>\n | GapXDescriptor<T>\n | GapYDescriptor<T>\n | ResponsiveNumberControl<T>\n | CheckboxControl<T>\n | ResponsiveColorDescriptor<T>\n | NumberDescriptor<T>\n | ResponsiveIconRadioGroupControl<\n T extends ResponsiveIconRadioGroupControlValue ? T : ResponsiveIconRadioGroupControlValue\n >\n | ResponsiveSelectControl<\n T extends ResponsiveSelectControlValue ? T : ResponsiveSelectControlValue\n >\n | ResponsiveLengthDescriptor<T>\n | DateControl<T>\n | LinkControl<T>\n | TextInputControl<T>\n | TextStyleControl<T>\n | ImageControl<T>\n | RichTextControl<T>\n | RichTextV2ControlDefinition\n | ComboboxControlDefinition\n | ShapeControlDefinition\n | ListControlDefinition\n | StyleV2ControlDefinition\n >\n | DeserializedListControl<T extends ListControlValue ? T : ListControlValue>\n | DeserializedShapeControl<T extends ShapeControlValue ? T : ShapeControlValue, any>\n | DeserializedTypeaheadControl<T extends TypeaheadControlValue ? T : TypeaheadControlValue>\n | DeserializedGapXControl<T>\n | DeserializedGapYControl<T>\n | DeserializedResponsiveNumberControl<T>\n | DeserializedCheckboxControl<T>\n | DeserializedResponsiveColorControl<T>\n | DeserializedNumberControl<T>\n | DeserializedResponsiveIconRadioGroupControl<T>\n | DeserializedResponsiveSelectControl<T>\n | DeserializedResponsiveLengthControl<T>\n | DeserializedDateControl<T>\n | DeserializedLinkControl<T>\n | DeserializedTextInputControl<T>\n | DeserializedTextStyleControl<T>\n | DeserializedImageControl<T>\n | DeserializedRichTextControl<T>\n | Deserialize<Serialize<RichTextV2ControlDefinition>>\n | Deserialize<Serialize<ComboboxControlDefinition>>\n | Deserialize<Serialize<ShapeControlDefinition>>\n | Deserialize<Serialize<ListControlDefinition>>\n | Deserialize<Serialize<StyleV2ControlDefinition>>\n\nexport type DeserializedPanelControl<T extends Data = Data> = Extract<\n DeserializedControl<T>,\n { type: PanelControlType }\n>\n\ntype DeserializedPanelControlValueType<T extends DeserializedPanelControl> =\n T extends DeserializedPanelControl<infer U> ? U : never\n\nexport function serializeControl<T extends Data>(\n control: Control<T>,\n): [SerializedControl<T>, Transferable[]] {\n switch (control.type) {\n case PropControllerTypes.Checkbox:\n return serializeCheckboxControl(control)\n\n case DELETED_PROP_CONTROLLER_TYPES.List:\n return serializeListControl(control)\n\n case DELETED_PROP_CONTROLLER_TYPES.Shape:\n return serializeShapeControl(control)\n\n case DELETED_PROP_CONTROLLER_TYPES.Typeahead:\n return serializeTypeaheadControl(control)\n\n case PropControllerTypes.GapX:\n return serializeGapXControl(control)\n\n case PropControllerTypes.GapY:\n return serializeGapYControl(control)\n\n case PropControllerTypes.ResponsiveColor:\n return serializeResponsiveColorControl(control)\n\n case Controls.Types.ResponsiveNumber:\n return serializeResponsiveNumberControl(control)\n\n case PropControllerTypes.Number:\n return serializeNumberControl(control)\n\n case Controls.Types.ResponsiveIconRadioGroup:\n return serializeResponsiveIconRadioGroupControl(control)\n\n case Controls.Types.ResponsiveSelect:\n return serializeResponsiveSelectControl(control)\n\n case PropControllerTypes.ResponsiveLength:\n return serializeResponsiveLengthControl(control)\n\n case PropControllerTypes.Date:\n return serializeDateControl(control)\n\n case PropControllerTypes.Link:\n return serializeLinkControl(control)\n\n case Controls.Types.TextInput:\n return serializeTextInputControl(control)\n\n case PropControllerTypes.TextStyle:\n return serializeTextStyleControl(control)\n\n case Controls.Types.Image:\n return serializeImageControl(control)\n\n case DELETED_PROP_CONTROLLER_TYPES.RichText:\n return serializeRichTextControl(control)\n\n case RichTextV2ControlType:\n return serializeRichTextControlV2(control)\n\n case StyleV2ControlType:\n return serializeStyleV2Control(control)\n\n case ComboboxControlType:\n return serializeComboboxControlDefinition(control)\n\n case ShapeControlType:\n return serializeShapeControlDefinition(control)\n\n case ListControlType:\n return serializeListControlDefinition(control)\n\n default:\n return [control, []]\n }\n}\n\nexport function deserializeControl<T extends Data>(\n serializedControl: SerializedControl<T>,\n): DeserializedControl<T> {\n switch (serializedControl.type) {\n case PropControllerTypes.Checkbox:\n return deserializeCheckboxControl(serializedControl)\n\n case DELETED_PROP_CONTROLLER_TYPES.List:\n return deserializeListControl(serializedControl)\n\n case DELETED_PROP_CONTROLLER_TYPES.Shape:\n return deserializeShapeControl(serializedControl)\n\n case DELETED_PROP_CONTROLLER_TYPES.Typeahead:\n return deserializeTypeaheadControl(serializedControl)\n\n case PropControllerTypes.GapX:\n return deserializeGapXControl(serializedControl)\n\n case PropControllerTypes.GapY:\n return deserializeGapYControl(serializedControl)\n\n case PropControllerTypes.ResponsiveColor:\n return deserializeResponsiveColorControl(serializedControl)\n\n case Controls.Types.ResponsiveNumber:\n return deserializeResponsiveNumberControl(serializedControl)\n\n case PropControllerTypes.Number:\n return deserializeNumberControl(serializedControl)\n\n case Controls.Types.ResponsiveIconRadioGroup:\n return deserializeResponsiveIconRadioGroupControl(serializedControl)\n\n case Controls.Types.ResponsiveSelect:\n return deserializeResponsiveSelectControl(serializedControl)\n\n case PropControllerTypes.ResponsiveLength:\n return deserializeResponsiveLengthControl(serializedControl)\n\n case PropControllerTypes.Date:\n return deserializeDateControl(serializedControl)\n\n case PropControllerTypes.Link:\n return deserializeLinkControl(serializedControl)\n\n case Controls.Types.TextInput:\n return deserializeTextInputControl(serializedControl)\n\n case PropControllerTypes.TextStyle:\n return deserializeTextStyleControl(serializedControl)\n\n case Controls.Types.Image:\n return deserializeImageControl(serializedControl)\n\n case DELETED_PROP_CONTROLLER_TYPES.RichText:\n return deserializeRichTextControl(serializedControl)\n\n case RichTextV2ControlType:\n return deserializeRichTextControlV2(serializedControl)\n\n case StyleV2ControlType:\n return deserializeStyleV2Control(serializedControl)\n\n case ComboboxControlType:\n return deserializeComboboxControlDefinition(serializedControl)\n\n case ShapeControlType:\n return deserializeShapeControlDefinition(serializedControl)\n\n case ListControlType:\n return deserializeListControlDefinition(serializedControl)\n\n default:\n return serializedControl\n }\n}\n\nexport function serializeControls(\n controls: Record<string, Control>,\n): [Record<string, SerializedControl>, Transferable[]] {\n return Object.entries(controls).reduce(\n ([accControls, accTransferables], [key, control]) => {\n const [serializedControl, transferables] = serializeControl(control)\n\n return [{ ...accControls, [key]: serializedControl }, [...accTransferables, ...transferables]]\n },\n [{}, []] as [Record<string, SerializedControl>, Transferable[]],\n )\n}\n\nexport function deserializeControls(\n serializedControls: Record<string, SerializedControl>,\n): Record<string, DeserializedControl> {\n return Object.entries(serializedControls).reduce(\n (deserializedControls, [key, serializedControl]) => {\n return { ...deserializedControls, [key]: deserializeControl(serializedControl) }\n },\n {} as Record<string, DeserializedControl>,\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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E3D;AACE,aAAO;AAAA,EACX;AACF;AAEO,SAAS,kBACd,UACqD;AACrD,SAAO,OAAO,QAAQ,QAAQ,EAAE;AAAA,IAC9B,CAAC,CAAC,aAAa,gBAAgB,GAAG,CAAC,KAAK,OAAO,MAAM;AACnD,YAAM,CAAC,mBAAmB,aAAa,IAAI,iBAAiB,OAAO;AAEnE,aAAO,CAAC,EAAE,GAAG,aAAa,CAAC,GAAG,GAAG,kBAAkB,GAAG,CAAC,GAAG,kBAAkB,GAAG,aAAa,CAAC;AAAA,IAC/F;AAAA,IACA,CAAC,CAAC,GAAG,CAAC,CAAC;AAAA,EACT;AACF;AAEO,SAAS,oBACd,oBACqC;AACrC,SAAO,OAAO,QAAQ,kBAAkB,EAAE;AAAA,IACxC,CAAC,sBAAsB,CAAC,KAAK,iBAAiB,MAAM;AAClD,aAAO,EAAE,GAAG,sBAAsB,CAAC,GAAG,GAAG,mBAAmB,iBAAiB,EAAE;AAAA,IACjF;AAAA,IACA,CAAC;AAAA,EACH;AACF;","names":["import_prop_controllers","control","PropControllerTypes","Controls"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/builtin/Box/Box.tsx"],"sourcesContent":["'use client'\n\nimport {\n forwardRef,\n Ref,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react'\nimport { cx } from '@emotion/css'\nimport { v4 as uuid } from 'uuid'\n\nimport { Element } from '../../../runtimes/react'\nimport Placeholder from './components/Placeholder'\nimport { areBoxAnimationPropsEqual, BoxAnimationProps, useBoxAnimation } from './animations'\nimport {\n ResponsiveIconRadioGroupValue,\n
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/builtin/Box/Box.tsx"],"sourcesContent":["'use client'\n\nimport {\n forwardRef,\n Ref,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react'\nimport { cx } from '@emotion/css'\nimport { v4 as uuid } from 'uuid'\n\nimport { Element } from '../../../runtimes/react'\nimport Placeholder from './components/Placeholder'\nimport { areBoxAnimationPropsEqual, BoxAnimationProps, useBoxAnimation } from './animations'\nimport {\n ResponsiveIconRadioGroupValue,\n BackgroundsValue,\n} from '../../../prop-controllers/descriptors'\nimport { BoxModelHandle, parse, createBox } from '../../../box-model'\nimport BackgroundsContainer from '../../shared/BackgroundsContainer'\nimport { useResponsiveStyle } from '../../utils/responsive-style'\nimport { GridItem } from '../../shared/grid-item'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { GridData, ResponsiveGapData } from '@makeswift/prop-controllers'\n\ntype Props = {\n id?: string\n backgrounds?: BackgroundsValue\n width?: string\n height?: ResponsiveIconRadioGroupValue<'auto' | 'stretch'>\n verticalAlign?: ResponsiveIconRadioGroupValue<\n 'flex-start' | 'center' | 'flex-end' | 'space-between'\n >\n margin?: string\n padding?: string\n border?: string\n borderRadius?: string\n boxShadow?: string\n rowGap?: ResponsiveGapData\n columnGap?: ResponsiveGapData\n hidePlaceholder?: boolean\n children?: GridData\n} & BoxAnimationProps\n\nconst Box = forwardRef(function Box(\n {\n id,\n backgrounds,\n width,\n height,\n margin,\n padding,\n border,\n children,\n borderRadius,\n boxShadow,\n rowGap,\n columnGap,\n hidePlaceholder,\n verticalAlign,\n boxAnimateType,\n boxAnimateDuration,\n boxAnimateDelay,\n itemAnimateDelay,\n itemAnimateType,\n itemAnimateDuration,\n itemStaggerDuration,\n }: Props,\n ref: Ref<BoxModelHandle>,\n) {\n const innerRef = useRef<HTMLDivElement | null>(null)\n const boxElementObjectRef = useRef<HTMLElement | null>(null)\n const [animationClassName, replayAnimation, setElement] = useBoxAnimation(\n boxAnimateType,\n boxAnimateDuration,\n boxAnimateDelay,\n itemAnimateType,\n )\n const boxElementCallbackRef = useCallback((current: HTMLElement | null) => {\n boxElementObjectRef.current = current\n\n setElement(current)\n }, [])\n\n useImperativeHandle(\n ref,\n () => ({\n getDomNode() {\n return boxElementObjectRef.current\n },\n getBoxModel() {\n const paddingBoxElement = innerRef.current\n const borderBoxElement = innerRef.current\n const marginBoxElement = boxElementObjectRef.current\n const borderBox = innerRef.current?.getBoundingClientRect()\n const paddingBoxComputedStyle =\n paddingBoxElement?.ownerDocument.defaultView?.getComputedStyle(paddingBoxElement)\n const borderBoxComputedStyle =\n borderBoxElement?.ownerDocument.defaultView?.getComputedStyle(borderBoxElement)\n const marginBoxComputedStyle =\n marginBoxElement?.ownerDocument.defaultView?.getComputedStyle(marginBoxElement)\n const padding = paddingBoxComputedStyle && {\n top: parse(paddingBoxComputedStyle.paddingTop),\n right: parse(paddingBoxComputedStyle.paddingRight),\n bottom: parse(paddingBoxComputedStyle.paddingBottom),\n left: parse(paddingBoxComputedStyle.paddingLeft),\n }\n const border = borderBoxComputedStyle && {\n top: parse(borderBoxComputedStyle.borderTopWidth),\n right: parse(borderBoxComputedStyle.borderRightWidth),\n bottom: parse(borderBoxComputedStyle.borderBottomWidth),\n left: parse(borderBoxComputedStyle.borderLeftWidth),\n }\n const margin = marginBoxComputedStyle && {\n top: parse(marginBoxComputedStyle.marginTop),\n right: parse(marginBoxComputedStyle.marginRight),\n bottom: parse(marginBoxComputedStyle.marginBottom),\n left: parse(marginBoxComputedStyle.marginLeft),\n }\n\n return borderBox ? createBox({ borderBox, padding, border, margin }) : null\n },\n }),\n [],\n )\n\n const gridItemClassName = useStyle(\n useResponsiveStyle([verticalAlign], ([alignItems = 'flex-start']) => ({ alignItems })),\n )\n\n const [key, setKey] = useState(() => uuid())\n\n const animationProps = {\n boxAnimateType,\n boxAnimateDuration,\n boxAnimateDelay,\n itemAnimateType,\n itemAnimateDuration,\n itemAnimateDelay,\n itemStaggerDuration,\n }\n\n const prevAnimationProps = useRef(animationProps)\n useEffect(() => {\n if (!areBoxAnimationPropsEqual(prevAnimationProps.current, animationProps)) {\n replayAnimation()\n setKey(uuid())\n prevAnimationProps.current = animationProps\n }\n }, [replayAnimation, animationProps])\n\n return (\n <BackgroundsContainer\n ref={boxElementCallbackRef}\n id={id}\n className={cx(\n width,\n margin,\n borderRadius,\n useStyle({ display: 'flex' }),\n useStyle(useResponsiveStyle([height], ([alignSelf = 'auto']) => ({ alignSelf }))),\n animationClassName,\n )}\n backgrounds={backgrounds}\n >\n <div\n ref={innerRef}\n key={key}\n className={cx(\n padding,\n boxShadow,\n border,\n useStyle({ display: 'flex', flexWrap: 'wrap', width: '100%' }),\n useStyle(\n useResponsiveStyle([verticalAlign], ([alignContent = 'flex-start']) => ({\n alignContent,\n })),\n ),\n )}\n >\n {children && children.elements.length > 0 ? (\n children.elements.map((child, index) => (\n <GridItem\n key={child.key}\n className={gridItemClassName}\n grid={children.columns}\n index={index}\n itemAnimateDuration={itemAnimateDuration}\n itemAnimateDelay={itemAnimateDelay}\n itemStaggerDuration={itemStaggerDuration}\n columnGap={columnGap}\n rowGap={rowGap}\n >\n <Element element={child} />\n </GridItem>\n ))\n ) : (\n <Placeholder hide={hidePlaceholder} />\n )}\n </div>\n </BackgroundsContainer>\n )\n})\n\nexport default Box\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoMc;AAlMd,mBAQO;AACP,iBAAmB;AACnB,kBAA2B;AAE3B,IAAAA,gBAAwB;AACxB,yBAAwB;AACxB,wBAA8E;AAK9E,uBAAiD;AACjD,kCAAiC;AACjC,8BAAmC;AACnC,uBAAyB;AACzB,uBAAyB;AAsBzB,MAAM,UAAM,yBAAW,SAASC,KAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GACA,KACA;AACA,QAAM,eAAW,qBAA8B,IAAI;AACnD,QAAM,0BAAsB,qBAA2B,IAAI;AAC3D,QAAM,CAAC,oBA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UAEC,sBAAY,SAAS,SAAS,SAAS,IACtC,SAAS,SAAS,IAAI,CAAC,OAAO,UAC5B;AAAA,YAAC;AAAA;AAAA,cAEC,WAAW;AAAA,cACX,MAAM,SAAS;AAAA,cACf;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cAEA,sDAAC,yBAAQ,SAAS,OAAO;AAAA;AAAA,YAVpB,MAAM;AAAA,UAWb,CACD,IAED,4CAAC,mBAAAC,SAAA,EAAY,MAAM,iBAAiB;AAAA;AAAA,QA9BjC;AAAA,MAgCP;AAAA;AAAA,EACF;AAEJ,CAAC;AAED,IAAO,cAAQ;","names":["import_react","Box","padding","border","margin","uuid","BackgroundsContainer","Placeholder"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/builtin/Box/register.ts"],"sourcesContent":["import {\n Border,\n BorderRadius,\n Checkbox,\n ElementID,\n GapX,\n GapY,\n Margin,\n Padding,\n Shadows,\n Width,\n} from '@makeswift/prop-controllers'\nimport { Props } from '../../../prop-controllers'\nimport { ReactRuntime } from '../../../runtimes/react'\nimport { findBreakpointOverride, getBaseBreakpoint } from '../../../state/modules/breakpoints'\nimport { MakeswiftComponentType } from '../constants'\nimport {\n BoxAnimateIn,\n DEFAULT_BOX_ANIMATE_DELAY,\n DEFAULT_BOX_ANIMATE_DURATION,\n DEFAULT_ITEM_ANIMATE_DELAY,\n DEFAULT_ITEM_STAGGER_DURATION,\n} from './constants'\nimport { lazy } from 'react'\nimport { ResponsiveSelectValue } from '../../../prop-controllers/descriptors'\n\nexport function registerComponent(runtime: ReactRuntime) {\n function isHiddenBasedOnAnimationType(\n props: Record<string, unknown>,\n deviceId: string,\n property: 'boxAnimateType' | 'itemAnimateType',\n ): boolean {\n const animateIn = props[property] as ResponsiveSelectValue<BoxAnimateIn> | undefined\n return (\n (findBreakpointOverride<BoxAnimateIn>(runtime.getBreakpoints(), animateIn, deviceId)?.value ??\n 'none') === 'none'\n )\n }\n const isHiddenBasedOnBoxAnimation = (props: Record<string, unknown>, deviceId: string) =>\n isHiddenBasedOnAnimationType(props, deviceId, 'boxAnimateType')\n const isHiddenBasedOnItemAnimation = (props: Record<string, unknown>, deviceId: string) =>\n isHiddenBasedOnAnimationType(props, deviceId, 'itemAnimateType')\n\n return runtime.registerComponent(\n lazy(() => import('./Box')),\n {\n type: MakeswiftComponentType.Box,\n label: 'Box',\n props: {\n id: ElementID(),\n backgrounds: Props.Backgrounds(),\n width: Width({\n format: Width.Format.ClassName,\n defaultValue: { value: 100, unit: '%' },\n }),\n height: Props.ResponsiveIconRadioGroup({\n label: 'Height',\n options: [\n { value: 'auto', label: 'Auto', icon: 'HeightAuto16' },\n { value: 'stretch', label: 'Stretch', icon: 'HeightMatch16' },\n ],\n defaultValue: 'auto',\n }),\n verticalAlign: Props.ResponsiveIconRadioGroup({\n label: 'Align items',\n options: [\n { value: 'flex-start', label: 'Top', icon: 'VerticalAlignStart16' },\n { value: 'center', label: 'Middle', icon: 'VerticalAlignMiddle16' },\n { value: 'flex-end', label: 'Bottom', icon: 'VerticalAlignEnd16' },\n {\n value: 'space-between',\n label: 'Space between',\n icon: 'VerticalAlignSpaceBetween16',\n },\n ],\n defaultValue: 'flex-start',\n }),\n margin: Margin({ format: Margin.Format.ClassName }),\n padding: Padding({\n format: Padding.Format.ClassName,\n preset: [\n {\n deviceId: getBaseBreakpoint(runtime.getBreakpoints()).id,\n value: {\n paddingTop: { value: 10, unit: 'px' },\n paddingRight: { value: 10, unit: 'px' },\n paddingBottom: { value: 10, unit: 'px' },\n paddingLeft: { value: 10, unit: 'px' },\n },\n },\n ],\n }),\n border: Border({ format: Border.Format.ClassName }),\n borderRadius: BorderRadius({ format: BorderRadius.Format.ClassName }),\n boxShadow: Shadows({ format: Shadows.Format.ClassName }),\n rowGap: GapY(props => ({\n hidden: props.children == null,\n })),\n columnGap: GapX(props => ({\n hidden: props.children == null,\n })),\n boxAnimateType: Props.ResponsiveSelect({\n label: 'Animate box in',\n labelOrientation: 'vertical',\n options: [\n { value: 'none', label: 'None' },\n { value: 'fadeIn', label: 'Fade in' },\n { value: 'fadeRight', label: 'Fade right' },\n { value: 'fadeDown', label: 'Fade down' },\n { value: 'fadeLeft', label: 'Fade left' },\n { value: 'fadeUp', label: 'Fade up' },\n { value: 'blurIn', label: 'Blur in' },\n { value: 'scaleUp', label: 'Scale up' },\n { value: 'scaleDown', label: 'Scale down' },\n ],\n defaultValue: 'none',\n }),\n boxAnimateDuration: Props.ResponsiveNumber((props, device) => ({\n label: 'Box duration',\n defaultValue: DEFAULT_BOX_ANIMATE_DURATION,\n min: 0.1,\n step: 0.05,\n suffix: 's',\n hidden: isHiddenBasedOnBoxAnimation(props, device),\n })),\n boxAnimateDelay: Props.ResponsiveNumber((props, device) => ({\n label: 'Box delay',\n defaultValue: DEFAULT_BOX_ANIMATE_DELAY,\n min: 0,\n step: 0.05,\n suffix: 's',\n hidden: isHiddenBasedOnBoxAnimation(props, device),\n })),\n itemAnimateType: Props.ResponsiveSelect({\n label: 'Animate items in',\n labelOrientation: 'vertical',\n options: [\n { value: 'none', label: 'None' },\n { value: 'fadeIn', label: 'Fade in' },\n { value: 'fadeRight', label: 'Fade right' },\n { value: 'fadeDown', label: 'Fade down' },\n { value: 'fadeLeft', label: 'Fade left' },\n { value: 'fadeUp', label: 'Fade up' },\n { value: 'blurIn', label: 'Blur in' },\n { value: 'scaleUp', label: 'Scale up' },\n { value: 'scaleDown', label: 'Scale down' },\n ],\n defaultValue: 'none',\n }),\n itemAnimateDuration: Props.ResponsiveNumber((props, device) => ({\n label: 'Items duration',\n defaultValue: DEFAULT_BOX_ANIMATE_DURATION,\n min: 0.1,\n step: 0.05,\n suffix: 's',\n hidden: isHiddenBasedOnItemAnimation(props, device),\n })),\n itemAnimateDelay: Props.ResponsiveNumber((props, device) => ({\n label: 'Items delay',\n defaultValue: DEFAULT_ITEM_ANIMATE_DELAY,\n min: 0,\n step: 0.05,\n suffix: 's',\n hidden: isHiddenBasedOnItemAnimation(props, device),\n })),\n itemStaggerDuration: Props.ResponsiveNumber((props, device) => ({\n label: 'Stagger',\n min: 0,\n step: 0.05,\n suffix: 's',\n defaultValue: DEFAULT_ITEM_STAGGER_DURATION,\n hidden: isHiddenBasedOnItemAnimation(props, device),\n })),\n hidePlaceholder: Checkbox(props => ({\n label: 'Hide placeholder',\n hidden: props.children != null,\n })),\n children: Props.Grid(),\n },\n },\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAWO;AACP,IAAAA,2BAAsB;AAEtB,yBAA0D;AAC1D,uBAAuC;AACvC,IAAAC,oBAMO;AACP,IAAAC,gBAAqB;AAGd,SAAS,kBAAkB,SAAuB;AACvD,WAAS,6BACP,OACA,UACA,UACS;AACT,UAAM,YAAY,MAAM,QAAQ;AAChC,gBACG,2CAAqC,QAAQ,eAAe,GAAG,WAAW,QAAQ,GAAG,SACpF,YAAY;AAAA,EAElB;AACA,QAAM,8BAA8B,CAAC,OAAgC,aACnE,6BAA6B,OAAO,UAAU,gBAAgB;AAChE,QAAM,+BAA+B,CAAC,OAAgC,aACpE,6BAA6B,OAAO,UAAU,iBAAiB;AAEjE,SAAO,QAAQ;AAAA,QACb,oBAAK,MAAM,6CAAO,OAAO,GAAC;AAAA,IAC1B;AAAA,MACE,MAAM,wCAAuB;AAAA,MAC7B,OAAO;AAAA,MACP,OAAO;AAAA,QACL,QAAI,mCAAU;AAAA,QACd,aAAa,+BAAM,YAAY;AAAA,QAC/B,WAAO,+BAAM;AAAA,UACX,QAAQ,8BAAM,OAAO;AAAA,UACrB,cAAc,EAAE,OAAO,KAAK,MAAM,IAAI;AAAA,QACxC,CAAC;AAAA,QACD,QAAQ,+BAAM,yBAAyB;AAAA,UACrC,OAAO;AAAA,UACP,SAAS;AAAA,YACP,EAAE,OAAO,QAAQ,OAAO,QAAQ,MAAM,eAAe;AAAA,YACrD,EAAE,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AAO,YAAY,OAAO,YAAY;AAAA,YACxC,EAAE,OAAO,UAAU,OAAO,UAAU;AAAA,YACpC,EAAE,OAAO,UAAU,OAAO,UAAU;AAAA,YACpC,EAAE,OAAO,WAAW,OAAO,WAAW;AAAA,YACtC,EAAE,OAAO,aAAa,OAAO,aAAa;AAAA,UAC5C;AAAA,UACA,cAAc;AAAA,QAChB,CAAC;AAAA,QACD,qBAAqB,+BAAM,iBAAiB,CAAC,OAAO,YAAY;AAAA,UAC9D,OAAO;AAAA,UACP,cAAc;AAAA,UACd,KAAK;AAAA,UACL,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,QAAQ,6BAA6B,OAAO,MAAM;AAAA,QACpD,EAAE;AAAA,QACF,kBAAkB,+BAAM,iBAAiB,CAAC,OAAO,YAAY;AAAA,UAC3D,OAAO;AAAA,UACP,cAAc;AAAA,UACd,KAAK;AAAA,UACL,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,QAAQ,6BAA6B,OAAO,MAAM;AAAA,QACpD,EAAE;AAAA,QACF,qBAAqB,+BAAM,iBAAiB,CAAC,OAAO,YAAY;AAAA,UAC9D,OAAO;AAAA,UACP,KAAK;AAAA,UACL,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,cAAc;AAAA,UACd,QAAQ,6BAA6B,OAAO,MAAM;AAAA,QACpD,EAAE;AAAA,QACF,qBAAiB,kCAAS,YAAU;AAAA,UAClC,OAAO;AAAA,UACP,QAAQ,MAAM,YAAY;AAAA,QAC5B,EAAE;AAAA,QACF,UAAU,+BAAM,KAAK;AAAA,MACvB;AAAA,IACF;AAAA,EACF;AACF;","names":["import_prop_controllers","import_constants","import_react"]}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/builtin/Box/register.ts"],"sourcesContent":["import {\n Border,\n BorderRadius,\n Checkbox,\n ElementID,\n GapX,\n GapY,\n Grid,\n Margin,\n Padding,\n Shadows,\n Width,\n} from '@makeswift/prop-controllers'\nimport { Props } from '../../../prop-controllers'\nimport { ReactRuntime } from '../../../runtimes/react'\nimport { findBreakpointOverride, getBaseBreakpoint } from '../../../state/modules/breakpoints'\nimport { MakeswiftComponentType } from '../constants'\nimport {\n BoxAnimateIn,\n DEFAULT_BOX_ANIMATE_DELAY,\n DEFAULT_BOX_ANIMATE_DURATION,\n DEFAULT_ITEM_ANIMATE_DELAY,\n DEFAULT_ITEM_STAGGER_DURATION,\n} from './constants'\nimport { lazy } from 'react'\nimport { ResponsiveSelectValue } from '../../../prop-controllers/descriptors'\n\nexport function registerComponent(runtime: ReactRuntime) {\n function isHiddenBasedOnAnimationType(\n props: Record<string, unknown>,\n deviceId: string,\n property: 'boxAnimateType' | 'itemAnimateType',\n ): boolean {\n const animateIn = props[property] as ResponsiveSelectValue<BoxAnimateIn> | undefined\n return (\n (findBreakpointOverride<BoxAnimateIn>(runtime.getBreakpoints(), animateIn, deviceId)?.value ??\n 'none') === 'none'\n )\n }\n const isHiddenBasedOnBoxAnimation = (props: Record<string, unknown>, deviceId: string) =>\n isHiddenBasedOnAnimationType(props, deviceId, 'boxAnimateType')\n const isHiddenBasedOnItemAnimation = (props: Record<string, unknown>, deviceId: string) =>\n isHiddenBasedOnAnimationType(props, deviceId, 'itemAnimateType')\n\n return runtime.registerComponent(\n lazy(() => import('./Box')),\n {\n type: MakeswiftComponentType.Box,\n label: 'Box',\n props: {\n id: ElementID(),\n backgrounds: Props.Backgrounds(),\n width: Width({\n format: Width.Format.ClassName,\n defaultValue: { value: 100, unit: '%' },\n }),\n height: Props.ResponsiveIconRadioGroup({\n label: 'Height',\n options: [\n { value: 'auto', label: 'Auto', icon: 'HeightAuto16' },\n { value: 'stretch', label: 'Stretch', icon: 'HeightMatch16' },\n ],\n defaultValue: 'auto',\n }),\n verticalAlign: Props.ResponsiveIconRadioGroup({\n label: 'Align items',\n options: [\n { value: 'flex-start', label: 'Top', icon: 'VerticalAlignStart16' },\n { value: 'center', label: 'Middle', icon: 'VerticalAlignMiddle16' },\n { value: 'flex-end', label: 'Bottom', icon: 'VerticalAlignEnd16' },\n {\n value: 'space-between',\n label: 'Space between',\n icon: 'VerticalAlignSpaceBetween16',\n },\n ],\n defaultValue: 'flex-start',\n }),\n margin: Margin({ format: Margin.Format.ClassName }),\n padding: Padding({\n format: Padding.Format.ClassName,\n preset: [\n {\n deviceId: getBaseBreakpoint(runtime.getBreakpoints()).id,\n value: {\n paddingTop: { value: 10, unit: 'px' },\n paddingRight: { value: 10, unit: 'px' },\n paddingBottom: { value: 10, unit: 'px' },\n paddingLeft: { value: 10, unit: 'px' },\n },\n },\n ],\n }),\n border: Border({ format: Border.Format.ClassName }),\n borderRadius: BorderRadius({ format: BorderRadius.Format.ClassName }),\n boxShadow: Shadows({ format: Shadows.Format.ClassName }),\n rowGap: GapY(props => ({\n hidden: props.children == null,\n })),\n columnGap: GapX(props => ({\n hidden: props.children == null,\n })),\n boxAnimateType: Props.ResponsiveSelect({\n label: 'Animate box in',\n labelOrientation: 'vertical',\n options: [\n { value: 'none', label: 'None' },\n { value: 'fadeIn', label: 'Fade in' },\n { value: 'fadeRight', label: 'Fade right' },\n { value: 'fadeDown', label: 'Fade down' },\n { value: 'fadeLeft', label: 'Fade left' },\n { value: 'fadeUp', label: 'Fade up' },\n { value: 'blurIn', label: 'Blur in' },\n { value: 'scaleUp', label: 'Scale up' },\n { value: 'scaleDown', label: 'Scale down' },\n ],\n defaultValue: 'none',\n }),\n boxAnimateDuration: Props.ResponsiveNumber((props, device) => ({\n label: 'Box duration',\n defaultValue: DEFAULT_BOX_ANIMATE_DURATION,\n min: 0.1,\n step: 0.05,\n suffix: 's',\n hidden: isHiddenBasedOnBoxAnimation(props, device),\n })),\n boxAnimateDelay: Props.ResponsiveNumber((props, device) => ({\n label: 'Box delay',\n defaultValue: DEFAULT_BOX_ANIMATE_DELAY,\n min: 0,\n step: 0.05,\n suffix: 's',\n hidden: isHiddenBasedOnBoxAnimation(props, device),\n })),\n itemAnimateType: Props.ResponsiveSelect({\n label: 'Animate items in',\n labelOrientation: 'vertical',\n options: [\n { value: 'none', label: 'None' },\n { value: 'fadeIn', label: 'Fade in' },\n { value: 'fadeRight', label: 'Fade right' },\n { value: 'fadeDown', label: 'Fade down' },\n { value: 'fadeLeft', label: 'Fade left' },\n { value: 'fadeUp', label: 'Fade up' },\n { value: 'blurIn', label: 'Blur in' },\n { value: 'scaleUp', label: 'Scale up' },\n { value: 'scaleDown', label: 'Scale down' },\n ],\n defaultValue: 'none',\n }),\n itemAnimateDuration: Props.ResponsiveNumber((props, device) => ({\n label: 'Items duration',\n defaultValue: DEFAULT_BOX_ANIMATE_DURATION,\n min: 0.1,\n step: 0.05,\n suffix: 's',\n hidden: isHiddenBasedOnItemAnimation(props, device),\n })),\n itemAnimateDelay: Props.ResponsiveNumber((props, device) => ({\n label: 'Items delay',\n defaultValue: DEFAULT_ITEM_ANIMATE_DELAY,\n min: 0,\n step: 0.05,\n suffix: 's',\n hidden: isHiddenBasedOnItemAnimation(props, device),\n })),\n itemStaggerDuration: Props.ResponsiveNumber((props, device) => ({\n label: 'Stagger',\n min: 0,\n step: 0.05,\n suffix: 's',\n defaultValue: DEFAULT_ITEM_STAGGER_DURATION,\n hidden: isHiddenBasedOnItemAnimation(props, device),\n })),\n hidePlaceholder: Checkbox(props => ({\n label: 'Hide placeholder',\n hidden: props.children != null,\n })),\n children: Grid(),\n },\n },\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAYO;AACP,IAAAA,2BAAsB;AAEtB,yBAA0D;AAC1D,uBAAuC;AACvC,IAAAC,oBAMO;AACP,IAAAC,gBAAqB;AAGd,SAAS,kBAAkB,SAAuB;AACvD,WAAS,6BACP,OACA,UACA,UACS;AACT,UAAM,YAAY,MAAM,QAAQ;AAChC,gBACG,2CAAqC,QAAQ,eAAe,GAAG,WAAW,QAAQ,GAAG,SACpF,YAAY;AAAA,EAElB;AACA,QAAM,8BAA8B,CAAC,OAAgC,aACnE,6BA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,YAAY;AAAA,UAC9D,OAAO;AAAA,UACP,KAAK;AAAA,UACL,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,cAAc;AAAA,UACd,QAAQ,6BAA6B,OAAO,MAAM;AAAA,QACpD,EAAE;AAAA,QACF,qBAAiB,kCAAS,YAAU;AAAA,UAClC,OAAO;AAAA,UACP,QAAQ,MAAM,YAAY;AAAA,QAC5B,EAAE;AAAA,QACF,cAAU,8BAAK;AAAA,MACjB;AAAA,IACF;AAAA,EACF;AACF;","names":["import_prop_controllers","import_constants","import_react"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/builtin/Root/Root.tsx"],"sourcesContent":["import { normalize } from 'polished'\nimport { forwardRef, Ref } from 'react'\n\nimport Placeholder from './components/Placeholder'\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/builtin/Root/Root.tsx"],"sourcesContent":["import { normalize } from 'polished'\nimport { forwardRef, Ref } from 'react'\n\nimport Placeholder from './components/Placeholder'\nimport type { BackgroundsValue } from '../../../prop-controllers/descriptors'\nimport { Element } from '../../../runtimes/react'\nimport BackgroundsContainer from '../../shared/BackgroundsContainer'\nimport { useGlobalStyle } from '../../../runtimes/react/use-global-style'\nimport { GridItem } from '../../shared/grid-item'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { GridData, ResponsiveGapData } from '@makeswift/prop-controllers'\n\ntype Props = {\n children?: GridData\n backgrounds?: BackgroundsValue\n rowGap?: ResponsiveGapData\n columnGap?: ResponsiveGapData\n}\n\nconst Root = forwardRef(function Page(\n { children, backgrounds, rowGap, columnGap }: Props,\n ref: Ref<HTMLDivElement>,\n) {\n useGlobalStyle({\n html: {\n boxSizing: 'border-box',\n },\n '*, *::before, *::after': {\n boxSizing: 'inherit',\n },\n })\n\n useGlobalStyle(normalize())\n\n return (\n <BackgroundsContainer ref={ref} style={{ background: 'white' }} backgrounds={backgrounds}>\n <div className={useStyle({ display: 'flex', flexWrap: 'wrap', width: '100%' })}>\n {children && children.elements.length > 0 ? (\n children.elements.map((child, index) => (\n <GridItem\n key={child.key}\n grid={children.columns}\n index={index}\n columnGap={columnGap}\n rowGap={rowGap}\n >\n <Element element={child} />\n </GridItem>\n ))\n ) : (\n <Placeholder />\n )}\n </div>\n </BackgroundsContainer>\n )\n})\n\nexport default Root\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8Cc;AA9Cd,sBAA0B;AAC1B,mBAAgC;AAEhC,yBAAwB;AAExB,IAAAA,gBAAwB;AACxB,kCAAiC;AACjC,8BAA+B;AAC/B,uBAAyB;AACzB,uBAAyB;AAUzB,MAAM,WAAO,yBAAW,SAAS,KAC/B,EAAE,UAAU,aAAa,QAAQ,UAAU,GAC3C,KACA;AACA,8CAAe;AAAA,IACb,MAAM;AAAA,MACJ,WAAW;AAAA,IACb;AAAA,IACA,0BAA0B;AAAA,MACxB,WAAW;AAAA,IACb;AAAA,EACF,CAAC;AAED,kDAAe,2BAAU,CAAC;AAE1B,SACE,4CAAC,4BAAAC,SAAA,EAAqB,KAAU,OAAO,EAAE,YAAY,QAAQ,GAAG,aAC9D,sDAAC,SAAI,eAAW,2BAAS,EAAE,SAAS,QAAQ,UAAU,QAAQ,OAAO,OAAO,CAAC,GAC1E,sBAAY,SAAS,SAAS,SAAS,IACtC,SAAS,SAAS,IAAI,CAAC,OAAO,UAC5B;AAAA,IAAC;AAAA;AAAA,MAEC,MAAM,SAAS;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MAEA,sDAAC,yBAAQ,SAAS,OAAO;AAAA;AAAA,IANpB,MAAM;AAAA,EAOb,CACD,IAED,4CAAC,mBAAAC,SAAA,EAAY,GAEjB,GACF;AAEJ,CAAC;AAED,IAAO,eAAQ;","names":["import_react","BackgroundsContainer","Placeholder"]}
|
|
@@ -43,7 +43,7 @@ function registerComponent(runtime) {
|
|
|
43
43
|
label: "Page",
|
|
44
44
|
hidden: true,
|
|
45
45
|
props: {
|
|
46
|
-
children:
|
|
46
|
+
children: (0, import_prop_controllers.Grid)(),
|
|
47
47
|
backgrounds: import_prop_controllers2.Props.Backgrounds(),
|
|
48
48
|
rowGap: (0, import_prop_controllers.GapY)(),
|
|
49
49
|
columnGap: (0, import_prop_controllers.GapX)()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/builtin/Root/register.ts"],"sourcesContent":["import { GapX, GapY } from '@makeswift/prop-controllers'\nimport { Props } from '../../../prop-controllers'\nimport { ReactRuntime } from '../../../react'\nimport { MakeswiftComponentType } from '../constants'\nimport { lazy } from 'react'\n\nexport function registerComponent(runtime: ReactRuntime) {\n return runtime.registerComponent(\n lazy(() => import('./Root')),\n {\n type: MakeswiftComponentType.Root,\n label: 'Page',\n hidden: true,\n props: {\n children:
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/builtin/Root/register.ts"],"sourcesContent":["import { GapX, GapY, Grid } from '@makeswift/prop-controllers'\nimport { Props } from '../../../prop-controllers'\nimport { ReactRuntime } from '../../../react'\nimport { MakeswiftComponentType } from '../constants'\nimport { lazy } from 'react'\n\nexport function registerComponent(runtime: ReactRuntime) {\n return runtime.registerComponent(\n lazy(() => import('./Root')),\n {\n type: MakeswiftComponentType.Root,\n label: 'Page',\n hidden: true,\n props: {\n children: Grid(),\n backgrounds: Props.Backgrounds(),\n rowGap: GapY(),\n columnGap: GapX(),\n },\n },\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAAiC;AACjC,IAAAA,2BAAsB;AAEtB,uBAAuC;AACvC,IAAAC,gBAAqB;AAEd,SAAS,kBAAkB,SAAuB;AACvD,SAAO,QAAQ;AAAA,QACb,oBAAK,MAAM,6CAAO,QAAQ,GAAC;AAAA,IAC3B;AAAA,MACE,MAAM,wCAAuB;AAAA,MAC7B,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,OAAO;AAAA,QACL,cAAU,8BAAK;AAAA,QACf,aAAa,+BAAM,YAAY;AAAA,QAC/B,YAAQ,8BAAK;AAAA,QACb,eAAW,8BAAK;AAAA,MAClB;AAAA,IACF;AAAA,EACF;AACF;","names":["import_prop_controllers","import_react"]}
|
|
@@ -37,6 +37,7 @@ var import_descriptors = require("../prop-controllers/descriptors");
|
|
|
37
37
|
var import_prop_controllers = require("@makeswift/prop-controllers");
|
|
38
38
|
var import_copy = require("../prop-controllers/copy");
|
|
39
39
|
var import_rich_text = require("./rich-text");
|
|
40
|
+
var import_prop_controllers2 = require("../prop-controllers");
|
|
40
41
|
var import_dto = require("./rich-text-v2/dto");
|
|
41
42
|
var import_copy2 = require("./rich-text-v2/copy");
|
|
42
43
|
var import_rich_text_v2 = require("./rich-text-v2/rich-text-v2");
|
|
@@ -44,7 +45,7 @@ var import_translation = require("./rich-text-v2/translation");
|
|
|
44
45
|
function copy(definition, value, context) {
|
|
45
46
|
switch (definition.type) {
|
|
46
47
|
case import_descriptors.Types.Backgrounds:
|
|
47
|
-
case
|
|
48
|
+
case import_prop_controllers.Types.Grid:
|
|
48
49
|
case import_prop_controllers.Types.NavigationLinks:
|
|
49
50
|
case import_prop_controllers.Types.Link:
|
|
50
51
|
case import_prop_controllers.Types.Shadows:
|
|
@@ -54,7 +55,7 @@ function copy(definition, value, context) {
|
|
|
54
55
|
case import_prop_controllers.Types.TableFormFields:
|
|
55
56
|
case import_prop_controllers.Types.Table:
|
|
56
57
|
case import_prop_controllers.Types.Border:
|
|
57
|
-
case
|
|
58
|
+
case import_prop_controllers2.DELETED_PROP_CONTROLLER_TYPES.RichText:
|
|
58
59
|
case import_prop_controllers.Types.ElementID:
|
|
59
60
|
return (0, import_copy.copy)(definition, value, context);
|
|
60
61
|
case import_rich_text.RichTextControlType:
|
|
@@ -125,8 +126,8 @@ function mergeTranslatedData(definition, data, translatedData, context) {
|
|
|
125
126
|
if (translatedData == null)
|
|
126
127
|
return data;
|
|
127
128
|
return translatedData;
|
|
128
|
-
case
|
|
129
|
-
return (0,
|
|
129
|
+
case import_prop_controllers.Types.Grid:
|
|
130
|
+
return (0, import_prop_controllers.mergeGridPropControllerTranslatedData)(data, context);
|
|
130
131
|
case import_slot.SlotControlType:
|
|
131
132
|
return (0, import_slot.mergeSlotControlTranslatedData)(data, context);
|
|
132
133
|
case import_rich_text_v2.RichTextV2ControlType:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/controls/control.ts"],"sourcesContent":["import { CheckboxControlData, CheckboxControlDefinition } from './checkbox'\nimport { ColorControlData, ColorControlDefinition, ColorControlType, copyColorData } from './color'\nimport { ComboboxControlData, ComboboxControlDefinition } from './combobox'\nimport { ImageControlData, ImageControlDefinition, copyImageData, ImageControlType } from './image'\nimport { LinkControlData, LinkControlDefinition, copyLinkData, LinkControlType } from './link'\nimport {\n ListControlData,\n ListControlDefinition,\n copyListData,\n ListControlType,\n getListTranslatableData,\n mergeListTranslatedData,\n ListControlTranslationDto,\n} from './list'\nimport { NumberControlData, NumberControlDefinition } from './number'\nimport { SelectControlData, SelectControlDefinition } from './select'\nimport {\n ShapeControlData,\n ShapeControlDefinition,\n copyShapeData,\n ShapeControlType,\n getShapeTranslatableData,\n mergeShapeTranslatedData,\n ShapeControlTranslationDto,\n} from './shape'\nimport { TextAreaControlData, TextAreaControlDefinition, TextAreaControlType } from './text-area'\nimport {\n TextInputControlData,\n TextInputControlDefinition,\n TextInputControlType,\n} from './text-input'\nimport { copyStyleData, StyleControlData, StyleControlDefinition, StyleControlType } from './style'\nimport {\n copySlotData,\n mergeSlotControlTranslatedData,\n mergeSlotData,\n SlotControlData,\n SlotControlDefinition,\n SlotControlType,\n} from './slot'\n\nimport {\n Descriptor,\n GridValue,\n IndexSignatureHack,\n Types,\n mergeGridPropControllerTranslatedData,\n} from '../prop-controllers/descriptors'\nimport { Types as PropControllerTypes } from '@makeswift/prop-controllers'\nimport { copy as propControllerCopy } from '../prop-controllers/copy'\nimport { CopyContext, Data, MergeContext, MergeTranslatableDataContext } from '../state/react-page'\nimport {\n RichTextControlData,\n RichTextControlDefinition,\n RichTextControlType,\n copyRichTextData,\n richTextDTOtoDAO,\n} from './rich-text'\nimport { PropControllerDescriptor } from '../prop-controllers'\n\nimport { richTextV2DescendentsToData } from './rich-text-v2/dto'\nimport { copyRichTextV2Data } from './rich-text-v2/copy'\nimport {\n RichTextV2ControlData,\n RichTextV2ControlDefinition,\n RichTextV2ControlType,\n isRichTextV1Data,\n} from './rich-text-v2/rich-text-v2'\n\nimport { StyleV2ControlData, StyleV2ControlDefinition } from './style-v2'\nimport { IconRadioGroupControlData, IconRadioGroupControlDefinition } from './icon-radio-group'\nimport { TypographyControlData, TypographyControlDefinition } from './typography'\nimport {\n RichTextV2ControlTranslationDto,\n getRichTextV2TranslatableData,\n mergeRichTextV2TranslatedData,\n} from './rich-text-v2/translation'\n\nexport type ControlDefinition =\n | CheckboxControlDefinition\n | NumberControlDefinition\n | TextInputControlDefinition\n | TextAreaControlDefinition\n | SelectControlDefinition\n | ColorControlDefinition\n | IconRadioGroupControlDefinition\n | ImageControlDefinition\n | ComboboxControlDefinition\n | ShapeControlDefinition\n | ListControlDefinition<any>\n | LinkControlDefinition\n | SlotControlDefinition\n | ShapeControlDefinition\n | RichTextControlDefinition\n | RichTextV2ControlDefinition\n | StyleControlDefinition\n | StyleV2ControlDefinition\n | TypographyControlDefinition\n\nexport type ControlDefinitionData<T extends ControlDefinition> = T extends CheckboxControlDefinition\n ? CheckboxControlData\n : T extends NumberControlDefinition\n ? NumberControlData\n : T extends TextInputControlDefinition\n ? TextInputControlData\n : T extends TextAreaControlDefinition\n ? TextAreaControlData\n : T extends SelectControlDefinition\n ? SelectControlData<T>\n : T extends ColorControlDefinition\n ? ColorControlData\n : T extends IconRadioGroupControlDefinition\n ? IconRadioGroupControlData<T>\n : T extends ImageControlDefinition\n ? ImageControlData\n : T extends ComboboxControlDefinition\n ? ComboboxControlData<T>\n : T extends ShapeControlDefinition\n ? ShapeControlData<T>\n : T extends ListControlDefinition\n ? ListControlData<T>\n : T extends LinkControlDefinition\n ? LinkControlData\n : T extends RichTextControlDefinition\n ? IndexSignatureHack<RichTextControlData>\n : T extends RichTextV2ControlDefinition\n ? RichTextV2ControlData\n : T extends StyleControlDefinition\n ? StyleControlData\n : T extends StyleV2ControlDefinition\n ? StyleV2ControlData\n : T extends TypographyControlDefinition\n ? TypographyControlData\n : never\n\nexport function copy(definition: Descriptor | ControlDefinition, value: any, context: CopyContext) {\n switch (definition.type) {\n case Types.Backgrounds:\n case Types.Grid:\n case PropControllerTypes.NavigationLinks:\n case PropControllerTypes.Link:\n case PropControllerTypes.Shadows:\n case Types.Image:\n case Types.Images:\n case PropControllerTypes.ResponsiveColor:\n case PropControllerTypes.TableFormFields:\n case PropControllerTypes.Table:\n case PropControllerTypes.Border:\n case Types.RichText:\n case PropControllerTypes.ElementID:\n return propControllerCopy(definition, value, context)\n case RichTextControlType:\n return copyRichTextData(value, context)\n case RichTextV2ControlType:\n return copyRichTextV2Data(\n isRichTextV1Data(value) ? richTextV2DescendentsToData(richTextDTOtoDAO(value)) : value,\n context,\n )\n case ColorControlType:\n return copyColorData(value, context)\n case ImageControlType:\n return copyImageData(value, context)\n case LinkControlType:\n return copyLinkData(value, context)\n case ShapeControlType:\n return copyShapeData(definition, value, context)\n case ListControlType:\n return copyListData(definition, value, context)\n case StyleControlType:\n return copyStyleData(value, context)\n case SlotControlType:\n return copySlotData(value, context)\n default:\n return value\n }\n}\n\nexport function merge(\n definition: PropControllerDescriptor,\n a: Data,\n b: Data = a,\n context: MergeContext,\n): Data {\n switch (definition.type) {\n case SlotControlType:\n return mergeSlotData(a as SlotControlData, b as SlotControlData, context)\n\n default:\n return b\n }\n}\n\nexport function getTranslatableData(definition: Descriptor | ControlDefinition, data: Data): Data {\n switch (definition.type) {\n case Types.TextInput:\n case PropControllerTypes.TextArea:\n case TextInputControlType:\n case TextAreaControlType:\n return data\n\n case RichTextV2ControlType:\n const richTextData = data as RichTextV2ControlData | RichTextControlData\n\n if (isRichTextV1Data(richTextData)) return null\n\n return getRichTextV2TranslatableData(definition, richTextData as RichTextV2ControlData)\n\n case ListControlType:\n if (data == null) return null\n\n return getListTranslatableData(definition, data as ListControlData)\n\n case ShapeControlType:\n if (data == null) return null\n\n return getShapeTranslatableData(definition, data as ShapeControlData)\n\n default:\n return null\n }\n}\n\nexport function mergeTranslatedData(\n definition: PropControllerDescriptor,\n data: Data,\n translatedData: Data,\n context: MergeTranslatableDataContext,\n): Data {\n if (data == null) return data\n\n switch (definition.type) {\n case Types.TextInput:\n case PropControllerTypes.TextArea:\n case TextInputControlType:\n case TextAreaControlType:\n if (translatedData == null) return data\n\n return translatedData\n\n case Types.Grid:\n return mergeGridPropControllerTranslatedData(data as GridValue, context)\n\n case SlotControlType:\n return mergeSlotControlTranslatedData(data as SlotControlData, context)\n\n case RichTextV2ControlType:\n if (translatedData == null) return data\n\n return mergeRichTextV2TranslatedData(\n definition,\n data as RichTextV2ControlData,\n translatedData as RichTextV2ControlTranslationDto,\n )\n\n case ListControlType:\n if (translatedData == null) return data\n\n return mergeListTranslatedData(\n definition,\n data as ListControlData,\n translatedData as ListControlTranslationDto,\n context,\n )\n\n case ShapeControlType:\n if (translatedData == null) return data\n\n return mergeShapeTranslatedData(\n definition,\n data as ShapeControlData,\n translatedData as ShapeControlTranslationDto,\n context,\n )\n\n default:\n return data\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAA0F;AAE1F,mBAA0F;AAC1F,kBAAsF;AACtF,kBAQO;AAGP,mBAQO;AACP,uBAAoF;AACpF,wBAIO;AACP,mBAA0F;AAC1F,kBAOO;AAEP,yBAMO;AACP,8BAA6C;AAC7C,kBAA2C;AAE3C,uBAMO;AAGP,iBAA4C;AAC5C,IAAAA,eAAmC;AACnC,0BAKO;AAKP,yBAIO;AA2DA,SAAS,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
+
{"version":3,"sources":["../../../src/controls/control.ts"],"sourcesContent":["import { CheckboxControlData, CheckboxControlDefinition } from './checkbox'\nimport { ColorControlData, ColorControlDefinition, ColorControlType, copyColorData } from './color'\nimport { ComboboxControlData, ComboboxControlDefinition } from './combobox'\nimport { ImageControlData, ImageControlDefinition, copyImageData, ImageControlType } from './image'\nimport { LinkControlData, LinkControlDefinition, copyLinkData, LinkControlType } from './link'\nimport {\n ListControlData,\n ListControlDefinition,\n copyListData,\n ListControlType,\n getListTranslatableData,\n mergeListTranslatedData,\n ListControlTranslationDto,\n} from './list'\nimport { NumberControlData, NumberControlDefinition } from './number'\nimport { SelectControlData, SelectControlDefinition } from './select'\nimport {\n ShapeControlData,\n ShapeControlDefinition,\n copyShapeData,\n ShapeControlType,\n getShapeTranslatableData,\n mergeShapeTranslatedData,\n ShapeControlTranslationDto,\n} from './shape'\nimport { TextAreaControlData, TextAreaControlDefinition, TextAreaControlType } from './text-area'\nimport {\n TextInputControlData,\n TextInputControlDefinition,\n TextInputControlType,\n} from './text-input'\nimport { copyStyleData, StyleControlData, StyleControlDefinition, StyleControlType } from './style'\nimport {\n copySlotData,\n mergeSlotControlTranslatedData,\n mergeSlotData,\n SlotControlData,\n SlotControlDefinition,\n SlotControlType,\n} from './slot'\n\nimport { Descriptor, Types } from '../prop-controllers/descriptors'\nimport {\n GridPropControllerData,\n Types as PropControllerTypes,\n mergeGridPropControllerTranslatedData,\n} from '@makeswift/prop-controllers'\nimport { copy as propControllerCopy } from '../prop-controllers/copy'\nimport { CopyContext, Data, MergeContext, MergeTranslatableDataContext } from '../state/react-page'\nimport {\n RichTextControlData,\n RichTextControlDefinition,\n RichTextControlType,\n copyRichTextData,\n richTextDTOtoDAO,\n} from './rich-text'\nimport { DELETED_PROP_CONTROLLER_TYPES, PropControllerDescriptor } from '../prop-controllers'\n\nimport { richTextV2DescendentsToData } from './rich-text-v2/dto'\nimport { copyRichTextV2Data } from './rich-text-v2/copy'\nimport {\n RichTextV2ControlData,\n RichTextV2ControlDefinition,\n RichTextV2ControlType,\n isRichTextV1Data,\n} from './rich-text-v2/rich-text-v2'\n\nimport { StyleV2ControlData, StyleV2ControlDefinition } from './style-v2'\nimport { IconRadioGroupControlData, IconRadioGroupControlDefinition } from './icon-radio-group'\nimport { TypographyControlData, TypographyControlDefinition } from './typography'\nimport {\n RichTextV2ControlTranslationDto,\n getRichTextV2TranslatableData,\n mergeRichTextV2TranslatedData,\n} from './rich-text-v2/translation'\nimport { IndexSignatureHack } from '../utils/index-signature-hack'\n\nexport type ControlDefinition =\n | CheckboxControlDefinition\n | NumberControlDefinition\n | TextInputControlDefinition\n | TextAreaControlDefinition\n | SelectControlDefinition\n | ColorControlDefinition\n | IconRadioGroupControlDefinition\n | ImageControlDefinition\n | ComboboxControlDefinition\n | ShapeControlDefinition\n | ListControlDefinition<any>\n | LinkControlDefinition\n | SlotControlDefinition\n | ShapeControlDefinition\n | RichTextControlDefinition\n | RichTextV2ControlDefinition\n | StyleControlDefinition\n | StyleV2ControlDefinition\n | TypographyControlDefinition\n\nexport type ControlDefinitionData<T extends ControlDefinition> = T extends CheckboxControlDefinition\n ? CheckboxControlData\n : T extends NumberControlDefinition\n ? NumberControlData\n : T extends TextInputControlDefinition\n ? TextInputControlData\n : T extends TextAreaControlDefinition\n ? TextAreaControlData\n : T extends SelectControlDefinition\n ? SelectControlData<T>\n : T extends ColorControlDefinition\n ? ColorControlData\n : T extends IconRadioGroupControlDefinition\n ? IconRadioGroupControlData<T>\n : T extends ImageControlDefinition\n ? ImageControlData\n : T extends ComboboxControlDefinition\n ? ComboboxControlData<T>\n : T extends ShapeControlDefinition\n ? ShapeControlData<T>\n : T extends ListControlDefinition\n ? ListControlData<T>\n : T extends LinkControlDefinition\n ? LinkControlData\n : T extends RichTextControlDefinition\n ? IndexSignatureHack<RichTextControlData>\n : T extends RichTextV2ControlDefinition\n ? RichTextV2ControlData\n : T extends StyleControlDefinition\n ? StyleControlData\n : T extends StyleV2ControlDefinition\n ? StyleV2ControlData\n : T extends TypographyControlDefinition\n ? TypographyControlData\n : never\n\nexport function copy(definition: Descriptor | ControlDefinition, value: any, context: CopyContext) {\n switch (definition.type) {\n case Types.Backgrounds:\n case PropControllerTypes.Grid:\n case PropControllerTypes.NavigationLinks:\n case PropControllerTypes.Link:\n case PropControllerTypes.Shadows:\n case Types.Image:\n case Types.Images:\n case PropControllerTypes.ResponsiveColor:\n case PropControllerTypes.TableFormFields:\n case PropControllerTypes.Table:\n case PropControllerTypes.Border:\n case DELETED_PROP_CONTROLLER_TYPES.RichText:\n case PropControllerTypes.ElementID:\n return propControllerCopy(definition, value, context)\n case RichTextControlType:\n return copyRichTextData(value, context)\n case RichTextV2ControlType:\n return copyRichTextV2Data(\n isRichTextV1Data(value) ? richTextV2DescendentsToData(richTextDTOtoDAO(value)) : value,\n context,\n )\n case ColorControlType:\n return copyColorData(value, context)\n case ImageControlType:\n return copyImageData(value, context)\n case LinkControlType:\n return copyLinkData(value, context)\n case ShapeControlType:\n return copyShapeData(definition, value, context)\n case ListControlType:\n return copyListData(definition, value, context)\n case StyleControlType:\n return copyStyleData(value, context)\n case SlotControlType:\n return copySlotData(value, context)\n default:\n return value\n }\n}\n\nexport function merge(\n definition: PropControllerDescriptor,\n a: Data,\n b: Data = a,\n context: MergeContext,\n): Data {\n switch (definition.type) {\n case SlotControlType:\n return mergeSlotData(a as SlotControlData, b as SlotControlData, context)\n\n default:\n return b\n }\n}\n\nexport function getTranslatableData(definition: Descriptor | ControlDefinition, data: Data): Data {\n switch (definition.type) {\n case Types.TextInput:\n case PropControllerTypes.TextArea:\n case TextInputControlType:\n case TextAreaControlType:\n return data\n\n case RichTextV2ControlType:\n const richTextData = data as RichTextV2ControlData | RichTextControlData\n\n if (isRichTextV1Data(richTextData)) return null\n\n return getRichTextV2TranslatableData(definition, richTextData as RichTextV2ControlData)\n\n case ListControlType:\n if (data == null) return null\n\n return getListTranslatableData(definition, data as ListControlData)\n\n case ShapeControlType:\n if (data == null) return null\n\n return getShapeTranslatableData(definition, data as ShapeControlData)\n\n default:\n return null\n }\n}\n\nexport function mergeTranslatedData(\n definition: PropControllerDescriptor,\n data: Data,\n translatedData: Data,\n context: MergeTranslatableDataContext,\n): Data {\n if (data == null) return data\n\n switch (definition.type) {\n case Types.TextInput:\n case PropControllerTypes.TextArea:\n case TextInputControlType:\n case TextAreaControlType:\n if (translatedData == null) return data\n\n return translatedData\n\n case PropControllerTypes.Grid:\n return mergeGridPropControllerTranslatedData(data as GridPropControllerData, context)\n\n case SlotControlType:\n return mergeSlotControlTranslatedData(data as SlotControlData, context)\n\n case RichTextV2ControlType:\n if (translatedData == null) return data\n\n return mergeRichTextV2TranslatedData(\n definition,\n data as RichTextV2ControlData,\n translatedData as RichTextV2ControlTranslationDto,\n )\n\n case ListControlType:\n if (translatedData == null) return data\n\n return mergeListTranslatedData(\n definition,\n data as ListControlData,\n translatedData as ListControlTranslationDto,\n context,\n )\n\n case ShapeControlType:\n if (translatedData == null) return data\n\n return mergeShapeTranslatedData(\n definition,\n data as ShapeControlData,\n translatedData as ShapeControlTranslationDto,\n context,\n )\n\n default:\n return data\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAA0F;AAE1F,mBAA0F;AAC1F,kBAAsF;AACtF,kBAQO;AAGP,mBAQO;AACP,uBAAoF;AACpF,wBAIO;AACP,mBAA0F;AAC1F,kBAOO;AAEP,yBAAkC;AAClC,8BAIO;AACP,kBAA2C;AAE3C,uBAMO;AACP,IAAAA,2BAAwE;AAExE,iBAA4C;AAC5C,IAAAC,eAAmC;AACnC,0BAKO;AAKP,yBAIO;AA4DA,SAAS,KAAK,YAA4C,OAAY,SAAsB;AACjG,UAAQ,WAAW,MAAM;AAAA,IACvB,KAAK,yBAAM;AAAA,IACX,KAAK,wBAAAC,MAAoB;AAAA,IACzB,KAAK,wBAAAA,MAAoB;AAAA,IACzB,KAAK,wBAAAA,MA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AK;AACH,YAAM,eAAe;AAErB,cAAI,sCAAiB,YAAY;AAAG,eAAO;AAE3C,iBAAO,kDAA8B,YAAY,YAAqC;AAAA,IAExF,KAAK;AACH,UAAI,QAAQ;AAAM,eAAO;AAEzB,iBAAO,qCAAwB,YAAY,IAAuB;AAAA,IAEpE,KAAK;AACH,UAAI,QAAQ;AAAM,eAAO;AAEzB,iBAAO,uCAAyB,YAAY,IAAwB;AAAA,IAEtE;AACE,aAAO;AAAA,EACX;AACF;AAEO,SAAS,oBACd,YACA,MACA,gBACA,SACM;AACN,MAAI,QAAQ;AAAM,WAAO;AAEzB,UAAQ,WAAW,MAAM;AAAA,IACvB,KAAK,yBAAM;AAAA,IACX,KAAK,wBAAAA,MAAoB;AAAA,IACzB,KAAK;AAAA,IACL,KAAK;AACH,UAAI,kBAAkB;AAAM,eAAO;AAEnC,aAAO;AAAA,IAET,KAAK,wBAAAA,MAAoB;AACvB,iBAAO,+DAAsC,MAAgC,OAAO;AAAA,IAEtF,KAAK;AACH,iBAAO,4CAA+B,MAAyB,OAAO;AAAA,IAExE,KAAK;AACH,UAAI,kBAAkB;AAAM,eAAO;AAEnC,iBAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IAEF,KAAK;AACH,UAAI,kBAAkB;AAAM,eAAO;AAEnC,iBAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IAEF,KAAK;AACH,UAAI,kBAAkB;AAAM,eAAO;AAEnC,iBAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IAEF;AACE,aAAO;AAAA,EACX;AACF;","names":["import_prop_controllers","import_copy","PropControllerTypes","propControllerCopy"]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var data_exports = {};
|
|
20
|
+
__export(data_exports, {
|
|
21
|
+
dataSchema: () => dataSchema,
|
|
22
|
+
deletableElementSchema: () => deletableElementSchema,
|
|
23
|
+
elementDataSchema: () => elementDataSchema,
|
|
24
|
+
elementReferenceSchema: () => elementReferenceSchema,
|
|
25
|
+
elementSchema: () => elementSchema
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(data_exports);
|
|
28
|
+
var import_zod = require("zod");
|
|
29
|
+
const dataSchema = import_zod.z.union([
|
|
30
|
+
import_zod.z.undefined(),
|
|
31
|
+
import_zod.z.null(),
|
|
32
|
+
import_zod.z.boolean(),
|
|
33
|
+
import_zod.z.number(),
|
|
34
|
+
import_zod.z.string(),
|
|
35
|
+
import_zod.z.array(import_zod.z.lazy(() => dataSchema)),
|
|
36
|
+
import_zod.z.record(import_zod.z.lazy(() => dataSchema))
|
|
37
|
+
]);
|
|
38
|
+
const elementDataSchema = import_zod.z.object({
|
|
39
|
+
type: import_zod.z.string(),
|
|
40
|
+
key: import_zod.z.string(),
|
|
41
|
+
props: import_zod.z.record(dataSchema)
|
|
42
|
+
});
|
|
43
|
+
const elementReferenceSchema = import_zod.z.object({
|
|
44
|
+
type: import_zod.z.literal("reference"),
|
|
45
|
+
key: import_zod.z.string(),
|
|
46
|
+
value: import_zod.z.string()
|
|
47
|
+
});
|
|
48
|
+
const elementSchema = import_zod.z.union([elementDataSchema, elementReferenceSchema]);
|
|
49
|
+
const deletableElementSchema = import_zod.z.union([
|
|
50
|
+
elementDataSchema.extend({
|
|
51
|
+
deleted: import_zod.z.boolean().optional()
|
|
52
|
+
}),
|
|
53
|
+
elementReferenceSchema.extend({
|
|
54
|
+
deleted: import_zod.z.boolean().optional()
|
|
55
|
+
})
|
|
56
|
+
]);
|
|
57
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
58
|
+
0 && (module.exports = {
|
|
59
|
+
dataSchema,
|
|
60
|
+
deletableElementSchema,
|
|
61
|
+
elementDataSchema,
|
|
62
|
+
elementReferenceSchema,
|
|
63
|
+
elementSchema
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/controls/data.ts"],"sourcesContent":["import { z } from 'zod'\n\nexport type Data = undefined | null | boolean | number | string | Data[] | { [key: string]: Data }\n\nexport const dataSchema: z.ZodType<Data> = z.union([\n z.undefined(),\n z.null(),\n z.boolean(),\n z.number(),\n z.string(),\n z.array(z.lazy(() => dataSchema)),\n z.record(z.lazy(() => dataSchema)),\n])\n\nexport const elementDataSchema = z.object({\n type: z.string(),\n key: z.string(),\n props: z.record(dataSchema),\n})\n\nexport type ElementData = z.infer<typeof elementDataSchema>\n\nexport const elementReferenceSchema = z.object({\n type: z.literal('reference'),\n key: z.string(),\n value: z.string(),\n})\n\nexport type ElementReference = z.infer<typeof elementReferenceSchema>\n\nexport const elementSchema = z.union([elementDataSchema, elementReferenceSchema])\n\nexport const deletableElementSchema = z.union([\n elementDataSchema.extend({\n deleted: z.boolean().optional(),\n }),\n elementReferenceSchema.extend({\n deleted: z.boolean().optional(),\n }),\n])\n\nexport type Element = z.infer<typeof elementSchema>\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAkB;AAIX,MAAM,aAA8B,aAAE,MAAM;AAAA,EACjD,aAAE,UAAU;AAAA,EACZ,aAAE,KAAK;AAAA,EACP,aAAE,QAAQ;AAAA,EACV,aAAE,OAAO;AAAA,EACT,aAAE,OAAO;AAAA,EACT,aAAE,MAAM,aAAE,KAAK,MAAM,UAAU,CAAC;AAAA,EAChC,aAAE,OAAO,aAAE,KAAK,MAAM,UAAU,CAAC;AACnC,CAAC;AAEM,MAAM,oBAAoB,aAAE,OAAO;AAAA,EACxC,MAAM,aAAE,OAAO;AAAA,EACf,KAAK,aAAE,OAAO;AAAA,EACd,OAAO,aAAE,OAAO,UAAU;AAC5B,CAAC;AAIM,MAAM,yBAAyB,aAAE,OAAO;AAAA,EAC7C,MAAM,aAAE,QAAQ,WAAW;AAAA,EAC3B,KAAK,aAAE,OAAO;AAAA,EACd,OAAO,aAAE,OAAO;AAClB,CAAC;AAIM,MAAM,gBAAgB,aAAE,MAAM,CAAC,mBAAmB,sBAAsB,CAAC;AAEzE,MAAM,yBAAyB,aAAE,MAAM;AAAA,EAC5C,kBAAkB,OAAO;AAAA,IACvB,SAAS,aAAE,QAAQ,EAAE,SAAS;AAAA,EAChC,CAAC;AAAA,EACD,uBAAuB,OAAO;AAAA,IAC5B,SAAS,aAAE,QAAQ,EAAE,SAAS;AAAA,EAChC,CAAC;AACH,CAAC;","names":[]}
|