reactjs-tiptap-editor 0.3.5 → 0.3.7

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 (243) hide show
  1. package/lib/{ActionMenuButton-DocMG_Xt.cjs → ActionMenuButton-CqlhqVIW.cjs} +1 -1
  2. package/lib/{ActionMenuButton-D9WfF2ep.js → ActionMenuButton-DXwpQHj4.js} +1 -1
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.d.cts +13 -13
  5. package/lib/Attachment.d.ts +13 -13
  6. package/lib/Attachment.js +3 -3
  7. package/lib/Blockquote.cjs +1 -1
  8. package/lib/Blockquote.d.cts +13 -13
  9. package/lib/Blockquote.d.ts +13 -13
  10. package/lib/Blockquote.js +2 -2
  11. package/lib/Bold.cjs +1 -1
  12. package/lib/Bold.d.cts +13 -13
  13. package/lib/Bold.d.ts +13 -13
  14. package/lib/Bold.js +2 -2
  15. package/lib/BulletList.cjs +1 -1
  16. package/lib/BulletList.d.cts +13 -13
  17. package/lib/BulletList.d.ts +13 -13
  18. package/lib/BulletList.js +2 -2
  19. package/lib/Clear.cjs +1 -1
  20. package/lib/Clear.d.cts +13 -13
  21. package/lib/Clear.d.ts +13 -13
  22. package/lib/Clear.js +2 -2
  23. package/lib/Code.cjs +1 -1
  24. package/lib/Code.d.cts +13 -13
  25. package/lib/Code.d.ts +13 -13
  26. package/lib/Code.js +2 -2
  27. package/lib/CodeBlock.cjs +1 -1
  28. package/lib/CodeBlock.d.cts +13 -13
  29. package/lib/CodeBlock.d.ts +13 -13
  30. package/lib/CodeBlock.js +3 -3
  31. package/lib/CodeView.cjs +1 -1
  32. package/lib/CodeView.d.cts +13 -13
  33. package/lib/CodeView.d.ts +13 -13
  34. package/lib/CodeView.js +2 -2
  35. package/lib/Color.cjs +1 -1
  36. package/lib/Color.d.cts +13 -13
  37. package/lib/Color.d.ts +13 -13
  38. package/lib/Color.js +3 -3
  39. package/lib/Document.cjs +1 -1
  40. package/lib/Document.d.cts +13 -13
  41. package/lib/Document.d.ts +13 -13
  42. package/lib/Document.js +1 -1
  43. package/lib/{Drawer-DdyndCxA.js → Drawer-B6uGc4Ab.js} +3 -3
  44. package/lib/{Drawer-C6yrcHc7.cjs → Drawer-DBt_aN5x.cjs} +1 -1
  45. package/lib/Drawer.cjs +1 -1
  46. package/lib/Drawer.d.cts +13 -13
  47. package/lib/Drawer.d.ts +13 -13
  48. package/lib/Drawer.js +4 -4
  49. package/lib/Emoji.cjs +1 -1
  50. package/lib/Emoji.d.cts +13 -13
  51. package/lib/Emoji.d.ts +13 -13
  52. package/lib/Emoji.js +4 -4
  53. package/lib/{Excalidraw-D5qXWfKq.js → Excalidraw-Bp252YTN.js} +3 -3
  54. package/lib/{Excalidraw-BS6_3xHm.cjs → Excalidraw-CYLyPnI4.cjs} +1 -1
  55. package/lib/Excalidraw.cjs +1 -1
  56. package/lib/Excalidraw.d.cts +13 -13
  57. package/lib/Excalidraw.d.ts +13 -13
  58. package/lib/Excalidraw.js +3 -3
  59. package/lib/ExportPdf.cjs +1 -1
  60. package/lib/ExportPdf.d.cts +13 -13
  61. package/lib/ExportPdf.d.ts +13 -13
  62. package/lib/ExportPdf.js +2 -2
  63. package/lib/ExportWord.cjs +1 -1
  64. package/lib/ExportWord.d.cts +13 -13
  65. package/lib/ExportWord.d.ts +13 -13
  66. package/lib/ExportWord.js +2 -2
  67. package/lib/FontFamily.cjs +1 -1
  68. package/lib/FontFamily.d.cts +13 -13
  69. package/lib/FontFamily.d.ts +13 -13
  70. package/lib/FontFamily.js +4 -4
  71. package/lib/FontSize.cjs +1 -1
  72. package/lib/FontSize.d.cts +13 -13
  73. package/lib/FontSize.d.ts +13 -13
  74. package/lib/FontSize.js +3 -3
  75. package/lib/FormatPainter.cjs +1 -1
  76. package/lib/FormatPainter.d.cts +13 -13
  77. package/lib/FormatPainter.d.ts +13 -13
  78. package/lib/FormatPainter.js +2 -2
  79. package/lib/Heading.cjs +1 -1
  80. package/lib/Heading.d.cts +13 -13
  81. package/lib/Heading.d.ts +13 -13
  82. package/lib/Heading.js +3 -3
  83. package/lib/Highlight.cjs +1 -1
  84. package/lib/Highlight.d.cts +13 -13
  85. package/lib/Highlight.d.ts +13 -13
  86. package/lib/Highlight.js +2 -2
  87. package/lib/History.cjs +1 -1
  88. package/lib/History.d.cts +13 -13
  89. package/lib/History.d.ts +13 -13
  90. package/lib/History.js +2 -2
  91. package/lib/HorizontalRule.cjs +1 -1
  92. package/lib/HorizontalRule.d.cts +13 -13
  93. package/lib/HorizontalRule.d.ts +13 -13
  94. package/lib/HorizontalRule.js +10 -8
  95. package/lib/Iframe.cjs +1 -1
  96. package/lib/Iframe.d.cts +13 -13
  97. package/lib/Iframe.d.ts +13 -13
  98. package/lib/Iframe.js +3 -3
  99. package/lib/Image.cjs +1 -1
  100. package/lib/Image.d.cts +13 -13
  101. package/lib/Image.d.ts +13 -13
  102. package/lib/Image.js +3 -3
  103. package/lib/ImageGif.cjs +1 -1
  104. package/lib/ImageGif.d.cts +13 -13
  105. package/lib/ImageGif.d.ts +13 -13
  106. package/lib/ImageGif.js +3 -3
  107. package/lib/ImportWord.cjs +2 -2
  108. package/lib/ImportWord.d.cts +13 -13
  109. package/lib/ImportWord.d.ts +13 -13
  110. package/lib/ImportWord.js +4 -4
  111. package/lib/Indent.cjs +1 -1
  112. package/lib/Indent.d.cts +13 -13
  113. package/lib/Indent.d.ts +13 -13
  114. package/lib/Indent.js +2 -2
  115. package/lib/Italic.cjs +1 -1
  116. package/lib/Italic.d.cts +13 -13
  117. package/lib/Italic.d.ts +13 -13
  118. package/lib/Italic.js +2 -2
  119. package/lib/Katex.cjs +1 -1
  120. package/lib/Katex.d.cts +13 -13
  121. package/lib/Katex.d.ts +13 -13
  122. package/lib/Katex.js +4 -4
  123. package/lib/LineHeight.cjs +1 -1
  124. package/lib/LineHeight.d.cts +13 -13
  125. package/lib/LineHeight.d.ts +13 -13
  126. package/lib/LineHeight.js +2 -2
  127. package/lib/Link.cjs +1 -1
  128. package/lib/Link.d.cts +13 -13
  129. package/lib/Link.d.ts +13 -13
  130. package/lib/Link.js +2 -2
  131. package/lib/ListItem.cjs +1 -1
  132. package/lib/ListItem.d.cts +13 -13
  133. package/lib/ListItem.d.ts +13 -13
  134. package/lib/ListItem.js +1 -1
  135. package/lib/Mention.cjs +1 -1
  136. package/lib/Mention.d.cts +13 -13
  137. package/lib/Mention.d.ts +13 -13
  138. package/lib/Mention.js +3 -3
  139. package/lib/Mermaid.cjs +1 -1
  140. package/lib/Mermaid.d.cts +13 -13
  141. package/lib/Mermaid.d.ts +13 -13
  142. package/lib/Mermaid.js +16 -16
  143. package/lib/MoreMark.cjs +1 -1
  144. package/lib/MoreMark.d.cts +13 -13
  145. package/lib/MoreMark.d.ts +13 -13
  146. package/lib/MoreMark.js +3 -3
  147. package/lib/MultiColumn.cjs +1 -1
  148. package/lib/MultiColumn.d.cts +13 -13
  149. package/lib/MultiColumn.d.ts +13 -13
  150. package/lib/MultiColumn.js +2 -2
  151. package/lib/OrderedList.cjs +1 -1
  152. package/lib/OrderedList.d.cts +13 -13
  153. package/lib/OrderedList.d.ts +13 -13
  154. package/lib/OrderedList.js +2 -2
  155. package/lib/{RichTextEditor-DS30aD8t.js → RichTextEditor-BfYZYQb9.js} +899 -905
  156. package/lib/RichTextEditor-Db6oQoYY.cjs +137 -0
  157. package/lib/SearchAndReplace.cjs +1 -1
  158. package/lib/SearchAndReplace.d.cts +13 -13
  159. package/lib/SearchAndReplace.d.ts +13 -13
  160. package/lib/SearchAndReplace.js +2 -2
  161. package/lib/Selection.cjs +1 -1
  162. package/lib/Selection.d.cts +13 -13
  163. package/lib/Selection.d.ts +13 -13
  164. package/lib/Selection.js +1 -1
  165. package/lib/SlashCommand.cjs +1 -1
  166. package/lib/SlashCommand.d.cts +13 -13
  167. package/lib/SlashCommand.d.ts +13 -13
  168. package/lib/SlashCommand.js +4 -4
  169. package/lib/Strike.cjs +1 -1
  170. package/lib/Strike.d.cts +13 -13
  171. package/lib/Strike.d.ts +13 -13
  172. package/lib/Strike.js +2 -2
  173. package/lib/SubAndSuperScript.cjs +1 -1
  174. package/lib/SubAndSuperScript.d.cts +13 -13
  175. package/lib/SubAndSuperScript.d.ts +13 -13
  176. package/lib/SubAndSuperScript.js +3 -3
  177. package/lib/Table.cjs +1 -1
  178. package/lib/Table.d.cts +13 -13
  179. package/lib/Table.d.ts +13 -13
  180. package/lib/Table.js +15 -15
  181. package/lib/TableOfContent.cjs +1 -1
  182. package/lib/TableOfContent.d.cts +13 -13
  183. package/lib/TableOfContent.d.ts +13 -13
  184. package/lib/TableOfContent.js +3 -3
  185. package/lib/TaskList.cjs +1 -1
  186. package/lib/TaskList.d.cts +13 -13
  187. package/lib/TaskList.d.ts +13 -13
  188. package/lib/TaskList.js +2 -2
  189. package/lib/TextAlign.cjs +1 -1
  190. package/lib/TextAlign.d.cts +13 -13
  191. package/lib/TextAlign.d.ts +13 -13
  192. package/lib/TextAlign.js +47 -46
  193. package/lib/TextBubble.cjs +1 -1
  194. package/lib/TextBubble.d.cts +13 -13
  195. package/lib/TextBubble.d.ts +13 -13
  196. package/lib/TextBubble.js +2 -2
  197. package/lib/TextDirection.cjs +1 -1
  198. package/lib/TextDirection.d.cts +13 -13
  199. package/lib/TextDirection.d.ts +13 -13
  200. package/lib/TextDirection.js +2 -2
  201. package/lib/TextUnderline.cjs +1 -1
  202. package/lib/TextUnderline.d.cts +13 -13
  203. package/lib/TextUnderline.d.ts +13 -13
  204. package/lib/TextUnderline.js +2 -2
  205. package/lib/TrailingNode.cjs +1 -1
  206. package/lib/TrailingNode.d.cts +13 -13
  207. package/lib/TrailingNode.d.ts +13 -13
  208. package/lib/TrailingNode.js +1 -1
  209. package/lib/{Twitter-VKMhfUTN.js → Twitter-CZA9dXpC.js} +44 -44
  210. package/lib/{Twitter-Dwmo5UJ-.cjs → Twitter-DLO12QnF.cjs} +1 -1
  211. package/lib/Twitter.cjs +1 -1
  212. package/lib/Twitter.d.cts +13 -13
  213. package/lib/Twitter.d.ts +13 -13
  214. package/lib/Twitter.js +3 -3
  215. package/lib/Video.cjs +1 -1
  216. package/lib/Video.d.cts +13 -13
  217. package/lib/Video.d.ts +13 -13
  218. package/lib/Video.js +2 -2
  219. package/lib/bubble-extra.cjs +1 -1
  220. package/lib/bubble-extra.d.cts +13 -13
  221. package/lib/bubble-extra.d.ts +13 -13
  222. package/lib/bubble-extra.js +6 -6
  223. package/lib/{dom-dataset-pKb7TLlt.js → dom-dataset-2RXYq9wp.js} +397 -376
  224. package/lib/dom-dataset-DmsCLv1q.cjs +33 -0
  225. package/lib/{index-BaTWsqZj.js → index-BGwJ0NfQ.js} +1 -1
  226. package/lib/{index-Dk3tSDmG.js → index-BkoojfPK.js} +1 -1
  227. package/lib/{index-COecBbaE.cjs → index-CSvnpArE.cjs} +11 -11
  228. package/lib/{index-DEe_Svay.js → index-CXIIg9Sq.js} +676 -644
  229. package/lib/{index-DjP7Onch.cjs → index-CrxasX7b.cjs} +1 -1
  230. package/lib/{index-CySbCeQd.cjs → index-Cyh1yoFk.cjs} +1 -1
  231. package/lib/{index-DCFzuS5p.js → index-fKx6CYUM.js} +1 -1
  232. package/lib/{index-ClFtfQ0J.cjs → index-h9_SDuwc.cjs} +1 -1
  233. package/lib/index.cjs +1 -1
  234. package/lib/index.d.cts +13 -13
  235. package/lib/index.d.ts +13 -13
  236. package/lib/index.js +27 -27
  237. package/lib/locale-bundle.d.cts +13 -13
  238. package/lib/locale-bundle.d.ts +13 -13
  239. package/lib/{textarea-DITg4shx.js → textarea-BUlQB7hI.js} +1 -1
  240. package/lib/{textarea-I3qcfzYg.cjs → textarea-ILk3QoYy.cjs} +1 -1
  241. package/package.json +71 -71
  242. package/lib/RichTextEditor-CFS3E6GK.cjs +0 -137
  243. package/lib/dom-dataset-CAXnsjYE.cjs +0 -33
@@ -1,44 +1,44 @@
1
- import { P as ie, a as oe, h as se, i as ue, p as ae, E as de, j as le, k as ce, l as he } from "./index-DEe_Svay.js";
2
- import fe from "tippy.js";
3
- import y, { useRef as pe, useState as K, useDebugValue as Q, useEffect as W, forwardRef as me, useLayoutEffect as ve, useContext as X, createContext as Z } from "react";
4
- import Se, { flushSync as Ee } from "react-dom";
5
- class ye {
6
- constructor({ editor: e, element: t, view: n, tippyOptions: r = {}, updateDelay: o = 250, shouldShow: p }) {
7
- this.preventHide = !1, this.shouldShow = ({ view: a, state: f, from: l, to: d }) => {
8
- const { doc: s, selection: h } = f, { empty: m } = h, E = !s.textBetween(l, d).length && se(f.selection), S = this.element.contains(document.activeElement);
9
- return !(!(a.hasFocus() || S) || m || E || !this.editor.isEditable);
1
+ import { P as ue, a as ae, j as de, i as le, p as ce, E as he, k as fe, l as pe, o as me } from "./index-CXIIg9Sq.js";
2
+ import ve from "tippy.js";
3
+ import g, { useRef as Se, useState as F, useDebugValue as k, useEffect as K, forwardRef as ye, useLayoutEffect as Ee, useContext as ee, createContext as te, createRef as _e, memo as ge, createElement as be, version as q } from "react";
4
+ import Oe, { flushSync as we } from "react-dom";
5
+ class De {
6
+ constructor({ editor: e, element: t, view: r, tippyOptions: i = {}, updateDelay: o = 250, shouldShow: h }) {
7
+ this.preventHide = !1, this.shouldShow = ({ view: s, state: f, from: l, to: d }) => {
8
+ const { doc: u, selection: p } = f, { empty: m } = p, y = !u.textBetween(l, d).length && de(f.selection), S = this.element.contains(document.activeElement);
9
+ return !(!(s.hasFocus() || S) || m || y || !this.editor.isEditable);
10
10
  }, this.mousedownHandler = () => {
11
11
  this.preventHide = !0;
12
12
  }, this.dragstartHandler = () => {
13
13
  this.hide();
14
14
  }, this.focusHandler = () => {
15
15
  setTimeout(() => this.update(this.editor.view));
16
- }, this.blurHandler = ({ event: a }) => {
16
+ }, this.blurHandler = ({ event: s }) => {
17
17
  var f;
18
18
  if (this.preventHide) {
19
19
  this.preventHide = !1;
20
20
  return;
21
21
  }
22
- a != null && a.relatedTarget && (!((f = this.element.parentNode) === null || f === void 0) && f.contains(a.relatedTarget)) || (a == null ? void 0 : a.relatedTarget) !== this.editor.view.dom && this.hide();
23
- }, this.tippyBlurHandler = (a) => {
24
- this.blurHandler({ event: a });
25
- }, this.handleDebouncedUpdate = (a, f) => {
26
- const l = !(f != null && f.selection.eq(a.state.selection)), d = !(f != null && f.doc.eq(a.state.doc));
22
+ s != null && s.relatedTarget && (!((f = this.element.parentNode) === null || f === void 0) && f.contains(s.relatedTarget)) || (s == null ? void 0 : s.relatedTarget) !== this.editor.view.dom && this.hide();
23
+ }, this.tippyBlurHandler = (s) => {
24
+ this.blurHandler({ event: s });
25
+ }, this.handleDebouncedUpdate = (s, f) => {
26
+ const l = !(f != null && f.selection.eq(s.state.selection)), d = !(f != null && f.doc.eq(s.state.doc));
27
27
  !l && !d || (this.updateDebounceTimer && clearTimeout(this.updateDebounceTimer), this.updateDebounceTimer = window.setTimeout(() => {
28
- this.updateHandler(a, l, d, f);
28
+ this.updateHandler(s, l, d, f);
29
29
  }, this.updateDelay));
30
- }, this.updateHandler = (a, f, l, d) => {
31
- var s, h, m;
32
- const { state: E, composing: S } = a, { selection: _ } = E;
30
+ }, this.updateHandler = (s, f, l, d) => {
31
+ var u, p, m;
32
+ const { state: y, composing: S } = s, { selection: E } = y;
33
33
  if (S || !f && !l)
34
34
  return;
35
35
  this.createTooltip();
36
- const { ranges: C } = _, v = Math.min(...C.map((u) => u.$from.pos)), c = Math.max(...C.map((u) => u.$to.pos));
37
- if (!((s = this.shouldShow) === null || s === void 0 ? void 0 : s.call(this, {
36
+ const { ranges: D } = E, v = Math.min(...D.map((a) => a.$from.pos)), c = Math.max(...D.map((a) => a.$to.pos));
37
+ if (!((u = this.shouldShow) === null || u === void 0 ? void 0 : u.call(this, {
38
38
  editor: this.editor,
39
39
  element: this.element,
40
- view: a,
41
- state: E,
40
+ view: s,
41
+ state: y,
42
42
  oldState: d,
43
43
  from: v,
44
44
  to: c
@@ -46,24 +46,24 @@ class ye {
46
46
  this.hide();
47
47
  return;
48
48
  }
49
- (h = this.tippy) === null || h === void 0 || h.setProps({
49
+ (p = this.tippy) === null || p === void 0 || p.setProps({
50
50
  getReferenceClientRect: ((m = this.tippyOptions) === null || m === void 0 ? void 0 : m.getReferenceClientRect) || (() => {
51
- if (ue(E.selection)) {
52
- let u = a.nodeDOM(v);
53
- if (u) {
54
- const g = u.dataset.nodeViewWrapper ? u : u.querySelector("[data-node-view-wrapper]");
55
- if (g && (u = g.firstChild), u)
56
- return u.getBoundingClientRect();
51
+ if (le(y.selection)) {
52
+ let a = s.nodeDOM(v);
53
+ if (a) {
54
+ const _ = a.dataset.nodeViewWrapper ? a : a.querySelector("[data-node-view-wrapper]");
55
+ if (_ && (a = _.firstChild), a)
56
+ return a.getBoundingClientRect();
57
57
  }
58
58
  }
59
- return ae(a, v, c);
59
+ return ce(s, v, c);
60
60
  })
61
61
  }), this.show();
62
- }, this.editor = e, this.element = t, this.view = n, this.updateDelay = o, p && (this.shouldShow = p), this.element.addEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.view.dom.addEventListener("dragstart", this.dragstartHandler), this.editor.on("focus", this.focusHandler), this.editor.on("blur", this.blurHandler), this.tippyOptions = r, this.element.remove(), this.element.style.visibility = "visible";
62
+ }, this.editor = e, this.element = t, this.view = r, this.updateDelay = o, h && (this.shouldShow = h), this.element.addEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.view.dom.addEventListener("dragstart", this.dragstartHandler), this.editor.on("focus", this.focusHandler), this.editor.on("blur", this.blurHandler), this.tippyOptions = i, this.element.remove(), this.element.style.visibility = "visible";
63
63
  }
64
64
  createTooltip() {
65
65
  const { element: e } = this.editor.options, t = !!e.parentElement;
66
- this.tippy || !t || (this.tippy = fe(e, {
66
+ this.tippy || !t || (this.tippy = ve(e, {
67
67
  duration: 0,
68
68
  getReferenceClientRect: null,
69
69
  content: this.element,
@@ -75,13 +75,13 @@ class ye {
75
75
  }), this.tippy.popper.firstChild && this.tippy.popper.firstChild.addEventListener("blur", this.tippyBlurHandler));
76
76
  }
77
77
  update(e, t) {
78
- const { state: n } = e, r = n.selection.from !== n.selection.to;
79
- if (this.updateDelay > 0 && r) {
78
+ const { state: r } = e, i = r.selection.from !== r.selection.to;
79
+ if (this.updateDelay > 0 && i) {
80
80
  this.handleDebouncedUpdate(e, t);
81
81
  return;
82
82
  }
83
- const o = !(t != null && t.selection.eq(e.state.selection)), p = !(t != null && t.doc.eq(e.state.doc));
84
- this.updateHandler(e, o, p, t);
83
+ const o = !(t != null && t.selection.eq(e.state.selection)), h = !(t != null && t.doc.eq(e.state.doc));
84
+ this.updateHandler(e, o, h, t);
85
85
  }
86
86
  show() {
87
87
  var e;
@@ -96,11 +96,11 @@ class ye {
96
96
  !((e = this.tippy) === null || e === void 0) && e.popper.firstChild && this.tippy.popper.firstChild.removeEventListener("blur", this.tippyBlurHandler), (t = this.tippy) === null || t === void 0 || t.destroy(), this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.view.dom.removeEventListener("dragstart", this.dragstartHandler), this.editor.off("focus", this.focusHandler), this.editor.off("blur", this.blurHandler);
97
97
  }
98
98
  }
99
- const k = (i) => new ie({
100
- key: typeof i.pluginKey == "string" ? new oe(i.pluginKey) : i.pluginKey,
101
- view: (e) => new ye({ view: e, ...i })
99
+ const ne = (n) => new ue({
100
+ key: typeof n.pluginKey == "string" ? new ae(n.pluginKey) : n.pluginKey,
101
+ view: (e) => new De({ view: e, ...n })
102
102
  });
103
- de.create({
103
+ he.create({
104
104
  name: "bubbleMenu",
105
105
  addOptions() {
106
106
  return {
@@ -113,7 +113,7 @@ de.create({
113
113
  },
114
114
  addProseMirrorPlugins() {
115
115
  return this.options.element ? [
116
- k({
116
+ ne({
117
117
  pluginKey: this.options.pluginKey,
118
118
  editor: this.editor,
119
119
  element: this.options.element,
@@ -124,10 +124,10 @@ de.create({
124
124
  ] : [];
125
125
  }
126
126
  });
127
- function _e(i) {
128
- return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
127
+ function Ce(n) {
128
+ return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
129
129
  }
130
- var j = { exports: {} }, I = {};
130
+ var P = { exports: {} }, I = {};
131
131
  /**
132
132
  * @license React
133
133
  * use-sync-external-store-shim.production.min.js
@@ -138,39 +138,39 @@ var j = { exports: {} }, I = {};
138
138
  * LICENSE file in the root directory of this source tree.
139
139
  */
140
140
  var z;
141
- function ge() {
141
+ function Re() {
142
142
  if (z) return I;
143
143
  z = 1;
144
- var i = y;
145
- function e(s, h) {
146
- return s === h && (s !== 0 || 1 / s === 1 / h) || s !== s && h !== h;
144
+ var n = g;
145
+ function e(u, p) {
146
+ return u === p && (u !== 0 || 1 / u === 1 / p) || u !== u && p !== p;
147
147
  }
148
- var t = typeof Object.is == "function" ? Object.is : e, n = i.useState, r = i.useEffect, o = i.useLayoutEffect, p = i.useDebugValue;
149
- function a(s, h) {
150
- var m = h(), E = n({ inst: { value: m, getSnapshot: h } }), S = E[0].inst, _ = E[1];
148
+ var t = typeof Object.is == "function" ? Object.is : e, r = n.useState, i = n.useEffect, o = n.useLayoutEffect, h = n.useDebugValue;
149
+ function s(u, p) {
150
+ var m = p(), y = r({ inst: { value: m, getSnapshot: p } }), S = y[0].inst, E = y[1];
151
151
  return o(function() {
152
- S.value = m, S.getSnapshot = h, f(S) && _({ inst: S });
153
- }, [s, m, h]), r(function() {
154
- return f(S) && _({ inst: S }), s(function() {
155
- f(S) && _({ inst: S });
152
+ S.value = m, S.getSnapshot = p, f(S) && E({ inst: S });
153
+ }, [u, m, p]), i(function() {
154
+ return f(S) && E({ inst: S }), u(function() {
155
+ f(S) && E({ inst: S });
156
156
  });
157
- }, [s]), p(m), m;
157
+ }, [u]), h(m), m;
158
158
  }
159
- function f(s) {
160
- var h = s.getSnapshot;
161
- s = s.value;
159
+ function f(u) {
160
+ var p = u.getSnapshot;
161
+ u = u.value;
162
162
  try {
163
- var m = h();
164
- return !t(s, m);
163
+ var m = p();
164
+ return !t(u, m);
165
165
  } catch {
166
166
  return !0;
167
167
  }
168
168
  }
169
- function l(s, h) {
170
- return h();
169
+ function l(u, p) {
170
+ return p();
171
171
  }
172
- var d = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? l : a;
173
- return I.useSyncExternalStore = i.useSyncExternalStore !== void 0 ? i.useSyncExternalStore : d, I;
172
+ var d = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? l : s;
173
+ return I.useSyncExternalStore = n.useSyncExternalStore !== void 0 ? n.useSyncExternalStore : d, I;
174
174
  }
175
175
  var H = {};
176
176
  /**
@@ -183,96 +183,96 @@ var H = {};
183
183
  * LICENSE file in the root directory of this source tree.
184
184
  */
185
185
  var G;
186
- function Oe() {
186
+ function Te() {
187
187
  return G || (G = 1, process.env.NODE_ENV !== "production" && function() {
188
188
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
189
- var i = y, e = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
189
+ var n = g, e = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
190
190
  function t(v) {
191
191
  {
192
- for (var c = arguments.length, O = new Array(c > 1 ? c - 1 : 0), u = 1; u < c; u++)
193
- O[u - 1] = arguments[u];
194
- n("error", v, O);
192
+ for (var c = arguments.length, b = new Array(c > 1 ? c - 1 : 0), a = 1; a < c; a++)
193
+ b[a - 1] = arguments[a];
194
+ r("error", v, b);
195
195
  }
196
196
  }
197
- function n(v, c, O) {
197
+ function r(v, c, b) {
198
198
  {
199
- var u = e.ReactDebugCurrentFrame, g = u.getStackAddendum();
200
- g !== "" && (c += "%s", O = O.concat([g]));
201
- var w = O.map(function(b) {
202
- return String(b);
199
+ var a = e.ReactDebugCurrentFrame, _ = a.getStackAddendum();
200
+ _ !== "" && (c += "%s", b = b.concat([_]));
201
+ var w = b.map(function(O) {
202
+ return String(O);
203
203
  });
204
204
  w.unshift("Warning: " + c), Function.prototype.apply.call(console[v], console, w);
205
205
  }
206
206
  }
207
- function r(v, c) {
207
+ function i(v, c) {
208
208
  return v === c && (v !== 0 || 1 / v === 1 / c) || v !== v && c !== c;
209
209
  }
210
- var o = typeof Object.is == "function" ? Object.is : r, p = i.useState, a = i.useEffect, f = i.useLayoutEffect, l = i.useDebugValue, d = !1, s = !1;
211
- function h(v, c, O) {
212
- d || i.startTransition !== void 0 && (d = !0, t("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
213
- var u = c();
214
- if (!s) {
215
- var g = c();
216
- o(u, g) || (t("The result of getSnapshot should be cached to avoid an infinite loop"), s = !0);
210
+ var o = typeof Object.is == "function" ? Object.is : i, h = n.useState, s = n.useEffect, f = n.useLayoutEffect, l = n.useDebugValue, d = !1, u = !1;
211
+ function p(v, c, b) {
212
+ d || n.startTransition !== void 0 && (d = !0, t("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
213
+ var a = c();
214
+ if (!u) {
215
+ var _ = c();
216
+ o(a, _) || (t("The result of getSnapshot should be cached to avoid an infinite loop"), u = !0);
217
217
  }
218
- var w = p({
218
+ var w = h({
219
219
  inst: {
220
- value: u,
220
+ value: a,
221
221
  getSnapshot: c
222
222
  }
223
- }), b = w[0].inst, R = w[1];
223
+ }), O = w[0].inst, R = w[1];
224
224
  return f(function() {
225
- b.value = u, b.getSnapshot = c, m(b) && R({
226
- inst: b
225
+ O.value = a, O.getSnapshot = c, m(O) && R({
226
+ inst: O
227
227
  });
228
- }, [v, u, c]), a(function() {
229
- m(b) && R({
230
- inst: b
228
+ }, [v, a, c]), s(function() {
229
+ m(O) && R({
230
+ inst: O
231
231
  });
232
232
  var L = function() {
233
- m(b) && R({
234
- inst: b
233
+ m(O) && R({
234
+ inst: O
235
235
  });
236
236
  };
237
237
  return v(L);
238
- }, [v]), l(u), u;
238
+ }, [v]), l(a), a;
239
239
  }
240
240
  function m(v) {
241
- var c = v.getSnapshot, O = v.value;
241
+ var c = v.getSnapshot, b = v.value;
242
242
  try {
243
- var u = c();
244
- return !o(O, u);
243
+ var a = c();
244
+ return !o(b, a);
245
245
  } catch {
246
246
  return !0;
247
247
  }
248
248
  }
249
- function E(v, c, O) {
249
+ function y(v, c, b) {
250
250
  return c();
251
251
  }
252
- var S = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", _ = !S, D = _ ? E : h, C = i.useSyncExternalStore !== void 0 ? i.useSyncExternalStore : D;
253
- H.useSyncExternalStore = C, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
252
+ var S = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", E = !S, C = E ? y : p, D = n.useSyncExternalStore !== void 0 ? n.useSyncExternalStore : C;
253
+ H.useSyncExternalStore = D, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
254
254
  }()), H;
255
255
  }
256
- process.env.NODE_ENV === "production" ? j.exports = ge() : j.exports = Oe();
257
- var M = j.exports;
258
- const be = (...i) => (e) => {
259
- i.forEach((t) => {
256
+ process.env.NODE_ENV === "production" ? P.exports = Re() : P.exports = Te();
257
+ var M = P.exports;
258
+ const Me = (...n) => (e) => {
259
+ n.forEach((t) => {
260
260
  typeof t == "function" ? t(e) : t && (t.current = e);
261
261
  });
262
- }, we = ({ contentComponent: i }) => {
263
- const e = M.useSyncExternalStore(i.subscribe, i.getSnapshot, i.getServerSnapshot);
264
- return y.createElement(y.Fragment, null, Object.values(e));
262
+ }, Le = ({ contentComponent: n }) => {
263
+ const e = M.useSyncExternalStore(n.subscribe, n.getSnapshot, n.getServerSnapshot);
264
+ return g.createElement(g.Fragment, null, Object.values(e));
265
265
  };
266
- function Ce() {
267
- const i = /* @__PURE__ */ new Set();
266
+ function Ae() {
267
+ const n = /* @__PURE__ */ new Set();
268
268
  let e = {};
269
269
  return {
270
270
  /**
271
271
  * Subscribe to the editor instance's changes.
272
272
  */
273
273
  subscribe(t) {
274
- return i.add(t), () => {
275
- i.delete(t);
274
+ return n.add(t), () => {
275
+ n.delete(t);
276
276
  };
277
277
  },
278
278
  getSnapshot() {
@@ -284,25 +284,25 @@ function Ce() {
284
284
  /**
285
285
  * Adds a new NodeView Renderer to the editor.
286
286
  */
287
- setRenderer(t, n) {
287
+ setRenderer(t, r) {
288
288
  e = {
289
289
  ...e,
290
- [t]: Se.createPortal(n.reactElement, n.element, t)
291
- }, i.forEach((r) => r());
290
+ [t]: Oe.createPortal(r.reactElement, r.element, t)
291
+ }, n.forEach((i) => i());
292
292
  },
293
293
  /**
294
294
  * Removes a NodeView Renderer from the editor.
295
295
  */
296
296
  removeRenderer(t) {
297
- const n = { ...e };
298
- delete n[t], e = n, i.forEach((r) => r());
297
+ const r = { ...e };
298
+ delete r[t], e = r, n.forEach((i) => i());
299
299
  }
300
300
  };
301
301
  }
302
- class De extends y.Component {
302
+ class Ne extends g.Component {
303
303
  constructor(e) {
304
304
  var t;
305
- super(e), this.editorContentRef = y.createRef(), this.initialized = !1, this.state = {
305
+ super(e), this.editorContentRef = g.createRef(), this.initialized = !1, this.state = {
306
306
  hasContentComponentInitialized: !!(!((t = e.editor) === null || t === void 0) && t.contentComponent)
307
307
  };
308
308
  }
@@ -320,8 +320,8 @@ class De extends y.Component {
320
320
  const t = this.editorContentRef.current;
321
321
  t.append(...e.options.element.childNodes), e.setOptions({
322
322
  element: t
323
- }), e.contentComponent = Ce(), this.state.hasContentComponentInitialized || (this.unsubscribeToContentComponent = e.contentComponent.subscribe(() => {
324
- this.setState((n) => n.hasContentComponentInitialized ? n : {
323
+ }), e.contentComponent = Ae(), this.state.hasContentComponentInitialized || (this.unsubscribeToContentComponent = e.contentComponent.subscribe(() => {
324
+ this.setState((r) => r.hasContentComponentInitialized ? r : {
325
325
  hasContentComponentInitialized: !0
326
326
  }), this.unsubscribeToContentComponent && this.unsubscribeToContentComponent();
327
327
  })), e.createNodeViews(), this.initialized = !0;
@@ -339,69 +339,69 @@ class De extends y.Component {
339
339
  });
340
340
  }
341
341
  render() {
342
- const { editor: e, innerRef: t, ...n } = this.props;
343
- return y.createElement(
344
- y.Fragment,
342
+ const { editor: e, innerRef: t, ...r } = this.props;
343
+ return g.createElement(
344
+ g.Fragment,
345
345
  null,
346
- y.createElement("div", { ref: be(t, this.editorContentRef), ...n }),
347
- (e == null ? void 0 : e.contentComponent) && y.createElement(we, { contentComponent: e.contentComponent })
346
+ g.createElement("div", { ref: Me(t, this.editorContentRef), ...r }),
347
+ (e == null ? void 0 : e.contentComponent) && g.createElement(Le, { contentComponent: e.contentComponent })
348
348
  );
349
349
  }
350
350
  }
351
- const Re = me((i, e) => {
352
- const t = y.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [i.editor]);
353
- return y.createElement(De, {
351
+ const xe = ye((n, e) => {
352
+ const t = g.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [n.editor]);
353
+ return g.createElement(Ne, {
354
354
  key: t,
355
355
  innerRef: e,
356
- ...i
356
+ ...n
357
357
  });
358
- }), Je = y.memo(Re);
359
- var Te = function i(e, t) {
358
+ }), tt = g.memo(xe);
359
+ var Ve = function n(e, t) {
360
360
  if (e === t) return !0;
361
361
  if (e && t && typeof e == "object" && typeof t == "object") {
362
362
  if (e.constructor !== t.constructor) return !1;
363
- var n, r, o;
363
+ var r, i, o;
364
364
  if (Array.isArray(e)) {
365
- if (n = e.length, n != t.length) return !1;
366
- for (r = n; r-- !== 0; )
367
- if (!i(e[r], t[r])) return !1;
365
+ if (r = e.length, r != t.length) return !1;
366
+ for (i = r; i-- !== 0; )
367
+ if (!n(e[i], t[i])) return !1;
368
368
  return !0;
369
369
  }
370
370
  if (e instanceof Map && t instanceof Map) {
371
371
  if (e.size !== t.size) return !1;
372
- for (r of e.entries())
373
- if (!t.has(r[0])) return !1;
374
- for (r of e.entries())
375
- if (!i(r[1], t.get(r[0]))) return !1;
372
+ for (i of e.entries())
373
+ if (!t.has(i[0])) return !1;
374
+ for (i of e.entries())
375
+ if (!n(i[1], t.get(i[0]))) return !1;
376
376
  return !0;
377
377
  }
378
378
  if (e instanceof Set && t instanceof Set) {
379
379
  if (e.size !== t.size) return !1;
380
- for (r of e.entries())
381
- if (!t.has(r[0])) return !1;
380
+ for (i of e.entries())
381
+ if (!t.has(i[0])) return !1;
382
382
  return !0;
383
383
  }
384
384
  if (ArrayBuffer.isView(e) && ArrayBuffer.isView(t)) {
385
- if (n = e.length, n != t.length) return !1;
386
- for (r = n; r-- !== 0; )
387
- if (e[r] !== t[r]) return !1;
385
+ if (r = e.length, r != t.length) return !1;
386
+ for (i = r; i-- !== 0; )
387
+ if (e[i] !== t[i]) return !1;
388
388
  return !0;
389
389
  }
390
390
  if (e.constructor === RegExp) return e.source === t.source && e.flags === t.flags;
391
391
  if (e.valueOf !== Object.prototype.valueOf) return e.valueOf() === t.valueOf();
392
392
  if (e.toString !== Object.prototype.toString) return e.toString() === t.toString();
393
- if (o = Object.keys(e), n = o.length, n !== Object.keys(t).length) return !1;
394
- for (r = n; r-- !== 0; )
395
- if (!Object.prototype.hasOwnProperty.call(t, o[r])) return !1;
396
- for (r = n; r-- !== 0; ) {
397
- var p = o[r];
398
- if (!(p === "_owner" && e.$$typeof) && !i(e[p], t[p]))
393
+ if (o = Object.keys(e), r = o.length, r !== Object.keys(t).length) return !1;
394
+ for (i = r; i-- !== 0; )
395
+ if (!Object.prototype.hasOwnProperty.call(t, o[i])) return !1;
396
+ for (i = r; i-- !== 0; ) {
397
+ var h = o[i];
398
+ if (!(h === "_owner" && e.$$typeof) && !n(e[h], t[h]))
399
399
  return !1;
400
400
  }
401
401
  return !0;
402
402
  }
403
403
  return e !== e && t !== t;
404
- }, Me = /* @__PURE__ */ _e(Te), U = { exports: {} }, B = {};
404
+ }, Ie = /* @__PURE__ */ Ce(Ve), U = { exports: {} }, B = {};
405
405
  /**
406
406
  * @license React
407
407
  * use-sync-external-store-shim/with-selector.production.min.js
@@ -411,48 +411,48 @@ var Te = function i(e, t) {
411
411
  * This source code is licensed under the MIT license found in the
412
412
  * LICENSE file in the root directory of this source tree.
413
413
  */
414
- var $;
415
- function Le() {
416
- if ($) return B;
417
- $ = 1;
418
- var i = y, e = M;
414
+ var J;
415
+ function He() {
416
+ if (J) return B;
417
+ J = 1;
418
+ var n = g, e = M;
419
419
  function t(l, d) {
420
420
  return l === d && (l !== 0 || 1 / l === 1 / d) || l !== l && d !== d;
421
421
  }
422
- var n = typeof Object.is == "function" ? Object.is : t, r = e.useSyncExternalStore, o = i.useRef, p = i.useEffect, a = i.useMemo, f = i.useDebugValue;
423
- return B.useSyncExternalStoreWithSelector = function(l, d, s, h, m) {
424
- var E = o(null);
425
- if (E.current === null) {
422
+ var r = typeof Object.is == "function" ? Object.is : t, i = e.useSyncExternalStore, o = n.useRef, h = n.useEffect, s = n.useMemo, f = n.useDebugValue;
423
+ return B.useSyncExternalStoreWithSelector = function(l, d, u, p, m) {
424
+ var y = o(null);
425
+ if (y.current === null) {
426
426
  var S = { hasValue: !1, value: null };
427
- E.current = S;
428
- } else S = E.current;
429
- E = a(function() {
430
- function D(u) {
431
- if (!C) {
432
- if (C = !0, v = u, u = h(u), m !== void 0 && S.hasValue) {
433
- var g = S.value;
434
- if (m(g, u)) return c = g;
427
+ y.current = S;
428
+ } else S = y.current;
429
+ y = s(function() {
430
+ function C(a) {
431
+ if (!D) {
432
+ if (D = !0, v = a, a = p(a), m !== void 0 && S.hasValue) {
433
+ var _ = S.value;
434
+ if (m(_, a)) return c = _;
435
435
  }
436
- return c = u;
436
+ return c = a;
437
437
  }
438
- if (g = c, n(v, u)) return g;
439
- var w = h(u);
440
- return m !== void 0 && m(g, w) ? g : (v = u, c = w);
438
+ if (_ = c, r(v, a)) return _;
439
+ var w = p(a);
440
+ return m !== void 0 && m(_, w) ? _ : (v = a, c = w);
441
441
  }
442
- var C = !1, v, c, O = s === void 0 ? null : s;
442
+ var D = !1, v, c, b = u === void 0 ? null : u;
443
443
  return [function() {
444
- return D(d());
445
- }, O === null ? void 0 : function() {
446
- return D(O());
444
+ return C(d());
445
+ }, b === null ? void 0 : function() {
446
+ return C(b());
447
447
  }];
448
- }, [d, s, h, m]);
449
- var _ = r(l, E[0], E[1]);
450
- return p(function() {
451
- S.hasValue = !0, S.value = _;
452
- }, [_]), f(_), _;
448
+ }, [d, u, p, m]);
449
+ var E = i(l, y[0], y[1]);
450
+ return h(function() {
451
+ S.hasValue = !0, S.value = E;
452
+ }, [E]), f(E), E;
453
453
  }, B;
454
454
  }
455
- var P = {};
455
+ var j = {};
456
456
  /**
457
457
  * @license React
458
458
  * use-sync-external-store-shim/with-selector.development.js
@@ -462,56 +462,56 @@ var P = {};
462
462
  * This source code is licensed under the MIT license found in the
463
463
  * LICENSE file in the root directory of this source tree.
464
464
  */
465
- var J;
466
- function Ae() {
467
- return J || (J = 1, process.env.NODE_ENV !== "production" && function() {
465
+ var Y;
466
+ function Be() {
467
+ return Y || (Y = 1, process.env.NODE_ENV !== "production" && function() {
468
468
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
469
- var i = y, e = M;
470
- function t(d, s) {
471
- return d === s && (d !== 0 || 1 / d === 1 / s) || d !== d && s !== s;
469
+ var n = g, e = M;
470
+ function t(d, u) {
471
+ return d === u && (d !== 0 || 1 / d === 1 / u) || d !== d && u !== u;
472
472
  }
473
- var n = typeof Object.is == "function" ? Object.is : t, r = e.useSyncExternalStore, o = i.useRef, p = i.useEffect, a = i.useMemo, f = i.useDebugValue;
474
- function l(d, s, h, m, E) {
475
- var S = o(null), _;
476
- S.current === null ? (_ = {
473
+ var r = typeof Object.is == "function" ? Object.is : t, i = e.useSyncExternalStore, o = n.useRef, h = n.useEffect, s = n.useMemo, f = n.useDebugValue;
474
+ function l(d, u, p, m, y) {
475
+ var S = o(null), E;
476
+ S.current === null ? (E = {
477
477
  hasValue: !1,
478
478
  value: null
479
- }, S.current = _) : _ = S.current;
480
- var D = a(function() {
481
- var O = !1, u, g, w = function(T) {
482
- if (!O) {
483
- O = !0, u = T;
479
+ }, S.current = E) : E = S.current;
480
+ var C = s(function() {
481
+ var b = !1, a, _, w = function(T) {
482
+ if (!b) {
483
+ b = !0, a = T;
484
484
  var A = m(T);
485
- if (E !== void 0 && _.hasValue) {
486
- var N = _.value;
487
- if (E(N, A))
488
- return g = N, N;
485
+ if (y !== void 0 && E.hasValue) {
486
+ var N = E.value;
487
+ if (y(N, A))
488
+ return _ = N, N;
489
489
  }
490
- return g = A, A;
490
+ return _ = A, A;
491
491
  }
492
- var re = u, x = g;
493
- if (n(re, T))
492
+ var se = a, x = _;
493
+ if (r(se, T))
494
494
  return x;
495
495
  var V = m(T);
496
- return E !== void 0 && E(x, V) ? x : (u = T, g = V, V);
497
- }, b = h === void 0 ? null : h, R = function() {
498
- return w(s());
499
- }, L = b === null ? void 0 : function() {
500
- return w(b());
496
+ return y !== void 0 && y(x, V) ? x : (a = T, _ = V, V);
497
+ }, O = p === void 0 ? null : p, R = function() {
498
+ return w(u());
499
+ }, L = O === null ? void 0 : function() {
500
+ return w(O());
501
501
  };
502
502
  return [R, L];
503
- }, [s, h, m, E]), C = D[0], v = D[1], c = r(d, C, v);
504
- return p(function() {
505
- _.hasValue = !0, _.value = c;
503
+ }, [u, p, m, y]), D = C[0], v = C[1], c = i(d, D, v);
504
+ return h(function() {
505
+ E.hasValue = !0, E.value = c;
506
506
  }, [c]), f(c), c;
507
507
  }
508
- P.useSyncExternalStoreWithSelector = l, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
509
- }()), P;
508
+ j.useSyncExternalStoreWithSelector = l, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
509
+ }()), j;
510
510
  }
511
- process.env.NODE_ENV === "production" ? U.exports = Le() : U.exports = Ae();
512
- var Ne = U.exports;
513
- const xe = typeof window < "u" ? ve : W;
514
- class Ve {
511
+ process.env.NODE_ENV === "production" ? U.exports = He() : U.exports = Be();
512
+ var je = U.exports;
513
+ const Pe = typeof window < "u" ? Ee : K;
514
+ class Ue {
515
515
  constructor(e) {
516
516
  this.transactionNumber = 0, this.lastTransactionNumber = 0, this.subscribers = /* @__PURE__ */ new Set(), this.editor = e, this.lastSnapshot = { editor: e, transactionNumber: 0 }, this.getSnapshot = this.getSnapshot.bind(this), this.getServerSnapshot = this.getServerSnapshot.bind(this), this.watch = this.watch.bind(this), this.subscribe = this.subscribe.bind(this);
517
517
  }
@@ -541,21 +541,21 @@ class Ve {
541
541
  watch(e) {
542
542
  if (this.editor = e, this.editor) {
543
543
  const t = () => {
544
- this.transactionNumber += 1, this.subscribers.forEach((r) => r());
545
- }, n = this.editor;
546
- return n.on("transaction", t), () => {
547
- n.off("transaction", t);
544
+ this.transactionNumber += 1, this.subscribers.forEach((i) => i());
545
+ }, r = this.editor;
546
+ return r.on("transaction", t), () => {
547
+ r.off("transaction", t);
548
548
  };
549
549
  }
550
550
  }
551
551
  }
552
- function Ie(i) {
552
+ function $e(n) {
553
553
  var e;
554
- const [t] = K(() => new Ve(i.editor)), n = Ne.useSyncExternalStoreWithSelector(t.subscribe, t.getSnapshot, t.getServerSnapshot, i.selector, (e = i.equalityFn) !== null && e !== void 0 ? e : Me);
555
- return xe(() => t.watch(i.editor), [i.editor, t]), Q(n), n;
554
+ const [t] = F(() => new Ue(n.editor)), r = je.useSyncExternalStoreWithSelector(t.subscribe, t.getSnapshot, t.getServerSnapshot, n.selector, (e = n.equalityFn) !== null && e !== void 0 ? e : Ie);
555
+ return Pe(() => t.watch(n.editor), [n.editor, t]), k(r), r;
556
556
  }
557
- const Y = process.env.NODE_ENV !== "production", F = typeof window > "u", He = F || !!(typeof window < "u" && window.next);
558
- class q {
557
+ const Q = process.env.NODE_ENV !== "production", $ = typeof window > "u", Fe = $ || !!(typeof window < "u" && window.next);
558
+ class W {
559
559
  constructor(e) {
560
560
  this.editor = null, this.subscriptions = /* @__PURE__ */ new Set(), this.isComponentMounted = !1, this.previousDeps = null, this.instanceId = "", this.options = e, this.subscriptions = /* @__PURE__ */ new Set(), this.setEditor(this.getInitialEditor()), this.scheduleDestroy(), this.getEditor = this.getEditor.bind(this), this.getServerSnapshot = this.getServerSnapshot.bind(this), this.subscribe = this.subscribe.bind(this), this.refreshEditorInstance = this.refreshEditorInstance.bind(this), this.scheduleDestroy = this.scheduleDestroy.bind(this), this.onRender = this.onRender.bind(this), this.createEditor = this.createEditor.bind(this);
561
561
  }
@@ -564,8 +564,8 @@ class q {
564
564
  }
565
565
  getInitialEditor() {
566
566
  if (this.options.current.immediatelyRender === void 0)
567
- return F || He ? (Y && console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."), null) : this.createEditor();
568
- if (this.options.current.immediatelyRender && F && Y)
567
+ return $ || Fe ? (Q && console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."), null) : this.createEditor();
568
+ if (this.options.current.immediatelyRender && $ && Q)
569
569
  throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");
570
570
  return this.options.current.immediatelyRender ? this.createEditor() : null;
571
571
  }
@@ -576,52 +576,52 @@ class q {
576
576
  const e = {
577
577
  ...this.options.current,
578
578
  // Always call the most recent version of the callback function by default
579
- onBeforeCreate: (...n) => {
580
- var r, o;
581
- return (o = (r = this.options.current).onBeforeCreate) === null || o === void 0 ? void 0 : o.call(r, ...n);
579
+ onBeforeCreate: (...r) => {
580
+ var i, o;
581
+ return (o = (i = this.options.current).onBeforeCreate) === null || o === void 0 ? void 0 : o.call(i, ...r);
582
582
  },
583
- onBlur: (...n) => {
584
- var r, o;
585
- return (o = (r = this.options.current).onBlur) === null || o === void 0 ? void 0 : o.call(r, ...n);
583
+ onBlur: (...r) => {
584
+ var i, o;
585
+ return (o = (i = this.options.current).onBlur) === null || o === void 0 ? void 0 : o.call(i, ...r);
586
586
  },
587
- onCreate: (...n) => {
588
- var r, o;
589
- return (o = (r = this.options.current).onCreate) === null || o === void 0 ? void 0 : o.call(r, ...n);
587
+ onCreate: (...r) => {
588
+ var i, o;
589
+ return (o = (i = this.options.current).onCreate) === null || o === void 0 ? void 0 : o.call(i, ...r);
590
590
  },
591
- onDestroy: (...n) => {
592
- var r, o;
593
- return (o = (r = this.options.current).onDestroy) === null || o === void 0 ? void 0 : o.call(r, ...n);
591
+ onDestroy: (...r) => {
592
+ var i, o;
593
+ return (o = (i = this.options.current).onDestroy) === null || o === void 0 ? void 0 : o.call(i, ...r);
594
594
  },
595
- onFocus: (...n) => {
596
- var r, o;
597
- return (o = (r = this.options.current).onFocus) === null || o === void 0 ? void 0 : o.call(r, ...n);
595
+ onFocus: (...r) => {
596
+ var i, o;
597
+ return (o = (i = this.options.current).onFocus) === null || o === void 0 ? void 0 : o.call(i, ...r);
598
598
  },
599
- onSelectionUpdate: (...n) => {
600
- var r, o;
601
- return (o = (r = this.options.current).onSelectionUpdate) === null || o === void 0 ? void 0 : o.call(r, ...n);
599
+ onSelectionUpdate: (...r) => {
600
+ var i, o;
601
+ return (o = (i = this.options.current).onSelectionUpdate) === null || o === void 0 ? void 0 : o.call(i, ...r);
602
602
  },
603
- onTransaction: (...n) => {
604
- var r, o;
605
- return (o = (r = this.options.current).onTransaction) === null || o === void 0 ? void 0 : o.call(r, ...n);
603
+ onTransaction: (...r) => {
604
+ var i, o;
605
+ return (o = (i = this.options.current).onTransaction) === null || o === void 0 ? void 0 : o.call(i, ...r);
606
606
  },
607
- onUpdate: (...n) => {
608
- var r, o;
609
- return (o = (r = this.options.current).onUpdate) === null || o === void 0 ? void 0 : o.call(r, ...n);
607
+ onUpdate: (...r) => {
608
+ var i, o;
609
+ return (o = (i = this.options.current).onUpdate) === null || o === void 0 ? void 0 : o.call(i, ...r);
610
610
  },
611
- onContentError: (...n) => {
612
- var r, o;
613
- return (o = (r = this.options.current).onContentError) === null || o === void 0 ? void 0 : o.call(r, ...n);
611
+ onContentError: (...r) => {
612
+ var i, o;
613
+ return (o = (i = this.options.current).onContentError) === null || o === void 0 ? void 0 : o.call(i, ...r);
614
614
  },
615
- onDrop: (...n) => {
616
- var r, o;
617
- return (o = (r = this.options.current).onDrop) === null || o === void 0 ? void 0 : o.call(r, ...n);
615
+ onDrop: (...r) => {
616
+ var i, o;
617
+ return (o = (i = this.options.current).onDrop) === null || o === void 0 ? void 0 : o.call(i, ...r);
618
618
  },
619
- onPaste: (...n) => {
620
- var r, o;
621
- return (o = (r = this.options.current).onPaste) === null || o === void 0 ? void 0 : o.call(r, ...n);
619
+ onPaste: (...r) => {
620
+ var i, o;
621
+ return (o = (i = this.options.current).onPaste) === null || o === void 0 ? void 0 : o.call(i, ...r);
622
622
  }
623
623
  };
624
- return new le(e);
624
+ return new fe(e);
625
625
  }
626
626
  /**
627
627
  * Get the current editor instance.
@@ -644,10 +644,10 @@ class q {
644
644
  };
645
645
  }
646
646
  static compareOptions(e, t) {
647
- return Object.keys(e).every((n) => ["onCreate", "onBeforeCreate", "onDestroy", "onUpdate", "onTransaction", "onFocus", "onBlur", "onSelectionUpdate", "onContentError", "onDrop", "onPaste"].includes(n) ? !0 : n === "extensions" && e.extensions && t.extensions ? e.extensions.length !== t.extensions.length ? !1 : e.extensions.every((r, o) => {
648
- var p;
649
- return r === ((p = t.extensions) === null || p === void 0 ? void 0 : p[o]);
650
- }) : e[n] === t[n]);
647
+ return Object.keys(e).every((r) => ["onCreate", "onBeforeCreate", "onDestroy", "onUpdate", "onTransaction", "onFocus", "onBlur", "onSelectionUpdate", "onContentError", "onDrop", "onPaste"].includes(r) ? !0 : r === "extensions" && e.extensions && t.extensions ? e.extensions.length !== t.extensions.length ? !1 : e.extensions.every((i, o) => {
648
+ var h;
649
+ return i === ((h = t.extensions) === null || h === void 0 ? void 0 : h[o]);
650
+ }) : e[r] === t[r]);
651
651
  }
652
652
  /**
653
653
  * On each render, we will create, update, or destroy the editor instance.
@@ -655,7 +655,7 @@ class q {
655
655
  * @returns A cleanup function
656
656
  */
657
657
  onRender(e) {
658
- return () => (this.isComponentMounted = !0, clearTimeout(this.scheduledDestructionTimeout), this.editor && !this.editor.isDestroyed && e.length === 0 ? q.compareOptions(this.options.current, this.editor.options) || this.editor.setOptions({
658
+ return () => (this.isComponentMounted = !0, clearTimeout(this.scheduledDestructionTimeout), this.editor && !this.editor.isDestroyed && e.length === 0 ? W.compareOptions(this.options.current, this.editor.options) || this.editor.setOptions({
659
659
  ...this.options.current,
660
660
  editable: this.editor.isEditable
661
661
  }) : this.refreshEditorInstance(e), () => {
@@ -671,7 +671,7 @@ class q {
671
671
  this.previousDeps = e;
672
672
  return;
673
673
  }
674
- if (this.previousDeps.length === e.length && this.previousDeps.every((n, r) => n === e[r]))
674
+ if (this.previousDeps.length === e.length && this.previousDeps.every((r, i) => r === e[i]))
675
675
  return;
676
676
  }
677
677
  this.editor && !this.editor.isDestroyed && this.editor.destroy(), this.setEditor(this.createEditor()), this.previousDeps = e;
@@ -692,67 +692,87 @@ class q {
692
692
  }, 1);
693
693
  }
694
694
  }
695
- function Ye(i = {}, e = []) {
696
- const t = pe(i);
697
- t.current = i;
698
- const [n] = K(() => new q(t)), r = M.useSyncExternalStore(n.subscribe, n.getEditor, n.getServerSnapshot);
699
- return Q(r), W(n.onRender(e)), Ie({
700
- editor: r,
701
- selector: ({ transactionNumber: o }) => i.shouldRerenderOnTransaction === !1 ? null : i.immediatelyRender && o === 0 ? 0 : o + 1
702
- }), r;
695
+ function nt(n = {}, e = []) {
696
+ const t = Se(n);
697
+ t.current = n;
698
+ const [r] = F(() => new W(t)), i = M.useSyncExternalStore(r.subscribe, r.getEditor, r.getServerSnapshot);
699
+ return k(i), K(r.onRender(e)), $e({
700
+ editor: i,
701
+ selector: ({ transactionNumber: o }) => n.shouldRerenderOnTransaction === !1 ? null : n.immediatelyRender && o === 0 ? 0 : o + 1
702
+ }), i;
703
703
  }
704
- const ee = Z({
704
+ const re = te({
705
705
  editor: null
706
706
  });
707
- ee.Consumer;
708
- const Be = () => X(ee), Qe = (i) => {
709
- const [e, t] = K(null), { editor: n } = Be();
710
- return W(() => {
711
- var r;
712
- if (!e || !((r = i.editor) === null || r === void 0) && r.isDestroyed || n != null && n.isDestroyed)
707
+ re.Consumer;
708
+ const Ke = () => ee(re), rt = (n) => {
709
+ const [e, t] = F(null), { editor: r } = Ke();
710
+ return K(() => {
711
+ var i;
712
+ if (!e || !((i = n.editor) === null || i === void 0) && i.isDestroyed || r != null && r.isDestroyed)
713
713
  return;
714
- const { pluginKey: o = "bubbleMenu", editor: p, tippyOptions: a = {}, updateDelay: f, shouldShow: l = null } = i, d = p || n;
714
+ const { pluginKey: o = "bubbleMenu", editor: h, tippyOptions: s = {}, updateDelay: f, shouldShow: l = null } = n, d = h || r;
715
715
  if (!d) {
716
716
  console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");
717
717
  return;
718
718
  }
719
- const s = k({
719
+ const u = ne({
720
720
  updateDelay: f,
721
721
  editor: d,
722
722
  element: e,
723
723
  pluginKey: o,
724
724
  shouldShow: l,
725
- tippyOptions: a
725
+ tippyOptions: s
726
726
  });
727
- return d.registerPlugin(s), () => {
727
+ return d.registerPlugin(u), () => {
728
728
  d.unregisterPlugin(o);
729
729
  };
730
- }, [i.editor, n, e]), y.createElement("div", { ref: t, className: i.className, style: { visibility: "hidden" } }, i.children);
731
- }, te = Z({
730
+ }, [n.editor, r, e]), g.createElement("div", { ref: t, className: n.className, style: { visibility: "hidden" } }, n.children);
731
+ }, ie = te({
732
732
  onDragStart: void 0
733
- }), Pe = () => X(te), Xe = y.forwardRef((i, e) => {
734
- const { onDragStart: t } = Pe(), n = i.as || "div";
733
+ }), We = () => ee(ie), it = g.forwardRef((n, e) => {
734
+ const { onDragStart: t } = We(), r = n.as || "div";
735
735
  return (
736
736
  // @ts-ignore
737
- y.createElement(n, { ...i, ref: e, "data-node-view-wrapper": "", onDragStart: t, style: {
737
+ g.createElement(r, { ...n, ref: e, "data-node-view-wrapper": "", onDragStart: t, style: {
738
738
  whiteSpace: "normal",
739
- ...i.style
739
+ ...n.style
740
740
  } })
741
741
  );
742
742
  });
743
- function je(i) {
744
- return !!(typeof i == "function" && i.prototype && i.prototype.isReactComponent);
743
+ function X(n) {
744
+ return !!(typeof n == "function" && n.prototype && n.prototype.isReactComponent);
745
745
  }
746
- function Ue(i) {
747
- var e;
748
- return typeof i == "object" && ((e = i.$$typeof) === null || e === void 0 ? void 0 : e.toString()) === "Symbol(react.forward_ref)";
746
+ function Z(n) {
747
+ return !!(typeof n == "object" && n.$$typeof && (n.$$typeof.toString() === "Symbol(react.forward_ref)" || n.$$typeof.description === "react.forward_ref"));
748
+ }
749
+ function qe(n) {
750
+ return !!(typeof n == "object" && n.$$typeof && (n.$$typeof.toString() === "Symbol(react.memo)" || n.$$typeof.description === "react.memo"));
751
+ }
752
+ function ze(n) {
753
+ if (X(n) || Z(n))
754
+ return !0;
755
+ if (qe(n)) {
756
+ const e = n.type;
757
+ if (e)
758
+ return X(e) || Z(e);
759
+ }
760
+ return !1;
761
+ }
762
+ function Ge() {
763
+ try {
764
+ if (q)
765
+ return parseInt(q.split(".")[0], 10) >= 19;
766
+ } catch {
767
+ }
768
+ return !1;
749
769
  }
750
- class Fe {
770
+ class Je {
751
771
  /**
752
772
  * Immediately creates element and renders the provided React component.
753
773
  */
754
- constructor(e, { editor: t, props: n = {}, as: r = "div", className: o = "" }) {
755
- this.ref = null, this.id = Math.floor(Math.random() * 4294967295).toString(), this.component = e, this.editor = t, this.props = n, this.element = document.createElement(r), this.element.classList.add("react-renderer"), o && this.element.classList.add(...o.split(" ")), this.editor.isInitialized ? Ee(() => {
774
+ constructor(e, { editor: t, props: r = {}, as: i = "div", className: o = "" }) {
775
+ this.ref = null, this.id = Math.floor(Math.random() * 4294967295).toString(), this.component = e, this.editor = t, this.props = r, this.element = document.createElement(i), this.element.classList.add("react-renderer"), o && this.element.classList.add(...o.split(" ")), this.editor.isInitialized ? we(() => {
756
776
  this.render();
757
777
  }) : this.render();
758
778
  }
@@ -761,10 +781,10 @@ class Fe {
761
781
  */
762
782
  render() {
763
783
  var e;
764
- const t = this.component, n = this.props, r = this.editor;
765
- (je(t) || Ue(t)) && (n.ref = (o) => {
766
- this.ref = o;
767
- }), this.reactElement = y.createElement(t, { ...n }), (e = r == null ? void 0 : r.contentComponent) === null || e === void 0 || e.setRenderer(this.id, this);
784
+ const t = this.component, r = this.props, i = this.editor, o = Ge(), h = ze(t), s = { ...r };
785
+ s.ref && !(o || h) && delete s.ref, !s.ref && (o || h) && (s.ref = (f) => {
786
+ this.ref = f;
787
+ }), this.reactElement = g.createElement(t, { ...s }), (e = i == null ? void 0 : i.contentComponent) === null || e === void 0 || e.setRenderer(this.id, this);
768
788
  }
769
789
  /**
770
790
  * Re-renders the React component with new props.
@@ -792,7 +812,7 @@ class Fe {
792
812
  });
793
813
  }
794
814
  }
795
- class Ke extends ce {
815
+ class Ye extends pe {
796
816
  /**
797
817
  * Setup the React component.
798
818
  * Called on initialization.
@@ -809,23 +829,24 @@ class Ke extends ce {
809
829
  HTMLAttributes: this.HTMLAttributes,
810
830
  getPos: () => this.getPos(),
811
831
  updateAttributes: (l = {}) => this.updateAttributes(l),
812
- deleteNode: () => this.deleteNode()
832
+ deleteNode: () => this.deleteNode(),
833
+ ref: _e()
813
834
  };
814
835
  if (!this.component.displayName) {
815
836
  const l = (d) => d.charAt(0).toUpperCase() + d.substring(1);
816
837
  this.component.displayName = l(this.extension.name);
817
838
  }
818
- const r = { onDragStart: this.onDragStart.bind(this), nodeViewContentRef: (l) => {
839
+ const i = { onDragStart: this.onDragStart.bind(this), nodeViewContentRef: (l) => {
819
840
  l && this.contentDOMElement && l.firstChild !== this.contentDOMElement && l.appendChild(this.contentDOMElement);
820
- } }, o = this.component, p = y.memo((l) => y.createElement(te.Provider, { value: r }, y.createElement(o, l)));
821
- p.displayName = "ReactNodeView", this.node.isLeaf ? this.contentDOMElement = null : this.options.contentDOMElementTag ? this.contentDOMElement = document.createElement(this.options.contentDOMElementTag) : this.contentDOMElement = document.createElement(this.node.isInline ? "span" : "div"), this.contentDOMElement && (this.contentDOMElement.dataset.nodeViewContentReact = "", this.contentDOMElement.style.whiteSpace = "inherit");
822
- let a = this.node.isInline ? "span" : "div";
823
- this.options.as && (a = this.options.as);
841
+ } }, o = this.component, h = ge((l) => g.createElement(ie.Provider, { value: i }, be(o, l)));
842
+ h.displayName = "ReactNodeView", this.node.isLeaf ? this.contentDOMElement = null : this.options.contentDOMElementTag ? this.contentDOMElement = document.createElement(this.options.contentDOMElementTag) : this.contentDOMElement = document.createElement(this.node.isInline ? "span" : "div"), this.contentDOMElement && (this.contentDOMElement.dataset.nodeViewContentReact = "", this.contentDOMElement.style.whiteSpace = "inherit");
843
+ let s = this.node.isInline ? "span" : "div";
844
+ this.options.as && (s = this.options.as);
824
845
  const { className: f = "" } = this.options;
825
- this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this), this.renderer = new Fe(p, {
846
+ this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this), this.renderer = new Je(h, {
826
847
  editor: this.editor,
827
848
  props: e,
828
- as: a,
849
+ as: s,
829
850
  className: `node-${this.node.type.name} ${f}`.trim()
830
851
  }), this.editor.on("selectionUpdate", this.handleSelectionUpdate), this.updateElementAttributes();
831
852
  }
@@ -851,9 +872,9 @@ class Ke extends ce {
851
872
  * If it is, call `selectNode`, otherwise call `deselectNode`.
852
873
  */
853
874
  handleSelectionUpdate() {
854
- const { from: e, to: t } = this.editor.state.selection, n = this.getPos();
855
- if (typeof n == "number")
856
- if (e <= n && t >= n + this.node.nodeSize) {
875
+ const { from: e, to: t } = this.editor.state.selection, r = this.getPos();
876
+ if (typeof r == "number")
877
+ if (e <= r && t >= r + this.node.nodeSize) {
857
878
  if (this.renderer.props.selected)
858
879
  return;
859
880
  this.selectNode();
@@ -867,25 +888,25 @@ class Ke extends ce {
867
888
  * On update, update the React component.
868
889
  * To prevent unnecessary updates, the `update` option can be used.
869
890
  */
870
- update(e, t, n) {
871
- const r = (o) => {
891
+ update(e, t, r) {
892
+ const i = (o) => {
872
893
  this.renderer.updateProps(o), typeof this.options.attrs == "function" && this.updateElementAttributes();
873
894
  };
874
895
  if (e.type !== this.node.type)
875
896
  return !1;
876
897
  if (typeof this.options.update == "function") {
877
- const o = this.node, p = this.decorations, a = this.innerDecorations;
878
- return this.node = e, this.decorations = t, this.innerDecorations = n, this.options.update({
898
+ const o = this.node, h = this.decorations, s = this.innerDecorations;
899
+ return this.node = e, this.decorations = t, this.innerDecorations = r, this.options.update({
879
900
  oldNode: o,
880
- oldDecorations: p,
901
+ oldDecorations: h,
881
902
  newNode: e,
882
903
  newDecorations: t,
883
- oldInnerDecorations: a,
884
- innerDecorations: n,
885
- updateProps: () => r({ node: e, decorations: t, innerDecorations: n })
904
+ oldInnerDecorations: s,
905
+ innerDecorations: r,
906
+ updateProps: () => i({ node: e, decorations: t, innerDecorations: r })
886
907
  });
887
908
  }
888
- return e === this.node && this.decorations === t && this.innerDecorations === n || (this.node = e, this.decorations = t, this.innerDecorations = n, r({ node: e, decorations: t, innerDecorations: n })), !0;
909
+ return e === this.node && this.decorations === t && this.innerDecorations === r || (this.node = e, this.decorations = t, this.innerDecorations = r, i({ node: e, decorations: t, innerDecorations: r })), !0;
889
910
  }
890
911
  /**
891
912
  * Select the node.
@@ -919,81 +940,81 @@ class Ke extends ce {
919
940
  if (this.options.attrs) {
920
941
  let e = {};
921
942
  if (typeof this.options.attrs == "function") {
922
- const t = this.editor.extensionManager.attributes, n = he(this.node, t);
923
- e = this.options.attrs({ node: this.node, HTMLAttributes: n });
943
+ const t = this.editor.extensionManager.attributes, r = me(this.node, t);
944
+ e = this.options.attrs({ node: this.node, HTMLAttributes: r });
924
945
  } else
925
946
  e = this.options.attrs;
926
947
  this.renderer.updateAttributes(e);
927
948
  }
928
949
  }
929
950
  }
930
- function Ze(i, e) {
931
- return (t) => t.editor.contentComponent ? new Ke(i, t, e) : {};
951
+ function ot(n, e) {
952
+ return (t) => t.editor.contentComponent ? new Ye(n, t, e) : {};
932
953
  }
933
- function ne(i) {
934
- var e, t, n = "";
935
- if (typeof i == "string" || typeof i == "number") n += i;
936
- else if (typeof i == "object") if (Array.isArray(i)) {
937
- var r = i.length;
938
- for (e = 0; e < r; e++) i[e] && (t = ne(i[e])) && (n && (n += " "), n += t);
939
- } else for (t in i) i[t] && (n && (n += " "), n += t);
940
- return n;
954
+ function oe(n) {
955
+ var e, t, r = "";
956
+ if (typeof n == "string" || typeof n == "number") r += n;
957
+ else if (typeof n == "object") if (Array.isArray(n)) {
958
+ var i = n.length;
959
+ for (e = 0; e < i; e++) n[e] && (t = oe(n[e])) && (r && (r += " "), r += t);
960
+ } else for (t in n) n[t] && (r && (r += " "), r += t);
961
+ return r;
941
962
  }
942
- function ke() {
943
- for (var i, e, t = 0, n = "", r = arguments.length; t < r; t++) (i = arguments[t]) && (e = ne(i)) && (n && (n += " "), n += e);
944
- return n;
963
+ function st() {
964
+ for (var n, e, t = 0, r = "", i = arguments.length; t < i; t++) (n = arguments[t]) && (e = oe(n)) && (r && (r += " "), r += e);
965
+ return r;
945
966
  }
946
- function We(i) {
967
+ function Qe(n) {
947
968
  try {
948
- return JSON.stringify(i);
969
+ return JSON.stringify(n);
949
970
  } catch {
950
971
  return JSON.stringify({});
951
972
  }
952
973
  }
953
- function et(i, e = !1) {
974
+ function ut(n, e = !1) {
954
975
  return (t) => {
955
- const n = i.startsWith("data-") ? i : `data-${i}`;
956
- let r = decodeURIComponent(t.getAttribute(n));
957
- if (r == null || typeof r == "string" && r === "null")
976
+ const r = n.startsWith("data-") ? n : `data-${n}`;
977
+ let i = decodeURIComponent(t.getAttribute(r));
978
+ if (i == null || typeof i == "string" && i === "null")
958
979
  try {
959
- const a = t.outerHTML.match(/([\S\s])+?="([\S\s])+?"/g);
960
- a && a.length > 0 && (r = (a.map((l) => l.trim()).reduce((l, d) => {
961
- const s = d.indexOf("="), h = [d.slice(0, s), d.slice(s + 1).slice(1, -1)];
962
- return l[h[0]] = h[1], l;
963
- }, {})[i.toLowerCase()] || "").replaceAll("&quot;", '"'));
964
- } catch (p) {
965
- console.error("Error getDatasetAttribute ", p.message, t);
980
+ const s = t.outerHTML.match(/([\S\s])+?="([\S\s])+?"/g);
981
+ s && s.length > 0 && (i = (s.map((l) => l.trim()).reduce((l, d) => {
982
+ const u = d.indexOf("="), p = [d.slice(0, u), d.slice(u + 1).slice(1, -1)];
983
+ return l[p[0]] = p[1], l;
984
+ }, {})[n.toLowerCase()] || "").replaceAll("&quot;", '"'));
985
+ } catch (h) {
986
+ console.error("Error getDatasetAttribute ", h.message, t);
966
987
  }
967
988
  if (e)
968
989
  try {
969
- return JSON.parse(r);
990
+ return JSON.parse(i);
970
991
  } catch {
971
992
  return {};
972
993
  }
973
- if (r.includes("%") || r.includes("auto"))
974
- return r;
975
- const o = Number.parseInt(r);
976
- return o !== o ? r : o;
994
+ if (i.includes("%") || i.includes("auto"))
995
+ return i;
996
+ const o = Number.parseInt(i);
997
+ return o !== o ? i : o;
977
998
  };
978
999
  }
979
- function tt(i) {
980
- const { attrs: e } = i;
981
- return Object.keys(e).reduce((t, n) => {
982
- const r = e[n];
983
- if (r == null)
1000
+ function at(n) {
1001
+ const { attrs: e } = n;
1002
+ return Object.keys(e).reduce((t, r) => {
1003
+ const i = e[r];
1004
+ if (i == null)
984
1005
  return t;
985
1006
  let o = "";
986
- return typeof r == "object" ? o = We(r) : o = r, t[n] = o, t;
1007
+ return typeof i == "object" ? o = Qe(i) : o = i, t[r] = o, t;
987
1008
  }, /* @__PURE__ */ Object.create(null));
988
1009
  }
989
1010
  export {
990
- Qe as B,
991
- Je as E,
992
- Xe as N,
993
- Ze as R,
994
- Fe as a,
995
- ke as c,
996
- et as g,
997
- tt as n,
998
- Ye as u
1011
+ rt as B,
1012
+ tt as E,
1013
+ it as N,
1014
+ ot as R,
1015
+ Je as a,
1016
+ st as c,
1017
+ ut as g,
1018
+ at as n,
1019
+ nt as u
999
1020
  };