@uva-glass/component-library 1.62.8 → 1.62.9

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 (44) hide show
  1. package/dist/TablePlugin-DQR5VWGq.js +301 -0
  2. package/dist/TablePlugin-DQR5VWGq.js.map +1 -0
  3. package/dist/assets/favicon/android-chrome-192x192.png +0 -0
  4. package/dist/assets/favicon/android-chrome-512x512.png +0 -0
  5. package/dist/assets/favicon/apple-touch-icon.png +0 -0
  6. package/dist/assets/favicon/favicon-16x16.png +0 -0
  7. package/dist/assets/favicon/favicon-32x32.png +0 -0
  8. package/dist/assets/favicon/favicon.ico +0 -0
  9. package/dist/assets/favicon/favicon.svg +27 -0
  10. package/dist/assets/favicon/site.webmanifest +19 -0
  11. package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
  12. package/dist/components/FormInput/FormInput.js +1 -1
  13. package/dist/components/InputField/InputField.stories.js +1 -1
  14. package/dist/components/MultiSelect/MultiSelect.js +1 -1
  15. package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
  16. package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
  17. package/dist/components/MultiSelect/index.js +1 -1
  18. package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
  19. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
  20. package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
  21. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +1 -1
  22. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.js +1 -1
  23. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +1 -1
  24. package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +1 -1
  25. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +2 -2
  26. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +7 -6
  27. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js.map +1 -1
  28. package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
  29. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +50 -37
  30. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
  31. package/dist/components/RteEditor/Plugins/index.js +1 -1
  32. package/dist/components/RteEditor/RteEditor.d.ts +1 -1
  33. package/dist/components/RteEditor/RteEditor.js +96 -94
  34. package/dist/components/RteEditor/RteEditor.js.map +1 -1
  35. package/dist/components/RteEditor/RteEditor.stories.js +1 -1
  36. package/dist/components/RteEditor/RteEditor.stories.js.map +1 -1
  37. package/dist/components/index.js +1 -1
  38. package/dist/{helpers-pUTvcL4e.js → helpers-CVB_4CnL.js} +70 -68
  39. package/dist/helpers-CVB_4CnL.js.map +1 -0
  40. package/dist/index.js +1 -1
  41. package/package.json +5 -5
  42. package/dist/TablePlugin-B-yAWpsC.js +0 -310
  43. package/dist/TablePlugin-B-yAWpsC.js.map +0 -1
  44. package/dist/helpers-pUTvcL4e.js.map +0 -1
@@ -1,18 +1,18 @@
1
- import { jsx as y, jsxs as A, Fragment as Ie } from "react/jsx-runtime";
1
+ import { jsx as y, jsxs as K, Fragment as Oe } from "react/jsx-runtime";
2
2
  import { l as Xe, o as Ye, u as R } from "../../LexicalComposerContext.prod-Dyvim1tK.js";
3
- import { ak as Fe, w as I, D as fe, M as v, l as q, b as J, L as Ze, a as P, v as C, al as Ke, am as Ge, O as p, a8 as Qe, T as K, J as et, an as tt, ao as nt, ap as rt, R as oe, aq as ot, ar as it, af as st, ah as at, E as lt, a2 as ct, as as ut, at as ge, o as he, a7 as dt, a5 as ie, a6 as ft, n as Ae, au as ve, a1 as mt, a0 as pt, W as gt, X as Ce, Z as ht, av as vt, aw as Ct, ax as yt, A as wt, a9 as Et, d as bt, ay as $t, aa as St, a4 as _t, a3 as kt, r as xt, t as Lt, I as ye, az as Nt, j as Dt, K as X, $ as Y, aA as Tt, aB as Pt, g as Rt, h as Mt, ae as Ot } from "../../Lexical.prod-B6kL_nwF.js";
3
+ import { ak as Fe, w as z, D as fe, M as v, l as q, b as J, L as Ze, a as P, v as C, al as Ke, am as Ge, O as p, a8 as Qe, T as F, J as et, an as tt, ao as nt, ap as rt, R as oe, aq as ot, ar as it, af as st, ah as at, E as lt, a2 as ct, as as ut, at as ge, o as he, a7 as dt, a5 as ie, a6 as ft, n as Ae, au as ve, a1 as mt, a0 as pt, W as gt, X as Ce, Z as ht, av as vt, aw as Ct, ax as yt, A as wt, a9 as Et, d as bt, ay as $t, aa as St, a4 as _t, a3 as kt, r as xt, t as Lt, I as ye, az as Nt, j as Dt, K as X, $ as Y, aA as Tt, aB as Pt, g as Rt, h as Mt, ae as It } from "../../Lexical.prod-B6kL_nwF.js";
4
4
  import * as se from "react";
5
- import { useMemo as W, useLayoutEffect as U, useEffect as k, useRef as It, useState as O, Suspense as Ft, forwardRef as ze, useCallback as Kt } from "react";
6
- import { L as B, i as z, e as At, t as me, r as zt, u as Bt } from "../../LexicalUtils.prod-BBoyOK4A.js";
5
+ import { useMemo as W, useLayoutEffect as U, useEffect as _, useRef as Ot, useState as I, Suspense as Ft, forwardRef as ze, useCallback as Kt } from "react";
6
+ import { L as B, i as A, e as At, t as me, r as zt, u as Bt } from "../../LexicalUtils.prod-BBoyOK4A.js";
7
7
  import { r as we } from "../../index-DsprzSCj.js";
8
- import { _ as Ee, O as be, L as $e, $ as Se, u as ne, f as re, h as Be, K as Ut, n as _e, r as jt, j as qt, k as Jt, l as Wt, F as Ht, m as ke, o as Vt, U as Xt, p as Yt, q as Zt } from "../../helpers-pUTvcL4e.js";
8
+ import { _ as Ee, O as be, L as $e, $ as Se, u as ne, f as re, h as Be, K as Ut, n as _e, r as jt, j as qt, k as Jt, l as Wt, F as Ht, m as ke, o as Vt, U as Xt, p as Yt, q as Zt } from "../../helpers-CVB_4CnL.js";
9
9
  import { J as Ue, D as je, Z as Gt } from "../../ListPlugin-CpLcVKRP.js";
10
10
  import { a as qe, U as xe, m as ae, g as Qt, b as en, F as tn, M as nn, f as rn } from "../../helpers-C7Yo7VY3.js";
11
11
  import { c as on } from "../../clsx-OuTLNxxd.js";
12
12
  import { s as M } from "../../RteEditor.module-CHbWzGpE.js";
13
13
  import { ToolBarPlugin as sn } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
14
14
  import { useTranslation as an } from "./hooks/useTranslation.js";
15
- import "../../TablePlugin-B-yAWpsC.js";
15
+ import "../../TablePlugin-DQR5VWGq.js";
16
16
  import "./hooks/components/Flyout.js";
17
17
  import "../Buttons/Button.js";
18
18
  import "../Buttons/LinkButton.js";
@@ -34,14 +34,14 @@ import "../../SortableProvider-BUsvniX7.js";
34
34
  import { UvaTheme as cn } from "./UvaTheme/UvaTheme.js";
35
35
  import { EditorHeader as un } from "./EditorHeader/EditorHeader.js";
36
36
  import { useLanguage as dn, LanguageProvider as fn } from "./Providers/LanguageProvider.js";
37
- const Je = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, mn = Je ? U : k, Z = { tag: "history-merge" };
37
+ const Je = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, mn = Je ? U : _, Z = { tag: "history-merge" };
38
38
  function pn({ initialConfig: e, children: t }) {
39
39
  const n = W(() => {
40
40
  const { theme: r, namespace: i, nodes: o, onError: s, editorState: a, html: l } = e, c = Ye(null, r), u = Fe({ editable: e.editable, html: l, namespace: i, nodes: o, onError: (d) => s(d, u), theme: r });
41
41
  return function(d, f) {
42
42
  if (f !== null) {
43
43
  if (f === void 0) d.update(() => {
44
- const m = I();
44
+ const m = z();
45
45
  if (m.isEmpty()) {
46
46
  const g = fe();
47
47
  m.append(g);
@@ -60,7 +60,7 @@ function pn({ initialConfig: e, children: t }) {
60
60
  break;
61
61
  case "function":
62
62
  d.update(() => {
63
- I().isEmpty() && f(d);
63
+ z().isEmpty() && f(d);
64
64
  }, Z);
65
65
  }
66
66
  }
@@ -71,13 +71,13 @@ function pn({ initialConfig: e, children: t }) {
71
71
  i.setEditable(r === void 0 || r);
72
72
  }, []), y(Xe.Provider, { value: n, children: t });
73
73
  }
74
- const gn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U : k;
74
+ const gn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U : _;
75
75
  function hn(e) {
76
76
  return { initialValueFn: () => e.isEditable(), subscribe: (t) => e.registerEditableListener(t) };
77
77
  }
78
78
  function vn() {
79
79
  return function(e) {
80
- const [t] = R(), n = W(() => e(t), [t, e]), r = It(n.initialValueFn()), [i, o] = O(r.current);
80
+ const [t] = R(), n = W(() => e(t), [t, e]), r = Ot(n.initialValueFn()), [i, o] = I(r.current);
81
81
  return gn(() => {
82
82
  const { initialValueFn: s, subscribe: a } = n, l = s();
83
83
  return r.current !== l && (r.current = l, o(l)), a((c) => {
@@ -87,7 +87,7 @@ function vn() {
87
87
  }(hn);
88
88
  }
89
89
  function Cn() {
90
- return I().getTextContent();
90
+ return z().getTextContent();
91
91
  }
92
92
  function yn(e, t = !0) {
93
93
  if (e) return !1;
@@ -96,7 +96,7 @@ function yn(e, t = !0) {
96
96
  }
97
97
  function wn(e) {
98
98
  if (!yn(e, !1)) return !1;
99
- const t = I().getChildren(), n = t.length;
99
+ const t = z().getChildren(), n = t.length;
100
100
  if (n > 1) return !1;
101
101
  for (let r = 0; r < n; r++) {
102
102
  const i = t[r];
@@ -147,11 +147,11 @@ function bn(e) {
147
147
  const h = v();
148
148
  if (C(h)) {
149
149
  const S = h.anchor;
150
- let w = S.getNode(), E = 0, $ = 0;
151
- if (P(w) && c >= 0 && u >= 0 && (E = c, $ = c + u, h.setTextNodeRange(w, E, w, $)), E === $ && d === "" || (h.insertRawText(d), w = S.getNode()), P(w)) {
152
- E = f, $ = f + m;
153
- const b = w.getTextContentSize();
154
- E = E > b ? b : E, $ = $ > b ? b : $, h.setTextNodeRange(w, E, w, $);
150
+ let w = S.getNode(), b = 0, $ = 0;
151
+ if (P(w) && c >= 0 && u >= 0 && (b = c, $ = c + u, h.setTextNodeRange(w, b, w, $)), b === $ && d === "" || (h.insertRawText(d), w = S.getNode()), P(w)) {
152
+ b = f, $ = f + m;
153
+ const E = w.getTextContentSize();
154
+ b = b > E ? E : b, $ = $ > E ? E : $, h.setTextNodeRange(w, b, w, $);
155
155
  }
156
156
  r.stopImmediatePropagation();
157
157
  }
@@ -179,7 +179,7 @@ function Le(e, t) {
179
179
  const j = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, $n = j && "documentMode" in document ? document.documentMode : null, Sn = !(!j || !("InputEvent" in window) || $n) && "getTargetRanges" in new window.InputEvent("input"), _n = j && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), kn = j && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, xn = j && /^(?=.*Chrome).*/i.test(navigator.userAgent), Ln = j && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !xn, Ne = Lt();
180
180
  function G(e) {
181
181
  let t = null;
182
- if (z(e, DragEvent) ? t = e.dataTransfer : z(e, ClipboardEvent) && (t = e.clipboardData), t === null) return [!1, [], !1];
182
+ if (A(e, DragEvent) ? t = e.dataTransfer : A(e, ClipboardEvent) && (t = e.clipboardData), t === null) return [!1, [], !1];
183
183
  const n = t.types, r = n.includes("Files"), i = n.includes("text/html") || n.includes("text/plain");
184
184
  return [r, Array.from(t.files), i];
185
185
  }
@@ -204,7 +204,7 @@ function Q(e) {
204
204
  function Nn(e) {
205
205
  return B(e.registerCommand(xt, (t) => {
206
206
  const n = v();
207
- return !!K(n) && (n.clear(), !0);
207
+ return !!F(n) && (n.clear(), !0);
208
208
  }, 0), e.registerCommand(ie, (t) => {
209
209
  const n = v();
210
210
  return !!C(n) && (n.deleteCharacter(t), !0);
@@ -235,7 +235,7 @@ function Nn(e) {
235
235
  return !!C(n) && (n.formatText(t), !0);
236
236
  }, p), e.registerCommand(Et, (t) => {
237
237
  const n = v();
238
- if (!C(n) && !K(n)) return !1;
238
+ if (!C(n) && !F(n)) return !1;
239
239
  const r = n.getNodes();
240
240
  for (const i of r) {
241
241
  const o = me(i, (s) => J(s) && !s.isInline());
@@ -256,7 +256,7 @@ function Nn(e) {
256
256
  n > 0 && t.setIndent(n - 1);
257
257
  }), p), e.registerCommand(ht, (t) => {
258
258
  const n = v();
259
- if (K(n) && !Q(t.target)) {
259
+ if (F(n) && !Q(t.target)) {
260
260
  const r = n.getNodes();
261
261
  if (r.length > 0) return r[0].selectPrevious(), !0;
262
262
  } else if (C(n)) {
@@ -266,13 +266,13 @@ function Nn(e) {
266
266
  return !1;
267
267
  }, p), e.registerCommand(gt, (t) => {
268
268
  const n = v();
269
- if (K(n)) {
269
+ if (F(n)) {
270
270
  const r = n.getNodes();
271
271
  if (r.length > 0) return r[0].selectNext(0, 0), !0;
272
272
  } else if (C(n)) {
273
273
  if (function(i) {
274
274
  const o = i.focus;
275
- return o.key === "root" && o.offset === I().getChildrenSize();
275
+ return o.key === "root" && o.offset === z().getChildrenSize();
276
276
  }(n)) return t.preventDefault(), !0;
277
277
  const r = Ce(n.focus, !1);
278
278
  if (!t.shiftKey && q(r) && !r.isIsolated() && !r.isInline()) return r.selectNext(), t.preventDefault(), !0;
@@ -280,7 +280,7 @@ function Nn(e) {
280
280
  return !1;
281
281
  }, p), e.registerCommand(pt, (t) => {
282
282
  const n = v();
283
- if (K(n)) {
283
+ if (F(n)) {
284
284
  const r = n.getNodes();
285
285
  if (r.length > 0) return t.preventDefault(), r[0].selectPrevious(), !0;
286
286
  }
@@ -292,7 +292,7 @@ function Nn(e) {
292
292
  return !1;
293
293
  }, p), e.registerCommand(mt, (t) => {
294
294
  const n = v();
295
- if (K(n) && !Q(t.target)) {
295
+ if (F(n) && !Q(t.target)) {
296
296
  const i = n.getNodes();
297
297
  if (i.length > 0) return t.preventDefault(), i[0].selectNext(0, 0), !0;
298
298
  }
@@ -355,33 +355,33 @@ function Nn(e) {
355
355
  q(o) && t.preventDefault();
356
356
  }
357
357
  return !0;
358
- }, p), e.registerCommand(tt, () => (nt(), !0), p), e.registerCommand(et, (t) => (be(e, z(t, ClipboardEvent) ? t : null), !0), p), e.registerCommand(Qe, (t) => (async function(n, r) {
359
- await be(r, z(n, ClipboardEvent) ? n : null), r.update(() => {
358
+ }, p), e.registerCommand(tt, () => (nt(), !0), p), e.registerCommand(et, (t) => (be(e, A(t, ClipboardEvent) ? t : null), !0), p), e.registerCommand(Qe, (t) => (async function(n, r) {
359
+ await be(r, A(n, ClipboardEvent) ? n : null), r.update(() => {
360
360
  const i = v();
361
- C(i) ? i.removeText() : K(i) && i.getNodes().forEach((o) => o.remove());
361
+ C(i) ? i.removeText() : F(i) && i.getNodes().forEach((o) => o.remove());
362
362
  });
363
363
  }(t, e), !0), p), e.registerCommand(Ke, (t) => {
364
364
  const [, n, r] = G(t);
365
365
  return n.length > 0 && !r ? (e.dispatchCommand(Ne, n), !0) : Ge(t.target) ? !1 : v() !== null && (function(i, o) {
366
366
  i.preventDefault(), o.update(() => {
367
- const s = v(), a = z(i, InputEvent) || z(i, KeyboardEvent) ? null : i.clipboardData;
367
+ const s = v(), a = A(i, InputEvent) || A(i, KeyboardEvent) ? null : i.clipboardData;
368
368
  a != null && s !== null && Ee(a, s, o);
369
369
  }, { tag: "paste" });
370
370
  }(t, e), !0);
371
371
  }, p));
372
372
  }
373
- const le = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U : k;
373
+ const le = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U : _;
374
374
  function Te(e) {
375
375
  return e.getEditorState().read(We(e.isComposing()));
376
376
  }
377
377
  function Dn({ contentEditable: e, placeholder: t = null, ErrorBoundary: n }) {
378
378
  const [r] = R(), i = function(o, s) {
379
- const [a, l] = O(() => o.getDecorators());
379
+ const [a, l] = I(() => o.getDecorators());
380
380
  return le(() => o.registerDecoratorListener((c) => {
381
381
  we.flushSync(() => {
382
382
  l(c);
383
383
  });
384
- }), [o]), k(() => {
384
+ }), [o]), _(() => {
385
385
  l(o.getDecorators());
386
386
  }, [o]), W(() => {
387
387
  const c = [], u = Object.keys(a);
@@ -394,11 +394,11 @@ function Dn({ contentEditable: e, placeholder: t = null, ErrorBoundary: n }) {
394
394
  }(r, n);
395
395
  return function(o) {
396
396
  le(() => B(Nn(o), bn(o)), [o]);
397
- }(r), A(Ie, { children: [e, y(Tn, { content: t }), i] });
397
+ }(r), K(Oe, { children: [e, y(Tn, { content: t }), i] });
398
398
  }
399
399
  function Tn({ content: e }) {
400
400
  const [t] = R(), n = function(i) {
401
- const [o, s] = O(() => Te(i));
401
+ const [o, s] = I(() => Te(i));
402
402
  return le(() => {
403
403
  function a() {
404
404
  const l = Te(i);
@@ -413,9 +413,9 @@ function Tn({ content: e }) {
413
413
  }(t), r = vn();
414
414
  return n ? typeof e == "function" ? e(r) : e : null;
415
415
  }
416
- const He = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U : k;
417
- function Pn({ editor: e, ariaActiveDescendant: t, ariaAutoComplete: n, ariaControls: r, ariaDescribedBy: i, ariaErrorMessage: o, ariaExpanded: s, ariaInvalid: a, ariaLabel: l, ariaLabelledBy: c, ariaMultiline: u, ariaOwns: d, ariaRequired: f, autoCapitalize: m, className: g, id: h, role: S = "textbox", spellCheck: w = !0, style: E, tabIndex: $, "data-testid": b, ...L }, x) {
418
- const [_, N] = O(e.isEditable()), F = Kt((T) => {
416
+ const He = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U : _;
417
+ function Pn({ editor: e, ariaActiveDescendant: t, ariaAutoComplete: n, ariaControls: r, ariaDescribedBy: i, ariaErrorMessage: o, ariaExpanded: s, ariaInvalid: a, ariaLabel: l, ariaLabelledBy: c, ariaMultiline: u, ariaOwns: d, ariaRequired: f, autoCapitalize: m, className: g, id: h, role: S = "textbox", spellCheck: w = !0, style: b, tabIndex: $, "data-testid": E, ...L }, x) {
418
+ const [k, N] = I(e.isEditable()), O = Kt((T) => {
419
419
  T && T.ownerDocument && T.ownerDocument.defaultView ? e.setRootElement(T) : e.setRootElement(null);
420
420
  }, [e]), H = W(() => /* @__PURE__ */ function(...T) {
421
421
  return (pe) => {
@@ -423,23 +423,23 @@ function Pn({ editor: e, ariaActiveDescendant: t, ariaAutoComplete: n, ariaContr
423
423
  typeof V == "function" ? V(pe) : V != null && (V.current = pe);
424
424
  });
425
425
  };
426
- }(x, F), [F, x]);
426
+ }(x, O), [O, x]);
427
427
  return He(() => (N(e.isEditable()), e.registerEditableListener((T) => {
428
428
  N(T);
429
- })), [e]), y("div", { ...L, "aria-activedescendant": _ ? t : void 0, "aria-autocomplete": _ ? n : "none", "aria-controls": _ ? r : void 0, "aria-describedby": i, ...o != null ? { "aria-errormessage": o } : {}, "aria-expanded": _ && S === "combobox" ? !!s : void 0, ...a != null ? { "aria-invalid": a } : {}, "aria-label": l, "aria-labelledby": c, "aria-multiline": u, "aria-owns": _ ? d : void 0, "aria-readonly": !_ || void 0, "aria-required": f, autoCapitalize: m, className: g, contentEditable: _, "data-testid": b, id: h, ref: H, role: _ ? S : void 0, spellCheck: w, style: E, tabIndex: $ });
429
+ })), [e]), y("div", { ...L, "aria-activedescendant": k ? t : void 0, "aria-autocomplete": k ? n : "none", "aria-controls": k ? r : void 0, "aria-describedby": i, ...o != null ? { "aria-errormessage": o } : {}, "aria-expanded": k && S === "combobox" ? !!s : void 0, ...a != null ? { "aria-invalid": a } : {}, "aria-label": l, "aria-labelledby": c, "aria-multiline": u, "aria-owns": k ? d : void 0, "aria-readonly": !k || void 0, "aria-required": f, autoCapitalize: m, className: g, contentEditable: k, "data-testid": E, id: h, ref: H, role: k ? S : void 0, spellCheck: w, style: b, tabIndex: $ });
430
430
  }
431
431
  const Rn = ze(Pn);
432
432
  function Pe(e) {
433
433
  return e.getEditorState().read(We(e.isComposing()));
434
434
  }
435
- const Mn = ze(On);
436
- function On(e, t) {
435
+ const Mn = ze(In);
436
+ function In(e, t) {
437
437
  const { placeholder: n, ...r } = e, [i] = R();
438
- return A(Ie, { children: [y(Rn, { editor: i, ...r, ref: t }), n != null && y(In, { editor: i, content: n })] });
438
+ return K(Oe, { children: [y(Rn, { editor: i, ...r, ref: t }), n != null && y(On, { editor: i, content: n })] });
439
439
  }
440
- function In({ content: e, editor: t }) {
440
+ function On({ content: e, editor: t }) {
441
441
  const n = function(s) {
442
- const [a, l] = O(() => Pe(s));
442
+ const [a, l] = I(() => Pe(s));
443
443
  return He(() => {
444
444
  function c() {
445
445
  const u = Pe(s);
@@ -451,7 +451,7 @@ function In({ content: e, editor: t }) {
451
451
  c();
452
452
  }));
453
453
  }, [s]), a;
454
- }(t), [r, i] = O(t.isEditable());
454
+ }(t), [r, i] = I(t.isEditable());
455
455
  if (U(() => (i(t.isEditable()), t.registerEditableListener((s) => {
456
456
  i(s);
457
457
  })), [t]), !n) return null;
@@ -501,7 +501,7 @@ var Re = { error: null }, Fn = function(e) {
501
501
  function Kn({ children: e, onError: t }) {
502
502
  return y(Fn, { fallback: y("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: t, children: e });
503
503
  }
504
- const An = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U : k;
504
+ const An = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U : _;
505
505
  function zn({ ignoreHistoryMergeTagChange: e = !0, ignoreSelectionChange: t = !1, onChange: n }) {
506
506
  const [r] = R();
507
507
  return An(() => {
@@ -512,15 +512,15 @@ function zn({ ignoreHistoryMergeTagChange: e = !0, ignoreSelectionChange: t = !1
512
512
  }
513
513
  function Bn() {
514
514
  const [e] = R();
515
- return k(() => {
515
+ return _(() => {
516
516
  if (!e.hasNodes([Ue, je])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
517
517
  }, [e]), function(t) {
518
- k(() => Gt(t), [t]);
518
+ _(() => Gt(t), [t]);
519
519
  }(e), null;
520
520
  }
521
521
  function Un({ validateUrl: e, attributes: t }) {
522
522
  const [n] = R();
523
- return k(() => {
523
+ return _(() => {
524
524
  if (!n.hasNodes([qe])) throw new Error("LinkPlugin: LinkNode not registered on editor");
525
525
  return B(n.registerCommand(xe, (r) => {
526
526
  if (r === null) return ae(r), !0;
@@ -531,7 +531,7 @@ function Un({ validateUrl: e, attributes: t }) {
531
531
  }
532
532
  }, ye), e !== void 0 ? n.registerCommand(Ke, (r) => {
533
533
  const i = v();
534
- if (!C(i) || i.isCollapsed() || !z(r, ClipboardEvent)) return !1;
534
+ if (!C(i) || i.isCollapsed() || !A(r, ClipboardEvent)) return !1;
535
535
  const o = r;
536
536
  if (o.clipboardData === null) return !1;
537
537
  const s = o.clipboardData.getData("text");
@@ -542,7 +542,7 @@ function Un({ validateUrl: e, attributes: t }) {
542
542
  }
543
543
  function jn({ newTab: e = !0, disabled: t = !1 }) {
544
544
  const [n] = R();
545
- return k(() => {
545
+ return _(() => {
546
546
  const r = (o) => {
547
547
  const s = o.target;
548
548
  if (!(s instanceof Node)) return;
@@ -585,23 +585,23 @@ function Hn(e, t, n, r, i) {
585
585
  const o = t._selection, s = e._selection;
586
586
  if (i) return qn;
587
587
  if (!(C(o) && C(s) && s.isCollapsed() && o.isCollapsed())) return D;
588
- const a = function(w, E, $) {
589
- const b = w._nodeMap, L = [];
590
- for (const x of E) {
591
- const _ = b.get(x);
592
- _ !== void 0 && L.push(_);
588
+ const a = function(w, b, $) {
589
+ const E = w._nodeMap, L = [];
590
+ for (const x of b) {
591
+ const k = E.get(x);
592
+ k !== void 0 && L.push(k);
593
593
  }
594
- for (const [x, _] of $) {
595
- if (!_) continue;
596
- const N = b.get(x);
594
+ for (const [x, k] of $) {
595
+ if (!k) continue;
596
+ const N = E.get(x);
597
597
  N === void 0 || Ae(N) || L.push(N);
598
598
  }
599
599
  return L;
600
600
  }(t, n, r);
601
601
  if (a.length === 0) return D;
602
602
  if (a.length > 1) {
603
- const w = t._nodeMap, E = w.get(o.anchor.key), $ = w.get(s.anchor.key);
604
- return E && $ && !e._nodeMap.has(E.__key) && P(E) && E.__text.length === 1 && o.anchor.offset === 1 ? Me : D;
603
+ const w = t._nodeMap, b = w.get(o.anchor.key), $ = w.get(s.anchor.key);
604
+ return b && $ && !e._nodeMap.has(b.__key) && P(b) && b.__text.length === 1 && o.anchor.offset === 1 ? Me : D;
605
605
  }
606
606
  const l = a[0], c = e._nodeMap.get(l.__key);
607
607
  if (!P(c) || !P(l) || c.__mode !== l.__mode) return D;
@@ -622,15 +622,15 @@ function Vn(e, t) {
622
622
  if (!g && m && c.has("history-merge")) return ee;
623
623
  if (i === null) return ue;
624
624
  const h = o._selection;
625
- return a.size > 0 || l.size > 0 ? g === !1 && d !== D && d === r && u < n + t && m || a.size === 1 && function(S, w, E) {
626
- const $ = w._nodeMap.get(S), b = E._nodeMap.get(S), L = w._selection, x = E._selection;
627
- return !(C(L) && C(x) && L.anchor.type === "element" && L.focus.type === "element" && x.anchor.type === "text" && x.focus.type === "text" || !P($) || !P(b) || $.__parent !== b.__parent) && JSON.stringify(w.read(() => $.exportJSON())) === JSON.stringify(E.read(() => b.exportJSON()));
625
+ return a.size > 0 || l.size > 0 ? g === !1 && d !== D && d === r && u < n + t && m || a.size === 1 && function(S, w, b) {
626
+ const $ = w._nodeMap.get(S), E = b._nodeMap.get(S), L = w._selection, x = b._selection;
627
+ return !(C(L) && C(x) && L.anchor.type === "element" && L.focus.type === "element" && x.anchor.type === "text" && x.focus.type === "text" || !P($) || !P(E) || $.__parent !== E.__parent) && JSON.stringify(w.read(() => $.exportJSON())) === JSON.stringify(b.read(() => E.exportJSON()));
628
628
  }(Array.from(a)[0], i, o) ? ee : ue : h !== null ? ee : de;
629
629
  })();
630
630
  return n = u, r = d, f;
631
631
  };
632
632
  }
633
- function Oe(e) {
633
+ function Ie(e) {
634
634
  e.undoStack = [], e.redoStack = [], e.current = null;
635
635
  }
636
636
  function Xn(e, t, n) {
@@ -649,7 +649,7 @@ function Xn(e, t, n) {
649
649
  const u = a.pop();
650
650
  a.length === 0 && o.dispatchCommand(X, !1), s.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: "historic" });
651
651
  }
652
- }(e, t), !0), p), e.registerCommand(Pt, () => (Oe(t), !1), p), e.registerCommand(Tt, () => (Oe(t), e.dispatchCommand(X, !1), e.dispatchCommand(Y, !1), !0), p), e.registerUpdateListener(({ editorState: o, prevEditorState: s, dirtyLeaves: a, dirtyElements: l, tags: c }) => {
652
+ }(e, t), !0), p), e.registerCommand(Pt, () => (Ie(t), !1), p), e.registerCommand(Tt, () => (Ie(t), e.dispatchCommand(X, !1), e.dispatchCommand(Y, !1), !0), p), e.registerUpdateListener(({ editorState: o, prevEditorState: s, dirtyLeaves: a, dirtyElements: l, tags: c }) => {
653
653
  const u = t.current, d = t.redoStack, f = t.undoStack, m = u === null ? null : u.editorState;
654
654
  if (u !== null && o === m) return;
655
655
  const g = r(s, o, u, a, l, c);
@@ -665,7 +665,7 @@ function Zn({ delay: e, externalHistoryState: t }) {
665
665
  const [n] = R();
666
666
  return function(r, i, o = 1e3) {
667
667
  const s = W(() => i || Yn(), [i]);
668
- k(() => Xn(r, s, o), [o, r, s]);
668
+ _(() => Xn(r, s, o), [o, r, s]);
669
669
  }(n, t, e), null;
670
670
  }
671
671
  function Gn(e) {
@@ -679,7 +679,7 @@ var te = Gn(function(e) {
679
679
  });
680
680
  function Qn({ hasCellMerge: e = !0, hasCellBackgroundColor: t = !0, hasTabHandler: n = !0 }) {
681
681
  const [r] = R();
682
- return k(() => (r.hasNodes([ne, re, Be]) || te(10), B(r.registerCommand(jt, ({ columns: i, rows: o, includeHeaders: s }) => {
682
+ return _(() => (r.hasNodes([ne, re, Be]) || te(10), B(r.registerCommand(jt, ({ columns: i, rows: o, includeHeaders: s }) => {
683
683
  const a = qt(Number(o), Number(i), s);
684
684
  zt(a);
685
685
  const l = a.getFirstDescendant();
@@ -695,7 +695,7 @@ function Qn({ hasCellMerge: e = !0, hasCellBackgroundColor: t = !0, hasTabHandle
695
695
  f.append(fe()), c.append(f);
696
696
  }
697
697
  }
698
- }))), [r]), k(() => {
698
+ }))), [r]), _(() => {
699
699
  const i = /* @__PURE__ */ new Map(), o = (a, l, c) => {
700
700
  const u = c, d = Xt(a, u, r, n);
701
701
  i.set(l, [d, u]);
@@ -703,7 +703,7 @@ function Qn({ hasCellMerge: e = !0, hasCellBackgroundColor: t = !0, hasTabHandle
703
703
  for (const [l, c] of a) if (c === "created" || c === "updated") {
704
704
  const u = i.get(l), d = r.getElementByKey(l);
705
705
  u && d === u[1] || (u && (u[0].removeListeners(), i.delete(l)), d !== null && r.getEditorState().read(() => {
706
- const f = Ot(l);
706
+ const f = It(l);
707
707
  Jt(f) && o(f, l, d);
708
708
  }));
709
709
  } else if (c === "destroyed") {
@@ -715,7 +715,7 @@ function Qn({ hasCellMerge: e = !0, hasCellBackgroundColor: t = !0, hasTabHandle
715
715
  s();
716
716
  for (const [, [a]] of i) a.removeListeners();
717
717
  };
718
- }, [r, n]), k(() => {
718
+ }, [r, n]), _(() => {
719
719
  if (!e) return r.registerNodeTransform(re, (i) => {
720
720
  if (i.getColSpan() > 1 || i.getRowSpan() > 1) {
721
721
  const [, , o] = Wt(i), [s] = Ht(o, i, i), a = s.length, l = s[0].length;
@@ -738,7 +738,7 @@ function Qn({ hasCellMerge: e = !0, hasCellBackgroundColor: t = !0, hasTabHandle
738
738
  for (const d of u) d.setColSpan(1), d.setRowSpan(1);
739
739
  }
740
740
  });
741
- }, [r, e]), k(() => {
741
+ }, [r, e]), _(() => {
742
742
  if (!t) return r.registerNodeTransform(re, (i) => {
743
743
  i.getBackgroundColor() !== null && i.setBackgroundColor(null);
744
744
  });
@@ -756,48 +756,50 @@ const Ve = 200, er = (e) => /^<(b|i|u|strong|em|mark|small|del|ins|sub|sup|div|p
756
756
  maxWords: l = Ve,
757
757
  onChange: c
758
758
  }) => {
759
- const { switchLanguage: u } = dn(), d = an(), [f] = O(() => Fe()), [m, g] = O(0), [h, S] = O(0), w = {
759
+ const { switchLanguage: u } = dn(), d = an(), [f] = I(() => Fe()), [m, g] = I(0), [h, S] = I(0), w = {
760
760
  namespace: "UvaEditor",
761
761
  editor: f,
762
762
  theme: cn,
763
- onError(b) {
764
- throw b;
763
+ onError(E) {
764
+ throw E;
765
765
  },
766
766
  nodes: [Ue, je, qe, rn, re, Be, ne],
767
- editorState: (b) => {
768
- const x = new DOMParser().parseFromString(t, "text/html"), _ = Yt(b, x), N = I();
767
+ editorState: (E) => {
768
+ const x = new DOMParser().parseFromString(t, "text/html"), k = Yt(E, x), N = z();
769
769
  if (N.clear(), er(t))
770
- _.forEach((F) => {
771
- N.append(F);
770
+ k.forEach((O) => {
771
+ N.append(O);
772
772
  });
773
773
  else {
774
- const F = fe();
775
- _.forEach((H, T) => {
776
- T === 0 ? (F.append(H), N.append(F)) : N.append(H);
774
+ const O = fe();
775
+ k.forEach((H, T) => {
776
+ T === 0 ? (O.append(H), N.append(O)) : N.append(H);
777
777
  });
778
778
  }
779
- g(E(I().getTextContent().replace(/\s+/g, " ").trim()) || 0);
780
779
  }
781
- }, E = (b) => b.trim().length === 0 ? 0 : b.split(" ").length, $ = (b, L) => {
782
- b.read(() => {
780
+ }, b = (E) => E.trim().length === 0 ? 0 : E.split(" ").length, $ = (E, L) => {
781
+ E.read(() => {
783
782
  let x = "";
784
- g(E(I().getTextContent().replace(/\s+/g, " ").trim())), x = Zt(L), c(x);
783
+ g(b(z().getTextContent().replace(/\s+/g, " ").trim())), x = Zt(L), c(x);
785
784
  });
786
785
  };
787
- return k(() => {
786
+ return _(() => {
788
787
  u(e.toLocaleLowerCase());
789
- }, [e, u]), /* @__PURE__ */ A("div", { className: M.editor__container, children: [
790
- /* @__PURE__ */ A("div", { className: M.editor__header, children: [
788
+ }, [e, u]), _(() => {
789
+ const E = t.replace(/<br\s*\/?>|&nbsp;/gi, " ").replace(/<\/?[^>]+(>|$)|&[a-z]+;/g, "").replace(/\s+/g, " ").trim();
790
+ g(b(E));
791
+ }, []), /* @__PURE__ */ K("div", { className: M.editor__container, children: [
792
+ /* @__PURE__ */ K("div", { className: M.editor__header, children: [
791
793
  /* @__PURE__ */ y(un, { label: r, info: i, required: o }),
792
- /* @__PURE__ */ A("div", { className: M["editor__header-word-count"], children: [
794
+ /* @__PURE__ */ K("div", { className: M["editor__header-word-count"], children: [
793
795
  /* @__PURE__ */ y("span", { className: on({ [M["editor__header-word-count--alert"]]: m > l }), children: m }),
794
796
  " / ",
795
797
  l
796
798
  ] })
797
799
  ] }),
798
- /* @__PURE__ */ y("div", { className: M.editor, children: /* @__PURE__ */ A(pn, { initialConfig: w, children: [
800
+ /* @__PURE__ */ y("div", { className: M.editor, children: /* @__PURE__ */ K(pn, { initialConfig: w, children: [
799
801
  /* @__PURE__ */ y(sn, { editorScrollPosition: h }),
800
- /* @__PURE__ */ A("div", { className: M["editor__field-wrapper"], children: [
802
+ /* @__PURE__ */ K("div", { className: M["editor__field-wrapper"], children: [
801
803
  /* @__PURE__ */ y(
802
804
  Dn,
803
805
  {
@@ -812,7 +814,7 @@ const Ve = 200, er = (e) => /^<(b|i|u|strong|em|mark|small|del|ins|sub|sup|div|p
812
814
  spellCheck: !1,
813
815
  id: "rteEditor",
814
816
  style: { height: `${a}`, maxHeight: `${a}` },
815
- onScroll: (b) => S(b.currentTarget.scrollTop)
817
+ onScroll: (E) => S(E.currentTarget.scrollTop)
816
818
  }
817
819
  ),
818
820
  placeholder: /* @__PURE__ */ y("div", { className: M.editor__placeholder, children: n }),