@makeswift/runtime 0.8.11 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/dist/Box.cjs.js +1 -1
  2. package/dist/Box.es.js +1 -1
  3. package/dist/Button.cjs.js +1 -1
  4. package/dist/Button.es.js +1 -1
  5. package/dist/Carousel.cjs.js +2 -2
  6. package/dist/Carousel.es.js +2 -2
  7. package/dist/Countdown.cjs.js +1 -1
  8. package/dist/Countdown.es.js +1 -1
  9. package/dist/Divider.cjs.js +1 -1
  10. package/dist/Divider.es.js +1 -1
  11. package/dist/Embed.cjs.js +1 -1
  12. package/dist/Embed.es.js +1 -1
  13. package/dist/Form.cjs.js +1 -1
  14. package/dist/Form.es.js +1 -1
  15. package/dist/Image.cjs.js +1 -1
  16. package/dist/Image.es.js +1 -1
  17. package/dist/LiveProvider.cjs.js +2 -2
  18. package/dist/LiveProvider.es.js +3 -3
  19. package/dist/Navigation.cjs.js +2 -2
  20. package/dist/Navigation.es.js +2 -2
  21. package/dist/PreviewProvider.cjs.js +17 -2
  22. package/dist/PreviewProvider.cjs.js.map +1 -1
  23. package/dist/PreviewProvider.es.js +19 -4
  24. package/dist/PreviewProvider.es.js.map +1 -1
  25. package/dist/ReadOnlyText.cjs.js +10 -9
  26. package/dist/ReadOnlyText.cjs.js.map +1 -1
  27. package/dist/ReadOnlyText.es.js +10 -9
  28. package/dist/ReadOnlyText.es.js.map +1 -1
  29. package/dist/ReadOnlyTextV2.cjs.js +10 -9
  30. package/dist/ReadOnlyTextV2.cjs.js.map +1 -1
  31. package/dist/ReadOnlyTextV2.es.js +10 -9
  32. package/dist/ReadOnlyTextV2.es.js.map +1 -1
  33. package/dist/Root.cjs.js +1 -1
  34. package/dist/Root.es.js +1 -1
  35. package/dist/SocialLinks.cjs.js +1 -1
  36. package/dist/SocialLinks.es.js +1 -1
  37. package/dist/Text.cjs.js +1 -1
  38. package/dist/Text.es.js +1 -1
  39. package/dist/Video.cjs.js +1 -1
  40. package/dist/Video.es.js +1 -1
  41. package/dist/actions.cjs.js +16 -1
  42. package/dist/actions.cjs.js.map +1 -1
  43. package/dist/actions.es.js +14 -2
  44. package/dist/actions.es.js.map +1 -1
  45. package/dist/components.cjs.js +1 -1
  46. package/dist/components.es.js +1 -1
  47. package/dist/control-serialization.cjs.js +1 -1
  48. package/dist/control-serialization.es.js +2 -2
  49. package/dist/controls.cjs.js +2 -3
  50. package/dist/controls.cjs.js.map +1 -1
  51. package/dist/controls.es.js +1 -2
  52. package/dist/controls.es.js.map +1 -1
  53. package/dist/index.cjs.js +253 -218
  54. package/dist/index.cjs.js.map +1 -1
  55. package/dist/index.cjs10.js +11 -10
  56. package/dist/index.cjs10.js.map +1 -1
  57. package/dist/index.cjs2.js +1 -1
  58. package/dist/index.cjs5.js +0 -522
  59. package/dist/index.cjs5.js.map +1 -1
  60. package/dist/index.cjs6.js +1 -2
  61. package/dist/index.cjs6.js.map +1 -1
  62. package/dist/index.cjs7.js +0 -52
  63. package/dist/index.cjs7.js.map +1 -1
  64. package/dist/index.cjs8.js +1 -1
  65. package/dist/index.cjs9.js +42 -3
  66. package/dist/index.cjs9.js.map +1 -1
  67. package/dist/index.es.js +253 -218
  68. package/dist/index.es.js.map +1 -1
  69. package/dist/index.es10.js +12 -11
  70. package/dist/index.es10.js.map +1 -1
  71. package/dist/index.es2.js +2 -2
  72. package/dist/index.es5.js +2 -514
  73. package/dist/index.es5.js.map +1 -1
  74. package/dist/index.es6.js +1 -2
  75. package/dist/index.es6.js.map +1 -1
  76. package/dist/index.es7.js +2 -53
  77. package/dist/index.es7.js.map +1 -1
  78. package/dist/index.es8.js +1 -1
  79. package/dist/index.es9.js +43 -4
  80. package/dist/index.es9.js.map +1 -1
  81. package/dist/leaf.es.js +1 -1
  82. package/dist/main.cjs.js +3 -0
  83. package/dist/main.cjs.js.map +1 -1
  84. package/dist/main.es.js +2 -2
  85. package/dist/next.cjs.js +1 -1
  86. package/dist/next.es.js +1 -1
  87. package/dist/react-page.cjs.js +711 -61
  88. package/dist/react-page.cjs.js.map +1 -1
  89. package/dist/react-page.es.js +694 -56
  90. package/dist/react-page.es.js.map +1 -1
  91. package/dist/react.cjs.js +1 -1
  92. package/dist/react.es.js +1 -1
  93. package/dist/slate.cjs.js +11 -13
  94. package/dist/slate.cjs.js.map +1 -1
  95. package/dist/slate.es.js +4 -5
  96. package/dist/slate.es.js.map +1 -1
  97. package/dist/types/src/api/graphql/documents/queries.d.ts.map +1 -1
  98. package/dist/types/src/api/graphql/generated/types.d.ts +0 -8
  99. package/dist/types/src/api/graphql/generated/types.d.ts.map +1 -1
  100. package/dist/types/src/components/builtin/Button/Button.d.ts +1 -1
  101. package/dist/types/src/components/builtin/Carousel/register.d.ts.map +1 -1
  102. package/dist/types/src/components/builtin/Countdown/register.d.ts.map +1 -1
  103. package/dist/types/src/components/builtin/Divider/register.d.ts.map +1 -1
  104. package/dist/types/src/components/builtin/Embed/register.d.ts.map +1 -1
  105. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +1 -1
  106. package/dist/types/src/components/builtin/Form/register.d.ts.map +1 -1
  107. package/dist/types/src/components/builtin/Navigation/register.d.ts.map +1 -1
  108. package/dist/types/src/components/builtin/SocialLinks/register.d.ts.map +1 -1
  109. package/dist/types/src/components/builtin/Text/EditableText/editable-text.d.ts.map +1 -1
  110. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +1 -1
  111. package/dist/types/src/components/builtin/Text/components/Element/block.d.ts.map +1 -1
  112. package/dist/types/src/components/builtin/Video/register.d.ts.map +1 -1
  113. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts +3 -3
  114. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
  115. package/dist/types/src/index.d.ts +2 -1
  116. package/dist/types/src/index.d.ts.map +1 -1
  117. package/dist/types/src/next/api-handler/handlers/manifest.d.ts +3 -1
  118. package/dist/types/src/next/api-handler/handlers/manifest.d.ts.map +1 -1
  119. package/dist/types/src/next/api-handler/handlers/proxy-preview-mode.d.ts.map +1 -1
  120. package/dist/types/src/next/api-handler/index.d.ts +2 -1
  121. package/dist/types/src/next/api-handler/index.d.ts.map +1 -1
  122. package/dist/types/src/next/client.d.ts +7 -7
  123. package/dist/types/src/next/client.d.ts.map +1 -1
  124. package/dist/types/src/next/index.d.ts +8 -5
  125. package/dist/types/src/next/index.d.ts.map +1 -1
  126. package/dist/types/src/next/preview-mode.d.ts +17 -3
  127. package/dist/types/src/next/preview-mode.d.ts.map +1 -1
  128. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts.map +1 -1
  129. package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts.map +1 -1
  130. package/dist/types/src/runtimes/react/index.d.ts +3 -1
  131. package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
  132. package/dist/types/src/slate/BlockPlugin/constants.d.ts.map +1 -0
  133. package/dist/types/src/slate/BlockPlugin/dedent.d.ts.map +1 -0
  134. package/dist/types/src/slate/BlockPlugin/indent.d.ts.map +1 -0
  135. package/dist/types/src/slate/BlockPlugin/index.d.ts +26 -3
  136. package/dist/types/src/slate/BlockPlugin/index.d.ts.map +1 -1
  137. package/dist/types/src/slate/BlockPlugin/toggleList.d.ts.map +1 -0
  138. package/dist/types/src/slate/BlockPlugin/unwrapList.d.ts.map +1 -0
  139. package/dist/types/src/slate/BlockPlugin/utils/filterForSubtreeRoots.d.ts.map +1 -0
  140. package/dist/types/src/slate/BlockPlugin/utils/getSelectedListItems.d.ts.map +1 -0
  141. package/dist/types/src/slate/BlockPlugin/utils/location.d.ts.map +1 -0
  142. package/dist/types/src/slate/BlockPlugin/wrapList.d.ts.map +1 -0
  143. package/dist/types/src/slate/InlineModePlugin/index.d.ts +1 -1
  144. package/dist/types/src/slate/index.d.ts +0 -1
  145. package/dist/types/src/slate/index.d.ts.map +1 -1
  146. package/dist/types/src/slate/utils/element.d.ts +1 -2
  147. package/dist/types/src/slate/utils/element.d.ts.map +1 -1
  148. package/dist/types/src/state/actions.d.ts +26 -1
  149. package/dist/types/src/state/actions.d.ts.map +1 -1
  150. package/dist/types/src/state/modules/components-meta.d.ts +25 -1
  151. package/dist/types/src/state/modules/components-meta.d.ts.map +1 -1
  152. package/dist/types/src/state/modules/locales.d.ts +16 -0
  153. package/dist/types/src/state/modules/locales.d.ts.map +1 -0
  154. package/dist/types/src/state/react-builder-preview.d.ts +2 -0
  155. package/dist/types/src/state/react-builder-preview.d.ts.map +1 -1
  156. package/dist/types/src/state/react-page.d.ts +5 -1
  157. package/dist/types/src/state/react-page.d.ts.map +1 -1
  158. package/package.json +6 -3
  159. package/dist/select.cjs.js +0 -8
  160. package/dist/select.cjs.js.map +0 -1
  161. package/dist/select.es.js +0 -6
  162. package/dist/select.es.js.map +0 -1
  163. package/dist/types/src/slate/ListPlugin/constants.d.ts.map +0 -1
  164. package/dist/types/src/slate/ListPlugin/dedent.d.ts.map +0 -1
  165. package/dist/types/src/slate/ListPlugin/indent.d.ts.map +0 -1
  166. package/dist/types/src/slate/ListPlugin/index.d.ts +0 -17
  167. package/dist/types/src/slate/ListPlugin/index.d.ts.map +0 -1
  168. package/dist/types/src/slate/ListPlugin/toggleList.d.ts.map +0 -1
  169. package/dist/types/src/slate/ListPlugin/unwrapList.d.ts.map +0 -1
  170. package/dist/types/src/slate/ListPlugin/utils/filterForSubtreeRoots.d.ts.map +0 -1
  171. package/dist/types/src/slate/ListPlugin/utils/getSelectedListItems.d.ts.map +0 -1
  172. package/dist/types/src/slate/ListPlugin/utils/location.d.ts.map +0 -1
  173. package/dist/types/src/slate/ListPlugin/wrapList.d.ts.map +0 -1
  174. /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/constants.d.ts +0 -0
  175. /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/dedent.d.ts +0 -0
  176. /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/indent.d.ts +0 -0
  177. /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/toggleList.d.ts +0 -0
  178. /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/unwrapList.d.ts +0 -0
  179. /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/utils/filterForSubtreeRoots.d.ts +0 -0
  180. /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/utils/getSelectedListItems.d.ts +0 -0
  181. /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/utils/location.d.ts +0 -0
  182. /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/wrapList.d.ts +0 -0
@@ -34,14 +34,14 @@ import { Range, createEditor } from "slate";
34
34
  import { ReactEditor, withReact, Slate, Editable } from "slate-react";
35
35
  import { cx } from "@emotion/css";
36
36
  import { g as getBox } from "./box-models.es.js";
37
- import { b4 as BlockType, b5 as InlineType, aX as richTextDTOtoDAO, aW as richTextDTOtoSelection, bc as BuilderEditMode } from "./react-page.es.js";
37
+ import { bc as BlockType, bd as InlineType, a_ as richTextDTOtoDAO, aZ as richTextDTOtoSelection, b9 as withBlock, b8 as onKeyDown, bm as BuilderEditMode } from "./react-page.es.js";
38
38
  import { L as Leaf } from "./leaf.es.js";
39
39
  import { n as useStyle, o as useResponsiveStyle, u as useIsInBuilder, L as deepEqual, Q as useBuilderEditMode, T as pollBoxModel } from "./index.es.js";
40
- import isHotkey from "is-hotkey";
41
40
  import "./state/breakpoints.es.js";
41
+ import isHotkey from "is-hotkey";
42
42
  import { jsx } from "react/jsx-runtime";
43
43
  import { L as Link } from "./index.es3.js";
44
- import { b as withBlock, a as withTypography, w as withList, o as onKeyDown } from "./index.es5.js";
44
+ import { w as withTypography } from "./index.es5.js";
45
45
  import { w as withBuilder } from "./index.es7.js";
46
46
  import { u as useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect.es.js";
47
47
  import "css-box-model";
@@ -54,7 +54,6 @@ import "@emotion/serialize";
54
54
  import "@emotion/utils";
55
55
  import "./text-input.es.js";
56
56
  import "./combobox.es.js";
57
- import "./select.es.js";
58
57
  import "use-sync-external-store/shim";
59
58
  import "./types.es.js";
60
59
  import "color";
@@ -62,6 +61,7 @@ import "scroll-into-view-if-needed";
62
61
  import "react-dom";
63
62
  import "html-react-parser";
64
63
  import "next/head";
64
+ import "zod";
65
65
  import "@emotion/server/create-instance";
66
66
  import "next/document";
67
67
  import "cors";
@@ -83,6 +83,12 @@ function BlockElement({
83
83
  }), useStyle(useResponsiveStyle([element.textAlign], ([textAlign = "left"]) => ({
84
84
  textAlign
85
85
  })))];
86
+ const quoteStyles = useStyle({
87
+ padding: "0.5em 10px",
88
+ fontSize: "1.25em",
89
+ fontWeight: "300",
90
+ borderLeft: "5px solid rgba(0, 0, 0, 0.1)"
91
+ });
86
92
  switch (element.type) {
87
93
  case BlockType.Text:
88
94
  return /* @__PURE__ */ jsx("span", __spreadProps(__spreadValues({}, attributes), {
@@ -126,12 +132,7 @@ function BlockElement({
126
132
  }));
127
133
  case BlockType.BlockQuote:
128
134
  return /* @__PURE__ */ jsx("blockquote", __spreadProps(__spreadValues({}, attributes), {
129
- className: cx(...blockStyles, useStyle({
130
- padding: "0.5em 10px",
131
- fontSize: "1.25em",
132
- fontWeight: "300",
133
- borderLeft: "5px solid rgba(0, 0, 0, 0.1)"
134
- })),
135
+ className: cx(...blockStyles, quoteStyles),
135
136
  children
136
137
  }));
137
138
  case BlockType.OrderedList:
@@ -294,7 +295,7 @@ const EditableText = forwardRef(function EditableText2({
294
295
  width,
295
296
  margin
296
297
  }, ref) {
297
- const [editor] = useState(() => withBlock(withTypography(withList(withBuilder(withReact(createEditor()))))));
298
+ const [editor] = useState(() => withBlock(withTypography(withBuilder(withReact(createEditor())))));
298
299
  const [isPreservingDOMSElection, setIsPreservingDOMSelection] = useState(false);
299
300
  useSyncDOMSelection(editor, isPreservingDOMSElection);
300
301
  const delaySync = useSyncWithBuilder(editor, text);
@@ -1 +1 @@
1
- {"version":3,"file":"index.es10.js","sources":["../src/components/builtin/Text/components/Element/block.tsx","../src/components/builtin/Text/components/Element/inline.tsx","../src/components/builtin/Text/components/Element/element.tsx","../src/components/builtin/Text/EditableText/useSyncWithBuilder.tsx","../src/components/builtin/Text/EditableText/useSyncDOMSelection.tsx","../src/components/builtin/Text/EditableText/editable-text.tsx"],"sourcesContent":["import { cx } from '@emotion/css'\nimport { RenderElementProps } from 'slate-react'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\nimport { useResponsiveStyle } from '../../../../utils/responsive-style'\nimport { Block, BlockType } from '../../../../../slate'\n\nexport interface InlineRenderElementProps extends RenderElementProps {\n element: Block\n}\n\nexport function BlockElement({ element, attributes, children }: InlineRenderElementProps) {\n const blockStyles = [\n useStyle({ margin: 0 }),\n useStyle(useResponsiveStyle([element.textAlign], ([textAlign = 'left']) => ({ textAlign }))),\n ]\n\n switch (element.type) {\n case BlockType.Text:\n return (\n <span {...attributes} className={cx(...blockStyles)}>\n {children}\n </span>\n )\n case BlockType.Paragraph:\n return (\n <p {...attributes} className={cx(...blockStyles)}>\n {children}\n </p>\n )\n case BlockType.Heading1:\n return (\n <h1 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h1>\n )\n case BlockType.Heading2:\n return (\n <h2 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h2>\n )\n case BlockType.Heading3:\n return (\n <h3 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h3>\n )\n case BlockType.Heading4:\n return (\n <h4 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h4>\n )\n case BlockType.Heading5:\n return (\n <h5 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h5>\n )\n case BlockType.Heading6:\n return (\n <h6 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h6>\n )\n case BlockType.BlockQuote:\n return (\n <blockquote\n {...attributes}\n className={cx(\n ...blockStyles,\n useStyle({\n padding: '0.5em 10px',\n fontSize: '1.25em',\n fontWeight: '300',\n borderLeft: '5px solid rgba(0, 0, 0, 0.1)',\n }),\n )}\n >\n {children}\n </blockquote>\n )\n case BlockType.OrderedList:\n return (\n <ol {...attributes} className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n {children}\n </ol>\n )\n case BlockType.UnorderedList:\n return (\n <ul {...attributes} className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n {children}\n </ul>\n )\n case BlockType.ListItem:\n return (\n <li {...attributes} className={cx(...blockStyles)}>\n {children}\n </li>\n )\n case BlockType.ListItemChild:\n return (\n <span {...attributes} className={cx(...blockStyles)}>\n {children}\n </span>\n )\n\n default:\n return null\n }\n}\n","import { cx } from '@emotion/css'\nimport { ComponentPropsWithoutRef } from 'react'\nimport { RenderElementProps } from 'slate-react'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\nimport { Link } from '../../../../shared/Link'\nimport { Inline, InlineType } from '../../../../../slate'\n\nfunction StyledLink({ className, ...restOfProps }: ComponentPropsWithoutRef<typeof Link>) {\n return <Link {...restOfProps} className={cx(useStyle({ textDecoration: 'none' }), className)} />\n}\n\nexport interface InlineRenderElementProps extends RenderElementProps {\n element: Inline\n}\n\nexport function InlineElement({ element, attributes, children }: InlineRenderElementProps) {\n switch (element.type) {\n case InlineType.Code:\n return <code {...attributes}>{children}</code>\n case InlineType.SuperScript:\n return <sup {...attributes}>{children}</sup>\n case InlineType.SubScript:\n return <sub {...attributes}>{children}</sub>\n case InlineType.Link:\n return (\n <StyledLink {...attributes} link={element.link}>\n {children}\n </StyledLink>\n )\n }\n}\n","import { RenderElementProps } from 'slate-react'\nimport { BlockElement } from './block'\nimport { InlineElement } from './inline'\nimport { InlineType, BlockType } from '../../../../../slate'\n\nexport function Element({ element, ...props }: RenderElementProps) {\n switch (element.type) {\n case InlineType.Code:\n case InlineType.SuperScript:\n case InlineType.SubScript:\n case InlineType.Link:\n return <InlineElement element={element} {...props} />\n case BlockType.Paragraph:\n case BlockType.Heading1:\n case BlockType.Heading2:\n case BlockType.Heading3:\n case BlockType.BlockQuote:\n case BlockType.OrderedList:\n case BlockType.UnorderedList:\n case BlockType.ListItem:\n case BlockType.ListItemChild:\n return <BlockElement element={element} {...props} />\n default:\n return <span {...props.attributes}>{props.children}</span>\n }\n}\n","import { useState, useEffect, useCallback } from 'react'\nimport { Editor } from 'slate'\nimport { richTextDTOtoDAO, richTextDTOtoSelection } from '../../../../controls'\nimport { RichTextValue } from '../../../../prop-controllers'\nimport deepEqual from '../../../../utils/deepEqual'\nimport { useIsInBuilder } from '../../../../runtimes/react'\n\nconst COMMIT_DEBOUNCE_DELAY = 500\n\n/**\n * Compare new prop value with current editor and update editor\n * if the values are not equal.\n */\nexport function useSyncWithBuilder(editor: Editor, text?: RichTextValue) {\n const [shouldCommit, setShouldCommit] = useState(true)\n const isInBuilder = useIsInBuilder()\n\n useEffect(() => {\n if (shouldCommit && text && isInBuilder) {\n const nextValue = richTextDTOtoDAO(text)\n const nextSelection = richTextDTOtoSelection(text)\n if (!deepEqual(editor.children, nextValue) || !deepEqual(editor.selection, nextSelection)) {\n editor.children = nextValue\n editor.selection = nextSelection\n editor.onChange()\n }\n }\n }, [editor, shouldCommit, text])\n\n useEffect(() => {\n if (shouldCommit) return\n\n const timeoutId = window.setTimeout(() => {\n setShouldCommit(true)\n }, COMMIT_DEBOUNCE_DELAY)\n\n return () => {\n window.clearTimeout(timeoutId)\n }\n }, [shouldCommit])\n\n return useCallback(() => setShouldCommit(false), [])\n}\n","import { ReactEditor } from 'slate-react'\nimport { useIsomorphicLayoutEffect } from '../../../hooks/useIsomorphicLayoutEffect'\nimport { Editor, Range as SlateRange } from 'slate'\n\n/**\n * Clicking outside of the host blurs our `<Editable />`.\n * `<Editable />` only updates the DOM's selection to match slate when it is focused.\n * In the case of a panel being clicked this hook updates the DOM selection to match slate.\n */\nexport function useSyncDOMSelection(editor: Editor, isEnabled: boolean) {\n useIsomorphicLayoutEffect(() => {\n if (!isEnabled || editor.selection == null || ReactEditor.isFocused(editor)) return\n try {\n const root = ReactEditor.findDocumentOrShadowRoot(editor) as Document\n const domSelection = root.getSelection()\n const newDomRange: Range | null = ReactEditor.toDOMRange(editor, editor.selection)\n\n if (newDomRange) {\n if (SlateRange.isBackward(editor.selection!)) {\n domSelection?.setBaseAndExtent(\n newDomRange.endContainer,\n newDomRange.endOffset,\n newDomRange.startContainer,\n newDomRange.startOffset,\n )\n } else {\n domSelection?.setBaseAndExtent(\n newDomRange.startContainer,\n newDomRange.startOffset,\n newDomRange.endContainer,\n newDomRange.endOffset,\n )\n }\n } else {\n domSelection?.removeAllRanges()\n }\n } catch (e) {\n console.error(e)\n }\n })\n}\n","import {\n FocusEvent,\n forwardRef,\n KeyboardEvent,\n Ref,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useState,\n} from 'react'\n\nimport { createEditor } from 'slate'\nimport { Slate, Editable, withReact, ReactEditor } from 'slate-react'\n\nimport { ElementIDValue, RichTextValue } from '../../../../prop-controllers/descriptors'\nimport { cx } from '@emotion/css'\nimport { DescriptorsPropControllers } from '../../../../prop-controllers/instances'\nimport { Descriptors } from '../../../../runtimes/react/controls/rich-text'\nimport { getBox } from '../../../../box-model'\nimport { PropControllersHandle } from '../../../../state/modules/prop-controller-handles'\nimport { richTextDTOtoDAO } from '../../../../controls'\nimport { Leaf } from '../components/Leaf'\nimport { Element } from '../components/Element'\nimport { useSyncWithBuilder } from './useSyncWithBuilder'\nimport isHotkey from 'is-hotkey'\nimport { useBuilderEditMode } from '../../../../runtimes/react'\nimport { BuilderEditMode } from '../../../../state/modules/builder-edit-mode'\nimport { onKeyDown, withBlock, withList, withTypography, withBuilder } from '../../../../slate'\nimport { pollBoxModel } from '../../../../runtimes/react/poll-box-model'\nimport { useSyncDOMSelection } from './useSyncDOMSelection'\nimport { RichTextDAO, BlockType } from '../../../../slate'\n\ntype Props = {\n id?: ElementIDValue\n text?: RichTextValue\n width?: string\n margin?: string\n}\n\nconst defaultText: RichTextDAO = [{ type: BlockType.Paragraph, children: [{ text: '' }] }]\n\nexport const EditableText = forwardRef(function EditableText(\n { id, text, width, margin }: Props,\n ref: Ref<PropControllersHandle<Descriptors>>,\n) {\n const [editor] = useState(() =>\n withBlock(withTypography(withList(withBuilder(withReact(createEditor()))))),\n )\n const [isPreservingDOMSElection, setIsPreservingDOMSelection] = useState(false)\n useSyncDOMSelection(editor, isPreservingDOMSElection)\n const delaySync = useSyncWithBuilder(editor, text)\n const editMode = useBuilderEditMode()\n\n const [propControllers, setPropControllers] =\n useState<DescriptorsPropControllers<Descriptors> | null>(null)\n const controller = propControllers?.text\n\n useEffect(() => {\n if (controller == null) return\n\n const element = ReactEditor.toDOMNode(editor, editor)\n\n return pollBoxModel({\n element,\n onBoxModelChange: boxModel => controller.changeBoxModel(boxModel),\n })\n }, [editor, controller])\n\n useImperativeHandle(\n ref,\n () => ({\n getDomNode() {\n return ReactEditor.toDOMNode(editor, editor)\n },\n getBoxModel() {\n return getBox(ReactEditor.toDOMNode(editor, editor))\n },\n setPropControllers,\n }),\n [editor, setPropControllers],\n )\n\n const initialValue = useMemo(() => (text ? richTextDTOtoDAO(text) : defaultText), [text])\n\n useEffect(() => {\n controller?.setSlateEditor(editor)\n }, [controller, editor])\n\n const handleFocus = useCallback(() => {\n controller?.focus()\n setIsPreservingDOMSelection(true)\n }, [controller])\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (isHotkey('mod+shift+z', e)) return controller?.redo()\n if (isHotkey('mod+z', e)) return controller?.undo()\n if (isHotkey('escape')(e)) return controller?.blur()\n onKeyDown(e, editor)\n },\n [controller, editor],\n )\n\n const handleBlur = useCallback((e: FocusEvent) => {\n // When clicking outside of the iframe (`relatedTarget` is null) we want to preserve the DOM selection.\n if (e.relatedTarget == null) return\n // Otherwise we want to deselect on blur and stop preserving selection.\n setIsPreservingDOMSelection(false)\n ReactEditor.deselect(editor)\n }, [])\n\n return (\n <Slate editor={editor} value={initialValue} onChange={delaySync}>\n <Editable\n id={id}\n renderLeaf={Leaf}\n renderElement={Element}\n onFocus={handleFocus}\n onKeyDown={handleKeyDown}\n onBlur={handleBlur}\n className={cx(width, margin)}\n readOnly={editMode !== BuilderEditMode.CONTENT}\n placeholder=\"Write some text...\"\n />\n </Slate>\n )\n})\n\nexport default EditableText\n"],"names":["element","attributes","children","blockStyles","useStyle","margin","useResponsiveStyle","textAlign","type","BlockType","Text","cx","Paragraph","Heading1","Heading2","Heading3","Heading4","Heading5","Heading6","BlockQuote","padding","fontSize","fontWeight","borderLeft","OrderedList","listStylePosition","UnorderedList","ListItem","ListItemChild","className","restOfProps","textDecoration","InlineType","Code","SuperScript","SubScript","Link","link","props","COMMIT_DEBOUNCE_DELAY","editor","text","shouldCommit","setShouldCommit","useState","isInBuilder","useIsInBuilder","useEffect","nextValue","richTextDTOtoDAO","nextSelection","richTextDTOtoSelection","deepEqual","selection","onChange","timeoutId","window","setTimeout","clearTimeout","useCallback","isEnabled","useIsomorphicLayoutEffect","ReactEditor","isFocused","root","findDocumentOrShadowRoot","domSelection","getSelection","newDomRange","toDOMRange","SlateRange","isBackward","setBaseAndExtent","endContainer","endOffset","startContainer","startOffset","removeAllRanges","e","console","error","defaultText","EditableText","forwardRef","id","width","ref","withBlock","withTypography","withList","withBuilder","withReact","createEditor","isPreservingDOMSElection","setIsPreservingDOMSelection","useSyncDOMSelection","delaySync","useSyncWithBuilder","editMode","useBuilderEditMode","propControllers","setPropControllers","controller","toDOMNode","pollBoxModel","onBoxModelChange","boxModel","changeBoxModel","useImperativeHandle","getDomNode","getBoxModel","getBox","initialValue","useMemo","setSlateEditor","handleFocus","focus","handleKeyDown","isHotkey","redo","undo","blur","onKeyDown","handleBlur","relatedTarget","deselect","Leaf","Element","BuilderEditMode","CONTENT"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAU6B,sBAAA;AAAA,EAAEA;AAAAA,EAASC;AAAAA,EAAYC;AAAAA,GAAsC;AAClFC,QAAAA,cAAc,CAClBC,SAAS;AAAA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GAAGtC,MAAJ;AAAA,EAAA,GAEX,CAAC8D,YAAY9D,MAAb,CAP+B;AAU3BmF,QAAAA,aAAahE,YAAY,CAACmB,MAAkB;AAEhD,QAAIA,EAAE8C,iBAAiB;AAAM;AAE7B9B,gCAA4B,KAAD;AAC3BhC,gBAAY+D,SAASrF,MAArB;AAAA,EAL4B,GAM3B,CAN2B,CAAA;AAQ9B,6BACG,OAAD;AAAA,IAAO;AAAA,IAAgB,OAAOwE;AAAAA,IAAc,UAAUhB;AAAAA,IAAtD,8BACG,UAAD;AAAA,MACE;AAAA,MACA,YAAY8B;AAAAA,MACZ,eAAeC;AAAAA,MACf,SAASZ;AAAAA,MACT,WAAWE;AAAAA,MACX,QAAQM;AAAAA,MACR,WAAWhH,GAAG0E,OAAOhF,MAAR;AAAA,MACb,UAAU6F,aAAa8B,gBAAgBC;AAAAA,MACvC,aAAY;AAAA,IAAA,CATd;AAAA,EAAA,CAFJ;AAeD,CArFqC;AAuFtC,IAAA,iBAAe/C;;"}
1
+ {"version":3,"file":"index.es10.js","sources":["../src/components/builtin/Text/components/Element/block.tsx","../src/components/builtin/Text/components/Element/inline.tsx","../src/components/builtin/Text/components/Element/element.tsx","../src/components/builtin/Text/EditableText/useSyncWithBuilder.tsx","../src/components/builtin/Text/EditableText/useSyncDOMSelection.tsx","../src/components/builtin/Text/EditableText/editable-text.tsx"],"sourcesContent":["import { cx } from '@emotion/css'\nimport { RenderElementProps } from 'slate-react'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\nimport { useResponsiveStyle } from '../../../../utils/responsive-style'\nimport { Block, BlockType } from '../../../../../slate'\n\nexport interface InlineRenderElementProps extends RenderElementProps {\n element: Block\n}\n\nexport function BlockElement({ element, attributes, children }: InlineRenderElementProps) {\n const blockStyles = [\n useStyle({ margin: 0 }),\n useStyle(useResponsiveStyle([element.textAlign], ([textAlign = 'left']) => ({ textAlign }))),\n ]\n\n const quoteStyles = useStyle({\n padding: '0.5em 10px',\n fontSize: '1.25em',\n fontWeight: '300',\n borderLeft: '5px solid rgba(0, 0, 0, 0.1)',\n })\n\n switch (element.type) {\n case BlockType.Text:\n return (\n <span {...attributes} className={cx(...blockStyles)}>\n {children}\n </span>\n )\n case BlockType.Paragraph:\n return (\n <p {...attributes} className={cx(...blockStyles)}>\n {children}\n </p>\n )\n case BlockType.Heading1:\n return (\n <h1 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h1>\n )\n case BlockType.Heading2:\n return (\n <h2 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h2>\n )\n case BlockType.Heading3:\n return (\n <h3 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h3>\n )\n case BlockType.Heading4:\n return (\n <h4 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h4>\n )\n case BlockType.Heading5:\n return (\n <h5 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h5>\n )\n case BlockType.Heading6:\n return (\n <h6 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h6>\n )\n case BlockType.BlockQuote:\n return (\n <blockquote {...attributes} className={cx(...blockStyles, quoteStyles)}>\n {children}\n </blockquote>\n )\n case BlockType.OrderedList:\n return (\n <ol {...attributes} className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n {children}\n </ol>\n )\n case BlockType.UnorderedList:\n return (\n <ul {...attributes} className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n {children}\n </ul>\n )\n case BlockType.ListItem:\n return (\n <li {...attributes} className={cx(...blockStyles)}>\n {children}\n </li>\n )\n case BlockType.ListItemChild:\n return (\n <span {...attributes} className={cx(...blockStyles)}>\n {children}\n </span>\n )\n\n default:\n return null\n }\n}\n","import { cx } from '@emotion/css'\nimport { ComponentPropsWithoutRef } from 'react'\nimport { RenderElementProps } from 'slate-react'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\nimport { Link } from '../../../../shared/Link'\nimport { Inline, InlineType } from '../../../../../slate'\n\nfunction StyledLink({ className, ...restOfProps }: ComponentPropsWithoutRef<typeof Link>) {\n return <Link {...restOfProps} className={cx(useStyle({ textDecoration: 'none' }), className)} />\n}\n\nexport interface InlineRenderElementProps extends RenderElementProps {\n element: Inline\n}\n\nexport function InlineElement({ element, attributes, children }: InlineRenderElementProps) {\n switch (element.type) {\n case InlineType.Code:\n return <code {...attributes}>{children}</code>\n case InlineType.SuperScript:\n return <sup {...attributes}>{children}</sup>\n case InlineType.SubScript:\n return <sub {...attributes}>{children}</sub>\n case InlineType.Link:\n return (\n <StyledLink {...attributes} link={element.link}>\n {children}\n </StyledLink>\n )\n }\n}\n","import { RenderElementProps } from 'slate-react'\nimport { BlockElement } from './block'\nimport { InlineElement } from './inline'\nimport { InlineType, BlockType } from '../../../../../slate'\n\nexport function Element({ element, ...props }: RenderElementProps) {\n switch (element.type) {\n case InlineType.Code:\n case InlineType.SuperScript:\n case InlineType.SubScript:\n case InlineType.Link:\n return <InlineElement element={element} {...props} />\n case BlockType.Paragraph:\n case BlockType.Heading1:\n case BlockType.Heading2:\n case BlockType.Heading3:\n case BlockType.BlockQuote:\n case BlockType.OrderedList:\n case BlockType.UnorderedList:\n case BlockType.ListItem:\n case BlockType.ListItemChild:\n return <BlockElement element={element} {...props} />\n default:\n return <span {...props.attributes}>{props.children}</span>\n }\n}\n","import { useState, useEffect, useCallback } from 'react'\nimport { Editor } from 'slate'\nimport { richTextDTOtoDAO, richTextDTOtoSelection } from '../../../../controls'\nimport { RichTextValue } from '../../../../prop-controllers'\nimport deepEqual from '../../../../utils/deepEqual'\nimport { useIsInBuilder } from '../../../../runtimes/react'\n\nconst COMMIT_DEBOUNCE_DELAY = 500\n\n/**\n * Compare new prop value with current editor and update editor\n * if the values are not equal.\n */\nexport function useSyncWithBuilder(editor: Editor, text?: RichTextValue) {\n const [shouldCommit, setShouldCommit] = useState(true)\n const isInBuilder = useIsInBuilder()\n\n useEffect(() => {\n if (shouldCommit && text && isInBuilder) {\n const nextValue = richTextDTOtoDAO(text)\n const nextSelection = richTextDTOtoSelection(text)\n if (!deepEqual(editor.children, nextValue) || !deepEqual(editor.selection, nextSelection)) {\n editor.children = nextValue\n editor.selection = nextSelection\n editor.onChange()\n }\n }\n }, [editor, shouldCommit, text])\n\n useEffect(() => {\n if (shouldCommit) return\n\n const timeoutId = window.setTimeout(() => {\n setShouldCommit(true)\n }, COMMIT_DEBOUNCE_DELAY)\n\n return () => {\n window.clearTimeout(timeoutId)\n }\n }, [shouldCommit])\n\n return useCallback(() => setShouldCommit(false), [])\n}\n","import { ReactEditor } from 'slate-react'\nimport { useIsomorphicLayoutEffect } from '../../../hooks/useIsomorphicLayoutEffect'\nimport { Editor, Range as SlateRange } from 'slate'\n\n/**\n * Clicking outside of the host blurs our `<Editable />`.\n * `<Editable />` only updates the DOM's selection to match slate when it is focused.\n * In the case of a panel being clicked this hook updates the DOM selection to match slate.\n */\nexport function useSyncDOMSelection(editor: Editor, isEnabled: boolean) {\n useIsomorphicLayoutEffect(() => {\n if (!isEnabled || editor.selection == null || ReactEditor.isFocused(editor)) return\n try {\n const root = ReactEditor.findDocumentOrShadowRoot(editor) as Document\n const domSelection = root.getSelection()\n const newDomRange: Range | null = ReactEditor.toDOMRange(editor, editor.selection)\n\n if (newDomRange) {\n if (SlateRange.isBackward(editor.selection!)) {\n domSelection?.setBaseAndExtent(\n newDomRange.endContainer,\n newDomRange.endOffset,\n newDomRange.startContainer,\n newDomRange.startOffset,\n )\n } else {\n domSelection?.setBaseAndExtent(\n newDomRange.startContainer,\n newDomRange.startOffset,\n newDomRange.endContainer,\n newDomRange.endOffset,\n )\n }\n } else {\n domSelection?.removeAllRanges()\n }\n } catch (e) {\n console.error(e)\n }\n })\n}\n","import {\n FocusEvent,\n forwardRef,\n KeyboardEvent,\n Ref,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useState,\n} from 'react'\n\nimport { createEditor } from 'slate'\nimport { Slate, Editable, withReact, ReactEditor } from 'slate-react'\n\nimport { ElementIDValue, RichTextValue } from '../../../../prop-controllers/descriptors'\nimport { cx } from '@emotion/css'\nimport { DescriptorsPropControllers } from '../../../../prop-controllers/instances'\nimport { Descriptors } from '../../../../runtimes/react/controls/rich-text'\nimport { getBox } from '../../../../box-model'\nimport { PropControllersHandle } from '../../../../state/modules/prop-controller-handles'\nimport { richTextDTOtoDAO } from '../../../../controls'\nimport { Leaf } from '../components/Leaf'\nimport { Element } from '../components/Element'\nimport { useSyncWithBuilder } from './useSyncWithBuilder'\nimport isHotkey from 'is-hotkey'\nimport { useBuilderEditMode } from '../../../../runtimes/react'\nimport { BuilderEditMode } from '../../../../state/modules/builder-edit-mode'\nimport { onKeyDown, withBlock, withTypography, withBuilder } from '../../../../slate'\nimport { pollBoxModel } from '../../../../runtimes/react/poll-box-model'\nimport { useSyncDOMSelection } from './useSyncDOMSelection'\nimport { RichTextDAO, BlockType } from '../../../../slate'\n\ntype Props = {\n id?: ElementIDValue\n text?: RichTextValue\n width?: string\n margin?: string\n}\n\nconst defaultText: RichTextDAO = [{ type: BlockType.Paragraph, children: [{ text: '' }] }]\n\nexport const EditableText = forwardRef(function EditableText(\n { id, text, width, margin }: Props,\n ref: Ref<PropControllersHandle<Descriptors>>,\n) {\n const [editor] = useState(() => withBlock(withTypography(withBuilder(withReact(createEditor())))))\n const [isPreservingDOMSElection, setIsPreservingDOMSelection] = useState(false)\n useSyncDOMSelection(editor, isPreservingDOMSElection)\n const delaySync = useSyncWithBuilder(editor, text)\n const editMode = useBuilderEditMode()\n\n const [propControllers, setPropControllers] =\n useState<DescriptorsPropControllers<Descriptors> | null>(null)\n const controller = propControllers?.text\n\n useEffect(() => {\n if (controller == null) return\n\n const element = ReactEditor.toDOMNode(editor, editor)\n\n return pollBoxModel({\n element,\n onBoxModelChange: boxModel => controller.changeBoxModel(boxModel),\n })\n }, [editor, controller])\n\n useImperativeHandle(\n ref,\n () => ({\n getDomNode() {\n return ReactEditor.toDOMNode(editor, editor)\n },\n getBoxModel() {\n return getBox(ReactEditor.toDOMNode(editor, editor))\n },\n setPropControllers,\n }),\n [editor, setPropControllers],\n )\n\n const initialValue = useMemo(() => (text ? richTextDTOtoDAO(text) : defaultText), [text])\n\n useEffect(() => {\n controller?.setSlateEditor(editor)\n }, [controller, editor])\n\n const handleFocus = useCallback(() => {\n controller?.focus()\n setIsPreservingDOMSelection(true)\n }, [controller])\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (isHotkey('mod+shift+z', e)) return controller?.redo()\n if (isHotkey('mod+z', e)) return controller?.undo()\n if (isHotkey('escape')(e)) return controller?.blur()\n onKeyDown(e, editor)\n },\n [controller, editor],\n )\n\n const handleBlur = useCallback((e: FocusEvent) => {\n // When clicking outside of the iframe (`relatedTarget` is null) we want to preserve the DOM selection.\n if (e.relatedTarget == null) return\n // Otherwise we want to deselect on blur and stop preserving selection.\n setIsPreservingDOMSelection(false)\n ReactEditor.deselect(editor)\n }, [])\n\n return (\n <Slate editor={editor} value={initialValue} onChange={delaySync}>\n <Editable\n id={id}\n renderLeaf={Leaf}\n renderElement={Element}\n onFocus={handleFocus}\n onKeyDown={handleKeyDown}\n onBlur={handleBlur}\n className={cx(width, margin)}\n readOnly={editMode !== BuilderEditMode.CONTENT}\n placeholder=\"Write some text...\"\n />\n </Slate>\n )\n})\n\nexport default EditableText\n"],"names":["element","attributes","children","blockStyles","useStyle","margin","useResponsiveStyle","textAlign","quoteStyles","padding","fontSize","fontWeight","borderLeft","type","BlockType","Text","cx","Paragraph","Heading1","Heading2","Heading3","Heading4","Heading5","Heading6","BlockQuote","OrderedList","listStylePosition","UnorderedList","ListItem","ListItemChild","className","restOfProps","textDecoration","InlineType","Code","SuperScript","SubScript","Link","link","props","COMMIT_DEBOUNCE_DELAY","editor","text","shouldCommit","setShouldCommit","useState","isInBuilder","useIsInBuilder","useEffect","nextValue","richTextDTOtoDAO","nextSelection","richTextDTOtoSelection","deepEqual","selection","onChange","timeoutId","window","setTimeout","clearTimeout","useCallback","isEnabled","useIsomorphicLayoutEffect","ReactEditor","isFocused","root","findDocumentOrShadowRoot","domSelection","getSelection","newDomRange","toDOMRange","SlateRange","isBackward","setBaseAndExtent","endContainer","endOffset","startContainer","startOffset","removeAllRanges","e","console","error","defaultText","EditableText","forwardRef","id","width","ref","withBlock","withTypography","withBuilder","withReact","createEditor","isPreservingDOMSElection","setIsPreservingDOMSelection","useSyncDOMSelection","delaySync","useSyncWithBuilder","editMode","useBuilderEditMode","propControllers","setPropControllers","controller","toDOMNode","pollBoxModel","onBoxModelChange","boxModel","changeBoxModel","useImperativeHandle","getDomNode","getBoxModel","getBox","initialValue","useMemo","setSlateEditor","handleFocus","focus","handleKeyDown","isHotkey","redo","undo","blur","onKeyDown","handleBlur","relatedTarget","deselect","Leaf","Element","BuilderEditMode","CONTENT"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAU6B,sBAAA;AAAA,EAAEA;AAAAA,EAASC;AAAAA,EAAYC;AAAAA,GAAsC;AAClFC,QAAAA,cAAc,CAClBC,SAAS;AAAA,IAAEC,QAAQ;AAAA,EAAA,CAAX,GACRD,SAASE,mBAAmB,CAACN,QAAQO,SAAT,GAAqB,CAAC,CAACA,YAAY,YAAa;AAAA,IAAEA;AAAAA,EAAAA,EAAnD,CAAnB,CAFU;AAKdC,QAAAA,cAAcJ,SAAS;AAAA,IAC3BK,SAAS;AAAA,IACTC,UAAU;AAAA,IACVC,YAAY;AAAA,IACZC,YAAY;AAAA,EAAA,CAJc;AAOpBZ,UAAAA,QAAQa;AAAAA,SACTC,UAAUC;AACb,0EACYd;QAAY,WAAWe,GAAG,GAAGb,WAAJ;AAAA,QAChCD;AAAAA,MAAAA,EAFL;AAAA,SAKGY,UAAUG;AACb,uEACShB;QAAY,WAAWe,GAAG,GAAGb,WAAJ;AAAA,QAC7BD;AAAAA,MAAAA,EAFL;AAAA,SAKGY,UAAUI;AACb,wEACUjB;QAAY,WAAWe,GAAG,GAAGb,WAAJ;AAAA,QAC9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,EAAA,CAFJ;AAeD,CAnFqC;AAqFtC,IAAA,iBAAe9C;;"}
package/dist/index.es2.js CHANGED
@@ -32,10 +32,10 @@ var __objRest = (source, exclude) => {
32
32
  import { useMemo, useState, useEffect, useCallback, useRef, forwardRef, createElement, Children } from "react";
33
33
  import { H as useFiles, I as useSwatches, n as useStyle, w as useResponsiveGridItem, c as DEFAULT_BOX_ANIMATE_TYPE, f as DEFAULT_ITEM_ANIMATE_TYPE, e as DEFAULT_BOX_ANIMATE_DURATION, d as DEFAULT_BOX_ANIMATE_DELAY, i as DEFAULT_ITEM_STAGGER_DURATION, o as useResponsiveStyle, r as colorToString } from "./index.es.js";
34
34
  import "use-sync-external-store/shim";
35
- import { Z as isNonNullable, ar as getBackgroundsFileIds, as as getBackgroundsSwatchIds } from "./react-page.es.js";
35
+ import { _ as isNonNullable, at as getBackgroundsFileIds, au as getBackgroundsSwatchIds } from "./react-page.es.js";
36
36
  import "slate";
37
- import "is-hotkey";
38
37
  import "./state/breakpoints.es.js";
38
+ import "is-hotkey";
39
39
  import "slate-react";
40
40
  import { u as useMediaQuery } from "./useMediaQuery.es.js";
41
41
  import { cx } from "@emotion/css";