reactjs-tiptap-editor 1.0.16 → 1.0.18

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 (263) hide show
  1. package/lib/{ActionMenuButton-a8LhmHXe.js → ActionMenuButton-BOjCHFTA.js} +12 -16
  2. package/lib/ActionMenuButton-Df077oOH.cjs +1 -0
  3. package/lib/Attachment.cjs +2 -2
  4. package/lib/Attachment.js +47 -89
  5. package/lib/Blockquote.cjs +2 -2
  6. package/lib/Blockquote.js +11 -14
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +13 -16
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +15 -18
  11. package/lib/Callout.cjs +1 -1
  12. package/lib/Callout.js +113 -113
  13. package/lib/Clear.cjs +1 -1
  14. package/lib/Clear.js +12 -14
  15. package/lib/Code.cjs +1 -1
  16. package/lib/Code.js +8 -11
  17. package/lib/CodeBlock.cjs +37 -37
  18. package/lib/CodeBlock.js +1566 -1613
  19. package/lib/CodeView.cjs +1 -1
  20. package/lib/CodeView.js +9 -11
  21. package/lib/Color.cjs +1 -1
  22. package/lib/Color.js +62 -82
  23. package/lib/Column.cjs +1 -1
  24. package/lib/Column.js +27 -15
  25. package/lib/Drawer-DwrlY_lY.cjs +1 -0
  26. package/lib/Drawer-DxOoRiGQ.js +1099 -0
  27. package/lib/Drawer.cjs +1 -1
  28. package/lib/Drawer.js +6 -5
  29. package/lib/Emoji.cjs +1 -1
  30. package/lib/Emoji.js +71 -97
  31. package/lib/Excalidraw.cjs +1 -1
  32. package/lib/Excalidraw.js +265 -5
  33. package/lib/ExportPdf.cjs +4 -4
  34. package/lib/ExportPdf.js +20 -31
  35. package/lib/ExportWord.cjs +1 -1
  36. package/lib/ExportWord.js +11 -11
  37. package/lib/FontFamily.cjs +1 -1
  38. package/lib/FontFamily.js +16 -39
  39. package/lib/FontSize.cjs +1 -1
  40. package/lib/FontSize.js +25 -41
  41. package/lib/Heading.cjs +1 -1
  42. package/lib/Heading.js +51 -65
  43. package/lib/Highlight.cjs +1 -1
  44. package/lib/Highlight.js +60 -76
  45. package/lib/History.cjs +1 -1
  46. package/lib/History.js +322 -320
  47. package/lib/HorizontalRule.cjs +1 -1
  48. package/lib/HorizontalRule.js +8 -11
  49. package/lib/{Iframe-CmjbQQcz.js → Iframe-AhNV5WH5.js} +52 -65
  50. package/lib/Iframe-C6pBw-AF.cjs +1 -0
  51. package/lib/Iframe.cjs +1 -1
  52. package/lib/Iframe.js +5 -4
  53. package/lib/Image.cjs +1 -1
  54. package/lib/Image.js +5 -5
  55. package/lib/ImageGif.cjs +1 -1
  56. package/lib/ImageGif.js +148 -181
  57. package/lib/ImportWord.cjs +1 -1
  58. package/lib/ImportWord.js +19 -26
  59. package/lib/{Indent-BoG-vpIE.js → Indent-DZ5PcJA4.js} +24 -30
  60. package/lib/Indent-Do-X0AsY.cjs +1 -0
  61. package/lib/Indent.cjs +1 -1
  62. package/lib/Indent.js +2 -2
  63. package/lib/Italic.cjs +1 -1
  64. package/lib/Italic.js +11 -14
  65. package/lib/Katex-CIC9ygbL.cjs +4 -0
  66. package/lib/{Katex-ByL9snce.js → Katex-bIgoenn_.js} +243 -262
  67. package/lib/Katex.cjs +1 -1
  68. package/lib/Katex.js +5 -4
  69. package/lib/LineHeight.cjs +1 -1
  70. package/lib/LineHeight.js +23 -34
  71. package/lib/Link.cjs +1 -1
  72. package/lib/Link.js +2 -2
  73. package/lib/LinkEditBlock-B0ZaACZO.cjs +5 -0
  74. package/lib/{LinkEditBlock-Ckih17pU.js → LinkEditBlock-D_cF9fnc.js} +324 -381
  75. package/lib/MarkdownPaste.cjs +58 -0
  76. package/lib/MarkdownPaste.js +1656 -0
  77. package/lib/Mention.cjs +1 -1
  78. package/lib/Mention.js +22 -17
  79. package/lib/Mermaid.cjs +2 -2
  80. package/lib/Mermaid.js +125 -154
  81. package/lib/MoreMark.cjs +1 -1
  82. package/lib/MoreMark.js +28 -40
  83. package/lib/OrderedList.cjs +1 -1
  84. package/lib/OrderedList.js +13 -16
  85. package/lib/SearchAndReplace.cjs +1 -1
  86. package/lib/SearchAndReplace.js +114 -186
  87. package/lib/SlashCommand.cjs +1 -1
  88. package/lib/SlashCommand.js +15 -14
  89. package/lib/SlashCommandNodeView-Ba03hlVZ.cjs +1 -0
  90. package/lib/{SlashCommandNodeView-B2g1MbgN.js → SlashCommandNodeView-cg0x3NRF.js} +72 -79
  91. package/lib/Strike.cjs +1 -1
  92. package/lib/Strike.js +12 -15
  93. package/lib/{Table-BEwrZVup.js → Table-KqLiT5wG.js} +85 -125
  94. package/lib/Table-ddU2LSc6.cjs +9 -0
  95. package/lib/Table.cjs +1 -1
  96. package/lib/Table.js +1 -1
  97. package/lib/TaskList.cjs +1 -1
  98. package/lib/TaskList.js +18 -21
  99. package/lib/TextAlign.cjs +1 -1
  100. package/lib/TextAlign.js +65 -78
  101. package/lib/TextDirection.cjs +1 -1
  102. package/lib/TextDirection.js +51 -77
  103. package/lib/TextUnderline.cjs +1 -1
  104. package/lib/TextUnderline.js +7 -10
  105. package/lib/Twitter-BIiR78Jh.cjs +1 -0
  106. package/lib/{Twitter-4U_ZBhpv.js → Twitter-C1Lzqc7u.js} +567 -599
  107. package/lib/Twitter.cjs +1 -1
  108. package/lib/Twitter.js +4 -3
  109. package/lib/Video.cjs +1 -1
  110. package/lib/Video.js +5 -270
  111. package/lib/bubble.cjs +6 -4
  112. package/lib/bubble.js +3719 -3039
  113. package/lib/clsx-BWE7vnna.cjs +33 -0
  114. package/lib/clsx-eGVyq7ot.js +1062 -0
  115. package/lib/components/ActionButton.d.ts +2 -2
  116. package/lib/components/ActionMenuButton.d.ts +1 -1
  117. package/lib/components/Bubble/formatBubble.d.ts +5 -5
  118. package/lib/components/ReactBus.d.ts +11 -0
  119. package/lib/components/SlashDialogTrigger/RenderDialogUploadImage.d.ts +1 -0
  120. package/lib/components/SlashDialogTrigger/RenderDialogUploadVideo.d.ts +1 -0
  121. package/lib/components/SlashDialogTrigger/SlashDialogTrigger.d.ts +5 -0
  122. package/lib/components/ui/checkbox.d.ts +1 -1
  123. package/lib/components/ui/dialog.d.ts +1 -1
  124. package/lib/components/ui/dropdown-menu.d.ts +1 -1
  125. package/lib/components/ui/emoji-picker.d.ts +1 -1
  126. package/lib/components/ui/label.d.ts +1 -1
  127. package/lib/components/ui/popover.d.ts +1 -1
  128. package/lib/components/ui/select.d.ts +1 -1
  129. package/lib/components/ui/separator.d.ts +1 -1
  130. package/lib/components/ui/switch.d.ts +1 -1
  131. package/lib/components/ui/tabs.d.ts +1 -1
  132. package/lib/components/ui/toast.d.ts +1 -1
  133. package/lib/components/ui/toggle.d.ts +1 -1
  134. package/lib/components/ui/tooltip.d.ts +1 -1
  135. package/lib/{delete-node-IyVmiRbI.js → delete-node-eQHsyyhR.js} +3 -1
  136. package/lib/{dropdown-menu-CW3Kthwy.js → dropdown-menu-CexIkt_V.js} +8 -8
  137. package/lib/{dropdown-menu-eUeBXQeA.cjs → dropdown-menu-oSKIntXM.cjs} +1 -1
  138. package/lib/extensions/Blockquote/Blockquote.d.ts +1 -1
  139. package/lib/extensions/Bold/Bold.d.ts +1 -1
  140. package/lib/extensions/Code/Code.d.ts +1 -1
  141. package/lib/extensions/CodeView/CodeView.d.ts +2 -2
  142. package/lib/extensions/Heading/Heading.d.ts +1 -1
  143. package/lib/extensions/Highlight/Highlight.d.ts +1 -1
  144. package/lib/extensions/HorizontalRule/HorizontalRule.d.ts +1 -1
  145. package/lib/extensions/ImportWord/ImportWord.d.ts +2 -2
  146. package/lib/extensions/Italic/Italic.d.ts +1 -1
  147. package/lib/extensions/Link/Link.d.ts +1 -1
  148. package/lib/extensions/MarkdownPaste/MarkdownPaste.d.ts +5 -0
  149. package/lib/extensions/MarkdownPaste/index.d.ts +1 -0
  150. package/lib/extensions/Mermaid/Mermaid.d.ts +1 -1
  151. package/lib/extensions/MoreMark/MoreMark.d.ts +1 -1
  152. package/lib/extensions/Strike/Strike.d.ts +1 -1
  153. package/lib/extensions/Table/Table.d.ts +1 -1
  154. package/lib/extensions/TextAlign/TextAlign.d.ts +1 -1
  155. package/lib/extensions/TextUnderline/TextUnderline.d.ts +1 -1
  156. package/lib/index-BUTn2LY6.cjs +1 -0
  157. package/lib/{index-C07N8gA1.js → index-BlXGgvT-.js} +21 -18
  158. package/lib/{index-CpTykZBR.js → index-BnW6t8z6.js} +23 -23
  159. package/lib/{index-BsFvo9PG.cjs → index-BqL4vAWE.cjs} +1 -1
  160. package/lib/index-BtxvYLJ1.cjs +12 -0
  161. package/lib/{index-DR5tIdL7.js → index-C6xmkxrQ.js} +232 -217
  162. package/lib/index-CJ9pyCM4.cjs +1 -0
  163. package/lib/{index-neeeY2o7.cjs → index-D0lc95kr.cjs} +3 -3
  164. package/lib/index-DHUN85fV.js +4855 -0
  165. package/lib/index-DUpSE1Gb.cjs +1 -0
  166. package/lib/index-D_8P0LE5.js +1362 -0
  167. package/lib/{index-4bHF5ovf.js → index-RIXs7STX.js} +1 -1
  168. package/lib/index-mfGK4pFo.js +6469 -0
  169. package/lib/index-zig3Dj7A.cjs +22 -0
  170. package/lib/index.cjs +3 -3
  171. package/lib/index.js +60 -72
  172. package/lib/locale-bundle.cjs +1 -1
  173. package/lib/locale-bundle.js +1 -1
  174. package/lib/plugins/image-upload.d.ts +1 -1
  175. package/lib/popover-BYSZ3zBi.js +24 -0
  176. package/lib/popover-BcHDZqBt.cjs +1 -0
  177. package/lib/{renderNodeView-CSazLrKF.js → renderNodeView-BrM5kUj_.js} +2 -2
  178. package/lib/{renderNodeView-DfLmGrgA.cjs → renderNodeView-D1zydtli.cjs} +1 -1
  179. package/lib/{select-F0ZZ3VZB.js → select-C5SHDLFj.js} +8 -5
  180. package/lib/{select-Doa_-jkZ.cjs → select-DHjzKkcu.cjs} +1 -1
  181. package/lib/separator-BmixLrnJ.cjs +1 -0
  182. package/lib/separator-CFKVxAea.js +293 -0
  183. package/lib/store/editor.d.ts +1 -1
  184. package/lib/store/store.d.ts +2 -22
  185. package/lib/style.css +1 -1
  186. package/lib/{textarea-BAolHF_W.cjs → textarea-CasDcv3u.cjs} +1 -1
  187. package/lib/{textarea-tOsPnxHf.js → textarea-DNLrJoRl.js} +1 -1
  188. package/lib/theme.js +1 -1
  189. package/lib/types.d.ts +3 -3
  190. package/lib/updatePosition-CBRjbQMH.js +16 -0
  191. package/lib/updatePosition-CfmY5Trk.cjs +1 -0
  192. package/lib/utils/checkIsVideoUrl.d.ts +1 -0
  193. package/lib/utils/columns.d.ts +1 -1
  194. package/lib/utils/customEvents/events.constant.d.ts +1 -0
  195. package/lib/utils/mitt.d.ts +6 -3
  196. package/lib/utils/pdf.d.ts +1 -1
  197. package/lib/utils/utils.d.ts +1 -1
  198. package/package.json +262 -247
  199. package/lib/ActionMenuButton-BYu0NyVo.cjs +0 -1
  200. package/lib/Drawer-CbOJ1Igo.js +0 -1379
  201. package/lib/Drawer-DNaDMoAk.cjs +0 -1
  202. package/lib/Excalidraw-DnHTVOj8.js +0 -355
  203. package/lib/Excalidraw-DxfO1lQ_.cjs +0 -1
  204. package/lib/Icon-C0TJMAOm.js +0 -12
  205. package/lib/Icon-DzK0_ztP.cjs +0 -1
  206. package/lib/Iframe-BSNCsofW.cjs +0 -1
  207. package/lib/Image-BZEFuS0P.js +0 -925
  208. package/lib/Image-iKsGKjvg.cjs +0 -1
  209. package/lib/Indent-Bou16OcB.cjs +0 -1
  210. package/lib/Katex-BqDocr3a.cjs +0 -4
  211. package/lib/LinkEditBlock-B0I0EUrt.cjs +0 -5
  212. package/lib/SlashCommandNodeView-BEJhEzba.cjs +0 -1
  213. package/lib/Table-BclWwp6P.cjs +0 -9
  214. package/lib/Twitter-Dtq6PEMC.cjs +0 -1
  215. package/lib/button-Bwn6gUuS.js +0 -43
  216. package/lib/button-CqJztfH2.cjs +0 -1
  217. package/lib/checkbox-BAzbZY2Y.cjs +0 -1
  218. package/lib/checkbox-B_rpz5Xq.js +0 -27
  219. package/lib/clsx-CXbNJWDD.cjs +0 -54
  220. package/lib/clsx-DSzxBzvL.js +0 -7391
  221. package/lib/dialog-CJvpoeMm.js +0 -101
  222. package/lib/dialog-CWYTvz5J.cjs +0 -1
  223. package/lib/events.constant-Dq21NPdV.cjs +0 -1
  224. package/lib/events.constant-do95b767.js +0 -21
  225. package/lib/extensions/Image/store.d.ts +0 -4
  226. package/lib/extensions/Video/store.d.ts +0 -4
  227. package/lib/file-BLas99n7.js +0 -43
  228. package/lib/file-i7e4nQY2.cjs +0 -1
  229. package/lib/index-BCzvbrf5.cjs +0 -12
  230. package/lib/index-CL7JP-Xz.js +0 -426
  231. package/lib/index-CjhjjJsN.cjs +0 -1
  232. package/lib/index-Cn-t3Zxw.cjs +0 -1
  233. package/lib/index-Cs6cp0Y6.cjs +0 -1
  234. package/lib/index-D8li6EQ4.js +0 -1351
  235. package/lib/index-DoiuU6VA.js +0 -2315
  236. package/lib/index-VhKd73hZ.cjs +0 -1
  237. package/lib/input-B1egKb-t.js +0 -21
  238. package/lib/input-ZGRt7lWR.cjs +0 -1
  239. package/lib/isNumber-BTYSVlKo.cjs +0 -1
  240. package/lib/isNumber-ClwLypY2.js +0 -15
  241. package/lib/label-Cjrzc5H2.js +0 -19
  242. package/lib/label-tzSPdqui.cjs +0 -1
  243. package/lib/popover-C6Cya3Cz.cjs +0 -1
  244. package/lib/popover-CeY3RbI5.js +0 -24
  245. package/lib/separator-CUh5Y7Rh.cjs +0 -1
  246. package/lib/separator-Cjn4YH8a.js +0 -329
  247. package/lib/store/fast-context.d.ts +0 -7
  248. package/lib/store-BsJz5QRC.js +0 -10
  249. package/lib/store-DjkMIIEN.cjs +0 -1
  250. package/lib/tabs-BP8ypR_m.cjs +0 -1
  251. package/lib/tabs-CBDjOLl_.js +0 -46
  252. package/lib/throttle-D040PfWL.js +0 -249
  253. package/lib/throttle-gTTvqDTW.cjs +0 -1
  254. package/lib/toggle-C_SSvDRy.cjs +0 -1
  255. package/lib/toggle-DEerYRil.js +0 -99
  256. package/lib/tooltip-BJIvosho.js +0 -24
  257. package/lib/tooltip-FS1rsvd3.cjs +0 -1
  258. package/lib/updatePosition-CDK7OR0i.js +0 -16
  259. package/lib/updatePosition-Cjuj2E26.cjs +0 -1
  260. package/lib/useButtonProps-CtZCbMQu.js +0 -136
  261. package/lib/useButtonProps-Cz4W5dC8.cjs +0 -1
  262. package/lib/utils/_event.d.ts +0 -13
  263. package/lib/utils/customEvents/customEvents.d.ts +0 -3
package/lib/History.js CHANGED
@@ -1,25 +1,22 @@
1
- import { V as N, y as te, F as V, x as _, T as G, v as H, S as A, W, X as ne, E as C, Y as re, Z as ie, _ as oe, q as se } from "./clsx-DSzxBzvL.js";
2
- import { Plugin as I, PluginKey as b } from "@tiptap/pm/state";
3
- import { DecorationSet as O, Decoration as R } from "@tiptap/pm/view";
4
- import { k as le, D as ae, a as de } from "./index-CpTykZBR.js";
5
- import { jsx as T, Fragment as j } from "react/jsx-runtime";
6
- import { A as U } from "./toggle-DEerYRil.js";
1
+ import { K as R, v as ne, F as L, u as G, T as H, s as U, S as T, L as W, O as re, E as C, Q as ie, R as oe, U as se, l as le } from "./index-mfGK4pFo.js";
2
+ import { Plugin as A, PluginKey as I } from "@tiptap/pm/state";
3
+ import { DecorationSet as S, Decoration as N } from "@tiptap/pm/view";
4
+ import { k as ae, D as de, a as ce } from "./index-BnW6t8z6.js";
5
+ import { jsx as O, Fragment as j } from "react/jsx-runtime";
6
+ import { u as X, e as Y, A as Z, i as ue } from "./index-DHUN85fV.js";
7
7
  import "react";
8
- import "./index-DoiuU6VA.js";
9
8
  import "./theme.js";
10
- import { u as X, b as Y } from "./useButtonProps-CtZCbMQu.js";
11
- import { i as ce } from "./index-CL7JP-Xz.js";
12
- function ue(i = {}) {
13
- return new N({
9
+ function pe(n = {}) {
10
+ return new R({
14
11
  view(e) {
15
- return new pe(e, i);
12
+ return new he(e, n);
16
13
  }
17
14
  });
18
15
  }
19
- class pe {
16
+ class he {
20
17
  constructor(e, t) {
21
- var n;
22
- this.editorView = e, this.cursorPos = null, this.element = null, this.timeout = -1, this.width = (n = t.width) !== null && n !== void 0 ? n : 1, this.color = t.color === !1 ? void 0 : t.color || "black", this.class = t.class, this.handlers = ["dragover", "dragend", "drop", "dragleave"].map((r) => {
18
+ var i;
19
+ this.editorView = e, this.cursorPos = null, this.element = null, this.timeout = -1, this.width = (i = t.width) !== null && i !== void 0 ? i : 1, this.color = t.color === !1 ? void 0 : t.color || "black", this.class = t.class, this.handlers = ["dragover", "dragend", "drop", "dragleave"].map((r) => {
23
20
  let o = (s) => {
24
21
  this[r](s);
25
22
  };
@@ -36,22 +33,22 @@ class pe {
36
33
  e != this.cursorPos && (this.cursorPos = e, e == null ? (this.element.parentNode.removeChild(this.element), this.element = null) : this.updateOverlay());
37
34
  }
38
35
  updateOverlay() {
39
- let e = this.editorView.state.doc.resolve(this.cursorPos), t = !e.parent.inlineContent, n, r = this.editorView.dom, o = r.getBoundingClientRect(), s = o.width / r.offsetWidth, l = o.height / r.offsetHeight;
36
+ let e = this.editorView.state.doc.resolve(this.cursorPos), t = !e.parent.inlineContent, i, r = this.editorView.dom, o = r.getBoundingClientRect(), s = o.width / r.offsetWidth, l = o.height / r.offsetHeight;
40
37
  if (t) {
41
38
  let c = e.nodeBefore, p = e.nodeAfter;
42
39
  if (c || p) {
43
- let h = this.editorView.nodeDOM(this.cursorPos - (c ? c.nodeSize : 0));
44
- if (h) {
45
- let g = h.getBoundingClientRect(), M = c ? g.bottom : g.top;
46
- c && p && (M = (M + this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top) / 2);
40
+ let f = this.editorView.nodeDOM(this.cursorPos - (c ? c.nodeSize : 0));
41
+ if (f) {
42
+ let g = f.getBoundingClientRect(), b = c ? g.bottom : g.top;
43
+ c && p && (b = (b + this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top) / 2);
47
44
  let P = this.width / 2 * l;
48
- n = { left: g.left, right: g.right, top: M - P, bottom: M + P };
45
+ i = { left: g.left, right: g.right, top: b - P, bottom: b + P };
49
46
  }
50
47
  }
51
48
  }
52
- if (!n) {
49
+ if (!i) {
53
50
  let c = this.editorView.coordsAtPos(this.cursorPos), p = this.width / 2 * s;
54
- n = { left: c.left - p, right: c.left + p, top: c.top, bottom: c.bottom };
51
+ i = { left: c.left - p, right: c.left + p, top: c.top, bottom: c.bottom };
55
52
  }
56
53
  let a = this.editorView.dom.offsetParent;
57
54
  this.element || (this.element = a.appendChild(document.createElement("div")), this.class && (this.element.className = this.class), this.element.style.cssText = "position: absolute; z-index: 50; pointer-events: none;", this.color && (this.element.style.backgroundColor = this.color)), this.element.classList.toggle("prosemirror-dropcursor-block", t), this.element.classList.toggle("prosemirror-dropcursor-inline", !t);
@@ -59,10 +56,10 @@ class pe {
59
56
  if (!a || a == document.body && getComputedStyle(a).position == "static")
60
57
  d = -pageXOffset, u = -pageYOffset;
61
58
  else {
62
- let c = a.getBoundingClientRect(), p = c.width / a.offsetWidth, h = c.height / a.offsetHeight;
63
- d = c.left - a.scrollLeft * p, u = c.top - a.scrollTop * h;
59
+ let c = a.getBoundingClientRect(), p = c.width / a.offsetWidth, f = c.height / a.offsetHeight;
60
+ d = c.left - a.scrollLeft * p, u = c.top - a.scrollTop * f;
64
61
  }
65
- this.element.style.left = (n.left - d) / s + "px", this.element.style.top = (n.top - u) / l + "px", this.element.style.width = (n.right - n.left) / s + "px", this.element.style.height = (n.bottom - n.top) / l + "px";
62
+ this.element.style.left = (i.left - d) / s + "px", this.element.style.top = (i.top - u) / l + "px", this.element.style.width = (i.right - i.left) / s + "px", this.element.style.height = (i.bottom - i.top) / l + "px";
66
63
  }
67
64
  scheduleRemoval(e) {
68
65
  clearTimeout(this.timeout), this.timeout = setTimeout(() => this.setCursor(null), e);
@@ -70,11 +67,11 @@ class pe {
70
67
  dragover(e) {
71
68
  if (!this.editorView.editable)
72
69
  return;
73
- let t = this.editorView.posAtCoords({ left: e.clientX, top: e.clientY }), n = t && t.inside >= 0 && this.editorView.state.doc.nodeAt(t.inside), r = n && n.type.spec.disableDropCursor, o = typeof r == "function" ? r(this.editorView, t, e) : r;
70
+ let t = this.editorView.posAtCoords({ left: e.clientX, top: e.clientY }), i = t && t.inside >= 0 && this.editorView.state.doc.nodeAt(t.inside), r = i && i.type.spec.disableDropCursor, o = typeof r == "function" ? r(this.editorView, t, e) : r;
74
71
  if (t && !o) {
75
72
  let s = t.pos;
76
73
  if (this.editorView.dragging && this.editorView.dragging.slice) {
77
- let l = te(this.editorView.state.doc, s, this.editorView.dragging.slice);
74
+ let l = ne(this.editorView.state.doc, s, this.editorView.dragging.slice);
78
75
  l != null && (s = l);
79
76
  }
80
77
  this.setCursor(s), this.scheduleRemoval(5e3);
@@ -90,7 +87,7 @@ class pe {
90
87
  this.editorView.dom.contains(e.relatedTarget) || this.setCursor(null);
91
88
  }
92
89
  }
93
- class f extends A {
90
+ class h extends T {
94
91
  /**
95
92
  Create a gap cursor.
96
93
  */
@@ -98,14 +95,14 @@ class f extends A {
98
95
  super(e, e);
99
96
  }
100
97
  map(e, t) {
101
- let n = e.resolve(t.map(this.head));
102
- return f.valid(n) ? new f(n) : A.near(n);
98
+ let i = e.resolve(t.map(this.head));
99
+ return h.valid(i) ? new h(i) : T.near(i);
103
100
  }
104
101
  content() {
105
- return _.empty;
102
+ return G.empty;
106
103
  }
107
104
  eq(e) {
108
- return e instanceof f && e.head == this.head;
105
+ return e instanceof h && e.head == this.head;
109
106
  }
110
107
  toJSON() {
111
108
  return { type: "gapcursor", pos: this.head };
@@ -116,7 +113,7 @@ class f extends A {
116
113
  static fromJSON(e, t) {
117
114
  if (typeof t.pos != "number")
118
115
  throw new RangeError("Invalid input for GapCursor.fromJSON");
119
- return new f(e.resolve(t.pos));
116
+ return new h(e.resolve(t.pos));
120
117
  }
121
118
  /**
122
119
  @internal
@@ -129,20 +126,20 @@ class f extends A {
129
126
  */
130
127
  static valid(e) {
131
128
  let t = e.parent;
132
- if (t.isTextblock || !fe(e) || !he(e))
129
+ if (t.inlineContent || !fe(e) || !me(e))
133
130
  return !1;
134
- let n = t.type.spec.allowGapCursor;
135
- if (n != null)
136
- return n;
131
+ let i = t.type.spec.allowGapCursor;
132
+ if (i != null)
133
+ return i;
137
134
  let r = t.contentMatchAt(e.index()).defaultType;
138
135
  return r && r.isTextblock;
139
136
  }
140
137
  /**
141
138
  @internal
142
139
  */
143
- static findGapCursorFrom(e, t, n = !1) {
140
+ static findGapCursorFrom(e, t, i = !1) {
144
141
  e: for (; ; ) {
145
- if (!n && f.valid(e))
142
+ if (!i && h.valid(e))
146
143
  return e;
147
144
  let r = e.pos, o = null;
148
145
  for (let s = e.depth; ; s--) {
@@ -154,30 +151,30 @@ class f extends A {
154
151
  return null;
155
152
  r += t;
156
153
  let a = e.doc.resolve(r);
157
- if (f.valid(a))
154
+ if (h.valid(a))
158
155
  return a;
159
156
  }
160
157
  for (; ; ) {
161
158
  let s = t > 0 ? o.firstChild : o.lastChild;
162
159
  if (!s) {
163
- if (o.isAtom && !o.isText && !H.isSelectable(o)) {
164
- e = e.doc.resolve(r + o.nodeSize * t), n = !1;
160
+ if (o.isAtom && !o.isText && !U.isSelectable(o)) {
161
+ e = e.doc.resolve(r + o.nodeSize * t), i = !1;
165
162
  continue e;
166
163
  }
167
164
  break;
168
165
  }
169
166
  o = s, r += t;
170
167
  let l = e.doc.resolve(r);
171
- if (f.valid(l))
168
+ if (h.valid(l))
172
169
  return l;
173
170
  }
174
171
  return null;
175
172
  }
176
173
  }
177
174
  }
178
- f.prototype.visible = !1;
179
- f.findFrom = f.findGapCursorFrom;
180
- A.jsonID("gapcursor", f);
175
+ h.prototype.visible = !1;
176
+ h.findFrom = h.findGapCursorFrom;
177
+ T.jsonID("gapcursor", h);
181
178
  class F {
182
179
  constructor(e) {
183
180
  this.pos = e;
@@ -187,22 +184,22 @@ class F {
187
184
  }
188
185
  resolve(e) {
189
186
  let t = e.resolve(this.pos);
190
- return f.valid(t) ? new f(t) : A.near(t);
187
+ return h.valid(t) ? new h(t) : T.near(t);
191
188
  }
192
189
  }
193
- function Z(i) {
194
- return i.isAtom || i.spec.isolating || i.spec.createGapCursor;
190
+ function J(n) {
191
+ return n.isAtom || n.spec.isolating || n.spec.createGapCursor;
195
192
  }
196
- function fe(i) {
197
- for (let e = i.depth; e >= 0; e--) {
198
- let t = i.index(e), n = i.node(e);
193
+ function fe(n) {
194
+ for (let e = n.depth; e >= 0; e--) {
195
+ let t = n.index(e), i = n.node(e);
199
196
  if (t == 0) {
200
- if (n.type.spec.isolating)
197
+ if (i.type.spec.isolating)
201
198
  return !0;
202
199
  continue;
203
200
  }
204
- for (let r = n.child(t - 1); ; r = r.lastChild) {
205
- if (r.childCount == 0 && !r.inlineContent || Z(r.type))
201
+ for (let r = i.child(t - 1); ; r = r.lastChild) {
202
+ if (r.childCount == 0 && !r.inlineContent || J(r.type))
206
203
  return !0;
207
204
  if (r.inlineContent)
208
205
  return !1;
@@ -210,16 +207,16 @@ function fe(i) {
210
207
  }
211
208
  return !0;
212
209
  }
213
- function he(i) {
214
- for (let e = i.depth; e >= 0; e--) {
215
- let t = i.indexAfter(e), n = i.node(e);
216
- if (t == n.childCount) {
217
- if (n.type.spec.isolating)
210
+ function me(n) {
211
+ for (let e = n.depth; e >= 0; e--) {
212
+ let t = n.indexAfter(e), i = n.node(e);
213
+ if (t == i.childCount) {
214
+ if (i.type.spec.isolating)
218
215
  return !0;
219
216
  continue;
220
217
  }
221
- for (let r = n.child(t); ; r = r.firstChild) {
222
- if (r.childCount == 0 && !r.inlineContent || Z(r.type))
218
+ for (let r = i.child(t); ; r = r.firstChild) {
219
+ if (r.childCount == 0 && !r.inlineContent || J(r.type))
223
220
  return !0;
224
221
  if (r.inlineContent)
225
222
  return !1;
@@ -227,64 +224,64 @@ function he(i) {
227
224
  }
228
225
  return !0;
229
226
  }
230
- function me() {
231
- return new N({
227
+ function ge() {
228
+ return new R({
232
229
  props: {
233
- decorations: ye,
234
- createSelectionBetween(i, e, t) {
235
- return e.pos == t.pos && f.valid(t) ? new f(t) : null;
230
+ decorations: Ce,
231
+ createSelectionBetween(n, e, t) {
232
+ return e.pos == t.pos && h.valid(t) ? new h(t) : null;
236
233
  },
237
- handleClick: ve,
238
- handleKeyDown: ge,
239
- handleDOMEvents: { beforeinput: we }
234
+ handleClick: we,
235
+ handleKeyDown: ve,
236
+ handleDOMEvents: { beforeinput: ye }
240
237
  }
241
238
  });
242
239
  }
243
- const ge = le({
244
- ArrowLeft: x("horiz", -1),
245
- ArrowRight: x("horiz", 1),
246
- ArrowUp: x("vert", -1),
247
- ArrowDown: x("vert", 1)
240
+ const ve = ae({
241
+ ArrowLeft: M("horiz", -1),
242
+ ArrowRight: M("horiz", 1),
243
+ ArrowUp: M("vert", -1),
244
+ ArrowDown: M("vert", 1)
248
245
  });
249
- function x(i, e) {
250
- const t = i == "vert" ? e > 0 ? "down" : "up" : e > 0 ? "right" : "left";
251
- return function(n, r, o) {
252
- let s = n.selection, l = e > 0 ? s.$to : s.$from, a = s.empty;
253
- if (s instanceof G) {
246
+ function M(n, e) {
247
+ const t = n == "vert" ? e > 0 ? "down" : "up" : e > 0 ? "right" : "left";
248
+ return function(i, r, o) {
249
+ let s = i.selection, l = e > 0 ? s.$to : s.$from, a = s.empty;
250
+ if (s instanceof H) {
254
251
  if (!o.endOfTextblock(t) || l.depth == 0)
255
252
  return !1;
256
- a = !1, l = n.doc.resolve(e > 0 ? l.after() : l.before());
253
+ a = !1, l = i.doc.resolve(e > 0 ? l.after() : l.before());
257
254
  }
258
- let d = f.findGapCursorFrom(l, e, a);
259
- return d ? (r && r(n.tr.setSelection(new f(d))), !0) : !1;
255
+ let d = h.findGapCursorFrom(l, e, a);
256
+ return d ? (r && r(i.tr.setSelection(new h(d))), !0) : !1;
260
257
  };
261
258
  }
262
- function ve(i, e, t) {
263
- if (!i || !i.editable)
259
+ function we(n, e, t) {
260
+ if (!n || !n.editable)
264
261
  return !1;
265
- let n = i.state.doc.resolve(e);
266
- if (!f.valid(n))
262
+ let i = n.state.doc.resolve(e);
263
+ if (!h.valid(i))
267
264
  return !1;
268
- let r = i.posAtCoords({ left: t.clientX, top: t.clientY });
269
- return r && r.inside > -1 && H.isSelectable(i.state.doc.nodeAt(r.inside)) ? !1 : (i.dispatch(i.state.tr.setSelection(new f(n))), !0);
265
+ let r = n.posAtCoords({ left: t.clientX, top: t.clientY });
266
+ return r && r.inside > -1 && U.isSelectable(n.state.doc.nodeAt(r.inside)) ? !1 : (n.dispatch(n.state.tr.setSelection(new h(i))), !0);
270
267
  }
271
- function we(i, e) {
272
- if (e.inputType != "insertCompositionText" || !(i.state.selection instanceof f))
268
+ function ye(n, e) {
269
+ if (e.inputType != "insertCompositionText" || !(n.state.selection instanceof h))
273
270
  return !1;
274
- let { $from: t } = i.state.selection, n = t.parent.contentMatchAt(t.index()).findWrapping(i.state.schema.nodes.text);
275
- if (!n)
271
+ let { $from: t } = n.state.selection, i = t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);
272
+ if (!i)
276
273
  return !1;
277
- let r = V.empty;
278
- for (let s = n.length - 1; s >= 0; s--)
279
- r = V.from(n[s].createAndFill(null, r));
280
- let o = i.state.tr.replace(t.pos, t.pos, new _(r, 0, 0));
281
- return o.setSelection(G.near(o.doc.resolve(t.pos + 1))), i.dispatch(o), !1;
274
+ let r = L.empty;
275
+ for (let s = i.length - 1; s >= 0; s--)
276
+ r = L.from(i[s].createAndFill(null, r));
277
+ let o = n.state.tr.replace(t.pos, t.pos, new G(r, 0, 0));
278
+ return o.setSelection(H.near(o.doc.resolve(t.pos + 1))), n.dispatch(o), !1;
282
279
  }
283
- function ye(i) {
284
- if (!(i.selection instanceof f))
280
+ function Ce(n) {
281
+ if (!(n.selection instanceof h))
285
282
  return null;
286
283
  let e = document.createElement("div");
287
- return e.className = "ProseMirror-gapcursor", ae.create(i.doc, [de.widget(i.selection.head, e, { key: "gapcursor" })]);
284
+ return e.className = "ProseMirror-gapcursor", de.create(n.doc, [ce.widget(n.selection.head, e, { key: "gapcursor" })]);
288
285
  }
289
286
  var D = 200, m = function() {
290
287
  };
@@ -295,7 +292,7 @@ m.prototype.prepend = function(e) {
295
292
  return e.length ? m.from(e).append(this) : this;
296
293
  };
297
294
  m.prototype.appendInner = function(e) {
298
- return new Ce(this, e);
295
+ return new Ee(this, e);
299
296
  };
300
297
  m.prototype.slice = function(e, t) {
301
298
  return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? m.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
@@ -304,24 +301,24 @@ m.prototype.get = function(e) {
304
301
  if (!(e < 0 || e >= this.length))
305
302
  return this.getInner(e);
306
303
  };
307
- m.prototype.forEach = function(e, t, n) {
308
- t === void 0 && (t = 0), n === void 0 && (n = this.length), t <= n ? this.forEachInner(e, t, n, 0) : this.forEachInvertedInner(e, t, n, 0);
304
+ m.prototype.forEach = function(e, t, i) {
305
+ t === void 0 && (t = 0), i === void 0 && (i = this.length), t <= i ? this.forEachInner(e, t, i, 0) : this.forEachInvertedInner(e, t, i, 0);
309
306
  };
310
- m.prototype.map = function(e, t, n) {
311
- t === void 0 && (t = 0), n === void 0 && (n = this.length);
307
+ m.prototype.map = function(e, t, i) {
308
+ t === void 0 && (t = 0), i === void 0 && (i = this.length);
312
309
  var r = [];
313
310
  return this.forEach(function(o, s) {
314
311
  return r.push(e(o, s));
315
- }, t, n), r;
312
+ }, t, i), r;
316
313
  };
317
314
  m.from = function(e) {
318
- return e instanceof m ? e : e && e.length ? new J(e) : m.empty;
315
+ return e instanceof m ? e : e && e.length ? new Q(e) : m.empty;
319
316
  };
320
- var J = /* @__PURE__ */ (function(i) {
321
- function e(n) {
322
- i.call(this), this.values = n;
317
+ var Q = /* @__PURE__ */ (function(n) {
318
+ function e(i) {
319
+ n.call(this), this.values = i;
323
320
  }
324
- i && (e.__proto__ = i), e.prototype = Object.create(i && i.prototype), e.prototype.constructor = e;
321
+ n && (e.__proto__ = n), e.prototype = Object.create(n && n.prototype), e.prototype.constructor = e;
325
322
  var t = { length: { configurable: !0 }, depth: { configurable: !0 } };
326
323
  return e.prototype.flatten = function() {
327
324
  return this.values;
@@ -349,41 +346,41 @@ var J = /* @__PURE__ */ (function(i) {
349
346
  return 0;
350
347
  }, Object.defineProperties(e.prototype, t), e;
351
348
  })(m);
352
- m.empty = new J([]);
353
- var Ce = /* @__PURE__ */ (function(i) {
354
- function e(t, n) {
355
- i.call(this), this.left = t, this.right = n, this.length = t.length + n.length, this.depth = Math.max(t.depth, n.depth) + 1;
349
+ m.empty = new Q([]);
350
+ var Ee = /* @__PURE__ */ (function(n) {
351
+ function e(t, i) {
352
+ n.call(this), this.left = t, this.right = i, this.length = t.length + i.length, this.depth = Math.max(t.depth, i.depth) + 1;
356
353
  }
357
- return i && (e.__proto__ = i), e.prototype = Object.create(i && i.prototype), e.prototype.constructor = e, e.prototype.flatten = function() {
354
+ return n && (e.__proto__ = n), e.prototype = Object.create(n && n.prototype), e.prototype.constructor = e, e.prototype.flatten = function() {
358
355
  return this.left.flatten().concat(this.right.flatten());
359
- }, e.prototype.getInner = function(n) {
360
- return n < this.left.length ? this.left.get(n) : this.right.get(n - this.left.length);
361
- }, e.prototype.forEachInner = function(n, r, o, s) {
356
+ }, e.prototype.getInner = function(i) {
357
+ return i < this.left.length ? this.left.get(i) : this.right.get(i - this.left.length);
358
+ }, e.prototype.forEachInner = function(i, r, o, s) {
362
359
  var l = this.left.length;
363
- if (r < l && this.left.forEachInner(n, r, Math.min(o, l), s) === !1 || o > l && this.right.forEachInner(n, Math.max(r - l, 0), Math.min(this.length, o) - l, s + l) === !1)
360
+ if (r < l && this.left.forEachInner(i, r, Math.min(o, l), s) === !1 || o > l && this.right.forEachInner(i, Math.max(r - l, 0), Math.min(this.length, o) - l, s + l) === !1)
364
361
  return !1;
365
- }, e.prototype.forEachInvertedInner = function(n, r, o, s) {
362
+ }, e.prototype.forEachInvertedInner = function(i, r, o, s) {
366
363
  var l = this.left.length;
367
- if (r > l && this.right.forEachInvertedInner(n, r - l, Math.max(o, l) - l, s + l) === !1 || o < l && this.left.forEachInvertedInner(n, Math.min(r, l), o, s) === !1)
364
+ if (r > l && this.right.forEachInvertedInner(i, r - l, Math.max(o, l) - l, s + l) === !1 || o < l && this.left.forEachInvertedInner(i, Math.min(r, l), o, s) === !1)
368
365
  return !1;
369
- }, e.prototype.sliceInner = function(n, r) {
370
- if (n == 0 && r == this.length)
366
+ }, e.prototype.sliceInner = function(i, r) {
367
+ if (i == 0 && r == this.length)
371
368
  return this;
372
369
  var o = this.left.length;
373
- return r <= o ? this.left.slice(n, r) : n >= o ? this.right.slice(n - o, r - o) : this.left.slice(n, o).append(this.right.slice(0, r - o));
374
- }, e.prototype.leafAppend = function(n) {
375
- var r = this.right.leafAppend(n);
370
+ return r <= o ? this.left.slice(i, r) : i >= o ? this.right.slice(i - o, r - o) : this.left.slice(i, o).append(this.right.slice(0, r - o));
371
+ }, e.prototype.leafAppend = function(i) {
372
+ var r = this.right.leafAppend(i);
376
373
  if (r)
377
374
  return new e(this.left, r);
378
- }, e.prototype.leafPrepend = function(n) {
379
- var r = this.left.leafPrepend(n);
375
+ }, e.prototype.leafPrepend = function(i) {
376
+ var r = this.left.leafPrepend(i);
380
377
  if (r)
381
378
  return new e(r, this.right);
382
- }, e.prototype.appendInner = function(n) {
383
- return this.left.depth >= Math.max(this.right.depth, n.depth) + 1 ? new e(this.left, new e(this.right, n)) : new e(this, n);
379
+ }, e.prototype.appendInner = function(i) {
380
+ return this.left.depth >= Math.max(this.right.depth, i.depth) + 1 ? new e(this.left, new e(this.right, i)) : new e(this, i);
384
381
  }, e;
385
382
  })(m);
386
- const Ee = 500;
383
+ const be = 500;
387
384
  class v {
388
385
  constructor(e, t) {
389
386
  this.items = e, this.eventCount = t;
@@ -393,46 +390,46 @@ class v {
393
390
  popEvent(e, t) {
394
391
  if (this.eventCount == 0)
395
392
  return null;
396
- let n = this.items.length;
397
- for (; ; n--)
398
- if (this.items.get(n - 1).selection) {
399
- --n;
393
+ let i = this.items.length;
394
+ for (; ; i--)
395
+ if (this.items.get(i - 1).selection) {
396
+ --i;
400
397
  break;
401
398
  }
402
399
  let r, o;
403
- t && (r = this.remapping(n, this.items.length), o = r.maps.length);
400
+ t && (r = this.remapping(i, this.items.length), o = r.maps.length);
404
401
  let s = e.tr, l, a, d = [], u = [];
405
402
  return this.items.forEach((c, p) => {
406
403
  if (!c.step) {
407
- r || (r = this.remapping(n, p + 1), o = r.maps.length), o--, u.push(c);
404
+ r || (r = this.remapping(i, p + 1), o = r.maps.length), o--, u.push(c);
408
405
  return;
409
406
  }
410
407
  if (r) {
411
408
  u.push(new w(c.map));
412
- let h = c.step.map(r.slice(o)), g;
413
- h && s.maybeStep(h).doc && (g = s.mapping.maps[s.mapping.maps.length - 1], d.push(new w(g, void 0, void 0, d.length + u.length))), o--, g && r.appendMap(g, o);
409
+ let f = c.step.map(r.slice(o)), g;
410
+ f && s.maybeStep(f).doc && (g = s.mapping.maps[s.mapping.maps.length - 1], d.push(new w(g, void 0, void 0, d.length + u.length))), o--, g && r.appendMap(g, o);
414
411
  } else
415
412
  s.maybeStep(c.step);
416
413
  if (c.selection)
417
- return l = r ? c.selection.map(r.slice(o)) : c.selection, a = new v(this.items.slice(0, n).append(u.reverse().concat(d)), this.eventCount - 1), !1;
414
+ return l = r ? c.selection.map(r.slice(o)) : c.selection, a = new v(this.items.slice(0, i).append(u.reverse().concat(d)), this.eventCount - 1), !1;
418
415
  }, this.items.length, 0), { remaining: a, transform: s, selection: l };
419
416
  }
420
417
  // Create a new branch with the given transform added.
421
- addTransform(e, t, n, r) {
418
+ addTransform(e, t, i, r) {
422
419
  let o = [], s = this.eventCount, l = this.items, a = !r && l.length ? l.get(l.length - 1) : null;
423
420
  for (let u = 0; u < e.steps.length; u++) {
424
- let c = e.steps[u].invert(e.docs[u]), p = new w(e.mapping.maps[u], c, t), h;
425
- (h = a && a.merge(p)) && (p = h, u ? o.pop() : l = l.slice(0, l.length - 1)), o.push(p), t && (s++, t = void 0), r || (a = p);
421
+ let c = e.steps[u].invert(e.docs[u]), p = new w(e.mapping.maps[u], c, t), f;
422
+ (f = a && a.merge(p)) && (p = f, u ? o.pop() : l = l.slice(0, l.length - 1)), o.push(p), t && (s++, t = void 0), r || (a = p);
426
423
  }
427
- let d = s - n.depth;
428
- return d > Pe && (l = Me(l, d), s -= d), new v(l.append(o), s);
424
+ let d = s - i.depth;
425
+ return d > Ae && (l = Pe(l, d), s -= d), new v(l.append(o), s);
429
426
  }
430
427
  remapping(e, t) {
431
- let n = new ne();
428
+ let i = new re();
432
429
  return this.items.forEach((r, o) => {
433
- let s = r.mirrorOffset != null && o - r.mirrorOffset >= e ? n.maps.length - r.mirrorOffset : void 0;
434
- n.appendMap(r.map, s);
435
- }, e, t), n;
430
+ let s = r.mirrorOffset != null && o - r.mirrorOffset >= e ? i.maps.length - r.mirrorOffset : void 0;
431
+ i.appendMap(r.map, s);
432
+ }, e, t), i;
436
433
  }
437
434
  addMaps(e) {
438
435
  return this.eventCount == 0 ? this : new v(this.items.append(e.map((t) => new w(t))), this.eventCount);
@@ -444,28 +441,28 @@ class v {
444
441
  rebased(e, t) {
445
442
  if (!this.eventCount)
446
443
  return this;
447
- let n = [], r = Math.max(0, this.items.length - t), o = e.mapping, s = e.steps.length, l = this.eventCount;
444
+ let i = [], r = Math.max(0, this.items.length - t), o = e.mapping, s = e.steps.length, l = this.eventCount;
448
445
  this.items.forEach((p) => {
449
446
  p.selection && l--;
450
447
  }, r);
451
448
  let a = t;
452
449
  this.items.forEach((p) => {
453
- let h = o.getMirror(--a);
454
- if (h == null)
450
+ let f = o.getMirror(--a);
451
+ if (f == null)
455
452
  return;
456
- s = Math.min(s, h);
457
- let g = o.maps[h];
453
+ s = Math.min(s, f);
454
+ let g = o.maps[f];
458
455
  if (p.step) {
459
- let M = e.steps[h].invert(e.docs[h]), P = p.selection && p.selection.map(o.slice(a + 1, h));
460
- P && l++, n.push(new w(g, M, P));
456
+ let b = e.steps[f].invert(e.docs[f]), P = p.selection && p.selection.map(o.slice(a + 1, f));
457
+ P && l++, i.push(new w(g, b, P));
461
458
  } else
462
- n.push(new w(g));
459
+ i.push(new w(g));
463
460
  }, r);
464
461
  let d = [];
465
462
  for (let p = t; p < s; p++)
466
463
  d.push(new w(o.maps[p]));
467
- let u = this.items.slice(0, r).append(d).append(n), c = new v(u, l);
468
- return c.emptyItemCount() > Ee && (c = c.compress(this.items.length - n.length)), c;
464
+ let u = this.items.slice(0, r).append(d).append(i), c = new v(u, l);
465
+ return c.emptyItemCount() > be && (c = c.compress(this.items.length - i.length)), c;
469
466
  }
470
467
  emptyItemCount() {
471
468
  let e = 0;
@@ -480,33 +477,33 @@ class v {
480
477
  // because `rebased` relies on a clean, untouched set of items in
481
478
  // order to associate old items with rebased steps.
482
479
  compress(e = this.items.length) {
483
- let t = this.remapping(0, e), n = t.maps.length, r = [], o = 0;
480
+ let t = this.remapping(0, e), i = t.maps.length, r = [], o = 0;
484
481
  return this.items.forEach((s, l) => {
485
482
  if (l >= e)
486
483
  r.push(s), s.selection && o++;
487
484
  else if (s.step) {
488
- let a = s.step.map(t.slice(n)), d = a && a.getMap();
489
- if (n--, d && t.appendMap(d, n), a) {
490
- let u = s.selection && s.selection.map(t.slice(n));
485
+ let a = s.step.map(t.slice(i)), d = a && a.getMap();
486
+ if (i--, d && t.appendMap(d, i), a) {
487
+ let u = s.selection && s.selection.map(t.slice(i));
491
488
  u && o++;
492
- let c = new w(d.invert(), a, u), p, h = r.length - 1;
493
- (p = r.length && r[h].merge(c)) ? r[h] = p : r.push(c);
489
+ let c = new w(d.invert(), a, u), p, f = r.length - 1;
490
+ (p = r.length && r[f].merge(c)) ? r[f] = p : r.push(c);
494
491
  }
495
- } else s.map && n--;
492
+ } else s.map && i--;
496
493
  }, this.items.length, 0), new v(m.from(r.reverse()), o);
497
494
  }
498
495
  }
499
496
  v.empty = new v(m.empty, 0);
500
- function Me(i, e) {
497
+ function Pe(n, e) {
501
498
  let t;
502
- return i.forEach((n, r) => {
503
- if (n.selection && e-- == 0)
499
+ return n.forEach((i, r) => {
500
+ if (i.selection && e-- == 0)
504
501
  return t = r, !1;
505
- }), i.slice(t);
502
+ }), n.slice(t);
506
503
  }
507
504
  class w {
508
- constructor(e, t, n, r) {
509
- this.map = e, this.step = t, this.selection = n, this.mirrorOffset = r;
505
+ constructor(e, t, i, r) {
506
+ this.map = e, this.step = t, this.selection = i, this.mirrorOffset = r;
510
507
  }
511
508
  merge(e) {
512
509
  if (this.step && e.step && !e.selection) {
@@ -517,63 +514,63 @@ class w {
517
514
  }
518
515
  }
519
516
  class y {
520
- constructor(e, t, n, r, o) {
521
- this.done = e, this.undone = t, this.prevRanges = n, this.prevTime = r, this.prevComposition = o;
517
+ constructor(e, t, i, r, o) {
518
+ this.done = e, this.undone = t, this.prevRanges = i, this.prevTime = r, this.prevComposition = o;
522
519
  }
523
520
  }
524
- const Pe = 20;
525
- function Ie(i, e, t, n) {
521
+ const Ae = 20;
522
+ function Ie(n, e, t, i) {
526
523
  let r = t.getMeta(E), o;
527
524
  if (r)
528
525
  return r.historyState;
529
- t.getMeta(Se) && (i = new y(i.done, i.undone, null, 0, -1));
526
+ t.getMeta(Te) && (n = new y(n.done, n.undone, null, 0, -1));
530
527
  let s = t.getMeta("appendedTransaction");
531
528
  if (t.steps.length == 0)
532
- return i;
529
+ return n;
533
530
  if (s && s.getMeta(E))
534
- return s.getMeta(E).redo ? new y(i.done.addTransform(t, void 0, n, S(e)), i.undone, L(t.mapping.maps), i.prevTime, i.prevComposition) : new y(i.done, i.undone.addTransform(t, void 0, n, S(e)), null, i.prevTime, i.prevComposition);
531
+ return s.getMeta(E).redo ? new y(n.done.addTransform(t, void 0, i, x(e)), n.undone, V(t.mapping.maps), n.prevTime, n.prevComposition) : new y(n.done, n.undone.addTransform(t, void 0, i, x(e)), null, n.prevTime, n.prevComposition);
535
532
  if (t.getMeta("addToHistory") !== !1 && !(s && s.getMeta("addToHistory") === !1)) {
536
- let l = t.getMeta("composition"), a = i.prevTime == 0 || !s && i.prevComposition != l && (i.prevTime < (t.time || 0) - n.newGroupDelay || !be(t, i.prevRanges)), d = s ? k(i.prevRanges, t.mapping) : L(t.mapping.maps);
537
- return new y(i.done.addTransform(t, a ? e.selection.getBookmark() : void 0, n, S(e)), v.empty, d, t.time, l ?? i.prevComposition);
538
- } else return (o = t.getMeta("rebased")) ? new y(i.done.rebased(t, o), i.undone.rebased(t, o), k(i.prevRanges, t.mapping), i.prevTime, i.prevComposition) : new y(i.done.addMaps(t.mapping.maps), i.undone.addMaps(t.mapping.maps), k(i.prevRanges, t.mapping), i.prevTime, i.prevComposition);
533
+ let l = t.getMeta("composition"), a = n.prevTime == 0 || !s && n.prevComposition != l && (n.prevTime < (t.time || 0) - i.newGroupDelay || !Me(t, n.prevRanges)), d = s ? k(n.prevRanges, t.mapping) : V(t.mapping.maps);
534
+ return new y(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, i, x(e)), v.empty, d, t.time, l ?? n.prevComposition);
535
+ } else return (o = t.getMeta("rebased")) ? new y(n.done.rebased(t, o), n.undone.rebased(t, o), k(n.prevRanges, t.mapping), n.prevTime, n.prevComposition) : new y(n.done.addMaps(t.mapping.maps), n.undone.addMaps(t.mapping.maps), k(n.prevRanges, t.mapping), n.prevTime, n.prevComposition);
539
536
  }
540
- function be(i, e) {
537
+ function Me(n, e) {
541
538
  if (!e)
542
539
  return !1;
543
- if (!i.docChanged)
540
+ if (!n.docChanged)
544
541
  return !0;
545
542
  let t = !1;
546
- return i.mapping.maps[0].forEach((n, r) => {
543
+ return n.mapping.maps[0].forEach((i, r) => {
547
544
  for (let o = 0; o < e.length; o += 2)
548
- n <= e[o + 1] && r >= e[o] && (t = !0);
545
+ i <= e[o + 1] && r >= e[o] && (t = !0);
549
546
  }), t;
550
547
  }
551
- function L(i) {
548
+ function V(n) {
552
549
  let e = [];
553
- for (let t = i.length - 1; t >= 0 && e.length == 0; t--)
554
- i[t].forEach((n, r, o, s) => e.push(o, s));
550
+ for (let t = n.length - 1; t >= 0 && e.length == 0; t--)
551
+ n[t].forEach((i, r, o, s) => e.push(o, s));
555
552
  return e;
556
553
  }
557
- function k(i, e) {
558
- if (!i)
554
+ function k(n, e) {
555
+ if (!n)
559
556
  return null;
560
557
  let t = [];
561
- for (let n = 0; n < i.length; n += 2) {
562
- let r = e.map(i[n], 1), o = e.map(i[n + 1], -1);
558
+ for (let i = 0; i < n.length; i += 2) {
559
+ let r = e.map(n[i], 1), o = e.map(n[i + 1], -1);
563
560
  r <= o && t.push(r, o);
564
561
  }
565
562
  return t;
566
563
  }
567
- function xe(i, e, t) {
568
- let n = S(e), r = E.get(e).spec.config, o = (t ? i.undone : i.done).popEvent(e, n);
564
+ function xe(n, e, t) {
565
+ let i = x(e), r = E.get(e).spec.config, o = (t ? n.undone : n.done).popEvent(e, i);
569
566
  if (!o)
570
567
  return null;
571
- let s = o.selection.resolve(o.transform.doc), l = (t ? i.done : i.undone).addTransform(o.transform, e.selection.getBookmark(), r, n), a = new y(t ? l : o.remaining, t ? o.remaining : l, null, 0, -1);
568
+ let s = o.selection.resolve(o.transform.doc), l = (t ? n.done : n.undone).addTransform(o.transform, e.selection.getBookmark(), r, i), a = new y(t ? l : o.remaining, t ? o.remaining : l, null, 0, -1);
572
569
  return o.transform.setSelection(s).setMeta(E, { redo: t, historyState: a });
573
570
  }
574
571
  let z = !1, B = null;
575
- function S(i) {
576
- let e = i.plugins;
572
+ function x(n) {
573
+ let e = n.plugins;
577
574
  if (B != e) {
578
575
  z = !1, B = e;
579
576
  for (let t = 0; t < e.length; t++)
@@ -584,53 +581,53 @@ function S(i) {
584
581
  }
585
582
  return z;
586
583
  }
587
- const E = new W("history"), Se = new W("closeHistory");
588
- function Ae(i = {}) {
589
- return i = {
590
- depth: i.depth || 100,
591
- newGroupDelay: i.newGroupDelay || 500
592
- }, new N({
584
+ const E = new W("history"), Te = new W("closeHistory");
585
+ function Se(n = {}) {
586
+ return n = {
587
+ depth: n.depth || 100,
588
+ newGroupDelay: n.newGroupDelay || 500
589
+ }, new R({
593
590
  key: E,
594
591
  state: {
595
592
  init() {
596
593
  return new y(v.empty, v.empty, null, 0, -1);
597
594
  },
598
- apply(e, t, n) {
599
- return Ie(t, n, e, i);
595
+ apply(e, t, i) {
596
+ return Ie(t, i, e, n);
600
597
  }
601
598
  },
602
- config: i,
599
+ config: n,
603
600
  props: {
604
601
  handleDOMEvents: {
605
602
  beforeinput(e, t) {
606
- let n = t.inputType, r = n == "historyUndo" ? q : n == "historyRedo" ? $ : null;
603
+ let i = t.inputType, r = i == "historyUndo" ? q : i == "historyRedo" ? ee : null;
607
604
  return !r || !e.editable ? !1 : (t.preventDefault(), r(e.state, e.dispatch));
608
605
  }
609
606
  }
610
607
  }
611
608
  });
612
609
  }
613
- function Q(i, e) {
614
- return (t, n) => {
610
+ function $(n, e) {
611
+ return (t, i) => {
615
612
  let r = E.getState(t);
616
- if (!r || (i ? r.undone : r.done).eventCount == 0)
613
+ if (!r || (n ? r.undone : r.done).eventCount == 0)
617
614
  return !1;
618
- if (n) {
619
- let o = xe(r, t, i);
620
- o && n(e ? o.scrollIntoView() : o);
615
+ if (i) {
616
+ let o = xe(r, t, n);
617
+ o && i(e ? o.scrollIntoView() : o);
621
618
  }
622
619
  return !0;
623
620
  };
624
621
  }
625
- const q = Q(!1, !0), $ = Q(!0, !0);
622
+ const q = $(!1, !0), ee = $(!0, !0);
626
623
  C.create({
627
624
  name: "characterCount",
628
625
  addOptions() {
629
626
  return {
630
627
  limit: null,
631
628
  mode: "textSize",
632
- textCounter: (i) => i.length,
633
- wordCounter: (i) => i.split(" ").filter((e) => e !== "").length
629
+ textCounter: (n) => n.length,
630
+ wordCounter: (n) => n.split(" ").filter((e) => e !== "").length
634
631
  };
635
632
  },
636
633
  addStorage() {
@@ -640,53 +637,53 @@ C.create({
640
637
  };
641
638
  },
642
639
  onBeforeCreate() {
643
- this.storage.characters = (i) => {
644
- const e = (i == null ? void 0 : i.node) || this.editor.state.doc;
645
- if (((i == null ? void 0 : i.mode) || this.options.mode) === "textSize") {
646
- const n = e.textBetween(0, e.content.size, void 0, " ");
647
- return this.options.textCounter(n);
640
+ this.storage.characters = (n) => {
641
+ const e = (n == null ? void 0 : n.node) || this.editor.state.doc;
642
+ if (((n == null ? void 0 : n.mode) || this.options.mode) === "textSize") {
643
+ const i = e.textBetween(0, e.content.size, void 0, " ");
644
+ return this.options.textCounter(i);
648
645
  }
649
646
  return e.nodeSize;
650
- }, this.storage.words = (i) => {
651
- const e = (i == null ? void 0 : i.node) || this.editor.state.doc, t = e.textBetween(0, e.content.size, " ", " ");
647
+ }, this.storage.words = (n) => {
648
+ const e = (n == null ? void 0 : n.node) || this.editor.state.doc, t = e.textBetween(0, e.content.size, " ", " ");
652
649
  return this.options.wordCounter(t);
653
650
  };
654
651
  },
655
652
  addProseMirrorPlugins() {
656
- let i = !1;
653
+ let n = !1;
657
654
  return [
658
- new I({
659
- key: new b("characterCount"),
660
- appendTransaction: (e, t, n) => {
661
- if (i)
655
+ new A({
656
+ key: new I("characterCount"),
657
+ appendTransaction: (e, t, i) => {
658
+ if (n)
662
659
  return;
663
660
  const r = this.options.limit;
664
661
  if (r == null || r === 0) {
665
- i = !0;
662
+ n = !0;
666
663
  return;
667
664
  }
668
- const o = this.storage.characters({ node: n.doc });
665
+ const o = this.storage.characters({ node: i.doc });
669
666
  if (o > r) {
670
667
  const s = o - r, l = 0, a = s;
671
668
  console.warn(
672
669
  `[CharacterCount] Initial content exceeded limit of ${r} characters. Content was automatically trimmed.`
673
670
  );
674
- const d = n.tr.deleteRange(l, a);
675
- return i = !0, d;
671
+ const d = i.tr.deleteRange(l, a);
672
+ return n = !0, d;
676
673
  }
677
- i = !0;
674
+ n = !0;
678
675
  },
679
676
  filterTransaction: (e, t) => {
680
- const n = this.options.limit;
681
- if (!e.docChanged || n === 0 || n === null || n === void 0)
677
+ const i = this.options.limit;
678
+ if (!e.docChanged || i === 0 || i === null || i === void 0)
682
679
  return !0;
683
680
  const r = this.storage.characters({ node: t.doc }), o = this.storage.characters({ node: e.doc });
684
- if (o <= n || r > n && o > n && o <= r)
681
+ if (o <= i || r > i && o > i && o <= r)
685
682
  return !0;
686
- if (r > n && o > n && o > r || !e.getMeta("paste"))
683
+ if (r > i && o > i && o > r || !e.getMeta("paste"))
687
684
  return !1;
688
- const l = e.selection.$head.pos, a = o - n, d = l - a, u = l;
689
- return e.deleteRange(d, u), !(this.storage.characters({ node: e.doc }) > n);
685
+ const l = e.selection.$head.pos, a = o - i, d = l - a, u = l;
686
+ return e.deleteRange(d, u), !(this.storage.characters({ node: e.doc }) > i);
690
687
  }
691
688
  })
692
689
  ];
@@ -702,7 +699,7 @@ C.create({
702
699
  };
703
700
  },
704
701
  addProseMirrorPlugins() {
705
- return [ue(this.options)];
702
+ return [pe(this.options)];
706
703
  }
707
704
  });
708
705
  C.create({
@@ -715,15 +712,15 @@ C.create({
715
712
  },
716
713
  addProseMirrorPlugins() {
717
714
  return [
718
- new I({
719
- key: new b("focus"),
715
+ new A({
716
+ key: new I("focus"),
720
717
  props: {
721
- decorations: ({ doc: i, selection: e }) => {
722
- const { isEditable: t, isFocused: n } = this.editor, { anchor: r } = e, o = [];
723
- if (!t || !n)
724
- return O.create(i, []);
718
+ decorations: ({ doc: n, selection: e }) => {
719
+ const { isEditable: t, isFocused: i } = this.editor, { anchor: r } = e, o = [];
720
+ if (!t || !i)
721
+ return S.create(n, []);
725
722
  let s = 0;
726
- this.options.mode === "deepest" && i.descendants((a, d) => {
723
+ this.options.mode === "deepest" && n.descendants((a, d) => {
727
724
  if (a.isText)
728
725
  return;
729
726
  if (!(r >= d && r <= d + a.nodeSize - 1))
@@ -731,17 +728,17 @@ C.create({
731
728
  s += 1;
732
729
  });
733
730
  let l = 0;
734
- return i.descendants((a, d) => {
731
+ return n.descendants((a, d) => {
735
732
  if (a.isText || !(r >= d && r <= d + a.nodeSize - 1))
736
733
  return !1;
737
734
  if (l += 1, this.options.mode === "deepest" && s - l > 0 || this.options.mode === "shallowest" && l > 1)
738
735
  return this.options.mode === "deepest";
739
736
  o.push(
740
- R.node(d, d + a.nodeSize, {
737
+ N.node(d, d + a.nodeSize, {
741
738
  class: this.options.className
742
739
  })
743
740
  );
744
- }), O.create(i, o);
741
+ }), S.create(n, o);
745
742
  }
746
743
  }
747
744
  })
@@ -751,26 +748,31 @@ C.create({
751
748
  C.create({
752
749
  name: "gapCursor",
753
750
  addProseMirrorPlugins() {
754
- return [me()];
751
+ return [ge()];
755
752
  },
756
- extendNodeSchema(i) {
753
+ extendNodeSchema(n) {
757
754
  var e;
758
755
  const t = {
759
- name: i.name,
760
- options: i.options,
761
- storage: i.storage
756
+ name: n.name,
757
+ options: n.options,
758
+ storage: n.storage
762
759
  };
763
760
  return {
764
- allowGapCursor: (e = re(ie(i, "allowGapCursor", t))) != null ? e : null
761
+ allowGapCursor: (e = ie(oe(n, "allowGapCursor", t))) != null ? e : null
765
762
  };
766
763
  }
767
764
  });
765
+ var K = "placeholder";
766
+ function Oe(n) {
767
+ return n.replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-]/g, "").replace(/^[0-9-]+/, "").replace(/^-+/, "").toLowerCase();
768
+ }
768
769
  C.create({
769
770
  name: "placeholder",
770
771
  addOptions() {
771
772
  return {
772
773
  emptyEditorClass: "is-editor-empty",
773
774
  emptyNodeClass: "is-empty",
775
+ dataAttribute: K,
774
776
  placeholder: "Write something …",
775
777
  showOnlyWhenEditable: !0,
776
778
  showOnlyCurrent: !0,
@@ -778,33 +780,34 @@ C.create({
778
780
  };
779
781
  },
780
782
  addProseMirrorPlugins() {
783
+ const n = this.options.dataAttribute ? `data-${Oe(this.options.dataAttribute)}` : `data-${K}`;
781
784
  return [
782
- new I({
783
- key: new b("placeholder"),
785
+ new A({
786
+ key: new I("placeholder"),
784
787
  props: {
785
- decorations: ({ doc: i, selection: e }) => {
786
- const t = this.editor.isEditable || !this.options.showOnlyWhenEditable, { anchor: n } = e, r = [];
787
- if (!t)
788
+ decorations: ({ doc: e, selection: t }) => {
789
+ const i = this.editor.isEditable || !this.options.showOnlyWhenEditable, { anchor: r } = t, o = [];
790
+ if (!i)
788
791
  return null;
789
- const o = this.editor.isEmpty;
790
- return i.descendants((s, l) => {
791
- const a = n >= l && n <= l + s.nodeSize, d = !s.isLeaf && oe(s);
792
- if ((a || !this.options.showOnlyCurrent) && d) {
793
- const u = [this.options.emptyNodeClass];
794
- o && u.push(this.options.emptyEditorClass);
795
- const c = R.node(l, l + s.nodeSize, {
796
- class: u.join(" "),
797
- "data-placeholder": typeof this.options.placeholder == "function" ? this.options.placeholder({
792
+ const s = this.editor.isEmpty;
793
+ return e.descendants((l, a) => {
794
+ const d = r >= a && r <= a + l.nodeSize, u = !l.isLeaf && se(l);
795
+ if ((d || !this.options.showOnlyCurrent) && u) {
796
+ const c = [this.options.emptyNodeClass];
797
+ s && c.push(this.options.emptyEditorClass);
798
+ const p = N.node(a, a + l.nodeSize, {
799
+ class: c.join(" "),
800
+ [n]: typeof this.options.placeholder == "function" ? this.options.placeholder({
798
801
  editor: this.editor,
799
- node: s,
800
- pos: l,
801
- hasAnchor: a
802
+ node: l,
803
+ pos: a,
804
+ hasAnchor: d
802
805
  }) : this.options.placeholder
803
806
  });
804
- r.push(c);
807
+ o.push(p);
805
808
  }
806
809
  return this.options.includeChildren;
807
- }), O.create(i, r);
810
+ }), S.create(e, o);
808
811
  }
809
812
  }
810
813
  })
@@ -819,14 +822,14 @@ C.create({
819
822
  };
820
823
  },
821
824
  addProseMirrorPlugins() {
822
- const { editor: i, options: e } = this;
825
+ const { editor: n, options: e } = this;
823
826
  return [
824
- new I({
825
- key: new b("selection"),
827
+ new A({
828
+ key: new I("selection"),
826
829
  props: {
827
830
  decorations(t) {
828
- return t.selection.empty || i.isFocused || !i.isEditable || se(t.selection) || i.view.dragging ? null : O.create(t.doc, [
829
- R.inline(t.selection.from, t.selection.to, {
831
+ return t.selection.empty || n.isFocused || !n.isEditable || le(t.selection) || n.view.dragging ? null : S.create(t.doc, [
832
+ N.inline(t.selection.from, t.selection.to, {
830
833
  class: e.className
831
834
  })
832
835
  ]);
@@ -836,8 +839,8 @@ C.create({
836
839
  ];
837
840
  }
838
841
  });
839
- function K({ types: i, node: e }) {
840
- return e && Array.isArray(i) && i.includes(e.type) || (e == null ? void 0 : e.type) === i;
842
+ function _({ types: n, node: e }) {
843
+ return e && Array.isArray(n) && n.includes(e.type) || (e == null ? void 0 : e.type) === n;
841
844
  }
842
845
  C.create({
843
846
  name: "trailingNode",
@@ -848,10 +851,10 @@ C.create({
848
851
  };
849
852
  },
850
853
  addProseMirrorPlugins() {
851
- var i;
852
- const e = new b(this.name), t = this.options.node || ((i = this.editor.schema.topNodeType.contentMatch.defaultType) == null ? void 0 : i.name) || "paragraph", n = Object.entries(this.editor.schema.nodes).map(([, r]) => r).filter((r) => (this.options.notAfter || []).concat(t).includes(r.name));
854
+ var n;
855
+ const e = new I(this.name), t = this.options.node || ((n = this.editor.schema.topNodeType.contentMatch.defaultType) == null ? void 0 : n.name) || "paragraph", i = Object.entries(this.editor.schema.nodes).map(([, r]) => r).filter((r) => (this.options.notAfter || []).concat(t).includes(r.name));
853
856
  return [
854
- new I({
857
+ new A({
855
858
  key: e,
856
859
  appendTransaction: (r, o, s) => {
857
860
  const { doc: l, tr: a, schema: d } = s, u = e.getState(s), c = l.content.size, p = d.nodes[t];
@@ -861,20 +864,20 @@ C.create({
861
864
  state: {
862
865
  init: (r, o) => {
863
866
  const s = o.tr.doc.lastChild;
864
- return !K({ node: s, types: n });
867
+ return !_({ node: s, types: i });
865
868
  },
866
869
  apply: (r, o) => {
867
870
  if (!r.docChanged || r.getMeta("__uniqueIDTransaction"))
868
871
  return o;
869
872
  const s = r.doc.lastChild;
870
- return !K({ node: s, types: n });
873
+ return !_({ node: s, types: i });
871
874
  }
872
875
  }
873
876
  })
874
877
  ];
875
878
  }
876
879
  });
877
- var Oe = C.create({
880
+ var De = C.create({
878
881
  name: "undoRedo",
879
882
  addOptions() {
880
883
  return {
@@ -884,12 +887,12 @@ var Oe = C.create({
884
887
  },
885
888
  addCommands() {
886
889
  return {
887
- undo: () => ({ state: i, dispatch: e }) => q(i, e),
888
- redo: () => ({ state: i, dispatch: e }) => $(i, e)
890
+ undo: () => ({ state: n, dispatch: e }) => q(n, e),
891
+ redo: () => ({ state: n, dispatch: e }) => ee(n, e)
889
892
  };
890
893
  },
891
894
  addProseMirrorPlugins() {
892
- return [Ae(this.options)];
895
+ return [Se(this.options)];
893
896
  },
894
897
  addKeyboardShortcuts() {
895
898
  return {
@@ -902,64 +905,63 @@ var Oe = C.create({
902
905
  };
903
906
  }
904
907
  });
905
- function _e() {
908
+ function Ke() {
906
909
  var u;
907
- const i = X(ee.name), {
910
+ const n = X(te.name), {
908
911
  icon: e = void 0,
909
912
  tooltip: t = void 0,
910
- shortcutKeys: n = void 0,
913
+ shortcutKeys: i = void 0,
911
914
  tooltipOptions: r = {},
912
915
  action: o = void 0,
913
916
  isActive: s = void 0
914
- } = ((u = i == null ? void 0 : i.componentProps) == null ? void 0 : u.undo) ?? {}, { disabled: l } = Y(s), a = ce[e], d = () => {
917
+ } = ((u = n == null ? void 0 : n.componentProps) == null ? void 0 : u.undo) ?? {}, { disabled: l } = Y(s), a = ue[e], d = () => {
915
918
  l || o && o();
916
919
  };
917
- return !i || !a ? /* @__PURE__ */ T(j, {}) : /* @__PURE__ */ T(
918
- U,
920
+ return !n || !a ? /* @__PURE__ */ O(j, {}) : /* @__PURE__ */ O(
921
+ Z,
919
922
  {
920
923
  action: d,
921
924
  disabled: l,
922
925
  icon: e,
923
- shortcutKeys: n,
926
+ shortcutKeys: i,
924
927
  tooltip: t,
925
928
  tooltipOptions: r
926
929
  }
927
930
  );
928
931
  }
929
- function Ge() {
932
+ function _e() {
930
933
  var d;
931
- const i = X(ee.name), {
934
+ const n = X(te.name), {
932
935
  icon: e = void 0,
933
936
  tooltip: t = void 0,
934
- shortcutKeys: n = void 0,
937
+ shortcutKeys: i = void 0,
935
938
  tooltipOptions: r = {},
936
939
  action: o = void 0,
937
940
  isActive: s = void 0
938
- } = ((d = i == null ? void 0 : i.componentProps) == null ? void 0 : d.redo) ?? {}, { disabled: l } = Y(s), a = () => {
941
+ } = ((d = n == null ? void 0 : n.componentProps) == null ? void 0 : d.redo) ?? {}, { disabled: l } = Y(s), a = () => {
939
942
  l || o && o();
940
943
  };
941
- return i ? /* @__PURE__ */ T(
942
- U,
944
+ return n ? /* @__PURE__ */ O(
945
+ Z,
943
946
  {
944
947
  action: a,
945
948
  disabled: l,
946
949
  icon: e,
947
- shortcutKeys: n,
950
+ shortcutKeys: i,
948
951
  tooltip: t,
949
952
  tooltipOptions: r
950
953
  }
951
- ) : /* @__PURE__ */ T(j, {});
954
+ ) : /* @__PURE__ */ O(j, {});
952
955
  }
953
- const ee = /* @__PURE__ */ Oe.extend({
954
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
956
+ const te = /* @__PURE__ */ De.extend({
955
957
  //@ts-expect-error
956
958
  addOptions() {
957
- var i;
959
+ var n;
958
960
  return {
959
- ...(i = this.parent) == null ? void 0 : i.call(this),
961
+ ...(n = this.parent) == null ? void 0 : n.call(this),
960
962
  depth: 100,
961
963
  newGroupDelay: 500,
962
- button: ({ editor: e, t, extension: n }) => {
964
+ button: ({ editor: e, t, extension: i }) => {
963
965
  var r, o;
964
966
  return {
965
967
  componentProps: {
@@ -967,7 +969,7 @@ const ee = /* @__PURE__ */ Oe.extend({
967
969
  action: () => {
968
970
  e.chain().focus().undo().run();
969
971
  },
970
- shortcutKeys: ((r = n.options.shortcutKeys) == null ? void 0 : r[0]) ?? ["mod", "Z"],
972
+ shortcutKeys: ((r = i.options.shortcutKeys) == null ? void 0 : r[0]) ?? ["mod", "Z"],
971
973
  isActive: () => e.can().undo(),
972
974
  icon: "Undo2",
973
975
  tooltip: t("editor.undo.tooltip")
@@ -976,7 +978,7 @@ const ee = /* @__PURE__ */ Oe.extend({
976
978
  action: () => {
977
979
  e.chain().focus().redo().run();
978
980
  },
979
- shortcutKeys: ((o = n.options.shortcutKeys) == null ? void 0 : o[1]) ?? ["shift", "mod", "Z"],
981
+ shortcutKeys: ((o = i.options.shortcutKeys) == null ? void 0 : o[1]) ?? ["shift", "mod", "Z"],
980
982
  isActive: () => e.can().redo(),
981
983
  icon: "Redo2",
982
984
  tooltip: t("editor.redo.tooltip")
@@ -988,7 +990,7 @@ const ee = /* @__PURE__ */ Oe.extend({
988
990
  }
989
991
  });
990
992
  export {
991
- ee as History,
992
- Ge as RichTextRedo,
993
- _e as RichTextUndo
993
+ te as History,
994
+ _e as RichTextRedo,
995
+ Ke as RichTextUndo
994
996
  };