@uva-glass/component-library 3.54.1 → 3.54.3

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 (70) hide show
  1. package/dist/{Lexical.prod-YJ1n9pVJ.js → Lexical.prod-A4JuKqM3.js} +1494 -1428
  2. package/dist/Lexical.prod-A4JuKqM3.js.map +1 -0
  3. package/dist/{LexicalClipboard.prod-CDPAGlNs.js → LexicalClipboard.prod-CoyZP29w.js} +60 -60
  4. package/dist/{LexicalClipboard.prod-CDPAGlNs.js.map → LexicalClipboard.prod-CoyZP29w.js.map} +1 -1
  5. package/dist/{LexicalExtension.prod-2-giLTv9.js → LexicalExtension.prod-DFPuTMk1.js} +94 -93
  6. package/dist/LexicalExtension.prod-DFPuTMk1.js.map +1 -0
  7. package/dist/LexicalLink.prod-Dp06n3Hn.js +561 -0
  8. package/dist/LexicalLink.prod-Dp06n3Hn.js.map +1 -0
  9. package/dist/LexicalList.prod-D3TdO_Pq.js +632 -0
  10. package/dist/LexicalList.prod-D3TdO_Pq.js.map +1 -0
  11. package/dist/{LexicalSelection.prod-CpZE7Sey.js → LexicalSelection.prod-BapitO0n.js} +39 -39
  12. package/dist/{LexicalSelection.prod-CpZE7Sey.js.map → LexicalSelection.prod-BapitO0n.js.map} +1 -1
  13. package/dist/LexicalTable.prod-bzYpvqMi.js +1892 -0
  14. package/dist/LexicalTable.prod-bzYpvqMi.js.map +1 -0
  15. package/dist/LexicalUtils.prod-CAsHFX57.js +134 -0
  16. package/dist/LexicalUtils.prod-CAsHFX57.js.map +1 -0
  17. package/dist/{TableCellResizerPlugin-BTfuE_kM.js → TableCellResizerPlugin-ffA1s2mD.js} +62 -62
  18. package/dist/{TableCellResizerPlugin-BTfuE_kM.js.map → TableCellResizerPlugin-ffA1s2mD.js.map} +1 -1
  19. package/dist/{TablePlugin-bFqq2Yd9.js → TablePlugin-CzmrXpxk.js} +89 -89
  20. package/dist/{TablePlugin-bFqq2Yd9.js.map → TablePlugin-CzmrXpxk.js.map} +1 -1
  21. package/dist/{chunk-2N4WE3KZ-nJkI9rUN.js → chunk-OPOZOKLO-nJkI9rUN.js} +1 -1
  22. package/dist/{chunk-2N4WE3KZ-nJkI9rUN.js.map → chunk-OPOZOKLO-nJkI9rUN.js.map} +1 -1
  23. package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
  24. package/dist/components/CheckboxTree/CheckboxTree.stories.js +1 -1
  25. package/dist/components/FormInput/FormInput.js +1 -1
  26. package/dist/components/InputField/InputField.stories.js +1 -1
  27. package/dist/components/MultiSelect/MultiSelect.js +1 -1
  28. package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
  29. package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
  30. package/dist/components/MultiSelect/index.js +1 -1
  31. package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
  32. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
  33. package/dist/components/RadioTabSelector/RadioTabSelector.js +1 -1
  34. package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
  35. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +4 -4
  36. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js +51 -51
  37. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +2 -2
  38. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +1 -1
  39. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +42 -42
  40. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
  41. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +7 -7
  42. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +22 -22
  43. package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +13 -13
  44. package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/TableCellResizerPlugin.js +4 -4
  45. package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/index.js +1 -1
  46. package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +1 -1
  47. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +4 -4
  48. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +24 -24
  49. package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
  50. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +34 -34
  51. package/dist/components/RteEditor/Plugins/index.js +2 -2
  52. package/dist/components/RteEditor/RteEditor.js +489 -495
  53. package/dist/components/RteEditor/RteEditor.js.map +1 -1
  54. package/dist/components/RteEditor/helpers.js +20 -20
  55. package/dist/components/RteEditor/nodes/CourseCatalogueNode/CourseCatalogueNode.js +15 -15
  56. package/dist/components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js +13 -13
  57. package/dist/components/index.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/storybook__react.d.js +1 -1
  60. package/package.json +16 -16
  61. package/dist/Lexical.prod-YJ1n9pVJ.js.map +0 -1
  62. package/dist/LexicalExtension.prod-2-giLTv9.js.map +0 -1
  63. package/dist/LexicalLink.prod-u8L4ioQd.js +0 -528
  64. package/dist/LexicalLink.prod-u8L4ioQd.js.map +0 -1
  65. package/dist/LexicalList.prod-DMU0XSLO.js +0 -630
  66. package/dist/LexicalList.prod-DMU0XSLO.js.map +0 -1
  67. package/dist/LexicalTable.prod-BOlKc5zf.js +0 -1846
  68. package/dist/LexicalTable.prod-BOlKc5zf.js.map +0 -1
  69. package/dist/LexicalUtils.prod-BQnuAaA9.js +0 -92
  70. package/dist/LexicalUtils.prod-BQnuAaA9.js.map +0 -1
@@ -1,24 +1,24 @@
1
- import { jsx as f, jsxs as A, Fragment as ke } from "react/jsx-runtime";
2
- import { t as Ye, r as qe, o as L } from "../../LexicalComposerContext.prod-DOyoZx0P.js";
3
- import { aw as Pe, J as F, j as Qe, a as p, aE as oe, ay as ae, aF as O, O as se, $ as Xe, _ as B, N as g, Q as H, a8 as Ze, y as d, b0 as Ge, s as Ve, n as et, i as tt, b1 as rt, b2 as nt, a4 as ot, l as D, aL as at, A as st, b3 as it, b4 as lt, M as re, b5 as ut, b6 as ct, ad as dt, C as ft, r as Le, Y as mt, b7 as pt, b8 as ue, d as ce, a3 as gt, a1 as G, a2 as ht, ae as Te, b9 as de, R as vt, T as yt, K as Ct, ba as fe, P as bt, bb as Et, bc as wt, ap as De, aY as St, a6 as xt, U as Re, a5 as _t, bd as Nt, a7 as $t, a0 as kt, Z as Pt, x as Lt, aN as q, aM as Q, be as Tt, bf as Dt, aP as Rt, bg as ne, aO as Bt, bh as It, bi as Mt, aC as At } from "../../Lexical.prod-YJ1n9pVJ.js";
4
- import * as Ft from "react";
5
- import { useMemo as j, useLayoutEffect as J, useEffect as b, useState as M, Suspense as Ut, forwardRef as Be, useCallback as Kt, Component as zt, createElement as me, createContext as Ot, useId as Ht } from "react";
6
- import { a as jt, T as Jt } from "../../TableCellResizerPlugin-BTfuE_kM.js";
7
- import { T as Wt, d as ie, F as Yt, c as Ie, B as qt, Q as Qt } from "../../LexicalExtension.prod-2-giLTv9.js";
8
- import { flushSync as Xt, createPortal as Zt } from "react-dom";
9
- import { R as pe, F as ge, m as Gt, g as Vt } from "../../LexicalClipboard.prod-CDPAGlNs.js";
10
- import { A as he, Z as ve, n as ye } from "../../LexicalSelection.prod-CpZE7Sey.js";
11
- import { A as K, y as er } from "../../LexicalUtils.prod-BQnuAaA9.js";
12
- import { l as Me, n as Ae, L as tr, b as rr } from "../../LexicalList.prod-DMU0XSLO.js";
13
- import { N as Fe, K as nr, w as Ue, l as or, z as ar } from "../../LexicalLink.prod-u8L4ioQd.js";
14
- import { f as sr, g as ir, m as Ke, R as lr, T as ur, x as cr, A as ze, W as dr } from "../../LexicalTable.prod-BOlKc5zf.js";
15
- import { c as Ce } from "../../clsx-OuTLNxxd.js";
16
- import { exportMap as fr, mergeBoldStrongTags as mr, cleanUpTable as pr } from "./helpers.js";
17
- import { validateUrl as gr, MATCHERS as hr } from "./Plugins/LinkPlugin/helpers.js";
1
+ import { jsx as f, jsxs as A, Fragment as Pe } from "react/jsx-runtime";
2
+ import { t as We, r as Ve, o as D } from "../../LexicalComposerContext.prod-DOyoZx0P.js";
3
+ import { az as Le, K, V as Ge, $ as g, aI as oe, aC as ae, aJ as q, P as De, Y as Xe, y as B, w as h, e as H, ab as Qe, E as c, b4 as Ze, o as et, n as tt, f as rt, b5 as nt, b6 as ot, a7 as at, i as T, aP as st, U as it, b7 as lt, b8 as ut, D as re, b9 as dt, ba as ct, ag as ft, c as mt, m as Te, a1 as pt, bb as gt, bc as le, d as ue, a6 as ht, a4 as Q, a5 as vt, ah as Re, bd as de, X as yt, W as Ct, N as bt, be as ce, R as Et, bf as wt, bg as St, b0 as xt, ar as Ie, a9 as Nt, q as _t, a8 as $t, bh as kt, aa as Pt, a3 as Lt, a2 as Dt, B as Tt, aR as Y, aQ as W, bi as Rt, bj as It, aT as Bt, bk as ne, aS as Ft, bl as Mt, bm as At, bn as Kt, bo as zt, aG as Ut } from "../../Lexical.prod-A4JuKqM3.js";
4
+ import * as Ht from "react";
5
+ import { useMemo as X, useLayoutEffect as J, useEffect as b, useState as F, Suspense as Ot, forwardRef as Be, useCallback as qt, Component as Jt, createElement as fe, createContext as jt, useId as Yt } from "react";
6
+ import { a as Wt, T as Vt } from "../../TableCellResizerPlugin-ffA1s2mD.js";
7
+ import { n as Gt, p as se, a as Xt, g as Fe, H as Qt, o as Zt } from "../../LexicalExtension.prod-DFPuTMk1.js";
8
+ import { flushSync as er, createPortal as tr } from "react-dom";
9
+ import { R as me, F as pe, m as rr, g as nr } from "../../LexicalClipboard.prod-CoyZP29w.js";
10
+ import { A as ge, Z as he, n as ve } from "../../LexicalSelection.prod-BapitO0n.js";
11
+ import { A as U, y as or, b as ye } from "../../LexicalUtils.prod-CAsHFX57.js";
12
+ import { u as Me, s as Ae, N as ar, L as Ce } from "../../LexicalList.prod-D3TdO_Pq.js";
13
+ import { E as Ke, V as sr, $ as ze, p as ir, Y as lr } from "../../LexicalLink.prod-Dp06n3Hn.js";
14
+ import { m as ur, C as dr, _ as Ue, a as cr, A as fr, F as mr, K as He, z as pr } from "../../LexicalTable.prod-bzYpvqMi.js";
15
+ import { c as be } from "../../clsx-OuTLNxxd.js";
16
+ import { exportMap as gr, mergeBoldStrongTags as hr, cleanUpTable as vr } from "./helpers.js";
17
+ import { validateUrl as yr, MATCHERS as Cr } from "./Plugins/LinkPlugin/helpers.js";
18
18
  import { s as R } from "../../RteEditor.module-DaBh86FK.js";
19
- import { ToolBarPlugin as vr } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
20
- import { useTranslation as yr } from "./hooks/useTranslation.js";
21
- import "../../TablePlugin-bFqq2Yd9.js";
19
+ import { ToolBarPlugin as br } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
20
+ import { useTranslation as Er } from "./hooks/useTranslation.js";
21
+ import "../../TablePlugin-CzmrXpxk.js";
22
22
  import "./Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js";
23
23
  import "./hooks/components/Flyout.js";
24
24
  import "../Accordion/Accordion.js";
@@ -26,7 +26,7 @@ import "../Buttons/Button.js";
26
26
  import "../Buttons/LinkButton.js";
27
27
  import "@react-aria/button";
28
28
  import "../Checkbox/Checkbox.js";
29
- import { FeedbackBox as Cr } from "../FeedbackBox/FeedbackBox.js";
29
+ import { FeedbackBox as wr } from "../FeedbackBox/FeedbackBox.js";
30
30
  import "@react-aria/dialog";
31
31
  import "@react-aria/focus";
32
32
  import "@react-aria/overlays";
@@ -42,107 +42,107 @@ import "../SelectListbox/SelectProvider.js";
42
42
  import "../Sortable/components/SortableItem.js";
43
43
  import "../../SortableProvider-BbwlEPIr.js";
44
44
  import "../WeekSelector/components/WeekSelectorOptionContainer.js";
45
- import { PasteHandlerPlugin as br } from "./Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js";
46
- import { UvaTheme as Er } from "./UvaTheme/UvaTheme.js";
47
- import { EditorHeader as wr } from "./EditorHeader/EditorHeader.js";
48
- import { LanguageProvider as Sr, useLanguage as xr } from "./Providers/LanguageProvider.js";
49
- import { TableWrapperNode as _r } from "./nodes/TableWrapperNode/TableWrapperNode.js";
50
- import { CourseCatalogueNode as Nr, CourseCatalogueLinkPlugin as $r } from "./nodes/CourseCatalogueNode/CourseCatalogueNode.js";
51
- const Oe = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, kr = Oe ? J : b, X = { tag: oe };
52
- function Pr({ initialConfig: r, children: e }) {
53
- const t = j(() => {
54
- const { theme: n, namespace: o, nodes: a, onError: s, editorState: i, html: l } = r, c = Ye(null, n), u = Pe({ editable: r.editable, html: l, namespace: o, nodes: a, onError: (m) => s(m, u), theme: n });
55
- return (function(m, h) {
56
- if (h !== null) {
57
- if (h === void 0) m.update(() => {
58
- const S = F();
59
- if (S.isEmpty()) {
60
- const y = Qe();
61
- S.append(y);
62
- const x = Oe ? document.activeElement : null;
63
- (p() !== null || x !== null && x === m.getRootElement()) && y.select();
45
+ import { PasteHandlerPlugin as Sr } from "./Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js";
46
+ import { UvaTheme as xr } from "./UvaTheme/UvaTheme.js";
47
+ import { EditorHeader as Nr } from "./EditorHeader/EditorHeader.js";
48
+ import { LanguageProvider as _r, useLanguage as $r } from "./Providers/LanguageProvider.js";
49
+ import { TableWrapperNode as kr } from "./nodes/TableWrapperNode/TableWrapperNode.js";
50
+ import { CourseCatalogueNode as Pr, CourseCatalogueLinkPlugin as Lr } from "./nodes/CourseCatalogueNode/CourseCatalogueNode.js";
51
+ const Oe = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Dr = Oe ? J : b, V = { tag: oe };
52
+ function Tr({ initialConfig: r, children: e }) {
53
+ const t = X(() => {
54
+ const { theme: n, namespace: o, nodes: s, onError: a, editorState: i, html: l } = r, d = We(null, n), u = Le({ editable: r.editable, html: l, namespace: o, nodes: s, onError: (m) => a(m, u), theme: n });
55
+ return (function(m, p) {
56
+ if (p !== null) {
57
+ if (p === void 0) m.update(() => {
58
+ const w = K();
59
+ if (w.isEmpty()) {
60
+ const v = Ge();
61
+ w.append(v);
62
+ const N = Oe ? document.activeElement : null;
63
+ (g() !== null || N !== null && N === m.getRootElement()) && v.select();
64
64
  }
65
- }, X);
66
- else if (h !== null) switch (typeof h) {
65
+ }, V);
66
+ else if (p !== null) switch (typeof p) {
67
67
  case "string": {
68
- const S = m.parseEditorState(h);
69
- m.setEditorState(S, X);
68
+ const w = m.parseEditorState(p);
69
+ m.setEditorState(w, V);
70
70
  break;
71
71
  }
72
72
  case "object":
73
- m.setEditorState(h, X);
73
+ m.setEditorState(p, V);
74
74
  break;
75
75
  case "function":
76
76
  m.update(() => {
77
- F().isEmpty() && h(m);
78
- }, X);
77
+ K().isEmpty() && p(m);
78
+ }, V);
79
79
  }
80
80
  }
81
- })(u, i), [u, c];
81
+ })(u, i), [u, d];
82
82
  }, []);
83
- return kr(() => {
83
+ return Dr(() => {
84
84
  const n = r.editable, [o] = t;
85
85
  o.setEditable(n === void 0 || n);
86
- }, []), f(qe.Provider, { value: t, children: e });
86
+ }, []), f(Ve.Provider, { value: t, children: e });
87
87
  }
88
- const Lr = ae({ name: "@lexical/react/ReactProvider" });
89
- function Tr() {
90
- return F().getTextContent();
88
+ const Rr = ae({ name: "@lexical/react/ReactProvider" });
89
+ function Ir() {
90
+ return K().getTextContent();
91
91
  }
92
- function Dr(r, e = !0) {
92
+ function Br(r, e = !0) {
93
93
  if (r) return !1;
94
- let t = Tr();
94
+ let t = Ir();
95
95
  return e && (t = t.trim()), t === "";
96
96
  }
97
- function Rr(r) {
98
- if (!Dr(r, !1)) return !1;
99
- const e = F().getChildren(), t = e.length;
97
+ function Fr(r) {
98
+ if (!Br(r, !1)) return !1;
99
+ const e = K().getChildren(), t = e.length;
100
100
  if (t > 1) return !1;
101
101
  for (let n = 0; n < t; n++) {
102
102
  const o = e[n];
103
- if (O(o)) return !1;
104
- if (se(o)) {
103
+ if (q(o)) return !1;
104
+ if (De(o)) {
105
105
  if (!Xe(o) || o.__indent !== 0) return !1;
106
- const a = o.getChildren(), s = a.length;
107
- for (let i = 0; i < s; i++) {
108
- const l = a[n];
106
+ const s = o.getChildren(), a = s.length;
107
+ for (let i = 0; i < a; i++) {
108
+ const l = s[n];
109
109
  if (!B(l)) return !1;
110
110
  }
111
111
  }
112
112
  }
113
113
  return !0;
114
114
  }
115
- function He(r) {
116
- return () => Rr(r);
115
+ function qe(r) {
116
+ return () => Fr(r);
117
117
  }
118
- function Br(r) {
118
+ function Mr(r) {
119
119
  const e = window.location.origin, t = (n) => {
120
120
  if (n.origin !== e) return;
121
121
  const o = r.getRootElement();
122
122
  if (document.activeElement !== o) return;
123
- const a = n.data;
124
- if (typeof a == "string") {
125
- let s;
123
+ const s = n.data;
124
+ if (typeof s == "string") {
125
+ let a;
126
126
  try {
127
- s = JSON.parse(a);
127
+ a = JSON.parse(s);
128
128
  } catch {
129
129
  return;
130
130
  }
131
- if (s && s.protocol === "nuanria_messaging" && s.type === "request") {
132
- const i = s.payload;
131
+ if (a && a.protocol === "nuanria_messaging" && a.type === "request") {
132
+ const i = a.payload;
133
133
  if (i && i.functionId === "makeChanges") {
134
134
  const l = i.args;
135
135
  if (l) {
136
- const [c, u, m, h, S] = l;
136
+ const [d, u, m, p, w] = l;
137
137
  r.update(() => {
138
- const y = p();
139
- if (g(y)) {
140
- const x = y.anchor;
141
- let E = x.getNode(), C = 0, v = 0;
142
- if (B(E) && c >= 0 && u >= 0 && (C = c, v = c + u, y.setTextNodeRange(E, C, E, v)), C === v && m === "" || (y.insertRawText(m), E = x.getNode()), B(E)) {
143
- C = h, v = h + S;
144
- const _ = E.getTextContentSize();
145
- C = C > _ ? _ : C, v = v > _ ? _ : v, y.setTextNodeRange(E, C, E, v);
138
+ const v = g();
139
+ if (h(v)) {
140
+ const N = v.anchor;
141
+ let E = N.getNode(), C = 0, y = 0;
142
+ if (B(E) && d >= 0 && u >= 0 && (C = d, y = d + u, v.setTextNodeRange(E, C, E, y)), C === y && m === "" || (v.insertRawText(m), E = N.getNode()), B(E)) {
143
+ C = p, y = p + w;
144
+ const $ = E.getTextContentSize();
145
+ C = C > $ ? $ : C, y = y > $ ? $ : y, v.setTextNodeRange(E, C, E, y);
146
146
  }
147
147
  n.stopImmediatePropagation();
148
148
  }
@@ -156,7 +156,7 @@ function Br(r) {
156
156
  window.removeEventListener("message", t, !0);
157
157
  };
158
158
  }
159
- function be(r, e) {
159
+ function Ee(r, e) {
160
160
  if (document.caretRangeFromPoint !== void 0) {
161
161
  const t = document.caretRangeFromPoint(r, e);
162
162
  return t === null ? null : { node: t.startContainer, offset: t.startOffset };
@@ -167,328 +167,317 @@ function be(r, e) {
167
167
  }
168
168
  return null;
169
169
  }
170
- const U = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Ir = U && "documentMode" in document ? document.documentMode : null, Mr = U && /Mac|iPod|iPhone|iPad/.test(navigator.platform), Ar = !(!U || !("InputEvent" in window) || Ir) && "getTargetRanges" in new window.InputEvent("input"), Fr = U && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Ee = U && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Ur = U && /^(?=.*Chrome).*/i.test(navigator.userAgent), Kr = U && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && Mr && !Ur, we = et("DRAG_DROP_PASTE_FILE");
171
- function Z(r) {
170
+ const z = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Ar = z && "documentMode" in document ? document.documentMode : null, Kr = z && /Mac|iPod|iPhone|iPad/.test(navigator.platform), zr = !(!z || !("InputEvent" in window) || Ar) && "getTargetRanges" in new window.InputEvent("input"), Ur = z && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), we = z && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Hr = z && /^(?=.*Chrome).*/i.test(navigator.userAgent), Or = z && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && Kr && !Hr, Se = tt("DRAG_DROP_PASTE_FILE");
171
+ function G(r) {
172
172
  let e = null;
173
- if (K(r, DragEvent) ? e = r.dataTransfer : K(r, ClipboardEvent) && (e = r.clipboardData), e === null) return [!1, [], !1];
173
+ if (U(r, DragEvent) ? e = r.dataTransfer : U(r, ClipboardEvent) && (e = r.clipboardData), e === null) return [!1, [], !1];
174
174
  const t = e.types, n = t.includes("Files"), o = t.includes("text/html") || t.includes("text/plain");
175
175
  return [n, Array.from(e.files), o];
176
176
  }
177
- function Se(r) {
178
- const e = p();
179
- if (!g(e)) return !1;
180
- const t = /* @__PURE__ */ new Set(), n = e.getNodes();
181
- for (let o = 0; o < n.length; o++) {
182
- const a = n[o], s = a.getKey();
183
- if (t.has(s)) continue;
184
- const i = Re(a, (c) => se(c) && !c.isInline());
185
- if (i === null) continue;
186
- const l = i.getKey();
187
- i.canIndent() && !t.has(l) && (t.add(l), r(i));
188
- }
189
- return t.size > 0;
190
- }
191
177
  function xe(r) {
192
178
  const e = re(r);
193
- return O(e);
179
+ return q(e);
194
180
  }
195
- function V(r) {
181
+ function Z(r) {
196
182
  for (const e of ["lowercase", "uppercase", "capitalize"]) r.hasFormat(e) && r.toggleFormat(e);
197
183
  }
198
- function zr(r) {
199
- return H(r.registerCommand(Lt, (e) => {
200
- const t = p();
201
- return !!D(t) && (t.clear(), !0);
202
- }, d), r.registerCommand(G, (e) => {
203
- const t = p();
204
- return g(t) ? (t.deleteCharacter(e), !0) : !!D(t) && (t.deleteNodes(), !0);
205
- }, d), r.registerCommand(Pt, (e) => {
206
- const t = p();
207
- return !!g(t) && (t.deleteWord(e), !0);
208
- }, d), r.registerCommand(kt, (e) => {
209
- const t = p();
210
- return !!g(t) && (t.deleteLine(e), !0);
211
- }, d), r.registerCommand($t, (e) => {
212
- const t = p();
184
+ function qr(r) {
185
+ return H(r.registerCommand(Tt, (e) => {
186
+ const t = g();
187
+ return !!T(t) && (t.clear(), !0);
188
+ }, c), r.registerCommand(Q, (e) => {
189
+ const t = g();
190
+ return h(t) ? (t.deleteCharacter(e), !0) : !!T(t) && (t.deleteNodes(), !0);
191
+ }, c), r.registerCommand(Dt, (e) => {
192
+ const t = g();
193
+ return !!h(t) && (t.deleteWord(e), !0);
194
+ }, c), r.registerCommand(Lt, (e) => {
195
+ const t = g();
196
+ return !!h(t) && (t.deleteLine(e), !0);
197
+ }, c), r.registerCommand(Pt, (e) => {
198
+ const t = g();
213
199
  if (typeof e == "string") t !== null && t.insertText(e);
214
200
  else {
215
201
  if (t === null) return !1;
216
202
  const n = e.dataTransfer;
217
- if (n != null) pe(n, t, r);
218
- else if (g(t)) {
203
+ if (n != null) me(n, t, r);
204
+ else if (h(t)) {
219
205
  const o = e.data;
220
206
  return o && t.insertText(o), !0;
221
207
  }
222
208
  }
223
209
  return !0;
224
- }, d), r.registerCommand(Nt, () => {
225
- const e = p();
226
- return !!g(e) && (e.removeText(), !0);
227
- }, d), r.registerCommand(_t, (e) => {
228
- const t = p();
229
- return !!g(t) && (t.formatText(e), !0);
230
- }, d), r.registerCommand(xt, (e) => {
231
- const t = p();
232
- if (!g(t) && !D(t)) return !1;
210
+ }, c), r.registerCommand(kt, () => {
211
+ const e = g();
212
+ return !!h(e) && (e.removeText(), !0);
213
+ }, c), r.registerCommand($t, (e) => {
214
+ const t = g();
215
+ return !!h(t) && (t.formatText(e), !0);
216
+ }, c), r.registerCommand(Nt, (e) => {
217
+ const t = g();
218
+ if (!h(t) && !T(t)) return !1;
233
219
  const n = t.getNodes();
234
220
  for (const o of n) {
235
- const a = Re(o, (s) => se(s) && !s.isInline());
236
- a !== null && a.setFormat(e);
221
+ const s = _t(o, (a) => De(a) && !a.isInline());
222
+ s !== null && s.setFormat(e);
237
223
  }
238
224
  return !0;
239
- }, d), r.registerCommand(ue, (e) => {
240
- const t = p();
241
- return !!g(t) && (t.insertLineBreak(e), !0);
242
- }, d), r.registerCommand(ce, () => {
243
- const e = p();
244
- return !!g(e) && (e.insertParagraph(), !0);
245
- }, d), r.registerCommand(wt, () => (De([St()]), !0), d), r.registerCommand(Et, () => Se((e) => {
225
+ }, c), r.registerCommand(le, (e) => {
226
+ const t = g();
227
+ return !!h(t) && (t.insertLineBreak(e), !0);
228
+ }, c), r.registerCommand(ue, () => {
229
+ const e = g();
230
+ return !!h(e) && (e.insertParagraph(), !0);
231
+ }, c), r.registerCommand(St, () => {
232
+ const e = xt(), t = g();
233
+ return h(t) && (e.setFormat(t.format), e.setStyle(t.style)), Ie([e]), !0;
234
+ }, c), r.registerCommand(wt, () => ye((e) => {
246
235
  const t = e.getIndent();
247
236
  e.setIndent(t + 1);
248
- }), d), r.registerCommand(de, () => Se((e) => {
237
+ }), c), r.registerCommand(de, () => ye((e) => {
249
238
  const t = e.getIndent();
250
239
  t > 0 && e.setIndent(Math.max(0, t - 1));
251
- }), d), r.registerCommand(bt, (e) => {
252
- const t = p();
253
- if (D(t)) {
240
+ }), c), r.registerCommand(Et, (e) => {
241
+ const t = g();
242
+ if (T(t)) {
254
243
  const n = t.getNodes();
255
244
  if (n.length > 0) return e.preventDefault(), n[0].selectPrevious(), !0;
256
- } else if (g(t)) {
257
- const n = fe(t.focus, !0);
258
- if (!e.shiftKey && O(n) && !n.isIsolated() && !n.isInline()) return n.selectPrevious(), e.preventDefault(), !0;
245
+ } else if (h(t)) {
246
+ const n = ce(t.focus, !0);
247
+ if (!e.shiftKey && q(n) && !n.isIsolated() && !n.isInline()) return n.selectPrevious(), e.preventDefault(), !0;
259
248
  }
260
249
  return !1;
261
- }, d), r.registerCommand(Ct, (e) => {
262
- const t = p();
263
- if (D(t)) {
250
+ }, c), r.registerCommand(bt, (e) => {
251
+ const t = g();
252
+ if (T(t)) {
264
253
  const n = t.getNodes();
265
254
  if (n.length > 0) return e.preventDefault(), n[0].selectNext(0, 0), !0;
266
- } else if (g(t)) {
255
+ } else if (h(t)) {
267
256
  if ((function(o) {
268
- const a = o.focus;
269
- return a.key === "root" && a.offset === F().getChildrenSize();
257
+ const s = o.focus;
258
+ return s.key === "root" && s.offset === K().getChildrenSize();
270
259
  })(t)) return e.preventDefault(), !0;
271
- const n = fe(t.focus, !1);
272
- if (!e.shiftKey && O(n) && !n.isIsolated() && !n.isInline()) return n.selectNext(), e.preventDefault(), !0;
260
+ const n = ce(t.focus, !1);
261
+ if (!e.shiftKey && q(n) && !n.isIsolated() && !n.isInline()) return n.selectNext(), e.preventDefault(), !0;
273
262
  }
274
263
  return !1;
275
- }, d), r.registerCommand(yt, (e) => {
276
- const t = p();
277
- if (D(t)) {
264
+ }, c), r.registerCommand(Ct, (e) => {
265
+ const t = g();
266
+ if (T(t)) {
278
267
  const n = t.getNodes();
279
- if (n.length > 0) return e.preventDefault(), he(n[0]) ? n[0].selectNext(0, 0) : n[0].selectPrevious(), !0;
268
+ if (n.length > 0) return e.preventDefault(), ge(n[0]) ? n[0].selectNext(0, 0) : n[0].selectPrevious(), !0;
280
269
  }
281
- if (!g(t)) return !1;
282
- if (ve(t, !0)) {
270
+ if (!h(t)) return !1;
271
+ if (he(t, !0)) {
283
272
  const n = e.shiftKey;
284
- return e.preventDefault(), ye(t, n, !0), !0;
273
+ return e.preventDefault(), ve(t, n, !0), !0;
285
274
  }
286
275
  return !1;
287
- }, d), r.registerCommand(vt, (e) => {
288
- const t = p();
289
- if (D(t)) {
276
+ }, c), r.registerCommand(yt, (e) => {
277
+ const t = g();
278
+ if (T(t)) {
290
279
  const o = t.getNodes();
291
- if (o.length > 0) return e.preventDefault(), he(o[0]) ? o[0].selectPrevious() : o[0].selectNext(0, 0), !0;
280
+ if (o.length > 0) return e.preventDefault(), ge(o[0]) ? o[0].selectPrevious() : o[0].selectNext(0, 0), !0;
292
281
  }
293
- if (!g(t)) return !1;
282
+ if (!h(t)) return !1;
294
283
  const n = e.shiftKey;
295
- return !!ve(t, !1) && (e.preventDefault(), ye(t, n, !1), !0);
296
- }, d), r.registerCommand(ht, (e) => {
284
+ return !!he(t, !1) && (e.preventDefault(), ve(t, n, !1), !0);
285
+ }, c), r.registerCommand(vt, (e) => {
297
286
  if (xe(e.target)) return !1;
298
- const t = p();
299
- if (g(t)) {
287
+ const t = g();
288
+ if (h(t)) {
300
289
  if ((function(n) {
301
290
  if (!n.isCollapsed()) return !1;
302
291
  const { anchor: o } = n;
303
292
  if (o.offset !== 0) return !1;
304
- const a = o.getNode();
305
- if (Te(a)) return !1;
306
- const s = er(a);
307
- return s.getIndent() > 0 && (s.is(a) || a.is(s.getFirstDescendant()));
293
+ const s = o.getNode();
294
+ if (Re(s)) return !1;
295
+ const a = or(s);
296
+ return a.getIndent() > 0 && (a.is(s) || s.is(a.getFirstDescendant()));
308
297
  })(t)) return e.preventDefault(), r.dispatchCommand(de, void 0);
309
- if (Ee && navigator.language === "ko-KR") return !1;
310
- } else if (!D(t)) return !1;
311
- return e.preventDefault(), r.dispatchCommand(G, !0);
312
- }, d), r.registerCommand(gt, (e) => {
298
+ if (we && navigator.language === "ko-KR") return !1;
299
+ } else if (!T(t)) return !1;
300
+ return e.preventDefault(), r.dispatchCommand(Q, !0);
301
+ }, c), r.registerCommand(ht, (e) => {
313
302
  if (xe(e.target)) return !1;
314
- const t = p();
315
- return !(!g(t) && !D(t)) && (e.preventDefault(), r.dispatchCommand(G, !1));
316
- }, d), r.registerCommand(pt, (e) => {
317
- const t = p();
318
- if (!g(t)) return !1;
319
- if (V(t), e !== null) {
320
- if ((Ee || Fr || Kr) && Ar) return !1;
321
- if (e.preventDefault(), e.shiftKey) return r.dispatchCommand(ue, !1);
303
+ const t = g();
304
+ return !(!h(t) && !T(t)) && (e.preventDefault(), r.dispatchCommand(Q, !1));
305
+ }, c), r.registerCommand(gt, (e) => {
306
+ const t = g();
307
+ if (!h(t)) return !1;
308
+ if (Z(t), e !== null) {
309
+ if ((we || Ur || Or) && zr) return !1;
310
+ if (e.preventDefault(), e.shiftKey) return r.dispatchCommand(le, !1);
322
311
  }
323
- return r.dispatchCommand(ce, void 0);
324
- }, d), r.registerCommand(mt, () => {
325
- const e = p();
326
- return !!g(e) && (r.blur(), !0);
327
- }, d), r.registerCommand(ct, (e) => {
328
- const [, t] = Z(e);
312
+ return r.dispatchCommand(ue, void 0);
313
+ }, c), r.registerCommand(pt, () => {
314
+ const e = g();
315
+ return !!h(e) && (r.blur(), !0);
316
+ }, c), r.registerCommand(ct, (e) => {
317
+ const [, t] = G(e);
329
318
  if (t.length > 0) {
330
- const o = be(e.clientX, e.clientY);
319
+ const o = Ee(e.clientX, e.clientY);
331
320
  if (o !== null) {
332
- const { offset: a, node: s } = o, i = re(s);
321
+ const { offset: s, node: a } = o, i = re(a);
333
322
  if (i !== null) {
334
- const l = dt();
335
- if (B(i)) l.anchor.set(i.getKey(), a, "text"), l.focus.set(i.getKey(), a, "text");
323
+ const l = ft();
324
+ if (B(i)) l.anchor.set(i.getKey(), s, "text"), l.focus.set(i.getKey(), s, "text");
336
325
  else {
337
326
  const u = i.getParentOrThrow().getKey(), m = i.getIndexWithinParent() + 1;
338
327
  l.anchor.set(u, m, "element"), l.focus.set(u, m, "element");
339
328
  }
340
- const c = ft(l);
341
- Le(c);
329
+ const d = mt(l);
330
+ Te(d);
342
331
  }
343
- r.dispatchCommand(we, t);
332
+ r.dispatchCommand(Se, t);
344
333
  }
345
334
  return e.preventDefault(), !0;
346
335
  }
347
- const n = p();
348
- return !!g(n);
349
- }, d), r.registerCommand(ut, (e) => {
350
- const [t] = Z(e), n = p();
351
- return !(t && !g(n));
352
- }, d), r.registerCommand(lt, (e) => {
353
- const [t] = Z(e), n = p();
354
- if (t && !g(n)) return !1;
355
- const o = be(e.clientX, e.clientY);
336
+ const n = g();
337
+ return !!h(n);
338
+ }, c), r.registerCommand(dt, (e) => {
339
+ const [t] = G(e), n = g();
340
+ return !(t && !h(n));
341
+ }, c), r.registerCommand(ut, (e) => {
342
+ const [t] = G(e), n = g();
343
+ if (t && !h(n)) return !1;
344
+ const o = Ee(e.clientX, e.clientY);
356
345
  if (o !== null) {
357
- const a = re(o.node);
358
- O(a) && e.preventDefault();
346
+ const s = re(o.node);
347
+ q(s) && e.preventDefault();
359
348
  }
360
349
  return !0;
361
- }, d), r.registerCommand(st, () => (it(), !0), d), r.registerCommand(at, (e) => (ge(r, K(e, ClipboardEvent) ? e : null), !0), d), r.registerCommand(ot, (e) => ((async function(t, n) {
362
- await ge(n, K(t, ClipboardEvent) ? t : null), n.update(() => {
363
- const o = p();
364
- g(o) ? o.removeText() : D(o) && o.getNodes().forEach((a) => a.remove());
350
+ }, c), r.registerCommand(it, () => (lt(), !0), c), r.registerCommand(st, (e) => (pe(r, U(e, ClipboardEvent) ? e : null), !0), c), r.registerCommand(at, (e) => ((async function(t, n) {
351
+ await pe(n, U(t, ClipboardEvent) ? t : null), n.update(() => {
352
+ const o = g();
353
+ h(o) ? o.removeText() : T(o) && o.getNodes().forEach((s) => s.remove());
365
354
  });
366
- })(e, r), !0), d), r.registerCommand(Ve, (e) => {
367
- const [, t, n] = Z(e);
368
- return t.length > 0 && !n ? (r.dispatchCommand(we, t), !0) : tt(e.target) && rt(e.target) ? !1 : p() !== null && ((function(o, a) {
369
- o.preventDefault(), a.update(() => {
370
- const s = p(), i = K(o, InputEvent) || K(o, KeyboardEvent) ? null : o.clipboardData;
371
- i != null && s !== null && pe(i, s, a);
372
- }, { tag: nt });
355
+ })(e, r), !0), c), r.registerCommand(et, (e) => {
356
+ const [, t, n] = G(e);
357
+ return t.length > 0 && !n ? (r.dispatchCommand(Se, t), !0) : rt(e.target) && nt(e.target) ? !1 : g() !== null && ((function(o, s) {
358
+ o.preventDefault(), s.update(() => {
359
+ const a = g(), i = U(o, InputEvent) || U(o, KeyboardEvent) ? null : o.clipboardData;
360
+ i != null && a !== null && me(i, a, s);
361
+ }, { tag: ot });
373
362
  })(e, r), !0);
374
- }, d), r.registerCommand(Ge, (e) => {
375
- const t = p();
376
- return g(t) && V(t), !1;
377
- }, d), r.registerCommand(Ze, (e) => {
378
- const t = p();
379
- return g(t) && V(t), !1;
380
- }, d));
381
- }
382
- function Or(r, ...e) {
363
+ }, c), r.registerCommand(Ze, (e) => {
364
+ const t = g();
365
+ return h(t) && Z(t), !1;
366
+ }, c), r.registerCommand(Qe, (e) => {
367
+ const t = g();
368
+ return h(t) && Z(t), !1;
369
+ }, c));
370
+ }
371
+ function Jr(r, ...e) {
383
372
  const t = new URL("https://lexical.dev/docs/error"), n = new URLSearchParams();
384
373
  n.append("code", r);
385
374
  for (const o of e) n.append("v", o);
386
375
  throw t.search = n.toString(), Error(`Minified Lexical error #${r}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
387
376
  }
388
- const le = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? J : b;
389
- function Hr({ editor: r, ErrorBoundary: e }) {
377
+ const ie = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? J : b;
378
+ function jr({ editor: r, ErrorBoundary: e }) {
390
379
  return (function(t, n) {
391
- const [o, a] = M(() => t.getDecorators());
392
- return le(() => t.registerDecoratorListener((s) => {
393
- Xt(() => {
394
- a(s);
380
+ const [o, s] = F(() => t.getDecorators());
381
+ return ie(() => t.registerDecoratorListener((a) => {
382
+ er(() => {
383
+ s(a);
395
384
  });
396
385
  }), [t]), b(() => {
397
- a(t.getDecorators());
398
- }, [t]), j(() => {
399
- const s = [], i = Object.keys(o);
386
+ s(t.getDecorators());
387
+ }, [t]), X(() => {
388
+ const a = [], i = Object.keys(o);
400
389
  for (let l = 0; l < i.length; l++) {
401
- const c = i[l], u = f(n, { onError: (h) => t._onError(h), children: f(Ut, { fallback: null, children: o[c] }) }), m = t.getElementByKey(c);
402
- m !== null && s.push(Zt(u, m, c));
390
+ const d = i[l], u = f(n, { onError: (p) => t._onError(p), children: f(Ot, { fallback: null, children: o[d] }) }), m = t.getElementByKey(d);
391
+ m !== null && a.push(tr(u, m, d));
403
392
  }
404
- return s;
393
+ return a;
405
394
  }, [n, o, t]);
406
395
  })(r, e);
407
396
  }
408
- function jr({ editor: r, ErrorBoundary: e }) {
397
+ function Yr({ editor: r, ErrorBoundary: e }) {
409
398
  return (function(t) {
410
- const n = Wt.maybeFromEditor(t);
411
- if (n && n.hasExtensionByName(Lr.name)) {
412
- for (const o of ["@lexical/plain-text", "@lexical/rich-text"]) n.hasExtensionByName(o) && Or(320, o);
399
+ const n = Gt.maybeFromEditor(t);
400
+ if (n && n.hasExtensionByName(Rr.name)) {
401
+ for (const o of ["@lexical/plain-text", "@lexical/rich-text"]) n.hasExtensionByName(o) && Jr(320, o);
413
402
  return !0;
414
403
  }
415
404
  return !1;
416
- })(r) ? null : f(Hr, { editor: r, ErrorBoundary: e });
405
+ })(r) ? null : f(jr, { editor: r, ErrorBoundary: e });
417
406
  }
418
- function _e(r) {
419
- return r.getEditorState().read(He(r.isComposing()));
407
+ function Ne(r) {
408
+ return r.getEditorState().read(qe(r.isComposing()));
420
409
  }
421
- function Jr({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
422
- const [n] = L();
410
+ function Wr({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
411
+ const [n] = D();
423
412
  return (function(o) {
424
- le(() => H(zr(o), Br(o)), [o]);
425
- })(n), A(ke, { children: [r, f(Wr, { content: e }), f(jr, { editor: n, ErrorBoundary: t })] });
413
+ ie(() => H(qr(o), Mr(o)), [o]);
414
+ })(n), A(Pe, { children: [r, f(Vr, { content: e }), f(Yr, { editor: n, ErrorBoundary: t })] });
426
415
  }
427
- function Wr({ content: r }) {
428
- const [e] = L(), t = (function(o) {
429
- const [a, s] = M(() => _e(o));
430
- return le(() => {
416
+ function Vr({ content: r }) {
417
+ const [e] = D(), t = (function(o) {
418
+ const [s, a] = F(() => Ne(o));
419
+ return ie(() => {
431
420
  function i() {
432
- const l = _e(o);
433
- s(l);
421
+ const l = Ne(o);
422
+ a(l);
434
423
  }
435
424
  return i(), H(o.registerUpdateListener(() => {
436
425
  i();
437
426
  }), o.registerEditableListener(() => {
438
427
  i();
439
428
  }));
440
- }, [o]), a;
441
- })(e), n = jt();
429
+ }, [o]), s;
430
+ })(e), n = Wt();
442
431
  return t ? typeof r == "function" ? r(n) : r : null;
443
432
  }
444
- const je = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? J : b;
445
- function Yr({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: n, ariaDescribedBy: o, ariaErrorMessage: a, ariaExpanded: s, ariaInvalid: i, ariaLabel: l, ariaLabelledBy: c, ariaMultiline: u, ariaOwns: m, ariaRequired: h, autoCapitalize: S, className: y, id: x, role: E = "textbox", spellCheck: C = !0, style: v, tabIndex: _, "data-testid": T, ...P }, k) {
446
- const [w, I] = M(r.isEditable()), N = Kt(($) => {
447
- $ && $.ownerDocument && $.ownerDocument.defaultView ? r.setRootElement($) : r.setRootElement(null);
448
- }, [r]), W = j(() => /* @__PURE__ */ (function(...$) {
449
- return (Y) => {
450
- for (const z of $) typeof z == "function" ? z(Y) : z != null && (z.current = Y);
433
+ const Je = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? J : b;
434
+ function Gr({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: n, ariaDescribedBy: o, ariaErrorMessage: s, ariaExpanded: a, ariaInvalid: i, ariaLabel: l, ariaLabelledBy: d, ariaMultiline: u, ariaOwns: m, ariaRequired: p, autoCapitalize: w, className: v, id: N, role: E = "textbox", spellCheck: C = !0, style: y, tabIndex: $, "data-testid": I, ...L }, k) {
435
+ const [S, P] = F(r.isEditable()), x = qt((_) => {
436
+ _ && _.ownerDocument && _.ownerDocument.defaultView ? r.setRootElement(_) : r.setRootElement(null);
437
+ }, [r]), M = X(() => /* @__PURE__ */ (function(..._) {
438
+ return (j) => {
439
+ for (const O of _) typeof O == "function" ? O(j) : O != null && (O.current = j);
451
440
  };
452
- })(k, N), [N, k]);
453
- return je(() => (I(r.isEditable()), r.registerEditableListener(($) => {
454
- I($);
455
- })), [r]), f("div", { "aria-activedescendant": w ? e : void 0, "aria-autocomplete": w ? t : "none", "aria-controls": w ? n : void 0, "aria-describedby": o, ...a != null ? { "aria-errormessage": a } : {}, "aria-expanded": w && E === "combobox" ? !!s : void 0, ...i != null ? { "aria-invalid": i } : {}, "aria-label": l, "aria-labelledby": c, "aria-multiline": u, "aria-owns": w ? m : void 0, "aria-readonly": !w || void 0, "aria-required": h, autoCapitalize: S, className: y, contentEditable: w, "data-testid": T, id: x, ref: W, role: E, spellCheck: C, style: v, tabIndex: _, ...P });
441
+ })(k, x), [x, k]);
442
+ return Je(() => (P(r.isEditable()), r.registerEditableListener((_) => {
443
+ P(_);
444
+ })), [r]), f("div", { "aria-activedescendant": S ? e : void 0, "aria-autocomplete": S ? t : "none", "aria-controls": S ? n : void 0, "aria-describedby": o, ...s != null ? { "aria-errormessage": s } : {}, "aria-expanded": S && E === "combobox" ? !!a : void 0, ...i != null ? { "aria-invalid": i } : {}, "aria-label": l, "aria-labelledby": d, "aria-multiline": u, "aria-owns": S ? m : void 0, "aria-readonly": !S || void 0, "aria-required": p, autoCapitalize: w, className: v, contentEditable: S, "data-testid": I, id: N, ref: M, role: E, spellCheck: C, style: y, tabIndex: $, ...L });
456
445
  }
457
- const qr = Be(Yr);
458
- function Ne(r) {
459
- return r.getEditorState().read(He(r.isComposing()));
460
- }
461
- const Qr = Be(Xr);
462
- function Xr(r, e) {
463
- const { placeholder: t, ...n } = r, [o] = L();
464
- return A(ke, { children: [f(qr, { editor: o, ...n, ref: e }), t != null && f(Zr, { editor: o, content: t })] });
465
- }
466
- function Zr({ content: r, editor: e }) {
467
- const t = (function(s) {
468
- const [i, l] = M(() => Ne(s));
469
- return je(() => {
470
- function c() {
471
- const u = Ne(s);
446
+ const Xr = Be(Gr);
447
+ function _e(r) {
448
+ return r.getEditorState().read(qe(r.isComposing()));
449
+ }
450
+ const Qr = Be(Zr);
451
+ function Zr(r, e) {
452
+ const { placeholder: t, ...n } = r, [o] = D();
453
+ return A(Pe, { children: [f(Xr, { editor: o, ...n, ref: e }), t != null && f(en, { editor: o, content: t })] });
454
+ }
455
+ function en({ content: r, editor: e }) {
456
+ const t = (function(a) {
457
+ const [i, l] = F(() => _e(a));
458
+ return Je(() => {
459
+ function d() {
460
+ const u = _e(a);
472
461
  l(u);
473
462
  }
474
- return c(), H(s.registerUpdateListener(() => {
475
- c();
476
- }), s.registerEditableListener(() => {
477
- c();
463
+ return d(), H(a.registerUpdateListener(() => {
464
+ d();
465
+ }), a.registerEditableListener(() => {
466
+ d();
478
467
  }));
479
- }, [s]), i;
480
- })(e), [n, o] = M(e.isEditable());
481
- if (J(() => (o(e.isEditable()), e.registerEditableListener((s) => {
482
- o(s);
468
+ }, [a]), i;
469
+ })(e), [n, o] = F(e.isEditable());
470
+ if (J(() => (o(e.isEditable()), e.registerEditableListener((a) => {
471
+ o(a);
483
472
  })), [e]), !t) return null;
484
- let a = null;
485
- return typeof r == "function" ? a = r(n) : r !== null && (a = r), a === null ? null : f("div", { "aria-hidden": !0, children: a });
473
+ let s = null;
474
+ return typeof r == "function" ? s = r(n) : r !== null && (s = r), s === null ? null : f("div", { "aria-hidden": !0, children: s });
486
475
  }
487
- const Gr = Ot(null), ee = {
476
+ const tn = jt(null), ee = {
488
477
  didCatch: !1,
489
478
  error: null
490
479
  };
491
- class Vr extends zt {
480
+ let rn = class extends Jt {
492
481
  constructor(e) {
493
482
  super(e), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = ee;
494
483
  }
@@ -507,368 +496,373 @@ class Vr extends zt {
507
496
  }
508
497
  componentDidUpdate(e, t) {
509
498
  const { didCatch: n } = this.state, { resetKeys: o } = this.props;
510
- n && t.error !== null && en(e.resetKeys, o) && (this.props.onReset?.({
499
+ n && t.error !== null && nn(e.resetKeys, o) && (this.props.onReset?.({
511
500
  next: o,
512
501
  prev: e.resetKeys,
513
502
  reason: "keys"
514
503
  }), this.setState(ee));
515
504
  }
516
505
  render() {
517
- const { children: e, fallbackRender: t, FallbackComponent: n, fallback: o } = this.props, { didCatch: a, error: s } = this.state;
506
+ const { children: e, fallbackRender: t, FallbackComponent: n, fallback: o } = this.props, { didCatch: s, error: a } = this.state;
518
507
  let i = e;
519
- if (a) {
508
+ if (s) {
520
509
  const l = {
521
- error: s,
510
+ error: a,
522
511
  resetErrorBoundary: this.resetErrorBoundary
523
512
  };
524
513
  if (typeof t == "function")
525
514
  i = t(l);
526
515
  else if (n)
527
- i = me(n, l);
516
+ i = fe(n, l);
528
517
  else if (o !== void 0)
529
518
  i = o;
530
519
  else
531
- throw s;
520
+ throw a;
532
521
  }
533
- return me(
534
- Gr.Provider,
522
+ return fe(
523
+ tn.Provider,
535
524
  {
536
525
  value: {
537
- didCatch: a,
538
- error: s,
526
+ didCatch: s,
527
+ error: a,
539
528
  resetErrorBoundary: this.resetErrorBoundary
540
529
  }
541
530
  },
542
531
  i
543
532
  );
544
533
  }
545
- }
546
- function en(r = [], e = []) {
534
+ };
535
+ function nn(r = [], e = []) {
547
536
  return r.length !== e.length || r.some((t, n) => !Object.is(t, e[n]));
548
537
  }
549
- function tn({ children: r, onError: e }) {
550
- return f(Vr, { fallback: f("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: r });
538
+ function on({ children: r, onError: e }) {
539
+ return f(rn, { fallback: f("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: r });
551
540
  }
552
- const rn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? J : b;
553
- function nn({ ignoreHistoryMergeTagChange: r = !0, ignoreSelectionChange: e = !1, onChange: t }) {
554
- const [n] = L();
555
- return rn(() => {
556
- if (t) return n.registerUpdateListener(({ editorState: o, dirtyElements: a, dirtyLeaves: s, prevEditorState: i, tags: l }) => {
557
- e && a.size === 0 && s.size === 0 || r && l.has(oe) || i.isEmpty() || t(o, n, l);
541
+ const an = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? J : b;
542
+ function sn({ ignoreHistoryMergeTagChange: r = !0, ignoreSelectionChange: e = !1, onChange: t }) {
543
+ const [n] = D();
544
+ return an(() => {
545
+ if (t) return n.registerUpdateListener(({ editorState: o, dirtyElements: s, dirtyLeaves: a, prevEditorState: i, tags: l }) => {
546
+ e && s.size === 0 && a.size === 0 || r && l.has(oe) || i.isEmpty() || t(o, n, l);
558
547
  });
559
548
  }, [n, r, e, t]), null;
560
549
  }
561
- function on({ hasStrictIndent: r = !1 }) {
562
- const [e] = L();
550
+ function ln({ hasStrictIndent: r = !1, shouldPreserveNumbering: e = !1 }) {
551
+ const [t] = D();
563
552
  return b(() => {
564
- if (!e.hasNodes([Me, Ae])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
565
- }, [e]), b(() => {
566
- if (r) return tr(e);
567
- }, [e, r]), (function(t) {
568
- b(() => rr(t), [t]);
569
- })(e), null;
570
- }
571
- function an({ validateUrl: r, attributes: e }) {
572
- const [t] = L();
553
+ if (!t.hasNodes([Me, Ae])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
554
+ }, [t]), b(() => H(Ce(t, { restoreNumbering: e }), r ? ar(t) : () => {
555
+ }), [t, r, e]), (function(n) {
556
+ b(() => Ce(n), [n]);
557
+ })(t), null;
558
+ }
559
+ function un({ validateUrl: r, attributes: e }) {
560
+ const [t] = D();
573
561
  return b(() => {
574
- if (!t.hasNodes([Fe])) throw new Error("LinkPlugin: LinkNode not registered on editor");
575
- }), b(() => nr(t, ie({ attributes: e, validateUrl: r })), [t, r, e]), null;
562
+ if (!t.hasNodes([Ke])) throw new Error("LinkPlugin: LinkNode not registered on editor");
563
+ }), b(() => sr(t, se({ attributes: e, validateUrl: r })), [t, r, e]), null;
576
564
  }
577
- function sn(r, e, t) {
565
+ function dn(r, e, t, n) {
578
566
  b(() => {
579
- r.hasNodes([Ue]) || (function(n, ...o) {
580
- const a = new URL("https://lexical.dev/docs/error"), s = new URLSearchParams();
581
- s.append("code", n);
582
- for (const i of o) s.append("v", i);
583
- throw a.search = s.toString(), Error(`Minified Lexical error #${n}; visit ${a.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
567
+ r.hasNodes([ze]) || (function(o, ...s) {
568
+ const a = new URL("https://lexical.dev/docs/error"), i = new URLSearchParams();
569
+ i.append("code", o);
570
+ for (const l of s) i.append("v", l);
571
+ throw a.search = i.toString(), Error(`Minified Lexical error #${o}; visit ${a.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
584
572
  })(77);
585
- }), b(() => or(r, { changeHandlers: t ? [t] : [], matchers: e }), [r, e, t]);
573
+ }), b(() => ir(r, { changeHandlers: t ? [t] : [], excludeParents: n ?? [], matchers: e }), [r, e, t, n]);
586
574
  }
587
- function ln({ matchers: r, onChange: e }) {
588
- const [t] = L();
589
- return sn(t, r, e), null;
575
+ function cn({ matchers: r, onChange: e, excludeParents: t }) {
576
+ const [n] = D();
577
+ return dn(n, r, e, t), null;
590
578
  }
591
- function un({ newTab: r = !0, disabled: e = !1 }) {
592
- const [t] = L();
593
- return b(() => ar(t, ie({ disabled: e, newTab: r })), [t, r, e]), null;
579
+ function fn({ newTab: r = !0, disabled: e = !1 }) {
580
+ const [t] = D();
581
+ return b(() => lr(t, se({ disabled: e, newTab: r })), [t, r, e]), null;
594
582
  }
595
- function cn(r, e, t, n, o) {
583
+ function mn(r, e, t, n, o) {
596
584
  if (r === null || t.size === 0 && n.size === 0 && !o) return 0;
597
- const a = e._selection, s = r._selection;
585
+ const s = e._selection, a = r._selection;
598
586
  if (o) return 1;
599
- if (!(g(a) && g(s) && s.isCollapsed() && a.isCollapsed())) return 0;
600
- const i = (function(C, v, _) {
601
- const T = C._nodeMap, P = [];
602
- for (const k of v) {
603
- const w = T.get(k);
604
- w !== void 0 && P.push(w);
587
+ if (!(h(s) && h(a) && a.isCollapsed() && s.isCollapsed())) return 0;
588
+ const i = (function(C, y, $) {
589
+ const I = C._nodeMap, L = [];
590
+ for (const k of y) {
591
+ const S = I.get(k);
592
+ S !== void 0 && L.push(S);
605
593
  }
606
- for (const [k, w] of _) {
607
- if (!w) continue;
608
- const I = T.get(k);
609
- I === void 0 || Te(I) || P.push(I);
594
+ for (const [k, S] of $) {
595
+ if (!S) continue;
596
+ const P = I.get(k);
597
+ P === void 0 || Re(P) || L.push(P);
610
598
  }
611
- return P;
599
+ return L;
612
600
  })(e, t, n);
613
601
  if (i.length === 0) return 0;
614
602
  if (i.length > 1) {
615
- const C = e._nodeMap, v = C.get(a.anchor.key), _ = C.get(s.anchor.key);
616
- return v && _ && !r._nodeMap.has(v.__key) && B(v) && v.__text.length === 1 && a.anchor.offset === 1 ? 2 : 0;
603
+ const C = e._nodeMap, y = C.get(s.anchor.key), $ = C.get(a.anchor.key);
604
+ return y && $ && !r._nodeMap.has(y.__key) && B(y) && y.__text.length === 1 && s.anchor.offset === 1 ? 2 : 0;
617
605
  }
618
- const l = i[0], c = r._nodeMap.get(l.__key);
619
- if (!B(c) || !B(l) || c.__mode !== l.__mode) return 0;
620
- const u = c.__text, m = l.__text;
606
+ const l = i[0], d = r._nodeMap.get(l.__key);
607
+ if (!B(d) || !B(l) || d.__mode !== l.__mode) return 0;
608
+ const u = d.__text, m = l.__text;
621
609
  if (u === m) return 0;
622
- const h = a.anchor, S = s.anchor;
623
- if (h.key !== S.key || h.type !== "text") return 0;
624
- const y = h.offset, x = S.offset, E = m.length - u.length;
625
- return E === 1 && x === y - 1 ? 2 : E === -1 && x === y + 1 ? 3 : E === -1 && x === y ? 4 : 0;
626
- }
627
- function dn(r, e) {
628
- let t = Date.now(), n = 0;
629
- return (o, a, s, i, l, c) => {
630
- const u = Date.now();
631
- if (c.has(ne)) return n = 0, t = u, 2;
632
- const m = cn(o, a, i, l, r.isComposing()), h = (() => {
633
- const S = s === null || s.editor === r, y = c.has(It);
634
- if (!y && S && c.has(oe)) return 0;
635
- if (o === null) return 1;
636
- const x = a._selection;
637
- if (!(i.size > 0 || l.size > 0)) return x !== null ? 0 : 2;
638
- const E = typeof e == "number" ? e : e.peek();
639
- return y === !1 && m !== 0 && m === n && u < t + E && S || i.size === 1 && (function(C, v, _) {
640
- const T = v._nodeMap.get(C), P = _._nodeMap.get(C), k = v._selection, w = _._selection;
641
- return !(g(k) && g(w) && k.anchor.type === "element" && k.focus.type === "element" && w.anchor.type === "text" && w.focus.type === "text" || !B(T) || !B(P) || T.__parent !== P.__parent) && JSON.stringify(v.read(() => T.exportJSON())) === JSON.stringify(_.read(() => P.exportJSON()));
642
- })(Array.from(i)[0], o, a) ? 0 : 1;
610
+ const p = s.anchor, w = a.anchor;
611
+ if (p.key !== w.key || p.type !== "text") return 0;
612
+ const v = p.offset, N = w.offset, E = m.length - u.length;
613
+ return E === 1 && N === v - 1 ? 2 : E === -1 && N === v + 1 ? 3 : E === -1 && N === v ? 4 : 0;
614
+ }
615
+ function pn(r, e) {
616
+ let t = Date.now(), n = 0, o = Date.now(), s = 0, a = null;
617
+ return (i, l, d, u, m, p) => {
618
+ const w = Date.now();
619
+ if (p.has(Mt) && (o = t, s = n, a = i), p.has(ne)) return n = 0, t = w, 2;
620
+ p.has(At) && a && (t = o, n = s, i = a);
621
+ const v = mn(i, l, u, m, r.isComposing()), N = (() => {
622
+ const E = d === null || d.editor === r, C = p.has(Kt);
623
+ if (!C && E && p.has(oe)) return 0;
624
+ if (v === 1) return 2;
625
+ if (i === null) return 1;
626
+ const y = l._selection;
627
+ if (!(u.size > 0 || m.size > 0)) return y !== null ? 0 : 2;
628
+ const $ = typeof e == "number" ? e : e.peek();
629
+ return C === !1 && v !== 0 && v === n && w < t + $ && E || u.size === 1 && (function(I, L, k) {
630
+ const S = L._nodeMap.get(I), P = k._nodeMap.get(I), x = L._selection, M = k._selection;
631
+ return !(h(x) && h(M) && x.anchor.type === "element" && x.focus.type === "element" && M.anchor.type === "text" && M.focus.type === "text" || !B(S) || !B(P) || S.__parent !== P.__parent) && JSON.stringify(L.read(() => S.exportJSON())) === JSON.stringify(k.read(() => P.exportJSON()));
632
+ })(Array.from(u)[0], i, l) ? 0 : 1;
643
633
  })();
644
- return t = u, n = m, h;
634
+ return t = w, n = v, N;
645
635
  };
646
636
  }
647
637
  function $e(r) {
648
638
  r.undoStack = [], r.redoStack = [], r.current = null;
649
639
  }
650
- function Je(r, e, t) {
651
- const n = dn(r, t);
652
- return H(r.registerCommand(Bt, () => ((function(a, s) {
653
- const i = s.redoStack, l = s.undoStack;
640
+ function je(r, e, t) {
641
+ const n = pn(r, t);
642
+ return H(r.registerCommand(Ft, () => ((function(s, a) {
643
+ const i = a.redoStack, l = a.undoStack;
654
644
  if (l.length !== 0) {
655
- const c = s.current, u = l.pop();
656
- c !== null && (i.push(c), a.dispatchCommand(q, !0)), l.length === 0 && a.dispatchCommand(Q, !1), s.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: ne });
645
+ const d = a.current, u = l.pop();
646
+ d !== null && (i.push(d), s.dispatchCommand(Y, !0)), l.length === 0 && s.dispatchCommand(W, !1), a.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: ne });
657
647
  }
658
- })(r, e), !0), d), r.registerCommand(Rt, () => ((function(a, s) {
659
- const i = s.redoStack, l = s.undoStack;
648
+ })(r, e), !0), c), r.registerCommand(Bt, () => ((function(s, a) {
649
+ const i = a.redoStack, l = a.undoStack;
660
650
  if (i.length !== 0) {
661
- const c = s.current;
662
- c !== null && (l.push(c), a.dispatchCommand(Q, !0));
651
+ const d = a.current;
652
+ d !== null && (l.push(d), s.dispatchCommand(W, !0));
663
653
  const u = i.pop();
664
- i.length === 0 && a.dispatchCommand(q, !1), s.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: ne });
654
+ i.length === 0 && s.dispatchCommand(Y, !1), a.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: ne });
665
655
  }
666
- })(r, e), !0), d), r.registerCommand(Dt, () => ($e(e), !1), d), r.registerCommand(Tt, () => ($e(e), r.dispatchCommand(q, !1), r.dispatchCommand(Q, !1), !0), d), r.registerUpdateListener(({ editorState: a, prevEditorState: s, dirtyLeaves: i, dirtyElements: l, tags: c }) => {
667
- const u = e.current, m = e.redoStack, h = e.undoStack, S = u === null ? null : u.editorState;
668
- if (u !== null && a === S) return;
669
- const y = n(s, a, u, i, l, c);
670
- if (y === 1) m.length !== 0 && (e.redoStack = [], r.dispatchCommand(q, !1)), u !== null && (h.push({ ...u }), r.dispatchCommand(Q, !0));
671
- else if (y === 2) return;
672
- e.current = { editor: r, editorState: a };
656
+ })(r, e), !0), c), r.registerCommand(It, () => ($e(e), !1), c), r.registerCommand(Rt, () => ($e(e), r.dispatchCommand(Y, !1), r.dispatchCommand(W, !1), !0), c), r.registerUpdateListener(({ editorState: s, prevEditorState: a, dirtyLeaves: i, dirtyElements: l, tags: d }) => {
657
+ const u = e.current, m = e.redoStack, p = e.undoStack, w = u === null ? null : u.editorState;
658
+ if (u !== null && s === w) return;
659
+ const v = n(a, s, u, i, l, d);
660
+ if (v === 1) m.length !== 0 && (e.redoStack = [], r.dispatchCommand(Y, !1)), u !== null && (p.push({ ...u }), r.dispatchCommand(W, !0));
661
+ else if (v === 2) return;
662
+ e.current = { editor: r, editorState: s };
673
663
  }));
674
664
  }
675
- function We() {
665
+ function Ye() {
676
666
  return { current: null, redoStack: [], undoStack: [] };
677
667
  }
678
- const te = ae({ build: (r, { delay: e, createInitialHistoryState: t, disabled: n }) => ie({ delay: e, disabled: n, historyState: t(r) }), config: At({ createInitialHistoryState: We, delay: 300, disabled: typeof window > "u" }), name: "@lexical/history/History", register: (r, e, t) => {
668
+ const te = ae({ build: (r, { delay: e, createInitialHistoryState: t, disabled: n }) => se({ delay: e, disabled: n, historyState: t(r) }), config: Ut({ createInitialHistoryState: Ye, delay: 300, disabled: typeof window > "u" }), name: "@lexical/history/History", register: (r, e, t) => {
679
669
  const n = t.getOutput();
680
- return Ie(() => n.disabled.value ? void 0 : Je(r, n.historyState.value, n.delay));
670
+ return Fe(() => n.disabled.value ? void 0 : je(r, n.historyState.value, n.delay));
681
671
  } });
682
- ae({ dependencies: [Mt(te, { createInitialHistoryState: () => {
672
+ ae({ dependencies: [zt(te, { createInitialHistoryState: () => {
683
673
  throw new Error("SharedHistory did not inherit parent history");
684
674
  }, disabled: !0 })], name: "@lexical/history/SharedHistory", register(r, e, t) {
685
- const { output: n } = t.getDependency(te), o = (function(s) {
686
- return s ? Yt(s, te.name) : null;
675
+ const { output: n } = t.getDependency(te), o = (function(a) {
676
+ return a ? Xt(a, te.name) : null;
687
677
  })(r._parentEditor);
688
678
  if (!o) return () => {
689
679
  };
690
- const a = o.output;
691
- return Ie(() => qt(() => {
692
- n.delay.value = a.delay.value, n.historyState.value = a.historyState.value, n.disabled.value = a.disabled.value;
680
+ const s = o.output;
681
+ return Fe(() => Qt(() => {
682
+ n.delay.value = s.delay.value, n.historyState.value = s.historyState.value, n.disabled.value = s.disabled.value;
693
683
  }));
694
684
  } });
695
- function fn({ delay: r, externalHistoryState: e }) {
696
- const [t] = L();
697
- return (function(n, o, a = 1e3) {
698
- const s = j(() => o || We(), [o]);
699
- b(() => Je(n, s, a), [a, n, s]);
685
+ function gn({ delay: r, externalHistoryState: e }) {
686
+ const [t] = D();
687
+ return (function(n, o, s = 1e3) {
688
+ const a = X(() => o || Ye(), [o]);
689
+ b(() => je(n, a, s), [s, n, a]);
700
690
  })(t, e, r), null;
701
691
  }
702
- function mn({ hasCellMerge: r = !0, hasCellBackgroundColor: e = !0, hasTabHandler: t = !0, hasHorizontalScroll: n = !1, hasNestedTables: o = !1 }) {
703
- const [a] = L();
692
+ function hn({ hasCellMerge: r = !0, hasCellBackgroundColor: e = !0, hasTabHandler: t = !0, hasHorizontalScroll: n = !1, hasNestedTables: o = !1, hasFitNestedTables: s = !1 }) {
693
+ const [a] = D();
704
694
  b(() => {
705
- sr(a) !== n && (ir(a, n), a.registerNodeTransform(Ke, () => {
695
+ ur(a) !== n && (dr(a, n), a.registerNodeTransform(Ue, () => {
706
696
  })());
707
697
  }, [a, n]);
708
- const s = j(() => Qt(!1), []);
709
- return s.peek() !== o && (s.value = o), b(() => lr(a, { hasNestedTables: s }), [a, s]), b(() => ur(a, t), [a, t]), b(() => {
710
- if (!r) return cr(a);
698
+ const i = ke(o), l = ke(s);
699
+ return b(() => cr(a, { hasFitNestedTables: l, hasNestedTables: i }), [a, i, l]), b(() => fr(a, t), [a, t]), b(() => {
700
+ if (!r) return mr(a);
711
701
  }, [a, r]), b(() => {
712
- if (!e) return a.registerNodeTransform(ze, (i) => {
713
- i.getBackgroundColor() !== null && i.setBackgroundColor(null);
702
+ if (!e) return a.registerNodeTransform(He, (d) => {
703
+ d.getBackgroundColor() !== null && d.setBackgroundColor(null);
714
704
  });
715
705
  }, [a, e, r]), null;
716
706
  }
717
- function pn({ editorRef: r }) {
718
- const [e] = L();
719
- return Ft.useEffect(() => {
707
+ function ke(r) {
708
+ const [e] = F(() => Zt(r));
709
+ return e.peek() !== r && (e.value = r), e;
710
+ }
711
+ function vn({ editorRef: r }) {
712
+ const [e] = D();
713
+ return Ht.useEffect(() => {
720
714
  typeof r == "function" ? r(e) : typeof r == "object" && (r.current = e);
721
715
  }, [e]), null;
722
716
  }
723
- const gn = ({
717
+ const yn = ({
724
718
  currentLanguage: r = "NL",
725
719
  initialValue: e = "",
726
720
  placeholder: t = "",
727
721
  label: n = "",
728
722
  info: o = "",
729
- required: a = !1,
730
- notValid: s = !1,
723
+ required: s = !1,
724
+ notValid: a = !1,
731
725
  notValidatedText: i = "",
732
726
  maxHeightInRem: l = "20rem",
733
- maxWords: c,
727
+ maxWords: d,
734
728
  rteRef: u = null,
735
729
  onChange: m,
736
- onCatalogueLinkSearch: h,
737
- catalogueSearchResponse: S = { state: "idle", results: [] }
730
+ onCatalogueLinkSearch: p,
731
+ catalogueSearchResponse: w = { state: "idle", results: [] }
738
732
  }) => {
739
- const { switchLanguage: y } = xr(), x = yr(), [E] = M(() => Pe()), [C, v] = M(0), [_, T] = M(0), P = Ht(), k = {
733
+ const { switchLanguage: v } = $r(), N = Er(), [E] = F(() => Le()), [C, y] = F(0), [$, I] = F(0), L = Yt(), k = {
740
734
  html: {
741
- export: fr
735
+ export: gr
742
736
  },
743
737
  namespace: "UvaRte",
744
738
  editor: E,
745
- theme: Er,
746
- onError(N) {
747
- throw N;
739
+ theme: xr,
740
+ onError(x) {
741
+ throw x;
748
742
  },
749
743
  nodes: [
750
744
  Me,
751
745
  Ae,
752
- Fe,
753
- Ue,
754
- ze,
755
- dr,
756
746
  Ke,
757
- _r,
758
- Nr
747
+ ze,
748
+ He,
749
+ pr,
750
+ Ue,
751
+ kr,
752
+ Pr
759
753
  ],
760
- editorState: (N) => {
761
- const $ = new DOMParser().parseFromString(e, "text/html"), Y = Gt(N, $);
762
- F().clear(), De(Y), Le(null);
754
+ editorState: (x) => {
755
+ const _ = new DOMParser().parseFromString(e, "text/html"), j = rr(x, _);
756
+ K().clear(), Ie(j), Te(null);
763
757
  }
764
- }, w = (N) => N.trim().length === 0 ? 0 : N.split(" ").length, I = (N, W) => {
765
- N.read(() => {
766
- let $ = "";
767
- v(w(F().getTextContent().replace(/\s+/g, " ").trim())), $ = mr(Vt(W)), $ = pr($), m($);
758
+ }, S = (x) => x.trim().length === 0 ? 0 : x.split(" ").length, P = (x, M) => {
759
+ x.read(() => {
760
+ let _ = "";
761
+ y(S(K().getTextContent().replace(/\s+/g, " ").trim())), _ = hr(nr(M)), _ = vr(_), m(_);
768
762
  });
769
763
  };
770
764
  return b(() => {
771
- y(r.toUpperCase());
772
- }, [r, y]), b(() => {
773
- const N = e.replace(/<br\s*\/?>|&nbsp;/gi, " ").replace(/<\/?[^>]+(>|$)|&[a-z]+;/g, "").replace(/\s+/g, " ").trim();
774
- v(w(N));
765
+ v(r.toUpperCase());
766
+ }, [r, v]), b(() => {
767
+ const x = e.replace(/<br\s*\/?>|&nbsp;/gi, " ").replace(/<\/?[^>]+(>|$)|&[a-z]+;/g, "").replace(/\s+/g, " ").trim();
768
+ y(S(x));
775
769
  }, [e]), /* @__PURE__ */ A("div", { className: R.editor__container, children: [
776
- /* @__PURE__ */ A("div", { className: R.editor__header, children: [
777
- /* @__PURE__ */ f(wr, { label: n, info: o, required: a }),
778
- c && c > 0 && /* @__PURE__ */ A("div", { className: R["editor__header-word-count"], children: [
779
- /* @__PURE__ */ f("span", { className: Ce({ [R["editor__header-word-count--alert"]]: C > c }), children: C }),
770
+ (n || o || d) && /* @__PURE__ */ A("div", { className: R.editor__header, children: [
771
+ /* @__PURE__ */ f(Nr, { label: n, info: o, required: s }),
772
+ d && d > 0 && /* @__PURE__ */ A("div", { className: R["editor__header-word-count"], children: [
773
+ /* @__PURE__ */ f("span", { className: be({ [R["editor__header-word-count--alert"]]: C > d }), children: C }),
780
774
  " / ",
781
- c
775
+ d
782
776
  ] })
783
777
  ] }),
784
778
  /* @__PURE__ */ f(
785
779
  "div",
786
780
  {
787
- className: Ce(R.editor, {
788
- [R["not-valid"]]: s
781
+ className: be(R.editor, {
782
+ [R["not-valid"]]: a
789
783
  }),
790
- children: /* @__PURE__ */ A(Pr, { initialConfig: k, children: [
784
+ children: /* @__PURE__ */ A(Tr, { initialConfig: k, children: [
791
785
  /* @__PURE__ */ f(
792
- vr,
786
+ br,
793
787
  {
794
- editorScrollPosition: _,
795
- onCatalogueLinkSearch: h,
796
- catalogueSearchResponse: S
788
+ editorScrollPosition: $,
789
+ onCatalogueLinkSearch: p,
790
+ catalogueSearchResponse: w
797
791
  }
798
792
  ),
799
793
  /* @__PURE__ */ A("div", { className: R["editor__field-wrapper"], children: [
800
794
  /* @__PURE__ */ f(
801
- Jr,
795
+ Wr,
802
796
  {
803
797
  contentEditable: /* @__PURE__ */ f(
804
798
  Qr,
805
799
  {
806
800
  className: R.editor__field,
807
- "aria-label": x.common.rteAriaLabel,
801
+ "aria-label": N.common.rteAriaLabel,
808
802
  "aria-placeholder": t,
809
- title: x.common.rteTitle,
803
+ title: N.common.rteTitle,
810
804
  placeholder: /* @__PURE__ */ f("div", { className: R.editor__placeholder, children: t }),
811
805
  spellCheck: !1,
812
- id: `${P}_rteEditor`,
806
+ id: `${L}_rteEditor`,
813
807
  style: { height: `${l}`, maxHeight: `${l}` },
814
- onScroll: (N) => T(N.currentTarget.scrollTop)
808
+ onScroll: (x) => I(x.currentTarget.scrollTop)
815
809
  }
816
810
  ),
817
811
  placeholder: /* @__PURE__ */ f("div", { className: R.editor__placeholder, children: t }),
818
- ErrorBoundary: tn
812
+ ErrorBoundary: on
819
813
  }
820
814
  ),
821
- /* @__PURE__ */ f(mn, {}),
822
- /* @__PURE__ */ f(Jt, {}),
815
+ /* @__PURE__ */ f(hn, {}),
816
+ /* @__PURE__ */ f(Vt, {}),
817
+ /* @__PURE__ */ f(gn, {}),
818
+ /* @__PURE__ */ f(ln, {}),
819
+ /* @__PURE__ */ f(un, { validateUrl: yr }),
820
+ /* @__PURE__ */ f(cn, { matchers: Cr }),
823
821
  /* @__PURE__ */ f(fn, {}),
824
- /* @__PURE__ */ f(on, {}),
825
- /* @__PURE__ */ f(an, { validateUrl: gr }),
826
- /* @__PURE__ */ f(ln, { matchers: hr }),
827
- /* @__PURE__ */ f(un, {}),
828
- /* @__PURE__ */ f(nn, { onChange: I }),
829
- /* @__PURE__ */ f(br, {}),
830
- /* @__PURE__ */ f($r, {}),
831
- u && /* @__PURE__ */ f(pn, { editorRef: u })
822
+ /* @__PURE__ */ f(sn, { onChange: P }),
823
+ /* @__PURE__ */ f(Sr, {}),
824
+ /* @__PURE__ */ f(Lr, {}),
825
+ u && /* @__PURE__ */ f(vn, { editorRef: u })
832
826
  ] })
833
827
  ] })
834
828
  }
835
829
  ),
836
- i !== "" && /* @__PURE__ */ f(Cr, { level: "error", feedback: i })
830
+ i !== "" && /* @__PURE__ */ f(wr, { level: "error", feedback: i })
837
831
  ] });
838
- }, fo = ({
832
+ }, ho = ({
839
833
  currentLanguage: r = "NL",
840
834
  initialValue: e = "",
841
835
  placeholder: t = "",
842
836
  label: n = "",
843
837
  info: o = "",
844
- required: a = !1,
845
- notValid: s = !1,
838
+ required: s = !1,
839
+ notValid: a = !1,
846
840
  notValidatedText: i = "",
847
841
  maxWords: l,
848
- rteRef: c,
842
+ rteRef: d,
849
843
  onChange: u,
850
844
  onCatalogueLinkSearch: m,
851
- catalogueSearchResponse: h = { state: "idle", results: [] }
852
- }) => /* @__PURE__ */ f(Sr, { children: /* @__PURE__ */ f(
853
- gn,
845
+ catalogueSearchResponse: p = { state: "idle", results: [] }
846
+ }) => /* @__PURE__ */ f(_r, { children: /* @__PURE__ */ f(
847
+ yn,
854
848
  {
855
849
  currentLanguage: r.toUpperCase(),
856
850
  initialValue: e,
857
851
  placeholder: t,
858
852
  label: n,
859
853
  info: o,
860
- required: a,
861
- notValid: s,
854
+ required: s,
855
+ notValid: a,
862
856
  notValidatedText: i,
863
857
  maxWords: l,
864
- rteRef: c,
858
+ rteRef: d,
865
859
  onChange: u,
866
860
  onCatalogueLinkSearch: m,
867
- catalogueSearchResponse: h
861
+ catalogueSearchResponse: p
868
862
  }
869
863
  ) });
870
864
  export {
871
- gn as Rte,
872
- fo as RteEditor
865
+ yn as Rte,
866
+ ho as RteEditor
873
867
  };
874
868
  //# sourceMappingURL=RteEditor.js.map