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