reactjs-tiptap-editor 1.0.22 → 1.0.24

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 (159) hide show
  1. package/lib/{ActionMenuButton-BBDqKvKg.cjs → ActionMenuButton-B8NhVw5m.cjs} +1 -1
  2. package/lib/{ActionMenuButton-B1067mIC.js → ActionMenuButton-HYlhmRvw.js} +1 -1
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.js +4 -4
  5. package/lib/Blockquote.cjs +1 -1
  6. package/lib/Blockquote.js +2 -2
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +2 -2
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +2 -2
  11. package/lib/{Callout-lBlBlK_w.cjs → Callout-B-S2f0Qo.cjs} +1 -1
  12. package/lib/{Callout-V2mO6s2Y.js → Callout-CF7Y9yJ7.js} +4 -4
  13. package/lib/Callout.cjs +1 -1
  14. package/lib/Callout.js +4 -4
  15. package/lib/Clear.cjs +1 -1
  16. package/lib/Clear.js +2 -2
  17. package/lib/Code.cjs +1 -1
  18. package/lib/Code.js +6 -6
  19. package/lib/CodeBlock.cjs +1 -1
  20. package/lib/CodeBlock.js +27 -27
  21. package/lib/CodeView.cjs +1 -1
  22. package/lib/CodeView.js +2 -2
  23. package/lib/Color.cjs +1 -1
  24. package/lib/Color.js +3 -3
  25. package/lib/Column.cjs +1 -1
  26. package/lib/Column.js +7 -7
  27. package/lib/{Drawer-Cyv27orn.js → Drawer-CaXVhxo4.js} +21 -21
  28. package/lib/{Drawer-BeYo9jAG.cjs → Drawer-Was4hxYH.cjs} +1 -1
  29. package/lib/Drawer.cjs +1 -1
  30. package/lib/Drawer.js +4 -4
  31. package/lib/Emoji.cjs +1 -1
  32. package/lib/Emoji.js +4312 -1860
  33. package/lib/Excalidraw.cjs +1 -1
  34. package/lib/Excalidraw.js +3 -3
  35. package/lib/ExportPdf.cjs +1 -1
  36. package/lib/ExportPdf.js +2 -2
  37. package/lib/ExportWord.cjs +1 -1
  38. package/lib/ExportWord.js +2 -2
  39. package/lib/FontFamily.cjs +1 -1
  40. package/lib/FontFamily.js +5 -5
  41. package/lib/FontSize.cjs +1 -1
  42. package/lib/FontSize.js +9 -9
  43. package/lib/Heading.cjs +1 -1
  44. package/lib/Heading.js +5 -5
  45. package/lib/Highlight.cjs +1 -1
  46. package/lib/Highlight.js +69 -46
  47. package/lib/History.cjs +1 -1
  48. package/lib/History.js +556 -418
  49. package/lib/HorizontalRule.cjs +1 -1
  50. package/lib/HorizontalRule.js +2 -2
  51. package/lib/{Iframe-Bx-VDxSB.cjs → Iframe-BI0sq6pd.cjs} +1 -1
  52. package/lib/{Iframe-D9JVKzO0.js → Iframe-Bp986fj0.js} +3 -3
  53. package/lib/Iframe.cjs +1 -1
  54. package/lib/Iframe.js +3 -3
  55. package/lib/Image.cjs +1 -1
  56. package/lib/Image.js +3 -3
  57. package/lib/ImageGif.cjs +1 -1
  58. package/lib/ImageGif.js +47 -47
  59. package/lib/ImportWord.cjs +1 -1
  60. package/lib/ImportWord.js +3 -3
  61. package/lib/{Indent-B5tQ5Wfg.js → Indent-E6B8DkyN.js} +4 -4
  62. package/lib/{Indent-CCLO0KpG.cjs → Indent-FvM52kjA.cjs} +1 -1
  63. package/lib/Indent.cjs +1 -1
  64. package/lib/Indent.js +2 -2
  65. package/lib/Italic.cjs +1 -1
  66. package/lib/Italic.js +2 -2
  67. package/lib/{Katex-rtfVV2pl.cjs → Katex-DP6EjdKz.cjs} +1 -1
  68. package/lib/{Katex-w_c6vAMd.js → Katex-pzwyyiFJ.js} +5 -5
  69. package/lib/Katex.cjs +1 -1
  70. package/lib/Katex.js +3 -3
  71. package/lib/LineHeight.cjs +1 -1
  72. package/lib/LineHeight.js +4 -4
  73. package/lib/Link.cjs +1 -1
  74. package/lib/Link.js +2 -2
  75. package/lib/LinkEditBlock-Cmkmp2fW.cjs +5 -0
  76. package/lib/{LinkEditBlock-CTlU8YnO.js → LinkEditBlock-OjN4F2rM.js} +222 -224
  77. package/lib/MarkdownPaste.cjs +1 -1
  78. package/lib/MarkdownPaste.js +1 -1
  79. package/lib/Mention.cjs +1 -1
  80. package/lib/Mention.js +8 -8
  81. package/lib/Mermaid.cjs +1 -1
  82. package/lib/Mermaid.js +34 -34
  83. package/lib/MoreMark.cjs +1 -1
  84. package/lib/MoreMark.js +3 -3
  85. package/lib/OrderedList.cjs +1 -1
  86. package/lib/OrderedList.js +2 -2
  87. package/lib/SearchAndReplace.cjs +1 -1
  88. package/lib/SearchAndReplace.js +4 -4
  89. package/lib/SlashCommand.cjs +1 -1
  90. package/lib/SlashCommand.js +7 -7
  91. package/lib/{SlashCommandNodeView-CVKjpS6r.cjs → SlashCommandNodeView-DarAytvt.cjs} +1 -1
  92. package/lib/{SlashCommandNodeView-DNkpJuM3.js → SlashCommandNodeView-o323V8li.js} +2 -2
  93. package/lib/Strike.cjs +1 -1
  94. package/lib/Strike.js +2 -2
  95. package/lib/Table-CC9uNHPL.js +1984 -0
  96. package/lib/Table-Clnz-i4l.cjs +9 -0
  97. package/lib/Table.cjs +1 -1
  98. package/lib/Table.js +1 -1
  99. package/lib/TaskList.cjs +1 -1
  100. package/lib/TaskList.js +2 -2
  101. package/lib/TextAlign.cjs +1 -1
  102. package/lib/TextAlign.js +3 -3
  103. package/lib/TextDirection.cjs +1 -1
  104. package/lib/TextDirection.js +3 -3
  105. package/lib/TextUnderline.cjs +1 -1
  106. package/lib/TextUnderline.js +2 -2
  107. package/lib/{Twitter-BJjt8vv_.cjs → Twitter-0kmrijjL.cjs} +1 -1
  108. package/lib/{Twitter-CKm0M53B.js → Twitter-BVnXL8we.js} +5 -5
  109. package/lib/Twitter.cjs +1 -1
  110. package/lib/Twitter.js +3 -3
  111. package/lib/Video.cjs +1 -1
  112. package/lib/Video.js +3 -3
  113. package/lib/bubble.cjs +6 -6
  114. package/lib/bubble.js +1573 -1561
  115. package/lib/{clsx-Bg-2aTKh.js → clsx-0OU6n9va.js} +379 -353
  116. package/lib/clsx-D6gYQn3o.cjs +33 -0
  117. package/lib/{dropdown-menu-Dre693DD.cjs → dropdown-menu-BIGvxqiu.cjs} +1 -1
  118. package/lib/{dropdown-menu-AhMKS9PQ.js → dropdown-menu-BW2M6saA.js} +1 -1
  119. package/lib/index-BAb_UADw.cjs +1 -0
  120. package/lib/index-BF3EVCB1.cjs +2 -0
  121. package/lib/{index-D0EmqTpe.js → index-BblvcbTH.js} +1130 -1064
  122. package/lib/index-Bcj8cyOO.cjs +24 -0
  123. package/lib/{index-BfHAqkoX.js → index-BrsJsbds.js} +3 -3
  124. package/lib/index-CGjT-a9h.js +1377 -0
  125. package/lib/index-CPTpXLfX.cjs +11 -0
  126. package/lib/{index-C3dgmjIF.cjs → index-CUvjYuRp.cjs} +1 -1
  127. package/lib/{index-C4aGVY2E.cjs → index-CWw4s87s.cjs} +1 -1
  128. package/lib/{index-DXtVL0al.js → index-Cal5SPfB.js} +189 -134
  129. package/lib/{index-CjLxMm5d.js → index-D-Ouz0vF.js} +1 -1
  130. package/lib/{index-83hp1lZH.cjs → index-deubsx3z.cjs} +1 -1
  131. package/lib/{index-DtVRewGA.js → index-oj858lQO.js} +229 -31
  132. package/lib/{index-CbkpBnTX.js → index-zw-Kd38i.js} +47 -50
  133. package/lib/index.cjs +1 -1
  134. package/lib/index.js +2 -2
  135. package/lib/locale-bundle.cjs +1 -1
  136. package/lib/locale-bundle.js +7 -6
  137. package/lib/locales/index.d.ts +199 -1
  138. package/lib/locales/ja.d.ts +198 -0
  139. package/lib/{popover-B1ptDngu.js → popover-BIVHT1W9.js} +1 -1
  140. package/lib/{popover-D7w_FVSV.cjs → popover-DoSfJsFS.cjs} +1 -1
  141. package/lib/{renderNodeView-CbxCTni3.js → renderNodeView-CfWJK4rG.js} +2 -2
  142. package/lib/{renderNodeView-DFVrJy0l.cjs → renderNodeView-D--fDFov.cjs} +1 -1
  143. package/lib/{separator-C_7KkuoG.cjs → separator-SRbPfmGa.cjs} +1 -1
  144. package/lib/{separator-CDoF4Z4Z.js → separator-b-qOPJmp.js} +3 -3
  145. package/lib/{textarea-CNzZnjjW.js → textarea-CpxXPky_.js} +1 -1
  146. package/lib/{textarea-CEtXap1b.cjs → textarea-DbGw9oCU.cjs} +1 -1
  147. package/lib/updatePosition-BwzAsiY0.js +16 -0
  148. package/lib/{updatePosition-CQE1ct18.cjs → updatePosition-DGPtRfWN.cjs} +1 -1
  149. package/package.json +60 -60
  150. package/lib/LinkEditBlock-_41zgSyl.cjs +0 -5
  151. package/lib/Table-BFiU40iW.cjs +0 -9
  152. package/lib/Table-yZtD5Qo1.js +0 -1945
  153. package/lib/clsx-DSAWW32g.cjs +0 -33
  154. package/lib/index-C4WLt4NA.cjs +0 -24
  155. package/lib/index-DlxZt4_j.cjs +0 -1
  156. package/lib/index-P5_MyY0i.js +0 -1362
  157. package/lib/index-TcJ2UKnv.cjs +0 -1
  158. package/lib/index-fbGGohBT.cjs +0 -12
  159. package/lib/updatePosition-BGD41Hbg.js +0 -16
@@ -1,8 +1,8 @@
1
- import w, { createContext as G, useContext as U, createRef as de, memo as fe, createElement as he, version as $, useState as pe, useDebugValue as me, useLayoutEffect as Ee, useEffect as ye, forwardRef as ve, useMemo as k } from "react";
1
+ import A, { createContext as U, useContext as G, createRef as de, memo as fe, createElement as he, version as k, useState as pe, useDebugValue as me, useLayoutEffect as Ee, useEffect as ye, forwardRef as ve, useMemo as z } from "react";
2
2
  import Se, { flushSync as _e } from "react-dom";
3
- import { jsx as A, jsxs as Oe, Fragment as ie } from "react/jsx-runtime";
4
- import { Z as ge, g as be } from "./index-D0EmqTpe.js";
5
- var D = { exports: {} }, M = {};
3
+ import { jsx as b, jsxs as ge, Fragment as ie } from "react/jsx-runtime";
4
+ import { _ as Oe, $ as we, a as Ae } from "./index-BblvcbTH.js";
5
+ var D = { exports: {} }, P = {};
6
6
  /**
7
7
  * @license React
8
8
  * use-sync-external-store-shim.production.js
@@ -13,47 +13,47 @@ var D = { exports: {} }, M = {};
13
13
  * LICENSE file in the root directory of this source tree.
14
14
  */
15
15
  var H;
16
- function we() {
17
- if (H) return M;
16
+ function be() {
17
+ if (H) return P;
18
18
  H = 1;
19
- var e = w;
20
- function t(h, v) {
21
- return h === v && (h !== 0 || 1 / h === 1 / v) || h !== h && v !== v;
19
+ var e = A;
20
+ function t(p, v) {
21
+ return p === v && (p !== 0 || 1 / p === 1 / v) || p !== p && v !== v;
22
22
  }
23
- var r = typeof Object.is == "function" ? Object.is : t, n = e.useState, o = e.useEffect, s = e.useLayoutEffect, i = e.useDebugValue;
24
- function u(h, v) {
25
- var c = v(), f = n({ inst: { value: c, getSnapshot: v } }), m = f[0].inst, a = f[1];
26
- return s(
23
+ var r = typeof Object.is == "function" ? Object.is : t, n = e.useState, o = e.useEffect, u = e.useLayoutEffect, i = e.useDebugValue;
24
+ function s(p, v) {
25
+ var l = v(), f = n({ inst: { value: l, getSnapshot: v } }), m = f[0].inst, a = f[1];
26
+ return u(
27
27
  function() {
28
- m.value = c, m.getSnapshot = v, d(m) && a({ inst: m });
28
+ m.value = l, m.getSnapshot = v, y(m) && a({ inst: m });
29
29
  },
30
- [h, c, v]
30
+ [p, l, v]
31
31
  ), o(
32
32
  function() {
33
- return d(m) && a({ inst: m }), h(function() {
34
- d(m) && a({ inst: m });
33
+ return y(m) && a({ inst: m }), p(function() {
34
+ y(m) && a({ inst: m });
35
35
  });
36
36
  },
37
- [h]
38
- ), i(c), c;
37
+ [p]
38
+ ), i(l), l;
39
39
  }
40
- function d(h) {
41
- var v = h.getSnapshot;
42
- h = h.value;
40
+ function y(p) {
41
+ var v = p.getSnapshot;
42
+ p = p.value;
43
43
  try {
44
- var c = v();
45
- return !r(h, c);
44
+ var l = v();
45
+ return !r(p, l);
46
46
  } catch {
47
47
  return !0;
48
48
  }
49
49
  }
50
- function E(h, v) {
50
+ function c(p, v) {
51
51
  return v();
52
52
  }
53
- var p = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? E : u;
54
- return M.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : p, M;
53
+ var h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? c : s;
54
+ return P.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : h, P;
55
55
  }
56
- var I = {};
56
+ var V = {};
57
57
  /**
58
58
  * @license React
59
59
  * use-sync-external-store-shim.development.js
@@ -64,99 +64,99 @@ var I = {};
64
64
  * LICENSE file in the root directory of this source tree.
65
65
  */
66
66
  var K;
67
- function Ae() {
67
+ function Re() {
68
68
  return K || (K = 1, process.env.NODE_ENV !== "production" && (function() {
69
- function e(c, f) {
70
- return c === f && (c !== 0 || 1 / c === 1 / f) || c !== c && f !== f;
69
+ function e(l, f) {
70
+ return l === f && (l !== 0 || 1 / l === 1 / f) || l !== l && f !== f;
71
71
  }
72
- function t(c, f) {
73
- p || o.startTransition === void 0 || (p = !0, console.error(
72
+ function t(l, f) {
73
+ h || o.startTransition === void 0 || (h = !0, console.error(
74
74
  "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."
75
75
  ));
76
76
  var m = f();
77
- if (!h) {
77
+ if (!p) {
78
78
  var a = f();
79
- s(m, a) || (console.error(
79
+ u(m, a) || (console.error(
80
80
  "The result of getSnapshot should be cached to avoid an infinite loop"
81
- ), h = !0);
81
+ ), p = !0);
82
82
  }
83
83
  a = i({
84
84
  inst: { value: m, getSnapshot: f }
85
85
  });
86
- var l = a[0].inst, y = a[1];
87
- return d(
86
+ var d = a[0].inst, E = a[1];
87
+ return y(
88
88
  function() {
89
- l.value = m, l.getSnapshot = f, r(l) && y({ inst: l });
89
+ d.value = m, d.getSnapshot = f, r(d) && E({ inst: d });
90
90
  },
91
- [c, m, f]
92
- ), u(
91
+ [l, m, f]
92
+ ), s(
93
93
  function() {
94
- return r(l) && y({ inst: l }), c(function() {
95
- r(l) && y({ inst: l });
94
+ return r(d) && E({ inst: d }), l(function() {
95
+ r(d) && E({ inst: d });
96
96
  });
97
97
  },
98
- [c]
99
- ), E(m), m;
98
+ [l]
99
+ ), c(m), m;
100
100
  }
101
- function r(c) {
102
- var f = c.getSnapshot;
103
- c = c.value;
101
+ function r(l) {
102
+ var f = l.getSnapshot;
103
+ l = l.value;
104
104
  try {
105
105
  var m = f();
106
- return !s(c, m);
106
+ return !u(l, m);
107
107
  } catch {
108
108
  return !0;
109
109
  }
110
110
  }
111
- function n(c, f) {
111
+ function n(l, f) {
112
112
  return f();
113
113
  }
114
114
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
115
- var o = w, s = typeof Object.is == "function" ? Object.is : e, i = o.useState, u = o.useEffect, d = o.useLayoutEffect, E = o.useDebugValue, p = !1, h = !1, v = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? n : t;
116
- I.useSyncExternalStore = o.useSyncExternalStore !== void 0 ? o.useSyncExternalStore : v, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
117
- })()), I;
115
+ var o = A, u = typeof Object.is == "function" ? Object.is : e, i = o.useState, s = o.useEffect, y = o.useLayoutEffect, c = o.useDebugValue, h = !1, p = !1, v = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? n : t;
116
+ V.useSyncExternalStore = o.useSyncExternalStore !== void 0 ? o.useSyncExternalStore : v, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
117
+ })()), V;
118
118
  }
119
119
  var F;
120
120
  function W() {
121
- return F || (F = 1, process.env.NODE_ENV === "production" ? D.exports = we() : D.exports = Ae()), D.exports;
121
+ return F || (F = 1, process.env.NODE_ENV === "production" ? D.exports = be() : D.exports = Re()), D.exports;
122
122
  }
123
- var Re = W();
124
- const { getOwnPropertyNames: Ce, getOwnPropertySymbols: Te } = Object, { hasOwnProperty: Ne } = Object.prototype;
125
- function V(e, t) {
126
- return function(n, o, s) {
127
- return e(n, o, s) && t(n, o, s);
123
+ var Te = W();
124
+ const { getOwnPropertyNames: Ce, getOwnPropertySymbols: Ne } = Object, { hasOwnProperty: De } = Object.prototype;
125
+ function M(e, t) {
126
+ return function(n, o, u) {
127
+ return e(n, o, u) && t(n, o, u);
128
128
  };
129
129
  }
130
130
  function j(e) {
131
131
  return function(r, n, o) {
132
132
  if (!r || !n || typeof r != "object" || typeof n != "object")
133
133
  return e(r, n, o);
134
- const { cache: s } = o, i = s.get(r), u = s.get(n);
135
- if (i && u)
136
- return i === n && u === r;
137
- s.set(r, n), s.set(n, r);
138
- const d = e(r, n, o);
139
- return s.delete(r), s.delete(n), d;
134
+ const { cache: u } = o, i = u.get(r), s = u.get(n);
135
+ if (i && s)
136
+ return i === n && s === r;
137
+ u.set(r, n), u.set(n, r);
138
+ const y = e(r, n, o);
139
+ return u.delete(r), u.delete(n), y;
140
140
  };
141
141
  }
142
- function De(e) {
142
+ function je(e) {
143
143
  return e != null ? e[Symbol.toStringTag] : void 0;
144
144
  }
145
145
  function Y(e) {
146
- return Ce(e).concat(Te(e));
146
+ return Ce(e).concat(Ne(e));
147
147
  }
148
- const je = (
148
+ const Le = (
149
149
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
150
- Object.hasOwn || ((e, t) => Ne.call(e, t))
150
+ Object.hasOwn || ((e, t) => De.call(e, t))
151
151
  );
152
- function C(e, t) {
152
+ function T(e, t) {
153
153
  return e === t || !e && !t && e !== e && t !== t;
154
154
  }
155
- const Le = "__v", xe = "__o", Me = "_owner", { getOwnPropertyDescriptor: Z, keys: J } = Object;
156
- function Ie(e, t) {
155
+ const xe = "__v", Pe = "__o", Ve = "_owner", { getOwnPropertyDescriptor: J, keys: X } = Object;
156
+ function Me(e, t) {
157
157
  return e.byteLength === t.byteLength && x(new Uint8Array(e), new Uint8Array(t));
158
158
  }
159
- function Ve(e, t, r) {
159
+ function Ie(e, t, r) {
160
160
  let n = e.length;
161
161
  if (t.length !== n)
162
162
  return !1;
@@ -168,49 +168,49 @@ function Ve(e, t, r) {
168
168
  function qe(e, t) {
169
169
  return e.byteLength === t.byteLength && x(new Uint8Array(e.buffer, e.byteOffset, e.byteLength), new Uint8Array(t.buffer, t.byteOffset, t.byteLength));
170
170
  }
171
- function Pe(e, t) {
172
- return C(e.getTime(), t.getTime());
171
+ function Ue(e, t) {
172
+ return T(e.getTime(), t.getTime());
173
173
  }
174
174
  function Ge(e, t) {
175
175
  return e.name === t.name && e.message === t.message && e.cause === t.cause && e.stack === t.stack;
176
176
  }
177
- function Ue(e, t) {
177
+ function We(e, t) {
178
178
  return e === t;
179
179
  }
180
- function X(e, t, r) {
180
+ function Z(e, t, r) {
181
181
  const n = e.size;
182
182
  if (n !== t.size)
183
183
  return !1;
184
184
  if (!n)
185
185
  return !0;
186
- const o = new Array(n), s = e.entries();
187
- let i, u, d = 0;
188
- for (; (i = s.next()) && !i.done; ) {
189
- const E = t.entries();
190
- let p = !1, h = 0;
191
- for (; (u = E.next()) && !u.done; ) {
192
- if (o[h]) {
193
- h++;
186
+ const o = new Array(n), u = e.entries();
187
+ let i, s, y = 0;
188
+ for (; (i = u.next()) && !i.done; ) {
189
+ const c = t.entries();
190
+ let h = !1, p = 0;
191
+ for (; (s = c.next()) && !s.done; ) {
192
+ if (o[p]) {
193
+ p++;
194
194
  continue;
195
195
  }
196
- const v = i.value, c = u.value;
197
- if (r.equals(v[0], c[0], d, h, e, t, r) && r.equals(v[1], c[1], v[0], c[0], e, t, r)) {
198
- p = o[h] = !0;
196
+ const v = i.value, l = s.value;
197
+ if (r.equals(v[0], l[0], y, p, e, t, r) && r.equals(v[1], l[1], v[0], l[0], e, t, r)) {
198
+ h = o[p] = !0;
199
199
  break;
200
200
  }
201
- h++;
201
+ p++;
202
202
  }
203
- if (!p)
203
+ if (!h)
204
204
  return !1;
205
- d++;
205
+ y++;
206
206
  }
207
207
  return !0;
208
208
  }
209
- const We = C;
210
- function Be(e, t, r) {
211
- const n = J(e);
209
+ const Be = T;
210
+ function $e(e, t, r) {
211
+ const n = X(e);
212
212
  let o = n.length;
213
- if (J(t).length !== o)
213
+ if (X(t).length !== o)
214
214
  return !1;
215
215
  for (; o-- > 0; )
216
216
  if (!se(e, t, r, n[o]))
@@ -222,16 +222,16 @@ function N(e, t, r) {
222
222
  let o = n.length;
223
223
  if (Y(t).length !== o)
224
224
  return !1;
225
- let s, i, u;
225
+ let u, i, s;
226
226
  for (; o-- > 0; )
227
- if (s = n[o], !se(e, t, r, s) || (i = Z(e, s), u = Z(t, s), (i || u) && (!i || !u || i.configurable !== u.configurable || i.enumerable !== u.enumerable || i.writable !== u.writable)))
227
+ if (u = n[o], !se(e, t, r, u) || (i = J(e, u), s = J(t, u), (i || s) && (!i || !s || i.configurable !== s.configurable || i.enumerable !== s.enumerable || i.writable !== s.writable)))
228
228
  return !1;
229
229
  return !0;
230
230
  }
231
- function ze(e, t) {
232
- return C(e.valueOf(), t.valueOf());
231
+ function ke(e, t) {
232
+ return T(e.valueOf(), t.valueOf());
233
233
  }
234
- function $e(e, t) {
234
+ function ze(e, t) {
235
235
  return e.source === t.source && e.flags === t.flags;
236
236
  }
237
237
  function Q(e, t, r) {
@@ -240,19 +240,19 @@ function Q(e, t, r) {
240
240
  return !1;
241
241
  if (!n)
242
242
  return !0;
243
- const o = new Array(n), s = e.values();
244
- let i, u;
245
- for (; (i = s.next()) && !i.done; ) {
246
- const d = t.values();
247
- let E = !1, p = 0;
248
- for (; (u = d.next()) && !u.done; ) {
249
- if (!o[p] && r.equals(i.value, u.value, i.value, u.value, e, t, r)) {
250
- E = o[p] = !0;
243
+ const o = new Array(n), u = e.values();
244
+ let i, s;
245
+ for (; (i = u.next()) && !i.done; ) {
246
+ const y = t.values();
247
+ let c = !1, h = 0;
248
+ for (; (s = y.next()) && !s.done; ) {
249
+ if (!o[h] && r.equals(i.value, s.value, i.value, s.value, e, t, r)) {
250
+ c = o[h] = !0;
251
251
  break;
252
252
  }
253
- p++;
253
+ h++;
254
254
  }
255
- if (!E)
255
+ if (!c)
256
256
  return !1;
257
257
  }
258
258
  return !0;
@@ -266,13 +266,13 @@ function x(e, t) {
266
266
  return !1;
267
267
  return !0;
268
268
  }
269
- function ke(e, t) {
269
+ function He(e, t) {
270
270
  return e.hostname === t.hostname && e.pathname === t.pathname && e.protocol === t.protocol && e.port === t.port && e.hash === t.hash && e.username === t.username && e.password === t.password;
271
271
  }
272
272
  function se(e, t, r, n) {
273
- return (n === Me || n === xe || n === Le) && (e.$$typeof || t.$$typeof) ? !0 : je(t, n) && r.equals(e[n], t[n], n, n, e, t, r);
273
+ return (n === Ve || n === Pe || n === xe) && (e.$$typeof || t.$$typeof) ? !0 : Le(t, n) && r.equals(e[n], t[n], n, n, e, t, r);
274
274
  }
275
- const He = "[object ArrayBuffer]", Ke = "[object Arguments]", Fe = "[object Boolean]", Ye = "[object DataView]", Ze = "[object Date]", Je = "[object Error]", Xe = "[object Map]", Qe = "[object Number]", et = "[object Object]", tt = "[object RegExp]", rt = "[object Set]", nt = "[object String]", ot = {
275
+ const Ke = "[object ArrayBuffer]", Fe = "[object Arguments]", Ye = "[object Boolean]", Je = "[object DataView]", Xe = "[object Date]", Ze = "[object Error]", Qe = "[object Map]", et = "[object Number]", tt = "[object Object]", rt = "[object RegExp]", nt = "[object Set]", ot = "[object String]", it = {
276
276
  "[object Int8Array]": !0,
277
277
  "[object Uint8Array]": !0,
278
278
  "[object Uint8ClampedArray]": !0,
@@ -285,135 +285,135 @@ const He = "[object ArrayBuffer]", Ke = "[object Arguments]", Fe = "[object Bool
285
285
  "[object Float64Array]": !0,
286
286
  "[object BigInt64Array]": !0,
287
287
  "[object BigUint64Array]": !0
288
- }, it = "[object URL]", st = Object.prototype.toString;
289
- function at({ areArrayBuffersEqual: e, areArraysEqual: t, areDataViewsEqual: r, areDatesEqual: n, areErrorsEqual: o, areFunctionsEqual: s, areMapsEqual: i, areNumbersEqual: u, areObjectsEqual: d, arePrimitiveWrappersEqual: E, areRegExpsEqual: p, areSetsEqual: h, areTypedArraysEqual: v, areUrlsEqual: c, unknownTagComparators: f }) {
290
- return function(a, l, y) {
291
- if (a === l)
288
+ }, st = "[object URL]", at = Object.prototype.toString;
289
+ function ut({ areArrayBuffersEqual: e, areArraysEqual: t, areDataViewsEqual: r, areDatesEqual: n, areErrorsEqual: o, areFunctionsEqual: u, areMapsEqual: i, areNumbersEqual: s, areObjectsEqual: y, arePrimitiveWrappersEqual: c, areRegExpsEqual: h, areSetsEqual: p, areTypedArraysEqual: v, areUrlsEqual: l, unknownTagComparators: f }) {
290
+ return function(a, d, E) {
291
+ if (a === d)
292
292
  return !0;
293
- if (a == null || l == null)
293
+ if (a == null || d == null)
294
294
  return !1;
295
- const b = typeof a;
296
- if (b !== typeof l)
295
+ const w = typeof a;
296
+ if (w !== typeof d)
297
297
  return !1;
298
- if (b !== "object")
299
- return b === "number" ? u(a, l, y) : b === "function" ? s(a, l, y) : !1;
300
- const O = a.constructor;
301
- if (O !== l.constructor)
298
+ if (w !== "object")
299
+ return w === "number" ? s(a, d, E) : w === "function" ? u(a, d, E) : !1;
300
+ const g = a.constructor;
301
+ if (g !== d.constructor)
302
302
  return !1;
303
- if (O === Object)
304
- return d(a, l, y);
303
+ if (g === Object)
304
+ return y(a, d, E);
305
305
  if (Array.isArray(a))
306
- return t(a, l, y);
307
- if (O === Date)
308
- return n(a, l, y);
309
- if (O === RegExp)
310
- return p(a, l, y);
311
- if (O === Map)
312
- return i(a, l, y);
313
- if (O === Set)
314
- return h(a, l, y);
315
- const _ = st.call(a);
316
- if (_ === Ze)
317
- return n(a, l, y);
318
- if (_ === tt)
319
- return p(a, l, y);
306
+ return t(a, d, E);
307
+ if (g === Date)
308
+ return n(a, d, E);
309
+ if (g === RegExp)
310
+ return h(a, d, E);
311
+ if (g === Map)
312
+ return i(a, d, E);
313
+ if (g === Set)
314
+ return p(a, d, E);
315
+ const _ = at.call(a);
320
316
  if (_ === Xe)
321
- return i(a, l, y);
317
+ return n(a, d, E);
322
318
  if (_ === rt)
323
- return h(a, l, y);
324
- if (_ === et)
325
- return typeof a.then != "function" && typeof l.then != "function" && d(a, l, y);
326
- if (_ === it)
327
- return c(a, l, y);
328
- if (_ === Je)
329
- return o(a, l, y);
319
+ return h(a, d, E);
320
+ if (_ === Qe)
321
+ return i(a, d, E);
322
+ if (_ === nt)
323
+ return p(a, d, E);
324
+ if (_ === tt)
325
+ return typeof a.then != "function" && typeof d.then != "function" && y(a, d, E);
326
+ if (_ === st)
327
+ return l(a, d, E);
328
+ if (_ === Ze)
329
+ return o(a, d, E);
330
+ if (_ === Fe)
331
+ return y(a, d, E);
332
+ if (it[_])
333
+ return v(a, d, E);
330
334
  if (_ === Ke)
331
- return d(a, l, y);
332
- if (ot[_])
333
- return v(a, l, y);
334
- if (_ === He)
335
- return e(a, l, y);
336
- if (_ === Ye)
337
- return r(a, l, y);
338
- if (_ === Fe || _ === Qe || _ === nt)
339
- return E(a, l, y);
335
+ return e(a, d, E);
336
+ if (_ === Je)
337
+ return r(a, d, E);
338
+ if (_ === Ye || _ === et || _ === ot)
339
+ return c(a, d, E);
340
340
  if (f) {
341
341
  let S = f[_];
342
342
  if (!S) {
343
- const g = De(a);
344
- g && (S = f[g]);
343
+ const O = je(a);
344
+ O && (S = f[O]);
345
345
  }
346
346
  if (S)
347
- return S(a, l, y);
347
+ return S(a, d, E);
348
348
  }
349
349
  return !1;
350
350
  };
351
351
  }
352
- function ut({ circular: e, createCustomConfig: t, strict: r }) {
352
+ function ct({ circular: e, createCustomConfig: t, strict: r }) {
353
353
  let n = {
354
- areArrayBuffersEqual: Ie,
355
- areArraysEqual: r ? N : Ve,
354
+ areArrayBuffersEqual: Me,
355
+ areArraysEqual: r ? N : Ie,
356
356
  areDataViewsEqual: qe,
357
- areDatesEqual: Pe,
357
+ areDatesEqual: Ue,
358
358
  areErrorsEqual: Ge,
359
- areFunctionsEqual: Ue,
360
- areMapsEqual: r ? V(X, N) : X,
361
- areNumbersEqual: We,
362
- areObjectsEqual: r ? N : Be,
363
- arePrimitiveWrappersEqual: ze,
364
- areRegExpsEqual: $e,
365
- areSetsEqual: r ? V(Q, N) : Q,
366
- areTypedArraysEqual: r ? V(x, N) : x,
367
- areUrlsEqual: ke,
359
+ areFunctionsEqual: We,
360
+ areMapsEqual: r ? M(Z, N) : Z,
361
+ areNumbersEqual: Be,
362
+ areObjectsEqual: r ? N : $e,
363
+ arePrimitiveWrappersEqual: ke,
364
+ areRegExpsEqual: ze,
365
+ areSetsEqual: r ? M(Q, N) : Q,
366
+ areTypedArraysEqual: r ? M(x, N) : x,
367
+ areUrlsEqual: He,
368
368
  unknownTagComparators: void 0
369
369
  };
370
370
  if (t && (n = Object.assign({}, n, t(n))), e) {
371
- const o = j(n.areArraysEqual), s = j(n.areMapsEqual), i = j(n.areObjectsEqual), u = j(n.areSetsEqual);
371
+ const o = j(n.areArraysEqual), u = j(n.areMapsEqual), i = j(n.areObjectsEqual), s = j(n.areSetsEqual);
372
372
  n = Object.assign({}, n, {
373
373
  areArraysEqual: o,
374
- areMapsEqual: s,
374
+ areMapsEqual: u,
375
375
  areObjectsEqual: i,
376
- areSetsEqual: u
376
+ areSetsEqual: s
377
377
  });
378
378
  }
379
379
  return n;
380
380
  }
381
- function ct(e) {
382
- return function(t, r, n, o, s, i, u) {
383
- return e(t, r, u);
381
+ function lt(e) {
382
+ return function(t, r, n, o, u, i, s) {
383
+ return e(t, r, s);
384
384
  };
385
385
  }
386
- function lt({ circular: e, comparator: t, createState: r, equals: n, strict: o }) {
386
+ function dt({ circular: e, comparator: t, createState: r, equals: n, strict: o }) {
387
387
  if (r)
388
- return function(u, d) {
389
- const { cache: E = e ? /* @__PURE__ */ new WeakMap() : void 0, meta: p } = r();
390
- return t(u, d, {
391
- cache: E,
388
+ return function(s, y) {
389
+ const { cache: c = e ? /* @__PURE__ */ new WeakMap() : void 0, meta: h } = r();
390
+ return t(s, y, {
391
+ cache: c,
392
392
  equals: n,
393
- meta: p,
393
+ meta: h,
394
394
  strict: o
395
395
  });
396
396
  };
397
397
  if (e)
398
- return function(u, d) {
399
- return t(u, d, {
398
+ return function(s, y) {
399
+ return t(s, y, {
400
400
  cache: /* @__PURE__ */ new WeakMap(),
401
401
  equals: n,
402
402
  meta: void 0,
403
403
  strict: o
404
404
  });
405
405
  };
406
- const s = {
406
+ const u = {
407
407
  cache: void 0,
408
408
  equals: n,
409
409
  meta: void 0,
410
410
  strict: o
411
411
  };
412
- return function(u, d) {
413
- return t(u, d, s);
412
+ return function(s, y) {
413
+ return t(s, y, u);
414
414
  };
415
415
  }
416
- const dt = R();
416
+ const ft = R();
417
417
  R({ strict: !0 });
418
418
  R({ circular: !0 });
419
419
  R({
@@ -421,26 +421,26 @@ R({
421
421
  strict: !0
422
422
  });
423
423
  R({
424
- createInternalComparator: () => C
424
+ createInternalComparator: () => T
425
425
  });
426
426
  R({
427
427
  strict: !0,
428
- createInternalComparator: () => C
428
+ createInternalComparator: () => T
429
429
  });
430
430
  R({
431
431
  circular: !0,
432
- createInternalComparator: () => C
432
+ createInternalComparator: () => T
433
433
  });
434
434
  R({
435
435
  circular: !0,
436
- createInternalComparator: () => C,
436
+ createInternalComparator: () => T,
437
437
  strict: !0
438
438
  });
439
439
  function R(e = {}) {
440
- const { circular: t = !1, createInternalComparator: r, createState: n, strict: o = !1 } = e, s = ut(e), i = at(s), u = r ? r(i) : ct(i);
441
- return lt({ circular: t, comparator: i, createState: n, equals: u, strict: o });
440
+ const { circular: t = !1, createInternalComparator: r, createState: n, strict: o = !1 } = e, u = ct(e), i = ut(u), s = r ? r(i) : lt(i);
441
+ return dt({ circular: t, comparator: i, createState: n, equals: s, strict: o });
442
442
  }
443
- var L = { exports: {} }, q = {};
443
+ var L = { exports: {} }, I = {};
444
444
  /**
445
445
  * @license React
446
446
  * use-sync-external-store-shim/with-selector.production.js
@@ -451,57 +451,57 @@ var L = { exports: {} }, q = {};
451
451
  * LICENSE file in the root directory of this source tree.
452
452
  */
453
453
  var ee;
454
- function ft() {
455
- if (ee) return q;
454
+ function ht() {
455
+ if (ee) return I;
456
456
  ee = 1;
457
- var e = w, t = W();
458
- function r(E, p) {
459
- return E === p && (E !== 0 || 1 / E === 1 / p) || E !== E && p !== p;
457
+ var e = A, t = W();
458
+ function r(c, h) {
459
+ return c === h && (c !== 0 || 1 / c === 1 / h) || c !== c && h !== h;
460
460
  }
461
- var n = typeof Object.is == "function" ? Object.is : r, o = t.useSyncExternalStore, s = e.useRef, i = e.useEffect, u = e.useMemo, d = e.useDebugValue;
462
- return q.useSyncExternalStoreWithSelector = function(E, p, h, v, c) {
463
- var f = s(null);
461
+ var n = typeof Object.is == "function" ? Object.is : r, o = t.useSyncExternalStore, u = e.useRef, i = e.useEffect, s = e.useMemo, y = e.useDebugValue;
462
+ return I.useSyncExternalStoreWithSelector = function(c, h, p, v, l) {
463
+ var f = u(null);
464
464
  if (f.current === null) {
465
465
  var m = { hasValue: !1, value: null };
466
466
  f.current = m;
467
467
  } else m = f.current;
468
- f = u(
468
+ f = s(
469
469
  function() {
470
- function l(S) {
471
- if (!y) {
472
- if (y = !0, b = S, S = v(S), c !== void 0 && m.hasValue) {
473
- var g = m.value;
474
- if (c(g, S))
475
- return O = g;
470
+ function d(S) {
471
+ if (!E) {
472
+ if (E = !0, w = S, S = v(S), l !== void 0 && m.hasValue) {
473
+ var O = m.value;
474
+ if (l(O, S))
475
+ return g = O;
476
476
  }
477
- return O = S;
477
+ return g = S;
478
478
  }
479
- if (g = O, n(b, S)) return g;
480
- var T = v(S);
481
- return c !== void 0 && c(g, T) ? (b = S, g) : (b = S, O = T);
479
+ if (O = g, n(w, S)) return O;
480
+ var C = v(S);
481
+ return l !== void 0 && l(O, C) ? (w = S, O) : (w = S, g = C);
482
482
  }
483
- var y = !1, b, O, _ = h === void 0 ? null : h;
483
+ var E = !1, w, g, _ = p === void 0 ? null : p;
484
484
  return [
485
485
  function() {
486
- return l(p());
486
+ return d(h());
487
487
  },
488
488
  _ === null ? void 0 : function() {
489
- return l(_());
489
+ return d(_());
490
490
  }
491
491
  ];
492
492
  },
493
- [p, h, v, c]
493
+ [h, p, v, l]
494
494
  );
495
- var a = o(E, f[0], f[1]);
495
+ var a = o(c, f[0], f[1]);
496
496
  return i(
497
497
  function() {
498
498
  m.hasValue = !0, m.value = a;
499
499
  },
500
500
  [a]
501
- ), d(a), a;
502
- }, q;
501
+ ), y(a), a;
502
+ }, I;
503
503
  }
504
- var P = {};
504
+ var q = {};
505
505
  /**
506
506
  * @license React
507
507
  * use-sync-external-store-shim/with-selector.development.js
@@ -512,74 +512,74 @@ var P = {};
512
512
  * LICENSE file in the root directory of this source tree.
513
513
  */
514
514
  var te;
515
- function ht() {
515
+ function pt() {
516
516
  return te || (te = 1, process.env.NODE_ENV !== "production" && (function() {
517
- function e(E, p) {
518
- return E === p && (E !== 0 || 1 / E === 1 / p) || E !== E && p !== p;
517
+ function e(c, h) {
518
+ return c === h && (c !== 0 || 1 / c === 1 / h) || c !== c && h !== h;
519
519
  }
520
520
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
521
- var t = w, r = W(), n = typeof Object.is == "function" ? Object.is : e, o = r.useSyncExternalStore, s = t.useRef, i = t.useEffect, u = t.useMemo, d = t.useDebugValue;
522
- P.useSyncExternalStoreWithSelector = function(E, p, h, v, c) {
523
- var f = s(null);
521
+ var t = A, r = W(), n = typeof Object.is == "function" ? Object.is : e, o = r.useSyncExternalStore, u = t.useRef, i = t.useEffect, s = t.useMemo, y = t.useDebugValue;
522
+ q.useSyncExternalStoreWithSelector = function(c, h, p, v, l) {
523
+ var f = u(null);
524
524
  if (f.current === null) {
525
525
  var m = { hasValue: !1, value: null };
526
526
  f.current = m;
527
527
  } else m = f.current;
528
- f = u(
528
+ f = s(
529
529
  function() {
530
- function l(S) {
531
- if (!y) {
532
- if (y = !0, b = S, S = v(S), c !== void 0 && m.hasValue) {
533
- var g = m.value;
534
- if (c(g, S))
535
- return O = g;
530
+ function d(S) {
531
+ if (!E) {
532
+ if (E = !0, w = S, S = v(S), l !== void 0 && m.hasValue) {
533
+ var O = m.value;
534
+ if (l(O, S))
535
+ return g = O;
536
536
  }
537
- return O = S;
537
+ return g = S;
538
538
  }
539
- if (g = O, n(b, S))
540
- return g;
541
- var T = v(S);
542
- return c !== void 0 && c(g, T) ? (b = S, g) : (b = S, O = T);
539
+ if (O = g, n(w, S))
540
+ return O;
541
+ var C = v(S);
542
+ return l !== void 0 && l(O, C) ? (w = S, O) : (w = S, g = C);
543
543
  }
544
- var y = !1, b, O, _ = h === void 0 ? null : h;
544
+ var E = !1, w, g, _ = p === void 0 ? null : p;
545
545
  return [
546
546
  function() {
547
- return l(p());
547
+ return d(h());
548
548
  },
549
549
  _ === null ? void 0 : function() {
550
- return l(_());
550
+ return d(_());
551
551
  }
552
552
  ];
553
553
  },
554
- [p, h, v, c]
554
+ [h, p, v, l]
555
555
  );
556
- var a = o(E, f[0], f[1]);
556
+ var a = o(c, f[0], f[1]);
557
557
  return i(
558
558
  function() {
559
559
  m.hasValue = !0, m.value = a;
560
560
  },
561
561
  [a]
562
- ), d(a), a;
562
+ ), y(a), a;
563
563
  }, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
564
- })()), P;
564
+ })()), q;
565
565
  }
566
566
  var re;
567
- function pt() {
568
- return re || (re = 1, process.env.NODE_ENV === "production" ? L.exports = ft() : L.exports = ht()), L.exports;
567
+ function mt() {
568
+ return re || (re = 1, process.env.NODE_ENV === "production" ? L.exports = ht() : L.exports = pt()), L.exports;
569
569
  }
570
- var mt = pt(), Et = (...e) => (t) => {
570
+ var Et = mt(), yt = (...e) => (t) => {
571
571
  e.forEach((r) => {
572
572
  typeof r == "function" ? r(t) : r && (r.current = t);
573
573
  });
574
- }, yt = ({ contentComponent: e }) => {
575
- const t = Re.useSyncExternalStore(
574
+ }, vt = ({ contentComponent: e }) => {
575
+ const t = Te.useSyncExternalStore(
576
576
  e.subscribe,
577
577
  e.getSnapshot,
578
578
  e.getServerSnapshot
579
579
  );
580
- return /* @__PURE__ */ A(ie, { children: Object.values(t) });
580
+ return /* @__PURE__ */ b(ie, { children: Object.values(t) });
581
581
  };
582
- function vt() {
582
+ function St() {
583
583
  const e = /* @__PURE__ */ new Set();
584
584
  let t = {};
585
585
  return {
@@ -615,12 +615,9 @@ function vt() {
615
615
  }
616
616
  };
617
617
  }
618
- var St = class extends w.Component {
618
+ var _t = class extends A.Component {
619
619
  constructor(e) {
620
- var t;
621
- super(e), this.editorContentRef = w.createRef(), this.initialized = !1, this.state = {
622
- hasContentComponentInitialized: !!((t = e.editor) != null && t.contentComponent)
623
- };
620
+ super(e), this.editorContentRef = A.createRef();
624
621
  }
625
622
  componentDidMount() {
626
623
  this.init();
@@ -637,20 +634,16 @@ var St = class extends w.Component {
637
634
  const r = this.editorContentRef.current;
638
635
  r.append(...t.view.dom.parentNode.childNodes), t.setOptions({
639
636
  element: r
640
- }), t.contentComponent = vt(), this.state.hasContentComponentInitialized || (this.unsubscribeToContentComponent = t.contentComponent.subscribe(() => {
641
- this.setState((n) => n.hasContentComponentInitialized ? n : {
642
- hasContentComponentInitialized: !0
643
- }), this.unsubscribeToContentComponent && this.unsubscribeToContentComponent();
644
- })), t.createNodeViews(), this.initialized = !0;
637
+ }), t.contentComponent = St(), t.createNodeViews(), t.isEditorContentInitialized = !0, this.forceUpdate();
645
638
  }
646
639
  }
647
640
  componentWillUnmount() {
648
641
  var e;
649
642
  const t = this.props.editor;
650
643
  if (t) {
651
- this.initialized = !1, t.isDestroyed || t.view.setProps({
644
+ t.isEditorContentInitialized = !1, t.isDestroyed || t.view.setProps({
652
645
  nodeViews: {}
653
- }), this.unsubscribeToContentComponent && this.unsubscribeToContentComponent(), t.contentComponent = null;
646
+ }), t.contentComponent = null;
654
647
  try {
655
648
  if (!((e = t.view.dom) != null && e.parentNode))
656
649
  return;
@@ -664,21 +657,21 @@ var St = class extends w.Component {
664
657
  }
665
658
  render() {
666
659
  const { editor: e, innerRef: t, ...r } = this.props;
667
- return /* @__PURE__ */ Oe(ie, { children: [
668
- /* @__PURE__ */ A("div", { ref: Et(t, this.editorContentRef), ...r }),
669
- (e == null ? void 0 : e.contentComponent) && /* @__PURE__ */ A(yt, { contentComponent: e.contentComponent })
660
+ return /* @__PURE__ */ ge(ie, { children: [
661
+ /* @__PURE__ */ b("div", { ref: yt(t, this.editorContentRef), ...r }),
662
+ (e == null ? void 0 : e.contentComponent) && /* @__PURE__ */ b(vt, { contentComponent: e.contentComponent })
670
663
  ] });
671
664
  }
672
- }, _t = ve(
665
+ }, gt = ve(
673
666
  (e, t) => {
674
- const r = w.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [e.editor]);
675
- return w.createElement(St, {
667
+ const r = A.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [e.editor]);
668
+ return A.createElement(_t, {
676
669
  key: r,
677
670
  innerRef: t,
678
671
  ...e
679
672
  });
680
673
  }
681
- ), Ot = w.memo(_t), gt = typeof window < "u" ? Ee : ye, bt = class {
674
+ ), Ot = A.memo(gt), wt = typeof window < "u" ? Ee : ye, At = class {
682
675
  constructor(e) {
683
676
  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);
684
677
  }
@@ -716,33 +709,33 @@ var St = class extends w.Component {
716
709
  }
717
710
  }
718
711
  };
719
- function It(e) {
712
+ function Mt(e) {
720
713
  var t;
721
- const [r] = pe(() => new bt(e.editor)), n = mt.useSyncExternalStoreWithSelector(
714
+ const [r] = pe(() => new At(e.editor)), n = Et.useSyncExternalStoreWithSelector(
722
715
  r.subscribe,
723
716
  r.getSnapshot,
724
717
  r.getServerSnapshot,
725
718
  e.selector,
726
- (t = e.equalityFn) != null ? t : dt
719
+ (t = e.equalityFn) != null ? t : ft
727
720
  );
728
- return gt(() => r.watch(e.editor), [e.editor, r]), me(n), n;
721
+ return wt(() => r.watch(e.editor), [e.editor, r]), me(n), n;
729
722
  }
730
723
  process.env.NODE_ENV;
731
- var B = G({
724
+ var B = U({
732
725
  editor: null
733
726
  });
734
727
  B.Consumer;
735
- var Vt = () => U(B), ae = G({
728
+ var It = () => G(B), ae = U({
736
729
  onDragStart: () => {
737
730
  },
738
731
  nodeViewContentChildren: void 0,
739
732
  nodeViewContentRef: () => {
740
733
  }
741
- }), wt = () => U(ae), qt = w.forwardRef((e, t) => {
742
- const { onDragStart: r } = wt(), n = e.as || "div";
734
+ }), bt = () => G(ae), qt = A.forwardRef((e, t) => {
735
+ const { onDragStart: r } = bt(), n = e.as || "div";
743
736
  return (
744
737
  // @ts-ignore
745
- /* @__PURE__ */ A(
738
+ /* @__PURE__ */ b(
746
739
  n,
747
740
  {
748
741
  ...e,
@@ -763,13 +756,13 @@ function ne(e) {
763
756
  function oe(e) {
764
757
  return !!(typeof e == "object" && e.$$typeof && (e.$$typeof.toString() === "Symbol(react.forward_ref)" || e.$$typeof.description === "react.forward_ref"));
765
758
  }
766
- function At(e) {
759
+ function Rt(e) {
767
760
  return !!(typeof e == "object" && e.$$typeof && (e.$$typeof.toString() === "Symbol(react.memo)" || e.$$typeof.description === "react.memo"));
768
761
  }
769
- function Rt(e) {
762
+ function Tt(e) {
770
763
  if (ne(e) || oe(e))
771
764
  return !0;
772
- if (At(e)) {
765
+ if (Rt(e)) {
773
766
  const t = e.type;
774
767
  if (t)
775
768
  return ne(t) || oe(t);
@@ -778,18 +771,18 @@ function Rt(e) {
778
771
  }
779
772
  function Ct() {
780
773
  try {
781
- if ($)
782
- return parseInt($.split(".")[0], 10) >= 19;
774
+ if (k)
775
+ return parseInt(k.split(".")[0], 10) >= 19;
783
776
  } catch {
784
777
  }
785
778
  return !1;
786
779
  }
787
- var Tt = class {
780
+ var Nt = class {
788
781
  /**
789
782
  * Immediately creates element and renders the provided React component.
790
783
  */
791
784
  constructor(e, { editor: t, props: r = {}, as: n = "div", className: o = "" }) {
792
- this.ref = null, this.destroyed = !1, this.id = Math.floor(Math.random() * 4294967295).toString(), this.component = e, this.editor = t, this.props = r, this.element = document.createElement(n), this.element.classList.add("react-renderer"), o && this.element.classList.add(...o.split(" ")), this.editor.isInitialized ? _e(() => {
785
+ this.ref = null, this.destroyed = !1, this.id = Math.floor(Math.random() * 4294967295).toString(), this.component = e, this.editor = t, this.props = r, this.element = document.createElement(n), this.element.classList.add("react-renderer"), o && this.element.classList.add(...o.split(" ")), this.editor.isEditorContentInitialized ? _e(() => {
793
786
  this.render();
794
787
  }) : queueMicrotask(() => {
795
788
  this.destroyed || this.render();
@@ -802,16 +795,29 @@ var Tt = class {
802
795
  var e;
803
796
  if (this.destroyed)
804
797
  return;
805
- const t = this.component, r = this.props, n = this.editor, o = Ct(), s = Rt(t), i = { ...r };
806
- i.ref && !(o || s) && delete i.ref, !i.ref && (o || s) && (i.ref = (u) => {
807
- this.ref = u;
808
- }), this.reactElement = /* @__PURE__ */ A(t, { ...i }), (e = n == null ? void 0 : n.contentComponent) == null || e.setRenderer(this.id, this);
798
+ const t = this.component, r = this.props, n = this.editor, o = Ct(), u = Tt(t), i = { ...r };
799
+ i.ref && !(o || u) && delete i.ref, !i.ref && (o || u) && (i.ref = (s) => {
800
+ this.ref = s;
801
+ }), this.reactElement = /* @__PURE__ */ b(t, { ...i }), (e = n == null ? void 0 : n.contentComponent) == null || e.setRenderer(this.id, this);
809
802
  }
810
803
  /**
811
804
  * Re-renders the React component with new props.
805
+ * Skips the render if none of the supplied props actually changed,
806
+ * to avoid unnecessary portal re-creation.
812
807
  */
813
808
  updateProps(e = {}) {
814
- this.destroyed || (this.props = {
809
+ if (this.destroyed)
810
+ return;
811
+ let t = !1;
812
+ const r = Object.keys(e);
813
+ for (let n = 0; n < r.length; n += 1) {
814
+ const o = r[n];
815
+ if (e[o] !== this.props[o]) {
816
+ t = !0;
817
+ break;
818
+ }
819
+ }
820
+ t && (this.props = {
815
821
  ...this.props,
816
822
  ...e
817
823
  }, this.render());
@@ -838,19 +844,23 @@ var Tt = class {
838
844
  });
839
845
  }
840
846
  };
841
- w.createContext({
847
+ A.createContext({
842
848
  markViewContentRef: () => {
843
849
  }
844
850
  });
845
- var Nt = class extends ge {
851
+ var Dt = class extends Oe {
846
852
  constructor(e, t, r) {
847
- if (super(e, t, r), this.selectionRafId = null, this.cachedExtensionWithSyncedStorage = null, !this.node.isLeaf) {
853
+ if (super(e, t, r), this.selectionRafId = null, this.handlePositionUpdate = () => {
854
+ const n = this.getPos();
855
+ typeof n != "number" || n === this.currentPos || (this.currentPos = n, this.renderer.updateProps({ getPos: () => this.getPos() }), typeof this.options.attrs == "function" && this.updateElementAttributes());
856
+ }, this.cachedExtensionWithSyncedStorage = null, !this.node.isLeaf) {
848
857
  this.options.contentDOMElementTag ? this.contentDOMElement = document.createElement(this.options.contentDOMElementTag) : this.contentDOMElement = document.createElement(this.node.isInline ? "span" : "div"), this.contentDOMElement.dataset.nodeViewContentReact = "", this.contentDOMElement.dataset.nodeViewWrapper = "", this.contentDOMElement.style.whiteSpace = "inherit";
849
858
  const n = this.dom.querySelector("[data-node-view-content]");
850
859
  if (!n)
851
860
  return;
852
861
  n.appendChild(this.contentDOMElement);
853
862
  }
863
+ this.options.trackNodeViewPosition && this.editor.on("update", this.handlePositionUpdate);
854
864
  }
855
865
  /**
856
866
  * Returns a proxy of the extension that redirects storage access to the editor's mutable storage.
@@ -862,8 +872,8 @@ var Nt = class extends ge {
862
872
  const e = this.editor, t = this.extension;
863
873
  this.cachedExtensionWithSyncedStorage = new Proxy(t, {
864
874
  get(r, n, o) {
865
- var s;
866
- return n === "storage" ? (s = e.storage[t.name]) != null ? s : {} : Reflect.get(r, n, o);
875
+ var u;
876
+ return n === "storage" ? (u = e.storage[t.name]) != null ? u : {} : Reflect.get(r, n, o);
867
877
  }
868
878
  });
869
879
  }
@@ -874,7 +884,7 @@ var Nt = class extends ge {
874
884
  * Called on initialization.
875
885
  */
876
886
  mount() {
877
- const e = {
887
+ const t = {
878
888
  editor: this.editor,
879
889
  node: this.node,
880
890
  decorations: this.decorations,
@@ -884,27 +894,27 @@ var Nt = class extends ge {
884
894
  extension: this.extensionWithSyncedStorage,
885
895
  HTMLAttributes: this.HTMLAttributes,
886
896
  getPos: () => this.getPos(),
887
- updateAttributes: (d = {}) => this.updateAttributes(d),
897
+ updateAttributes: (c = {}) => this.updateAttributes(c),
888
898
  deleteNode: () => this.deleteNode(),
889
899
  ref: de()
890
900
  };
891
901
  if (!this.component.displayName) {
892
- const d = (E) => E.charAt(0).toUpperCase() + E.substring(1);
893
- this.component.displayName = d(this.extension.name);
902
+ const c = (h) => h.charAt(0).toUpperCase() + h.substring(1);
903
+ this.component.displayName = c(this.extension.name);
894
904
  }
895
- const n = { onDragStart: this.onDragStart.bind(this), nodeViewContentRef: (d) => {
896
- d && this.contentDOMElement && d.firstChild !== this.contentDOMElement && (d.hasAttribute("data-node-view-wrapper") && d.removeAttribute("data-node-view-wrapper"), d.appendChild(this.contentDOMElement));
897
- } }, o = this.component, s = fe((d) => /* @__PURE__ */ A(ae.Provider, { value: n, children: he(o, d) }));
898
- s.displayName = "ReactNodeView";
899
- let i = this.node.isInline ? "span" : "div";
900
- this.options.as && (i = this.options.as);
901
- const { className: u = "" } = this.options;
902
- this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this), this.renderer = new Tt(s, {
905
+ const o = { onDragStart: this.onDragStart.bind(this), nodeViewContentRef: (c) => {
906
+ c && this.contentDOMElement && c.firstChild !== this.contentDOMElement && (c.hasAttribute("data-node-view-wrapper") && c.removeAttribute("data-node-view-wrapper"), c.appendChild(this.contentDOMElement));
907
+ } }, u = this.component, i = fe((c) => /* @__PURE__ */ b(ae.Provider, { value: o, children: he(u, c) }));
908
+ i.displayName = "ReactNodeView";
909
+ let s = this.node.isInline ? "span" : "div";
910
+ this.options.as && (s = this.options.as);
911
+ const { className: y = "" } = this.options;
912
+ this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this), this.renderer = new Nt(i, {
903
913
  editor: this.editor,
904
- props: e,
905
- as: i,
906
- className: `node-${this.node.type.name} ${u}`.trim()
907
- }), this.editor.on("selectionUpdate", this.handleSelectionUpdate), this.updateElementAttributes();
914
+ props: t,
915
+ as: s,
916
+ className: `node-${this.node.type.name} ${y}`.trim()
917
+ }), this.editor.on("selectionUpdate", this.handleSelectionUpdate), this.updateElementAttributes(), this.currentPos = this.getPos();
908
918
  }
909
919
  /**
910
920
  * Return the DOM element.
@@ -930,17 +940,23 @@ var Nt = class extends ge {
930
940
  handleSelectionUpdate() {
931
941
  this.selectionRafId && (cancelAnimationFrame(this.selectionRafId), this.selectionRafId = null), this.selectionRafId = requestAnimationFrame(() => {
932
942
  this.selectionRafId = null;
933
- const { from: e, to: t } = this.editor.state.selection, r = this.getPos();
934
- if (typeof r == "number")
935
- if (e <= r && t >= r + this.node.nodeSize) {
936
- if (this.renderer.props.selected)
937
- return;
938
- this.selectNode();
939
- } else {
940
- if (!this.renderer.props.selected)
941
- return;
942
- this.deselectNode();
943
- }
943
+ const e = this.currentPos;
944
+ if (typeof e != "number")
945
+ return;
946
+ if (we({
947
+ selection: this.editor.state.selection,
948
+ pos: e,
949
+ nodeSize: this.node.nodeSize,
950
+ selectedOnTextSelection: this.options.selectedOnTextSelection
951
+ })) {
952
+ if (this.renderer.props.selected)
953
+ return;
954
+ this.selectNode();
955
+ } else {
956
+ if (!this.renderer.props.selected)
957
+ return;
958
+ this.deselectNode();
959
+ }
944
960
  });
945
961
  }
946
962
  /**
@@ -948,24 +964,34 @@ var Nt = class extends ge {
948
964
  * To prevent unnecessary updates, the `update` option can be used.
949
965
  */
950
966
  update(e, t, r) {
951
- const n = (o) => {
952
- this.renderer.updateProps(o), typeof this.options.attrs == "function" && this.updateElementAttributes();
967
+ const n = (s) => {
968
+ this.renderer.updateProps(s), typeof this.options.attrs == "function" && this.updateElementAttributes();
953
969
  };
954
970
  if (e.type !== this.node.type)
955
971
  return !1;
956
972
  if (typeof this.options.update == "function") {
957
- const o = this.node, s = this.decorations, i = this.innerDecorations;
958
- return this.node = e, this.decorations = t, this.innerDecorations = r, this.options.update({
959
- oldNode: o,
960
- oldDecorations: s,
973
+ const s = this.node, y = this.decorations, c = this.innerDecorations;
974
+ return this.node = e, this.decorations = t, this.innerDecorations = r, this.currentPos = this.getPos(), this.options.update({
975
+ oldNode: s,
976
+ oldDecorations: y,
961
977
  newNode: e,
962
978
  newDecorations: t,
963
- oldInnerDecorations: i,
979
+ oldInnerDecorations: c,
964
980
  innerDecorations: r,
965
981
  updateProps: () => n({ node: e, decorations: t, innerDecorations: r, extension: this.extensionWithSyncedStorage })
966
982
  });
967
983
  }
968
- return e === this.node && this.decorations === t && this.innerDecorations === r || (this.node = e, this.decorations = t, this.innerDecorations = r, n({ node: e, decorations: t, innerDecorations: r, extension: this.extensionWithSyncedStorage })), !0;
984
+ if (!(e !== this.node))
985
+ return this.node = e, this.decorations = t, this.innerDecorations = r, !0;
986
+ const u = this.getPos();
987
+ this.node = e, this.decorations = t, this.innerDecorations = r, this.currentPos = u;
988
+ const i = {
989
+ node: e,
990
+ decorations: t,
991
+ innerDecorations: r,
992
+ extension: this.extensionWithSyncedStorage
993
+ };
994
+ return this.options.trackNodeViewPosition && (i.getPos = () => this.getPos()), n(i), !0;
969
995
  }
970
996
  /**
971
997
  * Select the node.
@@ -989,7 +1015,7 @@ var Nt = class extends ge {
989
1015
  * Destroy the React component instance.
990
1016
  */
991
1017
  destroy() {
992
- this.renderer.destroy(), this.editor.off("selectionUpdate", this.handleSelectionUpdate), this.contentDOMElement = null, this.selectionRafId && (cancelAnimationFrame(this.selectionRafId), this.selectionRafId = null);
1018
+ this.renderer.destroy(), this.editor.off("selectionUpdate", this.handleSelectionUpdate), this.options.trackNodeViewPosition && this.editor.off("update", this.handlePositionUpdate), this.contentDOMElement = null, this.selectionRafId && (cancelAnimationFrame(this.selectionRafId), this.selectionRafId = null);
993
1019
  }
994
1020
  /**
995
1021
  * Update the attributes of the top-level element that holds the React component.
@@ -999,7 +1025,7 @@ var Nt = class extends ge {
999
1025
  if (this.options.attrs) {
1000
1026
  let e = {};
1001
1027
  if (typeof this.options.attrs == "function") {
1002
- const t = this.editor.extensionManager.attributes, r = be(this.node, t);
1028
+ const t = this.editor.extensionManager.attributes, r = Ae(this.node, t);
1003
1029
  e = this.options.attrs({ node: this.node, HTMLAttributes: r });
1004
1030
  } else
1005
1031
  e = this.options.attrs;
@@ -1007,27 +1033,27 @@ var Nt = class extends ge {
1007
1033
  }
1008
1034
  }
1009
1035
  };
1010
- function Pt(e, t) {
1011
- return (r) => r.editor.contentComponent ? new Nt(e, r, t) : {};
1036
+ function Ut(e, t) {
1037
+ return (r) => r.editor.contentComponent ? new Dt(e, r, t) : {};
1012
1038
  }
1013
- var z = G({
1039
+ var $ = U({
1014
1040
  get editor() {
1015
1041
  throw new Error("useTiptap must be used within a <Tiptap> provider");
1016
1042
  }
1017
1043
  });
1018
- z.displayName = "TiptapContext";
1019
- var Dt = () => U(z);
1044
+ $.displayName = "TiptapContext";
1045
+ var jt = () => G($);
1020
1046
  function ue({ editor: e, instance: t, children: r }) {
1021
1047
  const n = e ?? t;
1022
1048
  if (!n)
1023
1049
  throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");
1024
- const o = k(() => ({ editor: n }), [n]), s = k(() => ({ editor: n }), [n]);
1025
- return /* @__PURE__ */ A(B.Provider, { value: s, children: /* @__PURE__ */ A(z.Provider, { value: o, children: r }) });
1050
+ const o = z(() => ({ editor: n }), [n]), u = z(() => ({ editor: n }), [n]);
1051
+ return /* @__PURE__ */ b(B.Provider, { value: u, children: /* @__PURE__ */ b($.Provider, { value: o, children: r }) });
1026
1052
  }
1027
1053
  ue.displayName = "Tiptap";
1028
1054
  function ce({ ...e }) {
1029
- const { editor: t } = Dt();
1030
- return /* @__PURE__ */ A(Ot, { editor: t, ...e });
1055
+ const { editor: t } = jt();
1056
+ return /* @__PURE__ */ b(Ot, { editor: t, ...e });
1031
1057
  }
1032
1058
  ce.displayName = "Tiptap.Content";
1033
1059
  Object.assign(ue, {
@@ -1053,10 +1079,10 @@ function Gt() {
1053
1079
  export {
1054
1080
  B as E,
1055
1081
  qt as N,
1056
- Tt as R,
1057
- Pt as a,
1058
- It as b,
1082
+ Nt as R,
1083
+ Ut as a,
1084
+ Mt as b,
1059
1085
  Gt as c,
1060
- Re as s,
1061
- Vt as u
1086
+ Te as s,
1087
+ It as u
1062
1088
  };