@makeswift/runtime 0.9.12 → 0.10.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 (235) hide show
  1. package/dist/Box.cjs.js +3 -0
  2. package/dist/Box.cjs.js.map +1 -1
  3. package/dist/Box.es.js +4 -1
  4. package/dist/Box.es.js.map +1 -1
  5. package/dist/Button.cjs.js +3 -2
  6. package/dist/Button.cjs.js.map +1 -1
  7. package/dist/Button.es.js +4 -3
  8. package/dist/Button.es.js.map +1 -1
  9. package/dist/Carousel.cjs.js +3 -2
  10. package/dist/Carousel.cjs.js.map +1 -1
  11. package/dist/Carousel.es.js +4 -3
  12. package/dist/Carousel.es.js.map +1 -1
  13. package/dist/Countdown.cjs.js +3 -0
  14. package/dist/Countdown.cjs.js.map +1 -1
  15. package/dist/Countdown.es.js +4 -1
  16. package/dist/Countdown.es.js.map +1 -1
  17. package/dist/Divider.cjs.js +3 -0
  18. package/dist/Divider.cjs.js.map +1 -1
  19. package/dist/Divider.es.js +4 -1
  20. package/dist/Divider.es.js.map +1 -1
  21. package/dist/Embed.cjs.js +1 -0
  22. package/dist/Embed.cjs.js.map +1 -1
  23. package/dist/Embed.es.js +2 -1
  24. package/dist/Embed.es.js.map +1 -1
  25. package/dist/Form.cjs.js +13 -12
  26. package/dist/Form.cjs.js.map +1 -1
  27. package/dist/Form.es.js +5 -4
  28. package/dist/Form.es.js.map +1 -1
  29. package/dist/Image.cjs.js +11 -10
  30. package/dist/Image.cjs.js.map +1 -1
  31. package/dist/Image.es.js +11 -10
  32. package/dist/Image.es.js.map +1 -1
  33. package/dist/LiveProvider.cjs.js +3 -0
  34. package/dist/LiveProvider.cjs.js.map +1 -1
  35. package/dist/LiveProvider.es.js +5 -2
  36. package/dist/LiveProvider.es.js.map +1 -1
  37. package/dist/Navigation.cjs.js +11 -10
  38. package/dist/Navigation.cjs.js.map +1 -1
  39. package/dist/Navigation.es.js +11 -10
  40. package/dist/Navigation.es.js.map +1 -1
  41. package/dist/PreviewProvider.cjs.js +6 -3
  42. package/dist/PreviewProvider.cjs.js.map +1 -1
  43. package/dist/PreviewProvider.es.js +5 -2
  44. package/dist/PreviewProvider.es.js.map +1 -1
  45. package/dist/ReadOnlyText.cjs.js +19 -26
  46. package/dist/ReadOnlyText.cjs.js.map +1 -1
  47. package/dist/ReadOnlyText.es.js +15 -22
  48. package/dist/ReadOnlyText.es.js.map +1 -1
  49. package/dist/ReadOnlyTextV2.cjs.js +29 -26
  50. package/dist/ReadOnlyTextV2.cjs.js.map +1 -1
  51. package/dist/ReadOnlyTextV2.es.js +28 -25
  52. package/dist/ReadOnlyTextV2.es.js.map +1 -1
  53. package/dist/Root.cjs.js +3 -0
  54. package/dist/Root.cjs.js.map +1 -1
  55. package/dist/Root.es.js +4 -1
  56. package/dist/Root.es.js.map +1 -1
  57. package/dist/SocialLinks.cjs.js +6 -5
  58. package/dist/SocialLinks.cjs.js.map +1 -1
  59. package/dist/SocialLinks.es.js +7 -6
  60. package/dist/SocialLinks.es.js.map +1 -1
  61. package/dist/Text.cjs.js +12 -71
  62. package/dist/Text.cjs.js.map +1 -1
  63. package/dist/Text.es.js +13 -64
  64. package/dist/Text.es.js.map +1 -1
  65. package/dist/Video.cjs.js +1 -0
  66. package/dist/Video.cjs.js.map +1 -1
  67. package/dist/Video.es.js +2 -1
  68. package/dist/Video.es.js.map +1 -1
  69. package/dist/builder.cjs.js +2 -0
  70. package/dist/builder.cjs.js.map +1 -1
  71. package/dist/builder.es.js +2 -0
  72. package/dist/builder.es.js.map +1 -1
  73. package/dist/components.cjs.js +3 -2
  74. package/dist/components.cjs.js.map +1 -1
  75. package/dist/components.es.js +3 -2
  76. package/dist/components.es.js.map +1 -1
  77. package/dist/control-serialization.es.js +1 -1
  78. package/dist/controls.cjs.js +8 -8
  79. package/dist/controls.es.js +4 -2
  80. package/dist/controls.es.js.map +1 -1
  81. package/dist/index.cjs.js +276 -213
  82. package/dist/index.cjs.js.map +1 -1
  83. package/dist/index.cjs3.js +21 -107
  84. package/dist/index.cjs3.js.map +1 -1
  85. package/dist/index.cjs4.js +16 -57
  86. package/dist/index.cjs4.js.map +1 -1
  87. package/dist/index.cjs5.js +53 -242
  88. package/dist/index.cjs5.js.map +1 -1
  89. package/dist/index.cjs6.js +0 -41
  90. package/dist/index.cjs6.js.map +1 -1
  91. package/dist/index.cjs7.js +376 -14
  92. package/dist/index.cjs7.js.map +1 -1
  93. package/dist/index.cjs8.js +275 -11
  94. package/dist/index.cjs8.js.map +1 -1
  95. package/dist/index.es.js +270 -206
  96. package/dist/index.es.js.map +1 -1
  97. package/dist/index.es2.js +2 -2
  98. package/dist/index.es3.js +22 -103
  99. package/dist/index.es3.js.map +1 -1
  100. package/dist/index.es4.js +16 -57
  101. package/dist/index.es4.js.map +1 -1
  102. package/dist/index.es5.js +53 -240
  103. package/dist/index.es5.js.map +1 -1
  104. package/dist/index.es6.js +1 -36
  105. package/dist/index.es6.js.map +1 -1
  106. package/dist/index.es7.js +372 -16
  107. package/dist/index.es7.js.map +1 -1
  108. package/dist/index.es8.js +270 -10
  109. package/dist/index.es8.js.map +1 -1
  110. package/dist/main.cjs.js +2 -0
  111. package/dist/main.cjs.js.map +1 -1
  112. package/dist/main.es.js +2 -0
  113. package/dist/main.es.js.map +1 -1
  114. package/dist/next.cjs.js +3 -0
  115. package/dist/next.cjs.js.map +1 -1
  116. package/dist/next.es.js +4 -1
  117. package/dist/next.es.js.map +1 -1
  118. package/dist/prop-controllers.cjs.js +2 -0
  119. package/dist/prop-controllers.cjs.js.map +1 -1
  120. package/dist/prop-controllers.es.js +2 -0
  121. package/dist/prop-controllers.es.js.map +1 -1
  122. package/dist/react-page.cjs.js +1450 -65
  123. package/dist/react-page.cjs.js.map +1 -1
  124. package/dist/react-page.es.js +1427 -66
  125. package/dist/react-page.es.js.map +1 -1
  126. package/dist/react.cjs.js +3 -0
  127. package/dist/react.cjs.js.map +1 -1
  128. package/dist/react.es.js +3 -0
  129. package/dist/react.es.js.map +1 -1
  130. package/dist/slate.cjs.js +33 -391
  131. package/dist/slate.cjs.js.map +1 -1
  132. package/dist/slate.es.js +15 -376
  133. package/dist/slate.es.js.map +1 -1
  134. package/dist/text-input.cjs.js +0 -22
  135. package/dist/text-input.cjs.js.map +1 -1
  136. package/dist/text-input.es.js +1 -18
  137. package/dist/text-input.es.js.map +1 -1
  138. package/dist/types/src/components/builtin/Text/Text.d.ts +3 -4
  139. package/dist/types/src/components/builtin/Text/Text.d.ts.map +1 -1
  140. package/dist/types/src/components/builtin/Text/register.d.ts.map +1 -1
  141. package/dist/types/src/controls/rich-text/fixtures/v2-data-types.d.ts.map +1 -1
  142. package/dist/types/src/controls/rich-text/rich-text.d.ts +0 -1
  143. package/dist/types/src/controls/rich-text/rich-text.d.ts.map +1 -1
  144. package/dist/types/src/controls/rich-text/translation.d.ts.map +1 -1
  145. package/dist/types/src/controls/rich-text-v2/plugin.d.ts +29 -0
  146. package/dist/types/src/controls/rich-text-v2/plugin.d.ts.map +1 -0
  147. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts +17 -31
  148. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
  149. package/dist/types/src/next/client.d.ts.map +1 -1
  150. package/dist/types/src/prop-controllers/descriptors.d.ts +1 -1
  151. package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
  152. package/dist/types/src/prop-controllers/introspection.d.ts.map +1 -1
  153. package/dist/types/src/runtimes/react/controls/control.d.ts +1 -1
  154. package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -1
  155. package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/EditableText/editable-text.d.ts +4 -3
  156. package/dist/types/src/runtimes/react/controls/rich-text/EditableText/editable-text.d.ts.map +1 -0
  157. package/dist/types/src/runtimes/react/controls/rich-text/EditableText/index.d.ts.map +1 -0
  158. package/dist/types/src/runtimes/react/controls/rich-text/EditableText/useSyncDOMSelection.d.ts.map +1 -0
  159. package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/EditableText/useSyncWithBuilder.d.ts +1 -1
  160. package/dist/types/src/runtimes/react/controls/rich-text/EditableText/useSyncWithBuilder.d.ts.map +1 -0
  161. package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/ReadOnlyText.d.ts +2 -2
  162. package/dist/types/src/runtimes/react/controls/rich-text/ReadOnlyText.d.ts.map +1 -0
  163. package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Element/block.d.ts +1 -1
  164. package/dist/types/src/runtimes/react/controls/rich-text/components/Element/block.d.ts.map +1 -0
  165. package/dist/types/src/runtimes/react/controls/rich-text/components/Element/element.d.ts.map +1 -0
  166. package/dist/types/src/runtimes/react/controls/rich-text/components/Element/index.d.ts.map +1 -0
  167. package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Element/inline.d.ts +1 -1
  168. package/dist/types/src/runtimes/react/controls/rich-text/components/Element/inline.d.ts.map +1 -0
  169. package/dist/types/src/runtimes/react/controls/rich-text/components/Leaf/index.d.ts.map +1 -0
  170. package/dist/types/src/runtimes/react/controls/rich-text/components/Leaf/leaf.d.ts.map +1 -0
  171. package/dist/types/src/runtimes/react/controls/rich-text/components/index.d.ts.map +1 -0
  172. package/dist/types/src/runtimes/react/controls/rich-text/index.d.ts +2 -0
  173. package/dist/types/src/runtimes/react/controls/rich-text/index.d.ts.map +1 -0
  174. package/dist/types/src/runtimes/react/controls/{rich-text.d.ts → rich-text/rich-text.d.ts} +1 -1
  175. package/dist/types/src/runtimes/react/controls/rich-text/rich-text.d.ts.map +1 -0
  176. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts.map +1 -1
  177. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-element.d.ts +2 -1
  178. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-element.d.ts.map +1 -1
  179. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-leaf.d.ts +2 -1
  180. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-leaf.d.ts.map +1 -1
  181. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/useRemoteChanges.d.ts.map +1 -1
  182. package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts +2 -1
  183. package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts.map +1 -1
  184. package/dist/types/src/slate/BlockPlugin/index.d.ts +3 -3
  185. package/dist/types/src/slate/BlockPlugin/index.d.ts.map +1 -1
  186. package/dist/types/src/slate/InlineModePlugin/index.d.ts +6 -4
  187. package/dist/types/src/slate/InlineModePlugin/index.d.ts.map +1 -1
  188. package/dist/types/src/slate/InlinePlugin/index.d.ts +3 -3
  189. package/dist/types/src/slate/InlinePlugin/index.d.ts.map +1 -1
  190. package/dist/types/src/slate/InlinePlugin/types.d.ts +1 -1
  191. package/dist/types/src/slate/InlinePlugin/types.d.ts.map +1 -1
  192. package/dist/types/src/slate/LinkPlugin/index.d.ts +3 -3
  193. package/dist/types/src/slate/LinkPlugin/index.d.ts.map +1 -1
  194. package/dist/types/src/slate/LinkPlugin/linkPluginWithoutRenderElement.d.ts +16 -0
  195. package/dist/types/src/slate/LinkPlugin/linkPluginWithoutRenderElement.d.ts.map +1 -0
  196. package/dist/types/src/slate/TextAlignPlugin/index.d.ts +3 -3
  197. package/dist/types/src/slate/TypographyPlugin/index.d.ts +3 -3
  198. package/dist/types/src/slate/TypographyPlugin/index.d.ts.map +1 -1
  199. package/dist/types/src/slate/types.d.ts +1 -10
  200. package/dist/types/src/slate/types.d.ts.map +1 -1
  201. package/dist/types/src/slate/utils/element.d.ts.map +1 -1
  202. package/dist/types/src/state/modules/locales.d.ts.map +1 -1
  203. package/package.json +1 -1
  204. package/dist/index.cjs10.js +0 -390
  205. package/dist/index.cjs10.js.map +0 -1
  206. package/dist/index.cjs9.js +0 -295
  207. package/dist/index.cjs9.js.map +0 -1
  208. package/dist/index.es10.js +0 -383
  209. package/dist/index.es10.js.map +0 -1
  210. package/dist/index.es9.js +0 -288
  211. package/dist/index.es9.js.map +0 -1
  212. package/dist/types/src/components/builtin/Text/EditableText/editable-text.d.ts.map +0 -1
  213. package/dist/types/src/components/builtin/Text/EditableText/index.d.ts.map +0 -1
  214. package/dist/types/src/components/builtin/Text/EditableText/useSyncDOMSelection.d.ts.map +0 -1
  215. package/dist/types/src/components/builtin/Text/EditableText/useSyncWithBuilder.d.ts.map +0 -1
  216. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +0 -1
  217. package/dist/types/src/components/builtin/Text/components/Element/block.d.ts.map +0 -1
  218. package/dist/types/src/components/builtin/Text/components/Element/element.d.ts.map +0 -1
  219. package/dist/types/src/components/builtin/Text/components/Element/index.d.ts.map +0 -1
  220. package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts.map +0 -1
  221. package/dist/types/src/components/builtin/Text/components/Leaf/index.d.ts.map +0 -1
  222. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +0 -1
  223. package/dist/types/src/components/builtin/Text/components/index.d.ts.map +0 -1
  224. package/dist/types/src/runtimes/react/controls/rich-text.d.ts.map +0 -1
  225. package/dist/types.cjs2.js +0 -765
  226. package/dist/types.cjs2.js.map +0 -1
  227. package/dist/types.es2.js +0 -748
  228. package/dist/types.es2.js.map +0 -1
  229. /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/EditableText/index.d.ts +0 -0
  230. /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/EditableText/useSyncDOMSelection.d.ts +0 -0
  231. /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Element/element.d.ts +0 -0
  232. /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Element/index.d.ts +0 -0
  233. /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Leaf/index.d.ts +0 -0
  234. /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Leaf/leaf.d.ts +0 -0
  235. /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/index.d.ts +0 -0
@@ -1,765 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __spreadValues = (a, b) => {
10
- for (var prop in b || (b = {}))
11
- if (__hasOwnProp.call(b, prop))
12
- __defNormalProp(a, prop, b[prop]);
13
- if (__getOwnPropSymbols)
14
- for (var prop of __getOwnPropSymbols(b)) {
15
- if (__propIsEnum.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- }
18
- return a;
19
- };
20
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
- var __objRest = (source, exclude) => {
22
- var target = {};
23
- for (var prop in source)
24
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
25
- target[prop] = source[prop];
26
- if (source != null && __getOwnPropSymbols)
27
- for (var prop of __getOwnPropSymbols(source)) {
28
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
29
- target[prop] = source[prop];
30
- }
31
- return target;
32
- };
33
- var slate = require("slate");
34
- var state_breakpoints = require("./state/breakpoints.cjs.js");
35
- var reactPage = require("./react-page.cjs.js");
36
- require("./actions.cjs.js");
37
- var textInput = require("./text-input.cjs.js");
38
- var isHotkey = require("is-hotkey");
39
- var css = require("@emotion/css");
40
- var jsxRuntime = require("react/jsx-runtime");
41
- function _interopDefaultLegacy(e) {
42
- return e && typeof e === "object" && "default" in e ? e : { "default": e };
43
- }
44
- var isHotkey__default = /* @__PURE__ */ _interopDefaultLegacy(isHotkey);
45
- const ElementUtils = {
46
- isRootBlock(node) {
47
- return slate.Element.isElement(node) && (slate.Element.isElementType(node, reactPage.BlockType.Paragraph) || slate.Element.isElementType(node, reactPage.BlockType.Heading1) || slate.Element.isElementType(node, reactPage.BlockType.Heading2) || slate.Element.isElementType(node, reactPage.BlockType.Heading3) || slate.Element.isElementType(node, reactPage.BlockType.Heading3) || slate.Element.isElementType(node, reactPage.BlockType.Heading4) || slate.Element.isElementType(node, reactPage.BlockType.Heading5) || slate.Element.isElementType(node, reactPage.BlockType.Heading6) || slate.Element.isElementType(node, reactPage.BlockType.BlockQuote) || slate.Element.isElementType(node, reactPage.BlockType.UnorderedList) || slate.Element.isElementType(node, reactPage.BlockType.OrderedList) || slate.Element.isElementType(node, reactPage.BlockType.Text) || slate.Element.isElementType(node, reactPage.BlockType.Default));
48
- },
49
- isBlock(node) {
50
- return slate.Element.isElement(node) && (this.isRootBlock(node) || slate.Element.isElementType(node, reactPage.BlockType.ListItem) || slate.Element.isElementType(node, reactPage.BlockType.ListItemChild));
51
- },
52
- isInline(node) {
53
- return slate.Element.isElementType(node, reactPage.InlineType.Code) || slate.Element.isElementType(node, reactPage.InlineType.Link) || slate.Element.isElementType(node, reactPage.InlineType.SubScript) || slate.Element.isElementType(node, reactPage.InlineType.SuperScript);
54
- },
55
- isConvertibleToListTextNode(node) {
56
- return !this.isList(node) && !this.isListItem(node) && !this.isListItemChild(node);
57
- },
58
- isList(node) {
59
- return slate.Element.isElementType(node, reactPage.BlockType.OrderedList) || slate.Element.isElementType(node, reactPage.BlockType.UnorderedList);
60
- },
61
- isListItem(node) {
62
- return slate.Element.isElementType(node, reactPage.BlockType.ListItem);
63
- },
64
- isListItemChild(node) {
65
- return slate.Element.isElementType(node, reactPage.BlockType.ListItemChild);
66
- },
67
- createText() {
68
- return { text: "" };
69
- },
70
- createParagraph() {
71
- return {
72
- children: [this.createText()],
73
- type: reactPage.BlockType.Paragraph
74
- };
75
- },
76
- createList(type = reactPage.BlockType.UnorderedList) {
77
- return { children: [this.createText()], type };
78
- },
79
- createListItem() {
80
- return {
81
- children: [this.createListItemChild()],
82
- type: reactPage.BlockType.ListItem
83
- };
84
- },
85
- createListItemChild() {
86
- return {
87
- children: [this.createText()],
88
- type: reactPage.BlockType.ListItemChild
89
- };
90
- }
91
- };
92
- function unhangRange(editor, range) {
93
- let [start, end] = slate.Range.edges(range);
94
- if (start.offset !== 0 || end.offset !== 0 || slate.Range.isCollapsed(range)) {
95
- return range;
96
- }
97
- const endBlock = slate.Editor.above(editor, {
98
- at: end,
99
- match: (n) => slate.Element.isElement(n) && slate.Editor.isBlock(editor, n)
100
- });
101
- const blockPath = endBlock ? endBlock[1] : [];
102
- const first = slate.Editor.start(editor, start);
103
- const before = { anchor: first, focus: end };
104
- let skip = true;
105
- for (const [node, path] of slate.Editor.nodes(editor, {
106
- at: before,
107
- match: slate.Text.isText,
108
- reverse: true
109
- })) {
110
- if (skip) {
111
- skip = false;
112
- continue;
113
- }
114
- if (node.text !== "" || slate.Path.isBefore(path, blockPath)) {
115
- end = { path, offset: node.text.length };
116
- break;
117
- }
118
- }
119
- return { anchor: start, focus: end };
120
- }
121
- function getSelection(editor) {
122
- if (editor.selection)
123
- return unhangRange(editor, editor.selection);
124
- return {
125
- anchor: slate.Editor.start(editor, []),
126
- focus: slate.Editor.end(editor, [])
127
- };
128
- }
129
- function getBlocksInSelection(editor) {
130
- return Array.from(slate.Editor.nodes(editor, {
131
- at: getSelection(editor),
132
- match: (node) => ElementUtils.isRootBlock(node)
133
- })).filter((entry) => ElementUtils.isRootBlock(entry[0]));
134
- }
135
- function getActiveBlockType(editor) {
136
- var _a;
137
- const rootBlocks = getBlocksInSelection(editor).map(([node]) => node.type);
138
- return rootBlocks.reduce((a, b) => a === b ? b : null, (_a = rootBlocks.at(0)) != null ? _a : null);
139
- }
140
- function setBlockKeyForDevice(editor, breakpoints, deviceId, key, value, options) {
141
- var _a, _b;
142
- const at = (_a = options == null ? void 0 : options.at) != null ? _a : editor.selection;
143
- if (!at)
144
- return;
145
- const rootElements = getBlocksInSelection(editor);
146
- for (const [node, path] of rootElements) {
147
- if (ElementUtils.isBlock(node)) {
148
- const deviceValues = (_b = node[key]) != null ? _b : [];
149
- const currentDeviceValue = state_breakpoints.findBreakpointOverride(breakpoints, deviceValues, deviceId, (v) => v);
150
- const nextDeviceValue = __spreadProps(__spreadValues({}, currentDeviceValue), {
151
- deviceId,
152
- value
153
- });
154
- slate.Transforms.setNodes(editor, {
155
- [key]: [...deviceValues.filter((v) => v.deviceId !== deviceId), nextDeviceValue]
156
- }, { at: path });
157
- }
158
- }
159
- }
160
- function clearBlockKeyForDevice(editor, deviceId, key) {
161
- var _a;
162
- const rootElements = getBlocksInSelection(editor);
163
- for (const [node, path] of rootElements) {
164
- if (ElementUtils.isBlock(node)) {
165
- const deviceOverrides = (_a = node[key]) != null ? _a : [];
166
- slate.Transforms.setNodes(editor, {
167
- [key]: deviceOverrides.filter((v) => v.deviceId !== deviceId)
168
- }, { at: path });
169
- }
170
- }
171
- }
172
- function wrapInline(editor, inline) {
173
- slate.Transforms.wrapNodes(editor, inline, {
174
- at: getSelection(editor),
175
- split: true
176
- });
177
- }
178
- function unwrapInline(editor, type) {
179
- slate.Transforms.unwrapNodes(editor, {
180
- match: (node) => ElementUtils.isInline(node) && node.type === type,
181
- at: getSelection(editor)
182
- });
183
- }
184
- const EditorUtils = {
185
- getFirstAncestorList(editor, path) {
186
- try {
187
- const parentList = slate.Editor.above(editor, {
188
- at: path,
189
- match: (node) => ElementUtils.isList(node)
190
- });
191
- return parentList != null ? parentList : null;
192
- } catch (e) {
193
- return null;
194
- }
195
- },
196
- getFirstAncestorListItem(editor, path) {
197
- try {
198
- const parentListItem = slate.Editor.above(editor, {
199
- at: path,
200
- match: (node) => ElementUtils.isListItem(node)
201
- });
202
- return parentListItem != null ? parentListItem : null;
203
- } catch (e) {
204
- return null;
205
- }
206
- }
207
- };
208
- const LIST_ITEM_CHILD_POSITION = 0;
209
- const LIST_ITEM_LIST_POSITION = 1;
210
- function filterForSubtreeRoots(entries) {
211
- return entries.filter(([, nodePath]) => !slate.Path.ancestors(nodePath).some((ancestor) => {
212
- return entries.some(([, path]) => slate.Path.equals(path, ancestor));
213
- }));
214
- }
215
- function unwrapPath(editor, listItemPath) {
216
- const parentList = EditorUtils.getFirstAncestorList(editor, listItemPath);
217
- const listItemContainingParentList = EditorUtils.getFirstAncestorListItem(editor, listItemPath);
218
- if (!parentList || listItemContainingParentList)
219
- return;
220
- slate.Editor.withoutNormalizing(editor, () => {
221
- const listItemTextPath = [...listItemPath, LIST_ITEM_CHILD_POSITION];
222
- const listItemNestedListPath = [...listItemPath, LIST_ITEM_LIST_POSITION];
223
- if (slate.Node.has(editor, listItemNestedListPath)) {
224
- slate.Transforms.setNodes(editor, { type: parentList[0].type }, { at: listItemNestedListPath });
225
- slate.Transforms.liftNodes(editor, { at: listItemNestedListPath });
226
- slate.Transforms.liftNodes(editor, { at: slate.Path.next(listItemPath) });
227
- }
228
- if (slate.Node.has(editor, listItemTextPath)) {
229
- slate.Transforms.setNodes(editor, { type: reactPage.BlockType.Paragraph }, {
230
- at: listItemTextPath
231
- });
232
- slate.Transforms.liftNodes(editor, { at: listItemTextPath });
233
- slate.Transforms.liftNodes(editor, { at: listItemPath });
234
- }
235
- });
236
- }
237
- function unwrapList(editor, options) {
238
- var _a;
239
- const at = (_a = options == null ? void 0 : options.at) != null ? _a : editor.selection;
240
- if (!at)
241
- return;
242
- const listItems = Array.from(slate.Editor.nodes(editor, {
243
- at,
244
- match: (node) => {
245
- return slate.Element.isElement(node) && ElementUtils.isListItem(node);
246
- }
247
- }));
248
- const subRoots = filterForSubtreeRoots(listItems);
249
- const refs = subRoots.map(([_, path]) => slate.Editor.pathRef(editor, path));
250
- refs.forEach((ref) => {
251
- if (ref.current) {
252
- unwrapPath(editor, ref.current);
253
- }
254
- ref.unref();
255
- });
256
- }
257
- function wrapList(editor, options = { type: reactPage.BlockType.UnorderedList }) {
258
- var _a;
259
- const at = (_a = options.at) != null ? _a : editor.selection;
260
- if (!at)
261
- return;
262
- const nonListEntries = Array.from(slate.Editor.nodes(editor, {
263
- at,
264
- match: (node) => {
265
- return slate.Element.isElement(node) && ElementUtils.isConvertibleToListTextNode(node);
266
- }
267
- }));
268
- const refs = nonListEntries.map(([_, path]) => slate.Editor.pathRef(editor, path));
269
- refs.forEach((ref) => {
270
- const path = ref.current;
271
- if (path) {
272
- slate.Editor.withoutNormalizing(editor, () => {
273
- slate.Transforms.setNodes(editor, { type: reactPage.BlockType.ListItemChild }, {
274
- at: path
275
- });
276
- slate.Transforms.wrapNodes(editor, ElementUtils.createListItem(), {
277
- match: (node) => ElementUtils.isListItemChild(node),
278
- at: path
279
- });
280
- slate.Transforms.wrapNodes(editor, ElementUtils.createList(options.type), {
281
- at: path
282
- });
283
- });
284
- }
285
- ref.unref();
286
- });
287
- }
288
- const LocationUtils = {
289
- getStartPath(location) {
290
- if (slate.Range.isRange(location))
291
- return slate.Range.start(location).path;
292
- if (slate.Point.isPoint(location))
293
- return location.path;
294
- return location;
295
- }
296
- };
297
- function getSelectedListItems(editor) {
298
- var _a, _b;
299
- if (!editor.selection)
300
- return [];
301
- const start = LocationUtils.getStartPath(editor.selection);
302
- const listItems = slate.Editor.nodes(editor, {
303
- at: editor.selection,
304
- match: (node) => ElementUtils.isListItem(node)
305
- });
306
- const firstAncestorPath = (_b = (_a = EditorUtils.getFirstAncestorListItem(editor, start)) == null ? void 0 : _a[1]) != null ? _b : [];
307
- return Array.from(listItems).filter((node) => slate.Path.isDescendant(start, node[1]) ? slate.Path.equals(node[1], firstAncestorPath) : !slate.Path.isAfter(start, node[1]));
308
- }
309
- function indentPath(editor, path) {
310
- const parent = slate.Node.parent(editor, path);
311
- if (!path || !slate.Path.hasPrevious(path) || !ElementUtils.isList(parent))
312
- return;
313
- const previosPath = slate.Path.previous(path);
314
- const previousChildListPath = [...previosPath, LIST_ITEM_LIST_POSITION];
315
- const previousHasChildList = slate.Node.has(editor, previousChildListPath);
316
- slate.Editor.withoutNormalizing(editor, () => {
317
- if (!previousHasChildList) {
318
- slate.Transforms.insertNodes(editor, ElementUtils.createList(parent.type), {
319
- at: previousChildListPath
320
- });
321
- }
322
- const previousChildList = slate.Node.get(editor, previousChildListPath);
323
- if (ElementUtils.isList(previousChildList)) {
324
- const index = previousHasChildList ? previousChildList.children.length : 0;
325
- slate.Transforms.moveNodes(editor, {
326
- at: path,
327
- to: [...previousChildListPath, index]
328
- });
329
- }
330
- });
331
- }
332
- function indent(editor) {
333
- if (!editor.selection)
334
- return;
335
- const listItems = getSelectedListItems(editor);
336
- const subRoots = filterForSubtreeRoots(listItems);
337
- const refs = subRoots.map(([_, path]) => slate.Editor.pathRef(editor, path));
338
- refs.forEach((ref) => {
339
- if (ref.current) {
340
- indentPath(editor, ref.current);
341
- }
342
- ref.unref();
343
- });
344
- }
345
- function dedentPath(editor, listItemPath) {
346
- const parentList = EditorUtils.getFirstAncestorList(editor, listItemPath);
347
- const listItemContainingParentList = EditorUtils.getFirstAncestorListItem(editor, listItemPath);
348
- if (!parentList || !listItemContainingParentList)
349
- return;
350
- const [parentListNode, parentListPath] = parentList;
351
- const [_, listItemContainingParentListPath] = listItemContainingParentList;
352
- const listItemPosition = listItemPath[listItemPath.length - 1];
353
- const previousSiblings = parentListNode.children.slice(0, listItemPosition);
354
- const nextSiblings = parentListNode.children.slice(listItemPosition + 1);
355
- slate.Editor.withoutNormalizing(editor, () => {
356
- nextSiblings.forEach(() => {
357
- const nextSiblingPath = [...parentListPath, listItemPosition + 1];
358
- indentPath(editor, nextSiblingPath);
359
- });
360
- slate.Transforms.moveNodes(editor, {
361
- at: listItemPath,
362
- to: slate.Path.next(listItemContainingParentListPath)
363
- });
364
- if (previousSiblings.length === 0) {
365
- slate.Transforms.removeNodes(editor, { at: parentListPath });
366
- }
367
- });
368
- }
369
- function dedent(editor) {
370
- if (!editor.selection)
371
- return;
372
- const listItems = getSelectedListItems(editor);
373
- const subRoots = filterForSubtreeRoots(listItems);
374
- const refs = subRoots.map(([_, path]) => slate.Editor.pathRef(editor, path));
375
- refs.forEach((ref) => {
376
- if (ref.current) {
377
- dedentPath(editor, ref.current);
378
- }
379
- ref.unref();
380
- });
381
- }
382
- function toggleList(editor, options = { type: reactPage.BlockType.UnorderedList }) {
383
- var _a;
384
- const at = (_a = options.at) != null ? _a : editor.selection;
385
- if (at == null)
386
- return;
387
- const start = LocationUtils.getStartPath(at);
388
- const ancestorPath = slate.Path.ancestors(start).at(1);
389
- if (!ancestorPath || !slate.Node.has(editor, ancestorPath))
390
- return;
391
- const ancestor = slate.Node.get(editor, ancestorPath);
392
- if (!ElementUtils.isList(ancestor)) {
393
- return wrapList(editor, { type: options.type, at });
394
- }
395
- if (ancestor.type === options.type) {
396
- unwrapList(editor, { at });
397
- } else {
398
- slate.Transforms.setNodes(editor, { type: options.type }, { at: ancestorPath });
399
- }
400
- }
401
- const BlockActions = {
402
- setBlockKeyForDevice,
403
- clearBlockKeyForDevice,
404
- wrapInline,
405
- unwrapInline
406
- };
407
- const ListActions = {
408
- unwrapList,
409
- wrapList,
410
- indent,
411
- dedent,
412
- toggleList
413
- };
414
- function onKeyDown(e, editor) {
415
- if (!editor.selection || Array.from(slate.Editor.nodes(editor, {
416
- match: (node) => ElementUtils.isListItem(node)
417
- })).length === 0)
418
- return;
419
- if (isHotkey__default["default"]("shift+tab", e)) {
420
- e.preventDefault();
421
- ListActions.dedent(editor);
422
- }
423
- if (isHotkey__default["default"]("tab", e)) {
424
- e.preventDefault();
425
- ListActions.indent(editor);
426
- }
427
- if (isHotkey__default["default"]("backspace", e)) {
428
- if (!editor.selection)
429
- return;
430
- if (slate.Range.isExpanded(editor.selection))
431
- return;
432
- const listItem = EditorUtils.getFirstAncestorListItem(editor, editor.selection.anchor.path);
433
- if (editor.selection.anchor.offset === 0 && listItem) {
434
- e.preventDefault();
435
- const parentListItem = EditorUtils.getFirstAncestorListItem(editor, listItem[1]);
436
- const list = EditorUtils.getFirstAncestorList(editor, listItem[1]);
437
- if (parentListItem) {
438
- ListActions.dedent(editor);
439
- } else if (list) {
440
- ListActions.unwrapList(editor);
441
- }
442
- return;
443
- }
444
- }
445
- if (isHotkey__default["default"]("enter", e)) {
446
- e.preventDefault();
447
- if (!editor.selection)
448
- return;
449
- if (slate.Range.isExpanded(editor.selection)) {
450
- slate.Transforms.delete(editor);
451
- return;
452
- }
453
- const listItem = EditorUtils.getFirstAncestorListItem(editor, editor.selection.anchor.path);
454
- if (editor.selection.anchor.offset === 0 && listItem && slate.Editor.string(editor, listItem[1]) === "") {
455
- const parentListItem = EditorUtils.getFirstAncestorListItem(editor, listItem[1]);
456
- if (parentListItem) {
457
- ListActions.dedent(editor);
458
- } else {
459
- ListActions.unwrapList(editor);
460
- }
461
- return;
462
- }
463
- slate.Transforms.splitNodes(editor, {
464
- at: editor.selection,
465
- always: true,
466
- match: (node) => ElementUtils.isListItem(node)
467
- });
468
- }
469
- if (isHotkey__default["default"]("shift+enter", e)) {
470
- e.preventDefault();
471
- editor.insertText("\n");
472
- }
473
- }
474
- function withBlock(editor) {
475
- const {
476
- normalizeNode
477
- } = editor;
478
- editor.isInline = (entry) => {
479
- return ElementUtils.isInline(entry);
480
- };
481
- editor.normalizeNode = (entry) => {
482
- var _a;
483
- const [normalizationNode, normalizationPath] = entry;
484
- if (ElementUtils.isBlock(normalizationNode) && ((_a = normalizationNode == null ? void 0 : normalizationNode.textAlign) == null ? void 0 : _a.length) == 0) {
485
- slate.Transforms.unsetNodes(editor, "textAlign", {
486
- at: normalizationPath
487
- });
488
- return;
489
- }
490
- if (ElementUtils.isListItem(normalizationNode)) {
491
- const pathToListItemText = [...normalizationPath, LIST_ITEM_CHILD_POSITION];
492
- if (slate.Node.has(editor, pathToListItemText)) {
493
- const nodeInListItemTextPosition = slate.Node.get(editor, pathToListItemText);
494
- if (ElementUtils.isRootBlock(nodeInListItemTextPosition)) {
495
- slate.Transforms.setNodes(editor, {
496
- type: reactPage.BlockType.ListItemChild
497
- }, {
498
- at: pathToListItemText
499
- });
500
- return;
501
- }
502
- } else {
503
- slate.Transforms.insertNodes(editor, ElementUtils.createListItem(), {
504
- at: pathToListItemText
505
- });
506
- return;
507
- }
508
- }
509
- if (!slate.Text.isText(normalizationNode)) {
510
- const mergeableChildren = Array.from(slate.Node.children(editor, normalizationPath)).map((child, index, children) => {
511
- const potentialNodeToBeMerged = children.at(index + 1);
512
- if (!potentialNodeToBeMerged || !ElementUtils.isList(potentialNodeToBeMerged[0]) || !ElementUtils.isList(child[0]) || potentialNodeToBeMerged[0].type !== child[0].type) {
513
- return null;
514
- }
515
- return [slate.Editor.pathRef(editor, child[1]), slate.Editor.pathRef(editor, potentialNodeToBeMerged[1])];
516
- }).filter((mergeableNodes) => Boolean(mergeableNodes));
517
- if (mergeableChildren.length !== 0) {
518
- mergeableChildren.reverse().forEach(([nodePathRef, nodeToBeMergedPathRef]) => {
519
- const nodePath = nodePathRef.current;
520
- const nodeToBeMergedPath = nodeToBeMergedPathRef.current;
521
- if (nodePath == null || nodeToBeMergedPath == null)
522
- return;
523
- const nodeChildren = Array.from(slate.Node.children(editor, nodePath));
524
- const childrenToBeMerged = Array.from(slate.Node.children(editor, nodeToBeMergedPath));
525
- slate.Editor.withoutNormalizing(editor, () => {
526
- childrenToBeMerged.reverse().forEach(([_, childPath]) => {
527
- slate.Transforms.moveNodes(editor, {
528
- at: childPath,
529
- to: [...nodePath, nodeChildren.length]
530
- });
531
- });
532
- slate.Transforms.removeNodes(editor, {
533
- at: nodeToBeMergedPath
534
- });
535
- });
536
- nodePathRef.unref();
537
- nodeToBeMergedPathRef.unref();
538
- });
539
- return;
540
- }
541
- }
542
- normalizeNode(entry);
543
- };
544
- return editor;
545
- }
546
- const definition = textInput.Select({
547
- label: "Block",
548
- labelOrientation: "horizontal",
549
- options: [{
550
- value: reactPage.BlockType.Paragraph,
551
- label: "Paragraph"
552
- }, {
553
- value: reactPage.BlockType.Heading1,
554
- label: "Heading 1"
555
- }, {
556
- value: reactPage.BlockType.Heading2,
557
- label: "Heading 2"
558
- }, {
559
- value: reactPage.BlockType.Heading3,
560
- label: "Heading 3"
561
- }, {
562
- value: reactPage.BlockType.Heading4,
563
- label: "Heading 4"
564
- }, {
565
- value: reactPage.BlockType.Heading5,
566
- label: "Heading 5"
567
- }, {
568
- value: reactPage.BlockType.Heading6,
569
- label: "Heading 6"
570
- }, {
571
- value: reactPage.BlockType.UnorderedList,
572
- label: "Bulleted list"
573
- }, {
574
- value: reactPage.BlockType.OrderedList,
575
- label: "Numbered list"
576
- }, {
577
- value: reactPage.BlockType.BlockQuote,
578
- label: "Quote"
579
- }],
580
- defaultValue: reactPage.BlockType.Paragraph
581
- });
582
- function BlockPlugin() {
583
- return reactPage.createRichTextV2Plugin({
584
- withPlugin: withBlock,
585
- onKeyDown,
586
- control: {
587
- definition,
588
- onChange: (editor, value) => {
589
- const activeBlockType = getActiveBlockType(editor);
590
- if (value === reactPage.BlockType.UnorderedList || value === reactPage.BlockType.OrderedList) {
591
- ListActions.toggleList(editor, {
592
- type: value,
593
- at: getSelection(editor)
594
- });
595
- } else if (activeBlockType === value) {
596
- slate.Transforms.setNodes(editor, {
597
- type: reactPage.BlockType.Default
598
- }, {
599
- at: getSelection(editor)
600
- });
601
- } else {
602
- ListActions.unwrapList(editor, {
603
- at: getSelection(editor)
604
- });
605
- slate.Transforms.setNodes(editor, {
606
- type: value != null ? value : reactPage.BlockType.Default
607
- }, {
608
- at: getSelection(editor)
609
- });
610
- }
611
- },
612
- getValue: (editor) => {
613
- const activeBlock = getActiveBlockType(editor);
614
- if (activeBlock === reactPage.RootBlockType.Text || activeBlock === reactPage.RootBlockType.Default)
615
- return void 0;
616
- return activeBlock;
617
- }
618
- },
619
- renderElement: (renderElement) => (props) => /* @__PURE__ */ jsxRuntime.jsx(BlockPluginComponent, __spreadProps(__spreadValues({}, props), {
620
- renderElement
621
- }))
622
- });
623
- }
624
- function BlockPluginComponent(_a) {
625
- var _b = _a, {
626
- renderElement
627
- } = _b, props = __objRest(_b, [
628
- "renderElement"
629
- ]);
630
- const blockStyles = [reactPage.useStyle({
631
- margin: 0
632
- }), props.element.className];
633
- const quoteStyles = reactPage.useStyle({
634
- padding: "0.5em 10px",
635
- fontSize: "1.25em",
636
- fontWeight: "300",
637
- borderLeft: "5px solid rgba(0, 0, 0, 0.1)"
638
- });
639
- const unorderedListStyles = reactPage.useStyle({
640
- listStylePosition: "inside",
641
- paddingInlineStart: "20px",
642
- listStyleType: "disc",
643
- ul: {
644
- listStyleType: "circle"
645
- },
646
- "ul ul": {
647
- listStyleType: "square"
648
- }
649
- });
650
- const orderedListStyles = reactPage.useStyle({
651
- listStylePosition: "inside",
652
- paddingInlineStart: "20px",
653
- listStyleType: "decimal"
654
- });
655
- switch (props.element.type) {
656
- case reactPage.BlockType.Text:
657
- return /* @__PURE__ */ jsxRuntime.jsx("span", __spreadProps(__spreadValues({}, props.attributes), {
658
- className: css.cx(...blockStyles),
659
- children: renderElement(props)
660
- }));
661
- case reactPage.BlockType.Default:
662
- case reactPage.BlockType.Paragraph:
663
- return /* @__PURE__ */ jsxRuntime.jsx("p", __spreadProps(__spreadValues({}, props.attributes), {
664
- className: css.cx(...blockStyles),
665
- children: renderElement(props)
666
- }));
667
- case reactPage.BlockType.Heading1:
668
- return /* @__PURE__ */ jsxRuntime.jsx("h1", __spreadProps(__spreadValues({}, props.attributes), {
669
- className: css.cx(...blockStyles),
670
- children: renderElement(props)
671
- }));
672
- case reactPage.BlockType.Heading2:
673
- return /* @__PURE__ */ jsxRuntime.jsx("h2", __spreadProps(__spreadValues({}, props.attributes), {
674
- className: css.cx(...blockStyles),
675
- children: renderElement(props)
676
- }));
677
- case reactPage.BlockType.Heading3:
678
- return /* @__PURE__ */ jsxRuntime.jsx("h3", __spreadProps(__spreadValues({}, props.attributes), {
679
- className: css.cx(...blockStyles),
680
- children: renderElement(props)
681
- }));
682
- case reactPage.BlockType.Heading4:
683
- return /* @__PURE__ */ jsxRuntime.jsx("h4", __spreadProps(__spreadValues({}, props.attributes), {
684
- className: css.cx(...blockStyles),
685
- children: renderElement(props)
686
- }));
687
- case reactPage.BlockType.Heading5:
688
- return /* @__PURE__ */ jsxRuntime.jsx("h5", __spreadProps(__spreadValues({}, props.attributes), {
689
- className: css.cx(...blockStyles),
690
- children: renderElement(props)
691
- }));
692
- case reactPage.BlockType.Heading6:
693
- return /* @__PURE__ */ jsxRuntime.jsx("h6", __spreadProps(__spreadValues({}, props.attributes), {
694
- className: css.cx(...blockStyles),
695
- children: renderElement(props)
696
- }));
697
- case reactPage.BlockType.BlockQuote:
698
- return /* @__PURE__ */ jsxRuntime.jsx("blockquote", __spreadProps(__spreadValues({}, props.attributes), {
699
- className: css.cx(...blockStyles, quoteStyles),
700
- children: renderElement(props)
701
- }));
702
- case reactPage.BlockType.OrderedList:
703
- return /* @__PURE__ */ jsxRuntime.jsx("ol", __spreadProps(__spreadValues({}, props.attributes), {
704
- className: css.cx(...blockStyles, orderedListStyles),
705
- children: renderElement(props)
706
- }));
707
- case reactPage.BlockType.UnorderedList:
708
- return /* @__PURE__ */ jsxRuntime.jsx("ul", __spreadProps(__spreadValues({}, props.attributes), {
709
- className: css.cx(...blockStyles, unorderedListStyles),
710
- children: renderElement(props)
711
- }));
712
- case reactPage.BlockType.ListItem:
713
- return /* @__PURE__ */ jsxRuntime.jsx("li", __spreadProps(__spreadValues({}, props.attributes), {
714
- className: css.cx(...blockStyles),
715
- children: renderElement(props)
716
- }));
717
- case reactPage.BlockType.ListItemChild:
718
- return /* @__PURE__ */ jsxRuntime.jsx("span", __spreadProps(__spreadValues({}, props.attributes), {
719
- className: css.cx(...blockStyles),
720
- children: renderElement(props)
721
- }));
722
- default:
723
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {
724
- children: renderElement(props)
725
- });
726
- }
727
- }
728
- const supportedInlineOptions = [
729
- {
730
- icon: textInput.unstable_IconRadioGroupIcon.Superscript,
731
- label: "Superscript",
732
- value: "superscript"
733
- },
734
- {
735
- icon: textInput.unstable_IconRadioGroupIcon.Subscript,
736
- label: "Subscript",
737
- value: "subscript"
738
- },
739
- {
740
- icon: textInput.unstable_IconRadioGroupIcon.Code,
741
- label: "Code",
742
- value: "code"
743
- }
744
- ];
745
- function isSupportedInlineType(inline) {
746
- return supportedInlineOptions.findIndex((option) => option.value === inline) !== -1;
747
- }
748
- function isSupportedInlineEntry(entry) {
749
- const node = entry[0];
750
- return ElementUtils.isInline(node) && supportedInlineOptions.findIndex((option) => option.value === node.type) !== -1;
751
- }
752
- exports.BlockActions = BlockActions;
753
- exports.BlockPlugin = BlockPlugin;
754
- exports.ElementUtils = ElementUtils;
755
- exports.ListActions = ListActions;
756
- exports.filterForSubtreeRoots = filterForSubtreeRoots;
757
- exports.getSelection = getSelection;
758
- exports.isSupportedInlineEntry = isSupportedInlineEntry;
759
- exports.isSupportedInlineType = isSupportedInlineType;
760
- exports.onKeyDown = onKeyDown;
761
- exports.supportedInlineOptions = supportedInlineOptions;
762
- exports.unwrapInline = unwrapInline;
763
- exports.withBlock = withBlock;
764
- exports.wrapInline = wrapInline;
765
- //# sourceMappingURL=types.cjs2.js.map