@uva-glass/component-library 2.6.2 → 2.7.0

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 (121) hide show
  1. package/dist/{Lexical.prod-BAr6tzpa.js → Lexical.prod-sR6tW7N6.js} +894 -894
  2. package/dist/Lexical.prod-sR6tW7N6.js.map +1 -0
  3. package/dist/{LexicalClipboard.prod-CLCBYtDj.js → LexicalClipboard.prod-BbRoaXo6.js} +93 -93
  4. package/dist/LexicalClipboard.prod-BbRoaXo6.js.map +1 -0
  5. package/dist/{LexicalComposerContext.prod-Dyvim1tK.js → LexicalComposerContext.prod-DxxjdrXB.js} +2 -2
  6. package/dist/{LexicalComposerContext.prod-Dyvim1tK.js.map → LexicalComposerContext.prod-DxxjdrXB.js.map} +1 -1
  7. package/dist/{LexicalLink.prod-CBgZ4B3x.js → LexicalLink.prod-iDKxtfCF.js} +42 -42
  8. package/dist/LexicalLink.prod-iDKxtfCF.js.map +1 -0
  9. package/dist/{LexicalList.prod-haeqjypw.js → LexicalList.prod-ywkx7SnO.js} +56 -56
  10. package/dist/LexicalList.prod-ywkx7SnO.js.map +1 -0
  11. package/dist/LexicalSelection.prod-mYXylG1z.js +86 -0
  12. package/dist/{LexicalSelection.prod-C8x7KK4L.js.map → LexicalSelection.prod-mYXylG1z.js.map} +1 -1
  13. package/dist/LexicalTable.prod-XN7avk7R.js +1447 -0
  14. package/dist/LexicalTable.prod-XN7avk7R.js.map +1 -0
  15. package/dist/{LexicalUtils.prod-Dsec_Kl-.js → LexicalUtils.prod-DnFLi0Ww.js} +24 -24
  16. package/dist/{LexicalUtils.prod-Dsec_Kl-.js.map → LexicalUtils.prod-DnFLi0Ww.js.map} +1 -1
  17. package/dist/{SortableProvider-BUsvniX7.js → SortableProvider-RaH_ZXB3.js} +20 -20
  18. package/dist/{SortableProvider-BUsvniX7.js.map → SortableProvider-RaH_ZXB3.js.map} +1 -1
  19. package/dist/{TablePlugin-sPSGmCno.js → TablePlugin-5Cs2F_co.js} +12 -11
  20. package/dist/{TablePlugin-sPSGmCno.js.map → TablePlugin-5Cs2F_co.js.map} +1 -1
  21. package/dist/assets/FormInput.css +1 -1
  22. package/dist/components/Buttons/Button.stories.js +1 -1
  23. package/dist/components/Buttons/LinkButton.stories.js +1 -1
  24. package/dist/components/Buttons/MenuButton.stories.js +1 -1
  25. package/dist/components/Checkbox/Checkbox.d.ts +1 -1
  26. package/dist/components/Checkbox/Checkbox.js +6 -5
  27. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  28. package/dist/components/Checkbox/Checkbox.stories.js +1 -1
  29. package/dist/components/CheckboxButton/CheckboxButton.stories.js +1 -1
  30. package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js +1 -1
  31. package/dist/components/CheckboxTree/CheckboxTree.d.ts +2 -2
  32. package/dist/components/CheckboxTree/CheckboxTree.js +110 -74
  33. package/dist/components/CheckboxTree/CheckboxTree.js.map +1 -1
  34. package/dist/components/CheckboxTree/CheckboxTree.stories.d.ts +2 -1
  35. package/dist/components/CheckboxTree/CheckboxTree.stories.js +121 -31
  36. package/dist/components/CheckboxTree/CheckboxTree.stories.js.map +1 -1
  37. package/dist/components/Chip/Chip.stories.js +1 -1
  38. package/dist/components/Drawer/Drawer.stories.js +1 -1
  39. package/dist/components/FormInput/FormInput.d.ts +1 -1
  40. package/dist/components/FormInput/FormInput.js +39 -41
  41. package/dist/components/FormInput/FormInput.js.map +1 -1
  42. package/dist/components/FormInput/FormInput.stories.js +1 -1
  43. package/dist/components/IconButton/IconButton.stories.js +1 -1
  44. package/dist/components/InputField/InputField.js +17 -17
  45. package/dist/components/InputField/InputField.stories.js +17 -16
  46. package/dist/components/InputField/InputField.stories.js.map +1 -1
  47. package/dist/components/ModalDialog/ModalDialog.stories.js +1 -1
  48. package/dist/components/MultiSelect/MultiSelect.js +1 -1
  49. package/dist/components/MultiSelect/MultiSelect.stories.js +2 -2
  50. package/dist/components/MultiSelect/components/MultiSelectHeader.js +5 -4
  51. package/dist/components/MultiSelect/components/MultiSelectHeader.js.map +1 -1
  52. package/dist/components/MultiSelect/index.js +1 -1
  53. package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js +4 -4
  54. package/dist/components/OverlayStepBar/OverlayStepBar.js +13 -12
  55. package/dist/components/OverlayStepBar/OverlayStepBar.js.map +1 -1
  56. package/dist/components/PeriodSelector/PeriodSelector.js +15 -14
  57. package/dist/components/PeriodSelector/PeriodSelector.js.map +1 -1
  58. package/dist/components/PeriodSelector/PeriodSelector.stories.js +1 -1
  59. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +11 -10
  60. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js.map +1 -1
  61. package/dist/components/RadioButton/RadioButton.js +3 -3
  62. package/dist/components/RteEditor/EditorHeader/EditorHeader.js +6 -5
  63. package/dist/components/RteEditor/EditorHeader/EditorHeader.js.map +1 -1
  64. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +2 -2
  65. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +15 -14
  66. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js.map +1 -1
  67. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +6 -5
  68. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js.map +1 -1
  69. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +1 -1
  70. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +10 -9
  71. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
  72. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
  73. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +48 -48
  74. package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +5 -5
  75. package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +5 -4
  76. package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js.map +1 -1
  77. package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js +1 -1
  78. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +8 -7
  79. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js.map +1 -1
  80. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +5 -5
  81. package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
  82. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +4 -4
  83. package/dist/components/RteEditor/Plugins/index.js +1 -1
  84. package/dist/components/RteEditor/Providers/LanguageProvider.js +7 -7
  85. package/dist/components/RteEditor/RteEditor.js +473 -472
  86. package/dist/components/RteEditor/RteEditor.js.map +1 -1
  87. package/dist/components/RteEditor/helpers.js +4 -4
  88. package/dist/components/SelectListbox/SelectListBox.stories.js +1 -1
  89. package/dist/components/SelectListbox/SelectProvider.js +10 -10
  90. package/dist/components/Sortable/Sortable.js +1 -1
  91. package/dist/components/Sortable/Sortable.stories.js +7 -7
  92. package/dist/components/Sortable/SortableProvider.js +1 -1
  93. package/dist/components/Sortable/components/SortableContainer.js +1 -1
  94. package/dist/components/Sortable/components/SortableItem.js +15 -15
  95. package/dist/components/Sortable/sortableReducer.js +21 -21
  96. package/dist/components/ToggleSwitch/ToggleSwitch.stories.js +5 -5
  97. package/dist/components/Tooltip/Tooltip.js +22 -22
  98. package/dist/components/index.js +1 -1
  99. package/dist/{helpers-DHHQR5ys.js → helpers-BpqX-Lj3.js} +26 -26
  100. package/dist/helpers-BpqX-Lj3.js.map +1 -0
  101. package/dist/{index-0wq-B7do.js → index-B3c5pcHk.js} +22 -22
  102. package/dist/{index-0wq-B7do.js.map → index-B3c5pcHk.js.map} +1 -1
  103. package/dist/{index-B9BWML6P.js → index-BpZ8v2ye.js} +7088 -7092
  104. package/dist/{index-B9BWML6P.js.map → index-BpZ8v2ye.js.map} +1 -1
  105. package/dist/index-CHX1d9_A.js +21922 -0
  106. package/dist/{index-DWzkl4aY.js.map → index-CHX1d9_A.js.map} +1 -1
  107. package/dist/index.js +1 -1
  108. package/dist/{react-18-BIqxBxbW.js → react-18-CT6mjea2.js} +2 -2
  109. package/dist/{react-18-BIqxBxbW.js.map → react-18-CT6mjea2.js.map} +1 -1
  110. package/dist/storybook__react.d.js +510 -510
  111. package/dist/storybook__react.d.js.map +1 -1
  112. package/package.json +1 -1
  113. package/dist/Lexical.prod-BAr6tzpa.js.map +0 -1
  114. package/dist/LexicalClipboard.prod-CLCBYtDj.js.map +0 -1
  115. package/dist/LexicalLink.prod-CBgZ4B3x.js.map +0 -1
  116. package/dist/LexicalList.prod-haeqjypw.js.map +0 -1
  117. package/dist/LexicalSelection.prod-C8x7KK4L.js +0 -86
  118. package/dist/LexicalTable.prod-8RqiGUG-.js +0 -1447
  119. package/dist/LexicalTable.prod-8RqiGUG-.js.map +0 -1
  120. package/dist/helpers-DHHQR5ys.js.map +0 -1
  121. package/dist/index-DWzkl4aY.js +0 -21915
@@ -1,27 +1,28 @@
1
1
  import { jsx as h, jsxs as K, Fragment as Te } from "react/jsx-runtime";
2
- import { l as Je, o as Xe, u as P } from "../../LexicalComposerContext.prod-Dyvim1tK.js";
3
- import { ap as Re, a2 as A, V as Me, H as p, I as H, L as V, j as Ge, v as M, a as g, N as Ye, f as m, aq as Ze, a1 as Ie, F as Oe, ar as Qe, B as et, ao as F, am as tt, as as nt, at as rt, au as ot, d as ne, av as it, aw as at, w as st, i as lt, M as ct, k as ut, ax as dt, ay as fe, o as me, U as ft, R as re, T as mt, a6 as Fe, az as pe, D as pt, C as gt, S as ht, a5 as ge, z as vt, aA as Ct, aB as yt, aC as Et, ak as wt, m as bt, l as $t, aD as St, p as _t, K as kt, G as xt, a8 as Nt, e as Lt, q as he, aE as Dt, E as Pt, aa as G, a9 as Y, aF as Tt, aG as Rt, ac as Mt, ab as It } from "../../Lexical.prod-BAr6tzpa.js";
2
+ import { l as Je, o as Xe, u as P } from "../../LexicalComposerContext.prod-DxxjdrXB.js";
3
+ import { ap as Re, a2 as A, V as Me, H as p, I as H, L as V, j as Ge, v as M, a as g, N as Ye, f as m, aq as Ze, a1 as Ie, F as Oe, ar as Qe, B as et, ao as F, am as tt, as as nt, at as rt, au as ot, d as ne, av as at, aw as st, w as it, i as lt, M as ut, k as ct, ax as dt, ay as fe, o as me, U as ft, R as re, T as mt, a6 as Fe, az as pe, D as pt, C as gt, S as ht, a5 as ge, z as Ct, aA as yt, aB as Et, aC as vt, ak as wt, m as bt, l as $t, aD as St, p as _t, K as kt, G as xt, a8 as Nt, e as Lt, q as he, aE as Dt, E as Pt, aa as G, a9 as Y, aF as Tt, aG as Rt, ac as Mt, ab as It } from "../../Lexical.prod-sR6tW7N6.js";
4
4
  import * as oe from "react";
5
5
  import { useMemo as W, useLayoutEffect as j, useEffect as _, useState as I, useRef as Ke, Suspense as Ot, forwardRef as ze, useCallback as Ft } from "react";
6
- import { N as U, c as z, o as Kt, r as de } from "../../LexicalUtils.prod-Dsec_Kl-.js";
7
- import { r as zt } from "../../index-B9BWML6P.js";
8
- import { N as ve, O as Ce, h as At, m as Bt } from "../../LexicalClipboard.prod-CLCBYtDj.js";
9
- import { M as ye, j as Ee } from "../../LexicalSelection.prod-C8x7KK4L.js";
10
- import { V as Ae, I as Be, Z as jt } from "../../LexicalList.prod-haeqjypw.js";
11
- import { f as je, N as we, x as ie, m as Ut, O as qt } from "../../LexicalLink.prod-CBgZ4B3x.js";
12
- import { a as Ht, j as Vt, X as Wt, q as Jt, u as Ue, S as Xt, P as Gt } from "../../LexicalTable.prod-8RqiGUG-.js";
13
- import { a as Yt, F as Zt, M as Qt } from "../../helpers-DHHQR5ys.js";
6
+ import { N as U, c as z, o as Kt, r as de } from "../../LexicalUtils.prod-DnFLi0Ww.js";
7
+ import { r as zt } from "../../index-BpZ8v2ye.js";
8
+ import { N as Ce, O as ye, h as At, m as Bt } from "../../LexicalClipboard.prod-BbRoaXo6.js";
9
+ import { M as Ee, j as ve } from "../../LexicalSelection.prod-mYXylG1z.js";
10
+ import { V as Ae, I as Be, Z as jt } from "../../LexicalList.prod-ywkx7SnO.js";
11
+ import { f as je, N as we, x as ae, m as Ut, O as qt } from "../../LexicalLink.prod-iDKxtfCF.js";
12
+ import { a as Ht, j as Vt, X as Wt, q as Jt, u as Ue, S as Xt, P as Gt } from "../../LexicalTable.prod-XN7avk7R.js";
13
+ import { a as Yt, F as Zt, M as Qt } from "../../helpers-BpqX-Lj3.js";
14
14
  import { c as en } from "../../clsx-OuTLNxxd.js";
15
15
  import { exportMap as tn, isStartingWithHtmlTag as nn, mergeBoldStrongTags as rn } from "./helpers.js";
16
16
  import { s as R } from "../../RteEditor.module-oFMKEW6f.js";
17
17
  import { ToolBarPlugin as on } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
18
18
  import { useTranslation as an } from "./hooks/useTranslation.js";
19
- import "../../TablePlugin-sPSGmCno.js";
19
+ import "../../TablePlugin-5Cs2F_co.js";
20
20
  import "./Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js";
21
21
  import "./hooks/components/Flyout.js";
22
22
  import "../Buttons/Button.js";
23
23
  import "../Buttons/LinkButton.js";
24
24
  import "@react-aria/button";
25
+ import "../Checkbox/Checkbox.js";
25
26
  import "@react-aria/dialog";
26
27
  import "@react-aria/focus";
27
28
  import "@react-aria/overlays";
@@ -35,30 +36,30 @@ import "react-router";
35
36
  import "../SelectListbox/SelectListbox.js";
36
37
  import "../SelectListbox/SelectProvider.js";
37
38
  import "../Sortable/components/SortableItem.js";
38
- import "../../SortableProvider-BUsvniX7.js";
39
+ import "../../SortableProvider-RaH_ZXB3.js";
39
40
  import { UvaTheme as ln } from "./UvaTheme/UvaTheme.js";
40
- import { EditorHeader as cn } from "./EditorHeader/EditorHeader.js";
41
- import { useLanguage as un, LanguageProvider as dn } from "./Providers/LanguageProvider.js";
41
+ import { EditorHeader as un } from "./EditorHeader/EditorHeader.js";
42
+ import { useLanguage as cn, LanguageProvider as dn } from "./Providers/LanguageProvider.js";
42
43
  import { PasteHandlerPlugin as fn } from "./Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js";
43
44
  const qe = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, mn = qe ? j : _, Z = { tag: "history-merge" };
44
- function pn({ initialConfig: t, children: e }) {
45
- const n = W(() => {
46
- const { theme: o, namespace: i, nodes: r, onError: a, editorState: s, html: l } = t, c = Xe(null, o), u = Re({ editable: t.editable, html: l, namespace: i, nodes: r, onError: (d) => a(d, u), theme: o });
45
+ function pn({ initialConfig: n, children: e }) {
46
+ const t = W(() => {
47
+ const { theme: o, namespace: a, nodes: r, onError: s, editorState: i, html: l } = n, u = Xe(null, o), c = Re({ editable: n.editable, html: l, namespace: a, nodes: r, onError: (d) => s(d, c), theme: o });
47
48
  return function(d, f) {
48
49
  if (f !== null) {
49
50
  if (f === void 0) d.update(() => {
50
- const v = A();
51
- if (v.isEmpty()) {
52
- const C = Me();
53
- v.append(C);
51
+ const C = A();
52
+ if (C.isEmpty()) {
53
+ const y = Me();
54
+ C.append(y);
54
55
  const w = qe ? document.activeElement : null;
55
- (p() !== null || w !== null && w === d.getRootElement()) && C.select();
56
+ (p() !== null || w !== null && w === d.getRootElement()) && y.select();
56
57
  }
57
58
  }, Z);
58
59
  else if (f !== null) switch (typeof f) {
59
60
  case "string": {
60
- const v = d.parseEditorState(f);
61
- d.setEditorState(v, Z);
61
+ const C = d.parseEditorState(f);
62
+ d.setEditorState(C, Z);
62
63
  break;
63
64
  }
64
65
  case "object":
@@ -70,47 +71,47 @@ function pn({ initialConfig: t, children: e }) {
70
71
  }, Z);
71
72
  }
72
73
  }
73
- }(u, s), [u, c];
74
+ }(c, i), [c, u];
74
75
  }, []);
75
76
  return mn(() => {
76
- const o = t.editable, [i] = n;
77
- i.setEditable(o === void 0 || o);
78
- }, []), h(Je.Provider, { value: n, children: e });
77
+ const o = n.editable, [a] = t;
78
+ a.setEditable(o === void 0 || o);
79
+ }, []), h(Je.Provider, { value: t, children: e });
79
80
  }
80
81
  const gn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? j : _;
81
- function hn(t) {
82
- return { initialValueFn: () => t.isEditable(), subscribe: (e) => t.registerEditableListener(e) };
82
+ function hn(n) {
83
+ return { initialValueFn: () => n.isEditable(), subscribe: (e) => n.registerEditableListener(e) };
83
84
  }
84
- function vn() {
85
- return function(t) {
86
- const [e] = P(), n = W(() => t(e), [e, t]), [o, i] = I(() => n.initialValueFn()), r = Ke(o);
85
+ function Cn() {
86
+ return function(n) {
87
+ const [e] = P(), t = W(() => n(e), [e, n]), [o, a] = I(() => t.initialValueFn()), r = Ke(o);
87
88
  return gn(() => {
88
- const { initialValueFn: a, subscribe: s } = n, l = a();
89
- return r.current !== l && (r.current = l, i(l)), s((c) => {
90
- r.current = c, i(c);
89
+ const { initialValueFn: s, subscribe: i } = t, l = s();
90
+ return r.current !== l && (r.current = l, a(l)), i((u) => {
91
+ r.current = u, a(u);
91
92
  });
92
- }, [n, t]), o;
93
+ }, [t, n]), o;
93
94
  }(hn);
94
95
  }
95
- function Cn() {
96
+ function yn() {
96
97
  return A().getTextContent();
97
98
  }
98
- function yn(t, e = !0) {
99
- if (t) return !1;
100
- let n = Cn();
101
- return e && (n = n.trim()), n === "";
102
- }
103
- function En(t) {
104
- if (!yn(t, !1)) return !1;
105
- const e = A().getChildren(), n = e.length;
106
- if (n > 1) return !1;
107
- for (let o = 0; o < n; o++) {
108
- const i = e[o];
109
- if (H(i)) return !1;
110
- if (V(i)) {
111
- if (!Ge(i) || i.__indent !== 0) return !1;
112
- const r = i.getChildren(), a = r.length;
113
- for (let s = 0; s < a; s++) {
99
+ function En(n, e = !0) {
100
+ if (n) return !1;
101
+ let t = yn();
102
+ return e && (t = t.trim()), t === "";
103
+ }
104
+ function vn(n) {
105
+ if (!En(n, !1)) return !1;
106
+ const e = A().getChildren(), t = e.length;
107
+ if (t > 1) return !1;
108
+ for (let o = 0; o < t; o++) {
109
+ const a = e[o];
110
+ if (H(a)) return !1;
111
+ if (V(a)) {
112
+ if (!Ge(a) || a.__indent !== 0) return !1;
113
+ const r = a.getChildren(), s = r.length;
114
+ for (let i = 0; i < s; i++) {
114
115
  const l = r[o];
115
116
  if (!M(l)) return !1;
116
117
  }
@@ -118,47 +119,47 @@ function En(t) {
118
119
  }
119
120
  return !0;
120
121
  }
121
- function He(t) {
122
- return () => En(t);
122
+ function He(n) {
123
+ return () => vn(n);
123
124
  }
124
- function wn(t) {
125
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
125
+ function wn(n) {
126
+ return n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
126
127
  }
127
- wn(function(t) {
128
+ wn(function(n) {
128
129
  const e = new URLSearchParams();
129
- e.append("code", t);
130
- for (let n = 1; n < arguments.length; n++) e.append("v", arguments[n]);
131
- throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
130
+ e.append("code", n);
131
+ for (let t = 1; t < arguments.length; t++) e.append("v", arguments[t]);
132
+ throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
132
133
  });
133
134
  var be = zt();
134
- function bn(t) {
135
- const e = window.location.origin, n = (o) => {
135
+ function bn(n) {
136
+ const e = window.location.origin, t = (o) => {
136
137
  if (o.origin !== e) return;
137
- const i = t.getRootElement();
138
- if (document.activeElement !== i) return;
138
+ const a = n.getRootElement();
139
+ if (document.activeElement !== a) return;
139
140
  const r = o.data;
140
141
  if (typeof r == "string") {
141
- let a;
142
+ let s;
142
143
  try {
143
- a = JSON.parse(r);
144
+ s = JSON.parse(r);
144
145
  } catch {
145
146
  return;
146
147
  }
147
- if (a && a.protocol === "nuanria_messaging" && a.type === "request") {
148
- const s = a.payload;
149
- if (s && s.functionId === "makeChanges") {
150
- const l = s.args;
148
+ if (s && s.protocol === "nuanria_messaging" && s.type === "request") {
149
+ const i = s.payload;
150
+ if (i && i.functionId === "makeChanges") {
151
+ const l = i.args;
151
152
  if (l) {
152
- const [c, u, d, f, v, C] = l;
153
- t.update(() => {
153
+ const [u, c, d, f, C, y] = l;
154
+ n.update(() => {
154
155
  const w = p();
155
156
  if (g(w)) {
156
157
  const k = w.anchor;
157
- let y = k.getNode(), E = 0, $ = 0;
158
- if (M(y) && c >= 0 && u >= 0 && (E = c, $ = c + u, w.setTextNodeRange(y, E, y, $)), E === $ && d === "" || (w.insertRawText(d), y = k.getNode()), M(y)) {
159
- E = f, $ = f + v;
160
- const x = y.getTextContentSize();
161
- E = E > x ? x : E, $ = $ > x ? x : $, w.setTextNodeRange(y, E, y, $);
158
+ let E = k.getNode(), v = 0, $ = 0;
159
+ if (M(E) && u >= 0 && c >= 0 && (v = u, $ = u + c, w.setTextNodeRange(E, v, E, $)), v === $ && d === "" || (w.insertRawText(d), E = k.getNode()), M(E)) {
160
+ v = f, $ = f + C;
161
+ const x = E.getTextContentSize();
162
+ v = v > x ? x : v, $ = $ > x ? x : $, w.setTextNodeRange(E, v, E, $);
162
163
  }
163
164
  o.stopImmediatePropagation();
164
165
  }
@@ -168,441 +169,441 @@ function bn(t) {
168
169
  }
169
170
  }
170
171
  };
171
- return window.addEventListener("message", n, !0), () => {
172
- window.removeEventListener("message", n, !0);
172
+ return window.addEventListener("message", t, !0), () => {
173
+ window.removeEventListener("message", t, !0);
173
174
  };
174
175
  }
175
- function $e(t, e) {
176
+ function $e(n, e) {
176
177
  if (document.caretRangeFromPoint !== void 0) {
177
- const n = document.caretRangeFromPoint(t, e);
178
- return n === null ? null : { node: n.startContainer, offset: n.startOffset };
178
+ const t = document.caretRangeFromPoint(n, e);
179
+ return t === null ? null : { node: t.startContainer, offset: t.startOffset };
179
180
  }
180
181
  if (document.caretPositionFromPoint !== "undefined") {
181
- const n = document.caretPositionFromPoint(t, e);
182
- return n === null ? null : { node: n.offsetNode, offset: n.offset };
182
+ const t = document.caretPositionFromPoint(n, e);
183
+ return t === null ? null : { node: t.offsetNode, offset: t.offset };
183
184
  }
184
185
  return null;
185
186
  }
186
187
  const q = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, $n = q && "documentMode" in document ? document.documentMode : null, Sn = !(!q || !("InputEvent" in window) || $n) && "getTargetRanges" in new window.InputEvent("input"), _n = q && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Se = q && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, kn = q && /^(?=.*Chrome).*/i.test(navigator.userAgent), xn = q && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !kn, _e = Lt();
187
- function Q(t) {
188
+ function Q(n) {
188
189
  let e = null;
189
- if (z(t, DragEvent) ? e = t.dataTransfer : z(t, ClipboardEvent) && (e = t.clipboardData), e === null) return [!1, [], !1];
190
- const n = e.types, o = n.includes("Files"), i = n.includes("text/html") || n.includes("text/plain");
191
- return [o, Array.from(e.files), i];
190
+ if (z(n, DragEvent) ? e = n.dataTransfer : z(n, ClipboardEvent) && (e = n.clipboardData), e === null) return [!1, [], !1];
191
+ const t = e.types, o = t.includes("Files"), a = t.includes("text/html") || t.includes("text/plain");
192
+ return [o, Array.from(e.files), a];
192
193
  }
193
- function ke(t) {
194
+ function ke(n) {
194
195
  const e = p();
195
196
  if (!g(e)) return !1;
196
- const n = /* @__PURE__ */ new Set(), o = e.getNodes();
197
- for (let i = 0; i < o.length; i++) {
198
- const r = o[i], a = r.getKey();
199
- if (n.has(a)) continue;
200
- const s = de(r, (c) => V(c) && !c.isInline());
201
- if (s === null) continue;
202
- const l = s.getKey();
203
- s.canIndent() && !n.has(l) && (n.add(l), t(s));
197
+ const t = /* @__PURE__ */ new Set(), o = e.getNodes();
198
+ for (let a = 0; a < o.length; a++) {
199
+ const r = o[a], s = r.getKey();
200
+ if (t.has(s)) continue;
201
+ const i = de(r, (u) => V(u) && !u.isInline());
202
+ if (i === null) continue;
203
+ const l = i.getKey();
204
+ i.canIndent() && !t.has(l) && (t.add(l), n(i));
204
205
  }
205
- return n.size > 0;
206
+ return t.size > 0;
206
207
  }
207
- function ee(t) {
208
- const e = ne(t);
208
+ function ee(n) {
209
+ const e = ne(n);
209
210
  return H(e);
210
211
  }
211
- function ae(t) {
212
- for (const e of ["lowercase", "uppercase", "capitalize"]) t.hasFormat(e) && t.toggleFormat(e);
213
- }
214
- function Nn(t) {
215
- return U(t.registerCommand(Nt, (e) => {
216
- const n = p();
217
- return !!F(n) && (n.clear(), !0);
218
- }, 0), t.registerCommand(re, (e) => {
219
- const n = p();
220
- return !!g(n) && (n.deleteCharacter(e), !0);
221
- }, m), t.registerCommand(xt, (e) => {
222
- const n = p();
223
- return !!g(n) && (n.deleteWord(e), !0);
224
- }, m), t.registerCommand(kt, (e) => {
225
- const n = p();
226
- return !!g(n) && (n.deleteLine(e), !0);
227
- }, m), t.registerCommand(_t, (e) => {
228
- const n = p();
229
- if (typeof e == "string") n !== null && n.insertText(e);
212
+ function se(n) {
213
+ for (const e of ["lowercase", "uppercase", "capitalize"]) n.hasFormat(e) && n.toggleFormat(e);
214
+ }
215
+ function Nn(n) {
216
+ return U(n.registerCommand(Nt, (e) => {
217
+ const t = p();
218
+ return !!F(t) && (t.clear(), !0);
219
+ }, 0), n.registerCommand(re, (e) => {
220
+ const t = p();
221
+ return !!g(t) && (t.deleteCharacter(e), !0);
222
+ }, m), n.registerCommand(xt, (e) => {
223
+ const t = p();
224
+ return !!g(t) && (t.deleteWord(e), !0);
225
+ }, m), n.registerCommand(kt, (e) => {
226
+ const t = p();
227
+ return !!g(t) && (t.deleteLine(e), !0);
228
+ }, m), n.registerCommand(_t, (e) => {
229
+ const t = p();
230
+ if (typeof e == "string") t !== null && t.insertText(e);
230
231
  else {
231
- if (n === null) return !1;
232
+ if (t === null) return !1;
232
233
  const o = e.dataTransfer;
233
- if (o != null) ve(o, n, t);
234
- else if (g(n)) {
235
- const i = e.data;
236
- return i && n.insertText(i), !0;
234
+ if (o != null) Ce(o, t, n);
235
+ else if (g(t)) {
236
+ const a = e.data;
237
+ return a && t.insertText(a), !0;
237
238
  }
238
239
  }
239
240
  return !0;
240
- }, m), t.registerCommand(St, () => {
241
+ }, m), n.registerCommand(St, () => {
241
242
  const e = p();
242
243
  return !!g(e) && (e.removeText(), !0);
243
- }, m), t.registerCommand($t, (e) => {
244
- const n = p();
245
- return !!g(n) && (n.formatText(e), !0);
246
- }, m), t.registerCommand(bt, (e) => {
247
- const n = p();
248
- if (!g(n) && !F(n)) return !1;
249
- const o = n.getNodes();
250
- for (const i of o) {
251
- const r = de(i, (a) => V(a) && !a.isInline());
244
+ }, m), n.registerCommand($t, (e) => {
245
+ const t = p();
246
+ return !!g(t) && (t.formatText(e), !0);
247
+ }, m), n.registerCommand(bt, (e) => {
248
+ const t = p();
249
+ if (!g(t) && !F(t)) return !1;
250
+ const o = t.getNodes();
251
+ for (const a of o) {
252
+ const r = de(a, (s) => V(s) && !s.isInline());
252
253
  r !== null && r.setFormat(e);
253
254
  }
254
255
  return !0;
255
- }, m), t.registerCommand(fe, (e) => {
256
- const n = p();
257
- return !!g(n) && (n.insertLineBreak(e), !0);
258
- }, m), t.registerCommand(me, () => {
256
+ }, m), n.registerCommand(fe, (e) => {
257
+ const t = p();
258
+ return !!g(t) && (t.insertLineBreak(e), !0);
259
+ }, m), n.registerCommand(me, () => {
259
260
  const e = p();
260
261
  return !!g(e) && (e.insertParagraph(), !0);
261
- }, m), t.registerCommand(yt, () => (Et([wt()]), !0), m), t.registerCommand(Ct, () => ke((e) => {
262
- const n = e.getIndent();
263
- e.setIndent(n + 1);
264
- }), m), t.registerCommand(pe, () => ke((e) => {
265
- const n = e.getIndent();
266
- n > 0 && e.setIndent(n - 1);
267
- }), m), t.registerCommand(vt, (e) => {
268
- const n = p();
269
- if (F(n) && !ee(e.target)) {
270
- const o = n.getNodes();
262
+ }, m), n.registerCommand(Et, () => (vt([wt()]), !0), m), n.registerCommand(yt, () => ke((e) => {
263
+ const t = e.getIndent();
264
+ e.setIndent(t + 1);
265
+ }), m), n.registerCommand(pe, () => ke((e) => {
266
+ const t = e.getIndent();
267
+ t > 0 && e.setIndent(t - 1);
268
+ }), m), n.registerCommand(Ct, (e) => {
269
+ const t = p();
270
+ if (F(t) && !ee(e.target)) {
271
+ const o = t.getNodes();
271
272
  if (o.length > 0) return o[0].selectPrevious(), !0;
272
- } else if (g(n)) {
273
- const o = ge(n.focus, !0);
273
+ } else if (g(t)) {
274
+ const o = ge(t.focus, !0);
274
275
  if (!e.shiftKey && H(o) && !o.isIsolated() && !o.isInline()) return o.selectPrevious(), e.preventDefault(), !0;
275
276
  }
276
277
  return !1;
277
- }, m), t.registerCommand(ht, (e) => {
278
- const n = p();
279
- if (F(n)) {
280
- const o = n.getNodes();
278
+ }, m), n.registerCommand(ht, (e) => {
279
+ const t = p();
280
+ if (F(t)) {
281
+ const o = t.getNodes();
281
282
  if (o.length > 0) return o[0].selectNext(0, 0), !0;
282
- } else if (g(n)) {
283
- if (function(i) {
284
- const r = i.focus;
283
+ } else if (g(t)) {
284
+ if (function(a) {
285
+ const r = a.focus;
285
286
  return r.key === "root" && r.offset === A().getChildrenSize();
286
- }(n)) return e.preventDefault(), !0;
287
- const o = ge(n.focus, !1);
287
+ }(t)) return e.preventDefault(), !0;
288
+ const o = ge(t.focus, !1);
288
289
  if (!e.shiftKey && H(o) && !o.isIsolated() && !o.isInline()) return o.selectNext(), e.preventDefault(), !0;
289
290
  }
290
291
  return !1;
291
- }, m), t.registerCommand(gt, (e) => {
292
- const n = p();
293
- if (F(n)) {
294
- const o = n.getNodes();
292
+ }, m), n.registerCommand(gt, (e) => {
293
+ const t = p();
294
+ if (F(t)) {
295
+ const o = t.getNodes();
295
296
  if (o.length > 0) return e.preventDefault(), o[0].selectPrevious(), !0;
296
297
  }
297
- if (!g(n)) return !1;
298
- if (ye(n, !0)) {
298
+ if (!g(t)) return !1;
299
+ if (Ee(t, !0)) {
299
300
  const o = e.shiftKey;
300
- return e.preventDefault(), Ee(n, o, !0), !0;
301
+ return e.preventDefault(), ve(t, o, !0), !0;
301
302
  }
302
303
  return !1;
303
- }, m), t.registerCommand(pt, (e) => {
304
- const n = p();
305
- if (F(n) && !ee(e.target)) {
306
- const i = n.getNodes();
307
- if (i.length > 0) return e.preventDefault(), i[0].selectNext(0, 0), !0;
304
+ }, m), n.registerCommand(pt, (e) => {
305
+ const t = p();
306
+ if (F(t) && !ee(e.target)) {
307
+ const a = t.getNodes();
308
+ if (a.length > 0) return e.preventDefault(), a[0].selectNext(0, 0), !0;
308
309
  }
309
- if (!g(n)) return !1;
310
+ if (!g(t)) return !1;
310
311
  const o = e.shiftKey;
311
- return !!ye(n, !1) && (e.preventDefault(), Ee(n, o, !1), !0);
312
- }, m), t.registerCommand(mt, (e) => {
312
+ return !!Ee(t, !1) && (e.preventDefault(), ve(t, o, !1), !0);
313
+ }, m), n.registerCommand(mt, (e) => {
313
314
  if (ee(e.target)) return !1;
314
- const n = p();
315
- if (!g(n)) return !1;
316
- const { anchor: o } = n, i = o.getNode();
317
- return n.isCollapsed() && o.offset === 0 && !Fe(i) && Kt(i).getIndent() > 0 ? (e.preventDefault(), t.dispatchCommand(pe, void 0)) : (!Se || navigator.language !== "ko-KR") && (e.preventDefault(), t.dispatchCommand(re, !0));
318
- }, m), t.registerCommand(ft, (e) => {
315
+ const t = p();
316
+ if (!g(t)) return !1;
317
+ const { anchor: o } = t, a = o.getNode();
318
+ return t.isCollapsed() && o.offset === 0 && !Fe(a) && Kt(a).getIndent() > 0 ? (e.preventDefault(), n.dispatchCommand(pe, void 0)) : (!Se || navigator.language !== "ko-KR") && (e.preventDefault(), n.dispatchCommand(re, !0));
319
+ }, m), n.registerCommand(ft, (e) => {
319
320
  if (ee(e.target)) return !1;
320
- const n = p();
321
- return !!g(n) && (e.preventDefault(), t.dispatchCommand(re, !1));
322
- }, m), t.registerCommand(dt, (e) => {
323
- const n = p();
324
- if (!g(n)) return !1;
325
- if (ae(n), e !== null) {
321
+ const t = p();
322
+ return !!g(t) && (e.preventDefault(), n.dispatchCommand(re, !1));
323
+ }, m), n.registerCommand(dt, (e) => {
324
+ const t = p();
325
+ if (!g(t)) return !1;
326
+ if (se(t), e !== null) {
326
327
  if ((Se || _n || xn) && Sn) return !1;
327
- if (e.preventDefault(), e.shiftKey) return t.dispatchCommand(fe, !1);
328
+ if (e.preventDefault(), e.shiftKey) return n.dispatchCommand(fe, !1);
328
329
  }
329
- return t.dispatchCommand(me, void 0);
330
- }, m), t.registerCommand(ut, () => {
330
+ return n.dispatchCommand(me, void 0);
331
+ }, m), n.registerCommand(ct, () => {
331
332
  const e = p();
332
- return !!g(e) && (t.blur(), !0);
333
- }, m), t.registerCommand(at, (e) => {
334
- const [, n] = Q(e);
335
- if (n.length > 0) {
336
- const i = $e(e.clientX, e.clientY);
337
- if (i !== null) {
338
- const { offset: r, node: a } = i, s = ne(a);
339
- if (s !== null) {
340
- const l = st();
341
- if (M(s)) l.anchor.set(s.getKey(), r, "text"), l.focus.set(s.getKey(), r, "text");
333
+ return !!g(e) && (n.blur(), !0);
334
+ }, m), n.registerCommand(st, (e) => {
335
+ const [, t] = Q(e);
336
+ if (t.length > 0) {
337
+ const a = $e(e.clientX, e.clientY);
338
+ if (a !== null) {
339
+ const { offset: r, node: s } = a, i = ne(s);
340
+ if (i !== null) {
341
+ const l = it();
342
+ if (M(i)) l.anchor.set(i.getKey(), r, "text"), l.focus.set(i.getKey(), r, "text");
342
343
  else {
343
- const u = s.getParentOrThrow().getKey(), d = s.getIndexWithinParent() + 1;
344
- l.anchor.set(u, d, "element"), l.focus.set(u, d, "element");
344
+ const c = i.getParentOrThrow().getKey(), d = i.getIndexWithinParent() + 1;
345
+ l.anchor.set(c, d, "element"), l.focus.set(c, d, "element");
345
346
  }
346
- const c = lt(l);
347
- ct(c);
347
+ const u = lt(l);
348
+ ut(u);
348
349
  }
349
- t.dispatchCommand(_e, n);
350
+ n.dispatchCommand(_e, t);
350
351
  }
351
352
  return e.preventDefault(), !0;
352
353
  }
353
354
  const o = p();
354
355
  return !!g(o);
355
- }, m), t.registerCommand(it, (e) => {
356
- const [n] = Q(e), o = p();
357
- return !(n && !g(o));
358
- }, m), t.registerCommand(ot, (e) => {
359
- const [n] = Q(e), o = p();
360
- if (n && !g(o)) return !1;
361
- const i = $e(e.clientX, e.clientY);
362
- if (i !== null) {
363
- const r = ne(i.node);
356
+ }, m), n.registerCommand(at, (e) => {
357
+ const [t] = Q(e), o = p();
358
+ return !(t && !g(o));
359
+ }, m), n.registerCommand(ot, (e) => {
360
+ const [t] = Q(e), o = p();
361
+ if (t && !g(o)) return !1;
362
+ const a = $e(e.clientX, e.clientY);
363
+ if (a !== null) {
364
+ const r = ne(a.node);
364
365
  H(r) && e.preventDefault();
365
366
  }
366
367
  return !0;
367
- }, m), t.registerCommand(nt, () => (rt(), !0), m), t.registerCommand(tt, (e) => (Ce(t, z(e, ClipboardEvent) ? e : null), !0), m), t.registerCommand(et, (e) => (async function(n, o) {
368
- await Ce(o, z(n, ClipboardEvent) ? n : null), o.update(() => {
369
- const i = p();
370
- g(i) ? i.removeText() : F(i) && i.getNodes().forEach((r) => r.remove());
368
+ }, m), n.registerCommand(nt, () => (rt(), !0), m), n.registerCommand(tt, (e) => (ye(n, z(e, ClipboardEvent) ? e : null), !0), m), n.registerCommand(et, (e) => (async function(t, o) {
369
+ await ye(o, z(t, ClipboardEvent) ? t : null), o.update(() => {
370
+ const a = p();
371
+ g(a) ? a.removeText() : F(a) && a.getNodes().forEach((r) => r.remove());
371
372
  });
372
- }(e, t), !0), m), t.registerCommand(Ie, (e) => {
373
- const [, n, o] = Q(e);
374
- return n.length > 0 && !o ? (t.dispatchCommand(_e, n), !0) : Oe(e.target) && Qe(e.target) ? !1 : p() !== null && (function(i, r) {
375
- i.preventDefault(), r.update(() => {
376
- const a = p(), s = z(i, InputEvent) || z(i, KeyboardEvent) ? null : i.clipboardData;
377
- s != null && a !== null && ve(s, a, r);
373
+ }(e, n), !0), m), n.registerCommand(Ie, (e) => {
374
+ const [, t, o] = Q(e);
375
+ return t.length > 0 && !o ? (n.dispatchCommand(_e, t), !0) : Oe(e.target) && Qe(e.target) ? !1 : p() !== null && (function(a, r) {
376
+ a.preventDefault(), r.update(() => {
377
+ const s = p(), i = z(a, InputEvent) || z(a, KeyboardEvent) ? null : a.clipboardData;
378
+ i != null && s !== null && Ce(i, s, r);
378
379
  }, { tag: "paste" });
379
- }(e, t), !0);
380
- }, m), t.registerCommand(Ze, (e) => {
381
- const n = p();
382
- return g(n) && ae(n), !1;
383
- }, m), t.registerCommand(Ye, (e) => {
384
- const n = p();
385
- return g(n) && ae(n), !1;
380
+ }(e, n), !0);
381
+ }, m), n.registerCommand(Ze, (e) => {
382
+ const t = p();
383
+ return g(t) && se(t), !1;
384
+ }, m), n.registerCommand(Ye, (e) => {
385
+ const t = p();
386
+ return g(t) && se(t), !1;
386
387
  }, m));
387
388
  }
388
- const se = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? j : _;
389
- function xe(t) {
390
- return t.getEditorState().read(He(t.isComposing()));
389
+ const ie = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? j : _;
390
+ function xe(n) {
391
+ return n.getEditorState().read(He(n.isComposing()));
391
392
  }
392
- function Ln({ contentEditable: t, placeholder: e = null, ErrorBoundary: n }) {
393
- const [o] = P(), i = function(r, a) {
394
- const [s, l] = I(() => r.getDecorators());
395
- return se(() => r.registerDecoratorListener((c) => {
393
+ function Ln({ contentEditable: n, placeholder: e = null, ErrorBoundary: t }) {
394
+ const [o] = P(), a = function(r, s) {
395
+ const [i, l] = I(() => r.getDecorators());
396
+ return ie(() => r.registerDecoratorListener((u) => {
396
397
  be.flushSync(() => {
397
- l(c);
398
+ l(u);
398
399
  });
399
400
  }), [r]), _(() => {
400
401
  l(r.getDecorators());
401
402
  }, [r]), W(() => {
402
- const c = [], u = Object.keys(s);
403
- for (let d = 0; d < u.length; d++) {
404
- const f = u[d], v = h(a, { onError: (w) => r._onError(w), children: h(Ot, { fallback: null, children: s[f] }) }), C = r.getElementByKey(f);
405
- C !== null && c.push(be.createPortal(v, C, f));
403
+ const u = [], c = Object.keys(i);
404
+ for (let d = 0; d < c.length; d++) {
405
+ const f = c[d], C = h(s, { onError: (w) => r._onError(w), children: h(Ot, { fallback: null, children: i[f] }) }), y = r.getElementByKey(f);
406
+ y !== null && u.push(be.createPortal(C, y, f));
406
407
  }
407
- return c;
408
- }, [a, s, r]);
409
- }(o, n);
408
+ return u;
409
+ }, [s, i, r]);
410
+ }(o, t);
410
411
  return function(r) {
411
- se(() => U(Nn(r), bn(r)), [r]);
412
- }(o), K(Te, { children: [t, h(Dn, { content: e }), i] });
413
- }
414
- function Dn({ content: t }) {
415
- const [e] = P(), n = function(i) {
416
- const [r, a] = I(() => xe(i));
417
- return se(() => {
418
- function s() {
419
- const l = xe(i);
420
- a(l);
412
+ ie(() => U(Nn(r), bn(r)), [r]);
413
+ }(o), K(Te, { children: [n, h(Dn, { content: e }), a] });
414
+ }
415
+ function Dn({ content: n }) {
416
+ const [e] = P(), t = function(a) {
417
+ const [r, s] = I(() => xe(a));
418
+ return ie(() => {
419
+ function i() {
420
+ const l = xe(a);
421
+ s(l);
421
422
  }
422
- return s(), U(i.registerUpdateListener(() => {
423
- s();
424
- }), i.registerEditableListener(() => {
425
- s();
423
+ return i(), U(a.registerUpdateListener(() => {
424
+ i();
425
+ }), a.registerEditableListener(() => {
426
+ i();
426
427
  }));
427
- }, [i]), r;
428
- }(e), o = vn();
429
- return n ? typeof t == "function" ? t(o) : t : null;
428
+ }, [a]), r;
429
+ }(e), o = Cn();
430
+ return t ? typeof n == "function" ? n(o) : n : null;
430
431
  }
431
432
  const Ve = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? j : _;
432
- function Pn({ editor: t, ariaActiveDescendant: e, ariaAutoComplete: n, ariaControls: o, ariaDescribedBy: i, ariaErrorMessage: r, ariaExpanded: a, ariaInvalid: s, ariaLabel: l, ariaLabelledBy: c, ariaMultiline: u, ariaOwns: d, ariaRequired: f, autoCapitalize: v, className: C, id: w, role: k = "textbox", spellCheck: y = !0, style: E, tabIndex: $, "data-testid": x, ...b }, N) {
433
- const [S, T] = I(t.isEditable()), O = Ft((L) => {
434
- L && L.ownerDocument && L.ownerDocument.defaultView ? t.setRootElement(L) : t.setRootElement(null);
435
- }, [t]), B = W(() => /* @__PURE__ */ function(...L) {
433
+ function Pn({ editor: n, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: o, ariaDescribedBy: a, ariaErrorMessage: r, ariaExpanded: s, ariaInvalid: i, ariaLabel: l, ariaLabelledBy: u, ariaMultiline: c, ariaOwns: d, ariaRequired: f, autoCapitalize: C, className: y, id: w, role: k = "textbox", spellCheck: E = !0, style: v, tabIndex: $, "data-testid": x, ...b }, N) {
434
+ const [S, T] = I(n.isEditable()), O = Ft((L) => {
435
+ L && L.ownerDocument && L.ownerDocument.defaultView ? n.setRootElement(L) : n.setRootElement(null);
436
+ }, [n]), B = W(() => /* @__PURE__ */ function(...L) {
436
437
  return (J) => {
437
438
  L.forEach((X) => {
438
439
  typeof X == "function" ? X(J) : X != null && (X.current = J);
439
440
  });
440
441
  };
441
442
  }(N, O), [O, N]);
442
- return Ve(() => (T(t.isEditable()), t.registerEditableListener((L) => {
443
+ return Ve(() => (T(n.isEditable()), n.registerEditableListener((L) => {
443
444
  T(L);
444
- })), [t]), h("div", { "aria-activedescendant": S ? e : void 0, "aria-autocomplete": S ? n : "none", "aria-controls": S ? o : void 0, "aria-describedby": i, ...r != null ? { "aria-errormessage": r } : {}, "aria-expanded": S && k === "combobox" ? !!a : void 0, ...s != null ? { "aria-invalid": s } : {}, "aria-label": l, "aria-labelledby": c, "aria-multiline": u, "aria-owns": S ? d : void 0, "aria-readonly": !S || void 0, "aria-required": f, autoCapitalize: v, className: C, contentEditable: S, "data-testid": x, id: w, ref: B, role: S ? k : void 0, spellCheck: y, style: E, tabIndex: $, ...b });
445
+ })), [n]), h("div", { "aria-activedescendant": S ? e : void 0, "aria-autocomplete": S ? t : "none", "aria-controls": S ? o : void 0, "aria-describedby": a, ...r != null ? { "aria-errormessage": r } : {}, "aria-expanded": S && k === "combobox" ? !!s : void 0, ...i != null ? { "aria-invalid": i } : {}, "aria-label": l, "aria-labelledby": u, "aria-multiline": c, "aria-owns": S ? d : void 0, "aria-readonly": !S || void 0, "aria-required": f, autoCapitalize: C, className: y, contentEditable: S, "data-testid": x, id: w, ref: B, role: S ? k : void 0, spellCheck: E, style: v, tabIndex: $, ...b });
445
446
  }
446
447
  const Tn = ze(Pn);
447
- function Ne(t) {
448
- return t.getEditorState().read(He(t.isComposing()));
448
+ function Ne(n) {
449
+ return n.getEditorState().read(He(n.isComposing()));
449
450
  }
450
451
  const Rn = ze(Mn);
451
- function Mn(t, e) {
452
- const { placeholder: n, ...o } = t, [i] = P();
453
- return K(Te, { children: [h(Tn, { editor: i, ...o, ref: e }), n != null && h(In, { editor: i, content: n })] });
452
+ function Mn(n, e) {
453
+ const { placeholder: t, ...o } = n, [a] = P();
454
+ return K(Te, { children: [h(Tn, { editor: a, ...o, ref: e }), t != null && h(In, { editor: a, content: t })] });
454
455
  }
455
- function In({ content: t, editor: e }) {
456
- const n = function(a) {
457
- const [s, l] = I(() => Ne(a));
456
+ function In({ content: n, editor: e }) {
457
+ const t = function(s) {
458
+ const [i, l] = I(() => Ne(s));
458
459
  return Ve(() => {
459
- function c() {
460
- const u = Ne(a);
461
- l(u);
460
+ function u() {
461
+ const c = Ne(s);
462
+ l(c);
462
463
  }
463
- return c(), U(a.registerUpdateListener(() => {
464
- c();
465
- }), a.registerEditableListener(() => {
466
- c();
464
+ return u(), U(s.registerUpdateListener(() => {
465
+ u();
466
+ }), s.registerEditableListener(() => {
467
+ u();
467
468
  }));
468
- }, [a]), s;
469
- }(e), [o, i] = I(e.isEditable());
470
- if (j(() => (i(e.isEditable()), e.registerEditableListener((a) => {
471
- i(a);
472
- })), [e]), !n) return null;
469
+ }, [s]), i;
470
+ }(e), [o, a] = I(e.isEditable());
471
+ if (j(() => (a(e.isEditable()), e.registerEditableListener((s) => {
472
+ a(s);
473
+ })), [e]), !t) return null;
473
474
  let r = null;
474
- return typeof t == "function" ? r = t(o) : t !== null && (r = t), r === null ? null : h("div", { "aria-hidden": !0, children: r });
475
+ return typeof n == "function" ? r = n(o) : n !== null && (r = n), r === null ? null : h("div", { "aria-hidden": !0, children: r });
475
476
  }
476
- function le(t, e) {
477
- return le = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, o) {
478
- return n.__proto__ = o, n;
479
- }, le(t, e);
477
+ function le(n, e) {
478
+ return le = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, o) {
479
+ return t.__proto__ = o, t;
480
+ }, le(n, e);
480
481
  }
481
- var Le = { error: null }, On = function(t) {
482
- var e, n;
482
+ var Le = { error: null }, On = function(n) {
483
+ var e, t;
483
484
  function o() {
484
- for (var r, a = arguments.length, s = new Array(a), l = 0; l < a; l++) s[l] = arguments[l];
485
- return (r = t.call.apply(t, [this].concat(s)) || this).state = Le, r.resetErrorBoundary = function() {
486
- for (var c, u = arguments.length, d = new Array(u), f = 0; f < u; f++) d[f] = arguments[f];
487
- r.props.onReset == null || (c = r.props).onReset.apply(c, d), r.reset();
485
+ for (var r, s = arguments.length, i = new Array(s), l = 0; l < s; l++) i[l] = arguments[l];
486
+ return (r = n.call.apply(n, [this].concat(i)) || this).state = Le, r.resetErrorBoundary = function() {
487
+ for (var u, c = arguments.length, d = new Array(c), f = 0; f < c; f++) d[f] = arguments[f];
488
+ r.props.onReset == null || (u = r.props).onReset.apply(u, d), r.reset();
488
489
  }, r;
489
490
  }
490
- n = t, (e = o).prototype = Object.create(n.prototype), e.prototype.constructor = e, le(e, n), o.getDerivedStateFromError = function(r) {
491
+ t = n, (e = o).prototype = Object.create(t.prototype), e.prototype.constructor = e, le(e, t), o.getDerivedStateFromError = function(r) {
491
492
  return { error: r };
492
493
  };
493
- var i = o.prototype;
494
- return i.reset = function() {
494
+ var a = o.prototype;
495
+ return a.reset = function() {
495
496
  this.setState(Le);
496
- }, i.componentDidCatch = function(r, a) {
497
- var s, l;
498
- (s = (l = this.props).onError) == null || s.call(l, r, a);
499
- }, i.componentDidUpdate = function(r, a) {
500
- var s, l, c, u, d = this.state.error, f = this.props.resetKeys;
501
- d !== null && a.error !== null && ((c = r.resetKeys) === void 0 && (c = []), (u = f) === void 0 && (u = []), c.length !== u.length || c.some(function(v, C) {
502
- return !Object.is(v, u[C]);
503
- })) && ((s = (l = this.props).onResetKeysChange) == null || s.call(l, r.resetKeys, f), this.reset());
504
- }, i.render = function() {
505
- var r = this.state.error, a = this.props, s = a.fallbackRender, l = a.FallbackComponent, c = a.fallback;
497
+ }, a.componentDidCatch = function(r, s) {
498
+ var i, l;
499
+ (i = (l = this.props).onError) == null || i.call(l, r, s);
500
+ }, a.componentDidUpdate = function(r, s) {
501
+ var i, l, u, c, d = this.state.error, f = this.props.resetKeys;
502
+ d !== null && s.error !== null && ((u = r.resetKeys) === void 0 && (u = []), (c = f) === void 0 && (c = []), u.length !== c.length || u.some(function(C, y) {
503
+ return !Object.is(C, c[y]);
504
+ })) && ((i = (l = this.props).onResetKeysChange) == null || i.call(l, r.resetKeys, f), this.reset());
505
+ }, a.render = function() {
506
+ var r = this.state.error, s = this.props, i = s.fallbackRender, l = s.FallbackComponent, u = s.fallback;
506
507
  if (r !== null) {
507
- var u = { error: r, resetErrorBoundary: this.resetErrorBoundary };
508
- if (oe.isValidElement(c)) return c;
509
- if (typeof s == "function") return s(u);
510
- if (l) return oe.createElement(l, u);
508
+ var c = { error: r, resetErrorBoundary: this.resetErrorBoundary };
509
+ if (oe.isValidElement(u)) return u;
510
+ if (typeof i == "function") return i(c);
511
+ if (l) return oe.createElement(l, c);
511
512
  throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop");
512
513
  }
513
514
  return this.props.children;
514
515
  }, o;
515
516
  }(oe.Component);
516
- function Fn({ children: t, onError: e }) {
517
- return h(On, { fallback: h("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: t });
517
+ function Fn({ children: n, onError: e }) {
518
+ return h(On, { fallback: h("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: n });
518
519
  }
519
520
  const Kn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? j : _;
520
- function zn({ ignoreHistoryMergeTagChange: t = !0, ignoreSelectionChange: e = !1, onChange: n }) {
521
+ function zn({ ignoreHistoryMergeTagChange: n = !0, ignoreSelectionChange: e = !1, onChange: t }) {
521
522
  const [o] = P();
522
523
  return Kn(() => {
523
- if (n) return o.registerUpdateListener(({ editorState: i, dirtyElements: r, dirtyLeaves: a, prevEditorState: s, tags: l }) => {
524
- e && r.size === 0 && a.size === 0 || t && l.has("history-merge") || s.isEmpty() || n(i, o, l);
524
+ if (t) return o.registerUpdateListener(({ editorState: a, dirtyElements: r, dirtyLeaves: s, prevEditorState: i, tags: l }) => {
525
+ e && r.size === 0 && s.size === 0 || n && l.has("history-merge") || i.isEmpty() || t(a, o, l);
525
526
  });
526
- }, [o, t, e, n]), null;
527
+ }, [o, n, e, t]), null;
527
528
  }
528
529
  function An() {
529
- const [t] = P();
530
+ const [n] = P();
530
531
  return _(() => {
531
- if (!t.hasNodes([Ae, Be])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
532
- }, [t]), function(e) {
532
+ if (!n.hasNodes([Ae, Be])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
533
+ }, [n]), function(e) {
533
534
  _(() => jt(e), [e]);
534
- }(t), null;
535
+ }(n), null;
535
536
  }
536
- function Bn({ validateUrl: t, attributes: e }) {
537
- const [n] = P();
537
+ function Bn({ validateUrl: n, attributes: e }) {
538
+ const [t] = P();
538
539
  return _(() => {
539
- if (!n.hasNodes([je])) throw new Error("LinkPlugin: LinkNode not registered on editor");
540
- return U(n.registerCommand(we, (o) => {
541
- if (o === null) return ie(o), !0;
542
- if (typeof o == "string") return !(t !== void 0 && !t(o)) && (ie(o, e), !0);
540
+ if (!t.hasNodes([je])) throw new Error("LinkPlugin: LinkNode not registered on editor");
541
+ return U(t.registerCommand(we, (o) => {
542
+ if (o === null) return ae(o), !0;
543
+ if (typeof o == "string") return !(n !== void 0 && !n(o)) && (ae(o, e), !0);
543
544
  {
544
- const { url: i, target: r, rel: a, title: s } = o;
545
- return ie(i, { ...e, rel: a, target: r, title: s }), !0;
545
+ const { url: a, target: r, rel: s, title: i } = o;
546
+ return ae(a, { ...e, rel: s, target: r, title: i }), !0;
546
547
  }
547
- }, he), t !== void 0 ? n.registerCommand(Ie, (o) => {
548
- const i = p();
549
- if (!g(i) || i.isCollapsed() || !z(o, ClipboardEvent)) return !1;
548
+ }, he), n !== void 0 ? t.registerCommand(Ie, (o) => {
549
+ const a = p();
550
+ if (!g(a) || a.isCollapsed() || !z(o, ClipboardEvent)) return !1;
550
551
  const r = o;
551
552
  if (r.clipboardData === null) return !1;
552
- const a = r.clipboardData.getData("text");
553
- return !!t(a) && !i.getNodes().some((s) => V(s)) && (n.dispatchCommand(we, { ...e, url: a }), o.preventDefault(), !0);
553
+ const s = r.clipboardData.getData("text");
554
+ return !!n(s) && !a.getNodes().some((i) => V(i)) && (t.dispatchCommand(we, { ...e, url: s }), o.preventDefault(), !0);
554
555
  }, he) : () => {
555
556
  });
556
- }, [n, t, e]), null;
557
+ }, [t, n, e]), null;
557
558
  }
558
- function jn({ newTab: t = !0, disabled: e = !1 }) {
559
- const [n] = P();
559
+ function jn({ newTab: n = !0, disabled: e = !1 }) {
560
+ const [t] = P();
560
561
  return _(() => {
561
562
  const o = (r) => {
562
- const a = r.target;
563
- if (!Oe(a)) return;
564
- const s = Dt(a);
565
- if (s === null) return;
566
- let l = null, c = null;
567
- if (s.update(() => {
568
- const f = ne(a);
563
+ const s = r.target;
564
+ if (!Oe(s)) return;
565
+ const i = Dt(s);
566
+ if (i === null) return;
567
+ let l = null, u = null;
568
+ if (i.update(() => {
569
+ const f = ne(s);
569
570
  if (f !== null) {
570
- const v = de(f, V);
571
- if (!e) if (Ut(v)) l = v.sanitizeUrl(v.getURL()), c = v.getTarget();
571
+ const C = de(f, V);
572
+ if (!e) if (Ut(C)) l = C.sanitizeUrl(C.getURL()), u = C.getTarget();
572
573
  else {
573
- const C = function(w, k) {
574
- let y = w;
575
- for (; y != null; ) {
576
- if (k(y)) return y;
577
- y = y.parentNode;
574
+ const y = function(w, k) {
575
+ let E = w;
576
+ for (; E != null; ) {
577
+ if (k(E)) return E;
578
+ E = E.parentNode;
578
579
  }
579
580
  return null;
580
- }(a, Pt);
581
- C !== null && (l = C.href, c = C.target);
581
+ }(s, Pt);
582
+ y !== null && (l = y.href, u = y.target);
582
583
  }
583
584
  }
584
585
  }), l === null || l === "") return;
585
- const u = n.getEditorState().read(p);
586
- if (g(u) && !u.isCollapsed()) return void r.preventDefault();
586
+ const c = t.getEditorState().read(p);
587
+ if (g(c) && !c.isCollapsed()) return void r.preventDefault();
587
588
  const d = r.type === "auxclick" && r.button === 1;
588
- window.open(l, t || d || r.metaKey || r.ctrlKey || c === "_blank" ? "_blank" : "_self"), r.preventDefault();
589
- }, i = (r) => {
589
+ window.open(l, n || d || r.metaKey || r.ctrlKey || u === "_blank" ? "_blank" : "_self"), r.preventDefault();
590
+ }, a = (r) => {
590
591
  r.button === 1 && o(r);
591
592
  };
592
- return n.registerRootListener((r, a) => {
593
- a !== null && (a.removeEventListener("click", o), a.removeEventListener("mouseup", i)), r !== null && (r.addEventListener("click", o), r.addEventListener("mouseup", i));
593
+ return t.registerRootListener((r, s) => {
594
+ s !== null && (s.removeEventListener("click", o), s.removeEventListener("mouseup", a)), r !== null && (r.addEventListener("click", o), r.addEventListener("mouseup", a));
594
595
  });
595
- }, [n, t, e]), null;
596
- }
597
- const te = 0, ce = 1, ue = 2, D = 0, Un = 1, De = 2, qn = 3, Hn = 4;
598
- function Vn(t, e, n, o, i) {
599
- if (t === null || n.size === 0 && o.size === 0 && !i) return D;
600
- const r = e._selection, a = t._selection;
601
- if (i) return Un;
602
- if (!(g(r) && g(a) && a.isCollapsed() && r.isCollapsed())) return D;
603
- const s = function(y, E, $) {
604
- const x = y._nodeMap, b = [];
605
- for (const N of E) {
596
+ }, [t, n, e]), null;
597
+ }
598
+ const te = 0, ue = 1, ce = 2, D = 0, Un = 1, De = 2, qn = 3, Hn = 4;
599
+ function Vn(n, e, t, o, a) {
600
+ if (n === null || t.size === 0 && o.size === 0 && !a) return D;
601
+ const r = e._selection, s = n._selection;
602
+ if (a) return Un;
603
+ if (!(g(r) && g(s) && s.isCollapsed() && r.isCollapsed())) return D;
604
+ const i = function(E, v, $) {
605
+ const x = E._nodeMap, b = [];
606
+ for (const N of v) {
606
607
  const S = x.get(N);
607
608
  S !== void 0 && b.push(S);
608
609
  }
@@ -612,102 +613,102 @@ function Vn(t, e, n, o, i) {
612
613
  T === void 0 || Fe(T) || b.push(T);
613
614
  }
614
615
  return b;
615
- }(e, n, o);
616
- if (s.length === 0) return D;
617
- if (s.length > 1) {
618
- const y = e._nodeMap, E = y.get(r.anchor.key), $ = y.get(a.anchor.key);
619
- return E && $ && !t._nodeMap.has(E.__key) && M(E) && E.__text.length === 1 && r.anchor.offset === 1 ? De : D;
616
+ }(e, t, o);
617
+ if (i.length === 0) return D;
618
+ if (i.length > 1) {
619
+ const E = e._nodeMap, v = E.get(r.anchor.key), $ = E.get(s.anchor.key);
620
+ return v && $ && !n._nodeMap.has(v.__key) && M(v) && v.__text.length === 1 && r.anchor.offset === 1 ? De : D;
620
621
  }
621
- const l = s[0], c = t._nodeMap.get(l.__key);
622
- if (!M(c) || !M(l) || c.__mode !== l.__mode) return D;
623
- const u = c.__text, d = l.__text;
624
- if (u === d) return D;
625
- const f = r.anchor, v = a.anchor;
626
- if (f.key !== v.key || f.type !== "text") return D;
627
- const C = f.offset, w = v.offset, k = d.length - u.length;
628
- return k === 1 && w === C - 1 ? De : k === -1 && w === C + 1 ? qn : k === -1 && w === C ? Hn : D;
629
- }
630
- function Wn(t, e) {
631
- let n = Date.now(), o = D;
632
- return (i, r, a, s, l, c) => {
633
- const u = Date.now();
634
- if (c.has("historic")) return o = D, n = u, ue;
635
- const d = Vn(i, r, s, l, t.isComposing()), f = (() => {
636
- const v = a === null || a.editor === t, C = c.has("history-push");
637
- if (!C && v && c.has("history-merge")) return te;
638
- if (i === null) return ce;
622
+ const l = i[0], u = n._nodeMap.get(l.__key);
623
+ if (!M(u) || !M(l) || u.__mode !== l.__mode) return D;
624
+ const c = u.__text, d = l.__text;
625
+ if (c === d) return D;
626
+ const f = r.anchor, C = s.anchor;
627
+ if (f.key !== C.key || f.type !== "text") return D;
628
+ const y = f.offset, w = C.offset, k = d.length - c.length;
629
+ return k === 1 && w === y - 1 ? De : k === -1 && w === y + 1 ? qn : k === -1 && w === y ? Hn : D;
630
+ }
631
+ function Wn(n, e) {
632
+ let t = Date.now(), o = D;
633
+ return (a, r, s, i, l, u) => {
634
+ const c = Date.now();
635
+ if (u.has("historic")) return o = D, t = c, ce;
636
+ const d = Vn(a, r, i, l, n.isComposing()), f = (() => {
637
+ const C = s === null || s.editor === n, y = u.has("history-push");
638
+ if (!y && C && u.has("history-merge")) return te;
639
+ if (a === null) return ue;
639
640
  const w = r._selection;
640
- return s.size > 0 || l.size > 0 ? C === !1 && d !== D && d === o && u < n + e && v || s.size === 1 && function(k, y, E) {
641
- const $ = y._nodeMap.get(k), x = E._nodeMap.get(k), b = y._selection, N = E._selection;
642
- return !(g(b) && g(N) && b.anchor.type === "element" && b.focus.type === "element" && N.anchor.type === "text" && N.focus.type === "text" || !M($) || !M(x) || $.__parent !== x.__parent) && JSON.stringify(y.read(() => $.exportJSON())) === JSON.stringify(E.read(() => x.exportJSON()));
643
- }(Array.from(s)[0], i, r) ? te : ce : w !== null ? te : ue;
641
+ return i.size > 0 || l.size > 0 ? y === !1 && d !== D && d === o && c < t + e && C || i.size === 1 && function(k, E, v) {
642
+ const $ = E._nodeMap.get(k), x = v._nodeMap.get(k), b = E._selection, N = v._selection;
643
+ return !(g(b) && g(N) && b.anchor.type === "element" && b.focus.type === "element" && N.anchor.type === "text" && N.focus.type === "text" || !M($) || !M(x) || $.__parent !== x.__parent) && JSON.stringify(E.read(() => $.exportJSON())) === JSON.stringify(v.read(() => x.exportJSON()));
644
+ }(Array.from(i)[0], a, r) ? te : ue : w !== null ? te : ce;
644
645
  })();
645
- return n = u, o = d, f;
646
+ return t = c, o = d, f;
646
647
  };
647
648
  }
648
- function Pe(t) {
649
- t.undoStack = [], t.redoStack = [], t.current = null;
649
+ function Pe(n) {
650
+ n.undoStack = [], n.redoStack = [], n.current = null;
650
651
  }
651
- function Jn(t, e, n) {
652
- const o = Wn(t, n);
653
- return U(t.registerCommand(It, () => (function(r, a) {
654
- const s = a.redoStack, l = a.undoStack;
652
+ function Jn(n, e, t) {
653
+ const o = Wn(n, t);
654
+ return U(n.registerCommand(It, () => (function(r, s) {
655
+ const i = s.redoStack, l = s.undoStack;
655
656
  if (l.length !== 0) {
656
- const c = a.current, u = l.pop();
657
- c !== null && (s.push(c), r.dispatchCommand(G, !0)), l.length === 0 && r.dispatchCommand(Y, !1), a.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: "historic" });
657
+ const u = s.current, c = l.pop();
658
+ u !== null && (i.push(u), r.dispatchCommand(G, !0)), l.length === 0 && r.dispatchCommand(Y, !1), s.current = c || null, c && c.editor.setEditorState(c.editorState, { tag: "historic" });
658
659
  }
659
- }(t, e), !0), m), t.registerCommand(Mt, () => (function(r, a) {
660
- const s = a.redoStack, l = a.undoStack;
661
- if (s.length !== 0) {
662
- const c = a.current;
663
- c !== null && (l.push(c), r.dispatchCommand(Y, !0));
664
- const u = s.pop();
665
- s.length === 0 && r.dispatchCommand(G, !1), a.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: "historic" });
660
+ }(n, e), !0), m), n.registerCommand(Mt, () => (function(r, s) {
661
+ const i = s.redoStack, l = s.undoStack;
662
+ if (i.length !== 0) {
663
+ const u = s.current;
664
+ u !== null && (l.push(u), r.dispatchCommand(Y, !0));
665
+ const c = i.pop();
666
+ i.length === 0 && r.dispatchCommand(G, !1), s.current = c || null, c && c.editor.setEditorState(c.editorState, { tag: "historic" });
666
667
  }
667
- }(t, e), !0), m), t.registerCommand(Rt, () => (Pe(e), !1), m), t.registerCommand(Tt, () => (Pe(e), t.dispatchCommand(G, !1), t.dispatchCommand(Y, !1), !0), m), t.registerUpdateListener(({ editorState: r, prevEditorState: a, dirtyLeaves: s, dirtyElements: l, tags: c }) => {
668
- const u = e.current, d = e.redoStack, f = e.undoStack, v = u === null ? null : u.editorState;
669
- if (u !== null && r === v) return;
670
- const C = o(a, r, u, s, l, c);
671
- if (C === ce) d.length !== 0 && (e.redoStack = [], t.dispatchCommand(G, !1)), u !== null && (f.push({ ...u }), t.dispatchCommand(Y, !0));
672
- else if (C === ue) return;
673
- e.current = { editor: t, editorState: r };
668
+ }(n, e), !0), m), n.registerCommand(Rt, () => (Pe(e), !1), m), n.registerCommand(Tt, () => (Pe(e), n.dispatchCommand(G, !1), n.dispatchCommand(Y, !1), !0), m), n.registerUpdateListener(({ editorState: r, prevEditorState: s, dirtyLeaves: i, dirtyElements: l, tags: u }) => {
669
+ const c = e.current, d = e.redoStack, f = e.undoStack, C = c === null ? null : c.editorState;
670
+ if (c !== null && r === C) return;
671
+ const y = o(s, r, c, i, l, u);
672
+ if (y === ue) d.length !== 0 && (e.redoStack = [], n.dispatchCommand(G, !1)), c !== null && (f.push({ ...c }), n.dispatchCommand(Y, !0));
673
+ else if (y === ce) return;
674
+ e.current = { editor: n, editorState: r };
674
675
  }));
675
676
  }
676
677
  function Xn() {
677
678
  return { current: null, redoStack: [], undoStack: [] };
678
679
  }
679
- function Gn({ delay: t, externalHistoryState: e }) {
680
- const [n] = P();
681
- return function(o, i, r = 1e3) {
682
- const a = W(() => i || Xn(), [i]);
683
- _(() => Jn(o, a, r), [r, o, a]);
684
- }(n, e, t), null;
680
+ function Gn({ delay: n, externalHistoryState: e }) {
681
+ const [t] = P();
682
+ return function(o, a, r = 1e3) {
683
+ const s = W(() => a || Xn(), [a]);
684
+ _(() => Jn(o, s, r), [r, o, s]);
685
+ }(t, e, n), null;
685
686
  }
686
- function Yn({ hasCellMerge: t = !0, hasCellBackgroundColor: e = !0, hasTabHandler: n = !0, hasHorizontalScroll: o = !1 }) {
687
- const [i] = P();
687
+ function Yn({ hasCellMerge: n = !0, hasCellBackgroundColor: e = !0, hasTabHandler: t = !0, hasHorizontalScroll: o = !1 }) {
688
+ const [a] = P();
688
689
  return _(() => {
689
- Ht(i, o);
690
- }, [i, o]), _(() => Vt(i), [i]), _(() => Wt(i, n), [i, n]), _(() => {
691
- if (!t) return Jt(i);
692
- }, [i, t]), _(() => {
693
- if (!e) return i.registerNodeTransform(Ue, (r) => {
690
+ Ht(a, o);
691
+ }, [a, o]), _(() => Vt(a), [a]), _(() => Wt(a, t), [a, t]), _(() => {
692
+ if (!n) return Jt(a);
693
+ }, [a, n]), _(() => {
694
+ if (!e) return a.registerNodeTransform(Ue, (r) => {
694
695
  r.getBackgroundColor() !== null && r.setBackgroundColor(null);
695
696
  });
696
- }, [i, e, t]), null;
697
+ }, [a, e, n]), null;
697
698
  }
698
699
  const We = 200, Zn = ({
699
- currentLanguage: t = "NL",
700
+ currentLanguage: n = "NL",
700
701
  initialValue: e = "",
701
- placeholder: n = "",
702
+ placeholder: t = "",
702
703
  label: o = "",
703
- info: i = "",
704
+ info: a = "",
704
705
  required: r = !1,
705
- notValidatedText: a = "",
706
- maxHeightInRem: s = "20rem",
706
+ notValidatedText: s = "",
707
+ maxHeightInRem: i = "20rem",
707
708
  maxWords: l = We,
708
- onChange: c
709
+ onChange: u
709
710
  }) => {
710
- const { switchLanguage: u } = un(), d = an(), [f] = I(() => Re()), [v, C] = I(0), [w, k] = I(0), y = Ke(null), E = {
711
+ const { switchLanguage: c } = cn(), d = an(), [f] = I(() => Re()), [C, y] = I(0), [w, k] = I(0), E = Ke(null), v = {
711
712
  html: {
712
713
  export: tn
713
714
  },
@@ -734,24 +735,24 @@ const We = 200, Zn = ({
734
735
  }, $ = (b) => b.trim().length === 0 ? 0 : b.split(" ").length, x = (b, N) => {
735
736
  b.read(() => {
736
737
  let S = "";
737
- C($(A().getTextContent().replace(/\s+/g, " ").trim())), S = rn(Bt(N)), c(S);
738
+ y($(A().getTextContent().replace(/\s+/g, " ").trim())), S = rn(Bt(N)), u(S);
738
739
  });
739
740
  };
740
741
  return _(() => {
741
- u(t.toLocaleLowerCase());
742
- }, [t, u]), _(() => {
742
+ c(n.toLocaleLowerCase());
743
+ }, [n, c]), _(() => {
743
744
  const b = e.replace(/<br\s*\/?>|&nbsp;/gi, " ").replace(/<\/?[^>]+(>|$)|&[a-z]+;/g, "").replace(/\s+/g, " ").trim();
744
- C($(b));
745
+ y($(b));
745
746
  }, []), /* @__PURE__ */ K("div", { className: R.editor__container, children: [
746
747
  /* @__PURE__ */ K("div", { className: R.editor__header, children: [
747
- /* @__PURE__ */ h(cn, { label: o, info: i, required: r }),
748
+ /* @__PURE__ */ h(un, { label: o, info: a, required: r }),
748
749
  /* @__PURE__ */ K("div", { className: R["editor__header-word-count"], children: [
749
- /* @__PURE__ */ h("span", { className: en({ [R["editor__header-word-count--alert"]]: v > l }), children: v }),
750
+ /* @__PURE__ */ h("span", { className: en({ [R["editor__header-word-count--alert"]]: C > l }), children: C }),
750
751
  " / ",
751
752
  l
752
753
  ] })
753
754
  ] }),
754
- /* @__PURE__ */ h("div", { className: R.editor, children: /* @__PURE__ */ K(pn, { initialConfig: E, children: [
755
+ /* @__PURE__ */ h("div", { className: R.editor, children: /* @__PURE__ */ K(pn, { initialConfig: v, children: [
755
756
  /* @__PURE__ */ h(on, { editorScrollPosition: w }),
756
757
  /* @__PURE__ */ K("div", { className: R["editor__field-wrapper"], children: [
757
758
  /* @__PURE__ */ h(
@@ -762,17 +763,17 @@ const We = 200, Zn = ({
762
763
  {
763
764
  className: R.editor__field,
764
765
  "aria-label": d.common.rteAriaLabel,
765
- "aria-placeholder": n,
766
+ "aria-placeholder": t,
766
767
  title: d.common.rteTitle,
767
- placeholder: /* @__PURE__ */ h("div", { className: R.editor__placeholder, children: n }),
768
+ placeholder: /* @__PURE__ */ h("div", { className: R.editor__placeholder, children: t }),
768
769
  spellCheck: !1,
769
770
  id: "rteEditor",
770
- style: { height: `${s}`, maxHeight: `${s}` },
771
+ style: { height: `${i}`, maxHeight: `${i}` },
771
772
  onScroll: (b) => k(b.currentTarget.scrollTop),
772
- ref: y
773
+ ref: E
773
774
  }
774
775
  ),
775
- placeholder: /* @__PURE__ */ h("div", { className: R.editor__placeholder, children: n }),
776
+ placeholder: /* @__PURE__ */ h("div", { className: R.editor__placeholder, children: t }),
776
777
  ErrorBoundary: Fn
777
778
  }
778
779
  ),
@@ -786,34 +787,34 @@ const We = 200, Zn = ({
786
787
  /* @__PURE__ */ h(fn, {})
787
788
  ] })
788
789
  ] }) }),
789
- a !== "" && /* @__PURE__ */ h(sn, { level: "error", feedback: a })
790
+ s !== "" && /* @__PURE__ */ h(sn, { level: "error", feedback: s })
790
791
  ] });
791
- }, Ar = ({
792
- currentLanguage: t = "NL",
792
+ }, Br = ({
793
+ currentLanguage: n = "NL",
793
794
  initialValue: e = "",
794
- placeholder: n = "",
795
+ placeholder: t = "",
795
796
  label: o = "",
796
- info: i = "",
797
+ info: a = "",
797
798
  required: r = !1,
798
- notValidatedText: a = "",
799
- maxWords: s = We,
799
+ notValidatedText: s = "",
800
+ maxWords: i = We,
800
801
  onChange: l
801
802
  }) => /* @__PURE__ */ h(dn, { children: /* @__PURE__ */ h(
802
803
  Zn,
803
804
  {
804
- currentLanguage: t,
805
+ currentLanguage: n,
805
806
  initialValue: e,
806
- placeholder: n,
807
+ placeholder: t,
807
808
  label: o,
808
- info: i,
809
+ info: a,
809
810
  required: r,
810
- notValidatedText: a,
811
- maxWords: s,
811
+ notValidatedText: s,
812
+ maxWords: i,
812
813
  onChange: l
813
814
  }
814
815
  ) });
815
816
  export {
816
817
  Zn as Rte,
817
- Ar as RteEditor
818
+ Br as RteEditor
818
819
  };
819
820
  //# sourceMappingURL=RteEditor.js.map