@makeswift/runtime 0.0.0-5c3c3d6 → 0.0.0-602aed3
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/builder.js +1 -0
- package/dist/actions.cjs.js +29 -2
- package/dist/actions.cjs.js.map +1 -1
- package/dist/actions.es.js +25 -2
- package/dist/actions.es.js.map +1 -1
- package/dist/api.cjs.js +1 -2
- package/dist/api.cjs.js.map +1 -1
- package/dist/box-model.cjs.js +2 -2
- package/dist/box-model.es.js +1 -0
- package/dist/box-model.es.js.map +1 -1
- package/dist/box-models.cjs.js +5 -143
- package/dist/box-models.cjs.js.map +1 -1
- package/dist/box-models.es.js +8 -146
- package/dist/box-models.es.js.map +1 -1
- package/dist/builder.cjs.js +9 -0
- package/dist/builder.cjs.js.map +1 -0
- package/dist/builder.es.js +3 -0
- package/dist/builder.es.js.map +1 -0
- package/dist/components.cjs.js +20 -2
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.es.js +19 -1
- package/dist/components.es.js.map +1 -1
- package/dist/constants.cjs.js +96 -1
- package/dist/constants.cjs.js.map +1 -1
- package/dist/constants.es.js +96 -1
- package/dist/constants.es.js.map +1 -1
- package/dist/control-serialization.cjs.js +110 -0
- package/dist/control-serialization.cjs.js.map +1 -0
- package/dist/control-serialization.es.js +106 -0
- package/dist/control-serialization.es.js.map +1 -0
- package/dist/descriptors.cjs.js +9 -3
- package/dist/descriptors.cjs.js.map +1 -1
- package/dist/descriptors.es.js +8 -4
- package/dist/descriptors.es.js.map +1 -1
- package/dist/instances.cjs.js +17 -0
- package/dist/instances.cjs.js.map +1 -1
- package/dist/instances.es.js +17 -1
- package/dist/instances.es.js.map +1 -1
- package/dist/main.cjs.js +9 -2
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +5 -1
- package/dist/main.es.js.map +1 -1
- package/dist/next.cjs.js +171 -0
- package/dist/next.cjs.js.map +1 -0
- package/dist/next.es.js +161 -0
- package/dist/next.es.js.map +1 -0
- package/dist/prop-controllers.cjs.js +2 -2
- package/dist/prop-controllers.es.js +1 -1
- package/dist/react-builder-preview.cjs.js +77 -4109
- package/dist/react-builder-preview.cjs.js.map +1 -1
- package/dist/react-builder-preview.es.js +65 -4101
- package/dist/react-builder-preview.es.js.map +1 -1
- package/dist/react-page.cjs.js +262 -0
- package/dist/react-page.cjs.js.map +1 -0
- package/dist/react-page.es.js +241 -0
- package/dist/react-page.es.js.map +1 -0
- package/dist/react.cjs.js +22 -3
- package/dist/react.cjs.js.map +1 -1
- package/dist/react.cjs2.js +5442 -31673
- package/dist/react.cjs2.js.map +1 -1
- package/dist/react.es.js +19 -1
- package/dist/react.es.js.map +1 -1
- package/dist/react.es2.js +5378 -31605
- package/dist/react.es2.js.map +1 -1
- package/dist/types/api/constants.d.ts.map +1 -1
- package/dist/types/api/generated/graphql.d.ts +59 -0
- package/dist/types/api/generated/graphql.d.ts.map +1 -1
- package/dist/types/api/react.d.ts +3 -1
- package/dist/types/api/react.d.ts.map +1 -1
- package/dist/types/api/types.d.ts +2 -2
- package/dist/types/api/types.d.ts.map +1 -1
- package/dist/types/builder/index.d.ts +2 -0
- package/dist/types/builder/index.d.ts.map +1 -0
- package/dist/types/builder/serialization/control-serialization.d.ts +50 -0
- package/dist/types/builder/serialization/control-serialization.d.ts.map +1 -0
- package/dist/types/builder/serialization/function-serialization.d.ts +11 -0
- package/dist/types/builder/serialization/function-serialization.d.ts.map +1 -0
- package/dist/types/builder/serialization/index.d.ts +3 -0
- package/dist/types/builder/serialization/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/Form.d.ts +41 -0
- package/dist/types/components/builtin/Form/Form.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +15 -0
- package/dist/types/components/builtin/Form/components/Field/components/Checkbox/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/components/Field/components/CheckboxTableField/index.d.ts +15 -0
- package/dist/types/components/builtin/Form/components/Field/components/CheckboxTableField/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/components/Field/components/EmailTableField/index.d.ts +11 -0
- package/dist/types/components/builtin/Form/components/Field/components/EmailTableField/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/components/Field/components/Input/index.d.ts +14 -0
- package/dist/types/components/builtin/Form/components/Field/components/Input/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/components/Field/components/Label/index.d.ts +16 -0
- package/dist/types/components/builtin/Form/components/Field/components/Label/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/components/Field/components/LongTextTableField/index.d.ts +10 -0
- package/dist/types/components/builtin/Form/components/Field/components/LongTextTableField/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/components/Field/components/MultipleSelectTableField/index.d.ts +23 -0
- package/dist/types/components/builtin/Form/components/Field/components/MultipleSelectTableField/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/components/Field/components/NumberTableField/index.d.ts +11 -0
- package/dist/types/components/builtin/Form/components/Field/components/NumberTableField/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/components/Field/components/PhoneNumberTableField/index.d.ts +11 -0
- package/dist/types/components/builtin/Form/components/Field/components/PhoneNumberTableField/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/components/Field/components/PlaceholderTableField/index.d.ts +3 -0
- package/dist/types/components/builtin/Form/components/Field/components/PlaceholderTableField/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/components/Field/components/RadioButton/index.d.ts +17 -0
- package/dist/types/components/builtin/Form/components/Field/components/RadioButton/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/components/Field/components/SingleLineTextTableField/index.d.ts +11 -0
- package/dist/types/components/builtin/Form/components/Field/components/SingleLineTextTableField/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnRadioButtonGroup/index.d.ts +23 -0
- package/dist/types/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnRadioButtonGroup/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnSingleSelect/index.d.ts +19 -0
- package/dist/types/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnSingleSelect/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/components/Field/components/SingleSelectTableField/index.d.ts +24 -0
- package/dist/types/components/builtin/Form/components/Field/components/SingleSelectTableField/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/components/Field/components/TextArea/index.d.ts +13 -0
- package/dist/types/components/builtin/Form/components/Field/components/TextArea/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/components/Field/components/URLTableField/index.d.ts +11 -0
- package/dist/types/components/builtin/Form/components/Field/components/URLTableField/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/components/Field/index.d.ts +19 -0
- package/dist/types/components/builtin/Form/components/Field/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/components/Field/services/cssField.d.ts +11 -0
- package/dist/types/components/builtin/Form/components/Field/services/cssField.d.ts.map +1 -0
- package/dist/types/components/{Embed/Embed.d.ts → builtin/Form/components/Placeholder/index.d.ts} +2 -4
- package/dist/types/components/builtin/Form/components/Placeholder/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/components/Spinner/index.d.ts +3 -0
- package/dist/types/components/builtin/Form/components/Spinner/index.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/context/FormContext.d.ts +32 -0
- package/dist/types/components/builtin/Form/context/FormContext.d.ts.map +1 -0
- package/dist/types/components/builtin/Form/index.d.ts +2 -0
- package/dist/types/components/builtin/Form/index.d.ts.map +1 -0
- package/dist/types/components/builtin/index.d.ts +1 -0
- package/dist/types/components/builtin/index.d.ts.map +1 -1
- package/dist/types/components/hooks/index.d.ts +1 -0
- package/dist/types/components/hooks/index.d.ts.map +1 -1
- package/dist/types/components/hooks/useTable.d.ts +66 -0
- package/dist/types/components/hooks/useTable.d.ts.map +1 -0
- package/dist/types/components/hooks/useTableFormFieldRefs.d.ts +8 -0
- package/dist/types/components/hooks/useTableFormFieldRefs.d.ts.map +1 -0
- package/dist/types/components/utils/queries.d.ts +1 -0
- package/dist/types/components/utils/queries.d.ts.map +1 -1
- package/dist/types/components/utils/types.d.ts +1 -2
- package/dist/types/components/utils/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/next.d.ts +21 -0
- package/dist/types/next.d.ts.map +1 -0
- package/dist/types/prop-controllers/descriptors.d.ts +27 -9
- package/dist/types/prop-controllers/descriptors.d.ts.map +1 -1
- package/dist/types/prop-controllers/index.d.ts +3 -3
- package/dist/types/prop-controllers/index.d.ts.map +1 -1
- package/dist/types/prop-controllers/instances.d.ts +36 -4
- package/dist/types/prop-controllers/instances.d.ts.map +1 -1
- package/dist/types/react.d.ts +1 -1
- package/dist/types/react.d.ts.map +1 -1
- package/dist/types/runtimes/react.d.ts +12 -5
- package/dist/types/runtimes/react.d.ts.map +1 -1
- package/dist/types/state/actions.d.ts +47 -1
- package/dist/types/state/actions.d.ts.map +1 -1
- package/dist/types/state/modules/box-models.d.ts.map +1 -1
- package/dist/types/state/modules/read-only-documents.d.ts +8 -4
- package/dist/types/state/modules/read-only-documents.d.ts.map +1 -1
- package/dist/types/state/modules/read-write-documents.d.ts +1 -1
- package/dist/types/state/modules/read-write-documents.d.ts.map +1 -1
- package/dist/types/state/react-builder-preview.d.ts.map +1 -1
- package/dist/types/state/react-page.d.ts +3 -3
- package/dist/types/state/react-page.d.ts.map +1 -1
- package/next.js +1 -0
- package/package.json +31 -31
- package/dist/deepEqual.cjs.js +0 -40
- package/dist/deepEqual.cjs.js.map +0 -1
- package/dist/deepEqual.es.js +0 -39
- package/dist/deepEqual.es.js.map +0 -1
- package/dist/immutable.es.cjs.js +0 -4459
- package/dist/immutable.es.cjs.js.map +0 -1
- package/dist/immutable.es.es.js +0 -4450
- package/dist/immutable.es.es.js.map +0 -1
- package/dist/shallowEqual.cjs.js +0 -24
- package/dist/shallowEqual.cjs.js.map +0 -1
- package/dist/shallowEqual.es.js +0 -23
- package/dist/shallowEqual.es.js.map +0 -1
- package/dist/types/api/getFragment.d.ts +0 -4
- package/dist/types/api/getFragment.d.ts.map +0 -1
- package/dist/types/codegen-loader.d.ts +0 -2
- package/dist/types/codegen-loader.d.ts.map +0 -1
- package/dist/types/components/BackgroundsContainer/components/BackgroundVideo/index.d.ts +0 -11
- package/dist/types/components/BackgroundsContainer/components/BackgroundVideo/index.d.ts.map +0 -1
- package/dist/types/components/BackgroundsContainer/components/Backgrounds/index.d.ts +0 -8
- package/dist/types/components/BackgroundsContainer/components/Backgrounds/index.d.ts.map +0 -1
- package/dist/types/components/BackgroundsContainer/components/Parallax/index.d.ts +0 -11
- package/dist/types/components/BackgroundsContainer/components/Parallax/index.d.ts.map +0 -1
- package/dist/types/components/BackgroundsContainer/index.d.ts +0 -11
- package/dist/types/components/BackgroundsContainer/index.d.ts.map +0 -1
- package/dist/types/components/Box/Box.d.ts +0 -30
- package/dist/types/components/Box/Box.d.ts.map +0 -1
- package/dist/types/components/Box/animations.d.ts +0 -69
- package/dist/types/components/Box/animations.d.ts.map +0 -1
- package/dist/types/components/Box/components/Placeholder/index.d.ts +0 -7
- package/dist/types/components/Box/components/Placeholder/index.d.ts.map +0 -1
- package/dist/types/components/Box/index.d.ts +0 -3
- package/dist/types/components/Box/index.d.ts.map +0 -1
- package/dist/types/components/Carousel/Carousel.d.ts +0 -25
- package/dist/types/components/Carousel/Carousel.d.ts.map +0 -1
- package/dist/types/components/Carousel/index.d.ts +0 -2
- package/dist/types/components/Carousel/index.d.ts.map +0 -1
- package/dist/types/components/Countdown/Countdown.d.ts +0 -24
- package/dist/types/components/Countdown/Countdown.d.ts.map +0 -1
- package/dist/types/components/Countdown/index.d.ts +0 -2
- package/dist/types/components/Countdown/index.d.ts.map +0 -1
- package/dist/types/components/Divider/Divider.d.ts +0 -14
- package/dist/types/components/Divider/Divider.d.ts.map +0 -1
- package/dist/types/components/Divider/index.d.ts +0 -2
- package/dist/types/components/Divider/index.d.ts.map +0 -1
- package/dist/types/components/Embed/Embed.d.ts.map +0 -1
- package/dist/types/components/Embed/index.d.ts +0 -2
- package/dist/types/components/Embed/index.d.ts.map +0 -1
- package/dist/types/components/Image/Image.d.ts +0 -26
- package/dist/types/components/Image/Image.d.ts.map +0 -1
- package/dist/types/components/Image/index.d.ts +0 -2
- package/dist/types/components/Image/index.d.ts.map +0 -1
- package/dist/types/components/Link/index.d.ts +0 -9
- package/dist/types/components/Link/index.d.ts.map +0 -1
- package/dist/types/components/RichText/index.d.ts +0 -5
- package/dist/types/components/RichText/index.d.ts.map +0 -1
- package/dist/types/components/Root/Root.d.ts +0 -11
- package/dist/types/components/Root/Root.d.ts.map +0 -1
- package/dist/types/components/Root/components/Placeholder/index.d.ts +0 -5
- package/dist/types/components/Root/components/Placeholder/index.d.ts.map +0 -1
- package/dist/types/components/Root/index.d.ts +0 -2
- package/dist/types/components/Root/index.d.ts.map +0 -1
- package/dist/types/components/builtin/Text/components/RichTextEditor/components/Link/index.d.ts +0 -9
- package/dist/types/components/builtin/Text/components/RichTextEditor/components/Link/index.d.ts.map +0 -1
- package/dist/types/components/builtin/Text/hooks/useRichText.d.ts +0 -1
- package/dist/types/components/builtin/Text/hooks/useRichText.d.ts.map +0 -1
- package/dist/types/components/builtin/Text/prop-controllers.d.ts +0 -286
- package/dist/types/components/builtin/Text/prop-controllers.d.ts.map +0 -1
- package/dist/types/components/hooks/useRichText.d.ts +0 -18
- package/dist/types/components/hooks/useRichText.d.ts.map +0 -1
- package/dist/types/components/shared/RichTextEditor/components/Block/index.d.ts +0 -24
- package/dist/types/components/shared/RichTextEditor/components/Block/index.d.ts.map +0 -1
- package/dist/types/components/shared/RichTextEditor/components/Link/index.d.ts +0 -9
- package/dist/types/components/shared/RichTextEditor/components/Link/index.d.ts.map +0 -1
- package/dist/types/components/shared/RichTextEditor/components/Mark/hooks/useTypographyMark.d.ts +0 -23
- package/dist/types/components/shared/RichTextEditor/components/Mark/hooks/useTypographyMark.d.ts.map +0 -1
- package/dist/types/components/shared/RichTextEditor/components/Mark/index.d.ts +0 -13
- package/dist/types/components/shared/RichTextEditor/components/Mark/index.d.ts.map +0 -1
- package/dist/types/components/shared/RichTextEditor/index.d.ts +0 -5
- package/dist/types/components/shared/RichTextEditor/index.d.ts.map +0 -1
- package/dist/types/components/shared/RichTextEditor/plugins/DeviceOverridesBlocks.d.ts +0 -3
- package/dist/types/components/shared/RichTextEditor/plugins/DeviceOverridesBlocks.d.ts.map +0 -1
- package/dist/types/components/shared/RichTextEditor/plugins/DeviceOverridesMarks.d.ts +0 -3
- package/dist/types/components/shared/RichTextEditor/plugins/DeviceOverridesMarks.d.ts.map +0 -1
- package/dist/types/components/shared/RichTextEditor/plugins/Inlines.d.ts +0 -3
- package/dist/types/components/shared/RichTextEditor/plugins/Inlines.d.ts.map +0 -1
- package/dist/types/components/shared/RichTextEditor/plugins/Link.d.ts +0 -3
- package/dist/types/components/shared/RichTextEditor/plugins/Link.d.ts.map +0 -1
- package/dist/types/components/utils/contants.d.ts +0 -5
- package/dist/types/components/utils/contants.d.ts.map +0 -1
- package/dist/types/components/utils/intersection.d.ts +0 -4
- package/dist/types/components/utils/intersection.d.ts.map +0 -1
- package/dist/types/components/utils/keys.d.ts +0 -5
- package/dist/types/components/utils/keys.d.ts.map +0 -1
- package/dist/types/generated/graphql.d.ts +0 -20
- package/dist/types/generated/graphql.d.ts.map +0 -1
- package/dist/types/state/modules/makeswift-api-client.d.ts +0 -17
- package/dist/types/state/modules/makeswift-api-client.d.ts.map +0 -1
- package/dist/types/types.d.ts +0 -2
- package/dist/types/types.d.ts.map +0 -1
package/dist/constants.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.es.js","sources":["../src/api/generated/graphql.ts","../src/api/constants.ts"],"sourcesContent":["import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'\nexport type SwatchFragment = {\n __typename: 'Swatch'\n id: string\n hue: number\n saturation: number\n lightness: number\n}\n\nexport type FileFragment = {\n __typename: 'File'\n id: string\n name: string\n publicUrl: any\n extension?: string | null\n dimensions?: { __typename?: 'ImageDimensions'; width: number; height: number } | null\n}\n\nexport type TypographyFragment = {\n __typename: 'Typography'\n id: string\n name: string\n style: Array<{\n __typename?: 'TypographyStyle'\n deviceId: string\n value: {\n __typename?: 'TypographyStyleValue'\n fontFamily?: string | null\n lineHeight?: number | null\n letterSpacing?: number | null\n fontWeight?: number | null\n textAlign?: string | null\n uppercase?: boolean | null\n underline?: boolean | null\n strikethrough?: boolean | null\n italic?: boolean | null\n fontSize?: { __typename?: 'Length'; value?: number | null; unit?: string | null } | null\n color?: { __typename?: 'Color'; swatchId?: string | null; alpha?: number | null } | null\n }\n }>\n}\n\nexport type PagePathnameSliceFragment = {\n __typename: 'PagePathnameSlice'\n id: string\n pathname: any\n}\n\nexport const SwatchFragmentDoc = {\n kind: 'Document',\n definitions: [\n {\n kind: 'FragmentDefinition',\n name: { kind: 'Name', value: 'Swatch' },\n typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'Swatch' } },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: '__typename' } },\n { kind: 'Field', name: { kind: 'Name', value: 'id' } },\n { kind: 'Field', name: { kind: 'Name', value: 'hue' } },\n { kind: 'Field', name: { kind: 'Name', value: 'saturation' } },\n { kind: 'Field', name: { kind: 'Name', value: 'lightness' } },\n ],\n },\n },\n ],\n} as unknown as DocumentNode<SwatchFragment, unknown>\nexport const FileFragmentDoc = {\n kind: 'Document',\n definitions: [\n {\n kind: 'FragmentDefinition',\n name: { kind: 'Name', value: 'File' },\n typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'File' } },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: '__typename' } },\n { kind: 'Field', name: { kind: 'Name', value: 'id' } },\n { kind: 'Field', name: { kind: 'Name', value: 'name' } },\n { kind: 'Field', name: { kind: 'Name', value: 'publicUrl' } },\n { kind: 'Field', name: { kind: 'Name', value: 'extension' } },\n {\n kind: 'Field',\n name: { kind: 'Name', value: 'dimensions' },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: 'width' } },\n { kind: 'Field', name: { kind: 'Name', value: 'height' } },\n ],\n },\n },\n ],\n },\n },\n ],\n} as unknown as DocumentNode<FileFragment, unknown>\nexport const TypographyFragmentDoc = {\n kind: 'Document',\n definitions: [\n {\n kind: 'FragmentDefinition',\n name: { kind: 'Name', value: 'Typography' },\n typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'Typography' } },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: '__typename' } },\n { kind: 'Field', name: { kind: 'Name', value: 'id' } },\n { kind: 'Field', name: { kind: 'Name', value: 'name' } },\n {\n kind: 'Field',\n name: { kind: 'Name', value: 'style' },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: 'deviceId' } },\n {\n kind: 'Field',\n name: { kind: 'Name', value: 'value' },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: 'fontFamily' } },\n {\n kind: 'Field',\n name: { kind: 'Name', value: 'fontSize' },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: 'value' } },\n { kind: 'Field', name: { kind: 'Name', value: 'unit' } },\n ],\n },\n },\n {\n kind: 'Field',\n name: { kind: 'Name', value: 'color' },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: 'swatchId' } },\n { kind: 'Field', name: { kind: 'Name', value: 'alpha' } },\n ],\n },\n },\n { kind: 'Field', name: { kind: 'Name', value: 'lineHeight' } },\n { kind: 'Field', name: { kind: 'Name', value: 'letterSpacing' } },\n { kind: 'Field', name: { kind: 'Name', value: 'fontWeight' } },\n { kind: 'Field', name: { kind: 'Name', value: 'textAlign' } },\n { kind: 'Field', name: { kind: 'Name', value: 'uppercase' } },\n { kind: 'Field', name: { kind: 'Name', value: 'underline' } },\n { kind: 'Field', name: { kind: 'Name', value: 'strikethrough' } },\n { kind: 'Field', name: { kind: 'Name', value: 'italic' } },\n ],\n },\n },\n ],\n },\n },\n ],\n },\n },\n ],\n} as unknown as DocumentNode<TypographyFragment, unknown>\nexport const PagePathnameSliceFragmentDoc = {\n kind: 'Document',\n definitions: [\n {\n kind: 'FragmentDefinition',\n name: { kind: 'Name', value: 'PagePathnameSlice' },\n typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'PagePathnameSlice' } },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: '__typename' } },\n { kind: 'Field', name: { kind: 'Name', value: 'id' } },\n { kind: 'Field', name: { kind: 'Name', value: 'pathname' } },\n ],\n },\n },\n ],\n} as unknown as DocumentNode<PagePathnameSliceFragment, unknown>\n","import type { DocumentNode } from 'graphql'\n\nimport {\n SwatchFragmentDoc,\n FileFragmentDoc,\n TypographyFragmentDoc,\n PagePathnameSliceFragmentDoc,\n} from './generated/graphql'\nimport type { APIResourceType } from './types'\n\nexport const Fragments: Record<APIResourceType, DocumentNode> = {\n Swatch: SwatchFragmentDoc,\n File: FileFragmentDoc,\n Typography: TypographyFragmentDoc,\n PagePathnameSlice: PagePathnameSliceFragmentDoc,\n}\n"],"names":[],"mappings":"MAgDa,oBAAoB;AAAA,EAC/B,MAAM;AAAA,EACN,aAAa;AAAA,IACX;AAAA,MACE,MAAM;AAAA,MACN,MAAM,EAAE,MAAM,QAAQ,OAAO;AAAA,MAC7B,eAAe,EAAE,MAAM,aAAa,MAAM,EAAE,MAAM,QAAQ,OAAO;AAAA,MACjE,cAAc;AAAA,QACZ,MAAM;AAAA,QACN,YAAY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
1
|
+
{"version":3,"file":"constants.es.js","sources":["../src/api/generated/graphql.ts","../src/api/constants.ts"],"sourcesContent":["import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'\nexport type SwatchFragment = {\n __typename: 'Swatch'\n id: string\n hue: number\n saturation: number\n lightness: number\n}\n\nexport type FileFragment = {\n __typename: 'File'\n id: string\n name: string\n publicUrl: any\n extension?: string | null\n dimensions?: { __typename?: 'ImageDimensions'; width: number; height: number } | null\n}\n\nexport type TypographyFragment = {\n __typename: 'Typography'\n id: string\n name: string\n style: Array<{\n __typename?: 'TypographyStyle'\n deviceId: string\n value: {\n __typename?: 'TypographyStyleValue'\n fontFamily?: string | null\n lineHeight?: number | null\n letterSpacing?: number | null\n fontWeight?: number | null\n textAlign?: string | null\n uppercase?: boolean | null\n underline?: boolean | null\n strikethrough?: boolean | null\n italic?: boolean | null\n fontSize?: { __typename?: 'Length'; value?: number | null; unit?: string | null } | null\n color?: { __typename?: 'Color'; swatchId?: string | null; alpha?: number | null } | null\n }\n }>\n}\n\nexport type PagePathnameSliceFragment = {\n __typename: 'PagePathnameSlice'\n id: string\n pathname: any\n}\n\nexport type GlobalElementFragment = { __typename: 'GlobalElement'; id: string; data: any }\n\nexport type TableFragment = {\n __typename: 'Table'\n id: string\n name: string\n columns: Array<\n | { __typename?: 'CheckboxTableColumn'; id: string; name: string }\n | { __typename?: 'EmailTableColumn'; id: string; name: string }\n | { __typename?: 'LongTextTableColumn'; id: string; name: string }\n | {\n __typename?: 'MultipleSelectTableColumn'\n id: string\n name: string\n options: Array<{ __typename?: 'MultipleSelectTableColumnOption'; id: string; name: string }>\n }\n | { __typename?: 'NumberTableColumn'; id: string; name: string }\n | { __typename?: 'PhoneNumberTableColumn'; id: string; name: string }\n | { __typename?: 'SingleLineTextTableColumn'; id: string; name: string }\n | {\n __typename?: 'SingleSelectTableColumn'\n id: string\n name: string\n options: Array<{ __typename?: 'SingleSelectTableColumnOption'; id: string; name: string }>\n }\n | { __typename?: 'URLTableColumn'; id: string; name: string }\n >\n}\n\nexport const SwatchFragmentDoc = {\n kind: 'Document',\n definitions: [\n {\n kind: 'FragmentDefinition',\n name: { kind: 'Name', value: 'Swatch' },\n typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'Swatch' } },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: '__typename' } },\n { kind: 'Field', name: { kind: 'Name', value: 'id' } },\n { kind: 'Field', name: { kind: 'Name', value: 'hue' } },\n { kind: 'Field', name: { kind: 'Name', value: 'saturation' } },\n { kind: 'Field', name: { kind: 'Name', value: 'lightness' } },\n ],\n },\n },\n ],\n} as unknown as DocumentNode<SwatchFragment, unknown>\nexport const FileFragmentDoc = {\n kind: 'Document',\n definitions: [\n {\n kind: 'FragmentDefinition',\n name: { kind: 'Name', value: 'File' },\n typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'File' } },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: '__typename' } },\n { kind: 'Field', name: { kind: 'Name', value: 'id' } },\n { kind: 'Field', name: { kind: 'Name', value: 'name' } },\n { kind: 'Field', name: { kind: 'Name', value: 'publicUrl' } },\n { kind: 'Field', name: { kind: 'Name', value: 'extension' } },\n {\n kind: 'Field',\n name: { kind: 'Name', value: 'dimensions' },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: 'width' } },\n { kind: 'Field', name: { kind: 'Name', value: 'height' } },\n ],\n },\n },\n ],\n },\n },\n ],\n} as unknown as DocumentNode<FileFragment, unknown>\nexport const TypographyFragmentDoc = {\n kind: 'Document',\n definitions: [\n {\n kind: 'FragmentDefinition',\n name: { kind: 'Name', value: 'Typography' },\n typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'Typography' } },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: '__typename' } },\n { kind: 'Field', name: { kind: 'Name', value: 'id' } },\n { kind: 'Field', name: { kind: 'Name', value: 'name' } },\n {\n kind: 'Field',\n name: { kind: 'Name', value: 'style' },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: 'deviceId' } },\n {\n kind: 'Field',\n name: { kind: 'Name', value: 'value' },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: 'fontFamily' } },\n {\n kind: 'Field',\n name: { kind: 'Name', value: 'fontSize' },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: 'value' } },\n { kind: 'Field', name: { kind: 'Name', value: 'unit' } },\n ],\n },\n },\n {\n kind: 'Field',\n name: { kind: 'Name', value: 'color' },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: 'swatchId' } },\n { kind: 'Field', name: { kind: 'Name', value: 'alpha' } },\n ],\n },\n },\n { kind: 'Field', name: { kind: 'Name', value: 'lineHeight' } },\n { kind: 'Field', name: { kind: 'Name', value: 'letterSpacing' } },\n { kind: 'Field', name: { kind: 'Name', value: 'fontWeight' } },\n { kind: 'Field', name: { kind: 'Name', value: 'textAlign' } },\n { kind: 'Field', name: { kind: 'Name', value: 'uppercase' } },\n { kind: 'Field', name: { kind: 'Name', value: 'underline' } },\n { kind: 'Field', name: { kind: 'Name', value: 'strikethrough' } },\n { kind: 'Field', name: { kind: 'Name', value: 'italic' } },\n ],\n },\n },\n ],\n },\n },\n ],\n },\n },\n ],\n} as unknown as DocumentNode<TypographyFragment, unknown>\nexport const PagePathnameSliceFragmentDoc = {\n kind: 'Document',\n definitions: [\n {\n kind: 'FragmentDefinition',\n name: { kind: 'Name', value: 'PagePathnameSlice' },\n typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'PagePathnameSlice' } },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: '__typename' } },\n { kind: 'Field', name: { kind: 'Name', value: 'id' } },\n { kind: 'Field', name: { kind: 'Name', value: 'pathname' } },\n ],\n },\n },\n ],\n} as unknown as DocumentNode<PagePathnameSliceFragment, unknown>\nexport const GlobalElementFragmentDoc = {\n kind: 'Document',\n definitions: [\n {\n kind: 'FragmentDefinition',\n name: { kind: 'Name', value: 'GlobalElement' },\n typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'GlobalElement' } },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: '__typename' } },\n { kind: 'Field', name: { kind: 'Name', value: 'id' } },\n { kind: 'Field', name: { kind: 'Name', value: 'data' } },\n ],\n },\n },\n ],\n} as unknown as DocumentNode<GlobalElementFragment, unknown>\nexport const TableFragmentDoc = {\n kind: 'Document',\n definitions: [\n {\n kind: 'FragmentDefinition',\n name: { kind: 'Name', value: 'Table' },\n typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'Table' } },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: '__typename' } },\n { kind: 'Field', name: { kind: 'Name', value: 'id' } },\n { kind: 'Field', name: { kind: 'Name', value: 'name' } },\n {\n kind: 'Field',\n name: { kind: 'Name', value: 'columns' },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: 'id' } },\n { kind: 'Field', name: { kind: 'Name', value: 'name' } },\n {\n kind: 'InlineFragment',\n typeCondition: {\n kind: 'NamedType',\n name: { kind: 'Name', value: 'MultipleSelectTableColumn' },\n },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'Field',\n name: { kind: 'Name', value: 'options' },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: 'id' } },\n { kind: 'Field', name: { kind: 'Name', value: 'name' } },\n ],\n },\n },\n ],\n },\n },\n {\n kind: 'InlineFragment',\n typeCondition: {\n kind: 'NamedType',\n name: { kind: 'Name', value: 'SingleSelectTableColumn' },\n },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'Field',\n name: { kind: 'Name', value: 'options' },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: 'id' } },\n { kind: 'Field', name: { kind: 'Name', value: 'name' } },\n ],\n },\n },\n ],\n },\n },\n ],\n },\n },\n ],\n },\n },\n ],\n} as unknown as DocumentNode<TableFragment, unknown>\n","import type { DocumentNode } from 'graphql'\n\nimport {\n SwatchFragmentDoc,\n FileFragmentDoc,\n TypographyFragmentDoc,\n PagePathnameSliceFragmentDoc,\n GlobalElementFragmentDoc,\n TableFragmentDoc,\n} from './generated/graphql'\nimport type { APIResourceType } from './types'\n\nexport const Fragments: Record<APIResourceType, DocumentNode> = {\n Swatch: SwatchFragmentDoc,\n File: FileFragmentDoc,\n Typography: TypographyFragmentDoc,\n PagePathnameSlice: PagePathnameSliceFragmentDoc,\n GlobalElement: GlobalElementFragmentDoc,\n Table: TableFragmentDoc,\n}\n"],"names":[],"mappings":"AA6EO,MAAM,oBAAoB;AAAA,EAC/B,MAAM;AAAA,EACN,aAAa;AAAA,IACX;AAAA,MACE,MAAM;AAAA,MACN,MAAM,EAAE,MAAM,QAAQ,OAAO,SAAS;AAAA,MACtC,eAAe,EAAE,MAAM,aAAa,MAAM,EAAE,MAAM,QAAQ,OAAO,WAAW;AAAA,MAC5E,cAAc;AAAA,QACZ,MAAM;AAAA,QACN,YAAY;AAAA,UACV,EAAE,MAAM,SAAS,MAAM,EAAE,MAAM,QAAQ,OAAO,eAAe;AAAA,UAC7D,EAAE,MAAM,SAAS,MAAM,EAAE,MAAM,QAAQ,OAAO,OAAO;AAAA,UACrD,EAAE,MAAM,SAAS,MAAM,EAAE,MAAM,QAAQ,OAAO,QAAQ;AAAA,UACtD,EAAE,MAAM,SAAS,MAAM,EAAE,MAAM,QAAQ,OAAO,eAAe;AAA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EAC9D,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,eAAe;AAAA,EACf,OAAO;AACT;;"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
+
var descriptors = require("./descriptors.cjs.js");
|
|
22
|
+
function serializeFunction(func) {
|
|
23
|
+
const messageChannel = new MessageChannel();
|
|
24
|
+
messageChannel.port1.onmessage = ({ data: [callId, args] }) => {
|
|
25
|
+
Promise.resolve().then(() => func.apply(null, args)).then((result) => messageChannel.port1.postMessage([callId, result]));
|
|
26
|
+
};
|
|
27
|
+
return messageChannel.port2;
|
|
28
|
+
}
|
|
29
|
+
function deserializeFunction(serializedFunction) {
|
|
30
|
+
let nextCallId = 0;
|
|
31
|
+
const calls = /* @__PURE__ */ new Map();
|
|
32
|
+
serializedFunction.onmessage = ({ data: [callId, result] }) => {
|
|
33
|
+
var _a;
|
|
34
|
+
(_a = calls.get(callId)) == null ? void 0 : _a(result);
|
|
35
|
+
calls.delete(callId);
|
|
36
|
+
};
|
|
37
|
+
return function deserializedFunction(...args) {
|
|
38
|
+
return new Promise((resolve) => {
|
|
39
|
+
const callId = nextCallId++;
|
|
40
|
+
calls.set(callId, resolve);
|
|
41
|
+
serializedFunction.postMessage([callId, args]);
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function serializeListControl(control) {
|
|
46
|
+
const { getItemLabel } = control.options;
|
|
47
|
+
const serializedGetItemLabel = getItemLabel && serializeFunction(getItemLabel);
|
|
48
|
+
return [
|
|
49
|
+
__spreadProps(__spreadValues({}, control), { options: __spreadProps(__spreadValues({}, control.options), { getItemLabel: serializedGetItemLabel }) }),
|
|
50
|
+
serializedGetItemLabel == null ? [] : [serializedGetItemLabel]
|
|
51
|
+
];
|
|
52
|
+
}
|
|
53
|
+
function deserializeListControl(serializedControl) {
|
|
54
|
+
const { getItemLabel } = serializedControl.options;
|
|
55
|
+
const deserializedGetItemLabel = getItemLabel && deserializeFunction(getItemLabel);
|
|
56
|
+
return __spreadProps(__spreadValues({}, serializedControl), {
|
|
57
|
+
options: __spreadProps(__spreadValues({}, serializedControl.options), { getItemLabel: deserializedGetItemLabel })
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function serializeTypeaheadControl(control) {
|
|
61
|
+
const { getItems } = control.options;
|
|
62
|
+
const serializedGetItems = getItems && serializeFunction(getItems);
|
|
63
|
+
return [
|
|
64
|
+
__spreadProps(__spreadValues({}, control), { options: __spreadProps(__spreadValues({}, control.options), { getItems: serializedGetItems }) }),
|
|
65
|
+
serializedGetItems == null ? [] : [serializedGetItems]
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
function deserializeTypeaheadControl(serializedControl) {
|
|
69
|
+
const { getItems } = serializedControl.options;
|
|
70
|
+
const deserializedGetItems = getItems && deserializeFunction(getItems);
|
|
71
|
+
return __spreadProps(__spreadValues({}, serializedControl), {
|
|
72
|
+
options: __spreadProps(__spreadValues({}, serializedControl.options), { getItems: deserializedGetItems })
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function serializeControl(control) {
|
|
76
|
+
switch (control.type) {
|
|
77
|
+
case descriptors.Types.List:
|
|
78
|
+
return serializeListControl(control);
|
|
79
|
+
case descriptors.Types.Typeahead:
|
|
80
|
+
return serializeTypeaheadControl(control);
|
|
81
|
+
default:
|
|
82
|
+
return [control, []];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function deserializeControl(serializedControl) {
|
|
86
|
+
switch (serializedControl.type) {
|
|
87
|
+
case descriptors.Types.List:
|
|
88
|
+
return deserializeListControl(serializedControl);
|
|
89
|
+
case descriptors.Types.Typeahead:
|
|
90
|
+
return deserializeTypeaheadControl(serializedControl);
|
|
91
|
+
default:
|
|
92
|
+
return serializedControl;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function serializeControls(controls) {
|
|
96
|
+
return Object.entries(controls).reduce(([accControls, accTransferables], [key, control]) => {
|
|
97
|
+
const [serializedControl, transferables] = serializeControl(control);
|
|
98
|
+
return [__spreadProps(__spreadValues({}, accControls), { [key]: serializedControl }), [...accTransferables, ...transferables]];
|
|
99
|
+
}, [{}, []]);
|
|
100
|
+
}
|
|
101
|
+
function deserializeControls(serializedControls) {
|
|
102
|
+
return Object.entries(serializedControls).reduce((deserializedControls, [key, serializedControl]) => {
|
|
103
|
+
return __spreadProps(__spreadValues({}, deserializedControls), { [key]: deserializeControl(serializedControl) });
|
|
104
|
+
}, {});
|
|
105
|
+
}
|
|
106
|
+
exports.deserializeControls = deserializeControls;
|
|
107
|
+
exports.deserializeFunction = deserializeFunction;
|
|
108
|
+
exports.serializeControls = serializeControls;
|
|
109
|
+
exports.serializeFunction = serializeFunction;
|
|
110
|
+
//# sourceMappingURL=control-serialization.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-serialization.cjs.js","sources":["../src/builder/serialization/function-serialization.ts","../src/builder/serialization/control-serialization.ts"],"sourcesContent":["declare const SerializedFunctionTag: unique symbol\n\ntype AnyFunction = (...args: any) => any\n\nexport type SerializedFunction<T extends AnyFunction> = MessagePort & {\n readonly [SerializedFunctionTag]: T\n}\n\ntype SerializedFunctionReturnType<T extends AnyFunction> = Awaited<ReturnType<T>>\n\nexport type DeserializedFunction<T extends AnyFunction> = (\n ...args: Parameters<T>\n) => Promise<SerializedFunctionReturnType<T>>\n\ntype CallID = number\n\nexport function serializeFunction<T extends AnyFunction>(func: T): SerializedFunction<T> {\n type CallMessageEvent = MessageEvent<[CallID, Parameters<T>]>\n\n const messageChannel = new MessageChannel()\n\n messageChannel.port1.onmessage = ({ data: [callId, args] }: CallMessageEvent) => {\n Promise.resolve()\n .then(() => func.apply(null, args))\n .then(result => messageChannel.port1.postMessage([callId, result]))\n }\n\n return messageChannel.port2 as SerializedFunction<T>\n}\n\nexport function deserializeFunction<T extends AnyFunction>(\n serializedFunction: SerializedFunction<T>,\n): DeserializedFunction<T> {\n type Result = SerializedFunctionReturnType<T>\n type ResultMessageEvent = MessageEvent<[CallID, Result]>\n type ResolveCallPromise = (value: Result | PromiseLike<Result>) => void\n\n let nextCallId = 0\n const calls = new Map<CallID, ResolveCallPromise>()\n\n serializedFunction.onmessage = ({ data: [callId, result] }: ResultMessageEvent) => {\n calls.get(callId)?.(result)\n\n calls.delete(callId)\n }\n\n return function deserializedFunction(...args) {\n return new Promise(resolve => {\n const callId = nextCallId++\n\n calls.set(callId, resolve)\n\n serializedFunction.postMessage([callId, args])\n })\n }\n}\n\nif (import.meta.vitest) {\n const { describe, test, expect } = import.meta.vitest\n\n describe.concurrent('serializeFunction & deserializeFunction', () => {\n test('simple call', async () => {\n // Arrange\n const add = deserializeFunction(serializeFunction((a, b) => a + b))\n\n // Act\n const result = await add(2, 2)\n\n // Assert\n expect(result).toBe(4)\n })\n\n test('multiple synchronous calls', async () => {\n // Arrange\n const add = deserializeFunction(serializeFunction((a, b) => a + b))\n\n // Act\n const results = await Promise.all(Array.from({ length: 5 }, (_, i) => add(1, i)))\n\n // Assert\n expect(results).toEqual([1, 2, 3, 4, 5])\n })\n })\n}\n","import {\n Data,\n ListDescriptor as ListControl,\n ListOptions as ListControlConfig,\n ListValue as ListControlValue,\n TypeaheadDescriptor as TypeaheadControl,\n TypeaheadOptions as TypeaheadControlConfig,\n TypeaheadValue as TypeaheadControlValue,\n PanelDescriptor,\n PropControllerDescriptor as Control,\n Props as Controls,\n} from '../../prop-controllers'\nimport {\n DeserializedFunction,\n deserializeFunction,\n SerializedFunction,\n serializeFunction,\n} from './function-serialization'\n\ntype SerializedListControlConfig<T extends Data> = {\n type: PanelDescriptor<T>\n label?: string\n getItemLabel?: SerializedFunction<Exclude<ListControlConfig<T>['getItemLabel'], undefined>>\n preset?: ListControlValue<T>\n defaultValue?: ListControlValue<T>\n}\n\ntype SerializedListControl<T extends ListControlValue = ListControlValue> = {\n type: typeof Controls.Types.List\n options: SerializedListControlConfig<T[number]['value']>\n}\n\nfunction serializeListControl<T extends Data>(\n control: ListControl<ListControlValue<T>>,\n): [SerializedListControl<ListControlValue<T>>, Transferable[]] {\n const { getItemLabel } = control.options\n\n const serializedGetItemLabel = getItemLabel && serializeFunction(getItemLabel)\n\n return [\n { ...control, options: { ...control.options, getItemLabel: serializedGetItemLabel } },\n serializedGetItemLabel == null ? [] : [serializedGetItemLabel],\n ]\n}\n\ntype DeserializedListControlConfig<T extends Data> = {\n type: PanelDescriptor<T>\n label?: string\n getItemLabel?: DeserializedFunction<Exclude<ListControlConfig<T>['getItemLabel'], undefined>>\n preset?: ListControlValue<T>\n defaultValue?: ListControlValue<T>\n}\n\ntype DeserializedListControl<T extends ListControlValue = ListControlValue> = {\n type: typeof Controls.Types.List\n options: DeserializedListControlConfig<T[number]['value']>\n}\n\nfunction deserializeListControl<T extends Data>(\n serializedControl: SerializedListControl<ListControlValue<T>>,\n): DeserializedListControl<ListControlValue<T>> {\n const { getItemLabel } = serializedControl.options\n\n const deserializedGetItemLabel = getItemLabel && deserializeFunction(getItemLabel)\n\n return {\n ...serializedControl,\n options: { ...serializedControl.options, getItemLabel: deserializedGetItemLabel },\n }\n}\n\ntype SerializedTypeaheadControlConfig<T extends Data> = {\n getItems: SerializedFunction<TypeaheadControlConfig<T>['getItems']>\n label?: string\n preset?: TypeaheadControlValue<T>\n defaultValue?: TypeaheadControlValue<T>\n}\n\ntype SerializedTypeaheadControl<T extends TypeaheadControlValue = TypeaheadControlValue> = {\n type: typeof Controls.Types.Typeahead\n options: SerializedTypeaheadControlConfig<T['value']>\n}\n\nfunction serializeTypeaheadControl<T extends Data>(\n control: TypeaheadControl<TypeaheadControlValue<T>>,\n): [SerializedTypeaheadControl<TypeaheadControlValue<T>>, Transferable[]] {\n const { getItems } = control.options\n\n const serializedGetItems = getItems && serializeFunction(getItems)\n\n return [\n { ...control, options: { ...control.options, getItems: serializedGetItems } },\n serializedGetItems == null ? [] : [serializedGetItems],\n ]\n}\n\ntype DeserializedTypeaheadControlConfig<T extends Data> = {\n getItems: DeserializedFunction<TypeaheadControlConfig<T>['getItems']>\n label?: string\n preset?: TypeaheadControlValue<T>\n defaultValue?: TypeaheadControlValue<T>\n}\n\ntype DeserializedTypeaheadControl<T extends TypeaheadControlValue = TypeaheadControlValue> = {\n type: typeof Controls.Types.Typeahead\n options: DeserializedTypeaheadControlConfig<T['value']>\n}\n\nfunction deserializeTypeaheadControl<T extends Data>(\n serializedControl: SerializedTypeaheadControl<TypeaheadControlValue<T>>,\n): DeserializedTypeaheadControl<TypeaheadControlValue<T>> {\n const { getItems } = serializedControl.options\n\n const deserializedGetItems = getItems && deserializeFunction(getItems)\n\n return {\n ...serializedControl,\n options: { ...serializedControl.options, getItems: deserializedGetItems },\n }\n}\n\nexport type SerializedControl =\n | Exclude<Control, ListControl | TypeaheadControl>\n | SerializedListControl\n | SerializedTypeaheadControl\n\nexport type DeserializedControl =\n | Exclude<Control, ListControl | TypeaheadControl>\n | DeserializedListControl\n | DeserializedTypeaheadControl\n\nfunction serializeControl(control: Control): [SerializedControl, Transferable[]] {\n switch (control.type) {\n case Controls.Types.List:\n return serializeListControl(control)\n\n case Controls.Types.Typeahead:\n return serializeTypeaheadControl(control)\n\n default:\n return [control, []]\n }\n}\n\nfunction deserializeControl(serializedControl: SerializedControl): DeserializedControl {\n switch (serializedControl.type) {\n case Controls.Types.List:\n return deserializeListControl(serializedControl)\n\n case Controls.Types.Typeahead:\n return deserializeTypeaheadControl(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"],"names":["Controls.Types"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgBO,2BAAkD,MAAgC;AAGjF,QAAA,iBAAiB,IAAI;AAE3B,iBAAe,MAAM,YAAY,CAAC,EAAE,MAAM,CAAC,QAAQ,YAA8B;AAC/E,YAAQ,QACL,EAAA,KAAK,MAAM,KAAK,MAAM,MAAM,IAAI,CAAC,EACjC,KAAK,CAAA,WAAU,eAAe,MAAM,YAAY,CAAC,QAAQ,MAAM,CAAC,CAAC;AAAA,EAAA;AAGtE,SAAO,eAAe;AACxB;AAEO,6BACL,oBACyB;AAKzB,MAAI,aAAa;AACX,QAAA,4B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AqB;AAAA,EAAA;AAE5E;AAYA,0BAA0B,SAAuD;AAC/E,UAAQ,QAAQ;AAAA,SACTA,YAAe,MAAA;AAClB,aAAO,qBAAqB,OAAO;AAAA,SAEhCA,YAAe,MAAA;AAClB,aAAO,0BAA0B,OAAO;AAAA;AAGjC,aAAA,CAAC,SAAS,CAAA,CAAE;AAAA;AAEzB;AAEA,4BAA4B,mBAA2D;AACrF,UAAQ,kBAAkB;AAAA,SACnBA,YAAe,MAAA;AAClB,aAAO,uBAAuB,iBAAiB;AAAA,SAE5CA,YAAe,MAAA;AAClB,aAAO,4BAA4B,iBAAiB;AAAA;AAG7C,aAAA;AAAA;AAEb;AAEO,2BACL,UACqD;AAC9C,SAAA,OAAO,QAAQ,QAAQ,EAAE,OAC9B,CAAC,CAAC,aAAa,mBAAmB,CAAC,KAAK,aAAa;AACnD,UAAM,CAAC,mBAAmB,iBAAiB,iBAAiB,OAAO;AAE5D,WAAA,CAAC,iCAAK,cAAL,GAAmB,MAAM,sBAAqB,CAAC,GAAG,kBAAkB,GAAG,aAAa,CAAC;AAAA,EAAA,GAE/F,CAAC,CAAA,GAAI,CAAE,CAAA,CACT;AACF;AAEO,6BACL,oBACqC;AAC9B,SAAA,OAAO,QAAQ,kBAAkB,EAAE,OACxC,CAAC,sBAAsB,CAAC,KAAK,uBAAuB;AAClD,WAAO,iCAAK,uBAAL,GAA4B,MAAM,mBAAmB,iBAAiB;EAC/E,GACA,CACF,CAAA;AACF;;;;;"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { T as Types } from "./descriptors.es.js";
|
|
21
|
+
function serializeFunction(func) {
|
|
22
|
+
const messageChannel = new MessageChannel();
|
|
23
|
+
messageChannel.port1.onmessage = ({ data: [callId, args] }) => {
|
|
24
|
+
Promise.resolve().then(() => func.apply(null, args)).then((result) => messageChannel.port1.postMessage([callId, result]));
|
|
25
|
+
};
|
|
26
|
+
return messageChannel.port2;
|
|
27
|
+
}
|
|
28
|
+
function deserializeFunction(serializedFunction) {
|
|
29
|
+
let nextCallId = 0;
|
|
30
|
+
const calls = /* @__PURE__ */ new Map();
|
|
31
|
+
serializedFunction.onmessage = ({ data: [callId, result] }) => {
|
|
32
|
+
var _a;
|
|
33
|
+
(_a = calls.get(callId)) == null ? void 0 : _a(result);
|
|
34
|
+
calls.delete(callId);
|
|
35
|
+
};
|
|
36
|
+
return function deserializedFunction(...args) {
|
|
37
|
+
return new Promise((resolve) => {
|
|
38
|
+
const callId = nextCallId++;
|
|
39
|
+
calls.set(callId, resolve);
|
|
40
|
+
serializedFunction.postMessage([callId, args]);
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function serializeListControl(control) {
|
|
45
|
+
const { getItemLabel } = control.options;
|
|
46
|
+
const serializedGetItemLabel = getItemLabel && serializeFunction(getItemLabel);
|
|
47
|
+
return [
|
|
48
|
+
__spreadProps(__spreadValues({}, control), { options: __spreadProps(__spreadValues({}, control.options), { getItemLabel: serializedGetItemLabel }) }),
|
|
49
|
+
serializedGetItemLabel == null ? [] : [serializedGetItemLabel]
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
function deserializeListControl(serializedControl) {
|
|
53
|
+
const { getItemLabel } = serializedControl.options;
|
|
54
|
+
const deserializedGetItemLabel = getItemLabel && deserializeFunction(getItemLabel);
|
|
55
|
+
return __spreadProps(__spreadValues({}, serializedControl), {
|
|
56
|
+
options: __spreadProps(__spreadValues({}, serializedControl.options), { getItemLabel: deserializedGetItemLabel })
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function serializeTypeaheadControl(control) {
|
|
60
|
+
const { getItems } = control.options;
|
|
61
|
+
const serializedGetItems = getItems && serializeFunction(getItems);
|
|
62
|
+
return [
|
|
63
|
+
__spreadProps(__spreadValues({}, control), { options: __spreadProps(__spreadValues({}, control.options), { getItems: serializedGetItems }) }),
|
|
64
|
+
serializedGetItems == null ? [] : [serializedGetItems]
|
|
65
|
+
];
|
|
66
|
+
}
|
|
67
|
+
function deserializeTypeaheadControl(serializedControl) {
|
|
68
|
+
const { getItems } = serializedControl.options;
|
|
69
|
+
const deserializedGetItems = getItems && deserializeFunction(getItems);
|
|
70
|
+
return __spreadProps(__spreadValues({}, serializedControl), {
|
|
71
|
+
options: __spreadProps(__spreadValues({}, serializedControl.options), { getItems: deserializedGetItems })
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function serializeControl(control) {
|
|
75
|
+
switch (control.type) {
|
|
76
|
+
case Types.List:
|
|
77
|
+
return serializeListControl(control);
|
|
78
|
+
case Types.Typeahead:
|
|
79
|
+
return serializeTypeaheadControl(control);
|
|
80
|
+
default:
|
|
81
|
+
return [control, []];
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function deserializeControl(serializedControl) {
|
|
85
|
+
switch (serializedControl.type) {
|
|
86
|
+
case Types.List:
|
|
87
|
+
return deserializeListControl(serializedControl);
|
|
88
|
+
case Types.Typeahead:
|
|
89
|
+
return deserializeTypeaheadControl(serializedControl);
|
|
90
|
+
default:
|
|
91
|
+
return serializedControl;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function serializeControls(controls) {
|
|
95
|
+
return Object.entries(controls).reduce(([accControls, accTransferables], [key, control]) => {
|
|
96
|
+
const [serializedControl, transferables] = serializeControl(control);
|
|
97
|
+
return [__spreadProps(__spreadValues({}, accControls), { [key]: serializedControl }), [...accTransferables, ...transferables]];
|
|
98
|
+
}, [{}, []]);
|
|
99
|
+
}
|
|
100
|
+
function deserializeControls(serializedControls) {
|
|
101
|
+
return Object.entries(serializedControls).reduce((deserializedControls, [key, serializedControl]) => {
|
|
102
|
+
return __spreadProps(__spreadValues({}, deserializedControls), { [key]: deserializeControl(serializedControl) });
|
|
103
|
+
}, {});
|
|
104
|
+
}
|
|
105
|
+
export { serializeFunction as a, deserializeFunction as b, deserializeControls as d, serializeControls as s };
|
|
106
|
+
//# sourceMappingURL=control-serialization.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-serialization.es.js","sources":["../src/builder/serialization/function-serialization.ts","../src/builder/serialization/control-serialization.ts"],"sourcesContent":["declare const SerializedFunctionTag: unique symbol\n\ntype AnyFunction = (...args: any) => any\n\nexport type SerializedFunction<T extends AnyFunction> = MessagePort & {\n readonly [SerializedFunctionTag]: T\n}\n\ntype SerializedFunctionReturnType<T extends AnyFunction> = Awaited<ReturnType<T>>\n\nexport type DeserializedFunction<T extends AnyFunction> = (\n ...args: Parameters<T>\n) => Promise<SerializedFunctionReturnType<T>>\n\ntype CallID = number\n\nexport function serializeFunction<T extends AnyFunction>(func: T): SerializedFunction<T> {\n type CallMessageEvent = MessageEvent<[CallID, Parameters<T>]>\n\n const messageChannel = new MessageChannel()\n\n messageChannel.port1.onmessage = ({ data: [callId, args] }: CallMessageEvent) => {\n Promise.resolve()\n .then(() => func.apply(null, args))\n .then(result => messageChannel.port1.postMessage([callId, result]))\n }\n\n return messageChannel.port2 as SerializedFunction<T>\n}\n\nexport function deserializeFunction<T extends AnyFunction>(\n serializedFunction: SerializedFunction<T>,\n): DeserializedFunction<T> {\n type Result = SerializedFunctionReturnType<T>\n type ResultMessageEvent = MessageEvent<[CallID, Result]>\n type ResolveCallPromise = (value: Result | PromiseLike<Result>) => void\n\n let nextCallId = 0\n const calls = new Map<CallID, ResolveCallPromise>()\n\n serializedFunction.onmessage = ({ data: [callId, result] }: ResultMessageEvent) => {\n calls.get(callId)?.(result)\n\n calls.delete(callId)\n }\n\n return function deserializedFunction(...args) {\n return new Promise(resolve => {\n const callId = nextCallId++\n\n calls.set(callId, resolve)\n\n serializedFunction.postMessage([callId, args])\n })\n }\n}\n\nif (import.meta.vitest) {\n const { describe, test, expect } = import.meta.vitest\n\n describe.concurrent('serializeFunction & deserializeFunction', () => {\n test('simple call', async () => {\n // Arrange\n const add = deserializeFunction(serializeFunction((a, b) => a + b))\n\n // Act\n const result = await add(2, 2)\n\n // Assert\n expect(result).toBe(4)\n })\n\n test('multiple synchronous calls', async () => {\n // Arrange\n const add = deserializeFunction(serializeFunction((a, b) => a + b))\n\n // Act\n const results = await Promise.all(Array.from({ length: 5 }, (_, i) => add(1, i)))\n\n // Assert\n expect(results).toEqual([1, 2, 3, 4, 5])\n })\n })\n}\n","import {\n Data,\n ListDescriptor as ListControl,\n ListOptions as ListControlConfig,\n ListValue as ListControlValue,\n TypeaheadDescriptor as TypeaheadControl,\n TypeaheadOptions as TypeaheadControlConfig,\n TypeaheadValue as TypeaheadControlValue,\n PanelDescriptor,\n PropControllerDescriptor as Control,\n Props as Controls,\n} from '../../prop-controllers'\nimport {\n DeserializedFunction,\n deserializeFunction,\n SerializedFunction,\n serializeFunction,\n} from './function-serialization'\n\ntype SerializedListControlConfig<T extends Data> = {\n type: PanelDescriptor<T>\n label?: string\n getItemLabel?: SerializedFunction<Exclude<ListControlConfig<T>['getItemLabel'], undefined>>\n preset?: ListControlValue<T>\n defaultValue?: ListControlValue<T>\n}\n\ntype SerializedListControl<T extends ListControlValue = ListControlValue> = {\n type: typeof Controls.Types.List\n options: SerializedListControlConfig<T[number]['value']>\n}\n\nfunction serializeListControl<T extends Data>(\n control: ListControl<ListControlValue<T>>,\n): [SerializedListControl<ListControlValue<T>>, Transferable[]] {\n const { getItemLabel } = control.options\n\n const serializedGetItemLabel = getItemLabel && serializeFunction(getItemLabel)\n\n return [\n { ...control, options: { ...control.options, getItemLabel: serializedGetItemLabel } },\n serializedGetItemLabel == null ? [] : [serializedGetItemLabel],\n ]\n}\n\ntype DeserializedListControlConfig<T extends Data> = {\n type: PanelDescriptor<T>\n label?: string\n getItemLabel?: DeserializedFunction<Exclude<ListControlConfig<T>['getItemLabel'], undefined>>\n preset?: ListControlValue<T>\n defaultValue?: ListControlValue<T>\n}\n\ntype DeserializedListControl<T extends ListControlValue = ListControlValue> = {\n type: typeof Controls.Types.List\n options: DeserializedListControlConfig<T[number]['value']>\n}\n\nfunction deserializeListControl<T extends Data>(\n serializedControl: SerializedListControl<ListControlValue<T>>,\n): DeserializedListControl<ListControlValue<T>> {\n const { getItemLabel } = serializedControl.options\n\n const deserializedGetItemLabel = getItemLabel && deserializeFunction(getItemLabel)\n\n return {\n ...serializedControl,\n options: { ...serializedControl.options, getItemLabel: deserializedGetItemLabel },\n }\n}\n\ntype SerializedTypeaheadControlConfig<T extends Data> = {\n getItems: SerializedFunction<TypeaheadControlConfig<T>['getItems']>\n label?: string\n preset?: TypeaheadControlValue<T>\n defaultValue?: TypeaheadControlValue<T>\n}\n\ntype SerializedTypeaheadControl<T extends TypeaheadControlValue = TypeaheadControlValue> = {\n type: typeof Controls.Types.Typeahead\n options: SerializedTypeaheadControlConfig<T['value']>\n}\n\nfunction serializeTypeaheadControl<T extends Data>(\n control: TypeaheadControl<TypeaheadControlValue<T>>,\n): [SerializedTypeaheadControl<TypeaheadControlValue<T>>, Transferable[]] {\n const { getItems } = control.options\n\n const serializedGetItems = getItems && serializeFunction(getItems)\n\n return [\n { ...control, options: { ...control.options, getItems: serializedGetItems } },\n serializedGetItems == null ? [] : [serializedGetItems],\n ]\n}\n\ntype DeserializedTypeaheadControlConfig<T extends Data> = {\n getItems: DeserializedFunction<TypeaheadControlConfig<T>['getItems']>\n label?: string\n preset?: TypeaheadControlValue<T>\n defaultValue?: TypeaheadControlValue<T>\n}\n\ntype DeserializedTypeaheadControl<T extends TypeaheadControlValue = TypeaheadControlValue> = {\n type: typeof Controls.Types.Typeahead\n options: DeserializedTypeaheadControlConfig<T['value']>\n}\n\nfunction deserializeTypeaheadControl<T extends Data>(\n serializedControl: SerializedTypeaheadControl<TypeaheadControlValue<T>>,\n): DeserializedTypeaheadControl<TypeaheadControlValue<T>> {\n const { getItems } = serializedControl.options\n\n const deserializedGetItems = getItems && deserializeFunction(getItems)\n\n return {\n ...serializedControl,\n options: { ...serializedControl.options, getItems: deserializedGetItems },\n }\n}\n\nexport type SerializedControl =\n | Exclude<Control, ListControl | TypeaheadControl>\n | SerializedListControl\n | SerializedTypeaheadControl\n\nexport type DeserializedControl =\n | Exclude<Control, ListControl | TypeaheadControl>\n | DeserializedListControl\n | DeserializedTypeaheadControl\n\nfunction serializeControl(control: Control): [SerializedControl, Transferable[]] {\n switch (control.type) {\n case Controls.Types.List:\n return serializeListControl(control)\n\n case Controls.Types.Typeahead:\n return serializeTypeaheadControl(control)\n\n default:\n return [control, []]\n }\n}\n\nfunction deserializeControl(serializedControl: SerializedControl): DeserializedControl {\n switch (serializedControl.type) {\n case Controls.Types.List:\n return deserializeListControl(serializedControl)\n\n case Controls.Types.Typeahead:\n return deserializeTypeaheadControl(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"],"names":["Controls.Types"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgBO,2BAAkD,MAAgC;AAGjF,QAAA,iBAAiB,IAAI;AAE3B,iBAAe,MAAM,YAAY,CAAC,EAAE,MAAM,CAAC,QAAQ,YAA8B;AAC/E,YAAQ,QACL,EAAA,KAAK,MAAM,KAAK,MAAM,MAAM,IAAI,CAAC,EACjC,KAAK,CAAA,WAAU,eAAe,MAAM,YAAY,CAAC,QAAQ,MAAM,CAAC,CAAC;AAAA,EAAA;AAGtE,SAAO,eAAe;AACxB;AAEO,6BACL,oBACyB;AAKzB,MAAI,aAAa;AACX,QAAA,4BAAY;AAElB,qBAAmB,YAAY,CAAC,EAAE,MAAM,CAAC,QAAQ,cAAkC;;AAC3E,gBAAA,IAAI,MAAM,MAAV,mBAAc;AAEpB,UAAM,OAAO,MAAM;AAAA,EAAA;AAGrB,SAAO,iCAAiC,MAAM;AACrC,WAAA,IAAI,QAAQ,CAAW,YAAA;AAC5B,YAAM,SAAS;AAET,YAAA,IAAI,QAAQ,OAAO;AAEzB,yBAAmB,YAAY,CAAC,QAAQ,IAAI,CAAC;AAAA,IAAA,CAC9C;AAAA,EAAA;AAEL;ACvBA,8BACE,SAC8D;AACxD,QAAA,EAAE,iBAAiB,QAAQ;AAE3B,QAAA,yBAAyB,gBAAgB,kBAAkB,YAAY;AAEtE,SAAA;AAAA,IACL,iCAAK,UAAL,EAAc,SAAS,iCAAK,QAAQ,UAAb,EAAsB,cAAc,0BAAyB;AAAA,IACpF,0BAA0B,OAA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WAAA,CAAC,iCAAK,cAAL,GAAmB,MAAM,sBAAqB,CAAC,GAAG,kBAAkB,GAAG,aAAa,CAAC;AAAA,EAAA,GAE/F,CAAC,CAAA,GAAI,CAAE,CAAA,CACT;AACF;AAEO,6BACL,oBACqC;AAC9B,SAAA,OAAO,QAAQ,kBAAkB,EAAE,OACxC,CAAC,sBAAsB,CAAC,KAAK,uBAAuB;AAClD,WAAO,iCAAK,uBAAL,GAA4B,MAAM,mBAAmB,iBAAiB;EAC/E,GACA,CACF,CAAA;AACF;;"}
|
package/dist/descriptors.cjs.js
CHANGED
|
@@ -30,6 +30,7 @@ const Types = {
|
|
|
30
30
|
SocialLinks: "SocialLinks",
|
|
31
31
|
Table: "Table",
|
|
32
32
|
TableFormFields: "TableFormFields",
|
|
33
|
+
Typeahead: "Typeahead",
|
|
33
34
|
TextArea: "TextArea",
|
|
34
35
|
TextInput: "TextInput",
|
|
35
36
|
TextStyle: "TextStyle",
|
|
@@ -126,6 +127,9 @@ function Table(options = {}) {
|
|
|
126
127
|
function TableFormFields(options = {}) {
|
|
127
128
|
return { type: Types.TableFormFields, options };
|
|
128
129
|
}
|
|
130
|
+
function Typeahead(options) {
|
|
131
|
+
return { type: Types.Typeahead, options };
|
|
132
|
+
}
|
|
129
133
|
function TextArea(options = {}) {
|
|
130
134
|
return { type: Types.TextArea, options };
|
|
131
135
|
}
|
|
@@ -141,9 +145,8 @@ function Video(options = {}) {
|
|
|
141
145
|
function Width(options = {}) {
|
|
142
146
|
return { type: Types.Width, options };
|
|
143
147
|
}
|
|
144
|
-
var descriptors = /* @__PURE__ */ Object.freeze({
|
|
148
|
+
var descriptors = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
145
149
|
__proto__: null,
|
|
146
|
-
[Symbol.toStringTag]: "Module",
|
|
147
150
|
Types,
|
|
148
151
|
Backgrounds,
|
|
149
152
|
Border,
|
|
@@ -175,12 +178,13 @@ var descriptors = /* @__PURE__ */ Object.freeze({
|
|
|
175
178
|
SocialLinks,
|
|
176
179
|
Table,
|
|
177
180
|
TableFormFields,
|
|
181
|
+
Typeahead,
|
|
178
182
|
TextArea,
|
|
179
183
|
TextInput,
|
|
180
184
|
TextStyle,
|
|
181
185
|
Video,
|
|
182
186
|
Width
|
|
183
|
-
});
|
|
187
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
184
188
|
exports.Backgrounds = Backgrounds;
|
|
185
189
|
exports.Border = Border;
|
|
186
190
|
exports.BorderRadius = BorderRadius;
|
|
@@ -207,6 +211,8 @@ exports.ResponsiveSelect = ResponsiveSelect;
|
|
|
207
211
|
exports.RichText = RichText;
|
|
208
212
|
exports.Shadows = Shadows;
|
|
209
213
|
exports.SocialLinks = SocialLinks;
|
|
214
|
+
exports.Table = Table;
|
|
215
|
+
exports.TableFormFields = TableFormFields;
|
|
210
216
|
exports.TextArea = TextArea;
|
|
211
217
|
exports.TextInput = TextInput;
|
|
212
218
|
exports.TextStyle = TextStyle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptors.cjs.js","sources":["../src/prop-controllers/descriptors.ts"],"sourcesContent":["import type * as Slate from 'slate'\nimport type { Element, Data } from '../state/react-page'\n\n// See https://github.com/microsoft/TypeScript/issues/15300\nexport type IndexSignatureHack<T> = T extends Record<string, any>\n ? { [K in keyof T]: IndexSignatureHack<T[K]> }\n : T\n\nexport type Device = 'desktop' | 'tablet' | 'mobile'\n\nexport type DeviceOverride<T> = { deviceId: Device; value: T }\n\nexport type ResponsiveValue<T> = DeviceOverride<T>[]\n\nexport type ResponsiveValueType<T> = T extends ResponsiveValue<infer U> ? U : never\n\ntype Color = { swatchId: string; alpha: number }\n\ntype IconName =\n | 'HeightAuto16'\n | 'HeightMatch16'\n | 'VerticalAlignStart16'\n | 'VerticalAlignMiddle16'\n | 'VerticalAlignEnd16'\n | 'VerticalAlignSpaceBetween16'\n | 'ButtonPill16'\n | 'ButtonRounded16'\n | 'ButtonSquare16'\n | 'SizeSmall16'\n | 'SizeMedium16'\n | 'SizeLarge16'\n | 'ArrowInside16'\n | 'ArrowCenter16'\n | 'ArrowOutside16'\n | 'CountdownSolid16'\n | 'CountdownSolidSplit16'\n | 'CountdownOutline16'\n | 'CountdownOutlineSplit16'\n | 'CountdownNaked16'\n | 'Sun16'\n | 'Moon16'\n | 'AlignLeft16'\n | 'AlignCenter16'\n | 'AlignRight16'\n | 'Star16'\n | 'StarCircle16'\n | 'StarRoundedSquare16'\n | 'StarSquare16'\n\ntype Gap = { value: number; unit: 'px' }\n\nexport type Length = { value: number; unit: 'px' | '%' }\n\ntype OpenPageLink = {\n type: 'OPEN_PAGE'\n payload: { pageId: string | null | undefined; openInNewTab: boolean }\n}\n\ntype OpenURLLink = { type: 'OPEN_URL'; payload: { url: string; openInNewTab: boolean } }\n\ntype SendEmailLink = {\n type: 'SEND_EMAIL'\n payload: { to: string; subject?: string; body?: string }\n}\n\ntype CallPhoneLink = { type: 'CALL_PHONE'; payload: { phoneNumber: string } }\n\ntype ScrollToElementLink = {\n type: 'SCROLL_TO_ELEMENT'\n payload: {\n elementIdConfig: { elementKey: string; propName: string } | null | undefined\n block: 'start' | 'center' | 'end'\n }\n}\n\ntype Link = OpenPageLink | OpenURLLink | SendEmailLink | CallPhoneLink | ScrollToElementLink\n\ntype TextStyle = {\n fontFamily?: string | null | undefined\n letterSpacing: number | null | undefined\n fontSize: { value: number; unit: 'px' } | null | undefined\n fontWeight: number | null | undefined\n textTransform: 'uppercase'[]\n fontStyle: 'italic'[]\n}\n\nexport const Types = {\n Backgrounds: 'Backgrounds',\n Border: 'Border',\n BorderRadius: 'BorderRadius',\n Checkbox: 'Checkbox',\n Date: 'Date',\n ElementID: 'ElementID',\n Font: 'Font',\n GapX: 'GapX',\n GapY: 'GapY',\n Grid: 'Grid',\n Image: 'Image',\n Images: 'Images',\n Link: 'Link',\n List: 'List',\n Margin: 'Margin',\n NavigationLinks: 'NavigationLinks',\n Number: 'Number',\n Padding: 'Padding',\n ResponsiveColor: 'ResponsiveColor',\n ResponsiveIconRadioGroup: 'ResponsiveIconRadioGroup',\n ResponsiveLength: 'ResponsiveLength',\n ResponsiveNumber: 'ResponsiveNumber',\n ResponsiveOpacity: 'ResponsiveOpacity',\n ResponsiveSelect: 'ResponsiveSelect',\n RichText: 'RichText',\n Shadows: 'Shadows',\n Shape: 'Shape',\n SocialLinks: 'SocialLinks',\n Table: 'Table',\n TableFormFields: 'TableFormFields',\n TextArea: 'TextArea',\n TextInput: 'TextInput',\n TextStyle: 'TextStyle',\n Video: 'Video',\n Width: 'Width',\n} as const\n\ntype Options<T> = T | ((props: Record<string, unknown>, decideMode: Device) => T)\n\ntype ColorBackground = { type: 'color'; id: string; payload: Color | null }\n\ntype GradientStop = { id: string; location: number; color: Color | null }\n\ntype Gradient = { angle?: number; isRadial?: boolean; stops: GradientStop[] }\n\ntype GradientBackground = { type: 'gradient'; id: string; payload: Gradient }\n\ntype BackgroundImagePosition = { x: number; y: number }\n\ntype BackgroundImageSize = 'cover' | 'contain' | 'auto'\n\ntype BackgroundImageRepeat = 'no-repeat' | 'repeat-x' | 'repeat-y' | 'repeat'\n\ntype BackgroundImage = {\n imageId: string\n position: BackgroundImagePosition\n size?: BackgroundImageSize\n repeat?: BackgroundImageRepeat\n opacity?: number\n parallax?: number\n}\n\ntype ImageBackground = { type: 'image'; id: string; payload: BackgroundImage }\n\ntype BackgroundVideoAspectRatio = 'wide' | 'standard'\n\ntype BackgroundVideo = {\n url?: string\n maskColor?: Color | null\n opacity?: number\n zoom?: number\n aspectRatio?: BackgroundVideoAspectRatio\n parallax?: number\n}\n\ntype VideoBackground = { type: 'video'; id: string; payload: BackgroundVideo }\n\ntype Background = ColorBackground | GradientBackground | ImageBackground | VideoBackground\n\nexport type BackgroundsValue = ResponsiveValue<Background[]>\n\ntype BackgroundsOptions = Options<Record<string, never>>\n\ntype BackgroundsDescriptor<_T = BackgroundsValue> = {\n type: typeof Types.Backgrounds\n options: BackgroundsOptions\n}\n\nexport function Backgrounds(options: BackgroundsOptions = {}): BackgroundsDescriptor {\n return { type: Types.Backgrounds, options }\n}\n\ntype BorderSideStyle = 'dashed' | 'dotted' | 'solid'\n\ntype BorderSide = { width: number | null | undefined; style: BorderSideStyle; color?: Color | null }\n\ntype Border = {\n [K in 'top' | 'right' | 'bottom' | 'left' as `border${Capitalize<K>}`]:\n | BorderSide\n | null\n | undefined\n}\n\nexport type BorderValue = ResponsiveValue<Border>\n\ntype BorderOptions = Options<Record<string, never>>\n\ntype BorderDescriptor<_T = BorderValue> = { type: typeof Types.Border; options: BorderOptions }\n\nexport function Border(options: BorderOptions = {}): BorderDescriptor {\n return { type: Types.Border, options }\n}\n\ntype BorderRadius = {\n [K in 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' as `border${Capitalize<K>}Radius`]:\n | Length\n | null\n | undefined\n}\n\nexport type BorderRadiusValue = ResponsiveValue<BorderRadius>\n\ntype BorderRadiusOptions = Options<Record<string, never>>\n\ntype BorderRadiusDescriptor<_T = BorderRadiusValue> = {\n type: typeof Types.BorderRadius\n options: BorderRadiusOptions\n}\n\nexport function BorderRadius(options: BorderRadiusOptions = {}): BorderRadiusDescriptor {\n return { type: Types.BorderRadius, options }\n}\n\nexport type CheckboxValue = boolean\n\ntype CheckboxOptions = Options<{\n preset?: CheckboxValue\n label: string\n hidden?: boolean\n}>\n\ntype CheckboxDescriptor<_T = CheckboxValue> = {\n type: typeof Types.Checkbox\n options: CheckboxOptions\n}\n\nexport function Checkbox(options: CheckboxOptions): CheckboxDescriptor {\n return { type: Types.Checkbox, options }\n}\n\nexport type DateValue = string\n\ntype DateOptions = Options<{ preset?: DateValue }>\n\ntype DateDescriptor<_T = DateValue> = { type: typeof Types.Date; options: DateOptions }\n\nexport function Date(options: DateOptions = {}): DateDescriptor {\n return { type: Types.Date, options }\n}\n\nexport type ElementIDValue = string\n\ntype ElementIDOptions = Options<Record<string, never>>\n\ntype ElementIDDescriptor<_T = ElementIDValue> = {\n type: typeof Types.ElementID\n options: ElementIDOptions\n}\n\nexport function ElementID(options: ElementIDOptions = {}): ElementIDDescriptor {\n return { type: Types.ElementID, options }\n}\n\nexport type FontValue = ResponsiveValue<string>\n\ntype FontOptions = Options<{ preset?: FontValue; label?: string }>\n\ntype FontDescriptor<_T = FontValue> = { type: typeof Types.Font; options: FontOptions }\n\nexport function Font(options: FontOptions = {}): FontDescriptor {\n return { type: Types.Font, options }\n}\n\nexport type GapXValue = ResponsiveValue<Gap>\n\ntype GapXOptions = Options<{\n preset?: GapXValue\n label?: string\n defaultValue?: Gap\n min?: number\n max?: number\n step?: number\n hidden?: boolean\n}>\n\ntype GapXDescriptor<_T = GapXValue> = { type: typeof Types.GapX; options: GapXOptions }\n\nexport function GapX(options: GapXOptions = {}): GapXDescriptor {\n return { type: Types.GapX, options }\n}\n\nexport type GapYValue = ResponsiveValue<Gap>\n\ntype GapYOptions = Options<{\n preset?: GapYValue\n label?: string\n defaultValue?: Gap\n step?: number\n min?: number\n max?: number\n hidden?: boolean\n}>\n\ntype GapYDescriptor<_T = GapYValue> = { type: typeof Types.GapY; options: GapYOptions }\n\nexport function GapY(options: GapYOptions = {}): GapYDescriptor {\n return { type: Types.GapY, options }\n}\n\ntype GridColumn = { count: number; spans: number[][] }\n\nexport type GridValue = { elements: Element[]; columns: ResponsiveValue<GridColumn> }\n\ntype GridOptions = Options<Record<string, never>>\n\ntype GridDescriptor<_T = GridValue> = { type: typeof Types.Grid; options: GridOptions }\n\nexport function Grid(options: GridOptions = {}): GridDescriptor {\n return { type: Types.Grid, options }\n}\n\nexport type ImageValue = string\n\ntype ImageOptions = Options<{ label?: string; hidden?: boolean }>\n\ntype ImageDescriptor<_T = ImageValue> = { type: typeof Types.Image; options: ImageOptions }\n\nexport function Image(options: ImageOptions = {}): ImageDescriptor {\n return { type: Types.Image, options }\n}\n\nexport type ImagesValue = { key: string; props: { link?: Link; file?: string; altText?: string } }[]\n\ntype ImagesOptions = Options<{ preset?: ImagesValue }>\n\ntype ImagesDescriptor<_T = ImagesValue> = { type: typeof Types.Images; options: ImagesOptions }\n\nexport function Images(options: ImagesOptions = {}): ImagesDescriptor {\n return { type: Types.Images, options }\n}\n\nexport type LinkValue = Link\n\ntype LinkOptions = Options<{\n preset?: LinkValue\n label?: string\n defaultValue?: Link\n options?: { value: Link['type']; label: string }[]\n hidden?: boolean\n}>\n\ntype LinkDescriptor<_T = LinkValue> = { type: typeof Types.Link; options: LinkOptions }\n\nexport function Link(options: LinkOptions = {}): LinkDescriptor {\n return { type: Types.Link, options }\n}\n\ntype ListValueItem<T extends Data> = { id: string; value?: T }\n\ntype ListValue<T extends Data = Data> = ListValueItem<T>[]\n\ntype ListOptions<T extends Data> = Options<{\n type: PanelDescriptor<T>\n label?: string\n preset?: ListValue<T>\n defaultValue?: ListValue<T>\n}>\n\ntype ListDescriptor<T extends ListValue> = {\n type: typeof Types.List\n options: ListOptions<T[number]['value']>\n}\n\nexport function List<T extends Data>(options: ListOptions<T>): ListDescriptor<ListValue<T>> {\n return { type: Types.List, options }\n}\n\ntype MarginSide = { value: number; unit: 'px' } | 'auto'\n\ntype Margin = {\n [K in 'top' | 'right' | 'bottom' | 'left' as `margin${Capitalize<K>}`]:\n | MarginSide\n | null\n | undefined\n}\n\nexport type MarginValue = ResponsiveValue<Margin>\n\ntype MarginOptions = Options<{ preset?: MarginValue }>\n\ntype MarginDescriptor<_T = MarginValue> = { type: typeof Types.Margin; options: MarginOptions }\n\nexport function Margin(options: MarginOptions = {}): MarginDescriptor {\n return { type: Types.Margin, options }\n}\n\ntype ButtonVariant = 'flat' | 'outline' | 'shadow' | 'clear' | 'blocky' | 'bubbly' | 'skewed'\n\ntype ButtonShape = 'pill' | 'rounded' | 'square'\n\ntype ButtonSize = 'small' | 'medium' | 'large'\n\ntype NavigationButton = {\n id: string\n type: 'button'\n payload: {\n label: string\n link?: Link\n variant?: ResponsiveValue<ButtonVariant>\n shape?: ResponsiveValue<ButtonShape>\n size?: ResponsiveValue<ButtonSize>\n textColor?: ResponsiveValue<Color>\n color?: ResponsiveValue<Color>\n textStyle?: ResponsiveValue<TextStyle>\n }\n}\n\ntype NavigationDropdownCaretType = 'caret' | 'plus' | 'arrow-down' | 'chevron-down'\n\ntype NavigationDropdownLink = {\n id: string\n payload: {\n label: string\n link?: Link\n color?: ResponsiveValue<Color>\n textStyle?: ResponsiveValue<TextStyle>\n }\n}\n\ntype NavigationDropdown = {\n id: string\n type: 'dropdown'\n payload: {\n label: string\n caret?: NavigationDropdownCaretType\n links?: NavigationDropdownLink[]\n variant?: ResponsiveValue<ButtonVariant>\n shape?: ResponsiveValue<ButtonShape>\n size?: ResponsiveValue<ButtonSize>\n textColor?: ResponsiveValue<Color>\n color?: ResponsiveValue<Color>\n textStyle?: ResponsiveValue<TextStyle>\n }\n}\n\nexport type NavigationLinksValue = (NavigationButton | NavigationDropdown)[]\n\ntype NavigationLinksOptions = Options<Record<string, never>>\n\ntype NavigationLinksDescriptor<_T = NavigationLinksValue> = {\n type: typeof Types.NavigationLinks\n options: NavigationLinksOptions\n}\n\nexport function NavigationLinks(options: NavigationLinksOptions = {}): NavigationLinksDescriptor {\n return { type: Types.NavigationLinks, options }\n}\n\nexport type NumberValue = number\n\ntype NumberOptions = Options<{\n preset?: NumberValue\n label?: string\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n suffix?: string\n hidden?: boolean\n}>\n\ntype NumberDescriptor<_T = NumberValue> = { type: typeof Types.Number; options: NumberOptions }\n\nexport function Number(options: NumberOptions = {}): NumberDescriptor {\n return { type: Types.Number, options }\n}\n\ntype PaddingSide = { value: number; unit: 'px' }\n\ntype Padding = {\n [K in 'top' | 'right' | 'bottom' | 'left' as `padding${Capitalize<K>}`]:\n | PaddingSide\n | null\n | undefined\n}\n\nexport type PaddingValue = ResponsiveValue<Padding>\n\ntype PaddingOptions = Options<{ preset?: PaddingValue }>\n\ntype PaddingDescriptor<_T = PaddingValue> = { type: typeof Types.Padding; options: PaddingOptions }\n\nexport function Padding(options: PaddingOptions = {}): PaddingDescriptor {\n return { type: Types.Padding, options }\n}\n\nexport type ResponsiveColorValue = ResponsiveValue<Color>\n\ntype ResponsiveColorOptions = Options<{ label?: string; placeholder?: string; hidden?: boolean }>\n\ntype ResponsiveColorDescriptor<_T = ResponsiveColorValue> = {\n type: typeof Types.ResponsiveColor\n options: ResponsiveColorOptions\n}\n\nexport function ResponsiveColor(options: ResponsiveColorOptions = {}): ResponsiveColorDescriptor {\n return { type: Types.ResponsiveColor, options }\n}\n\ntype IconRadioGroupOption<T extends string> = { value: T; label: string; icon: IconName }\n\nexport type ResponsiveIconRadioGroupValue<T extends string> = ResponsiveValue<T>\n\ntype ResponsiveIconRadioGroupOptions<T extends string, U extends T = T> = Options<{\n label?: string\n options: IconRadioGroupOption<T>[]\n defaultValue?: U\n hidden?: boolean\n}>\n\ntype ResponsiveIconRadioGroupDescriptor<T extends ResponsiveIconRadioGroupValue<string>> = {\n type: typeof Types.ResponsiveIconRadioGroup\n options: ResponsiveIconRadioGroupOptions<ResponsiveValueType<T>>\n}\n\n// HACK(miguel): We have to use a layer of indirection with `_T` and `T` because otherwise the\n// values provided would undergo type widening. For some reason, the extra layer of indirection\n// reuslts in TypeScript not widening types. Note, this only happens when the returned value of this\n// function is passed to another as an argument, which is common with the `registerComponent` API.\nexport function ResponsiveIconRadioGroup<_T extends string, T extends _T, U extends T>(\n options: ResponsiveIconRadioGroupOptions<T, U>,\n): ResponsiveIconRadioGroupDescriptor<ResponsiveIconRadioGroupValue<T>> {\n return { type: Types.ResponsiveIconRadioGroup, options }\n}\n\nexport type ResponsiveLengthValue = ResponsiveValue<Length>\n\ntype LengthOption =\n | { value: 'px'; label: 'Pixels'; icon: 'Px16' }\n | { value: '%'; label: 'Percentage'; icon: 'Percent16' }\n\ntype ResponsiveLengthOptions = Options<{\n label?: string\n options?: LengthOption[]\n defaultValue?: Length\n hidden?: boolean\n}>\n\ntype ResponsiveLengthDescriptor<_T = ResponsiveLengthValue> = {\n type: typeof Types.ResponsiveLength\n options: ResponsiveLengthOptions\n}\n\nexport function ResponsiveLength(\n options: ResponsiveLengthOptions = {},\n): ResponsiveLengthDescriptor {\n return { type: Types.ResponsiveLength, options }\n}\n\nexport type ResponsiveNumberValue = ResponsiveValue<number>\n\ntype ResponsiveNumberOptions = Options<{\n label?: string\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n suffix?: string\n hidden?: boolean\n}>\n\ntype ResponsiveNumberDescriptor<_T = ResponsiveNumberValue> = {\n type: typeof Types.ResponsiveNumber\n options: ResponsiveNumberOptions\n}\n\nexport function ResponsiveNumber(\n options: ResponsiveNumberOptions = {},\n): ResponsiveNumberDescriptor {\n return { type: Types.ResponsiveNumber, options }\n}\n\nexport type ResponsiveOpacityValue = ResponsiveValue<number>\n\ntype ResponsiveOpacityOptions = Options<Record<string, never>>\n\ntype ResponsiveOpacityDescriptor<_T = ResponsiveOpacityValue> = {\n type: typeof Types.ResponsiveOpacity\n options: ResponsiveOpacityOptions\n}\n\nexport function ResponsiveOpacity(\n options: ResponsiveOpacityOptions = {},\n): ResponsiveOpacityDescriptor {\n return { type: Types.ResponsiveOpacity, options }\n}\n\nexport type ResponsiveSelectValue<T extends string> = ResponsiveValue<T>\n\ntype SelectLabelOrientation = 'vertical' | 'horizontal'\n\ntype SelectOption<T extends string> = { value: T; label: string }\n\ntype ResponsiveSelectOptions<T extends string, U extends T = T> = Options<{\n label?: string\n labelOrientation?: SelectLabelOrientation\n options: SelectOption<T>[]\n defaultValue?: U\n hidden?: boolean\n}>\n\ntype ResponsiveSelectDescriptor<T extends ResponsiveSelectValue<string>> = {\n type: typeof Types.ResponsiveSelect\n options: ResponsiveSelectOptions<ResponsiveValueType<T>>\n}\n\n// HACK(miguel): We have to use a layer of indirection with `_T` and `T` because otherwise the\n// values provided would undergo type widening. For some reason, the extra layer of indirection\n// reuslts in TypeScript not widening types. Note, this only happens when the returned value of this\n// function is passed to another as an argument, which is common with the `registerComponent` API.\nexport function ResponsiveSelect<_T extends string, T extends _T, U extends T>(\n options: ResponsiveSelectOptions<T, U>,\n): ResponsiveSelectDescriptor<ResponsiveSelectValue<T>> {\n return { type: Types.ResponsiveSelect, options }\n}\n\nexport type RichTextValue = IndexSignatureHack<Slate.ValueJSON>\n\ntype RichTextOptions = Options<{ preset?: RichTextValue }>\n\nexport type RichTextDescriptor<_T extends Data = RichTextValue> = {\n type: typeof Types.RichText\n options: RichTextOptions\n}\n\nexport function RichText(options: RichTextOptions = {}): RichTextDescriptor {\n return { type: Types.RichText, options }\n}\n\ntype Shadow = {\n color?: Color | null\n blurRadius?: number\n spreadRadius?: number\n offsetX?: number\n offsetY?: number\n inset?: boolean\n}\n\ntype Shadows = { id: string; payload: Shadow }[]\n\nexport type ShadowsValue = ResponsiveValue<Shadows>\n\ntype ShadowsOptions = Options<Record<string, never>>\n\ntype ShadowsDescriptor<_T = ShadowsValue> = { type: typeof Types.Shadows; options: ShadowsOptions }\n\nexport function Shadows(options: ShadowsOptions = {}): ShadowsDescriptor {\n return { type: Types.Shadows, options }\n}\n\nexport type ShapeValue<T extends Data = Data> = Record<string, T>\n\ntype ShapeOptions<T extends Record<string, Descriptor>> = {\n type: T\n preset?: { [K in keyof T]?: DescriptorValueType<T[K]> }\n}\n\ntype ShapeDescriptor<_T extends Record<string, Data>, U extends Record<string, Descriptor>> = {\n type: typeof Types.Shape\n options: ShapeOptions<U>\n}\n\nexport function Shape<T extends Record<string, Descriptor>>(\n options: ShapeOptions<T>,\n): ShapeDescriptor<{ [K in keyof T]?: DescriptorValueType<T[K]> }, T> {\n return { type: Types.Shape, options }\n}\n\ntype SocialLinkType =\n | 'angellist'\n | 'codepen'\n | 'dribbble'\n | 'facebook'\n | 'github'\n | 'instagram'\n | 'linkedin'\n | 'medium'\n | 'pinterest'\n | 'reddit'\n | 'rss'\n | 'snapchat'\n | 'soundcloud'\n | 'spotify'\n | 'telegram'\n | 'tumblr'\n | 'twitch'\n | 'twitter'\n | 'vimeo'\n | 'whatsapp'\n | 'yelp'\n | 'youtube'\n\ntype SocialLink = { type: SocialLinkType; url: string }\n\ntype SocialLinksLink = { id: string; payload: SocialLink }\n\nexport type SocialLinksValue = { links: SocialLinksLink[]; openInNewTab: boolean }\n\ntype SocialLinksOptions = Options<{ preset?: SocialLinksValue }>\n\ntype SocialLinksDescriptor<_T = SocialLinksValue> = {\n type: typeof Types.SocialLinks\n options: SocialLinksOptions\n}\n\nexport function SocialLinks(options: SocialLinksOptions = {}): SocialLinksDescriptor {\n return { type: Types.SocialLinks, options }\n}\n\nexport type TableValue = string\n\ntype TableOptions = Options<{ preset?: TableValue }>\n\ntype TableDescriptor<_T = TableValue> = { type: typeof Types.Table; options: TableOptions }\n\nexport function Table(options: TableOptions = {}): TableDescriptor {\n return { type: Types.Table, options }\n}\n\ntype TableFormField = {\n id: string\n tableColumnId: string\n label?: string\n placeholder?: string\n defaultValue?: string | boolean | string[]\n required?: boolean\n hidden?: boolean\n type?: 'select' | 'radio'\n hideLabel?: boolean\n autofill?: boolean\n}\n\ntype Grid = { count: number; spans: number[][] }\n\nexport type TableFormFieldsValue = { fields: TableFormField[]; grid: ResponsiveValue<Grid> }\n\ntype TableFormFieldsOptions = Options<{ preset?: TableFormFieldsValue }>\n\ntype TableFormFieldsDescriptor<_T = TableFormFieldsValue> = {\n type: typeof Types.TableFormFields\n options: TableFormFieldsOptions\n}\n\nexport function TableFormFields(options: TableFormFieldsOptions = {}): TableFormFieldsDescriptor {\n return { type: Types.TableFormFields, options }\n}\n\nexport type TextAreaValue = string\n\ntype TextAreaOptions = Options<{ preset?: TextAreaValue; label?: string; rows?: number }>\n\ntype TextAreaDescriptor<_T = TextAreaValue> = {\n type: typeof Types.TextArea\n options: TextAreaOptions\n}\n\nexport function TextArea(options: TextAreaOptions = {}): TextAreaDescriptor {\n return { type: Types.TextArea, options }\n}\n\nexport type TextInputValue = string\n\ntype TextInputOptions = Options<{ label?: string; placeholder?: string; hidden?: boolean }>\n\ntype TextInputDescriptor<_T = TextInputValue> = {\n type: typeof Types.TextInput\n options: TextInputOptions\n}\n\nexport function TextInput(options: TextInputOptions = {}): TextInputDescriptor {\n return { type: Types.TextInput, options }\n}\n\nexport type TextStyleValue = ResponsiveValue<TextStyle>\n\ntype TextStyleOptions = Options<{ preset?: TextStyleValue; label?: string; hidden?: boolean }>\n\ntype TextStyleDescriptor<_T = TextStyleValue> = {\n type: typeof Types.TextStyle\n options: TextStyleOptions\n}\n\nexport function TextStyle(options: TextStyleOptions = {}): TextStyleDescriptor {\n return { type: Types.TextStyle, options }\n}\n\ntype Video = {\n url?: string\n muted?: boolean\n playing?: boolean\n loop?: boolean\n controls?: boolean\n}\n\nexport type VideoValue = Video\n\ntype VideoOptions = Options<{ preset?: VideoValue }>\n\ntype VideoDescriptor<_T = VideoValue> = { type: typeof Types.Video; options: VideoOptions }\n\nexport function Video(options: VideoOptions = {}): VideoDescriptor {\n return { type: Types.Video, options }\n}\n\nexport type WidthValue = ResponsiveValue<Length>\n\ntype WidthOptions = Options<{ preset?: WidthValue; defaultValue?: Length }>\n\ntype WidthDescriptor<_T = WidthValue> = { type: typeof Types.Width; options: WidthOptions }\n\nexport function Width(options: WidthOptions = {}): WidthDescriptor {\n return { type: Types.Width, options }\n}\n\nexport type Descriptor<T extends Data = Data> =\n | BackgroundsDescriptor<T>\n | BorderDescriptor<T>\n | BorderRadiusDescriptor<T>\n | CheckboxDescriptor<T>\n | DateDescriptor<T>\n | ElementIDDescriptor<T>\n | FontDescriptor<T>\n | GapXDescriptor<T>\n | GapYDescriptor<T>\n | GridDescriptor<T>\n | ImageDescriptor<T>\n | ImagesDescriptor<T>\n | LinkDescriptor<T>\n | ListDescriptor<T extends ListValue ? T : ListValue>\n | MarginDescriptor<T>\n | NavigationLinksDescriptor<T>\n | NumberDescriptor<T>\n | PaddingDescriptor<T>\n | ResponsiveColorDescriptor<T>\n | ResponsiveIconRadioGroupDescriptor<\n T extends ResponsiveIconRadioGroupValue<string> ? T : ResponsiveIconRadioGroupValue<string>\n >\n | ResponsiveLengthDescriptor<T>\n | ResponsiveNumberDescriptor<T>\n | ResponsiveOpacityDescriptor<T>\n | ResponsiveSelectDescriptor<\n T extends ResponsiveSelectValue<string> ? T : ResponsiveSelectValue<string>\n >\n | RichTextDescriptor<T>\n | ShadowsDescriptor<T>\n | ShapeDescriptor<T extends ShapeValue ? T : ShapeValue, any>\n | SocialLinksDescriptor<T>\n | TableDescriptor<T>\n | TableFormFieldsDescriptor<T>\n | TextAreaDescriptor<T>\n | TextInputDescriptor<T>\n | TextStyleDescriptor<T>\n | VideoDescriptor<T>\n | WidthDescriptor<T>\n\ntype PanelDescriptorType =\n | typeof Types.Backgrounds\n | typeof Types.ResponsiveIconRadioGroup\n | typeof Types.Margin\n | typeof Types.Padding\n | typeof Types.Border\n | typeof Types.Shadows\n | typeof Types.GapY\n | typeof Types.GapX\n | typeof Types.BorderRadius\n | typeof Types.Checkbox\n | typeof Types.TextInput\n | typeof Types.Link\n | typeof Types.List\n | typeof Types.Shape\n | typeof Types.ResponsiveSelect\n | typeof Types.ResponsiveColor\n | typeof Types.TextStyle\n | typeof Types.Images\n | typeof Types.ResponsiveNumber\n | typeof Types.Number\n | typeof Types.Date\n | typeof Types.Font\n | typeof Types.TextArea\n | typeof Types.Table\n | typeof Types.RichText\n | typeof Types.Image\n | typeof Types.ResponsiveOpacity\n | typeof Types.SocialLinks\n | typeof Types.Video\n | typeof Types.NavigationLinks\n\nexport type PanelDescriptor<T extends Data = Data> = Extract<\n Descriptor<T>,\n { type: PanelDescriptorType }\n>\n\nexport type DescriptorValueType<T extends Descriptor> = T extends Descriptor<infer U> ? U : never\n"],"names":[],"mappings":";MAsFa,QAAQ;AAAA,EACnB,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,UAAU;AAAA,EACV,MAAM;AAAA,EACN,WAAW;AAAA,EACX,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"descriptors.cjs.js","sources":["../src/prop-controllers/descriptors.ts"],"sourcesContent":["import type * as Slate from 'slate'\nimport type { Element, Data } from '../state/react-page'\n\nexport type { Data }\n\n// See https://github.com/microsoft/TypeScript/issues/15300\nexport type IndexSignatureHack<T> = T extends Record<string, any>\n ? { [K in keyof T]: IndexSignatureHack<T[K]> }\n : T\n\nexport type Device = 'desktop' | 'tablet' | 'mobile'\n\nexport type DeviceOverride<T> = { deviceId: Device; value: T }\n\nexport type ResponsiveValue<T> = DeviceOverride<T>[]\n\nexport type ResponsiveValueType<T> = T extends ResponsiveValue<infer U> ? U : never\n\ntype Color = { swatchId: string; alpha: number }\n\ntype IconName =\n | 'HeightAuto16'\n | 'HeightMatch16'\n | 'VerticalAlignStart16'\n | 'VerticalAlignMiddle16'\n | 'VerticalAlignEnd16'\n | 'VerticalAlignSpaceBetween16'\n | 'ButtonPill16'\n | 'ButtonRounded16'\n | 'ButtonSquare16'\n | 'SizeSmall16'\n | 'SizeMedium16'\n | 'SizeLarge16'\n | 'ArrowInside16'\n | 'ArrowCenter16'\n | 'ArrowOutside16'\n | 'CountdownSolid16'\n | 'CountdownSolidSplit16'\n | 'CountdownOutline16'\n | 'CountdownOutlineSplit16'\n | 'CountdownNaked16'\n | 'Sun16'\n | 'Moon16'\n | 'AlignLeft16'\n | 'AlignCenter16'\n | 'AlignRight16'\n | 'Star16'\n | 'StarCircle16'\n | 'StarRoundedSquare16'\n | 'StarSquare16'\n\ntype Gap = { value: number; unit: 'px' }\n\nexport type Length = { value: number; unit: 'px' | '%' }\n\ntype OpenPageLink = {\n type: 'OPEN_PAGE'\n payload: { pageId: string | null | undefined; openInNewTab: boolean }\n}\n\ntype OpenURLLink = { type: 'OPEN_URL'; payload: { url: string; openInNewTab: boolean } }\n\ntype SendEmailLink = {\n type: 'SEND_EMAIL'\n payload: { to: string; subject?: string; body?: string }\n}\n\ntype CallPhoneLink = { type: 'CALL_PHONE'; payload: { phoneNumber: string } }\n\ntype ScrollToElementLink = {\n type: 'SCROLL_TO_ELEMENT'\n payload: {\n elementIdConfig: { elementKey: string; propName: string } | null | undefined\n block: 'start' | 'center' | 'end'\n }\n}\n\ntype Link = OpenPageLink | OpenURLLink | SendEmailLink | CallPhoneLink | ScrollToElementLink\n\ntype TextStyle = {\n fontFamily?: string | null | undefined\n letterSpacing: number | null | undefined\n fontSize: { value: number; unit: 'px' } | null | undefined\n fontWeight: number | null | undefined\n textTransform: 'uppercase'[]\n fontStyle: 'italic'[]\n}\n\nexport const Types = {\n Backgrounds: 'Backgrounds',\n Border: 'Border',\n BorderRadius: 'BorderRadius',\n Checkbox: 'Checkbox',\n Date: 'Date',\n ElementID: 'ElementID',\n Font: 'Font',\n GapX: 'GapX',\n GapY: 'GapY',\n Grid: 'Grid',\n Image: 'Image',\n Images: 'Images',\n Link: 'Link',\n List: 'List',\n Margin: 'Margin',\n NavigationLinks: 'NavigationLinks',\n Number: 'Number',\n Padding: 'Padding',\n ResponsiveColor: 'ResponsiveColor',\n ResponsiveIconRadioGroup: 'ResponsiveIconRadioGroup',\n ResponsiveLength: 'ResponsiveLength',\n ResponsiveNumber: 'ResponsiveNumber',\n ResponsiveOpacity: 'ResponsiveOpacity',\n ResponsiveSelect: 'ResponsiveSelect',\n RichText: 'RichText',\n Shadows: 'Shadows',\n Shape: 'Shape',\n SocialLinks: 'SocialLinks',\n Table: 'Table',\n TableFormFields: 'TableFormFields',\n Typeahead: 'Typeahead',\n TextArea: 'TextArea',\n TextInput: 'TextInput',\n TextStyle: 'TextStyle',\n Video: 'Video',\n Width: 'Width',\n} as const\n\ntype Options<T> = T | ((props: Record<string, unknown>, decideMode: Device) => T)\n\ntype ColorBackground = { type: 'color'; id: string; payload: Color | null }\n\ntype GradientStop = { id: string; location: number; color: Color | null }\n\ntype Gradient = { angle?: number; isRadial?: boolean; stops: GradientStop[] }\n\ntype GradientBackground = { type: 'gradient'; id: string; payload: Gradient }\n\ntype BackgroundImagePosition = { x: number; y: number }\n\ntype BackgroundImageSize = 'cover' | 'contain' | 'auto'\n\ntype BackgroundImageRepeat = 'no-repeat' | 'repeat-x' | 'repeat-y' | 'repeat'\n\ntype BackgroundImage = {\n imageId: string\n position: BackgroundImagePosition\n size?: BackgroundImageSize\n repeat?: BackgroundImageRepeat\n opacity?: number\n parallax?: number\n}\n\ntype ImageBackground = { type: 'image'; id: string; payload: BackgroundImage }\n\ntype BackgroundVideoAspectRatio = 'wide' | 'standard'\n\ntype BackgroundVideo = {\n url?: string\n maskColor?: Color | null\n opacity?: number\n zoom?: number\n aspectRatio?: BackgroundVideoAspectRatio\n parallax?: number\n}\n\ntype VideoBackground = { type: 'video'; id: string; payload: BackgroundVideo }\n\ntype Background = ColorBackground | GradientBackground | ImageBackground | VideoBackground\n\nexport type BackgroundsValue = ResponsiveValue<Background[]>\n\ntype BackgroundsOptions = Options<Record<string, never>>\n\ntype BackgroundsDescriptor<_T = BackgroundsValue> = {\n type: typeof Types.Backgrounds\n options: BackgroundsOptions\n}\n\nexport function Backgrounds(options: BackgroundsOptions = {}): BackgroundsDescriptor {\n return { type: Types.Backgrounds, options }\n}\n\ntype BorderSideStyle = 'dashed' | 'dotted' | 'solid'\n\ntype BorderSide = { width: number | null | undefined; style: BorderSideStyle; color?: Color | null }\n\ntype Border = {\n [K in 'top' | 'right' | 'bottom' | 'left' as `border${Capitalize<K>}`]:\n | BorderSide\n | null\n | undefined\n}\n\nexport type BorderValue = ResponsiveValue<Border>\n\ntype BorderOptions = Options<Record<string, never>>\n\ntype BorderDescriptor<_T = BorderValue> = { type: typeof Types.Border; options: BorderOptions }\n\nexport function Border(options: BorderOptions = {}): BorderDescriptor {\n return { type: Types.Border, options }\n}\n\ntype BorderRadius = {\n [K in 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' as `border${Capitalize<K>}Radius`]:\n | Length\n | null\n | undefined\n}\n\nexport type BorderRadiusValue = ResponsiveValue<BorderRadius>\n\ntype BorderRadiusOptions = Options<Record<string, never>>\n\ntype BorderRadiusDescriptor<_T = BorderRadiusValue> = {\n type: typeof Types.BorderRadius\n options: BorderRadiusOptions\n}\n\nexport function BorderRadius(options: BorderRadiusOptions = {}): BorderRadiusDescriptor {\n return { type: Types.BorderRadius, options }\n}\n\nexport type CheckboxValue = boolean\n\ntype CheckboxOptions = Options<{\n preset?: CheckboxValue\n label: string\n hidden?: boolean\n}>\n\ntype CheckboxDescriptor<_T = CheckboxValue> = {\n type: typeof Types.Checkbox\n options: CheckboxOptions\n}\n\nexport function Checkbox(options: CheckboxOptions): CheckboxDescriptor {\n return { type: Types.Checkbox, options }\n}\n\nexport type DateValue = string\n\ntype DateOptions = Options<{ preset?: DateValue }>\n\ntype DateDescriptor<_T = DateValue> = { type: typeof Types.Date; options: DateOptions }\n\nexport function Date(options: DateOptions = {}): DateDescriptor {\n return { type: Types.Date, options }\n}\n\nexport type ElementIDValue = string\n\ntype ElementIDOptions = Options<Record<string, never>>\n\ntype ElementIDDescriptor<_T = ElementIDValue> = {\n type: typeof Types.ElementID\n options: ElementIDOptions\n}\n\nexport function ElementID(options: ElementIDOptions = {}): ElementIDDescriptor {\n return { type: Types.ElementID, options }\n}\n\nexport type FontValue = ResponsiveValue<string>\n\ntype FontOptions = Options<{ preset?: FontValue; label?: string }>\n\ntype FontDescriptor<_T = FontValue> = { type: typeof Types.Font; options: FontOptions }\n\nexport function Font(options: FontOptions = {}): FontDescriptor {\n return { type: Types.Font, options }\n}\n\nexport type GapXValue = ResponsiveValue<Gap>\n\ntype GapXOptions = Options<{\n preset?: GapXValue\n label?: string\n defaultValue?: Gap\n min?: number\n max?: number\n step?: number\n hidden?: boolean\n}>\n\ntype GapXDescriptor<_T = GapXValue> = { type: typeof Types.GapX; options: GapXOptions }\n\nexport function GapX(options: GapXOptions = {}): GapXDescriptor {\n return { type: Types.GapX, options }\n}\n\nexport type GapYValue = ResponsiveValue<Gap>\n\ntype GapYOptions = Options<{\n preset?: GapYValue\n label?: string\n defaultValue?: Gap\n step?: number\n min?: number\n max?: number\n hidden?: boolean\n}>\n\ntype GapYDescriptor<_T = GapYValue> = { type: typeof Types.GapY; options: GapYOptions }\n\nexport function GapY(options: GapYOptions = {}): GapYDescriptor {\n return { type: Types.GapY, options }\n}\n\ntype GridColumn = { count: number; spans: number[][] }\n\nexport type GridValue = { elements: Element[]; columns: ResponsiveValue<GridColumn> }\n\ntype GridOptions = Options<Record<string, never>>\n\ntype GridDescriptor<_T = GridValue> = { type: typeof Types.Grid; options: GridOptions }\n\nexport function Grid(options: GridOptions = {}): GridDescriptor {\n return { type: Types.Grid, options }\n}\n\nexport type ImageValue = string\n\ntype ImageOptions = Options<{ label?: string; hidden?: boolean }>\n\ntype ImageDescriptor<_T = ImageValue> = { type: typeof Types.Image; options: ImageOptions }\n\nexport function Image(options: ImageOptions = {}): ImageDescriptor {\n return { type: Types.Image, options }\n}\n\nexport type ImagesValue = { key: string; props: { link?: Link; file?: string; altText?: string } }[]\n\ntype ImagesOptions = Options<{ preset?: ImagesValue }>\n\ntype ImagesDescriptor<_T = ImagesValue> = { type: typeof Types.Images; options: ImagesOptions }\n\nexport function Images(options: ImagesOptions = {}): ImagesDescriptor {\n return { type: Types.Images, options }\n}\n\nexport type LinkValue = Link\n\ntype LinkOptions = Options<{\n preset?: LinkValue\n label?: string\n defaultValue?: Link\n options?: { value: Link['type']; label: string }[]\n hidden?: boolean\n}>\n\ntype LinkDescriptor<_T = LinkValue> = { type: typeof Types.Link; options: LinkOptions }\n\nexport function Link(options: LinkOptions = {}): LinkDescriptor {\n return { type: Types.Link, options }\n}\n\ntype ListValueItem<T extends Data> = { id: string; value?: T }\n\nexport type ListValue<T extends Data = Data> = ListValueItem<T>[]\n\nexport type ListOptions<T extends Data> = {\n type: PanelDescriptor<T>\n label?: string\n getItemLabel?: ((value: T | undefined) => string) | ((value: T | undefined) => Promise<string>)\n preset?: ListValue<T>\n defaultValue?: ListValue<T>\n}\n\nexport type ListDescriptor<T extends ListValue = ListValue> = {\n type: typeof Types.List\n options: ListOptions<T extends ListValue<infer U> ? U : never>\n}\n\nexport function List<T extends Data>(options: ListOptions<T>): ListDescriptor<ListValue<T>> {\n return { type: Types.List, options }\n}\n\ntype MarginSide = { value: number; unit: 'px' } | 'auto'\n\ntype Margin = {\n [K in 'top' | 'right' | 'bottom' | 'left' as `margin${Capitalize<K>}`]:\n | MarginSide\n | null\n | undefined\n}\n\nexport type MarginValue = ResponsiveValue<Margin>\n\ntype MarginOptions = Options<{ preset?: MarginValue }>\n\ntype MarginDescriptor<_T = MarginValue> = { type: typeof Types.Margin; options: MarginOptions }\n\nexport function Margin(options: MarginOptions = {}): MarginDescriptor {\n return { type: Types.Margin, options }\n}\n\ntype ButtonVariant = 'flat' | 'outline' | 'shadow' | 'clear' | 'blocky' | 'bubbly' | 'skewed'\n\ntype ButtonShape = 'pill' | 'rounded' | 'square'\n\ntype ButtonSize = 'small' | 'medium' | 'large'\n\ntype NavigationButton = {\n id: string\n type: 'button'\n payload: {\n label: string\n link?: Link\n variant?: ResponsiveValue<ButtonVariant>\n shape?: ResponsiveValue<ButtonShape>\n size?: ResponsiveValue<ButtonSize>\n textColor?: ResponsiveValue<Color>\n color?: ResponsiveValue<Color>\n textStyle?: ResponsiveValue<TextStyle>\n }\n}\n\ntype NavigationDropdownCaretType = 'caret' | 'plus' | 'arrow-down' | 'chevron-down'\n\ntype NavigationDropdownLink = {\n id: string\n payload: {\n label: string\n link?: Link\n color?: ResponsiveValue<Color>\n textStyle?: ResponsiveValue<TextStyle>\n }\n}\n\ntype NavigationDropdown = {\n id: string\n type: 'dropdown'\n payload: {\n label: string\n caret?: NavigationDropdownCaretType\n links?: NavigationDropdownLink[]\n variant?: ResponsiveValue<ButtonVariant>\n shape?: ResponsiveValue<ButtonShape>\n size?: ResponsiveValue<ButtonSize>\n textColor?: ResponsiveValue<Color>\n color?: ResponsiveValue<Color>\n textStyle?: ResponsiveValue<TextStyle>\n }\n}\n\nexport type NavigationLinksValue = (NavigationButton | NavigationDropdown)[]\n\ntype NavigationLinksOptions = Options<Record<string, never>>\n\ntype NavigationLinksDescriptor<_T = NavigationLinksValue> = {\n type: typeof Types.NavigationLinks\n options: NavigationLinksOptions\n}\n\nexport function NavigationLinks(options: NavigationLinksOptions = {}): NavigationLinksDescriptor {\n return { type: Types.NavigationLinks, options }\n}\n\nexport type NumberValue = number\n\ntype NumberOptions = Options<{\n preset?: NumberValue\n label?: string\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n suffix?: string\n hidden?: boolean\n}>\n\ntype NumberDescriptor<_T = NumberValue> = { type: typeof Types.Number; options: NumberOptions }\n\nexport function Number(options: NumberOptions = {}): NumberDescriptor {\n return { type: Types.Number, options }\n}\n\ntype PaddingSide = { value: number; unit: 'px' }\n\ntype Padding = {\n [K in 'top' | 'right' | 'bottom' | 'left' as `padding${Capitalize<K>}`]:\n | PaddingSide\n | null\n | undefined\n}\n\nexport type PaddingValue = ResponsiveValue<Padding>\n\ntype PaddingOptions = Options<{ preset?: PaddingValue }>\n\ntype PaddingDescriptor<_T = PaddingValue> = { type: typeof Types.Padding; options: PaddingOptions }\n\nexport function Padding(options: PaddingOptions = {}): PaddingDescriptor {\n return { type: Types.Padding, options }\n}\n\nexport type ResponsiveColorValue = ResponsiveValue<Color>\n\ntype ResponsiveColorOptions = Options<{ label?: string; placeholder?: string; hidden?: boolean }>\n\ntype ResponsiveColorDescriptor<_T = ResponsiveColorValue> = {\n type: typeof Types.ResponsiveColor\n options: ResponsiveColorOptions\n}\n\nexport function ResponsiveColor(options: ResponsiveColorOptions = {}): ResponsiveColorDescriptor {\n return { type: Types.ResponsiveColor, options }\n}\n\ntype IconRadioGroupOption<T extends string> = { value: T; label: string; icon: IconName }\n\nexport type ResponsiveIconRadioGroupValue<T extends string> = ResponsiveValue<T>\n\ntype ResponsiveIconRadioGroupOptions<T extends string, U extends T = T> = Options<{\n label?: string\n options: IconRadioGroupOption<T>[]\n defaultValue?: U\n hidden?: boolean\n}>\n\ntype ResponsiveIconRadioGroupDescriptor<T extends ResponsiveIconRadioGroupValue<string>> = {\n type: typeof Types.ResponsiveIconRadioGroup\n options: ResponsiveIconRadioGroupOptions<ResponsiveValueType<T>>\n}\n\n// HACK(miguel): We have to use a layer of indirection with `_T` and `T` because otherwise the\n// values provided would undergo type widening. For some reason, the extra layer of indirection\n// reuslts in TypeScript not widening types. Note, this only happens when the returned value of this\n// function is passed to another as an argument, which is common with the `registerComponent` API.\nexport function ResponsiveIconRadioGroup<_T extends string, T extends _T, U extends T>(\n options: ResponsiveIconRadioGroupOptions<T, U>,\n): ResponsiveIconRadioGroupDescriptor<ResponsiveIconRadioGroupValue<T>> {\n return { type: Types.ResponsiveIconRadioGroup, options }\n}\n\nexport type ResponsiveLengthValue = ResponsiveValue<Length>\n\ntype LengthOption =\n | { value: 'px'; label: 'Pixels'; icon: 'Px16' }\n | { value: '%'; label: 'Percentage'; icon: 'Percent16' }\n\ntype ResponsiveLengthOptions = Options<{\n label?: string\n options?: LengthOption[]\n defaultValue?: Length\n hidden?: boolean\n}>\n\ntype ResponsiveLengthDescriptor<_T = ResponsiveLengthValue> = {\n type: typeof Types.ResponsiveLength\n options: ResponsiveLengthOptions\n}\n\nexport function ResponsiveLength(\n options: ResponsiveLengthOptions = {},\n): ResponsiveLengthDescriptor {\n return { type: Types.ResponsiveLength, options }\n}\n\nexport type ResponsiveNumberValue = ResponsiveValue<number>\n\ntype ResponsiveNumberOptions = Options<{\n label?: string\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n suffix?: string\n hidden?: boolean\n}>\n\ntype ResponsiveNumberDescriptor<_T = ResponsiveNumberValue> = {\n type: typeof Types.ResponsiveNumber\n options: ResponsiveNumberOptions\n}\n\nexport function ResponsiveNumber(\n options: ResponsiveNumberOptions = {},\n): ResponsiveNumberDescriptor {\n return { type: Types.ResponsiveNumber, options }\n}\n\nexport type ResponsiveOpacityValue = ResponsiveValue<number>\n\ntype ResponsiveOpacityOptions = Options<Record<string, never>>\n\ntype ResponsiveOpacityDescriptor<_T = ResponsiveOpacityValue> = {\n type: typeof Types.ResponsiveOpacity\n options: ResponsiveOpacityOptions\n}\n\nexport function ResponsiveOpacity(\n options: ResponsiveOpacityOptions = {},\n): ResponsiveOpacityDescriptor {\n return { type: Types.ResponsiveOpacity, options }\n}\n\nexport type ResponsiveSelectValue<T extends string> = ResponsiveValue<T>\n\ntype SelectLabelOrientation = 'vertical' | 'horizontal'\n\ntype SelectOption<T extends string> = { value: T; label: string }\n\ntype ResponsiveSelectOptions<T extends string, U extends T = T> = Options<{\n label?: string\n labelOrientation?: SelectLabelOrientation\n options: SelectOption<T>[]\n defaultValue?: U\n hidden?: boolean\n}>\n\ntype ResponsiveSelectDescriptor<T extends ResponsiveSelectValue<string>> = {\n type: typeof Types.ResponsiveSelect\n options: ResponsiveSelectOptions<ResponsiveValueType<T>>\n}\n\n// HACK(miguel): We have to use a layer of indirection with `_T` and `T` because otherwise the\n// values provided would undergo type widening. For some reason, the extra layer of indirection\n// reuslts in TypeScript not widening types. Note, this only happens when the returned value of this\n// function is passed to another as an argument, which is common with the `registerComponent` API.\nexport function ResponsiveSelect<_T extends string, T extends _T, U extends T>(\n options: ResponsiveSelectOptions<T, U>,\n): ResponsiveSelectDescriptor<ResponsiveSelectValue<T>> {\n return { type: Types.ResponsiveSelect, options }\n}\n\nexport type RichTextValue = IndexSignatureHack<Slate.ValueJSON>\n\ntype RichTextOptions = Options<{ preset?: RichTextValue }>\n\nexport type RichTextDescriptor<_T extends Data = RichTextValue> = {\n type: typeof Types.RichText\n options: RichTextOptions\n}\n\nexport function RichText(options: RichTextOptions = {}): RichTextDescriptor {\n return { type: Types.RichText, options }\n}\n\ntype Shadow = {\n color?: Color | null\n blurRadius?: number\n spreadRadius?: number\n offsetX?: number\n offsetY?: number\n inset?: boolean\n}\n\ntype Shadows = { id: string; payload: Shadow }[]\n\nexport type ShadowsValue = ResponsiveValue<Shadows>\n\ntype ShadowsOptions = Options<Record<string, never>>\n\ntype ShadowsDescriptor<_T = ShadowsValue> = { type: typeof Types.Shadows; options: ShadowsOptions }\n\nexport function Shadows(options: ShadowsOptions = {}): ShadowsDescriptor {\n return { type: Types.Shadows, options }\n}\n\nexport type ShapeValue<T extends Data = Data> = Record<string, T>\n\ntype ShapeOptions<T extends Record<string, Descriptor>> = {\n type: T\n preset?: { [K in keyof T]?: DescriptorValueType<T[K]> }\n}\n\ntype ShapeDescriptor<_T extends Record<string, Data>, U extends Record<string, Descriptor>> = {\n type: typeof Types.Shape\n options: ShapeOptions<U>\n}\n\nexport function Shape<T extends Record<string, Descriptor>>(\n options: ShapeOptions<T>,\n): ShapeDescriptor<{ [K in keyof T]?: DescriptorValueType<T[K]> }, T> {\n return { type: Types.Shape, options }\n}\n\ntype SocialLinkType =\n | 'angellist'\n | 'codepen'\n | 'dribbble'\n | 'facebook'\n | 'github'\n | 'instagram'\n | 'linkedin'\n | 'medium'\n | 'pinterest'\n | 'reddit'\n | 'rss'\n | 'snapchat'\n | 'soundcloud'\n | 'spotify'\n | 'telegram'\n | 'tumblr'\n | 'twitch'\n | 'twitter'\n | 'vimeo'\n | 'whatsapp'\n | 'yelp'\n | 'youtube'\n\ntype SocialLink = { type: SocialLinkType; url: string }\n\ntype SocialLinksLink = { id: string; payload: SocialLink }\n\nexport type SocialLinksValue = { links: SocialLinksLink[]; openInNewTab: boolean }\n\ntype SocialLinksOptions = Options<{ preset?: SocialLinksValue }>\n\ntype SocialLinksDescriptor<_T = SocialLinksValue> = {\n type: typeof Types.SocialLinks\n options: SocialLinksOptions\n}\n\nexport function SocialLinks(options: SocialLinksOptions = {}): SocialLinksDescriptor {\n return { type: Types.SocialLinks, options }\n}\n\nexport type TableValue = string\n\ntype TableOptions = Options<{ preset?: TableValue }>\n\ntype TableDescriptor<_T = TableValue> = { type: typeof Types.Table; options: TableOptions }\n\nexport function Table(options: TableOptions = {}): TableDescriptor {\n return { type: Types.Table, options }\n}\n\ntype TableFormField = {\n id: string\n tableColumnId: string\n label?: string\n placeholder?: string\n defaultValue?: string | boolean | string[]\n required?: boolean\n hidden?: boolean\n type?: 'select' | 'radio'\n hideLabel?: boolean\n autofill?: boolean\n}\n\ntype Grid = { count: number; spans: number[][] }\n\nexport type TableFormFieldsValue = { fields: TableFormField[]; grid: ResponsiveValue<Grid> }\n\ntype TableFormFieldsOptions = Options<{ preset?: TableFormFieldsValue }>\n\nexport type TableFormFieldsDescriptor<_T = TableFormFieldsValue> = {\n type: typeof Types.TableFormFields\n options: TableFormFieldsOptions\n}\n\nexport function TableFormFields(options: TableFormFieldsOptions = {}): TableFormFieldsDescriptor {\n return { type: Types.TableFormFields, options }\n}\n\nexport type TypeaheadValue<T extends Data = Data> = {\n id: string\n label: string\n value: T\n}\n\nexport type TypeaheadOptions<T extends Data> = {\n getItems: (query: string) => Promise<TypeaheadValue<T>[]>\n label?: string\n preset?: TypeaheadValue<T>\n defaultValue?: TypeaheadValue<T>\n}\n\nexport type TypeaheadDescriptor<T extends TypeaheadValue = TypeaheadValue> = {\n type: typeof Types.Typeahead\n options: TypeaheadOptions<T extends TypeaheadValue<infer U> ? U : never>\n}\n\nexport function Typeahead<T extends Data>(\n options: TypeaheadOptions<T>,\n): TypeaheadDescriptor<TypeaheadValue<T>> {\n return { type: Types.Typeahead, options }\n}\n\nexport type TextAreaValue = string\n\ntype TextAreaOptions = Options<{ preset?: TextAreaValue; label?: string; rows?: number }>\n\ntype TextAreaDescriptor<_T = TextAreaValue> = {\n type: typeof Types.TextArea\n options: TextAreaOptions\n}\n\nexport function TextArea(options: TextAreaOptions = {}): TextAreaDescriptor {\n return { type: Types.TextArea, options }\n}\n\nexport type TextInputValue = string\n\ntype TextInputOptions = Options<{ label?: string; placeholder?: string; hidden?: boolean }>\n\ntype TextInputDescriptor<_T = TextInputValue> = {\n type: typeof Types.TextInput\n options: TextInputOptions\n}\n\nexport function TextInput(options: TextInputOptions = {}): TextInputDescriptor {\n return { type: Types.TextInput, options }\n}\n\nexport type TextStyleValue = ResponsiveValue<TextStyle>\n\ntype TextStyleOptions = Options<{ preset?: TextStyleValue; label?: string; hidden?: boolean }>\n\ntype TextStyleDescriptor<_T = TextStyleValue> = {\n type: typeof Types.TextStyle\n options: TextStyleOptions\n}\n\nexport function TextStyle(options: TextStyleOptions = {}): TextStyleDescriptor {\n return { type: Types.TextStyle, options }\n}\n\ntype Video = {\n url?: string\n muted?: boolean\n playing?: boolean\n loop?: boolean\n controls?: boolean\n}\n\nexport type VideoValue = Video\n\ntype VideoOptions = Options<{ preset?: VideoValue }>\n\ntype VideoDescriptor<_T = VideoValue> = { type: typeof Types.Video; options: VideoOptions }\n\nexport function Video(options: VideoOptions = {}): VideoDescriptor {\n return { type: Types.Video, options }\n}\n\nexport type WidthValue = ResponsiveValue<Length>\n\ntype WidthOptions = Options<{ preset?: WidthValue; defaultValue?: Length }>\n\ntype WidthDescriptor<_T = WidthValue> = { type: typeof Types.Width; options: WidthOptions }\n\nexport function Width(options: WidthOptions = {}): WidthDescriptor {\n return { type: Types.Width, options }\n}\n\nexport type Descriptor<T extends Data = Data> =\n | BackgroundsDescriptor<T>\n | BorderDescriptor<T>\n | BorderRadiusDescriptor<T>\n | CheckboxDescriptor<T>\n | DateDescriptor<T>\n | ElementIDDescriptor<T>\n | FontDescriptor<T>\n | GapXDescriptor<T>\n | GapYDescriptor<T>\n | GridDescriptor<T>\n | ImageDescriptor<T>\n | ImagesDescriptor<T>\n | LinkDescriptor<T>\n | ListDescriptor<T extends ListValue ? T : ListValue>\n | MarginDescriptor<T>\n | NavigationLinksDescriptor<T>\n | NumberDescriptor<T>\n | PaddingDescriptor<T>\n | ResponsiveColorDescriptor<T>\n | ResponsiveIconRadioGroupDescriptor<\n T extends ResponsiveIconRadioGroupValue<string> ? T : ResponsiveIconRadioGroupValue<string>\n >\n | ResponsiveLengthDescriptor<T>\n | ResponsiveNumberDescriptor<T>\n | ResponsiveOpacityDescriptor<T>\n | ResponsiveSelectDescriptor<\n T extends ResponsiveSelectValue<string> ? T : ResponsiveSelectValue<string>\n >\n | RichTextDescriptor<T>\n | ShadowsDescriptor<T>\n | ShapeDescriptor<T extends ShapeValue ? T : ShapeValue, any>\n | SocialLinksDescriptor<T>\n | TableDescriptor<T>\n | TableFormFieldsDescriptor<T>\n | TypeaheadDescriptor<T extends TypeaheadValue ? T : TypeaheadValue>\n | TextAreaDescriptor<T>\n | TextInputDescriptor<T>\n | TextStyleDescriptor<T>\n | VideoDescriptor<T>\n | WidthDescriptor<T>\n\ntype PanelDescriptorType =\n | typeof Types.Backgrounds\n | typeof Types.ResponsiveIconRadioGroup\n | typeof Types.Margin\n | typeof Types.Padding\n | typeof Types.Border\n | typeof Types.Shadows\n | typeof Types.GapY\n | typeof Types.GapX\n | typeof Types.BorderRadius\n | typeof Types.Checkbox\n | typeof Types.TextInput\n | typeof Types.Link\n | typeof Types.List\n | typeof Types.Shape\n | typeof Types.ResponsiveSelect\n | typeof Types.ResponsiveColor\n | typeof Types.TextStyle\n | typeof Types.Images\n | typeof Types.ResponsiveNumber\n | typeof Types.Number\n | typeof Types.Date\n | typeof Types.Font\n | typeof Types.TextArea\n | typeof Types.Table\n | typeof Types.Typeahead\n | typeof Types.RichText\n | typeof Types.Image\n | typeof Types.ResponsiveOpacity\n | typeof Types.SocialLinks\n | typeof Types.Video\n | typeof Types.NavigationLinks\n\nexport type PanelDescriptor<T extends Data = Data> = Extract<\n Descriptor<T>,\n { type: PanelDescriptorType }\n>\n\nexport type DescriptorValueType<T extends Descriptor> = T extends Descriptor<infer U> ? U : never\n"],"names":[],"mappings":";AAwFO,MAAM,QAAQ;AAAA,EACnB,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,UAAU;AAAA,EACV,MAAM;AAAA,EACN,WAAW;AAAA,EACX,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EAC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AAM,SAAS,QAAQ;AACxC;AAcO,eACL,SACoE;AACpE,SAAO,EAAE,MAAM,MAAM,OAAO,QAAQ;AACtC;AAuC4B,qBAAA,UAA8B,IAA2B;AACnF,SAAO,EAAE,MAAM,MAAM,aAAa,QAAQ;AAC5C;AAQsB,eAAA,UAAwB,IAAqB;AACjE,SAAO,EAAE,MAAM,MAAM,OAAO,QAAQ;AACtC;AA0BgC,yBAAA,UAAkC,IAA+B;AAC/F,SAAO,EAAE,MAAM,MAAM,iBAAiB,QAAQ;AAChD;AAoBO,mBACL,SACwC;AACxC,SAAO,EAAE,MAAM,MAAM,WAAW,QAAQ;AAC1C;AAWyB,kBAAA,UAA2B,IAAwB;AAC1E,SAAO,EAAE,MAAM,MAAM,UAAU,QAAQ;AACzC;AAW0B,mBAAA,UAA4B,IAAyB;AAC7E,SAAO,EAAE,MAAM,MAAM,WAAW,QAAQ;AAC1C;AAW0B,mBAAA,UAA4B,IAAyB;AAC7E,SAAO,EAAE,MAAM,MAAM,WAAW,QAAQ;AAC1C;AAgBsB,eAAA,UAAwB,IAAqB;AACjE,SAAO,EAAE,MAAM,MAAM,OAAO,QAAQ;AACtC;AAQsB,eAAA,UAAwB,IAAqB;AACjE,SAAO,EAAE,MAAM,MAAM,OAAO,QAAQ;AACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/descriptors.es.js
CHANGED
|
@@ -29,6 +29,7 @@ const Types = {
|
|
|
29
29
|
SocialLinks: "SocialLinks",
|
|
30
30
|
Table: "Table",
|
|
31
31
|
TableFormFields: "TableFormFields",
|
|
32
|
+
Typeahead: "Typeahead",
|
|
32
33
|
TextArea: "TextArea",
|
|
33
34
|
TextInput: "TextInput",
|
|
34
35
|
TextStyle: "TextStyle",
|
|
@@ -125,6 +126,9 @@ function Table(options = {}) {
|
|
|
125
126
|
function TableFormFields(options = {}) {
|
|
126
127
|
return { type: Types.TableFormFields, options };
|
|
127
128
|
}
|
|
129
|
+
function Typeahead(options) {
|
|
130
|
+
return { type: Types.Typeahead, options };
|
|
131
|
+
}
|
|
128
132
|
function TextArea(options = {}) {
|
|
129
133
|
return { type: Types.TextArea, options };
|
|
130
134
|
}
|
|
@@ -140,9 +144,8 @@ function Video(options = {}) {
|
|
|
140
144
|
function Width(options = {}) {
|
|
141
145
|
return { type: Types.Width, options };
|
|
142
146
|
}
|
|
143
|
-
var descriptors = /* @__PURE__ */ Object.freeze({
|
|
147
|
+
var descriptors = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
144
148
|
__proto__: null,
|
|
145
|
-
[Symbol.toStringTag]: "Module",
|
|
146
149
|
Types,
|
|
147
150
|
Backgrounds,
|
|
148
151
|
Border,
|
|
@@ -174,11 +177,12 @@ var descriptors = /* @__PURE__ */ Object.freeze({
|
|
|
174
177
|
SocialLinks,
|
|
175
178
|
Table,
|
|
176
179
|
TableFormFields,
|
|
180
|
+
Typeahead,
|
|
177
181
|
TextArea,
|
|
178
182
|
TextInput,
|
|
179
183
|
TextStyle,
|
|
180
184
|
Video,
|
|
181
185
|
Width
|
|
182
|
-
});
|
|
183
|
-
export { Backgrounds as B, Checkbox as C, Date as D, ElementID as E, Font as F, GapY as G, Image as I, Link as L, Margin as M, Number as N, Padding as P, ResponsiveIconRadioGroup as R, Shadows as S, Types as T, Width as W, Border as a, BorderRadius as b, GapX as c, descriptors as d, ResponsiveSelect as e, ResponsiveNumber as f, Grid as g, TextInput as h, ResponsiveColor as i, TextStyle as j, ResponsiveOpacity as k, Images as l, ResponsiveLength as m, TextArea as n,
|
|
186
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
187
|
+
export { Backgrounds as B, Checkbox as C, Date as D, ElementID as E, Font as F, GapY as G, Image as I, Link as L, Margin as M, Number as N, Padding as P, ResponsiveIconRadioGroup as R, Shadows as S, Types as T, Width as W, Border as a, BorderRadius as b, GapX as c, descriptors as d, ResponsiveSelect as e, ResponsiveNumber as f, Grid as g, TextInput as h, ResponsiveColor as i, TextStyle as j, ResponsiveOpacity as k, Images as l, ResponsiveLength as m, TextArea as n, Table as o, TableFormFields as p, NavigationLinks as q, SocialLinks as r, RichText as s };
|
|
184
188
|
//# sourceMappingURL=descriptors.es.js.map
|