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