@uva-glass/component-library 3.53.10 → 3.53.11

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 (71) hide show
  1. package/dist/{chunk-MDLQUVZN-BSRMHXbx.js → chunk-MDLQUVZN-Dk02kWJ8.js} +2 -5
  2. package/dist/{chunk-MDLQUVZN-BSRMHXbx.js.map → chunk-MDLQUVZN-Dk02kWJ8.js.map} +1 -1
  3. package/dist/{client-DdSuZDnt.js → client-3XNwBsl7.js} +43 -111
  4. package/dist/{client-DdSuZDnt.js.map → client-3XNwBsl7.js.map} +1 -1
  5. package/dist/components/Accordion/Accordion.test.js +3 -3
  6. package/dist/components/AccordionCard/AccordionCard.test.js +3 -3
  7. package/dist/components/ActionList/ActionList.test.js +3 -3
  8. package/dist/components/AppStatusBar/AppStatusBar.test.js +2 -2
  9. package/dist/components/Attention/Attention.test.js +2 -2
  10. package/dist/components/Backdrop/Backdrop.test.js +2 -2
  11. package/dist/components/Buttons/Button.stories.js +1 -1
  12. package/dist/components/Buttons/Button.test.js +2 -2
  13. package/dist/components/Buttons/LinkButton.stories.js +1 -1
  14. package/dist/components/Buttons/LinkButton.test.js +2 -2
  15. package/dist/components/Buttons/MenuButton.stories.js +1 -1
  16. package/dist/components/Buttons/MenuButton.test.js +2 -2
  17. package/dist/components/Card/Card.test.js +2 -2
  18. package/dist/components/Checkbox/Checkbox.stories.js +1 -1
  19. package/dist/components/Checkbox/Checkbox.test.js +3 -3
  20. package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js +1 -1
  21. package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js +2 -2
  22. package/dist/components/CheckboxTree/CheckboxTree.stories.js +2 -2
  23. package/dist/components/Chip/Chip.stories.js +1 -1
  24. package/dist/components/ControlsButton/ControlsButton.stories.js +1 -1
  25. package/dist/components/Drawer/Drawer.stories.js +1 -1
  26. package/dist/components/FeedbackBar/FeedbackBar.test.js +2 -2
  27. package/dist/components/FormInput/FormInput.stories.js +1 -1
  28. package/dist/components/IconButton/IconButton.stories.js +1 -1
  29. package/dist/components/InputField/InputField.stories.js +1 -1
  30. package/dist/components/Label/Label.test.js +2 -2
  31. package/dist/components/MetaDataBar/MetaDataBar.test.js +1 -1
  32. package/dist/components/ModalDialog/ModalDialog.stories.js +1 -1
  33. package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
  34. package/dist/components/MultiSelectBox/MultiSelectBox.stories.js +1 -1
  35. package/dist/components/MultiSelectBox/MultiSelectBox.test.js +2 -2
  36. package/dist/components/Notification/Notification.stories.js +1 -1
  37. package/dist/components/Notification/Notification.test.js +2 -2
  38. package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js +1 -1
  39. package/dist/components/PeriodSelector/PeriodSelector.stories.js +1 -1
  40. package/dist/components/ProgrammeCard/ProgrammeCard.js.map +1 -1
  41. package/dist/components/RadioGroup/RadioGroup.stories.js +1 -1
  42. package/dist/components/RadioGroup/Radiogroup.test.js +2 -2
  43. package/dist/components/RadioTabSelector/RadioTabSelector.stories.js +1 -1
  44. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js +135 -125
  45. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js.map +1 -1
  46. package/dist/components/RteEditor/RteEditor.js +215 -238
  47. package/dist/components/RteEditor/RteEditor.js.map +1 -1
  48. package/dist/components/RteEditor/translations.js +4 -4
  49. package/dist/components/RteEditor/translations.js.map +1 -1
  50. package/dist/components/SelectListbox/SelectListBox.stories.js +1 -1
  51. package/dist/components/Sortable/Sortable.stories.js +1 -1
  52. package/dist/components/StatusBadge/StatusBadge.test.js +2 -2
  53. package/dist/components/TextArea/TextArea.stories.js +1 -1
  54. package/dist/components/TextArea/TextArea.test.js +3 -3
  55. package/dist/components/ToggleSwitch/ToggleSwitch.stories.js +1 -1
  56. package/dist/components/VarIndicator/VarIndicator.stories.js +1 -1
  57. package/dist/components/VarIndicator/VarIndicator.test.js +3 -3
  58. package/dist/{index-DcECbqp4.js → index-CLNHDZVV.js} +2 -2
  59. package/dist/{index-DcECbqp4.js.map → index-CLNHDZVV.js.map} +1 -1
  60. package/dist/{index-ApPj4mI1.js → index-CULNJwuI.js} +5 -13
  61. package/dist/{index-ApPj4mI1.js.map → index-CULNJwuI.js.map} +1 -1
  62. package/dist/{index-Cfzi-sRQ.js → index-CdPMY4ux.js} +8 -19
  63. package/dist/{index-Cfzi-sRQ.js.map → index-CdPMY4ux.js.map} +1 -1
  64. package/dist/{react-18-plvLTuyc.js → react-18-D3e2aqkg.js} +2 -2
  65. package/dist/{react-18-plvLTuyc.js.map → react-18-D3e2aqkg.js.map} +1 -1
  66. package/dist/{react.esm-BpII5CMY.js → react.esm-QW7uOFDD.js} +5 -8
  67. package/dist/{react.esm-BpII5CMY.js.map → react.esm-QW7uOFDD.js.map} +1 -1
  68. package/dist/setupTests.js +1 -1
  69. package/dist/storybook__react.d.js +6 -9
  70. package/dist/storybook__react.d.js.map +1 -1
  71. package/package.json +9 -9
@@ -1,6 +1,6 @@
1
- import { jsx as f, jsxs as A, Fragment as Le } from "react/jsx-runtime";
1
+ import { jsx as m, jsxs as F, Fragment as ke } from "react/jsx-runtime";
2
2
  import { t as Ye, r as qe, o as D } from "../../LexicalComposerContext.prod-DOyoZx0P.js";
3
- import { ar as Pe, al as F, $ as Ge, c as p, az as oe, at as ae, aA as H, M as se, U as Ve, p as I, b as g, a2 as Ze, V as c, aX as Qe, n as et, r as tt, i as rt, aY as nt, aZ as ot, X as at, k as $, aG as st, a_ as it, a$ as lt, b0 as ut, A as re, b1 as dt, b2 as ct, a7 as ft, S as mt, l as De, P as pt, b3 as gt, b4 as ue, h as de, W as ht, G as Z, T as vt, a8 as Te, b5 as ce, B as yt, N as Ct, y as bt, b6 as fe, z as Et, b7 as wt, b8 as St, aj as $e, aT as xt, a0 as Nt, d as Be, Z as _t, b9 as kt, a1 as Lt, F as Pt, D as Dt, u as Tt, aI as Y, aH as q, ba as $t, bb as Bt, aK as It, bc as ne, aJ as Rt, bd as Mt, be as At, ax as Ft } from "../../Lexical.prod-Dgzi-S1E.js";
3
+ import { ar as Pe, al as A, $ as Ge, c as p, az as oe, at as ae, aA as H, M as se, U as Ve, p as I, b as g, a2 as Ze, V as c, aX as Qe, n as et, r as tt, i as rt, aY as nt, aZ as ot, X as at, k as T, aG as st, a_ as it, a$ as lt, b0 as ut, A as re, b1 as dt, b2 as ct, a7 as ft, S as mt, l as De, P as pt, b3 as gt, b4 as ue, h as de, W as ht, G as Z, T as vt, a8 as Le, b5 as ce, B as yt, N as Ct, y as bt, b6 as fe, z as Et, b7 as wt, b8 as St, aj as Te, aT as xt, a0 as _t, d as Be, Z as Nt, b9 as $t, a1 as kt, F as Pt, D as Dt, u as Lt, aI as Y, aH as q, ba as Tt, bb as Bt, aK as It, bc as ne, aJ as Rt, bd as Mt, be as Ft, ax as At } from "../../Lexical.prod-Dgzi-S1E.js";
4
4
  import * as Ut from "react";
5
5
  import { useMemo as O, useLayoutEffect as j, useEffect as b, useState as M, Suspense as zt, forwardRef as Ie, useCallback as Kt, Component as Ht, createElement as me, createContext as Ot, useId as jt } from "react";
6
6
  import { a as Wt, T as Jt } from "../../TableCellResizerPlugin-9kvw_LpH.js";
@@ -9,8 +9,8 @@ import { flushSync as Vt, createPortal as Zt } from "react-dom";
9
9
  import { U as W, P as z, E as Qt } from "../../LexicalUtils.prod-D1mwAww-.js";
10
10
  import { R as pe, F as ge, m as er, g as tr } from "../../LexicalClipboard.prod-Dxc8c2F_.js";
11
11
  import { A as he, Z as ve, n as ye } from "../../LexicalSelection.prod-B0uiXGSS.js";
12
- import { l as Me, n as Ae, L as rr, b as nr } from "../../LexicalList.prod-DADZlhem.js";
13
- import { y as Fe, F as or, A as Ue, l as ar, z as sr } from "../../LexicalLink.prod-EEOzXxej.js";
12
+ import { l as Me, n as Fe, L as rr, b as nr } from "../../LexicalList.prod-DADZlhem.js";
13
+ import { y as Ae, F as or, A as Ue, l as ar, z as sr } from "../../LexicalLink.prod-EEOzXxej.js";
14
14
  import { u as ir, h as lr, d as ze, N as ur, y as dr, b as cr, T as Ke, E as fr } from "../../LexicalTable.prod-QpQxZNNH.js";
15
15
  import { c as Ce } from "../../clsx-OuTLNxxd.js";
16
16
  import { exportMap as mr, mergeBoldStrongTags as pr, cleanUpTable as gr } from "./helpers.js";
@@ -45,58 +45,58 @@ import "../WeekSelector/components/WeekSelectorOptionContainer.js";
45
45
  import { PasteHandlerPlugin as Er } from "./Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js";
46
46
  import { UvaTheme as wr } from "./UvaTheme/UvaTheme.js";
47
47
  import { EditorHeader as Sr } from "./EditorHeader/EditorHeader.js";
48
- import { LanguageProvider as xr, useLanguage as Nr } from "./Providers/LanguageProvider.js";
49
- import { TableWrapperNode as _r } from "./nodes/TableWrapperNode/TableWrapperNode.js";
50
- import { CourseCatalogueNode as kr, CourseCatalogueLinkPlugin as Lr } from "./nodes/CourseCatalogueNode/CourseCatalogueNode.js";
51
- const He = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Pr = He ? j : b, G = { tag: oe };
52
- function Dr({ initialConfig: r, children: e }) {
48
+ import { LanguageProvider as xr, useLanguage as _r } from "./Providers/LanguageProvider.js";
49
+ import { TableWrapperNode as Nr } from "./nodes/TableWrapperNode/TableWrapperNode.js";
50
+ import { CourseCatalogueNode as $r } from "./nodes/CourseCatalogueNode/CourseCatalogueNode.js";
51
+ const He = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, kr = He ? j : b, G = { tag: oe };
52
+ function Pr({ initialConfig: r, children: e }) {
53
53
  const t = O(() => {
54
- const { theme: n, namespace: o, nodes: a, onError: s, editorState: i, html: l } = r, d = 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) {
54
+ const { theme: n, namespace: o, nodes: a, onError: s, editorState: i, html: l } = r, d = Ye(null, n), u = Pe({ editable: r.editable, html: l, namespace: o, nodes: a, onError: (f) => s(f, u), theme: n });
55
+ return (function(f, h) {
56
56
  if (h !== null) {
57
- if (h === void 0) m.update(() => {
58
- const S = F();
57
+ if (h === void 0) f.update(() => {
58
+ const S = A();
59
59
  if (S.isEmpty()) {
60
60
  const y = Ge();
61
61
  S.append(y);
62
62
  const x = He ? document.activeElement : null;
63
- (p() !== null || x !== null && x === m.getRootElement()) && y.select();
63
+ (p() !== null || x !== null && x === f.getRootElement()) && y.select();
64
64
  }
65
65
  }, G);
66
66
  else if (h !== null) switch (typeof h) {
67
67
  case "string": {
68
- const S = m.parseEditorState(h);
69
- m.setEditorState(S, G);
68
+ const S = f.parseEditorState(h);
69
+ f.setEditorState(S, G);
70
70
  break;
71
71
  }
72
72
  case "object":
73
- m.setEditorState(h, G);
73
+ f.setEditorState(h, G);
74
74
  break;
75
75
  case "function":
76
- m.update(() => {
77
- F().isEmpty() && h(m);
76
+ f.update(() => {
77
+ A().isEmpty() && h(f);
78
78
  }, G);
79
79
  }
80
80
  }
81
81
  })(u, i), [u, d];
82
82
  }, []);
83
- return Pr(() => {
83
+ return kr(() => {
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
+ }, []), m(qe.Provider, { value: t, children: e });
87
87
  }
88
- const Tr = ae({ name: "@lexical/react/ReactProvider" });
89
- function $r() {
90
- return F().getTextContent();
88
+ const Dr = ae({ name: "@lexical/react/ReactProvider" });
89
+ function Lr() {
90
+ return A().getTextContent();
91
91
  }
92
- function Br(r, e = !0) {
92
+ function Tr(r, e = !0) {
93
93
  if (r) return !1;
94
- let t = $r();
94
+ let t = Lr();
95
95
  return e && (t = t.trim()), t === "";
96
96
  }
97
- function Ir(r) {
98
- if (!Br(r, !1)) return !1;
99
- const e = F().getChildren(), t = e.length;
97
+ function Br(r) {
98
+ if (!Tr(r, !1)) return !1;
99
+ const e = A().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];
@@ -113,9 +113,9 @@ function Ir(r) {
113
113
  return !0;
114
114
  }
115
115
  function Oe(r) {
116
- return () => Ir(r);
116
+ return () => Br(r);
117
117
  }
118
- function Rr(r) {
118
+ function Ir(r) {
119
119
  const e = window.location.origin, t = (n) => {
120
120
  if (n.origin !== e) return;
121
121
  const o = r.getRootElement();
@@ -133,16 +133,16 @@ function Rr(r) {
133
133
  if (i && i.functionId === "makeChanges") {
134
134
  const l = i.args;
135
135
  if (l) {
136
- const [d, u, m, h, S] = l;
136
+ const [d, u, f, h, S] = l;
137
137
  r.update(() => {
138
138
  const y = p();
139
139
  if (g(y)) {
140
140
  const x = y.anchor;
141
141
  let E = x.getNode(), C = 0, v = 0;
142
- if (I(E) && d >= 0 && u >= 0 && (C = d, v = d + u, y.setTextNodeRange(E, C, E, v)), C === v && m === "" || (y.insertRawText(m), E = x.getNode()), I(E)) {
142
+ if (I(E) && d >= 0 && u >= 0 && (C = d, v = d + u, y.setTextNodeRange(E, C, E, v)), C === v && f === "" || (y.insertRawText(f), E = x.getNode()), I(E)) {
143
143
  C = h, v = h + S;
144
- const N = E.getTextContentSize();
145
- C = C > N ? N : C, v = v > N ? N : v, y.setTextNodeRange(E, C, E, v);
144
+ const _ = E.getTextContentSize();
145
+ C = C > _ ? _ : C, v = v > _ ? _ : v, y.setTextNodeRange(E, C, E, v);
146
146
  }
147
147
  n.stopImmediatePropagation();
148
148
  }
@@ -167,7 +167,7 @@ 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, Mr = U && "documentMode" in document ? document.documentMode : null, Ar = U && /Mac|iPod|iPhone|iPad/.test(navigator.platform), Fr = !(!U || !("InputEvent" in window) || Mr) && "getTargetRanges" in new window.InputEvent("input"), Ur = U && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Ee = U && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, zr = U && /^(?=.*Chrome).*/i.test(navigator.userAgent), Kr = U && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && Ar && !zr, we = tt("DRAG_DROP_PASTE_FILE");
170
+ const U = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Rr = U && "documentMode" in document ? document.documentMode : null, Mr = U && /Mac|iPod|iPhone|iPad/.test(navigator.platform), Fr = !(!U || !("InputEvent" in window) || Rr) && "getTargetRanges" in new window.InputEvent("input"), Ar = U && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Ee = U && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Ur = U && /^(?=.*Chrome).*/i.test(navigator.userAgent), zr = U && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && Mr && !Ur, we = tt("DRAG_DROP_PASTE_FILE");
171
171
  function V(r) {
172
172
  let e = null;
173
173
  if (z(r, DragEvent) ? e = r.dataTransfer : z(r, ClipboardEvent) && (e = r.clipboardData), e === null) return [!1, [], !1];
@@ -195,20 +195,20 @@ function xe(r) {
195
195
  function Q(r) {
196
196
  for (const e of ["lowercase", "uppercase", "capitalize"]) r.hasFormat(e) && r.toggleFormat(e);
197
197
  }
198
- function Hr(r) {
199
- return W(r.registerCommand(Tt, (e) => {
198
+ function Kr(r) {
199
+ return W(r.registerCommand(Lt, (e) => {
200
200
  const t = p();
201
- return !!$(t) && (t.clear(), !0);
201
+ return !!T(t) && (t.clear(), !0);
202
202
  }, c), r.registerCommand(Z, (e) => {
203
203
  const t = p();
204
- return g(t) ? (t.deleteCharacter(e), !0) : !!$(t) && (t.deleteNodes(), !0);
204
+ return g(t) ? (t.deleteCharacter(e), !0) : !!T(t) && (t.deleteNodes(), !0);
205
205
  }, c), r.registerCommand(Dt, (e) => {
206
206
  const t = p();
207
207
  return !!g(t) && (t.deleteWord(e), !0);
208
208
  }, c), r.registerCommand(Pt, (e) => {
209
209
  const t = p();
210
210
  return !!g(t) && (t.deleteLine(e), !0);
211
- }, c), r.registerCommand(Lt, (e) => {
211
+ }, c), r.registerCommand(kt, (e) => {
212
212
  const t = p();
213
213
  if (typeof e == "string") t !== null && t.insertText(e);
214
214
  else {
@@ -221,15 +221,15 @@ function Hr(r) {
221
221
  }
222
222
  }
223
223
  return !0;
224
- }, c), r.registerCommand(kt, () => {
224
+ }, c), r.registerCommand($t, () => {
225
225
  const e = p();
226
226
  return !!g(e) && (e.removeText(), !0);
227
- }, c), r.registerCommand(_t, (e) => {
227
+ }, c), r.registerCommand(Nt, (e) => {
228
228
  const t = p();
229
229
  return !!g(t) && (t.formatText(e), !0);
230
- }, c), r.registerCommand(Nt, (e) => {
230
+ }, c), r.registerCommand(_t, (e) => {
231
231
  const t = p();
232
- if (!g(t) && !$(t)) return !1;
232
+ if (!g(t) && !T(t)) return !1;
233
233
  const n = t.getNodes();
234
234
  for (const o of n) {
235
235
  const a = Be(o, (s) => se(s) && !s.isInline());
@@ -242,7 +242,7 @@ function Hr(r) {
242
242
  }, c), r.registerCommand(de, () => {
243
243
  const e = p();
244
244
  return !!g(e) && (e.insertParagraph(), !0);
245
- }, c), r.registerCommand(St, () => ($e([xt()]), !0), c), r.registerCommand(wt, () => Se((e) => {
245
+ }, c), r.registerCommand(St, () => (Te([xt()]), !0), c), r.registerCommand(wt, () => Se((e) => {
246
246
  const t = e.getIndent();
247
247
  e.setIndent(t + 1);
248
248
  }), c), r.registerCommand(ce, () => Se((e) => {
@@ -250,7 +250,7 @@ function Hr(r) {
250
250
  t > 0 && e.setIndent(Math.max(0, t - 1));
251
251
  }), c), r.registerCommand(Et, (e) => {
252
252
  const t = p();
253
- if ($(t)) {
253
+ if (T(t)) {
254
254
  const n = t.getNodes();
255
255
  if (n.length > 0) return e.preventDefault(), n[0].selectPrevious(), !0;
256
256
  } else if (g(t)) {
@@ -260,13 +260,13 @@ function Hr(r) {
260
260
  return !1;
261
261
  }, c), r.registerCommand(bt, (e) => {
262
262
  const t = p();
263
- if ($(t)) {
263
+ if (T(t)) {
264
264
  const n = t.getNodes();
265
265
  if (n.length > 0) return e.preventDefault(), n[0].selectNext(0, 0), !0;
266
266
  } else if (g(t)) {
267
267
  if ((function(o) {
268
268
  const a = o.focus;
269
- return a.key === "root" && a.offset === F().getChildrenSize();
269
+ return a.key === "root" && a.offset === A().getChildrenSize();
270
270
  })(t)) return e.preventDefault(), !0;
271
271
  const n = fe(t.focus, !1);
272
272
  if (!e.shiftKey && H(n) && !n.isIsolated() && !n.isInline()) return n.selectNext(), e.preventDefault(), !0;
@@ -274,7 +274,7 @@ function Hr(r) {
274
274
  return !1;
275
275
  }, c), r.registerCommand(Ct, (e) => {
276
276
  const t = p();
277
- if ($(t)) {
277
+ if (T(t)) {
278
278
  const n = t.getNodes();
279
279
  if (n.length > 0) return e.preventDefault(), he(n[0]) ? n[0].selectNext(0, 0) : n[0].selectPrevious(), !0;
280
280
  }
@@ -286,7 +286,7 @@ function Hr(r) {
286
286
  return !1;
287
287
  }, c), r.registerCommand(yt, (e) => {
288
288
  const t = p();
289
- if ($(t)) {
289
+ if (T(t)) {
290
290
  const o = t.getNodes();
291
291
  if (o.length > 0) return e.preventDefault(), he(o[0]) ? o[0].selectPrevious() : o[0].selectNext(0, 0), !0;
292
292
  }
@@ -302,22 +302,22 @@ function Hr(r) {
302
302
  const { anchor: o } = n;
303
303
  if (o.offset !== 0) return !1;
304
304
  const a = o.getNode();
305
- if (Te(a)) return !1;
305
+ if (Le(a)) return !1;
306
306
  const s = Qt(a);
307
307
  return s.getIndent() > 0 && (s.is(a) || a.is(s.getFirstDescendant()));
308
308
  })(t)) return e.preventDefault(), r.dispatchCommand(ce, void 0);
309
309
  if (Ee && navigator.language === "ko-KR") return !1;
310
- } else if (!$(t)) return !1;
310
+ } else if (!T(t)) return !1;
311
311
  return e.preventDefault(), r.dispatchCommand(Z, !0);
312
312
  }, c), r.registerCommand(ht, (e) => {
313
313
  if (xe(e.target)) return !1;
314
314
  const t = p();
315
- return !(!g(t) && !$(t)) && (e.preventDefault(), r.dispatchCommand(Z, !1));
315
+ return !(!g(t) && !T(t)) && (e.preventDefault(), r.dispatchCommand(Z, !1));
316
316
  }, c), r.registerCommand(gt, (e) => {
317
317
  const t = p();
318
318
  if (!g(t)) return !1;
319
319
  if (Q(t), e !== null) {
320
- if ((Ee || Ur || Kr) && Fr) return !1;
320
+ if ((Ee || Ar || zr) && Fr) return !1;
321
321
  if (e.preventDefault(), e.shiftKey) return r.dispatchCommand(ue, !1);
322
322
  }
323
323
  return r.dispatchCommand(de, void 0);
@@ -334,8 +334,8 @@ function Hr(r) {
334
334
  const l = ft();
335
335
  if (I(i)) l.anchor.set(i.getKey(), a, "text"), l.focus.set(i.getKey(), a, "text");
336
336
  else {
337
- const u = i.getParentOrThrow().getKey(), m = i.getIndexWithinParent() + 1;
338
- l.anchor.set(u, m, "element"), l.focus.set(u, m, "element");
337
+ const u = i.getParentOrThrow().getKey(), f = i.getIndexWithinParent() + 1;
338
+ l.anchor.set(u, f, "element"), l.focus.set(u, f, "element");
339
339
  }
340
340
  const d = mt(l);
341
341
  De(d);
@@ -361,7 +361,7 @@ function Hr(r) {
361
361
  }, c), r.registerCommand(it, () => (lt(), !0), c), r.registerCommand(st, (e) => (ge(r, z(e, ClipboardEvent) ? e : null), !0), c), r.registerCommand(at, (e) => ((async function(t, n) {
362
362
  await ge(n, z(t, ClipboardEvent) ? t : null), n.update(() => {
363
363
  const o = p();
364
- g(o) ? o.removeText() : $(o) && o.getNodes().forEach((a) => a.remove());
364
+ g(o) ? o.removeText() : T(o) && o.getNodes().forEach((a) => a.remove());
365
365
  });
366
366
  })(e, r), !0), c), r.registerCommand(et, (e) => {
367
367
  const [, t, n] = V(e);
@@ -379,14 +379,14 @@ function Hr(r) {
379
379
  return g(t) && Q(t), !1;
380
380
  }, c));
381
381
  }
382
- function Or(r, ...e) {
382
+ function Hr(r, ...e) {
383
383
  const t = new URL("https://lexical.dev/docs/error"), n = new URLSearchParams();
384
384
  n.append("code", r);
385
385
  for (const o of e) n.append("v", o);
386
386
  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
387
  }
388
388
  const le = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? j : b;
389
- function jr({ editor: r, ErrorBoundary: e }) {
389
+ function Or({ editor: r, ErrorBoundary: e }) {
390
390
  return (function(t, n) {
391
391
  const [o, a] = M(() => t.getDecorators());
392
392
  return le(() => t.registerDecoratorListener((s) => {
@@ -398,38 +398,38 @@ function jr({ editor: r, ErrorBoundary: e }) {
398
398
  }, [t]), O(() => {
399
399
  const s = [], i = Object.keys(o);
400
400
  for (let l = 0; l < i.length; l++) {
401
- const d = i[l], u = f(n, { onError: (h) => t._onError(h), children: f(zt, { fallback: null, children: o[d] }) }), m = t.getElementByKey(d);
402
- m !== null && s.push(Zt(u, m, d));
401
+ const d = i[l], u = m(n, { onError: (h) => t._onError(h), children: m(zt, { fallback: null, children: o[d] }) }), f = t.getElementByKey(d);
402
+ f !== null && s.push(Zt(u, f, d));
403
403
  }
404
404
  return s;
405
405
  }, [n, o, t]);
406
406
  })(r, e);
407
407
  }
408
- function Wr({ editor: r, ErrorBoundary: e }) {
408
+ function jr({ editor: r, ErrorBoundary: e }) {
409
409
  return (function(t) {
410
410
  const n = Xt.maybeFromEditor(t);
411
- if (n && n.hasExtensionByName(Tr.name)) {
412
- for (const o of ["@lexical/plain-text", "@lexical/rich-text"]) n.hasExtensionByName(o) && Or(320, o);
411
+ if (n && n.hasExtensionByName(Dr.name)) {
412
+ for (const o of ["@lexical/plain-text", "@lexical/rich-text"]) n.hasExtensionByName(o) && Hr(320, o);
413
413
  return !0;
414
414
  }
415
415
  return !1;
416
- })(r) ? null : f(jr, { editor: r, ErrorBoundary: e });
416
+ })(r) ? null : m(Or, { editor: r, ErrorBoundary: e });
417
417
  }
418
- function Ne(r) {
418
+ function _e(r) {
419
419
  return r.getEditorState().read(Oe(r.isComposing()));
420
420
  }
421
- function Jr({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
421
+ function Wr({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
422
422
  const [n] = D();
423
423
  return (function(o) {
424
- le(() => W(Hr(o), Rr(o)), [o]);
425
- })(n), A(Le, { children: [r, f(Xr, { content: e }), f(Wr, { editor: n, ErrorBoundary: t })] });
424
+ le(() => W(Kr(o), Ir(o)), [o]);
425
+ })(n), F(ke, { children: [r, m(Jr, { content: e }), m(jr, { editor: n, ErrorBoundary: t })] });
426
426
  }
427
- function Xr({ content: r }) {
427
+ function Jr({ content: r }) {
428
428
  const [e] = D(), t = (function(o) {
429
- const [a, s] = M(() => Ne(o));
429
+ const [a, s] = M(() => _e(o));
430
430
  return le(() => {
431
431
  function i() {
432
- const l = Ne(o);
432
+ const l = _e(o);
433
433
  s(l);
434
434
  }
435
435
  return i(), W(o.registerUpdateListener(() => {
@@ -442,33 +442,33 @@ function Xr({ content: r }) {
442
442
  return t ? typeof r == "function" ? r(n) : r : null;
443
443
  }
444
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: d, ariaMultiline: u, ariaOwns: m, ariaRequired: h, autoCapitalize: S, className: y, id: x, role: E = "textbox", spellCheck: C = !0, style: v, tabIndex: N, "data-testid": T, ...P }, L) {
446
- const [w, R] = M(r.isEditable()), _ = Kt((k) => {
447
- k && k.ownerDocument && k.ownerDocument.defaultView ? r.setRootElement(k) : r.setRootElement(null);
448
- }, [r]), J = O(() => /* @__PURE__ */ (function(...k) {
445
+ function Xr({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: n, ariaDescribedBy: o, ariaErrorMessage: a, ariaExpanded: s, ariaInvalid: i, ariaLabel: l, ariaLabelledBy: d, ariaMultiline: u, ariaOwns: f, ariaRequired: h, autoCapitalize: S, className: y, id: x, role: E = "textbox", spellCheck: C = !0, style: v, tabIndex: _, "data-testid": L, ...P }, k) {
446
+ const [w, R] = M(r.isEditable()), N = Kt(($) => {
447
+ $ && $.ownerDocument && $.ownerDocument.defaultView ? r.setRootElement($) : r.setRootElement(null);
448
+ }, [r]), J = O(() => /* @__PURE__ */ (function(...$) {
449
449
  return (X) => {
450
- for (const K of k) typeof K == "function" ? K(X) : K != null && (K.current = X);
450
+ for (const K of $) typeof K == "function" ? K(X) : K != null && (K.current = X);
451
451
  };
452
- })(L, _), [_, L]);
453
- return je(() => (R(r.isEditable()), r.registerEditableListener((k) => {
454
- R(k);
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": d, "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: J, role: E, spellCheck: C, style: v, tabIndex: N, ...P });
452
+ })(k, N), [N, k]);
453
+ return je(() => (R(r.isEditable()), r.registerEditableListener(($) => {
454
+ R($);
455
+ })), [r]), m("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": d, "aria-multiline": u, "aria-owns": w ? f : void 0, "aria-readonly": !w || void 0, "aria-required": h, autoCapitalize: S, className: y, contentEditable: w, "data-testid": L, id: x, ref: J, role: E, spellCheck: C, style: v, tabIndex: _, ...P });
456
456
  }
457
- const qr = Ie(Yr);
458
- function _e(r) {
457
+ const Yr = Ie(Xr);
458
+ function Ne(r) {
459
459
  return r.getEditorState().read(Oe(r.isComposing()));
460
460
  }
461
- const Gr = Ie(Vr);
462
- function Vr(r, e) {
461
+ const qr = Ie(Gr);
462
+ function Gr(r, e) {
463
463
  const { placeholder: t, ...n } = r, [o] = D();
464
- return A(Le, { children: [f(qr, { editor: o, ...n, ref: e }), t != null && f(Zr, { editor: o, content: t })] });
464
+ return F(ke, { children: [m(Yr, { editor: o, ...n, ref: e }), t != null && m(Vr, { editor: o, content: t })] });
465
465
  }
466
- function Zr({ content: r, editor: e }) {
466
+ function Vr({ content: r, editor: e }) {
467
467
  const t = (function(s) {
468
- const [i, l] = M(() => _e(s));
468
+ const [i, l] = M(() => Ne(s));
469
469
  return je(() => {
470
470
  function d() {
471
- const u = _e(s);
471
+ const u = Ne(s);
472
472
  l(u);
473
473
  }
474
474
  return d(), W(s.registerUpdateListener(() => {
@@ -482,64 +482,39 @@ function Zr({ content: r, editor: e }) {
482
482
  o(s);
483
483
  })), [e]), !t) return null;
484
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 });
485
+ return typeof r == "function" ? a = r(n) : r !== null && (a = r), a === null ? null : m("div", { "aria-hidden": !0, children: a });
486
486
  }
487
- const Qr = Ot(null), ee = {
487
+ const Zr = Ot(null), ee = {
488
488
  didCatch: !1,
489
489
  error: null
490
490
  };
491
- class en extends Ht {
491
+ class Qr extends Ht {
492
492
  constructor(e) {
493
493
  super(e), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = ee;
494
494
  }
495
495
  static getDerivedStateFromError(e) {
496
- return {
497
- didCatch: !0,
498
- error: e
499
- };
496
+ return { didCatch: !0, error: e };
500
497
  }
501
- resetErrorBoundary() {
502
- const {
503
- error: e
504
- } = this.state;
505
- if (e !== null) {
506
- for (var t, n, o = arguments.length, a = new Array(o), s = 0; s < o; s++)
507
- a[s] = arguments[s];
508
- (t = (n = this.props).onReset) === null || t === void 0 || t.call(n, {
509
- args: a,
510
- reason: "imperative-api"
511
- }), this.setState(ee);
512
- }
498
+ resetErrorBoundary(...e) {
499
+ const { error: t } = this.state;
500
+ t !== null && (this.props.onReset?.({
501
+ args: e,
502
+ reason: "imperative-api"
503
+ }), this.setState(ee));
513
504
  }
514
505
  componentDidCatch(e, t) {
515
- var n, o;
516
- (n = (o = this.props).onError) === null || n === void 0 || n.call(o, e, t);
506
+ this.props.onError?.(e, t);
517
507
  }
518
508
  componentDidUpdate(e, t) {
519
- const {
520
- didCatch: n
521
- } = this.state, {
522
- resetKeys: o
523
- } = this.props;
524
- if (n && t.error !== null && tn(e.resetKeys, o)) {
525
- var a, s;
526
- (a = (s = this.props).onReset) === null || a === void 0 || a.call(s, {
527
- next: o,
528
- prev: e.resetKeys,
529
- reason: "keys"
530
- }), this.setState(ee);
531
- }
509
+ const { didCatch: n } = this.state, { resetKeys: o } = this.props;
510
+ n && t.error !== null && en(e.resetKeys, o) && (this.props.onReset?.({
511
+ next: o,
512
+ prev: e.resetKeys,
513
+ reason: "keys"
514
+ }), this.setState(ee));
532
515
  }
533
516
  render() {
534
- const {
535
- children: e,
536
- fallbackRender: t,
537
- FallbackComponent: n,
538
- fallback: o
539
- } = this.props, {
540
- didCatch: a,
541
- error: s
542
- } = this.state;
517
+ const { children: e, fallbackRender: t, FallbackComponent: n, fallback: o } = this.props, { didCatch: a, error: s } = this.state;
543
518
  let i = e;
544
519
  if (a) {
545
520
  const l = {
@@ -555,48 +530,51 @@ class en extends Ht {
555
530
  else
556
531
  throw s;
557
532
  }
558
- return me(Qr.Provider, {
559
- value: {
560
- didCatch: a,
561
- error: s,
562
- resetErrorBoundary: this.resetErrorBoundary
563
- }
564
- }, i);
533
+ return me(
534
+ Zr.Provider,
535
+ {
536
+ value: {
537
+ didCatch: a,
538
+ error: s,
539
+ resetErrorBoundary: this.resetErrorBoundary
540
+ }
541
+ },
542
+ i
543
+ );
565
544
  }
566
545
  }
567
- function tn() {
568
- let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
546
+ function en(r = [], e = []) {
569
547
  return r.length !== e.length || r.some((t, n) => !Object.is(t, e[n]));
570
548
  }
571
- function rn({ children: r, onError: e }) {
572
- return f(en, { fallback: f("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: r });
549
+ function tn({ children: r, onError: e }) {
550
+ return m(Qr, { fallback: m("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: r });
573
551
  }
574
- const nn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? j : b;
575
- function on({ ignoreHistoryMergeTagChange: r = !0, ignoreSelectionChange: e = !1, onChange: t }) {
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 }) {
576
554
  const [n] = D();
577
- return nn(() => {
555
+ return rn(() => {
578
556
  if (t) return n.registerUpdateListener(({ editorState: o, dirtyElements: a, dirtyLeaves: s, prevEditorState: i, tags: l }) => {
579
557
  e && a.size === 0 && s.size === 0 || r && l.has(oe) || i.isEmpty() || t(o, n, l);
580
558
  });
581
559
  }, [n, r, e, t]), null;
582
560
  }
583
- function an({ hasStrictIndent: r = !1 }) {
561
+ function on({ hasStrictIndent: r = !1 }) {
584
562
  const [e] = D();
585
563
  return b(() => {
586
- if (!e.hasNodes([Me, Ae])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
564
+ if (!e.hasNodes([Me, Fe])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
587
565
  }, [e]), b(() => {
588
566
  if (r) return rr(e);
589
567
  }, [e, r]), (function(t) {
590
568
  b(() => nr(t), [t]);
591
569
  })(e), null;
592
570
  }
593
- function sn({ validateUrl: r, attributes: e }) {
571
+ function an({ validateUrl: r, attributes: e }) {
594
572
  const [t] = D();
595
573
  return b(() => {
596
- if (!t.hasNodes([Fe])) throw new Error("LinkPlugin: LinkNode not registered on editor");
574
+ if (!t.hasNodes([Ae])) throw new Error("LinkPlugin: LinkNode not registered on editor");
597
575
  }), b(() => or(t, ie({ attributes: e, validateUrl: r })), [t, r, e]), null;
598
576
  }
599
- function ln(r, e, t) {
577
+ function sn(r, e, t) {
600
578
  b(() => {
601
579
  r.hasNodes([Ue]) || (function(n, ...o) {
602
580
  const a = new URL("https://lexical.dev/docs/error"), s = new URLSearchParams();
@@ -606,71 +584,71 @@ function ln(r, e, t) {
606
584
  })(77);
607
585
  }), b(() => ar(r, { changeHandlers: t ? [t] : [], matchers: e }), [r, e, t]);
608
586
  }
609
- function un({ matchers: r, onChange: e }) {
587
+ function ln({ matchers: r, onChange: e }) {
610
588
  const [t] = D();
611
- return ln(t, r, e), null;
589
+ return sn(t, r, e), null;
612
590
  }
613
- function dn({ newTab: r = !0, disabled: e = !1 }) {
591
+ function un({ newTab: r = !0, disabled: e = !1 }) {
614
592
  const [t] = D();
615
593
  return b(() => sr(t, ie({ disabled: e, newTab: r })), [t, r, e]), null;
616
594
  }
617
- function cn(r, e, t, n, o) {
595
+ function dn(r, e, t, n, o) {
618
596
  if (r === null || t.size === 0 && n.size === 0 && !o) return 0;
619
597
  const a = e._selection, s = r._selection;
620
598
  if (o) return 1;
621
599
  if (!(g(a) && g(s) && s.isCollapsed() && a.isCollapsed())) return 0;
622
- const i = (function(C, v, N) {
623
- const T = C._nodeMap, P = [];
624
- for (const L of v) {
625
- const w = T.get(L);
600
+ const i = (function(C, v, _) {
601
+ const L = C._nodeMap, P = [];
602
+ for (const k of v) {
603
+ const w = L.get(k);
626
604
  w !== void 0 && P.push(w);
627
605
  }
628
- for (const [L, w] of N) {
606
+ for (const [k, w] of _) {
629
607
  if (!w) continue;
630
- const R = T.get(L);
631
- R === void 0 || Te(R) || P.push(R);
608
+ const R = L.get(k);
609
+ R === void 0 || Le(R) || P.push(R);
632
610
  }
633
611
  return P;
634
612
  })(e, t, n);
635
613
  if (i.length === 0) return 0;
636
614
  if (i.length > 1) {
637
- const C = e._nodeMap, v = C.get(a.anchor.key), N = C.get(s.anchor.key);
638
- return v && N && !r._nodeMap.has(v.__key) && I(v) && v.__text.length === 1 && a.anchor.offset === 1 ? 2 : 0;
615
+ const C = e._nodeMap, v = C.get(a.anchor.key), _ = C.get(s.anchor.key);
616
+ return v && _ && !r._nodeMap.has(v.__key) && I(v) && v.__text.length === 1 && a.anchor.offset === 1 ? 2 : 0;
639
617
  }
640
618
  const l = i[0], d = r._nodeMap.get(l.__key);
641
619
  if (!I(d) || !I(l) || d.__mode !== l.__mode) return 0;
642
- const u = d.__text, m = l.__text;
643
- if (u === m) return 0;
620
+ const u = d.__text, f = l.__text;
621
+ if (u === f) return 0;
644
622
  const h = a.anchor, S = s.anchor;
645
623
  if (h.key !== S.key || h.type !== "text") return 0;
646
- const y = h.offset, x = S.offset, E = m.length - u.length;
624
+ const y = h.offset, x = S.offset, E = f.length - u.length;
647
625
  return E === 1 && x === y - 1 ? 2 : E === -1 && x === y + 1 ? 3 : E === -1 && x === y ? 4 : 0;
648
626
  }
649
- function fn(r, e) {
627
+ function cn(r, e) {
650
628
  let t = Date.now(), n = 0;
651
629
  return (o, a, s, i, l, d) => {
652
630
  const u = Date.now();
653
631
  if (d.has(ne)) return n = 0, t = u, 2;
654
- const m = cn(o, a, i, l, r.isComposing()), h = (() => {
632
+ const f = dn(o, a, i, l, r.isComposing()), h = (() => {
655
633
  const S = s === null || s.editor === r, y = d.has(Mt);
656
634
  if (!y && S && d.has(oe)) return 0;
657
635
  if (o === null) return 1;
658
636
  const x = a._selection;
659
637
  if (!(i.size > 0 || l.size > 0)) return x !== null ? 0 : 2;
660
638
  const E = typeof e == "number" ? e : e.peek();
661
- return y === !1 && m !== 0 && m === n && u < t + E && S || i.size === 1 && (function(C, v, N) {
662
- const T = v._nodeMap.get(C), P = N._nodeMap.get(C), L = v._selection, w = N._selection;
663
- return !(g(L) && g(w) && L.anchor.type === "element" && L.focus.type === "element" && w.anchor.type === "text" && w.focus.type === "text" || !I(T) || !I(P) || T.__parent !== P.__parent) && JSON.stringify(v.read(() => T.exportJSON())) === JSON.stringify(N.read(() => P.exportJSON()));
639
+ return y === !1 && f !== 0 && f === n && u < t + E && S || i.size === 1 && (function(C, v, _) {
640
+ const L = 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" || !I(L) || !I(P) || L.__parent !== P.__parent) && JSON.stringify(v.read(() => L.exportJSON())) === JSON.stringify(_.read(() => P.exportJSON()));
664
642
  })(Array.from(i)[0], o, a) ? 0 : 1;
665
643
  })();
666
- return t = u, n = m, h;
644
+ return t = u, n = f, h;
667
645
  };
668
646
  }
669
- function ke(r) {
647
+ function $e(r) {
670
648
  r.undoStack = [], r.redoStack = [], r.current = null;
671
649
  }
672
650
  function We(r, e, t) {
673
- const n = fn(r, t);
651
+ const n = cn(r, t);
674
652
  return W(r.registerCommand(Rt, () => ((function(a, s) {
675
653
  const i = s.redoStack, l = s.undoStack;
676
654
  if (l.length !== 0) {
@@ -685,11 +663,11 @@ function We(r, e, t) {
685
663
  const u = i.pop();
686
664
  i.length === 0 && a.dispatchCommand(Y, !1), s.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: ne });
687
665
  }
688
- })(r, e), !0), c), r.registerCommand(Bt, () => (ke(e), !1), c), r.registerCommand($t, () => (ke(e), r.dispatchCommand(Y, !1), r.dispatchCommand(q, !1), !0), c), r.registerUpdateListener(({ editorState: a, prevEditorState: s, dirtyLeaves: i, dirtyElements: l, tags: d }) => {
689
- const u = e.current, m = e.redoStack, h = e.undoStack, S = u === null ? null : u.editorState;
666
+ })(r, e), !0), c), r.registerCommand(Bt, () => ($e(e), !1), c), r.registerCommand(Tt, () => ($e(e), r.dispatchCommand(Y, !1), r.dispatchCommand(q, !1), !0), c), r.registerUpdateListener(({ editorState: a, prevEditorState: s, dirtyLeaves: i, dirtyElements: l, tags: d }) => {
667
+ const u = e.current, f = e.redoStack, h = e.undoStack, S = u === null ? null : u.editorState;
690
668
  if (u !== null && a === S) return;
691
669
  const y = n(s, a, u, i, l, d);
692
- if (y === 1) m.length !== 0 && (e.redoStack = [], r.dispatchCommand(Y, !1)), u !== null && (h.push({ ...u }), r.dispatchCommand(q, !0));
670
+ if (y === 1) f.length !== 0 && (e.redoStack = [], r.dispatchCommand(Y, !1)), u !== null && (h.push({ ...u }), r.dispatchCommand(q, !0));
693
671
  else if (y === 2) return;
694
672
  e.current = { editor: r, editorState: a };
695
673
  }));
@@ -697,11 +675,11 @@ function We(r, e, t) {
697
675
  function Je() {
698
676
  return { current: null, redoStack: [], undoStack: [] };
699
677
  }
700
- const te = ae({ build: (r, { delay: e, createInitialHistoryState: t, disabled: n }) => ie({ delay: e, disabled: n, historyState: t(r) }), config: Ft({ createInitialHistoryState: Je, delay: 300, disabled: typeof window > "u" }), name: "@lexical/history/History", register: (r, e, t) => {
678
+ const te = ae({ build: (r, { delay: e, createInitialHistoryState: t, disabled: n }) => ie({ delay: e, disabled: n, historyState: t(r) }), config: At({ createInitialHistoryState: Je, delay: 300, disabled: typeof window > "u" }), name: "@lexical/history/History", register: (r, e, t) => {
701
679
  const n = t.getOutput();
702
680
  return Re(() => n.disabled.value ? void 0 : We(r, n.historyState.value, n.delay));
703
681
  } });
704
- ae({ dependencies: [At(te, { createInitialHistoryState: () => {
682
+ ae({ dependencies: [Ft(te, { createInitialHistoryState: () => {
705
683
  throw new Error("SharedHistory did not inherit parent history");
706
684
  }, disabled: !0 })], name: "@lexical/history/SharedHistory", register(r, e, t) {
707
685
  const { output: n } = t.getDependency(te), o = (function(s) {
@@ -714,14 +692,14 @@ ae({ dependencies: [At(te, { createInitialHistoryState: () => {
714
692
  n.delay.value = a.delay.value, n.historyState.value = a.historyState.value, n.disabled.value = a.disabled.value;
715
693
  }));
716
694
  } });
717
- function mn({ delay: r, externalHistoryState: e }) {
695
+ function fn({ delay: r, externalHistoryState: e }) {
718
696
  const [t] = D();
719
697
  return (function(n, o, a = 1e3) {
720
698
  const s = O(() => o || Je(), [o]);
721
699
  b(() => We(n, s, a), [a, n, s]);
722
700
  })(t, e, r), null;
723
701
  }
724
- function pn({ hasCellMerge: r = !0, hasCellBackgroundColor: e = !0, hasTabHandler: t = !0, hasHorizontalScroll: n = !1, hasNestedTables: o = !1 }) {
702
+ function mn({ hasCellMerge: r = !0, hasCellBackgroundColor: e = !0, hasTabHandler: t = !0, hasHorizontalScroll: n = !1, hasNestedTables: o = !1 }) {
725
703
  const [a] = D();
726
704
  b(() => {
727
705
  ir(a) !== n && (lr(a, n), a.registerNodeTransform(ze, () => {
@@ -736,13 +714,13 @@ function pn({ hasCellMerge: r = !0, hasCellBackgroundColor: e = !0, hasTabHandle
736
714
  });
737
715
  }, [a, e, r]), null;
738
716
  }
739
- function gn({ editorRef: r }) {
717
+ function pn({ editorRef: r }) {
740
718
  const [e] = D();
741
719
  return Ut.useEffect(() => {
742
720
  typeof r == "function" ? r(e) : typeof r == "object" && (r.current = e);
743
721
  }, [e]), null;
744
722
  }
745
- const Xe = 200, hn = ({
723
+ const Xe = 200, gn = ({
746
724
  currentLanguage: r = "NL",
747
725
  initialValue: e = "",
748
726
  placeholder: t = "",
@@ -754,110 +732,109 @@ const Xe = 200, hn = ({
754
732
  maxHeightInRem: l = "20rem",
755
733
  maxWords: d = Xe,
756
734
  rteRef: u = null,
757
- onChange: m,
735
+ onChange: f,
758
736
  onCatalogueLinkSearch: h,
759
737
  catalogueSearchResponse: S = { state: "idle", results: [] }
760
738
  }) => {
761
- const { switchLanguage: y } = Nr(), x = Cr(), [E] = M(() => Pe()), [C, v] = M(0), [N, T] = M(0), P = jt(), L = {
739
+ const { switchLanguage: y } = _r(), x = Cr(), [E] = M(() => Pe()), [C, v] = M(0), [_, L] = M(0), P = jt(), k = {
762
740
  html: {
763
741
  export: mr
764
742
  },
765
743
  namespace: "UvaRte",
766
744
  editor: E,
767
745
  theme: wr,
768
- onError(_) {
769
- throw _;
746
+ onError(N) {
747
+ throw N;
770
748
  },
771
749
  nodes: [
772
750
  Me,
773
- Ae,
774
751
  Fe,
752
+ Ae,
775
753
  Ue,
776
754
  Ke,
777
755
  fr,
778
756
  ze,
779
- _r,
780
- kr
757
+ Nr,
758
+ $r
781
759
  ],
782
- editorState: (_) => {
783
- const k = new DOMParser().parseFromString(e, "text/html"), X = er(_, k);
784
- F().clear(), $e(X), De(null);
760
+ editorState: (N) => {
761
+ const $ = new DOMParser().parseFromString(e, "text/html"), X = er(N, $);
762
+ A().clear(), Te(X), De(null);
785
763
  }
786
- }, w = (_) => _.trim().length === 0 ? 0 : _.split(" ").length, R = (_, J) => {
787
- _.read(() => {
788
- let k = "";
789
- v(w(F().getTextContent().replace(/\s+/g, " ").trim())), k = pr(tr(J)), k = gr(k), m(k);
764
+ }, w = (N) => N.trim().length === 0 ? 0 : N.split(" ").length, R = (N, J) => {
765
+ N.read(() => {
766
+ let $ = "";
767
+ v(w(A().getTextContent().replace(/\s+/g, " ").trim())), $ = pr(tr(J)), $ = gr($), f($);
790
768
  });
791
769
  };
792
770
  return b(() => {
793
771
  y(r.toUpperCase());
794
772
  }, [r, y]), b(() => {
795
- const _ = e.replace(/<br\s*\/?>|&nbsp;/gi, " ").replace(/<\/?[^>]+(>|$)|&[a-z]+;/g, "").replace(/\s+/g, " ").trim();
796
- v(w(_));
797
- }, [e]), /* @__PURE__ */ A("div", { className: B.editor__container, children: [
798
- /* @__PURE__ */ A("div", { className: B.editor__header, children: [
799
- /* @__PURE__ */ f(Sr, { label: n, info: o, required: a }),
800
- /* @__PURE__ */ A("div", { className: B["editor__header-word-count"], children: [
801
- /* @__PURE__ */ f("span", { className: Ce({ [B["editor__header-word-count--alert"]]: C > d }), children: C }),
773
+ const N = e.replace(/<br\s*\/?>|&nbsp;/gi, " ").replace(/<\/?[^>]+(>|$)|&[a-z]+;/g, "").replace(/\s+/g, " ").trim();
774
+ v(w(N));
775
+ }, [e]), /* @__PURE__ */ F("div", { className: B.editor__container, children: [
776
+ /* @__PURE__ */ F("div", { className: B.editor__header, children: [
777
+ /* @__PURE__ */ m(Sr, { label: n, info: o, required: a }),
778
+ /* @__PURE__ */ F("div", { className: B["editor__header-word-count"], children: [
779
+ /* @__PURE__ */ m("span", { className: Ce({ [B["editor__header-word-count--alert"]]: C > d }), children: C }),
802
780
  " / ",
803
781
  d
804
782
  ] })
805
783
  ] }),
806
- /* @__PURE__ */ f(
784
+ /* @__PURE__ */ m(
807
785
  "div",
808
786
  {
809
787
  className: Ce(B.editor, {
810
788
  [B["not-valid"]]: s
811
789
  }),
812
- children: /* @__PURE__ */ A(Dr, { initialConfig: L, children: [
813
- /* @__PURE__ */ f(
790
+ children: /* @__PURE__ */ F(Pr, { initialConfig: k, children: [
791
+ /* @__PURE__ */ m(
814
792
  yr,
815
793
  {
816
- editorScrollPosition: N,
794
+ editorScrollPosition: _,
817
795
  onCatalogueLinkSearch: h,
818
796
  catalogueSearchResponse: S
819
797
  }
820
798
  ),
821
- /* @__PURE__ */ A("div", { className: B["editor__field-wrapper"], children: [
822
- /* @__PURE__ */ f(
823
- Jr,
799
+ /* @__PURE__ */ F("div", { className: B["editor__field-wrapper"], children: [
800
+ /* @__PURE__ */ m(
801
+ Wr,
824
802
  {
825
- contentEditable: /* @__PURE__ */ f(
826
- Gr,
803
+ contentEditable: /* @__PURE__ */ m(
804
+ qr,
827
805
  {
828
806
  className: B.editor__field,
829
807
  "aria-label": x.common.rteAriaLabel,
830
808
  "aria-placeholder": t,
831
809
  title: x.common.rteTitle,
832
- placeholder: /* @__PURE__ */ f("div", { className: B.editor__placeholder, children: t }),
810
+ placeholder: /* @__PURE__ */ m("div", { className: B.editor__placeholder, children: t }),
833
811
  spellCheck: !1,
834
812
  id: `${P}_rteEditor`,
835
813
  style: { height: `${l}`, maxHeight: `${l}` },
836
- onScroll: (_) => T(_.currentTarget.scrollTop)
814
+ onScroll: (N) => L(N.currentTarget.scrollTop)
837
815
  }
838
816
  ),
839
- placeholder: /* @__PURE__ */ f("div", { className: B.editor__placeholder, children: t }),
840
- ErrorBoundary: rn
817
+ placeholder: /* @__PURE__ */ m("div", { className: B.editor__placeholder, children: t }),
818
+ ErrorBoundary: tn
841
819
  }
842
820
  ),
843
- /* @__PURE__ */ f(pn, {}),
844
- /* @__PURE__ */ f(Jt, {}),
845
- /* @__PURE__ */ f(mn, {}),
846
- /* @__PURE__ */ f(an, {}),
847
- /* @__PURE__ */ f(sn, { validateUrl: hr }),
848
- /* @__PURE__ */ f(un, { matchers: vr }),
849
- /* @__PURE__ */ f(dn, {}),
850
- /* @__PURE__ */ f(on, { onChange: R }),
851
- /* @__PURE__ */ f(Er, {}),
852
- /* @__PURE__ */ f(Lr, {}),
853
- u && /* @__PURE__ */ f(gn, { editorRef: u })
821
+ /* @__PURE__ */ m(mn, {}),
822
+ /* @__PURE__ */ m(Jt, {}),
823
+ /* @__PURE__ */ m(fn, {}),
824
+ /* @__PURE__ */ m(on, {}),
825
+ /* @__PURE__ */ m(an, { validateUrl: hr }),
826
+ /* @__PURE__ */ m(ln, { matchers: vr }),
827
+ /* @__PURE__ */ m(un, {}),
828
+ /* @__PURE__ */ m(nn, { onChange: R }),
829
+ /* @__PURE__ */ m(Er, {}),
830
+ u && /* @__PURE__ */ m(pn, { editorRef: u })
854
831
  ] })
855
832
  ] })
856
833
  }
857
834
  ),
858
- i !== "" && /* @__PURE__ */ f(br, { level: "error", feedback: i })
835
+ i !== "" && /* @__PURE__ */ m(br, { level: "error", feedback: i })
859
836
  ] });
860
- }, mo = ({
837
+ }, fo = ({
861
838
  currentLanguage: r = "NL",
862
839
  initialValue: e = "",
863
840
  placeholder: t = "",
@@ -869,10 +846,10 @@ const Xe = 200, hn = ({
869
846
  maxWords: l = Xe,
870
847
  rteRef: d,
871
848
  onChange: u,
872
- onCatalogueLinkSearch: m,
849
+ onCatalogueLinkSearch: f,
873
850
  catalogueSearchResponse: h = { state: "idle", results: [] }
874
- }) => /* @__PURE__ */ f(xr, { children: /* @__PURE__ */ f(
875
- hn,
851
+ }) => /* @__PURE__ */ m(xr, { children: /* @__PURE__ */ m(
852
+ gn,
876
853
  {
877
854
  currentLanguage: r.toUpperCase(),
878
855
  initialValue: e,
@@ -885,12 +862,12 @@ const Xe = 200, hn = ({
885
862
  maxWords: l,
886
863
  rteRef: d,
887
864
  onChange: u,
888
- onCatalogueLinkSearch: m,
865
+ onCatalogueLinkSearch: f,
889
866
  catalogueSearchResponse: h
890
867
  }
891
868
  ) });
892
869
  export {
893
- hn as Rte,
894
- mo as RteEditor
870
+ gn as Rte,
871
+ fo as RteEditor
895
872
  };
896
873
  //# sourceMappingURL=RteEditor.js.map