@uva-glass/component-library 1.51.0 → 1.52.1

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 (60) hide show
  1. package/dist/{Lexical.prod-DSsdOWxu.js → Lexical.prod-zUeT_jIr.js} +253 -246
  2. package/dist/Lexical.prod-zUeT_jIr.js.map +1 -0
  3. package/dist/LexicalUtils.prod-DtRifALg.js +64 -0
  4. package/dist/LexicalUtils.prod-DtRifALg.js.map +1 -0
  5. package/dist/ListPlugin-CxyYg2bv.js +588 -0
  6. package/dist/ListPlugin-CxyYg2bv.js.map +1 -0
  7. package/dist/RteEditor.module--4R0Ql6Y.js +26 -0
  8. package/dist/RteEditor.module--4R0Ql6Y.js.map +1 -0
  9. package/dist/assets/HorizontalList.css +1 -1
  10. package/dist/assets/RteEditor.css +1 -1
  11. package/dist/assets/useFlyout.css +1 -0
  12. package/dist/components/Buttons/Button.stories.js +1 -1
  13. package/dist/components/Buttons/Button.stories.js.map +1 -1
  14. package/dist/components/Buttons/LinkButton.stories.js +5 -5
  15. package/dist/components/Buttons/LinkButton.stories.js.map +1 -1
  16. package/dist/components/Buttons/MenuButton.stories.js +10 -10
  17. package/dist/components/Buttons/MenuButton.stories.js.map +1 -1
  18. package/dist/components/HorizontalList/HorizontalList.d.ts +3 -2
  19. package/dist/components/HorizontalList/HorizontalList.js +10 -9
  20. package/dist/components/HorizontalList/HorizontalList.js.map +1 -1
  21. package/dist/components/HorizontalList/HorizontalList.stories.d.ts +1 -0
  22. package/dist/components/HorizontalList/HorizontalList.stories.js +35 -14
  23. package/dist/components/HorizontalList/HorizontalList.stories.js.map +1 -1
  24. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +2 -2
  25. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.d.ts +6 -0
  26. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +98 -0
  27. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -0
  28. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.d.ts +8 -0
  29. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +7 -0
  30. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js.map +1 -0
  31. package/dist/components/RteEditor/Plugins/LinkPlugin/index.d.ts +1 -0
  32. package/dist/components/RteEditor/Plugins/LinkPlugin/index.js +5 -0
  33. package/dist/components/RteEditor/Plugins/LinkPlugin/index.js.map +1 -0
  34. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +3 -3
  35. package/dist/components/RteEditor/Plugins/ListPlugin/index.js +1 -1
  36. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.d.ts +6 -0
  37. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +33 -28
  38. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
  39. package/dist/components/RteEditor/Plugins/index.js +1 -1
  40. package/dist/components/RteEditor/RteEditor.js +532 -457
  41. package/dist/components/RteEditor/RteEditor.js.map +1 -1
  42. package/dist/components/RteEditor/RteEditor.stories.js +1 -1
  43. package/dist/components/RteEditor/RteEditor.stories.js.map +1 -1
  44. package/dist/components/RteEditor/UvaTheme/UvaTheme.d.ts +1 -0
  45. package/dist/components/RteEditor/UvaTheme/UvaTheme.js +5 -4
  46. package/dist/components/RteEditor/UvaTheme/UvaTheme.js.map +1 -1
  47. package/dist/components/RteEditor/hooks/index.d.ts +1 -0
  48. package/dist/components/RteEditor/hooks/index.js +5 -0
  49. package/dist/components/RteEditor/hooks/index.js.map +1 -0
  50. package/dist/components/RteEditor/hooks/useFlyout.d.ts +12 -0
  51. package/dist/components/RteEditor/hooks/useFlyout.js +45 -0
  52. package/dist/components/RteEditor/hooks/useFlyout.js.map +1 -0
  53. package/dist/helpers-DpGAANJ8.js +365 -0
  54. package/dist/helpers-DpGAANJ8.js.map +1 -0
  55. package/package.json +15 -15
  56. package/dist/Lexical.prod-DSsdOWxu.js.map +0 -1
  57. package/dist/ListPlugin-Bu2AbCDB.js +0 -643
  58. package/dist/ListPlugin-Bu2AbCDB.js.map +0 -1
  59. package/dist/RteEditor.module-RkKUrkOO.js +0 -21
  60. package/dist/RteEditor.module-RkKUrkOO.js.map +0 -1
@@ -1,31 +1,33 @@
1
- import { jsx as y, jsxs as J, Fragment as $e } from "react/jsx-runtime";
2
- import { W as qe, w as P, P as te, I as p, l as He, c as Xe, u as A, e as F, y as x, F as Ye, g as T, T as Ze, X as Y, h as Ne, m as w, i as Se, $ as De, j as Pe, v as Ge, S as ie, b as Qe, E as Z, C as se, k as ae, n as Te, q as et, r as tt, M as _e, A as nt, s as rt, x as ot, z as it, B as st, D as h, G as at, H as L, J as lt, V as ct, K as ut, N as G, O as dt, Q as ft, R as mt, U as pt, Y as gt, Z as ht, a0 as wt, a1 as le, a as ce, a2 as vt, a3 as H, a4 as yt, a5 as ue, a6 as Ct, a7 as Et, a8 as bt, a9 as xt, aa as $t, ab as Nt, ac as St, ad as Dt, d as Pt, ae as Tt, af as _t, ag as Lt, ah as Ot, ai as Rt, t as Ft } from "../../Lexical.prod-DSsdOWxu.js";
3
- import * as X from "react";
4
- import { useMemo as V, useLayoutEffect as M, useEffect as _, useRef as It, useState as I, Suspense as At, forwardRef as Le, useCallback as Mt } from "react";
5
- import { i as O, a as q, e as kt, t as Oe, J as Re, D as Fe, Z as Kt } from "../../ListPlugin-Bu2AbCDB.js";
6
- import { r as de } from "../../index-DsprzSCj.js";
7
- import { s as B } from "../../RteEditor.module-RkKUrkOO.js";
8
- import { ToolBarPlugin as Bt } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
9
- import { UvaTheme as jt } from "./UvaTheme/UvaTheme.js";
10
- const Ie = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, zt = Ie ? M : _, j = { tag: "history-merge" };
11
- function Ut({ initialConfig: t, children: e }) {
12
- const n = V(() => {
13
- const { theme: r, namespace: o, nodes: s, onError: i, editorState: a, html: l } = t, c = Xe(null, r), u = qe({ editable: t.editable, html: l, namespace: o, nodes: s, onError: (d) => i(d, u), theme: r });
1
+ import { jsx as y, jsxs as J, Fragment as Le } from "react/jsx-runtime";
2
+ import { W as Ge, w as P, P as ne, I as g, e as Qe, g as et, u as R, h as F, y as b, F as tt, l as _, T as nt, X as G, i as Te, m as h, j as Pe, $ as _e, k as Re, v as rt, S as ae, b as ot, E as Q, C as le, n as ce, q as Oe, r as it, s as st, M as ke, A as at, z as lt, B as ct, D as Fe, G as ut, H as v, K as dt, c as O, N as ft, V as mt, O as pt, Q as V, R as gt, U as ht, Z as vt, a0 as wt, a1 as yt, a2 as Et, a3 as Ct, a4 as ue, a as de, a5 as bt, a6 as X, a7 as xt, a8 as fe, a9 as $t, aa as Nt, ab as Dt, ac as St, ad as Lt, ae as Tt, af as Pt, ag as _t, d as Rt, ah as Ot, ai as kt, aj as Ft, ak as At, al as It, t as Mt, L as me, am as Kt, x as Ut } from "../../Lexical.prod-zUeT_jIr.js";
3
+ import * as Y from "react";
4
+ import { useMemo as H, useLayoutEffect as I, useEffect as D, useRef as Bt, useState as A, Suspense as jt, forwardRef as Ae, useCallback as zt } from "react";
5
+ import { i as T, L as U, e as Wt, t as re } from "../../LexicalUtils.prod-DtRifALg.js";
6
+ import { r as pe } from "../../index-DsprzSCj.js";
7
+ import { J as Ie, D as Me, Z as Jt } from "../../ListPlugin-CxyYg2bv.js";
8
+ import { a as Ke, U as ge, m as Z, g as Vt, b as qt, F as Ht, M as Xt, f as Yt } from "../../helpers-DpGAANJ8.js";
9
+ import { s as K } from "../../RteEditor.module--4R0Ql6Y.js";
10
+ import { ToolBarPlugin as Zt } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
11
+ import { UvaTheme as Gt } from "./UvaTheme/UvaTheme.js";
12
+ const Ue = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Qt = Ue ? I : D, j = { tag: "history-merge" };
13
+ function en({ initialConfig: t, children: e }) {
14
+ const n = H(() => {
15
+ const { theme: r, namespace: i, nodes: s, onError: o, editorState: a, html: l } = t, c = et(null, r), u = Ge({ editable: t.editable, html: l, namespace: i, nodes: s, onError: (d) => o(d, u), theme: r });
14
16
  return function(d, f) {
15
17
  if (f !== null) {
16
18
  if (f === void 0) d.update(() => {
17
- const g = P();
18
- if (g.isEmpty()) {
19
- const m = te();
20
- g.append(m);
21
- const v = Ie ? document.activeElement : null;
22
- (p() !== null || v !== null && v === d.getRootElement()) && m.select();
19
+ const p = P();
20
+ if (p.isEmpty()) {
21
+ const m = ne();
22
+ p.append(m);
23
+ const w = Ue ? document.activeElement : null;
24
+ (g() !== null || w !== null && w === d.getRootElement()) && m.select();
23
25
  }
24
26
  }, j);
25
27
  else if (f !== null) switch (typeof f) {
26
28
  case "string": {
27
- const g = d.parseEditorState(f);
28
- d.setEditorState(g, j);
29
+ const p = d.parseEditorState(f);
30
+ d.setEditorState(p, j);
29
31
  break;
30
32
  }
31
33
  case "object":
@@ -39,141 +41,141 @@ function Ut({ initialConfig: t, children: e }) {
39
41
  }
40
42
  }(u, a), [u, c];
41
43
  }, []);
42
- return zt(() => {
43
- const r = t.editable, [o] = n;
44
- o.setEditable(r === void 0 || r);
45
- }, []), y(He.Provider, { value: n, children: e });
44
+ return Qt(() => {
45
+ const r = t.editable, [i] = n;
46
+ i.setEditable(r === void 0 || r);
47
+ }, []), y(Qe.Provider, { value: n, children: e });
46
48
  }
47
- const Jt = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? M : _;
48
- function Wt(t) {
49
+ const tn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? I : D;
50
+ function nn(t) {
49
51
  return { initialValueFn: () => t.isEditable(), subscribe: (e) => t.registerEditableListener(e) };
50
52
  }
51
- function Vt() {
53
+ function rn() {
52
54
  return function(t) {
53
- const [e] = A(), n = V(() => t(e), [e, t]), r = It(n.initialValueFn()), [o, s] = I(r.current);
54
- return Jt(() => {
55
- const { initialValueFn: i, subscribe: a } = n, l = i();
55
+ const [e] = R(), n = H(() => t(e), [e, t]), r = Bt(n.initialValueFn()), [i, s] = A(r.current);
56
+ return tn(() => {
57
+ const { initialValueFn: o, subscribe: a } = n, l = o();
56
58
  return r.current !== l && (r.current = l, s(l)), a((c) => {
57
59
  r.current = c, s(c);
58
60
  });
59
- }, [n, t]), o;
60
- }(Wt);
61
+ }, [n, t]), i;
62
+ }(nn);
61
63
  }
62
- function qt() {
64
+ function on() {
63
65
  return P().getTextContent();
64
66
  }
65
- function Ht(t, e = !0) {
67
+ function sn(t, e = !0) {
66
68
  if (t) return !1;
67
- let n = qt();
69
+ let n = on();
68
70
  return e && (n = n.trim()), n === "";
69
71
  }
70
- function Xt(t) {
71
- if (!Ht(t, !1)) return !1;
72
+ function an(t) {
73
+ if (!sn(t, !1)) return !1;
72
74
  const e = P().getChildren(), n = e.length;
73
75
  if (n > 1) return !1;
74
76
  for (let r = 0; r < n; r++) {
75
- const o = e[r];
76
- if (F(o)) return !1;
77
- if (x(o)) {
78
- if (!Ye(o) || o.__indent !== 0) return !1;
79
- const s = o.getChildren(), i = s.length;
80
- for (let a = 0; a < i; a++) {
77
+ const i = e[r];
78
+ if (F(i)) return !1;
79
+ if (b(i)) {
80
+ if (!tt(i) || i.__indent !== 0) return !1;
81
+ const s = i.getChildren(), o = s.length;
82
+ for (let a = 0; a < o; a++) {
81
83
  const l = s[r];
82
- if (!T(l)) return !1;
84
+ if (!_(l)) return !1;
83
85
  }
84
86
  }
85
87
  }
86
88
  return !0;
87
89
  }
88
- function Ae(t) {
89
- return () => Xt(t);
90
+ function Be(t) {
91
+ return () => an(t);
90
92
  }
91
- function Yt(t) {
93
+ function ln(t) {
92
94
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
93
95
  }
94
- Yt(function(t) {
96
+ ln(function(t) {
95
97
  const e = new URLSearchParams();
96
98
  e.append("code", t);
97
99
  for (let n = 1; n < arguments.length; n++) e.append("v", arguments[n]);
98
100
  throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
99
101
  });
100
- function Zt(t) {
102
+ function cn(t) {
101
103
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
102
104
  }
103
- Zt(function(t) {
105
+ cn(function(t) {
104
106
  const e = new URLSearchParams();
105
107
  e.append("code", t);
106
108
  for (let n = 1; n < arguments.length; n++) e.append("v", arguments[n]);
107
109
  throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
108
110
  });
109
- const Gt = /* @__PURE__ */ new Map();
110
- function Qt(t) {
111
+ const un = /* @__PURE__ */ new Map();
112
+ function dn(t) {
111
113
  const e = {}, n = t.split(";");
112
114
  for (const r of n) if (r !== "") {
113
- const [o, s] = r.split(/:([^]+)/);
114
- o && s && (e[o.trim()] = s.trim());
115
+ const [i, s] = r.split(/:([^]+)/);
116
+ i && s && (e[i.trim()] = s.trim());
115
117
  }
116
118
  return e;
117
119
  }
118
- function Me(t, e) {
120
+ function je(t, e) {
119
121
  const n = t.getStartEndPoints();
120
122
  if (e.isSelected(t) && !e.isSegmented() && !e.isToken() && n !== null) {
121
- const [r, o] = n, s = t.isBackward(), i = r.getNode(), a = o.getNode(), l = e.is(i), c = e.is(a);
123
+ const [r, i] = n, s = t.isBackward(), o = r.getNode(), a = i.getNode(), l = e.is(o), c = e.is(a);
122
124
  if (l || c) {
123
- const [u, d] = Ze(t), f = i.is(a), g = e.is(s ? a : i), m = e.is(s ? i : a);
124
- let v, $ = 0;
125
- return f ? ($ = u > d ? d : u, v = u > d ? u : d) : g ? ($ = s ? d : u, v = void 0) : m && ($ = 0, v = s ? u : d), e.__text = e.__text.slice($, v), e;
125
+ const [u, d] = nt(t), f = o.is(a), p = e.is(s ? a : o), m = e.is(s ? o : a);
126
+ let w, x = 0;
127
+ return f ? (x = u > d ? d : u, w = u > d ? u : d) : p ? (x = s ? d : u, w = void 0) : m && (x = 0, w = s ? u : d), e.__text = e.__text.slice(x, w), e;
126
128
  }
127
129
  }
128
130
  return e;
129
131
  }
130
- function en(t) {
131
- const e = t.getStyle(), n = Qt(e);
132
- Gt.set(e, n);
132
+ function fn(t) {
133
+ const e = t.getStyle(), n = dn(e);
134
+ un.set(e, n);
133
135
  }
134
- function fe(t, e) {
135
- const n = Y(t.focus, e);
136
- return F(n) && !n.isIsolated() || x(n) && !n.isInline() && !n.canBeEmpty();
136
+ function he(t, e) {
137
+ const n = G(t.focus, e);
138
+ return F(n) && !n.isIsolated() || b(n) && !n.isInline() && !n.canBeEmpty();
137
139
  }
138
- function tn(t, e, n, r) {
140
+ function mn(t, e, n, r) {
139
141
  t.modify(e ? "extend" : "move", n, r);
140
142
  }
141
- function nn(t) {
143
+ function pn(t) {
142
144
  const e = t.anchor.getNode();
143
- return (Ne(e) ? e : e.getParentOrThrow()).getDirection() === "rtl";
145
+ return (Te(e) ? e : e.getParentOrThrow()).getDirection() === "rtl";
144
146
  }
145
- function me(t, e, n) {
146
- const r = nn(t);
147
- tn(t, e, n ? !r : r, "character");
147
+ function ve(t, e, n) {
148
+ const r = pn(t);
149
+ mn(t, e, n ? !r : r, "character");
148
150
  }
149
- function rn(t) {
151
+ function gn(t) {
150
152
  const e = window.location.origin, n = (r) => {
151
153
  if (r.origin !== e) return;
152
- const o = t.getRootElement();
153
- if (document.activeElement !== o) return;
154
+ const i = t.getRootElement();
155
+ if (document.activeElement !== i) return;
154
156
  const s = r.data;
155
157
  if (typeof s == "string") {
156
- let i;
158
+ let o;
157
159
  try {
158
- i = JSON.parse(s);
160
+ o = JSON.parse(s);
159
161
  } catch {
160
162
  return;
161
163
  }
162
- if (i && i.protocol === "nuanria_messaging" && i.type === "request") {
163
- const a = i.payload;
164
+ if (o && o.protocol === "nuanria_messaging" && o.type === "request") {
165
+ const a = o.payload;
164
166
  if (a && a.functionId === "makeChanges") {
165
167
  const l = a.args;
166
168
  if (l) {
167
- const [c, u, d, f, g, m] = l;
169
+ const [c, u, d, f, p, m] = l;
168
170
  t.update(() => {
169
- const v = p();
170
- if (w(v)) {
171
- const $ = v.anchor;
172
- let E = $.getNode(), C = 0, b = 0;
173
- if (T(E) && c >= 0 && u >= 0 && (C = c, b = c + u, v.setTextNodeRange(E, C, E, b)), C === b && d === "" || (v.insertRawText(d), E = $.getNode()), T(E)) {
174
- C = f, b = f + g;
171
+ const w = g();
172
+ if (h(w)) {
173
+ const x = w.anchor;
174
+ let E = x.getNode(), C = 0, $ = 0;
175
+ if (_(E) && c >= 0 && u >= 0 && (C = c, $ = c + u, w.setTextNodeRange(E, C, E, $)), C === $ && d === "" || (w.insertRawText(d), E = x.getNode()), _(E)) {
176
+ C = f, $ = f + p;
175
177
  const N = E.getTextContentSize();
176
- C = C > N ? N : C, b = b > N ? N : b, v.setTextNodeRange(E, C, E, b);
178
+ C = C > N ? N : C, $ = $ > N ? N : $, w.setTextNodeRange(E, C, E, $);
177
179
  }
178
180
  r.stopImmediatePropagation();
179
181
  }
@@ -187,69 +189,69 @@ function rn(t) {
187
189
  window.removeEventListener("message", n, !0);
188
190
  };
189
191
  }
190
- function ke(t, e) {
192
+ function ze(t, e) {
191
193
  const n = e.body ? e.body.childNodes : [];
192
194
  let r = [];
193
- const o = [];
195
+ const i = [];
194
196
  for (let s = 0; s < n.length; s++) {
195
- const i = n[s];
196
- if (!je.has(i.nodeName)) {
197
- const a = ze(i, t, o, !1);
197
+ const o = n[s];
198
+ if (!Ve.has(o.nodeName)) {
199
+ const a = qe(o, t, i, !1);
198
200
  a !== null && (r = r.concat(a));
199
201
  }
200
202
  }
201
203
  return function(s) {
202
- for (const i of s) i.getNextSibling() instanceof Se && i.insertAfter(De());
203
- for (const i of s) {
204
- const a = i.getChildren();
205
- for (const l of a) i.insertBefore(l);
206
- i.remove();
204
+ for (const o of s) o.getNextSibling() instanceof Pe && o.insertAfter(_e());
205
+ for (const o of s) {
206
+ const a = o.getChildren();
207
+ for (const l of a) o.insertBefore(l);
208
+ o.remove();
207
209
  }
208
- }(o), r;
210
+ }(i), r;
209
211
  }
210
- function Ke(t, e) {
212
+ function We(t, e) {
211
213
  if (typeof document > "u" || typeof window > "u" && global.window === void 0) throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");
212
214
  const n = document.createElement("div"), r = P().getChildren();
213
- for (let o = 0; o < r.length; o++)
214
- Be(t, r[o], n, e);
215
+ for (let i = 0; i < r.length; i++)
216
+ Je(t, r[i], n, e);
215
217
  return n.innerHTML;
216
218
  }
217
- function Be(t, e, n, r = null) {
218
- let o = r === null || e.isSelected(r);
219
- const s = x(e) && e.excludeFromCopy("html");
220
- let i = e;
219
+ function Je(t, e, n, r = null) {
220
+ let i = r === null || e.isSelected(r);
221
+ const s = b(e) && e.excludeFromCopy("html");
222
+ let o = e;
221
223
  if (r !== null) {
222
- let g = Pe(e);
223
- g = T(g) && r !== null ? Me(r, g) : g, i = g;
224
+ let p = Re(e);
225
+ p = _(p) && r !== null ? je(r, p) : p, o = p;
224
226
  }
225
- const a = x(i) ? i.getChildren() : [], l = t._nodes.get(i.getType());
227
+ const a = b(o) ? o.getChildren() : [], l = t._nodes.get(o.getType());
226
228
  let c;
227
- c = l && l.exportDOM !== void 0 ? l.exportDOM(t, i) : i.exportDOM(t);
229
+ c = l && l.exportDOM !== void 0 ? l.exportDOM(t, o) : o.exportDOM(t);
228
230
  const { element: u, after: d } = c;
229
231
  if (!u) return !1;
230
232
  const f = document.createDocumentFragment();
231
- for (let g = 0; g < a.length; g++) {
232
- const m = a[g], v = Be(t, m, f, r);
233
- !o && x(e) && v && e.extractWithChild(m, r, "html") && (o = !0);
233
+ for (let p = 0; p < a.length; p++) {
234
+ const m = a[p], w = Je(t, m, f, r);
235
+ !i && b(e) && w && e.extractWithChild(m, r, "html") && (i = !0);
234
236
  }
235
- if (o && !s) {
236
- if ((Ge(u) || ie(u)) && u.append(f), n.append(u), d) {
237
- const g = d.call(i, u);
238
- g && (ie(u) ? u.replaceChildren(g) : u.replaceWith(g));
237
+ if (i && !s) {
238
+ if ((rt(u) || ae(u)) && u.append(f), n.append(u), d) {
239
+ const p = d.call(o, u);
240
+ p && (ae(u) ? u.replaceChildren(p) : u.replaceWith(p));
239
241
  }
240
242
  } else n.append(f);
241
- return o;
243
+ return i;
242
244
  }
243
- const je = /* @__PURE__ */ new Set(["STYLE", "SCRIPT"]);
244
- function ze(t, e, n, r, o = /* @__PURE__ */ new Map(), s) {
245
- let i = [];
246
- if (je.has(t.nodeName)) return i;
245
+ const Ve = /* @__PURE__ */ new Set(["STYLE", "SCRIPT"]);
246
+ function qe(t, e, n, r, i = /* @__PURE__ */ new Map(), s) {
247
+ let o = [];
248
+ if (Ve.has(t.nodeName)) return o;
247
249
  let a = null;
248
- const l = function(m, v) {
249
- const { nodeName: $ } = m, E = v._htmlConversions.get($.toLowerCase());
250
+ const l = function(m, w) {
251
+ const { nodeName: x } = m, E = w._htmlConversions.get(x.toLowerCase());
250
252
  let C = null;
251
- if (E !== void 0) for (const b of E) {
252
- const N = b(m);
253
+ if (E !== void 0) for (const $ of E) {
254
+ const N = $(m);
253
255
  N !== null && (C === null || (C.priority || 0) < (N.priority || 0)) && (C = N);
254
256
  }
255
257
  return C !== null ? C.conversion : null;
@@ -259,181 +261,181 @@ function ze(t, e, n, r, o = /* @__PURE__ */ new Map(), s) {
259
261
  u = c.after;
260
262
  const m = c.node;
261
263
  if (a = Array.isArray(m) ? m[m.length - 1] : m, a !== null) {
262
- for (const [, v] of o) if (a = v(a, s), !a) break;
263
- a && i.push(...Array.isArray(m) ? m : [a]);
264
+ for (const [, w] of i) if (a = w(a, s), !a) break;
265
+ a && o.push(...Array.isArray(m) ? m : [a]);
264
266
  }
265
- c.forChild != null && o.set(t.nodeName, c.forChild);
267
+ c.forChild != null && i.set(t.nodeName, c.forChild);
266
268
  }
267
269
  const d = t.childNodes;
268
270
  let f = [];
269
- const g = (a == null || !Qe(a)) && (a != null && Z(a) || r);
270
- for (let m = 0; m < d.length; m++) f.push(...ze(d[m], e, n, g, new Map(o), a));
271
- return u != null && (f = u(f)), se(t) && (f = on(t, f, g ? () => {
272
- const m = new Se();
271
+ const p = (a == null || !ot(a)) && (a != null && Q(a) || r);
272
+ for (let m = 0; m < d.length; m++) f.push(...qe(d[m], e, n, p, new Map(i), a));
273
+ return u != null && (f = u(f)), le(t) && (f = hn(t, f, p ? () => {
274
+ const m = new Pe();
273
275
  return n.push(m), m;
274
- } : te)), a == null ? f.length > 0 ? i = i.concat(f) : se(t) && function(m) {
275
- return m.nextSibling == null || m.previousSibling == null ? !1 : ae(m.nextSibling) && ae(m.previousSibling);
276
- }(t) && (i = i.concat(De())) : x(a) && a.append(...f), i;
276
+ } : ne)), a == null ? f.length > 0 ? o = o.concat(f) : le(t) && function(m) {
277
+ return m.nextSibling == null || m.previousSibling == null ? !1 : ce(m.nextSibling) && ce(m.previousSibling);
278
+ }(t) && (o = o.concat(_e())) : b(a) && a.append(...f), o;
277
279
  }
278
- function on(t, e, n) {
279
- const r = t.style.textAlign, o = [];
280
+ function hn(t, e, n) {
281
+ const r = t.style.textAlign, i = [];
280
282
  let s = [];
281
- for (let i = 0; i < e.length; i++) {
282
- const a = e[i];
283
- if (Z(a)) r && !a.getFormat() && a.setFormat(r), o.push(a);
284
- else if (s.push(a), i === e.length - 1 || i < e.length - 1 && Z(e[i + 1])) {
283
+ for (let o = 0; o < e.length; o++) {
284
+ const a = e[o];
285
+ if (Q(a)) r && !a.getFormat() && a.setFormat(r), i.push(a);
286
+ else if (s.push(a), o === e.length - 1 || o < e.length - 1 && Q(e[o + 1])) {
285
287
  const l = n();
286
- l.setFormat(r), l.append(...s), o.push(l), s = [];
288
+ l.setFormat(r), l.append(...s), i.push(l), s = [];
287
289
  }
288
290
  }
289
- return o;
291
+ return i;
290
292
  }
291
- function sn(t) {
293
+ function vn(t) {
292
294
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
293
295
  }
294
- var W = sn(function(t) {
296
+ var q = vn(function(t) {
295
297
  const e = new URLSearchParams();
296
298
  e.append("code", t);
297
299
  for (let n = 1; n < arguments.length; n++) e.append("v", arguments[n]);
298
300
  throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
299
301
  });
300
- const an = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Ue = (t) => an ? (t || window).getSelection() : null;
301
- function ln(t, e = p()) {
302
- return e == null && W(166), w(e) && e.isCollapsed() || e.getNodes().length === 0 ? "" : Ke(t, e);
302
+ const wn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, He = (t) => wn ? (t || window).getSelection() : null;
303
+ function yn(t, e = g()) {
304
+ return e == null && q(166), h(e) && e.isCollapsed() || e.getNodes().length === 0 ? "" : We(t, e);
303
305
  }
304
- function cn(t, e = p()) {
305
- return e == null && W(166), w(e) && e.isCollapsed() || e.getNodes().length === 0 ? null : JSON.stringify(un(t, e));
306
+ function En(t, e = g()) {
307
+ return e == null && q(166), h(e) && e.isCollapsed() || e.getNodes().length === 0 ? null : JSON.stringify(Cn(t, e));
306
308
  }
307
- function pe(t, e, n) {
309
+ function we(t, e, n) {
308
310
  const r = t.getData("application/x-lexical-editor");
309
311
  if (r) try {
310
- const i = JSON.parse(r);
311
- if (i.namespace === n._config.namespace && Array.isArray(i.nodes))
312
- return ge(n, dn(i.nodes), e);
312
+ const o = JSON.parse(r);
313
+ if (o.namespace === n._config.namespace && Array.isArray(o.nodes))
314
+ return ye(n, bn(o.nodes), e);
313
315
  } catch {
314
316
  }
315
- const o = t.getData("text/html");
316
- if (o) try {
317
- const i = new DOMParser().parseFromString(o, "text/html");
318
- return ge(n, ke(n, i), e);
317
+ const i = t.getData("text/html");
318
+ if (i) try {
319
+ const o = new DOMParser().parseFromString(i, "text/html");
320
+ return ye(n, ze(n, o), e);
319
321
  } catch {
320
322
  }
321
323
  const s = t.getData("text/plain") || t.getData("text/uri-list");
322
- if (s != null) if (w(e)) {
323
- const i = s.split(/(\r?\n|\t)/);
324
- i[i.length - 1] === "" && i.pop();
325
- for (let a = 0; a < i.length; a++) {
326
- const l = p();
327
- if (w(l)) {
328
- const c = i[a];
324
+ if (s != null) if (h(e)) {
325
+ const o = s.split(/(\r?\n|\t)/);
326
+ o[o.length - 1] === "" && o.pop();
327
+ for (let a = 0; a < o.length; a++) {
328
+ const l = g();
329
+ if (h(l)) {
330
+ const c = o[a];
329
331
  c === `
330
332
  ` || c === `\r
331
- ` ? l.insertParagraph() : c === " " ? l.insertNodes([Te()]) : l.insertText(c);
333
+ ` ? l.insertParagraph() : c === " " ? l.insertNodes([Oe()]) : l.insertText(c);
332
334
  }
333
335
  }
334
336
  } else e.insertRawText(s);
335
337
  }
336
- function ge(t, e, n) {
337
- t.dispatchCommand(et, { nodes: e, selection: n }) || n.insertNodes(e);
338
+ function ye(t, e, n) {
339
+ t.dispatchCommand(it, { nodes: e, selection: n }) || n.insertNodes(e);
338
340
  }
339
- function Je(t, e, n, r = []) {
340
- let o = e === null || n.isSelected(e);
341
- const s = x(n) && n.excludeFromCopy("html");
342
- let i = n;
341
+ function Xe(t, e, n, r = []) {
342
+ let i = e === null || n.isSelected(e);
343
+ const s = b(n) && n.excludeFromCopy("html");
344
+ let o = n;
343
345
  if (e !== null) {
344
- let c = Pe(n);
345
- c = T(c) && e !== null ? Me(e, c) : c, i = c;
346
+ let c = Re(n);
347
+ c = _(c) && e !== null ? je(e, c) : c, o = c;
346
348
  }
347
- const a = x(i) ? i.getChildren() : [], l = function(c) {
349
+ const a = b(o) ? o.getChildren() : [], l = function(c) {
348
350
  const u = c.exportJSON(), d = c.constructor;
349
- if (u.type !== d.getType() && W(58, d.name), x(c)) {
351
+ if (u.type !== d.getType() && q(58, d.name), b(c)) {
350
352
  const f = u.children;
351
- Array.isArray(f) || W(59, d.name);
353
+ Array.isArray(f) || q(59, d.name);
352
354
  }
353
355
  return u;
354
- }(i);
355
- if (T(i)) {
356
- const c = i.__text;
357
- c.length > 0 ? l.text = c : o = !1;
356
+ }(o);
357
+ if (_(o)) {
358
+ const c = o.__text;
359
+ c.length > 0 ? l.text = c : i = !1;
358
360
  }
359
361
  for (let c = 0; c < a.length; c++) {
360
- const u = a[c], d = Je(t, e, u, l.children);
361
- !o && x(n) && d && n.extractWithChild(u, e, "clone") && (o = !0);
362
+ const u = a[c], d = Xe(t, e, u, l.children);
363
+ !i && b(n) && d && n.extractWithChild(u, e, "clone") && (i = !0);
362
364
  }
363
- if (o && !s) r.push(l);
365
+ if (i && !s) r.push(l);
364
366
  else if (Array.isArray(l.children)) for (let c = 0; c < l.children.length; c++) {
365
367
  const u = l.children[c];
366
368
  r.push(u);
367
369
  }
368
- return o;
370
+ return i;
369
371
  }
370
- function un(t, e) {
372
+ function Cn(t, e) {
371
373
  const n = [], r = P().getChildren();
372
- for (let o = 0; o < r.length; o++)
373
- Je(t, e, r[o], n);
374
+ for (let i = 0; i < r.length; i++)
375
+ Xe(t, e, r[i], n);
374
376
  return { namespace: t._config.namespace, nodes: n };
375
377
  }
376
- function dn(t) {
378
+ function bn(t) {
377
379
  const e = [];
378
380
  for (let n = 0; n < t.length; n++) {
379
- const r = t[n], o = tt(r);
380
- T(o) && en(o), e.push(o);
381
+ const r = t[n], i = st(r);
382
+ _(i) && fn(i), e.push(i);
381
383
  }
382
384
  return e;
383
385
  }
384
- let R = null;
385
- async function he(t, e, n) {
386
- if (R !== null) return !1;
386
+ let k = null;
387
+ async function Ee(t, e, n) {
388
+ if (k !== null) return !1;
387
389
  if (e !== null) return new Promise((l, c) => {
388
390
  t.update(() => {
389
- l(we(t, e, n));
391
+ l(Ce(t, e, n));
390
392
  });
391
393
  });
392
- const r = t.getRootElement(), o = t._window == null ? window.document : t._window.document, s = Ue(t._window);
394
+ const r = t.getRootElement(), i = t._window == null ? window.document : t._window.document, s = He(t._window);
393
395
  if (r === null || s === null) return !1;
394
- const i = o.createElement("span");
395
- i.style.cssText = "position: fixed; top: -1000px;", i.append(o.createTextNode("#")), r.append(i);
396
+ const o = i.createElement("span");
397
+ o.style.cssText = "position: fixed; top: -1000px;", o.append(i.createTextNode("#")), r.append(o);
396
398
  const a = new Range();
397
- return a.setStart(i, 0), a.setEnd(i, 1), s.removeAllRanges(), s.addRange(a), new Promise((l, c) => {
398
- const u = t.registerCommand(_e, (d) => (O(d, ClipboardEvent) && (u(), R !== null && (window.clearTimeout(R), R = null), l(we(t, d, n))), !0), nt);
399
- R = window.setTimeout(() => {
400
- u(), R = null, l(!1);
401
- }, 50), o.execCommand("copy"), i.remove();
399
+ return a.setStart(o, 0), a.setEnd(o, 1), s.removeAllRanges(), s.addRange(a), new Promise((l, c) => {
400
+ const u = t.registerCommand(ke, (d) => (T(d, ClipboardEvent) && (u(), k !== null && (window.clearTimeout(k), k = null), l(Ce(t, d, n))), !0), at);
401
+ k = window.setTimeout(() => {
402
+ u(), k = null, l(!1);
403
+ }, 50), i.execCommand("copy"), o.remove();
402
404
  });
403
405
  }
404
- function we(t, e, n) {
406
+ function Ce(t, e, n) {
405
407
  if (n === void 0) {
406
- const o = Ue(t._window);
407
- if (!o) return !1;
408
- const s = o.anchorNode, i = o.focusNode;
409
- if (s !== null && i !== null && !rt(t, s, i)) return !1;
410
- const a = p();
408
+ const i = He(t._window);
409
+ if (!i) return !1;
410
+ const s = i.anchorNode, o = i.focusNode;
411
+ if (s !== null && o !== null && !lt(t, s, o)) return !1;
412
+ const a = g();
411
413
  if (a === null) return !1;
412
- n = mn(a);
414
+ n = $n(a);
413
415
  }
414
416
  e.preventDefault();
415
417
  const r = e.clipboardData;
416
- return r !== null && (pn(r, n), !0);
418
+ return r !== null && (Nn(r, n), !0);
417
419
  }
418
- const fn = [["text/html", ln], ["application/x-lexical-editor", cn]];
419
- function mn(t = p()) {
420
+ const xn = [["text/html", yn], ["application/x-lexical-editor", En]];
421
+ function $n(t = g()) {
420
422
  const e = { "text/plain": t ? t.getTextContent() : "" };
421
423
  if (t) {
422
- const n = ot();
423
- for (const [r, o] of fn) {
424
- const s = o(n, t);
424
+ const n = ct();
425
+ for (const [r, i] of xn) {
426
+ const s = i(n, t);
425
427
  s !== null && (e[r] = s);
426
428
  }
427
429
  }
428
430
  return e;
429
431
  }
430
- function pn(t, e) {
432
+ function Nn(t, e) {
431
433
  for (const n in e) {
432
434
  const r = e[n];
433
435
  r !== void 0 && t.setData(n, r);
434
436
  }
435
437
  }
436
- function ve(t, e) {
438
+ function be(t, e) {
437
439
  if (document.caretRangeFromPoint !== void 0) {
438
440
  const n = document.caretRangeFromPoint(t, e);
439
441
  return n === null ? null : { node: n.startContainer, offset: n.startOffset };
@@ -444,390 +446,463 @@ function ve(t, e) {
444
446
  }
445
447
  return null;
446
448
  }
447
- const k = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, gn = k && "documentMode" in document ? document.documentMode : null, hn = !(!k || !("InputEvent" in window) || gn) && "getTargetRanges" in new window.InputEvent("input"), wn = k && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), vn = k && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, yn = k && /^(?=.*Chrome).*/i.test(navigator.userAgent), Cn = k && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !yn, ye = Ft();
449
+ const M = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Dn = M && "documentMode" in document ? document.documentMode : null, Sn = !(!M || !("InputEvent" in window) || Dn) && "getTargetRanges" in new window.InputEvent("input"), Ln = M && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Tn = M && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Pn = M && /^(?=.*Chrome).*/i.test(navigator.userAgent), _n = M && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !Pn, xe = Mt();
448
450
  function z(t) {
449
451
  let e = null;
450
- if (O(t, DragEvent) ? e = t.dataTransfer : O(t, ClipboardEvent) && (e = t.clipboardData), e === null) return [!1, [], !1];
451
- const n = e.types, r = n.includes("Files"), o = n.includes("text/html") || n.includes("text/plain");
452
- return [r, Array.from(e.files), o];
452
+ if (T(t, DragEvent) ? e = t.dataTransfer : T(t, ClipboardEvent) && (e = t.clipboardData), e === null) return [!1, [], !1];
453
+ const n = e.types, r = n.includes("Files"), i = n.includes("text/html") || n.includes("text/plain");
454
+ return [r, Array.from(e.files), i];
453
455
  }
454
- function Ce(t) {
455
- const e = p();
456
- if (!w(e)) return !1;
456
+ function $e(t) {
457
+ const e = g();
458
+ if (!h(e)) return !1;
457
459
  const n = /* @__PURE__ */ new Set(), r = e.getNodes();
458
- for (let o = 0; o < r.length; o++) {
459
- const s = r[o], i = s.getKey();
460
- if (n.has(i)) continue;
461
- const a = Oe(s, (c) => x(c) && !c.isInline());
460
+ for (let i = 0; i < r.length; i++) {
461
+ const s = r[i], o = s.getKey();
462
+ if (n.has(o)) continue;
463
+ const a = re(s, (c) => b(c) && !c.isInline());
462
464
  if (a === null) continue;
463
465
  const l = a.getKey();
464
466
  a.canIndent() && !n.has(l) && (n.add(l), t(a));
465
467
  }
466
468
  return n.size > 0;
467
469
  }
468
- function U(t) {
469
- const e = G(t);
470
+ function W(t) {
471
+ const e = V(t);
470
472
  return F(e);
471
473
  }
472
- function En(t) {
473
- return q(t.registerCommand(Rt, (e) => {
474
- const n = p();
475
- return !!L(n) && (n.clear(), !0);
476
- }, 0), t.registerCommand(H, (e) => {
477
- const n = p();
478
- return !!w(n) && (n.deleteCharacter(e), !0);
479
- }, h), t.registerCommand(Ot, (e) => {
480
- const n = p();
481
- return !!w(n) && (n.deleteWord(e), !0);
482
- }, h), t.registerCommand(Lt, (e) => {
483
- const n = p();
484
- return !!w(n) && (n.deleteLine(e), !0);
485
- }, h), t.registerCommand(_t, (e) => {
486
- const n = p();
474
+ function Rn(t) {
475
+ return U(t.registerCommand(It, (e) => {
476
+ const n = g();
477
+ return !!O(n) && (n.clear(), !0);
478
+ }, 0), t.registerCommand(X, (e) => {
479
+ const n = g();
480
+ return !!h(n) && (n.deleteCharacter(e), !0);
481
+ }, v), t.registerCommand(At, (e) => {
482
+ const n = g();
483
+ return !!h(n) && (n.deleteWord(e), !0);
484
+ }, v), t.registerCommand(Ft, (e) => {
485
+ const n = g();
486
+ return !!h(n) && (n.deleteLine(e), !0);
487
+ }, v), t.registerCommand(kt, (e) => {
488
+ const n = g();
487
489
  if (typeof e == "string") n !== null && n.insertText(e);
488
490
  else {
489
491
  if (n === null) return !1;
490
492
  const r = e.dataTransfer;
491
- if (r != null) pe(r, n, t);
492
- else if (w(n)) {
493
- const o = e.data;
494
- return o && n.insertText(o), !0;
493
+ if (r != null) we(r, n, t);
494
+ else if (h(n)) {
495
+ const i = e.data;
496
+ return i && n.insertText(i), !0;
495
497
  }
496
498
  }
497
499
  return !0;
498
- }, h), t.registerCommand(Tt, () => {
499
- const e = p();
500
- return !!w(e) && (e.removeText(), !0);
501
- }, h), t.registerCommand(Pt, (e) => {
502
- const n = p();
503
- return !!w(n) && (n.formatText(e), !0);
504
- }, h), t.registerCommand(Dt, (e) => {
505
- const n = p();
506
- if (!w(n) && !L(n)) return !1;
500
+ }, v), t.registerCommand(Ot, () => {
501
+ const e = g();
502
+ return !!h(e) && (e.removeText(), !0);
503
+ }, v), t.registerCommand(Rt, (e) => {
504
+ const n = g();
505
+ return !!h(n) && (n.formatText(e), !0);
506
+ }, v), t.registerCommand(_t, (e) => {
507
+ const n = g();
508
+ if (!h(n) && !O(n)) return !1;
507
509
  const r = n.getNodes();
508
- for (const o of r) {
509
- const s = Oe(o, (i) => x(i) && !i.isInline());
510
+ for (const i of r) {
511
+ const s = re(i, (o) => b(o) && !o.isInline());
510
512
  s !== null && s.setFormat(e);
511
513
  }
512
514
  return !0;
513
- }, h), t.registerCommand(le, (e) => {
514
- const n = p();
515
- return !!w(n) && (n.insertLineBreak(e), !0);
516
- }, h), t.registerCommand(ce, () => {
517
- const e = p();
518
- return !!w(e) && (e.insertParagraph(), !0);
519
- }, h), t.registerCommand(Nt, () => (St([Te()]), !0), h), t.registerCommand($t, () => Ce((e) => {
515
+ }, v), t.registerCommand(ue, (e) => {
516
+ const n = g();
517
+ return !!h(n) && (n.insertLineBreak(e), !0);
518
+ }, v), t.registerCommand(de, () => {
519
+ const e = g();
520
+ return !!h(e) && (e.insertParagraph(), !0);
521
+ }, v), t.registerCommand(Tt, () => (Pt([Oe()]), !0), v), t.registerCommand(Lt, () => $e((e) => {
520
522
  const n = e.getIndent();
521
523
  e.setIndent(n + 1);
522
- }), h), t.registerCommand(ue, () => Ce((e) => {
524
+ }), v), t.registerCommand(fe, () => $e((e) => {
523
525
  const n = e.getIndent();
524
526
  n > 0 && e.setIndent(n - 1);
525
- }), h), t.registerCommand(xt, (e) => {
526
- const n = p();
527
- if (L(n) && !U(e.target)) {
527
+ }), v), t.registerCommand(St, (e) => {
528
+ const n = g();
529
+ if (O(n) && !W(e.target)) {
528
530
  const r = n.getNodes();
529
531
  if (r.length > 0) return r[0].selectPrevious(), !0;
530
- } else if (w(n)) {
531
- const r = Y(n.focus, !0);
532
+ } else if (h(n)) {
533
+ const r = G(n.focus, !0);
532
534
  if (!e.shiftKey && F(r) && !r.isIsolated() && !r.isInline()) return r.selectPrevious(), e.preventDefault(), !0;
533
535
  }
534
536
  return !1;
535
- }, h), t.registerCommand(bt, (e) => {
536
- const n = p();
537
- if (L(n)) {
537
+ }, v), t.registerCommand(Dt, (e) => {
538
+ const n = g();
539
+ if (O(n)) {
538
540
  const r = n.getNodes();
539
541
  if (r.length > 0) return r[0].selectNext(0, 0), !0;
540
- } else if (w(n)) {
541
- if (function(o) {
542
- const s = o.focus;
542
+ } else if (h(n)) {
543
+ if (function(i) {
544
+ const s = i.focus;
543
545
  return s.key === "root" && s.offset === P().getChildrenSize();
544
546
  }(n)) return e.preventDefault(), !0;
545
- const r = Y(n.focus, !1);
547
+ const r = G(n.focus, !1);
546
548
  if (!e.shiftKey && F(r) && !r.isIsolated() && !r.isInline()) return r.selectNext(), e.preventDefault(), !0;
547
549
  }
548
550
  return !1;
549
- }, h), t.registerCommand(Et, (e) => {
550
- const n = p();
551
- if (L(n)) {
551
+ }, v), t.registerCommand(Nt, (e) => {
552
+ const n = g();
553
+ if (O(n)) {
552
554
  const r = n.getNodes();
553
555
  if (r.length > 0) return e.preventDefault(), r[0].selectPrevious(), !0;
554
556
  }
555
- if (!w(n)) return !1;
556
- if (fe(n, !0)) {
557
+ if (!h(n)) return !1;
558
+ if (he(n, !0)) {
557
559
  const r = e.shiftKey;
558
- return e.preventDefault(), me(n, r, !0), !0;
560
+ return e.preventDefault(), ve(n, r, !0), !0;
559
561
  }
560
562
  return !1;
561
- }, h), t.registerCommand(Ct, (e) => {
562
- const n = p();
563
- if (L(n) && !U(e.target)) {
564
- const o = n.getNodes();
565
- if (o.length > 0) return e.preventDefault(), o[0].selectNext(0, 0), !0;
563
+ }, v), t.registerCommand($t, (e) => {
564
+ const n = g();
565
+ if (O(n) && !W(e.target)) {
566
+ const i = n.getNodes();
567
+ if (i.length > 0) return e.preventDefault(), i[0].selectNext(0, 0), !0;
566
568
  }
567
- if (!w(n)) return !1;
569
+ if (!h(n)) return !1;
568
570
  const r = e.shiftKey;
569
- return !!fe(n, !1) && (e.preventDefault(), me(n, r, !1), !0);
570
- }, h), t.registerCommand(yt, (e) => {
571
- if (U(e.target)) return !1;
572
- const n = p();
573
- if (!w(n)) return !1;
571
+ return !!he(n, !1) && (e.preventDefault(), ve(n, r, !1), !0);
572
+ }, v), t.registerCommand(xt, (e) => {
573
+ if (W(e.target)) return !1;
574
+ const n = g();
575
+ if (!h(n)) return !1;
574
576
  e.preventDefault();
575
- const { anchor: r } = n, o = r.getNode();
576
- return n.isCollapsed() && r.offset === 0 && !Ne(o) && kt(o).getIndent() > 0 ? t.dispatchCommand(ue, void 0) : t.dispatchCommand(H, !0);
577
- }, h), t.registerCommand(vt, (e) => {
578
- if (U(e.target)) return !1;
579
- const n = p();
580
- return !!w(n) && (e.preventDefault(), t.dispatchCommand(H, !1));
581
- }, h), t.registerCommand(wt, (e) => {
582
- const n = p();
583
- if (!w(n)) return !1;
577
+ const { anchor: r } = n, i = r.getNode();
578
+ return n.isCollapsed() && r.offset === 0 && !Te(i) && Wt(i).getIndent() > 0 ? t.dispatchCommand(fe, void 0) : t.dispatchCommand(X, !0);
579
+ }, v), t.registerCommand(bt, (e) => {
580
+ if (W(e.target)) return !1;
581
+ const n = g();
582
+ return !!h(n) && (e.preventDefault(), t.dispatchCommand(X, !1));
583
+ }, v), t.registerCommand(Ct, (e) => {
584
+ const n = g();
585
+ if (!h(n)) return !1;
584
586
  if (e !== null) {
585
- if ((vn || wn || Cn) && hn) return !1;
586
- if (e.preventDefault(), e.shiftKey) return t.dispatchCommand(le, !1);
587
+ if ((Tn || Ln || _n) && Sn) return !1;
588
+ if (e.preventDefault(), e.shiftKey) return t.dispatchCommand(ue, !1);
587
589
  }
588
- return t.dispatchCommand(ce, void 0);
589
- }, h), t.registerCommand(ht, () => {
590
- const e = p();
591
- return !!w(e) && (t.blur(), !0);
592
- }, h), t.registerCommand(ft, (e) => {
590
+ return t.dispatchCommand(de, void 0);
591
+ }, v), t.registerCommand(Et, () => {
592
+ const e = g();
593
+ return !!h(e) && (t.blur(), !0);
594
+ }, v), t.registerCommand(ht, (e) => {
593
595
  const [, n] = z(e);
594
596
  if (n.length > 0) {
595
- const o = ve(e.clientX, e.clientY);
596
- if (o !== null) {
597
- const { offset: s, node: i } = o, a = G(i);
597
+ const i = be(e.clientX, e.clientY);
598
+ if (i !== null) {
599
+ const { offset: s, node: o } = i, a = V(o);
598
600
  if (a !== null) {
599
- const l = mt();
600
- if (T(a)) l.anchor.set(a.getKey(), s, "text"), l.focus.set(a.getKey(), s, "text");
601
+ const l = vt();
602
+ if (_(a)) l.anchor.set(a.getKey(), s, "text"), l.focus.set(a.getKey(), s, "text");
601
603
  else {
602
604
  const u = a.getParentOrThrow().getKey(), d = a.getIndexWithinParent() + 1;
603
605
  l.anchor.set(u, d, "element"), l.focus.set(u, d, "element");
604
606
  }
605
- const c = pt(l);
606
- gt(c);
607
+ const c = wt(l);
608
+ yt(c);
607
609
  }
608
- t.dispatchCommand(ye, n);
610
+ t.dispatchCommand(xe, n);
609
611
  }
610
612
  return e.preventDefault(), !0;
611
613
  }
612
- const r = p();
613
- return !!w(r);
614
- }, h), t.registerCommand(dt, (e) => {
615
- const [n] = z(e), r = p();
616
- return !(n && !w(r));
617
- }, h), t.registerCommand(ut, (e) => {
618
- const [n] = z(e), r = p();
619
- if (n && !w(r)) return !1;
620
- const o = ve(e.clientX, e.clientY);
621
- if (o !== null) {
622
- const s = G(o.node);
614
+ const r = g();
615
+ return !!h(r);
616
+ }, v), t.registerCommand(gt, (e) => {
617
+ const [n] = z(e), r = g();
618
+ return !(n && !h(r));
619
+ }, v), t.registerCommand(pt, (e) => {
620
+ const [n] = z(e), r = g();
621
+ if (n && !h(r)) return !1;
622
+ const i = be(e.clientX, e.clientY);
623
+ if (i !== null) {
624
+ const s = V(i.node);
623
625
  F(s) && e.preventDefault();
624
626
  }
625
627
  return !0;
626
- }, h), t.registerCommand(lt, () => (ct(), !0), h), t.registerCommand(_e, (e) => (he(t, O(e, ClipboardEvent) ? e : null), !0), h), t.registerCommand(at, (e) => (async function(n, r) {
627
- await he(r, O(n, ClipboardEvent) ? n : null), r.update(() => {
628
- const o = p();
629
- w(o) ? o.removeText() : L(o) && o.getNodes().forEach((s) => s.remove());
628
+ }, v), t.registerCommand(ft, () => (mt(), !0), v), t.registerCommand(ke, (e) => (Ee(t, T(e, ClipboardEvent) ? e : null), !0), v), t.registerCommand(dt, (e) => (async function(n, r) {
629
+ await Ee(r, T(n, ClipboardEvent) ? n : null), r.update(() => {
630
+ const i = g();
631
+ h(i) ? i.removeText() : O(i) && i.getNodes().forEach((s) => s.remove());
630
632
  });
631
- }(e, t), !0), h), t.registerCommand(it, (e) => {
633
+ }(e, t), !0), v), t.registerCommand(Fe, (e) => {
632
634
  const [, n, r] = z(e);
633
- return n.length > 0 && !r ? (t.dispatchCommand(ye, n), !0) : st(e.target) ? !1 : p() !== null && (function(o, s) {
634
- o.preventDefault(), s.update(() => {
635
- const i = p(), a = O(o, InputEvent) || O(o, KeyboardEvent) ? null : o.clipboardData;
636
- a != null && i !== null && pe(a, i, s);
635
+ return n.length > 0 && !r ? (t.dispatchCommand(xe, n), !0) : ut(e.target) ? !1 : g() !== null && (function(i, s) {
636
+ i.preventDefault(), s.update(() => {
637
+ const o = g(), a = T(i, InputEvent) || T(i, KeyboardEvent) ? null : i.clipboardData;
638
+ a != null && o !== null && we(a, o, s);
637
639
  }, { tag: "paste" });
638
640
  }(e, t), !0);
639
- }, h));
641
+ }, v));
640
642
  }
641
- const Q = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? M : _;
642
- function Ee(t) {
643
- return t.getEditorState().read(Ae(t.isComposing()));
643
+ const ee = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? I : D;
644
+ function Ne(t) {
645
+ return t.getEditorState().read(Be(t.isComposing()));
644
646
  }
645
- function bn({ contentEditable: t, placeholder: e = null, ErrorBoundary: n }) {
646
- const [r] = A(), o = function(s, i) {
647
- const [a, l] = I(() => s.getDecorators());
648
- return Q(() => s.registerDecoratorListener((c) => {
649
- de.flushSync(() => {
647
+ function On({ contentEditable: t, placeholder: e = null, ErrorBoundary: n }) {
648
+ const [r] = R(), i = function(s, o) {
649
+ const [a, l] = A(() => s.getDecorators());
650
+ return ee(() => s.registerDecoratorListener((c) => {
651
+ pe.flushSync(() => {
650
652
  l(c);
651
653
  });
652
- }), [s]), _(() => {
654
+ }), [s]), D(() => {
653
655
  l(s.getDecorators());
654
- }, [s]), V(() => {
656
+ }, [s]), H(() => {
655
657
  const c = [], u = Object.keys(a);
656
658
  for (let d = 0; d < u.length; d++) {
657
- const f = u[d], g = y(i, { onError: (v) => s._onError(v), children: y(At, { fallback: null, children: a[f] }) }), m = s.getElementByKey(f);
658
- m !== null && c.push(de.createPortal(g, m, f));
659
+ const f = u[d], p = y(o, { onError: (w) => s._onError(w), children: y(jt, { fallback: null, children: a[f] }) }), m = s.getElementByKey(f);
660
+ m !== null && c.push(pe.createPortal(p, m, f));
659
661
  }
660
662
  return c;
661
- }, [i, a, s]);
663
+ }, [o, a, s]);
662
664
  }(r, n);
663
665
  return function(s) {
664
- Q(() => q(En(s), rn(s)), [s]);
665
- }(r), J($e, { children: [t, y(xn, { content: e }), o] });
666
+ ee(() => U(Rn(s), gn(s)), [s]);
667
+ }(r), J(Le, { children: [t, y(kn, { content: e }), i] });
666
668
  }
667
- function xn({ content: t }) {
668
- const [e] = A(), n = function(o) {
669
- const [s, i] = I(() => Ee(o));
670
- return Q(() => {
669
+ function kn({ content: t }) {
670
+ const [e] = R(), n = function(i) {
671
+ const [s, o] = A(() => Ne(i));
672
+ return ee(() => {
671
673
  function a() {
672
- const l = Ee(o);
673
- i(l);
674
+ const l = Ne(i);
675
+ o(l);
674
676
  }
675
- return a(), q(o.registerUpdateListener(() => {
677
+ return a(), U(i.registerUpdateListener(() => {
676
678
  a();
677
- }), o.registerEditableListener(() => {
679
+ }), i.registerEditableListener(() => {
678
680
  a();
679
681
  }));
680
- }, [o]), s;
681
- }(e), r = Vt();
682
+ }, [i]), s;
683
+ }(e), r = rn();
682
684
  return n ? typeof t == "function" ? t(r) : t : null;
683
685
  }
684
- const We = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? M : _;
685
- function $n({ editor: t, ariaActiveDescendant: e, ariaAutoComplete: n, ariaControls: r, ariaDescribedBy: o, ariaExpanded: s, ariaLabel: i, ariaLabelledBy: a, ariaMultiline: l, ariaOwns: c, ariaRequired: u, autoCapitalize: d, className: f, id: g, role: m = "textbox", spellCheck: v = !0, style: $, tabIndex: E, "data-testid": C, ...b }, N) {
686
- const [S, ne] = I(t.isEditable()), re = Mt((D) => {
687
- D && D.ownerDocument && D.ownerDocument.defaultView ? t.setRootElement(D) : t.setRootElement(null);
688
- }, [t]), Ve = V(() => /* @__PURE__ */ function(...D) {
689
- return (oe) => {
690
- D.forEach((K) => {
691
- typeof K == "function" ? K(oe) : K != null && (K.current = oe);
686
+ const Ye = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? I : D;
687
+ function Fn({ editor: t, ariaActiveDescendant: e, ariaAutoComplete: n, ariaControls: r, ariaDescribedBy: i, ariaExpanded: s, ariaLabel: o, ariaLabelledBy: a, ariaMultiline: l, ariaOwns: c, ariaRequired: u, autoCapitalize: d, className: f, id: p, role: m = "textbox", spellCheck: w = !0, style: x, tabIndex: E, "data-testid": C, ...$ }, N) {
688
+ const [S, oe] = A(t.isEditable()), ie = zt((L) => {
689
+ L && L.ownerDocument && L.ownerDocument.defaultView ? t.setRootElement(L) : t.setRootElement(null);
690
+ }, [t]), Ze = H(() => /* @__PURE__ */ function(...L) {
691
+ return (se) => {
692
+ L.forEach((B) => {
693
+ typeof B == "function" ? B(se) : B != null && (B.current = se);
692
694
  });
693
695
  };
694
- }(N, re), [re, N]);
695
- return We(() => (ne(t.isEditable()), t.registerEditableListener((D) => {
696
- ne(D);
697
- })), [t]), y("div", { ...b, "aria-activedescendant": S ? e : void 0, "aria-autocomplete": S ? n : "none", "aria-controls": S ? r : void 0, "aria-describedby": o, "aria-expanded": S && m === "combobox" ? !!s : void 0, "aria-label": i, "aria-labelledby": a, "aria-multiline": l, "aria-owns": S ? c : void 0, "aria-readonly": !S || void 0, "aria-required": u, autoCapitalize: d, className: f, contentEditable: S, "data-testid": C, id: g, ref: Ve, role: S ? m : void 0, spellCheck: v, style: $, tabIndex: E });
698
- }
699
- const Nn = Le($n);
700
- function be(t) {
701
- return t.getEditorState().read(Ae(t.isComposing()));
702
- }
703
- const Sn = Le(Dn);
704
- function Dn(t, e) {
705
- const { placeholder: n, ...r } = t, [o] = A();
706
- return J($e, { children: [y(Nn, { editor: o, ...r, ref: e }), n != null && y(Pn, { editor: o, content: n })] });
707
- }
708
- function Pn({ content: t, editor: e }) {
709
- const n = function(i) {
710
- const [a, l] = I(() => be(i));
711
- return We(() => {
696
+ }(N, ie), [ie, N]);
697
+ return Ye(() => (oe(t.isEditable()), t.registerEditableListener((L) => {
698
+ oe(L);
699
+ })), [t]), y("div", { ...$, "aria-activedescendant": S ? e : void 0, "aria-autocomplete": S ? n : "none", "aria-controls": S ? r : void 0, "aria-describedby": i, "aria-expanded": S && m === "combobox" ? !!s : void 0, "aria-label": o, "aria-labelledby": a, "aria-multiline": l, "aria-owns": S ? c : void 0, "aria-readonly": !S || void 0, "aria-required": u, autoCapitalize: d, className: f, contentEditable: S, "data-testid": C, id: p, ref: Ze, role: S ? m : void 0, spellCheck: w, style: x, tabIndex: E });
700
+ }
701
+ const An = Ae(Fn);
702
+ function De(t) {
703
+ return t.getEditorState().read(Be(t.isComposing()));
704
+ }
705
+ const In = Ae(Mn);
706
+ function Mn(t, e) {
707
+ const { placeholder: n, ...r } = t, [i] = R();
708
+ return J(Le, { children: [y(An, { editor: i, ...r, ref: e }), n != null && y(Kn, { editor: i, content: n })] });
709
+ }
710
+ function Kn({ content: t, editor: e }) {
711
+ const n = function(o) {
712
+ const [a, l] = A(() => De(o));
713
+ return Ye(() => {
712
714
  function c() {
713
- const u = be(i);
715
+ const u = De(o);
714
716
  l(u);
715
717
  }
716
- return c(), q(i.registerUpdateListener(() => {
718
+ return c(), U(o.registerUpdateListener(() => {
717
719
  c();
718
- }), i.registerEditableListener(() => {
720
+ }), o.registerEditableListener(() => {
719
721
  c();
720
722
  }));
721
- }, [i]), a;
722
- }(e), [r, o] = I(e.isEditable());
723
- if (M(() => (o(e.isEditable()), e.registerEditableListener((i) => {
724
- o(i);
723
+ }, [o]), a;
724
+ }(e), [r, i] = A(e.isEditable());
725
+ if (I(() => (i(e.isEditable()), e.registerEditableListener((o) => {
726
+ i(o);
725
727
  })), [e]), !n) return null;
726
728
  let s = null;
727
729
  return typeof t == "function" ? s = t(r) : t !== null && (s = t), s === null ? null : y("div", { "aria-hidden": !0, children: s });
728
730
  }
729
- function ee(t, e) {
730
- return ee = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
731
+ function te(t, e) {
732
+ return te = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
731
733
  return n.__proto__ = r, n;
732
- }, ee(t, e);
734
+ }, te(t, e);
733
735
  }
734
- var xe = { error: null }, Tn = function(t) {
736
+ var Se = { error: null }, Un = function(t) {
735
737
  var e, n;
736
738
  function r() {
737
- for (var s, i = arguments.length, a = new Array(i), l = 0; l < i; l++) a[l] = arguments[l];
738
- return (s = t.call.apply(t, [this].concat(a)) || this).state = xe, s.resetErrorBoundary = function() {
739
+ for (var s, o = arguments.length, a = new Array(o), l = 0; l < o; l++) a[l] = arguments[l];
740
+ return (s = t.call.apply(t, [this].concat(a)) || this).state = Se, s.resetErrorBoundary = function() {
739
741
  for (var c, u = arguments.length, d = new Array(u), f = 0; f < u; f++) d[f] = arguments[f];
740
742
  s.props.onReset == null || (c = s.props).onReset.apply(c, d), s.reset();
741
743
  }, s;
742
744
  }
743
- n = t, (e = r).prototype = Object.create(n.prototype), e.prototype.constructor = e, ee(e, n), r.getDerivedStateFromError = function(s) {
745
+ n = t, (e = r).prototype = Object.create(n.prototype), e.prototype.constructor = e, te(e, n), r.getDerivedStateFromError = function(s) {
744
746
  return { error: s };
745
747
  };
746
- var o = r.prototype;
747
- return o.reset = function() {
748
- this.setState(xe);
749
- }, o.componentDidCatch = function(s, i) {
748
+ var i = r.prototype;
749
+ return i.reset = function() {
750
+ this.setState(Se);
751
+ }, i.componentDidCatch = function(s, o) {
750
752
  var a, l;
751
- (a = (l = this.props).onError) == null || a.call(l, s, i);
752
- }, o.componentDidUpdate = function(s, i) {
753
+ (a = (l = this.props).onError) == null || a.call(l, s, o);
754
+ }, i.componentDidUpdate = function(s, o) {
753
755
  var a, l, c, u, d = this.state.error, f = this.props.resetKeys;
754
- d !== null && i.error !== null && ((c = s.resetKeys) === void 0 && (c = []), (u = f) === void 0 && (u = []), c.length !== u.length || c.some(function(g, m) {
755
- return !Object.is(g, u[m]);
756
+ d !== null && o.error !== null && ((c = s.resetKeys) === void 0 && (c = []), (u = f) === void 0 && (u = []), c.length !== u.length || c.some(function(p, m) {
757
+ return !Object.is(p, u[m]);
756
758
  })) && ((a = (l = this.props).onResetKeysChange) == null || a.call(l, s.resetKeys, f), this.reset());
757
- }, o.render = function() {
758
- var s = this.state.error, i = this.props, a = i.fallbackRender, l = i.FallbackComponent, c = i.fallback;
759
+ }, i.render = function() {
760
+ var s = this.state.error, o = this.props, a = o.fallbackRender, l = o.FallbackComponent, c = o.fallback;
759
761
  if (s !== null) {
760
762
  var u = { error: s, resetErrorBoundary: this.resetErrorBoundary };
761
- if (X.isValidElement(c)) return c;
763
+ if (Y.isValidElement(c)) return c;
762
764
  if (typeof a == "function") return a(u);
763
- if (l) return X.createElement(l, u);
765
+ if (l) return Y.createElement(l, u);
764
766
  throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop");
765
767
  }
766
768
  return this.props.children;
767
769
  }, r;
768
- }(X.Component);
769
- function _n({ children: t, onError: e }) {
770
- return y(Tn, { fallback: y("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: t });
771
- }
772
- const Ln = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? M : _;
773
- function On({ ignoreHistoryMergeTagChange: t = !0, ignoreSelectionChange: e = !1, onChange: n }) {
774
- const [r] = A();
775
- return Ln(() => {
776
- if (n) return r.registerUpdateListener(({ editorState: o, dirtyElements: s, dirtyLeaves: i, prevEditorState: a, tags: l }) => {
777
- e && s.size === 0 && i.size === 0 || t && l.has("history-merge") || a.isEmpty() || n(o, r, l);
770
+ }(Y.Component);
771
+ function Bn({ children: t, onError: e }) {
772
+ return y(Un, { fallback: y("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: t });
773
+ }
774
+ const jn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? I : D;
775
+ function zn({ ignoreHistoryMergeTagChange: t = !0, ignoreSelectionChange: e = !1, onChange: n }) {
776
+ const [r] = R();
777
+ return jn(() => {
778
+ if (n) return r.registerUpdateListener(({ editorState: i, dirtyElements: s, dirtyLeaves: o, prevEditorState: a, tags: l }) => {
779
+ e && s.size === 0 && o.size === 0 || t && l.has("history-merge") || a.isEmpty() || n(i, r, l);
778
780
  });
779
781
  }, [r, t, e, n]), null;
780
782
  }
781
- function Rn() {
782
- const [t] = A();
783
- return _(() => {
784
- if (!t.hasNodes([Re, Fe])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
783
+ function Wn() {
784
+ const [t] = R();
785
+ return D(() => {
786
+ if (!t.hasNodes([Ie, Me])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
785
787
  }, [t]), function(e) {
786
- _(() => Kt(e), [e]);
788
+ D(() => Jt(e), [e]);
787
789
  }(t), null;
788
790
  }
789
- const zn = ({
791
+ function Jn({ validateUrl: t }) {
792
+ const [e] = R();
793
+ return D(() => {
794
+ if (!e.hasNodes([Ke])) throw new Error("LinkPlugin: LinkNode not registered on editor");
795
+ return U(e.registerCommand(ge, (n) => {
796
+ if (n === null) return Z(n), !0;
797
+ if (typeof n == "string") return !(t !== void 0 && !t(n)) && (Z(n), !0);
798
+ {
799
+ const { url: r, target: i, rel: s, title: o } = n;
800
+ return Z(r, { rel: s, target: i, title: o }), !0;
801
+ }
802
+ }, me), t !== void 0 ? e.registerCommand(Fe, (n) => {
803
+ const r = g();
804
+ if (!h(r) || r.isCollapsed() || !T(n, ClipboardEvent)) return !1;
805
+ const i = n;
806
+ if (i.clipboardData === null) return !1;
807
+ const s = i.clipboardData.getData("text");
808
+ return !!t(s) && !r.getNodes().some((o) => b(o)) && (e.dispatchCommand(ge, s), n.preventDefault(), !0);
809
+ }, me) : () => {
810
+ });
811
+ }, [e, t]), null;
812
+ }
813
+ function Vn({ newTab: t = !0, disabled: e = !1 }) {
814
+ const [n] = R();
815
+ return D(() => {
816
+ const r = (s) => {
817
+ const o = s.target;
818
+ if (!(o instanceof Node)) return;
819
+ const a = Kt(o);
820
+ if (a === null) return;
821
+ let l = null, c = null;
822
+ if (a.update(() => {
823
+ const f = V(o);
824
+ if (f !== null) {
825
+ const p = re(f, b);
826
+ if (!e) if (Vt(p)) l = p.sanitizeUrl(p.getURL()), c = p.getTarget();
827
+ else {
828
+ const m = function(w, x) {
829
+ let E = w;
830
+ for (; E != null; ) {
831
+ if (x(E)) return E;
832
+ E = E.parentNode;
833
+ }
834
+ return null;
835
+ }(o, Ut);
836
+ m !== null && (l = m.href, c = m.target);
837
+ }
838
+ }
839
+ }), l === null || l === "") return;
840
+ const u = n.getEditorState().read(g);
841
+ if (h(u) && !u.isCollapsed()) return void s.preventDefault();
842
+ const d = s.type === "auxclick" && s.button === 1;
843
+ window.open(l, t || d || s.metaKey || s.ctrlKey || c === "_blank" ? "_blank" : "_self"), s.preventDefault();
844
+ }, i = (s) => {
845
+ s.button === 1 && r(s);
846
+ };
847
+ return n.registerRootListener((s, o) => {
848
+ o !== null && (o.removeEventListener("click", r), o.removeEventListener("mouseup", i)), s !== null && (s.addEventListener("click", r), s.addEventListener("mouseup", i));
849
+ });
850
+ }, [n, t, e]), null;
851
+ }
852
+ const rr = ({
790
853
  namespace: t = "UvaEditor",
791
854
  initialValue: e = "",
792
855
  placeholder: n = "",
793
856
  onChange: r
794
857
  }) => {
795
- const o = {
858
+ const i = {
796
859
  namespace: t,
797
- theme: jt,
798
- onError(i) {
799
- throw i;
860
+ theme: Gt,
861
+ onError(o) {
862
+ throw o;
800
863
  },
801
- nodes: [Re, Fe],
802
- editorState: (i) => {
803
- const l = new DOMParser().parseFromString(e, "text/html"), c = ke(i, l), u = P();
864
+ nodes: [Ie, Me, Ke, Yt],
865
+ editorState: (o) => {
866
+ const l = new DOMParser().parseFromString(e, "text/html"), c = ze(o, l), u = P();
804
867
  u.clear();
805
- const d = te();
868
+ const d = ne();
806
869
  c.forEach((f) => d.append(f)), u.append(d);
807
870
  }
808
- }, s = (i, a) => {
809
- i.read(() => {
810
- const l = Ke(a);
871
+ }, s = (o, a) => {
872
+ o.read(() => {
873
+ const l = We(a);
811
874
  r(l);
812
875
  });
813
876
  };
814
- return /* @__PURE__ */ y("div", { className: B.editor__wrapper, children: /* @__PURE__ */ J(Ut, { initialConfig: o, children: [
815
- /* @__PURE__ */ y(Bt, {}),
816
- /* @__PURE__ */ J("div", { className: B["editor__field-wrapper"], children: [
877
+ return /* @__PURE__ */ y("div", { className: K.editor__wrapper, children: /* @__PURE__ */ J(en, { initialConfig: i, children: [
878
+ /* @__PURE__ */ y(Zt, {}),
879
+ /* @__PURE__ */ J("div", { className: K["editor__field-wrapper"], children: [
817
880
  /* @__PURE__ */ y(
818
- bn,
881
+ On,
819
882
  {
820
- contentEditable: /* @__PURE__ */ y(Sn, { className: B.editor__field }),
821
- placeholder: /* @__PURE__ */ y("div", { className: B.editor__placeholder, children: n }),
822
- ErrorBoundary: _n
883
+ contentEditable: /* @__PURE__ */ y(
884
+ In,
885
+ {
886
+ className: K.editor__field,
887
+ "aria-label": "Rich text editor content",
888
+ "aria-placeholder": n,
889
+ title: "Rich text editor content",
890
+ placeholder: /* @__PURE__ */ y("div", { className: K.editor__placeholder, children: n })
891
+ }
892
+ ),
893
+ placeholder: /* @__PURE__ */ y("div", { className: K.editor__placeholder, children: n }),
894
+ ErrorBoundary: Bn
823
895
  }
824
896
  ),
825
- /* @__PURE__ */ y(Rn, {}),
826
- /* @__PURE__ */ y(On, { onChange: s })
897
+ /* @__PURE__ */ y(Wn, {}),
898
+ /* @__PURE__ */ y(Jn, { validateUrl: qt }),
899
+ /* @__PURE__ */ y(Ht, { matchers: Xt }),
900
+ /* @__PURE__ */ y(Vn, {}),
901
+ /* @__PURE__ */ y(zn, { onChange: s })
827
902
  ] })
828
903
  ] }) });
829
904
  };
830
905
  export {
831
- zn as RteEditor
906
+ rr as RteEditor
832
907
  };
833
908
  //# sourceMappingURL=RteEditor.js.map