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