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