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