@uva-glass/component-library 3.53.0 → 3.53.2
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-DH2XfwvA.js → Lexical.prod-Dgzi-S1E.js} +1427 -1409
- package/dist/Lexical.prod-Dgzi-S1E.js.map +1 -0
- package/dist/{LexicalClipboard.prod-DTuNvXAS.js → LexicalClipboard.prod-Dxc8c2F_.js} +86 -86
- package/dist/{LexicalClipboard.prod-DTuNvXAS.js.map → LexicalClipboard.prod-Dxc8c2F_.js.map} +1 -1
- package/dist/LexicalExtension.prod-CNBWjmfs.js +551 -0
- package/dist/LexicalExtension.prod-CNBWjmfs.js.map +1 -0
- package/dist/LexicalLink.prod-EEOzXxej.js +502 -0
- package/dist/LexicalLink.prod-EEOzXxej.js.map +1 -0
- package/dist/{LexicalList.prod-DA9du3qx.js → LexicalList.prod-DADZlhem.js} +65 -65
- package/dist/LexicalList.prod-DADZlhem.js.map +1 -0
- package/dist/{LexicalSelection.prod-mQk00-U_.js → LexicalSelection.prod-B0uiXGSS.js} +44 -44
- package/dist/LexicalSelection.prod-B0uiXGSS.js.map +1 -0
- package/dist/{LexicalTable.prod-RGq0GKAR.js → LexicalTable.prod-QpQxZNNH.js} +331 -319
- package/dist/LexicalTable.prod-QpQxZNNH.js.map +1 -0
- package/dist/{LexicalUtils.prod-DU4QwthB.js → LexicalUtils.prod-D1mwAww-.js} +39 -39
- package/dist/LexicalUtils.prod-D1mwAww-.js.map +1 -0
- package/dist/{TableCellResizerPlugin-DRwI83s2.js → TableCellResizerPlugin-9kvw_LpH.js} +57 -57
- package/dist/{TableCellResizerPlugin-DRwI83s2.js.map → TableCellResizerPlugin-9kvw_LpH.js.map} +1 -1
- package/dist/{TablePlugin-DmE96vN7.js → TablePlugin-Culqb83M.js} +67 -67
- package/dist/{TablePlugin-DmE96vN7.js.map → TablePlugin-Culqb83M.js.map} +1 -1
- package/dist/{chunk-SS2NHR7W-qmI2h7CJ.js → chunk-GPBRNGY5-BSRMHXbx.js} +3 -3
- package/dist/chunk-GPBRNGY5-BSRMHXbx.js.map +1 -0
- package/dist/{client-D4oO7Spw.js → client-DdSuZDnt.js} +93 -95
- package/dist/{client-D4oO7Spw.js.map → client-DdSuZDnt.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.d.ts +1 -1
- 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.d.ts +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 +2 -2
- package/dist/components/Chip/Chip.stories.js +1 -1
- package/dist/components/ControlsButton/ControlsButton.d.ts +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.d.ts +1 -1
- package/dist/components/IconButton/IconButton.stories.js +1 -1
- package/dist/components/InfoBanner/InfoBanner.d.ts +1 -1
- package/dist/components/InfoBanner/InfoBanner.stories.d.ts +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.d.ts +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.d.ts +2 -2
- 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.d.ts +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 +1 -1
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js +63 -63
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +7 -7
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.d.ts +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +64 -64
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +21 -21
- 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 +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.d.ts +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +29 -29
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.d.ts +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +15 -15
- package/dist/components/RteEditor/Plugins/index.js +2 -2
- package/dist/components/RteEditor/RteEditor.js +218 -215
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/RteEditor/helpers.js +5 -5
- package/dist/components/RteEditor/nodes/CourseCatalogueNode/CourseCatalogueNode.js +12 -12
- package/dist/components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js +14 -14
- package/dist/components/SectionNotification/SectionNotification.stories.d.ts +1 -1
- package/dist/components/SelectListbox/SelectListBox.stories.js +1 -1
- package/dist/components/SelectListbox/components/SelectButton.d.ts +1 -1
- package/dist/components/SelectListbox/components/SelectOption.d.ts +1 -1
- package/dist/components/Sortable/Sortable.stories.js +1 -1
- package/dist/components/Sortable/components/SortableItem.d.ts +1 -1
- package/dist/components/StatusBadge/StatusBadge.stories.d.ts +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/WeekSelector/WeekSelector.stories.d.ts +1 -1
- package/dist/components/WeekSelector/components/WeekSelectorOption.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{index-B4NxQN5d.js → index-Cfzi-sRQ.js} +333 -332
- package/dist/index-Cfzi-sRQ.js.map +1 -0
- package/dist/{index-ZQcmo1D_.js → index-DcECbqp4.js} +12 -12
- package/dist/{index-ZQcmo1D_.js.map → index-DcECbqp4.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/{react-18-BczhA0zC.js → react-18-plvLTuyc.js} +2 -2
- package/dist/{react-18-BczhA0zC.js.map → react-18-plvLTuyc.js.map} +1 -1
- package/dist/{react.esm-BDo_tPxu.js → react.esm-BpII5CMY.js} +712 -733
- package/dist/{react.esm-BDo_tPxu.js.map → react.esm-BpII5CMY.js.map} +1 -1
- package/dist/storybook__react.d.js +8 -8
- package/dist/storybook__react.d.js.map +1 -1
- package/package.json +26 -26
- package/dist/Lexical.prod-DH2XfwvA.js.map +0 -1
- package/dist/LexicalLink.prod-BV5Y2RYj.js +0 -1046
- package/dist/LexicalLink.prod-BV5Y2RYj.js.map +0 -1
- package/dist/LexicalList.prod-DA9du3qx.js.map +0 -1
- package/dist/LexicalSelection.prod-mQk00-U_.js.map +0 -1
- package/dist/LexicalTable.prod-RGq0GKAR.js.map +0 -1
- package/dist/LexicalUtils.prod-DU4QwthB.js.map +0 -1
- package/dist/chunk-SS2NHR7W-qmI2h7CJ.js.map +0 -1
- package/dist/index-B4NxQN5d.js.map +0 -1
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { jsx as f, jsxs 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 Vt, createPortal 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-Dgzi-S1E.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-9kvw_LpH.js";
|
|
7
|
+
import { B as Xt, a as ie, G as Yt, d as Re, F as qt, X as Gt } from "../../LexicalExtension.prod-CNBWjmfs.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-D1mwAww-.js";
|
|
10
|
+
import { R as pe, F as ge, m as er, g as tr } from "../../LexicalClipboard.prod-Dxc8c2F_.js";
|
|
11
|
+
import { A as he, Z as ve, n as ye } from "../../LexicalSelection.prod-B0uiXGSS.js";
|
|
12
|
+
import { l as Me, n as Ae, L as rr, b as nr } from "../../LexicalList.prod-DADZlhem.js";
|
|
13
|
+
import { y as Fe, F as or, A as Ue, l as ar, z as sr } from "../../LexicalLink.prod-EEOzXxej.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-QpQxZNNH.js";
|
|
14
15
|
import { c as Ce } from "../../clsx-OuTLNxxd.js";
|
|
15
|
-
import { exportMap as
|
|
16
|
-
import { validateUrl as
|
|
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";
|
|
17
18
|
import { s as B } from "../../RteEditor.module-DaBh86FK.js";
|
|
18
|
-
import { ToolBarPlugin as
|
|
19
|
-
import { useTranslation as
|
|
20
|
-
import "../../TablePlugin-
|
|
19
|
+
import { ToolBarPlugin as yr } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
|
|
20
|
+
import { useTranslation as Cr } from "./hooks/useTranslation.js";
|
|
21
|
+
import "../../TablePlugin-Culqb83M.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,67 +42,67 @@ 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
|
-
import { CourseCatalogueNode as
|
|
50
|
-
const
|
|
51
|
-
function
|
|
52
|
-
const t =
|
|
53
|
-
const { theme: n, namespace: o, nodes: a, onError: s, editorState: i, html: l } = r, d =
|
|
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 });
|
|
54
55
|
return (function(m, h) {
|
|
55
56
|
if (h !== null) {
|
|
56
57
|
if (h === void 0) m.update(() => {
|
|
57
58
|
const S = F();
|
|
58
59
|
if (S.isEmpty()) {
|
|
59
|
-
const y =
|
|
60
|
+
const y = Ge();
|
|
60
61
|
S.append(y);
|
|
61
|
-
const x =
|
|
62
|
+
const x = He ? document.activeElement : null;
|
|
62
63
|
(p() !== null || x !== null && x === m.getRootElement()) && y.select();
|
|
63
64
|
}
|
|
64
|
-
},
|
|
65
|
+
}, G);
|
|
65
66
|
else if (h !== null) switch (typeof h) {
|
|
66
67
|
case "string": {
|
|
67
68
|
const S = m.parseEditorState(h);
|
|
68
|
-
m.setEditorState(S,
|
|
69
|
+
m.setEditorState(S, G);
|
|
69
70
|
break;
|
|
70
71
|
}
|
|
71
72
|
case "object":
|
|
72
|
-
m.setEditorState(h,
|
|
73
|
+
m.setEditorState(h, G);
|
|
73
74
|
break;
|
|
74
75
|
case "function":
|
|
75
76
|
m.update(() => {
|
|
76
77
|
F().isEmpty() && h(m);
|
|
77
|
-
},
|
|
78
|
+
}, G);
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
81
|
})(u, i), [u, d];
|
|
81
82
|
}, []);
|
|
82
|
-
return
|
|
83
|
+
return Pr(() => {
|
|
83
84
|
const n = r.editable, [o] = t;
|
|
84
85
|
o.setEditable(n === void 0 || n);
|
|
85
|
-
}, []), f(
|
|
86
|
+
}, []), f(qe.Provider, { value: t, children: e });
|
|
86
87
|
}
|
|
87
|
-
const
|
|
88
|
-
function
|
|
88
|
+
const Tr = ae({ name: "@lexical/react/ReactProvider" });
|
|
89
|
+
function $r() {
|
|
89
90
|
return F().getTextContent();
|
|
90
91
|
}
|
|
91
|
-
function
|
|
92
|
+
function Br(r, e = !0) {
|
|
92
93
|
if (r) return !1;
|
|
93
|
-
let t =
|
|
94
|
+
let t = $r();
|
|
94
95
|
return e && (t = t.trim()), t === "";
|
|
95
96
|
}
|
|
96
|
-
function
|
|
97
|
-
if (
|
|
97
|
+
function Ir(r) {
|
|
98
|
+
if (!Br(r, !1)) return !1;
|
|
98
99
|
const e = F().getChildren(), t = e.length;
|
|
99
100
|
if (t > 1) return !1;
|
|
100
101
|
for (let n = 0; n < t; n++) {
|
|
101
102
|
const o = e[n];
|
|
102
|
-
if (
|
|
103
|
+
if (H(o)) return !1;
|
|
103
104
|
if (se(o)) {
|
|
104
|
-
if (!
|
|
105
|
+
if (!Ve(o) || o.__indent !== 0) return !1;
|
|
105
106
|
const a = o.getChildren(), s = a.length;
|
|
106
107
|
for (let i = 0; i < s; i++) {
|
|
107
108
|
const l = a[n];
|
|
@@ -111,10 +112,10 @@ function Br(r) {
|
|
|
111
112
|
}
|
|
112
113
|
return !0;
|
|
113
114
|
}
|
|
114
|
-
function
|
|
115
|
-
return () =>
|
|
115
|
+
function Oe(r) {
|
|
116
|
+
return () => Ir(r);
|
|
116
117
|
}
|
|
117
|
-
function
|
|
118
|
+
function Rr(r) {
|
|
118
119
|
const e = window.location.origin, t = (n) => {
|
|
119
120
|
if (n.origin !== e) return;
|
|
120
121
|
const o = r.getRootElement();
|
|
@@ -166,10 +167,10 @@ function be(r, e) {
|
|
|
166
167
|
}
|
|
167
168
|
return null;
|
|
168
169
|
}
|
|
169
|
-
const
|
|
170
|
-
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) {
|
|
171
172
|
let e = null;
|
|
172
|
-
if (
|
|
173
|
+
if (z(r, DragEvent) ? e = r.dataTransfer : z(r, ClipboardEvent) && (e = r.clipboardData), e === null) return [!1, [], !1];
|
|
173
174
|
const t = e.types, n = t.includes("Files"), o = t.includes("text/html") || t.includes("text/plain");
|
|
174
175
|
return [n, Array.from(e.files), o];
|
|
175
176
|
}
|
|
@@ -189,16 +190,16 @@ function Se(r) {
|
|
|
189
190
|
}
|
|
190
191
|
function xe(r) {
|
|
191
192
|
const e = re(r);
|
|
192
|
-
return
|
|
193
|
+
return H(e);
|
|
193
194
|
}
|
|
194
|
-
function
|
|
195
|
+
function Q(r) {
|
|
195
196
|
for (const e of ["lowercase", "uppercase", "capitalize"]) r.hasFormat(e) && r.toggleFormat(e);
|
|
196
197
|
}
|
|
197
|
-
function
|
|
198
|
-
return
|
|
198
|
+
function Hr(r) {
|
|
199
|
+
return W(r.registerCommand(Tt, (e) => {
|
|
199
200
|
const t = p();
|
|
200
201
|
return !!$(t) && (t.clear(), !0);
|
|
201
|
-
}, c), r.registerCommand(
|
|
202
|
+
}, c), r.registerCommand(Z, (e) => {
|
|
202
203
|
const t = p();
|
|
203
204
|
return g(t) ? (t.deleteCharacter(e), !0) : !!$(t) && (t.deleteNodes(), !0);
|
|
204
205
|
}, c), r.registerCommand(Dt, (e) => {
|
|
@@ -207,7 +208,7 @@ function zr(r) {
|
|
|
207
208
|
}, c), r.registerCommand(Pt, (e) => {
|
|
208
209
|
const t = p();
|
|
209
210
|
return !!g(t) && (t.deleteLine(e), !0);
|
|
210
|
-
}, c), r.registerCommand(
|
|
211
|
+
}, c), r.registerCommand(Lt, (e) => {
|
|
211
212
|
const t = p();
|
|
212
213
|
if (typeof e == "string") t !== null && t.insertText(e);
|
|
213
214
|
else {
|
|
@@ -220,7 +221,7 @@ function zr(r) {
|
|
|
220
221
|
}
|
|
221
222
|
}
|
|
222
223
|
return !0;
|
|
223
|
-
}, c), r.registerCommand(
|
|
224
|
+
}, c), r.registerCommand(kt, () => {
|
|
224
225
|
const e = p();
|
|
225
226
|
return !!g(e) && (e.removeText(), !0);
|
|
226
227
|
}, c), r.registerCommand(_t, (e) => {
|
|
@@ -254,7 +255,7 @@ function zr(r) {
|
|
|
254
255
|
if (n.length > 0) return e.preventDefault(), n[0].selectPrevious(), !0;
|
|
255
256
|
} else if (g(t)) {
|
|
256
257
|
const n = fe(t.focus, !0);
|
|
257
|
-
if (!e.shiftKey &&
|
|
258
|
+
if (!e.shiftKey && H(n) && !n.isIsolated() && !n.isInline()) return n.selectPrevious(), e.preventDefault(), !0;
|
|
258
259
|
}
|
|
259
260
|
return !1;
|
|
260
261
|
}, c), r.registerCommand(bt, (e) => {
|
|
@@ -268,7 +269,7 @@ function zr(r) {
|
|
|
268
269
|
return a.key === "root" && a.offset === F().getChildrenSize();
|
|
269
270
|
})(t)) return e.preventDefault(), !0;
|
|
270
271
|
const n = fe(t.focus, !1);
|
|
271
|
-
if (!e.shiftKey &&
|
|
272
|
+
if (!e.shiftKey && H(n) && !n.isIsolated() && !n.isInline()) return n.selectNext(), e.preventDefault(), !0;
|
|
272
273
|
}
|
|
273
274
|
return !1;
|
|
274
275
|
}, c), r.registerCommand(Ct, (e) => {
|
|
@@ -302,21 +303,21 @@ function zr(r) {
|
|
|
302
303
|
if (o.offset !== 0) return !1;
|
|
303
304
|
const a = o.getNode();
|
|
304
305
|
if (Te(a)) return !1;
|
|
305
|
-
const s =
|
|
306
|
+
const s = Qt(a);
|
|
306
307
|
return s.getIndent() > 0 && (s.is(a) || a.is(s.getFirstDescendant()));
|
|
307
308
|
})(t)) return e.preventDefault(), r.dispatchCommand(ce, void 0);
|
|
308
309
|
if (Ee && navigator.language === "ko-KR") return !1;
|
|
309
310
|
} else if (!$(t)) return !1;
|
|
310
|
-
return e.preventDefault(), r.dispatchCommand(
|
|
311
|
+
return e.preventDefault(), r.dispatchCommand(Z, !0);
|
|
311
312
|
}, c), r.registerCommand(ht, (e) => {
|
|
312
313
|
if (xe(e.target)) return !1;
|
|
313
314
|
const t = p();
|
|
314
|
-
return !(!g(t) && !$(t)) && (e.preventDefault(), r.dispatchCommand(
|
|
315
|
+
return !(!g(t) && !$(t)) && (e.preventDefault(), r.dispatchCommand(Z, !1));
|
|
315
316
|
}, c), r.registerCommand(gt, (e) => {
|
|
316
317
|
const t = p();
|
|
317
318
|
if (!g(t)) return !1;
|
|
318
|
-
if (
|
|
319
|
-
if ((Ee ||
|
|
319
|
+
if (Q(t), e !== null) {
|
|
320
|
+
if ((Ee || Ur || Kr) && Fr) return !1;
|
|
320
321
|
if (e.preventDefault(), e.shiftKey) return r.dispatchCommand(ue, !1);
|
|
321
322
|
}
|
|
322
323
|
return r.dispatchCommand(de, void 0);
|
|
@@ -324,7 +325,7 @@ function zr(r) {
|
|
|
324
325
|
const e = p();
|
|
325
326
|
return !!g(e) && (r.blur(), !0);
|
|
326
327
|
}, c), r.registerCommand(ct, (e) => {
|
|
327
|
-
const [, t] =
|
|
328
|
+
const [, t] = V(e);
|
|
328
329
|
if (t.length > 0) {
|
|
329
330
|
const o = be(e.clientX, e.clientY);
|
|
330
331
|
if (o !== null) {
|
|
@@ -346,36 +347,36 @@ function zr(r) {
|
|
|
346
347
|
const n = p();
|
|
347
348
|
return !!g(n);
|
|
348
349
|
}, c), r.registerCommand(dt, (e) => {
|
|
349
|
-
const [t] =
|
|
350
|
+
const [t] = V(e), n = p();
|
|
350
351
|
return !(t && !g(n));
|
|
351
352
|
}, c), r.registerCommand(ut, (e) => {
|
|
352
|
-
const [t] =
|
|
353
|
+
const [t] = V(e), n = p();
|
|
353
354
|
if (t && !g(n)) return !1;
|
|
354
355
|
const o = be(e.clientX, e.clientY);
|
|
355
356
|
if (o !== null) {
|
|
356
357
|
const a = re(o.node);
|
|
357
|
-
|
|
358
|
+
H(a) && e.preventDefault();
|
|
358
359
|
}
|
|
359
360
|
return !0;
|
|
360
|
-
}, c), r.registerCommand(it, () => (lt(), !0), c), r.registerCommand(st, (e) => (ge(r,
|
|
361
|
-
await ge(n,
|
|
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) {
|
|
362
|
+
await ge(n, z(t, ClipboardEvent) ? t : null), n.update(() => {
|
|
362
363
|
const o = p();
|
|
363
364
|
g(o) ? o.removeText() : $(o) && o.getNodes().forEach((a) => a.remove());
|
|
364
365
|
});
|
|
365
366
|
})(e, r), !0), c), r.registerCommand(et, (e) => {
|
|
366
|
-
const [, t, n] =
|
|
367
|
+
const [, t, n] = V(e);
|
|
367
368
|
return t.length > 0 && !n ? (r.dispatchCommand(we, t), !0) : rt(e.target) && nt(e.target) ? !1 : p() !== null && ((function(o, a) {
|
|
368
369
|
o.preventDefault(), a.update(() => {
|
|
369
|
-
const s = p(), i =
|
|
370
|
+
const s = p(), i = z(o, InputEvent) || z(o, KeyboardEvent) ? null : o.clipboardData;
|
|
370
371
|
i != null && s !== null && pe(i, s, a);
|
|
371
372
|
}, { tag: ot });
|
|
372
373
|
})(e, r), !0);
|
|
373
|
-
}, c), r.registerCommand(Ve, (e) => {
|
|
374
|
-
const t = p();
|
|
375
|
-
return g(t) && V(t), !1;
|
|
376
374
|
}, c), r.registerCommand(Qe, (e) => {
|
|
377
375
|
const t = p();
|
|
378
|
-
return g(t) &&
|
|
376
|
+
return g(t) && Q(t), !1;
|
|
377
|
+
}, c), r.registerCommand(Ze, (e) => {
|
|
378
|
+
const t = p();
|
|
379
|
+
return g(t) && Q(t), !1;
|
|
379
380
|
}, c));
|
|
380
381
|
}
|
|
381
382
|
function Or(r, ...e) {
|
|
@@ -384,54 +385,54 @@ function Or(r, ...e) {
|
|
|
384
385
|
for (const o of e) n.append("v", o);
|
|
385
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.`);
|
|
386
387
|
}
|
|
387
|
-
const le = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ?
|
|
388
|
-
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 }) {
|
|
389
390
|
return (function(t, n) {
|
|
390
|
-
const [o, a] =
|
|
391
|
+
const [o, a] = M(() => t.getDecorators());
|
|
391
392
|
return le(() => t.registerDecoratorListener((s) => {
|
|
392
393
|
Vt(() => {
|
|
393
394
|
a(s);
|
|
394
395
|
});
|
|
395
396
|
}), [t]), b(() => {
|
|
396
397
|
a(t.getDecorators());
|
|
397
|
-
}, [t]),
|
|
398
|
+
}, [t]), O(() => {
|
|
398
399
|
const s = [], i = Object.keys(o);
|
|
399
400
|
for (let l = 0; l < i.length; l++) {
|
|
400
|
-
const d = i[l], u = f(n, { onError: (h) => t._onError(h), children: f(
|
|
401
|
-
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));
|
|
402
403
|
}
|
|
403
404
|
return s;
|
|
404
405
|
}, [n, o, t]);
|
|
405
406
|
})(r, e);
|
|
406
407
|
}
|
|
407
|
-
function
|
|
408
|
+
function Wr({ editor: r, ErrorBoundary: e }) {
|
|
408
409
|
return (function(t) {
|
|
409
|
-
const n =
|
|
410
|
-
if (n && n.hasExtensionByName(
|
|
410
|
+
const n = Xt.maybeFromEditor(t);
|
|
411
|
+
if (n && n.hasExtensionByName(Tr.name)) {
|
|
411
412
|
for (const o of ["@lexical/plain-text", "@lexical/rich-text"]) n.hasExtensionByName(o) && Or(320, o);
|
|
412
413
|
return !0;
|
|
413
414
|
}
|
|
414
415
|
return !1;
|
|
415
|
-
})(r) ? null : f(
|
|
416
|
+
})(r) ? null : f(jr, { editor: r, ErrorBoundary: e });
|
|
416
417
|
}
|
|
417
418
|
function Ne(r) {
|
|
418
|
-
return r.getEditorState().read(
|
|
419
|
+
return r.getEditorState().read(Oe(r.isComposing()));
|
|
419
420
|
}
|
|
420
|
-
function
|
|
421
|
+
function Jr({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
|
|
421
422
|
const [n] = D();
|
|
422
423
|
return (function(o) {
|
|
423
|
-
le(() =>
|
|
424
|
-
})(n),
|
|
424
|
+
le(() => W(Hr(o), Rr(o)), [o]);
|
|
425
|
+
})(n), A(Le, { children: [r, f(Xr, { content: e }), f(Wr, { editor: n, ErrorBoundary: t })] });
|
|
425
426
|
}
|
|
426
|
-
function
|
|
427
|
+
function Xr({ content: r }) {
|
|
427
428
|
const [e] = D(), t = (function(o) {
|
|
428
|
-
const [a, s] =
|
|
429
|
+
const [a, s] = M(() => Ne(o));
|
|
429
430
|
return le(() => {
|
|
430
431
|
function i() {
|
|
431
432
|
const l = Ne(o);
|
|
432
433
|
s(l);
|
|
433
434
|
}
|
|
434
|
-
return i(),
|
|
435
|
+
return i(), W(o.registerUpdateListener(() => {
|
|
435
436
|
i();
|
|
436
437
|
}), o.registerEditableListener(() => {
|
|
437
438
|
i();
|
|
@@ -440,54 +441,54 @@ function Jr({ content: r }) {
|
|
|
440
441
|
})(e), n = Wt();
|
|
441
442
|
return t ? typeof r == "function" ? r(n) : r : null;
|
|
442
443
|
}
|
|
443
|
-
const je = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ?
|
|
444
|
-
function
|
|
445
|
-
const [w, R] =
|
|
446
|
-
|
|
447
|
-
}, [r]),
|
|
448
|
-
return (
|
|
449
|
-
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);
|
|
450
451
|
};
|
|
451
|
-
})(
|
|
452
|
-
return je(() => (R(r.isEditable()), r.registerEditableListener((
|
|
453
|
-
R(
|
|
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:
|
|
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 });
|
|
455
456
|
}
|
|
456
|
-
const
|
|
457
|
+
const qr = Ie(Yr);
|
|
457
458
|
function _e(r) {
|
|
458
|
-
return r.getEditorState().read(
|
|
459
|
+
return r.getEditorState().read(Oe(r.isComposing()));
|
|
459
460
|
}
|
|
460
|
-
const
|
|
461
|
-
function
|
|
461
|
+
const Gr = Ie(Vr);
|
|
462
|
+
function Vr(r, e) {
|
|
462
463
|
const { placeholder: t, ...n } = r, [o] = D();
|
|
463
|
-
return
|
|
464
|
+
return A(Le, { children: [f(qr, { editor: o, ...n, ref: e }), t != null && f(Zr, { editor: o, content: t })] });
|
|
464
465
|
}
|
|
465
466
|
function Zr({ content: r, editor: e }) {
|
|
466
467
|
const t = (function(s) {
|
|
467
|
-
const [i, l] =
|
|
468
|
+
const [i, l] = M(() => _e(s));
|
|
468
469
|
return je(() => {
|
|
469
470
|
function d() {
|
|
470
471
|
const u = _e(s);
|
|
471
472
|
l(u);
|
|
472
473
|
}
|
|
473
|
-
return d(),
|
|
474
|
+
return d(), W(s.registerUpdateListener(() => {
|
|
474
475
|
d();
|
|
475
476
|
}), s.registerEditableListener(() => {
|
|
476
477
|
d();
|
|
477
478
|
}));
|
|
478
479
|
}, [s]), i;
|
|
479
|
-
})(e), [n, o] =
|
|
480
|
-
if (
|
|
480
|
+
})(e), [n, o] = M(e.isEditable());
|
|
481
|
+
if (j(() => (o(e.isEditable()), e.registerEditableListener((s) => {
|
|
481
482
|
o(s);
|
|
482
483
|
})), [e]), !t) return null;
|
|
483
484
|
let a = null;
|
|
484
485
|
return typeof r == "function" ? a = r(n) : r !== null && (a = r), a === null ? null : f("div", { "aria-hidden": !0, children: a });
|
|
485
486
|
}
|
|
486
|
-
const Qr =
|
|
487
|
+
const Qr = Ot(null), ee = {
|
|
487
488
|
didCatch: !1,
|
|
488
489
|
error: null
|
|
489
490
|
};
|
|
490
|
-
class
|
|
491
|
+
class en extends Ht {
|
|
491
492
|
constructor(e) {
|
|
492
493
|
super(e), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = ee;
|
|
493
494
|
}
|
|
@@ -520,7 +521,7 @@ class Vr extends Ot {
|
|
|
520
521
|
} = this.state, {
|
|
521
522
|
resetKeys: o
|
|
522
523
|
} = this.props;
|
|
523
|
-
if (n && t.error !== null &&
|
|
524
|
+
if (n && t.error !== null && tn(e.resetKeys, o)) {
|
|
524
525
|
var a, s;
|
|
525
526
|
(a = (s = this.props).onReset) === null || a === void 0 || a.call(s, {
|
|
526
527
|
next: o,
|
|
@@ -563,70 +564,70 @@ class Vr extends Ot {
|
|
|
563
564
|
}, i);
|
|
564
565
|
}
|
|
565
566
|
}
|
|
566
|
-
function
|
|
567
|
+
function tn() {
|
|
567
568
|
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
|
|
568
569
|
return r.length !== e.length || r.some((t, n) => !Object.is(t, e[n]));
|
|
569
570
|
}
|
|
570
|
-
function
|
|
571
|
-
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 });
|
|
572
573
|
}
|
|
573
|
-
const
|
|
574
|
-
function
|
|
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 }) {
|
|
575
576
|
const [n] = D();
|
|
576
|
-
return
|
|
577
|
+
return nn(() => {
|
|
577
578
|
if (t) return n.registerUpdateListener(({ editorState: o, dirtyElements: a, dirtyLeaves: s, prevEditorState: i, tags: l }) => {
|
|
578
579
|
e && a.size === 0 && s.size === 0 || r && l.has(oe) || i.isEmpty() || t(o, n, l);
|
|
579
580
|
});
|
|
580
581
|
}, [n, r, e, t]), null;
|
|
581
582
|
}
|
|
582
|
-
function
|
|
583
|
+
function an({ hasStrictIndent: r = !1 }) {
|
|
583
584
|
const [e] = D();
|
|
584
585
|
return b(() => {
|
|
585
|
-
if (!e.hasNodes([
|
|
586
|
+
if (!e.hasNodes([Me, Ae])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
|
|
586
587
|
}, [e]), b(() => {
|
|
587
|
-
if (r) return
|
|
588
|
+
if (r) return rr(e);
|
|
588
589
|
}, [e, r]), (function(t) {
|
|
589
|
-
b(() =>
|
|
590
|
+
b(() => nr(t), [t]);
|
|
590
591
|
})(e), null;
|
|
591
592
|
}
|
|
592
|
-
function
|
|
593
|
+
function sn({ validateUrl: r, attributes: e }) {
|
|
593
594
|
const [t] = D();
|
|
594
595
|
return b(() => {
|
|
595
|
-
if (!t.hasNodes([
|
|
596
|
-
}), 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;
|
|
597
598
|
}
|
|
598
|
-
function
|
|
599
|
+
function ln(r, e, t) {
|
|
599
600
|
b(() => {
|
|
600
|
-
r.hasNodes([
|
|
601
|
+
r.hasNodes([Ue]) || (function(n, ...o) {
|
|
601
602
|
const a = new URL("https://lexical.dev/docs/error"), s = new URLSearchParams();
|
|
602
603
|
s.append("code", n);
|
|
603
604
|
for (const i of o) s.append("v", i);
|
|
604
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.`);
|
|
605
606
|
})(77);
|
|
606
|
-
}), b(() =>
|
|
607
|
+
}), b(() => ar(r, { changeHandlers: t ? [t] : [], matchers: e }), [r, e, t]);
|
|
607
608
|
}
|
|
608
|
-
function
|
|
609
|
+
function un({ matchers: r, onChange: e }) {
|
|
609
610
|
const [t] = D();
|
|
610
|
-
return
|
|
611
|
+
return ln(t, r, e), null;
|
|
611
612
|
}
|
|
612
|
-
function
|
|
613
|
+
function dn({ newTab: r = !0, disabled: e = !1 }) {
|
|
613
614
|
const [t] = D();
|
|
614
|
-
return b(() =>
|
|
615
|
+
return b(() => sr(t, ie({ disabled: e, newTab: r })), [t, r, e]), null;
|
|
615
616
|
}
|
|
616
|
-
function
|
|
617
|
+
function cn(r, e, t, n, o) {
|
|
617
618
|
if (r === null || t.size === 0 && n.size === 0 && !o) return 0;
|
|
618
619
|
const a = e._selection, s = r._selection;
|
|
619
620
|
if (o) return 1;
|
|
620
621
|
if (!(g(a) && g(s) && s.isCollapsed() && a.isCollapsed())) return 0;
|
|
621
622
|
const i = (function(C, v, N) {
|
|
622
623
|
const T = C._nodeMap, P = [];
|
|
623
|
-
for (const
|
|
624
|
-
const w = T.get(
|
|
624
|
+
for (const L of v) {
|
|
625
|
+
const w = T.get(L);
|
|
625
626
|
w !== void 0 && P.push(w);
|
|
626
627
|
}
|
|
627
|
-
for (const [
|
|
628
|
+
for (const [L, w] of N) {
|
|
628
629
|
if (!w) continue;
|
|
629
|
-
const R = T.get(
|
|
630
|
+
const R = T.get(L);
|
|
630
631
|
R === void 0 || Te(R) || P.push(R);
|
|
631
632
|
}
|
|
632
633
|
return P;
|
|
@@ -645,50 +646,50 @@ function dn(r, e, t, n, o) {
|
|
|
645
646
|
const y = h.offset, x = S.offset, E = m.length - u.length;
|
|
646
647
|
return E === 1 && x === y - 1 ? 2 : E === -1 && x === y + 1 ? 3 : E === -1 && x === y ? 4 : 0;
|
|
647
648
|
}
|
|
648
|
-
function
|
|
649
|
+
function fn(r, e) {
|
|
649
650
|
let t = Date.now(), n = 0;
|
|
650
651
|
return (o, a, s, i, l, d) => {
|
|
651
652
|
const u = Date.now();
|
|
652
653
|
if (d.has(ne)) return n = 0, t = u, 2;
|
|
653
|
-
const m =
|
|
654
|
-
const S = s === null || s.editor === r, y = d.has(
|
|
654
|
+
const m = cn(o, a, i, l, r.isComposing()), h = (() => {
|
|
655
|
+
const S = s === null || s.editor === r, y = d.has(Mt);
|
|
655
656
|
if (!y && S && d.has(oe)) return 0;
|
|
656
657
|
if (o === null) return 1;
|
|
657
658
|
const x = a._selection;
|
|
658
659
|
if (!(i.size > 0 || l.size > 0)) return x !== null ? 0 : 2;
|
|
659
660
|
const E = typeof e == "number" ? e : e.peek();
|
|
660
661
|
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),
|
|
662
|
-
return !(g(
|
|
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()));
|
|
663
664
|
})(Array.from(i)[0], o, a) ? 0 : 1;
|
|
664
665
|
})();
|
|
665
666
|
return t = u, n = m, h;
|
|
666
667
|
};
|
|
667
668
|
}
|
|
668
|
-
function
|
|
669
|
+
function ke(r) {
|
|
669
670
|
r.undoStack = [], r.redoStack = [], r.current = null;
|
|
670
671
|
}
|
|
671
672
|
function We(r, e, t) {
|
|
672
|
-
const n =
|
|
673
|
-
return
|
|
673
|
+
const n = fn(r, t);
|
|
674
|
+
return W(r.registerCommand(Rt, () => ((function(a, s) {
|
|
674
675
|
const i = s.redoStack, l = s.undoStack;
|
|
675
676
|
if (l.length !== 0) {
|
|
676
677
|
const d = s.current, u = l.pop();
|
|
677
|
-
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 });
|
|
678
679
|
}
|
|
679
680
|
})(r, e), !0), c), r.registerCommand(It, () => ((function(a, s) {
|
|
680
681
|
const i = s.redoStack, l = s.undoStack;
|
|
681
682
|
if (i.length !== 0) {
|
|
682
683
|
const d = s.current;
|
|
683
|
-
d !== null && (l.push(d), a.dispatchCommand(
|
|
684
|
+
d !== null && (l.push(d), a.dispatchCommand(q, !0));
|
|
684
685
|
const u = i.pop();
|
|
685
|
-
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 });
|
|
686
687
|
}
|
|
687
|
-
})(r, e), !0), c), r.registerCommand(Bt, () => (
|
|
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 }) => {
|
|
688
689
|
const u = e.current, m = e.redoStack, h = e.undoStack, S = u === null ? null : u.editorState;
|
|
689
690
|
if (u !== null && a === S) return;
|
|
690
691
|
const y = n(s, a, u, i, l, d);
|
|
691
|
-
if (y === 1) m.length !== 0 && (e.redoStack = [], r.dispatchCommand(
|
|
692
|
+
if (y === 1) m.length !== 0 && (e.redoStack = [], r.dispatchCommand(Y, !1)), u !== null && (h.push({ ...u }), r.dispatchCommand(q, !0));
|
|
692
693
|
else if (y === 2) return;
|
|
693
694
|
e.current = { editor: r, editorState: a };
|
|
694
695
|
}));
|
|
@@ -698,48 +699,50 @@ function Je() {
|
|
|
698
699
|
}
|
|
699
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) => {
|
|
700
701
|
const n = t.getOutput();
|
|
701
|
-
return
|
|
702
|
+
return Re(() => n.disabled.value ? void 0 : We(r, n.historyState.value, n.delay));
|
|
702
703
|
} });
|
|
703
|
-
ae({ dependencies: [
|
|
704
|
+
ae({ dependencies: [At(te, { createInitialHistoryState: () => {
|
|
704
705
|
throw new Error("SharedHistory did not inherit parent history");
|
|
705
706
|
}, disabled: !0 })], name: "@lexical/history/SharedHistory", register(r, e, t) {
|
|
706
707
|
const { output: n } = t.getDependency(te), o = (function(s) {
|
|
707
|
-
return s ?
|
|
708
|
+
return s ? Yt(s, te.name) : null;
|
|
708
709
|
})(r._parentEditor);
|
|
709
710
|
if (!o) return () => {
|
|
710
711
|
};
|
|
711
712
|
const a = o.output;
|
|
712
|
-
return
|
|
713
|
+
return Re(() => qt(() => {
|
|
713
714
|
n.delay.value = a.delay.value, n.historyState.value = a.historyState.value, n.disabled.value = a.disabled.value;
|
|
714
715
|
}));
|
|
715
716
|
} });
|
|
716
|
-
function
|
|
717
|
+
function mn({ delay: r, externalHistoryState: e }) {
|
|
717
718
|
const [t] = D();
|
|
718
719
|
return (function(n, o, a = 1e3) {
|
|
719
|
-
const s =
|
|
720
|
+
const s = O(() => o || Je(), [o]);
|
|
720
721
|
b(() => We(n, s, a), [a, n, s]);
|
|
721
722
|
})(t, e, r), null;
|
|
722
723
|
}
|
|
723
|
-
function
|
|
724
|
-
const [
|
|
725
|
-
|
|
726
|
-
|
|
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, () => {
|
|
727
728
|
})());
|
|
728
|
-
}, [
|
|
729
|
-
|
|
730
|
-
}, [
|
|
731
|
-
if (!
|
|
732
|
-
|
|
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);
|
|
733
736
|
});
|
|
734
|
-
}, [
|
|
737
|
+
}, [a, e, r]), null;
|
|
735
738
|
}
|
|
736
|
-
function
|
|
739
|
+
function gn({ editorRef: r }) {
|
|
737
740
|
const [e] = D();
|
|
738
|
-
return
|
|
741
|
+
return Ut.useEffect(() => {
|
|
739
742
|
typeof r == "function" ? r(e) : typeof r == "object" && (r.current = e);
|
|
740
743
|
}, [e]), null;
|
|
741
744
|
}
|
|
742
|
-
const
|
|
745
|
+
const Xe = 200, hn = ({
|
|
743
746
|
currentLanguage: r = "NL",
|
|
744
747
|
initialValue: e = "",
|
|
745
748
|
placeholder: t = "",
|
|
@@ -749,41 +752,41 @@ const qe = 200, gn = ({
|
|
|
749
752
|
notValid: s = !1,
|
|
750
753
|
notValidatedText: i = "",
|
|
751
754
|
maxHeightInRem: l = "20rem",
|
|
752
|
-
maxWords: d =
|
|
755
|
+
maxWords: d = Xe,
|
|
753
756
|
rteRef: u = null,
|
|
754
757
|
onChange: m,
|
|
755
758
|
onCatalogueLinkSearch: h,
|
|
756
759
|
catalogueSearchResponse: S = { state: "idle", results: [] }
|
|
757
760
|
}) => {
|
|
758
|
-
const { switchLanguage: y } =
|
|
761
|
+
const { switchLanguage: y } = Nr(), x = Cr(), [E] = M(() => Pe()), [C, v] = M(0), [N, T] = M(0), P = jt(), L = {
|
|
759
762
|
html: {
|
|
760
|
-
export:
|
|
763
|
+
export: mr
|
|
761
764
|
},
|
|
762
765
|
namespace: "UvaRte",
|
|
763
766
|
editor: E,
|
|
764
|
-
theme:
|
|
767
|
+
theme: wr,
|
|
765
768
|
onError(_) {
|
|
766
769
|
throw _;
|
|
767
770
|
},
|
|
768
771
|
nodes: [
|
|
772
|
+
Me,
|
|
773
|
+
Ae,
|
|
769
774
|
Fe,
|
|
775
|
+
Ue,
|
|
770
776
|
Ke,
|
|
771
|
-
|
|
772
|
-
Ae,
|
|
777
|
+
fr,
|
|
773
778
|
ze,
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
Nr,
|
|
777
|
-
_r
|
|
779
|
+
_r,
|
|
780
|
+
kr
|
|
778
781
|
],
|
|
779
782
|
editorState: (_) => {
|
|
780
|
-
const
|
|
781
|
-
F().clear(), $e(
|
|
783
|
+
const k = new DOMParser().parseFromString(e, "text/html"), X = er(_, k);
|
|
784
|
+
F().clear(), $e(X), De(null);
|
|
782
785
|
}
|
|
783
|
-
}, w = (_) => _.trim().length === 0 ? 0 : _.split(" ").length, R = (_,
|
|
786
|
+
}, w = (_) => _.trim().length === 0 ? 0 : _.split(" ").length, R = (_, J) => {
|
|
784
787
|
_.read(() => {
|
|
785
|
-
let
|
|
786
|
-
v(w(F().getTextContent().replace(/\s+/g, " ").trim())),
|
|
788
|
+
let k = "";
|
|
789
|
+
v(w(F().getTextContent().replace(/\s+/g, " ").trim())), k = pr(tr(J)), k = gr(k), m(k);
|
|
787
790
|
});
|
|
788
791
|
};
|
|
789
792
|
return b(() => {
|
|
@@ -791,10 +794,10 @@ const qe = 200, gn = ({
|
|
|
791
794
|
}, [r, y]), b(() => {
|
|
792
795
|
const _ = e.replace(/<br\s*\/?>| /gi, " ").replace(/<\/?[^>]+(>|$)|&[a-z]+;/g, "").replace(/\s+/g, " ").trim();
|
|
793
796
|
v(w(_));
|
|
794
|
-
}, [e]), /* @__PURE__ */
|
|
795
|
-
/* @__PURE__ */
|
|
796
|
-
/* @__PURE__ */ f(
|
|
797
|
-
/* @__PURE__ */
|
|
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: [
|
|
798
801
|
/* @__PURE__ */ f("span", { className: Ce({ [B["editor__header-word-count--alert"]]: C > d }), children: C }),
|
|
799
802
|
" / ",
|
|
800
803
|
d
|
|
@@ -806,21 +809,21 @@ const qe = 200, gn = ({
|
|
|
806
809
|
className: Ce(B.editor, {
|
|
807
810
|
[B["not-valid"]]: s
|
|
808
811
|
}),
|
|
809
|
-
children: /* @__PURE__ */
|
|
812
|
+
children: /* @__PURE__ */ A(Dr, { initialConfig: L, children: [
|
|
810
813
|
/* @__PURE__ */ f(
|
|
811
|
-
|
|
814
|
+
yr,
|
|
812
815
|
{
|
|
813
816
|
editorScrollPosition: N,
|
|
814
817
|
onCatalogueLinkSearch: h,
|
|
815
818
|
catalogueSearchResponse: S
|
|
816
819
|
}
|
|
817
820
|
),
|
|
818
|
-
/* @__PURE__ */
|
|
821
|
+
/* @__PURE__ */ A("div", { className: B["editor__field-wrapper"], children: [
|
|
819
822
|
/* @__PURE__ */ f(
|
|
820
|
-
|
|
823
|
+
Jr,
|
|
821
824
|
{
|
|
822
825
|
contentEditable: /* @__PURE__ */ f(
|
|
823
|
-
|
|
826
|
+
Gr,
|
|
824
827
|
{
|
|
825
828
|
className: B.editor__field,
|
|
826
829
|
"aria-label": x.common.rteAriaLabel,
|
|
@@ -834,27 +837,27 @@ const qe = 200, gn = ({
|
|
|
834
837
|
}
|
|
835
838
|
),
|
|
836
839
|
placeholder: /* @__PURE__ */ f("div", { className: B.editor__placeholder, children: t }),
|
|
837
|
-
ErrorBoundary:
|
|
840
|
+
ErrorBoundary: rn
|
|
838
841
|
}
|
|
839
842
|
),
|
|
840
|
-
/* @__PURE__ */ f(
|
|
843
|
+
/* @__PURE__ */ f(pn, {}),
|
|
841
844
|
/* @__PURE__ */ f(Jt, {}),
|
|
842
|
-
/* @__PURE__ */ f(
|
|
843
|
-
/* @__PURE__ */ f(
|
|
844
|
-
/* @__PURE__ */ f(
|
|
845
|
-
/* @__PURE__ */ f(
|
|
846
|
-
/* @__PURE__ */ f(
|
|
847
|
-
/* @__PURE__ */ f(
|
|
848
|
-
/* @__PURE__ */ f(
|
|
845
|
+
/* @__PURE__ */ f(mn, {}),
|
|
846
|
+
/* @__PURE__ */ f(an, {}),
|
|
847
|
+
/* @__PURE__ */ f(sn, { validateUrl: hr }),
|
|
848
|
+
/* @__PURE__ */ f(un, { matchers: vr }),
|
|
849
|
+
/* @__PURE__ */ f(dn, {}),
|
|
850
|
+
/* @__PURE__ */ f(on, { onChange: R }),
|
|
851
|
+
/* @__PURE__ */ f(Er, {}),
|
|
849
852
|
/* @__PURE__ */ f(Lr, {}),
|
|
850
|
-
u && /* @__PURE__ */ f(
|
|
853
|
+
u && /* @__PURE__ */ f(gn, { editorRef: u })
|
|
851
854
|
] })
|
|
852
855
|
] })
|
|
853
856
|
}
|
|
854
857
|
),
|
|
855
|
-
i !== "" && /* @__PURE__ */ f(
|
|
858
|
+
i !== "" && /* @__PURE__ */ f(br, { level: "error", feedback: i })
|
|
856
859
|
] });
|
|
857
|
-
},
|
|
860
|
+
}, mo = ({
|
|
858
861
|
currentLanguage: r = "NL",
|
|
859
862
|
initialValue: e = "",
|
|
860
863
|
placeholder: t = "",
|
|
@@ -863,13 +866,13 @@ const qe = 200, gn = ({
|
|
|
863
866
|
required: a = !1,
|
|
864
867
|
notValid: s = !1,
|
|
865
868
|
notValidatedText: i = "",
|
|
866
|
-
maxWords: l =
|
|
869
|
+
maxWords: l = Xe,
|
|
867
870
|
rteRef: d,
|
|
868
871
|
onChange: u,
|
|
869
872
|
onCatalogueLinkSearch: m,
|
|
870
873
|
catalogueSearchResponse: h = { state: "idle", results: [] }
|
|
871
|
-
}) => /* @__PURE__ */ f(
|
|
872
|
-
|
|
874
|
+
}) => /* @__PURE__ */ f(xr, { children: /* @__PURE__ */ f(
|
|
875
|
+
hn,
|
|
873
876
|
{
|
|
874
877
|
currentLanguage: r.toUpperCase(),
|
|
875
878
|
initialValue: e,
|
|
@@ -887,7 +890,7 @@ const qe = 200, gn = ({
|
|
|
887
890
|
}
|
|
888
891
|
) });
|
|
889
892
|
export {
|
|
890
|
-
|
|
891
|
-
|
|
893
|
+
hn as Rte,
|
|
894
|
+
mo as RteEditor
|
|
892
895
|
};
|
|
893
896
|
//# sourceMappingURL=RteEditor.js.map
|