@makeswift/runtime 0.9.3 → 0.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Box.cjs.js +4 -4
- package/dist/Box.es.js +5 -5
- package/dist/Button.cjs.js +4 -4
- package/dist/Button.es.js +5 -5
- package/dist/Carousel.cjs.js +4 -4
- package/dist/Carousel.es.js +5 -5
- package/dist/Countdown.cjs.js +2 -2
- package/dist/Countdown.es.js +3 -3
- package/dist/Divider.cjs.js +4 -4
- package/dist/Divider.es.js +5 -5
- package/dist/Embed.cjs.js +1 -0
- package/dist/Embed.cjs.js.map +1 -1
- package/dist/Embed.es.js +2 -1
- package/dist/Embed.es.js.map +1 -1
- package/dist/Form.cjs.js +2 -2
- package/dist/Form.es.js +3 -3
- package/dist/Image.cjs.js +2 -2
- package/dist/Image.es.js +3 -3
- package/dist/LiveProvider.cjs.js +5 -5
- package/dist/LiveProvider.es.js +5 -5
- package/dist/Navigation.cjs.js +3 -3
- package/dist/Navigation.es.js +4 -4
- package/dist/PreviewProvider.cjs.js +9 -8
- package/dist/PreviewProvider.cjs.js.map +1 -1
- package/dist/PreviewProvider.es.js +11 -10
- package/dist/PreviewProvider.es.js.map +1 -1
- package/dist/ReadOnlyText.cjs.js +4 -5
- package/dist/ReadOnlyText.cjs.js.map +1 -1
- package/dist/ReadOnlyText.es.js +4 -5
- package/dist/ReadOnlyText.es.js.map +1 -1
- package/dist/ReadOnlyTextV2.cjs.js +17 -19
- package/dist/ReadOnlyTextV2.cjs.js.map +1 -1
- package/dist/ReadOnlyTextV2.es.js +16 -18
- package/dist/ReadOnlyTextV2.es.js.map +1 -1
- package/dist/Root.cjs.js +2 -2
- package/dist/Root.es.js +3 -3
- package/dist/SocialLinks.cjs.js +4 -4
- package/dist/SocialLinks.es.js +5 -5
- package/dist/Text.cjs.js +2 -2
- package/dist/Text.es.js +2 -2
- package/dist/Video.cjs.js +1 -0
- package/dist/Video.cjs.js.map +1 -1
- package/dist/Video.es.js +2 -1
- package/dist/Video.es.js.map +1 -1
- package/dist/actions.cjs.js +467 -3
- package/dist/actions.cjs.js.map +1 -1
- package/dist/actions.es.js +467 -4
- package/dist/actions.es.js.map +1 -1
- package/dist/box-model.cjs.js +1 -0
- package/dist/box-model.cjs.js.map +1 -1
- package/dist/box-model.es.js +1 -0
- package/dist/box-model.es.js.map +1 -1
- package/dist/builder.cjs.js +1 -0
- package/dist/builder.cjs.js.map +1 -1
- package/dist/builder.es.js +1 -0
- package/dist/builder.es.js.map +1 -1
- package/dist/components.cjs.js +2 -2
- package/dist/components.es.js +2 -2
- package/dist/control-serialization.cjs.js +1 -0
- package/dist/control-serialization.cjs.js.map +1 -1
- package/dist/control-serialization.es.js +2 -1
- package/dist/control-serialization.es.js.map +1 -1
- package/dist/controls.cjs.js +19 -14
- package/dist/controls.cjs.js.map +1 -1
- package/dist/controls.es.js +3 -2
- package/dist/controls.es.js.map +1 -1
- package/dist/index.cjs.js +182 -60
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs10.js +25 -13
- package/dist/index.cjs10.js.map +1 -1
- package/dist/index.cjs2.js +1 -0
- package/dist/index.cjs2.js.map +1 -1
- package/dist/index.cjs5.js +96 -5
- package/dist/index.cjs5.js.map +1 -1
- package/dist/index.cjs8.js +2 -2
- package/dist/index.cjs9.js +5 -5
- package/dist/index.es.js +170 -49
- package/dist/index.es.js.map +1 -1
- package/dist/index.es10.js +26 -14
- package/dist/index.es10.js.map +1 -1
- package/dist/index.es2.js +2 -1
- package/dist/index.es2.js.map +1 -1
- package/dist/index.es4.js +1 -1
- package/dist/index.es5.js +88 -2
- package/dist/index.es5.js.map +1 -1
- package/dist/index.es6.js +1 -1
- package/dist/index.es8.js +2 -2
- package/dist/index.es9.js +6 -6
- package/dist/main.cjs.js +1 -0
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +1 -0
- package/dist/main.es.js.map +1 -1
- package/dist/next.cjs.js +2 -2
- package/dist/next.es.js +3 -3
- package/dist/prop-controllers.cjs.js +1 -0
- package/dist/prop-controllers.cjs.js.map +1 -1
- package/dist/prop-controllers.es.js +1 -0
- package/dist/prop-controllers.es.js.map +1 -1
- package/dist/react-page.cjs.js +114 -31
- package/dist/react-page.cjs.js.map +1 -1
- package/dist/react-page.es.js +111 -12
- package/dist/react-page.es.js.map +1 -1
- package/dist/react.cjs.js +2 -2
- package/dist/react.es.js +2 -2
- package/dist/slate.cjs.js +22 -75
- package/dist/slate.cjs.js.map +1 -1
- package/dist/slate.es.js +25 -79
- package/dist/slate.es.js.map +1 -1
- package/dist/state/breakpoints.cjs.js +1 -0
- package/dist/state/breakpoints.cjs.js.map +1 -1
- package/dist/state/breakpoints.es.js +1 -0
- package/dist/state/breakpoints.es.js.map +1 -1
- package/dist/types/src/components/builtin/Button/Button.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts +0 -17
- package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +1 -1
- package/dist/types/src/components/page/Page.d.ts.map +1 -1
- package/dist/types/src/controls/control.d.ts +3 -2
- package/dist/types/src/controls/control.d.ts.map +1 -1
- package/dist/types/src/controls/index.d.ts +1 -0
- package/dist/types/src/controls/index.d.ts.map +1 -1
- package/dist/types/src/controls/list.d.ts +2 -0
- package/dist/types/src/controls/list.d.ts.map +1 -1
- package/dist/types/src/controls/shape.d.ts +2 -0
- package/dist/types/src/controls/shape.d.ts.map +1 -1
- package/dist/types/src/controls/typography.d.ts +31 -0
- package/dist/types/src/controls/typography.d.ts.map +1 -0
- package/dist/types/src/next/client.d.ts +9 -1
- package/dist/types/src/next/client.d.ts.map +1 -1
- package/dist/types/src/next/index.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/descriptors.d.ts +6 -3
- package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/introspection.d.ts +1 -1
- package/dist/types/src/prop-controllers/introspection.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/control.d.ts +3 -2
- package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/typography.d.ts +21 -0
- package/dist/types/src/runtimes/react/controls/typography.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/index.d.ts +9 -0
- package/dist/types/src/slate/TypographyPlugin/index.d.ts.map +1 -1
- package/dist/types/src/state/actions.d.ts +7 -7
- package/dist/types/src/state/actions.d.ts.map +1 -1
- package/dist/types/src/state/modules/locales.d.ts +6 -7
- package/dist/types/src/state/modules/locales.d.ts.map +1 -1
- package/dist/types/src/state/react-builder-preview.d.ts.map +1 -1
- package/dist/types/src/state/react-page.d.ts +3 -1
- package/dist/types/src/state/react-page.d.ts.map +1 -1
- package/dist/types/types/locale.d.ts +9 -0
- package/dist/types/types/locale.d.ts.map +1 -0
- package/dist/types.cjs2.js +13 -16
- package/dist/types.cjs2.js.map +1 -1
- package/dist/types.es2.js +10 -13
- package/dist/types.es2.js.map +1 -1
- package/dist/{text-input.cjs.js → typography.cjs.js} +9 -1
- package/dist/typography.cjs.js.map +1 -0
- package/dist/{text-input.es.js → typography.es.js} +8 -2
- package/dist/typography.es.js.map +1 -0
- package/package.json +1 -1
- package/dist/leaf.cjs.js +0 -182
- package/dist/leaf.cjs.js.map +0 -1
- package/dist/leaf.es.js +0 -179
- package/dist/leaf.es.js.map +0 -1
- package/dist/text-input.cjs.js.map +0 -1
- package/dist/text-input.es.js.map +0 -1
package/dist/index.es5.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es5.js","sources":["../src/slate/TypographyPlugin/clearActiveTypographyStyle.ts","../src/slate/TypographyPlugin/clearDeviceActiveTypography.ts","../src/slate/TypographyPlugin/detachActiveTypography.ts","../src/slate/TypographyPlugin/setActiveTypographyId.ts","../src/slate/TypographyPlugin/setActiveTypographyStyle.ts","../src/slate/TypographyPlugin/index.ts"],"sourcesContent":["import { Editor, Transforms, Text, Range } from 'slate'\nimport { RichTextTypography } from '../types'\n\ntype ClearActiveTypographyStyleOptions = {\n at?: Range\n}\n\nexport function clearActiveTypographyStyle(\n editor: Editor,\n options?: ClearActiveTypographyStyleOptions,\n) {\n Editor.withoutNormalizing(editor, () => {\n const at = options?.at ?? editor.selection\n if (!at) return\n const atRef = Editor.rangeRef(editor, at)\n\n if (atRef.current) {\n Transforms.setNodes(\n editor,\n {\n slice: true,\n },\n {\n at: atRef.current,\n match: node => Text.isText(node),\n split: Range.isExpanded(atRef.current),\n },\n )\n }\n\n if (atRef.current) {\n const textNodes = Array.from(\n Editor.nodes(editor, {\n at: atRef.current,\n match: node => Text.isText(node) && node.slice === true,\n }),\n )\n\n for (const [node, path] of textNodes) {\n if (Text.isText(node)) {\n const typography: RichTextTypography = {\n ...node.typography,\n style: [],\n }\n\n Transforms.setNodes(\n editor,\n {\n typography,\n },\n { at: path },\n )\n }\n }\n }\n\n atRef.unref()\n })\n}\n","import { Editor, Transforms, Text, Range } from 'slate'\nimport { RichTextTypography } from '../types'\n\ntype ClearDeviceActiveTypographyOptions = {\n at?: Range\n}\n\nexport function clearDeviceActiveTypography(\n editor: Editor,\n currentDeviceId: string,\n options?: ClearDeviceActiveTypographyOptions,\n) {\n Editor.withoutNormalizing(editor, () => {\n const at = options?.at ?? editor.selection\n if (!at) return\n const atRef = Editor.rangeRef(editor, at)\n\n if (atRef.current) {\n Transforms.setNodes(\n editor,\n {\n slice: true,\n },\n {\n at: atRef.current,\n match: node => Text.isText(node),\n split: Range.isExpanded(atRef.current),\n },\n )\n }\n\n if (atRef.current) {\n const textNodes = Array.from(\n Editor.nodes(editor, {\n at: atRef.current,\n match: node => Text.isText(node) && node.slice === true,\n }),\n )\n\n for (const [node, path] of textNodes) {\n if (Text.isText(node)) {\n const typography: RichTextTypography = {\n ...node.typography,\n style:\n node?.typography?.style.filter(({ deviceId }) => deviceId !== currentDeviceId) ?? [],\n }\n\n Transforms.setNodes(\n editor,\n {\n typography,\n },\n { at: path },\n )\n }\n }\n }\n\n atRef.unref()\n })\n}\n","import { Editor, Transforms, Text, Range } from 'slate'\nimport { RichTextTypography } from '../types'\n\ntype SetActiveTypographyIdOptions = {\n at?: Range\n}\n\nexport function detachActiveTypography(\n editor: Editor,\n value: RichTextTypography['style'],\n options?: SetActiveTypographyIdOptions,\n) {\n Editor.withoutNormalizing(editor, () => {\n const at = options?.at ?? editor.selection\n if (!at) return\n const atRef = Editor.rangeRef(editor, at)\n\n if (atRef.current) {\n Transforms.setNodes(\n editor,\n {\n slice: true,\n },\n {\n at: atRef.current,\n match: node => Text.isText(node),\n split: Range.isExpanded(atRef.current),\n },\n )\n }\n\n if (atRef.current) {\n const textNodes = Array.from(\n Editor.nodes(editor, {\n at: atRef.current,\n match: node => Text.isText(node) && node.slice === true,\n }),\n )\n\n for (const [node, path] of textNodes) {\n if (Text.isText(node)) {\n Transforms.setNodes(\n editor,\n {\n typography: {\n style: value,\n },\n },\n { at: path },\n )\n }\n }\n }\n\n atRef.unref()\n })\n}\n","import { Editor, Transforms, Text, Range } from 'slate'\n\ntype SetActiveTypographyIdOptions = {\n at?: Range\n}\n\nexport function setActiveTypographyId(\n editor: Editor,\n id?: string,\n options?: SetActiveTypographyIdOptions,\n) {\n const at = options?.at ?? editor.selection\n if (!at) return\n Transforms.setNodes(\n editor,\n {\n typography: {\n id,\n style: [],\n },\n },\n {\n at,\n match: node => Text.isText(node),\n split: Range.isExpanded(at),\n },\n )\n}\n","import { Editor, Transforms, Text, Range } from 'slate'\nimport { Breakpoints, findBreakpointOverride, BreakpointId } from '../../state/modules/breakpoints'\nimport { RichTextTypography } from '../types'\n\ntype SetActiveTypographyStyleOptions = {\n at?: Range\n}\n\nexport function setActiveTypographyStyle(\n editor: Editor,\n breakpoints: Breakpoints,\n deviceId: string,\n prop: string,\n value?: unknown,\n options?: SetActiveTypographyStyleOptions,\n) {\n Editor.withoutNormalizing(editor, () => {\n const at = options?.at ?? editor.selection\n if (!at) return\n const atRef = Editor.rangeRef(editor, at)\n\n if (atRef.current) {\n Transforms.setNodes(\n editor,\n {\n slice: true,\n },\n {\n at: atRef.current,\n match: node => Text.isText(node),\n split: Range.isExpanded(atRef.current),\n },\n )\n }\n\n if (atRef.current) {\n const textNodes = Array.from(\n Editor.nodes(editor, {\n at: atRef.current,\n match: node => Text.isText(node) && node.slice === true,\n }),\n )\n\n for (const [node, path] of textNodes) {\n if (Text.isText(node)) {\n const deviceOverrides = node?.typography?.style ?? []\n const deviceStyle = findBreakpointOverride(\n breakpoints,\n deviceOverrides,\n deviceId as BreakpointId,\n v => v,\n ) || {\n value: {},\n }\n const nextDeviceStyle = {\n deviceId,\n value: { ...deviceStyle.value, [prop]: value },\n }\n\n const nextTypography: RichTextTypography = {\n ...node.typography,\n style: [...deviceOverrides.filter(v => v.deviceId !== deviceId), nextDeviceStyle],\n }\n\n Transforms.setNodes(\n editor,\n {\n typography: nextTypography,\n },\n { at: path },\n )\n }\n }\n }\n\n atRef.unref()\n })\n}\n","import { Editor, Text, Transforms } from 'slate'\nimport { clearActiveTypographyStyle } from './clearActiveTypographyStyle'\nimport { clearDeviceActiveTypography } from './clearDeviceActiveTypography'\nimport { detachActiveTypography } from './detachActiveTypography'\nimport { setActiveTypographyId } from './setActiveTypographyId'\nimport { setActiveTypographyStyle } from './setActiveTypographyStyle'\n\nexport const TypographyActions = {\n setActiveTypographyId,\n setActiveTypographyStyle,\n clearActiveTypographyStyle,\n clearDeviceActiveTypography,\n detachActiveTypography,\n}\n\nexport function withTypography(editor: Editor) {\n const { normalizeNode } = editor\n editor.normalizeNode = entry => {\n const [normalizationNode, normalizationPath] = entry\n if (\n Text.isText(normalizationNode) &&\n normalizationNode?.typography?.id == null &&\n normalizationNode?.typography?.style.length === 0\n ) {\n Transforms.unsetNodes(editor, 'typography', { at: normalizationPath })\n return\n }\n\n if (Text.isText(normalizationNode) && normalizationNode?.slice != null) {\n Transforms.unsetNodes(editor, 'slice', { at: normalizationPath })\n return\n }\n\n normalizeNode(entry)\n }\n\n return editor\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOO,oCACL,QACA,SACA;AACO,SAAA,mBAAmB,QAAQ,MAAM;;AAChC,UAAA,KAAK,yCAAS,OAAT,YAAe,OAAO;AACjC,QAAI,CAAC;AAAI;AACT,UAAM,QAAQ,OAAO,SAAS,QAAQ,EAAE;AAExC,QAAI,MAAM,SAAS;AACjB,iBAAW,SACT,QACA;AAAA,QACE,OAAO;AAAA,MAAA,GAET;AAAA,QACE,IAAI,MAAM;AAAA,QACV,OAAO,CAAA,SAAQ,KAAK,OAAO,IAAI;AAAA,QAC/B,OAAO,MAAM,WAAW,MAAM,OAAO;AAAA,MAAA,CAEzC;AAAA,IACF;AAEA,QAAI,MAAM,SAAS;AACjB,YAAM,YAAY,MAAM,KACtB,OAAO,MAAM,QAAQ;AAAA,QACnB,IAAI,MAAM;AAAA,QACV,OAAO,CAAQ,SAAA,KAAK,OAAO,IAAI,KAAK,KAAK,UAAU;AAAA,MACpD,CAAA,CACH;AAEW,iBAAA,CAAC,MAAM,SAAS,WAAW;AAChC,YAAA,KAAK,OAAO,IAAI,GAAG;AACrB,gBAAM,aAAiC,iCAClC,KAAK,aAD6B;AAAA,YAErC,OAAO,CAAC;AAAA,UAAA;AAGV,qBAAW,SACT,QACA;AAAA,YACE;AAAA,UAAA,GAEF,EAAE,IAAI,KAAA,CACR;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAEA,UAAM,MAAM;AAAA,EAAA,CACb;AACH;AClDE,qCAAA,QACA,iBACA,SACA;AACO,SAAA,mBAAmB,QAAQ,MAAM;;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,KAAK,wDAAmB,UAAS,MAAM;AACtE,iBAAW,WAAW,QAAQ,SAAS,EAAE,IAAI,mBAAmB;AAChE;AAAA,IACF;AAEA,kBAAc,KAAK;AAAA,EAAA;AAGd,SAAA;AACT;;"}
|
|
1
|
+
{"version":3,"file":"index.es5.js","sources":["../src/slate/TypographyPlugin/clearActiveTypographyStyle.ts","../src/slate/TypographyPlugin/clearDeviceActiveTypography.ts","../src/slate/TypographyPlugin/detachActiveTypography.ts","../src/slate/TypographyPlugin/setActiveTypographyId.ts","../src/slate/TypographyPlugin/setActiveTypographyStyle.ts","../src/slate/utils/responsive.ts","../src/slate/TypographyPlugin/index.ts"],"sourcesContent":["import { Editor, Transforms, Text, Range } from 'slate'\nimport { RichTextTypography } from '../types'\n\ntype ClearActiveTypographyStyleOptions = {\n at?: Range\n}\n\nexport function clearActiveTypographyStyle(\n editor: Editor,\n options?: ClearActiveTypographyStyleOptions,\n) {\n Editor.withoutNormalizing(editor, () => {\n const at = options?.at ?? editor.selection\n if (!at) return\n const atRef = Editor.rangeRef(editor, at)\n\n if (atRef.current) {\n Transforms.setNodes(\n editor,\n {\n slice: true,\n },\n {\n at: atRef.current,\n match: node => Text.isText(node),\n split: Range.isExpanded(atRef.current),\n },\n )\n }\n\n if (atRef.current) {\n const textNodes = Array.from(\n Editor.nodes(editor, {\n at: atRef.current,\n match: node => Text.isText(node) && node.slice === true,\n }),\n )\n\n for (const [node, path] of textNodes) {\n if (Text.isText(node)) {\n const typography: RichTextTypography = {\n ...node.typography,\n style: [],\n }\n\n Transforms.setNodes(\n editor,\n {\n typography,\n },\n { at: path },\n )\n }\n }\n }\n\n atRef.unref()\n })\n}\n","import { Editor, Transforms, Text, Range } from 'slate'\nimport { RichTextTypography } from '../types'\n\ntype ClearDeviceActiveTypographyOptions = {\n at?: Range\n}\n\nexport function clearDeviceActiveTypography(\n editor: Editor,\n currentDeviceId: string,\n options?: ClearDeviceActiveTypographyOptions,\n) {\n Editor.withoutNormalizing(editor, () => {\n const at = options?.at ?? editor.selection\n if (!at) return\n const atRef = Editor.rangeRef(editor, at)\n\n if (atRef.current) {\n Transforms.setNodes(\n editor,\n {\n slice: true,\n },\n {\n at: atRef.current,\n match: node => Text.isText(node),\n split: Range.isExpanded(atRef.current),\n },\n )\n }\n\n if (atRef.current) {\n const textNodes = Array.from(\n Editor.nodes(editor, {\n at: atRef.current,\n match: node => Text.isText(node) && node.slice === true,\n }),\n )\n\n for (const [node, path] of textNodes) {\n if (Text.isText(node)) {\n const typography: RichTextTypography = {\n ...node.typography,\n style:\n node?.typography?.style.filter(({ deviceId }) => deviceId !== currentDeviceId) ?? [],\n }\n\n Transforms.setNodes(\n editor,\n {\n typography,\n },\n { at: path },\n )\n }\n }\n }\n\n atRef.unref()\n })\n}\n","import { Editor, Transforms, Text, Range } from 'slate'\nimport { RichTextTypography } from '../types'\n\ntype SetActiveTypographyIdOptions = {\n at?: Range\n}\n\nexport function detachActiveTypography(\n editor: Editor,\n value: RichTextTypography['style'],\n options?: SetActiveTypographyIdOptions,\n) {\n Editor.withoutNormalizing(editor, () => {\n const at = options?.at ?? editor.selection\n if (!at) return\n const atRef = Editor.rangeRef(editor, at)\n\n if (atRef.current) {\n Transforms.setNodes(\n editor,\n {\n slice: true,\n },\n {\n at: atRef.current,\n match: node => Text.isText(node),\n split: Range.isExpanded(atRef.current),\n },\n )\n }\n\n if (atRef.current) {\n const textNodes = Array.from(\n Editor.nodes(editor, {\n at: atRef.current,\n match: node => Text.isText(node) && node.slice === true,\n }),\n )\n\n for (const [node, path] of textNodes) {\n if (Text.isText(node)) {\n Transforms.setNodes(\n editor,\n {\n typography: {\n style: value,\n },\n },\n { at: path },\n )\n }\n }\n }\n\n atRef.unref()\n })\n}\n","import { Editor, Transforms, Text, Range } from 'slate'\n\ntype SetActiveTypographyIdOptions = {\n at?: Range\n}\n\nexport function setActiveTypographyId(\n editor: Editor,\n id?: string,\n options?: SetActiveTypographyIdOptions,\n) {\n const at = options?.at ?? editor.selection\n if (!at) return\n Transforms.setNodes(\n editor,\n {\n typography: {\n id,\n style: [],\n },\n },\n {\n at,\n match: node => Text.isText(node),\n split: Range.isExpanded(at),\n },\n )\n}\n","import { Editor, Transforms, Text, Range } from 'slate'\nimport { Breakpoints, findBreakpointOverride, BreakpointId } from '../../state/modules/breakpoints'\nimport { RichTextTypography } from '../types'\n\ntype SetActiveTypographyStyleOptions = {\n at?: Range\n}\n\nexport function setActiveTypographyStyle(\n editor: Editor,\n breakpoints: Breakpoints,\n deviceId: string,\n prop: string,\n value?: unknown,\n options?: SetActiveTypographyStyleOptions,\n) {\n Editor.withoutNormalizing(editor, () => {\n const at = options?.at ?? editor.selection\n if (!at) return\n const atRef = Editor.rangeRef(editor, at)\n\n if (atRef.current) {\n Transforms.setNodes(\n editor,\n {\n slice: true,\n },\n {\n at: atRef.current,\n match: node => Text.isText(node),\n split: Range.isExpanded(atRef.current),\n },\n )\n }\n\n if (atRef.current) {\n const textNodes = Array.from(\n Editor.nodes(editor, {\n at: atRef.current,\n match: node => Text.isText(node) && node.slice === true,\n }),\n )\n\n for (const [node, path] of textNodes) {\n if (Text.isText(node)) {\n const deviceOverrides = node?.typography?.style ?? []\n const deviceStyle = findBreakpointOverride(\n breakpoints,\n deviceOverrides,\n deviceId as BreakpointId,\n v => v,\n ) || {\n value: {},\n }\n const nextDeviceStyle = {\n deviceId,\n value: { ...deviceStyle.value, [prop]: value },\n }\n\n const nextTypography: RichTextTypography = {\n ...node.typography,\n style: [...deviceOverrides.filter(v => v.deviceId !== deviceId), nextDeviceStyle],\n }\n\n Transforms.setNodes(\n editor,\n {\n typography: nextTypography,\n },\n { at: path },\n )\n }\n }\n }\n\n atRef.unref()\n })\n}\n","import { Editor, Transforms, NodeMatch, Descendant, NodeEntry } from 'slate'\nimport { getSelection } from '../selectors'\nimport deepEqual from '../../utils/deepEqual'\n\ntype SetResponsiveValueOptions<T extends Descendant> = {\n match: NodeMatch<T>\n split: boolean\n}\n\nexport function setResponsiveValue<T extends Descendant, K extends keyof T>(\n editor: Editor,\n key: K,\n value: T[K] | undefined,\n options: SetResponsiveValueOptions<T>,\n) {\n Editor.withoutNormalizing(editor, () => {\n const at = getSelection(editor)\n if (!at) return\n const atRef = Editor.rangeRef(editor, at)\n\n if (atRef.current) {\n Transforms.setNodes<Descendant>(\n editor,\n {\n slice: true,\n },\n {\n at: atRef.current,\n match: options.match,\n split: options.split,\n },\n )\n }\n\n if (atRef.current) {\n const nodesToUpdate = Array.from(\n Editor.nodes(editor, {\n at: atRef.current,\n match: (node, path) => options.match(node, path) && node.slice === true,\n }),\n )\n\n for (const [, path] of nodesToUpdate) {\n Transforms.setNodes(\n editor,\n {\n [key]: value,\n },\n { at: path },\n )\n }\n }\n\n atRef.unref()\n })\n}\n\ntype GetResponsiveValueOptions<T extends Descendant> = {\n match: NodeMatch<T>\n}\n\nexport function getResponsiveValue<T extends Descendant, K extends keyof T>(\n editor: Editor,\n key: K,\n options: GetResponsiveValueOptions<T>,\n): T[K] | undefined {\n const matchingValues = Array.from(\n Editor.nodes(editor, {\n at: getSelection(editor),\n match: options?.match,\n }),\n )\n .filter(([node, path]) => options.match(node, path))\n .map(([node]) => node[key]) as (T[K] | undefined)[]\n\n const value =\n matchingValues.length === 0\n ? undefined\n : matchingValues.reduce((a, b) => (deepEqual(a, b) ? b : undefined))\n\n return value\n}\n\ntype NormalizeResponsiveValueOptions<T extends Descendant> = {\n match: NodeMatch<T>\n}\n\nexport function normalizeResponsiveValue<T extends Descendant, K extends keyof T & string>(\n editor: Editor,\n key: K,\n options: NormalizeResponsiveValueOptions<T>,\n) {\n return (entry: NodeEntry) => {\n const [node, path] = entry\n\n if (!options.match(node, path)) {\n return false\n }\n\n const responsiveValue = node?.[key]\n\n if (Array.isArray(responsiveValue) && responsiveValue.length === 0) {\n Transforms.unsetNodes(editor, key, { at: path })\n return true\n }\n\n if (node?.slice != null) {\n Transforms.unsetNodes(editor, 'slice', { at: path })\n return true\n }\n\n return false\n }\n}\n","import { Editor, Text, Transforms } from 'slate'\nimport { clearActiveTypographyStyle } from './clearActiveTypographyStyle'\nimport { clearDeviceActiveTypography } from './clearDeviceActiveTypography'\nimport { detachActiveTypography } from './detachActiveTypography'\nimport { setActiveTypographyId } from './setActiveTypographyId'\nimport { setActiveTypographyStyle } from './setActiveTypographyStyle'\nimport { createRichTextV2Plugin, unstable_Typography } from '../../controls'\nimport { getResponsiveValue, setResponsiveValue } from '../utils/responsive'\n\nexport const TypographyActions = {\n setActiveTypographyId,\n setActiveTypographyStyle,\n clearActiveTypographyStyle,\n clearDeviceActiveTypography,\n detachActiveTypography,\n}\n\nexport const TYPOGRAPHY_KEY = 'typography'\n\nexport function withTypography(editor: Editor) {\n const { normalizeNode } = editor\n editor.normalizeNode = entry => {\n const [normalizationNode, normalizationPath] = entry\n if (\n Text.isText(normalizationNode) &&\n normalizationNode?.typography?.id == null &&\n normalizationNode?.typography?.style.length === 0\n ) {\n Transforms.unsetNodes(editor, TYPOGRAPHY_KEY, { at: normalizationPath })\n return\n }\n\n if (Text.isText(normalizationNode) && normalizationNode?.slice != null) {\n Transforms.unsetNodes(editor, 'slice', { at: normalizationPath })\n return\n }\n\n normalizeNode(entry)\n }\n\n return editor\n}\n\nexport function TypographyPlugin() {\n return createRichTextV2Plugin({\n withPlugin: withTypography,\n control: {\n definition: unstable_Typography(),\n onChange: (editor, value) => {\n setResponsiveValue(editor, TYPOGRAPHY_KEY, value, {\n match: Text.isText,\n split: true,\n })\n },\n getValue: editor => getResponsiveValue(editor, TYPOGRAPHY_KEY, { match: Text.isText }),\n getLeafValue: (text: Text) => {\n return Text.isText(text) ? text.typography : undefined\n },\n },\n renderLeaf: (renderLeaf, className) => props => {\n return renderLeaf({\n ...props,\n leaf: {\n ...props.leaf,\n className: `${props.leaf.className} ${className}`,\n },\n })\n },\n })\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAOO,oCACL,QACA,SACA;AACO,SAAA,mBAAmB,QAAQ,MAAM;;AAChC,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,iBAAiB,KAAK,wDAAmB,UAAS,MAAM;AACtE,iBAAW,WAAW,QAAQ,SAAS,EAAE,IAAI,mBAAmB;AAChE;AAAA,IACF;AAEA,kBAAc,KAAK;AAAA,EAAA;AAGd,SAAA;AACT;AAEmC,4BAAA;AACjC,SAAO,uBAAuB;AAAA,IAC5B,YAAY;AAAA,IACZ,SAAS;AAAA,MACP,YAAY,oBAAoB;AAAA,MAChC,UAAU,CAAC,QAAQ,UAAU;AACR,2BAAA,QAAQ,gBAAgB,OAAO;AAAA,UAChD,OAAO,KAAK;AAAA,UACZ,OAAO;AAAA,QAAA,CACR;AAAA,MACH;AAAA,MACA,UAAU,YAAU,mBAAmB,QAAQ,gBAAgB,EAAE,OAAO,KAAK,QAAQ;AAAA,MACrF,cAAc,CAAC,SAAe;AAC5B,eAAO,KAAK,OAAO,IAAI,IAAI,KAAK,aAAa;AAAA,MAC/C;AAAA,IACF;AAAA,IACA,YAAY,CAAC,YAAY,cAAc,CAAS,UAAA;AAC9C,aAAO,WAAW,iCACb,QADa;AAAA,QAEhB,MAAM,iCACD,MAAM,OADL;AAAA,UAEJ,WAAW,GAAG,MAAM,KAAK,aAAa;AAAA,QACxC;AAAA,MAAA,EACD;AAAA,IACH;AAAA,EAAA,CACD;AACH;;"}
|
package/dist/index.es6.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Path, Transforms } from "slate";
|
|
2
2
|
import isHotkey from "is-hotkey";
|
|
3
|
-
import {
|
|
3
|
+
import { bf as BlockType, b9 as createRichTextV2Plugin } from "./react-page.es.js";
|
|
4
4
|
import { E as ElementUtils } from "./types.es2.js";
|
|
5
5
|
const BLOCK_ONE_PATH = [0];
|
|
6
6
|
const BLOCK_TWO_PATH = [1];
|
package/dist/index.es8.js
CHANGED
|
@@ -7,13 +7,14 @@ import "./react-page.es.js";
|
|
|
7
7
|
import "redux";
|
|
8
8
|
import "redux-thunk";
|
|
9
9
|
import "./actions.es.js";
|
|
10
|
+
import "zod";
|
|
10
11
|
import "./state/breakpoints.es.js";
|
|
11
12
|
import "@emotion/css";
|
|
12
13
|
import "@emotion/serialize";
|
|
13
14
|
import "@emotion/utils";
|
|
14
15
|
import "slate";
|
|
15
16
|
import "react/jsx-runtime";
|
|
16
|
-
import "./
|
|
17
|
+
import "./typography.es.js";
|
|
17
18
|
import "./combobox.es.js";
|
|
18
19
|
import "use-sync-external-store/shim";
|
|
19
20
|
import "./types.es.js";
|
|
@@ -24,7 +25,6 @@ import "scroll-into-view-if-needed";
|
|
|
24
25
|
import "react-dom";
|
|
25
26
|
import "html-react-parser";
|
|
26
27
|
import "next/head";
|
|
27
|
-
import "zod";
|
|
28
28
|
import "@emotion/server/create-instance";
|
|
29
29
|
import "next/document";
|
|
30
30
|
import "cors";
|
package/dist/index.es9.js
CHANGED
|
@@ -34,10 +34,7 @@ import { Range, createEditor } from "slate";
|
|
|
34
34
|
import isHotkey from "is-hotkey";
|
|
35
35
|
import { withHistory, HistoryEditor } from "slate-history";
|
|
36
36
|
import { ReactEditor, withReact, Slate, Editable } from "slate-react";
|
|
37
|
-
import {
|
|
38
|
-
import { cx } from "@emotion/css";
|
|
39
|
-
import "@emotion/serialize";
|
|
40
|
-
import "@emotion/utils";
|
|
37
|
+
import { U as useStyle, b8 as RichTextV2Mode, bf as BlockType, bo as BuilderEditMode } from "./react-page.es.js";
|
|
41
38
|
import { O as ControlValue, Q as useBuilderEditMode, T as pollBoxModel } from "./index.es.js";
|
|
42
39
|
import "./state/breakpoints.es.js";
|
|
43
40
|
import "./types.es2.js";
|
|
@@ -45,13 +42,16 @@ import { I as InlineModePlugin } from "./index.es6.js";
|
|
|
45
42
|
import { w as withBuilder } from "./index.es7.js";
|
|
46
43
|
import { jsx } from "react/jsx-runtime";
|
|
47
44
|
import "./index.es3.js";
|
|
45
|
+
import { cx } from "@emotion/css";
|
|
48
46
|
import { u as useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect.es.js";
|
|
47
|
+
import "./actions.es.js";
|
|
49
48
|
import "redux";
|
|
50
49
|
import "redux-thunk";
|
|
51
|
-
import "
|
|
50
|
+
import "@emotion/serialize";
|
|
51
|
+
import "@emotion/utils";
|
|
52
52
|
import "use-sync-external-store/shim/with-selector";
|
|
53
53
|
import "next/dynamic";
|
|
54
|
-
import "./
|
|
54
|
+
import "./typography.es.js";
|
|
55
55
|
import "./combobox.es.js";
|
|
56
56
|
import "use-sync-external-store/shim";
|
|
57
57
|
import "./types.es.js";
|
package/dist/main.cjs.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
3
3
|
var actions = require("./actions.cjs.js");
|
|
4
4
|
var reactPage = require("./react-page.cjs.js");
|
|
5
5
|
var constants = require("./constants.cjs.js");
|
|
6
|
+
require("zod");
|
|
6
7
|
require("redux");
|
|
7
8
|
require("redux-thunk");
|
|
8
9
|
require("./state/breakpoints.cjs.js");
|
package/dist/main.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/main.es.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { A as ActionTypes, h as builderPointerMove, d as changeApiResource, c as changeDocument, a as changeDocumentElementScrollTop, g as changePathname, b as cleanUp, e as evictApiResource, i as init, m as messageHostPropController, r as registerDocument, s as scrollDocumentElement, j as setBreakpoints, f as setBuilderEditMode, k as setLocale, l as setLocales, u as unregisterDocument } from "./actions.es.js";
|
|
2
2
|
export { C as ComponentIcon, c as createDocument } from "./react-page.es.js";
|
|
3
3
|
export { M as MakeswiftComponentType } from "./constants.es.js";
|
|
4
|
+
import "zod";
|
|
4
5
|
import "redux";
|
|
5
6
|
import "redux-thunk";
|
|
6
7
|
import "./state/breakpoints.es.js";
|
package/dist/main.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
package/dist/next.cjs.js
CHANGED
|
@@ -9,12 +9,13 @@ require("./react-page.cjs.js");
|
|
|
9
9
|
require("redux");
|
|
10
10
|
require("redux-thunk");
|
|
11
11
|
require("./actions.cjs.js");
|
|
12
|
+
require("zod");
|
|
12
13
|
require("./state/breakpoints.cjs.js");
|
|
13
14
|
require("@emotion/css");
|
|
14
15
|
require("@emotion/serialize");
|
|
15
16
|
require("@emotion/utils");
|
|
16
17
|
require("slate");
|
|
17
|
-
require("./
|
|
18
|
+
require("./typography.cjs.js");
|
|
18
19
|
require("./combobox.cjs.js");
|
|
19
20
|
require("use-sync-external-store/shim");
|
|
20
21
|
require("./types.cjs.js");
|
|
@@ -25,7 +26,6 @@ require("scroll-into-view-if-needed");
|
|
|
25
26
|
require("react-dom");
|
|
26
27
|
require("html-react-parser");
|
|
27
28
|
require("next/head");
|
|
28
|
-
require("zod");
|
|
29
29
|
require("@emotion/server/create-instance");
|
|
30
30
|
require("next/document");
|
|
31
31
|
require("cors");
|
package/dist/next.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "react";
|
|
2
|
-
export {
|
|
2
|
+
export { a0 as Document, _ as Makeswift, a1 as MakeswiftApiHandler, Z as Page, $ as PreviewModeScript, B as forwardNextDynamicRef, Y as getServerSideProps, W as getStaticPaths, X as getStaticProps } from "./index.es.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "use-sync-external-store/shim/with-selector";
|
|
5
5
|
import "next/dynamic";
|
|
@@ -7,12 +7,13 @@ import "./react-page.es.js";
|
|
|
7
7
|
import "redux";
|
|
8
8
|
import "redux-thunk";
|
|
9
9
|
import "./actions.es.js";
|
|
10
|
+
import "zod";
|
|
10
11
|
import "./state/breakpoints.es.js";
|
|
11
12
|
import "@emotion/css";
|
|
12
13
|
import "@emotion/serialize";
|
|
13
14
|
import "@emotion/utils";
|
|
14
15
|
import "slate";
|
|
15
|
-
import "./
|
|
16
|
+
import "./typography.es.js";
|
|
16
17
|
import "./combobox.es.js";
|
|
17
18
|
import "use-sync-external-store/shim";
|
|
18
19
|
import "./types.es.js";
|
|
@@ -23,7 +24,6 @@ import "scroll-into-view-if-needed";
|
|
|
23
24
|
import "react-dom";
|
|
24
25
|
import "html-react-parser";
|
|
25
26
|
import "next/head";
|
|
26
|
-
import "zod";
|
|
27
27
|
import "@emotion/server/create-instance";
|
|
28
28
|
import "next/document";
|
|
29
29
|
import "cors";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-controllers.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prop-controllers.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-controllers.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prop-controllers.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
package/dist/react-page.cjs.js
CHANGED
|
@@ -35,28 +35,8 @@ var slate = require("slate");
|
|
|
35
35
|
function _interopDefaultLegacy(e) {
|
|
36
36
|
return e && typeof e === "object" && "default" in e ? e : { "default": e };
|
|
37
37
|
}
|
|
38
|
-
function _interopNamespace(e) {
|
|
39
|
-
if (e && e.__esModule)
|
|
40
|
-
return e;
|
|
41
|
-
var n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
42
|
-
if (e) {
|
|
43
|
-
Object.keys(e).forEach(function(k) {
|
|
44
|
-
if (k !== "default") {
|
|
45
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
46
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
47
|
-
enumerable: true,
|
|
48
|
-
get: function() {
|
|
49
|
-
return e[k];
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
n["default"] = e;
|
|
56
|
-
return Object.freeze(n);
|
|
57
|
-
}
|
|
58
38
|
var thunk__default = /* @__PURE__ */ _interopDefaultLegacy(thunk);
|
|
59
|
-
var
|
|
39
|
+
var React__default = /* @__PURE__ */ _interopDefaultLegacy(React);
|
|
60
40
|
const ComponentIcon = {
|
|
61
41
|
Billing: "billing",
|
|
62
42
|
Bolt: "bolt",
|
|
@@ -309,6 +289,13 @@ function reducer$1(state = getInitialState(), action) {
|
|
|
309
289
|
return state;
|
|
310
290
|
}
|
|
311
291
|
}
|
|
292
|
+
function parseLocalesInput(input) {
|
|
293
|
+
return {
|
|
294
|
+
locales: input.locales.map((locale) => actions.localeStringSchema.parse(locale)),
|
|
295
|
+
defaultLocale: actions.localeStringSchema.parse(input.defaultLocale),
|
|
296
|
+
locale: null
|
|
297
|
+
};
|
|
298
|
+
}
|
|
312
299
|
const ColorControlType = "makeswift::controls::color";
|
|
313
300
|
function Color(config = {}) {
|
|
314
301
|
return { type: ColorControlType, config };
|
|
@@ -612,6 +599,11 @@ function Link$1(options = {}) {
|
|
|
612
599
|
function List$1(options) {
|
|
613
600
|
return { type: Types.List, options };
|
|
614
601
|
}
|
|
602
|
+
function introspectListPropControllerData(descriptor, value, func) {
|
|
603
|
+
if (value == null)
|
|
604
|
+
return [];
|
|
605
|
+
return value.flatMap((item) => item.value ? func(descriptor.options.type, item.value) : []);
|
|
606
|
+
}
|
|
615
607
|
const MarginPropControllerFormat = {
|
|
616
608
|
ClassName: "makeswift::prop-controllers::margin::format::class-name",
|
|
617
609
|
ResponsiveValue: "makeswift::prop-controllers::margin::format::responsive-value"
|
|
@@ -666,6 +658,11 @@ Shadows.Format = ShadowsPropControllerFormat;
|
|
|
666
658
|
function Shape$1(options) {
|
|
667
659
|
return { type: Types.Shape, options };
|
|
668
660
|
}
|
|
661
|
+
function introspectShapePropControllerData(descriptor, value, func) {
|
|
662
|
+
if (value == null)
|
|
663
|
+
return [];
|
|
664
|
+
return Object.entries(descriptor.options.type).flatMap(([key, definition]) => func(definition, value[key]));
|
|
665
|
+
}
|
|
669
666
|
function SocialLinks(options = {}) {
|
|
670
667
|
return { type: Types.SocialLinks, options };
|
|
671
668
|
}
|
|
@@ -717,6 +714,7 @@ var descriptors = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePro
|
|
|
717
714
|
Images,
|
|
718
715
|
Link: Link$1,
|
|
719
716
|
List: List$1,
|
|
717
|
+
introspectListPropControllerData,
|
|
720
718
|
MarginPropControllerFormat,
|
|
721
719
|
Margin,
|
|
722
720
|
NavigationLinks,
|
|
@@ -733,6 +731,7 @@ var descriptors = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePro
|
|
|
733
731
|
ShadowsPropControllerFormat,
|
|
734
732
|
Shadows,
|
|
735
733
|
Shape: Shape$1,
|
|
734
|
+
introspectShapePropControllerData,
|
|
736
735
|
SocialLinks,
|
|
737
736
|
Table,
|
|
738
737
|
TableFormFields,
|
|
@@ -1010,6 +1009,11 @@ function copyListData(definition, value, context) {
|
|
|
1010
1009
|
value: copy(definition.config.type, item.value, context)
|
|
1011
1010
|
}));
|
|
1012
1011
|
}
|
|
1012
|
+
function introspectListData(definition, value, func) {
|
|
1013
|
+
if (value == null)
|
|
1014
|
+
return [];
|
|
1015
|
+
return value.flatMap((item) => func(definition.config.type, item.value));
|
|
1016
|
+
}
|
|
1013
1017
|
const ShapeControlType = "makeswift::controls::shape";
|
|
1014
1018
|
function Shape(config) {
|
|
1015
1019
|
return { type: ShapeControlType, config };
|
|
@@ -1063,6 +1067,11 @@ function copyShapeData(definition, value, context) {
|
|
|
1063
1067
|
}
|
|
1064
1068
|
return newValue;
|
|
1065
1069
|
}
|
|
1070
|
+
function introspectShapeData(definition, value, func) {
|
|
1071
|
+
if (value == null)
|
|
1072
|
+
return [];
|
|
1073
|
+
return Object.entries(definition.config.type).flatMap(([key, definition2]) => func(definition2, value[key]));
|
|
1074
|
+
}
|
|
1066
1075
|
const SlotControlType = "makeswift::controls::slot";
|
|
1067
1076
|
function Slot() {
|
|
1068
1077
|
return { type: SlotControlType };
|
|
@@ -1903,7 +1912,7 @@ function merge(definition, a, b = a, context) {
|
|
|
1903
1912
|
}
|
|
1904
1913
|
const isServer = typeof window === "undefined";
|
|
1905
1914
|
const useInsertionEffectSpecifier = "useInsertionEffect";
|
|
1906
|
-
const useInsertionEffect = (_a =
|
|
1915
|
+
const useInsertionEffect = (_a = React__default["default"][useInsertionEffectSpecifier]) != null ? _a : React__default["default"].useLayoutEffect;
|
|
1907
1916
|
function useStyle(style) {
|
|
1908
1917
|
const serialized = serialize.serializeStyles([style], css.cache.registered);
|
|
1909
1918
|
utils.registerStyles(css.cache, serialized, false);
|
|
@@ -2372,8 +2381,16 @@ function getElementChildren(descriptor, prop) {
|
|
|
2372
2381
|
case ListControlType:
|
|
2373
2382
|
return prop.flatMap(({ value }) => getElementChildren(descriptor.config.type, value));
|
|
2374
2383
|
case ShapeControlType: {
|
|
2375
|
-
|
|
2376
|
-
|
|
2384
|
+
return introspectShapeData(descriptor, prop, getElementChildren);
|
|
2385
|
+
}
|
|
2386
|
+
case ListControlType: {
|
|
2387
|
+
return introspectListData(descriptor, prop, getElementChildren);
|
|
2388
|
+
}
|
|
2389
|
+
case Types.Shape: {
|
|
2390
|
+
return introspectShapePropControllerData(descriptor, prop, getElementChildren);
|
|
2391
|
+
}
|
|
2392
|
+
case Types.List: {
|
|
2393
|
+
return introspectListPropControllerData(descriptor, prop, getElementChildren);
|
|
2377
2394
|
}
|
|
2378
2395
|
default:
|
|
2379
2396
|
return [];
|
|
@@ -2433,7 +2450,7 @@ function getTypographyStyleSwatchIds(style) {
|
|
|
2433
2450
|
return (_a3 = typographyStyle.color) == null ? void 0 : _a3.swatchId;
|
|
2434
2451
|
}).filter(isNonNullable)) != null ? _a2 : [];
|
|
2435
2452
|
}
|
|
2436
|
-
function
|
|
2453
|
+
function getSwatchIds(descriptor, prop) {
|
|
2437
2454
|
var _a2;
|
|
2438
2455
|
if (prop == null)
|
|
2439
2456
|
return [];
|
|
@@ -2488,7 +2505,7 @@ function getElementSwatchIds(descriptor, prop) {
|
|
|
2488
2505
|
}
|
|
2489
2506
|
case StyleV2ControlType: {
|
|
2490
2507
|
const value = prop;
|
|
2491
|
-
return value.flatMap((value2) =>
|
|
2508
|
+
return value.flatMap((value2) => getSwatchIds(descriptor.config.type, value2.value));
|
|
2492
2509
|
}
|
|
2493
2510
|
case RichTextV2ControlType: {
|
|
2494
2511
|
let getDescendantSwatchIds = function(descendant) {
|
|
@@ -2506,19 +2523,31 @@ function getElementSwatchIds(descriptor, prop) {
|
|
|
2506
2523
|
var _a3;
|
|
2507
2524
|
return (_a3 = plugins == null ? void 0 : plugins.flatMap((plugin) => {
|
|
2508
2525
|
var _a4;
|
|
2509
|
-
return ((_a4 = plugin.control) == null ? void 0 : _a4.definition) && plugin.control.getElementValue ?
|
|
2526
|
+
return ((_a4 = plugin.control) == null ? void 0 : _a4.definition) && plugin.control.getElementValue ? getSwatchIds(plugin.control.definition, plugin.control.getElementValue(descendant)) : [];
|
|
2510
2527
|
})) != null ? _a3 : [];
|
|
2511
2528
|
}, getTextSwatchIds = function(text) {
|
|
2512
2529
|
var _a3;
|
|
2513
2530
|
return (_a3 = plugins == null ? void 0 : plugins.flatMap((plugin) => {
|
|
2514
2531
|
var _a4;
|
|
2515
|
-
return ((_a4 = plugin.control) == null ? void 0 : _a4.definition) && plugin.control.getLeafValue ?
|
|
2532
|
+
return ((_a4 = plugin.control) == null ? void 0 : _a4.definition) && plugin.control.getLeafValue ? getSwatchIds(plugin.control.definition, plugin.control.getLeafValue(text)) : [];
|
|
2516
2533
|
})) != null ? _a3 : [];
|
|
2517
2534
|
};
|
|
2518
2535
|
const descendants = prop;
|
|
2519
2536
|
const plugins = descriptor.config.plugins;
|
|
2520
2537
|
return descendants.flatMap((d) => getDescendantSwatchIds(d));
|
|
2521
2538
|
}
|
|
2539
|
+
case ShapeControlType: {
|
|
2540
|
+
return introspectShapeData(descriptor, prop, getSwatchIds);
|
|
2541
|
+
}
|
|
2542
|
+
case ListControlType: {
|
|
2543
|
+
return introspectListData(descriptor, prop, getSwatchIds);
|
|
2544
|
+
}
|
|
2545
|
+
case Types.Shape: {
|
|
2546
|
+
return introspectShapePropControllerData(descriptor, prop, getSwatchIds);
|
|
2547
|
+
}
|
|
2548
|
+
case Types.List: {
|
|
2549
|
+
return introspectListPropControllerData(descriptor, prop, getSwatchIds);
|
|
2550
|
+
}
|
|
2522
2551
|
default:
|
|
2523
2552
|
return [];
|
|
2524
2553
|
}
|
|
@@ -2553,6 +2582,18 @@ function getFileIds(descriptor, prop) {
|
|
|
2553
2582
|
const value = prop;
|
|
2554
2583
|
return value == null ? [] : [value];
|
|
2555
2584
|
}
|
|
2585
|
+
case ShapeControlType: {
|
|
2586
|
+
return introspectShapeData(descriptor, prop, getFileIds);
|
|
2587
|
+
}
|
|
2588
|
+
case ListControlType: {
|
|
2589
|
+
return introspectListData(descriptor, prop, getFileIds);
|
|
2590
|
+
}
|
|
2591
|
+
case Types.Shape: {
|
|
2592
|
+
return introspectShapePropControllerData(descriptor, prop, getFileIds);
|
|
2593
|
+
}
|
|
2594
|
+
case Types.List: {
|
|
2595
|
+
return introspectListPropControllerData(descriptor, prop, getFileIds);
|
|
2596
|
+
}
|
|
2556
2597
|
default:
|
|
2557
2598
|
return [];
|
|
2558
2599
|
}
|
|
@@ -2583,6 +2624,18 @@ function getTypographyIds(descriptor, prop) {
|
|
|
2583
2624
|
return [];
|
|
2584
2625
|
return getNodeTypographyIds(value.document);
|
|
2585
2626
|
}
|
|
2627
|
+
case ShapeControlType: {
|
|
2628
|
+
return introspectShapeData(descriptor, prop, getTypographyIds);
|
|
2629
|
+
}
|
|
2630
|
+
case ListControlType: {
|
|
2631
|
+
return introspectListData(descriptor, prop, getTypographyIds);
|
|
2632
|
+
}
|
|
2633
|
+
case Types.Shape: {
|
|
2634
|
+
return introspectShapePropControllerData(descriptor, prop, getTypographyIds);
|
|
2635
|
+
}
|
|
2636
|
+
case Types.List: {
|
|
2637
|
+
return introspectListPropControllerData(descriptor, prop, getTypographyIds);
|
|
2638
|
+
}
|
|
2586
2639
|
default:
|
|
2587
2640
|
return [];
|
|
2588
2641
|
}
|
|
@@ -2615,6 +2668,17 @@ function getPageIds(descriptor, prop) {
|
|
|
2615
2668
|
return [];
|
|
2616
2669
|
}
|
|
2617
2670
|
}
|
|
2671
|
+
case LinkControlType: {
|
|
2672
|
+
const value = prop;
|
|
2673
|
+
if (value == null)
|
|
2674
|
+
return [];
|
|
2675
|
+
switch (value.type) {
|
|
2676
|
+
case "OPEN_PAGE":
|
|
2677
|
+
return value.payload.pageId == null ? [] : [value.payload.pageId];
|
|
2678
|
+
default:
|
|
2679
|
+
return [];
|
|
2680
|
+
}
|
|
2681
|
+
}
|
|
2618
2682
|
case Types.NavigationLinks: {
|
|
2619
2683
|
const value = prop;
|
|
2620
2684
|
if (value == null)
|
|
@@ -2683,6 +2747,18 @@ function getPageIds(descriptor, prop) {
|
|
|
2683
2747
|
return [];
|
|
2684
2748
|
return getNodePageIds(value.document);
|
|
2685
2749
|
}
|
|
2750
|
+
case ShapeControlType: {
|
|
2751
|
+
return introspectShapeData(descriptor, prop, getPageIds);
|
|
2752
|
+
}
|
|
2753
|
+
case ListControlType: {
|
|
2754
|
+
return introspectListData(descriptor, prop, getPageIds);
|
|
2755
|
+
}
|
|
2756
|
+
case Types.Shape: {
|
|
2757
|
+
return introspectShapePropControllerData(descriptor, prop, getPageIds);
|
|
2758
|
+
}
|
|
2759
|
+
case Types.List: {
|
|
2760
|
+
return introspectListPropControllerData(descriptor, prop, getPageIds);
|
|
2761
|
+
}
|
|
2686
2762
|
default:
|
|
2687
2763
|
return [];
|
|
2688
2764
|
}
|
|
@@ -2696,7 +2772,7 @@ var introspection = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
2696
2772
|
getBoxShadowsSwatchIds,
|
|
2697
2773
|
getResponsiveColorSwatchIds,
|
|
2698
2774
|
getTypographyStyleSwatchIds,
|
|
2699
|
-
|
|
2775
|
+
getSwatchIds,
|
|
2700
2776
|
getBackgroundsFileIds,
|
|
2701
2777
|
getFileIds,
|
|
2702
2778
|
getTypographyIds,
|
|
@@ -2857,7 +2933,10 @@ function getBreakpoints(state) {
|
|
|
2857
2933
|
return state.breakpoints;
|
|
2858
2934
|
}
|
|
2859
2935
|
function getLocales(state) {
|
|
2860
|
-
return state.locales;
|
|
2936
|
+
return state.locales.locales.map((locale) => new Intl.Locale(locale));
|
|
2937
|
+
}
|
|
2938
|
+
function getDefaultLocale(state) {
|
|
2939
|
+
return state.locales.defaultLocale ? new Intl.Locale(state.locales.defaultLocale) : null;
|
|
2861
2940
|
}
|
|
2862
2941
|
function configureStore({
|
|
2863
2942
|
rootElements,
|
|
@@ -2979,6 +3058,7 @@ exports.getBuilderEditMode = getBuilderEditMode;
|
|
|
2979
3058
|
exports.getComponentPropControllerDescriptors = getComponentPropControllerDescriptors;
|
|
2980
3059
|
exports.getComponentPropControllerDescriptors$1 = getComponentPropControllerDescriptors$1;
|
|
2981
3060
|
exports.getComponentsMeta = getComponentsMeta;
|
|
3061
|
+
exports.getDefaultLocale = getDefaultLocale;
|
|
2982
3062
|
exports.getDocument = getDocument;
|
|
2983
3063
|
exports.getDocument$1 = getDocument$1;
|
|
2984
3064
|
exports.getDocumentKeysSortedByDepth = getDocumentKeysSortedByDepth;
|
|
@@ -2986,7 +3066,6 @@ exports.getElement = getElement;
|
|
|
2986
3066
|
exports.getElementChildren = getElementChildren;
|
|
2987
3067
|
exports.getElementId = getElementId;
|
|
2988
3068
|
exports.getElementPropControllerDescriptors = getElementPropControllerDescriptors;
|
|
2989
|
-
exports.getElementSwatchIds = getElementSwatchIds;
|
|
2990
3069
|
exports.getFileIds = getFileIds;
|
|
2991
3070
|
exports.getInitialState = getInitialState$7;
|
|
2992
3071
|
exports.getInitialState$1 = getInitialState$2;
|
|
@@ -3000,14 +3079,18 @@ exports.getPropControllers = getPropControllers;
|
|
|
3000
3079
|
exports.getPropControllersHandle = getPropControllersHandle;
|
|
3001
3080
|
exports.getReactComponent = getReactComponent;
|
|
3002
3081
|
exports.getResponsiveColorSwatchIds = getResponsiveColorSwatchIds;
|
|
3082
|
+
exports.getSwatchIds = getSwatchIds;
|
|
3003
3083
|
exports.getTableIds = getTableIds;
|
|
3004
3084
|
exports.getTypographyIds = getTypographyIds;
|
|
3085
|
+
exports.introspectListData = introspectListData;
|
|
3086
|
+
exports.introspectShapeData = introspectShapeData;
|
|
3005
3087
|
exports.introspection = introspection;
|
|
3006
3088
|
exports.isElementReference = isElementReference;
|
|
3007
3089
|
exports.isNonNullable = isNonNullable;
|
|
3008
3090
|
exports.isPropControllersHandle = isPropControllersHandle;
|
|
3009
3091
|
exports.merge = merge;
|
|
3010
3092
|
exports.mergeSlotData = mergeSlotData;
|
|
3093
|
+
exports.parseLocalesInput = parseLocalesInput;
|
|
3011
3094
|
exports.reducer = reducer$8;
|
|
3012
3095
|
exports.reducer$1 = reducer$7;
|
|
3013
3096
|
exports.reducer$2 = reducer$9;
|