@uva-glass/component-library 3.50.6 → 3.50.7
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-DBU6xTBY.js → Lexical.prod-BAE-wnll.js} +873 -863
- package/dist/Lexical.prod-BAE-wnll.js.map +1 -0
- package/dist/LexicalClipboard.prod-BS4qAkmJ.js +263 -0
- package/dist/LexicalClipboard.prod-BS4qAkmJ.js.map +1 -0
- package/dist/{LexicalLink.prod-DV9kT537.js → LexicalLink.prod-C6Or2Yo6.js} +97 -97
- package/dist/{LexicalLink.prod-DV9kT537.js.map → LexicalLink.prod-C6Or2Yo6.js.map} +1 -1
- package/dist/{LexicalList.prod-2UfLUgO1.js → LexicalList.prod-rTq41CO0.js} +24 -24
- package/dist/{LexicalList.prod-2UfLUgO1.js.map → LexicalList.prod-rTq41CO0.js.map} +1 -1
- package/dist/LexicalSelection.prod-fLzEGOT_.js +116 -0
- package/dist/LexicalSelection.prod-fLzEGOT_.js.map +1 -0
- package/dist/{LexicalTable.prod-CZ1mYUR-.js → LexicalTable.prod-BBI7yaOy.js} +118 -118
- package/dist/LexicalTable.prod-BBI7yaOy.js.map +1 -0
- package/dist/{LexicalUtils.prod-C3vvQk50.js → LexicalUtils.prod-D8DAKg7O.js} +36 -36
- package/dist/{LexicalUtils.prod-C3vvQk50.js.map → LexicalUtils.prod-D8DAKg7O.js.map} +1 -1
- package/dist/{TableCellResizerPlugin-CxFy7dbe.js → TableCellResizerPlugin-HPo4ZkHo.js} +39 -39
- package/dist/{TableCellResizerPlugin-CxFy7dbe.js.map → TableCellResizerPlugin-HPo4ZkHo.js.map} +1 -1
- package/dist/{TablePlugin-8TKXJMYE.js → TablePlugin-CeZO4BR1.js} +70 -70
- package/dist/{TablePlugin-8TKXJMYE.js.map → TablePlugin-CeZO4BR1.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 +7 -7
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +2 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +41 -41
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +14 -14
- 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 +12 -12
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +16 -16
- package/dist/components/RteEditor/Plugins/index.js +2 -2
- package/dist/components/RteEditor/RteEditor.js +219 -219
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/RteEditor/helpers.js +4 -4
- package/dist/components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js +15 -15
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +5 -5
- package/dist/Lexical.prod-DBU6xTBY.js.map +0 -1
- package/dist/LexicalClipboard.prod-CzGBnMdD.js +0 -272
- package/dist/LexicalClipboard.prod-CzGBnMdD.js.map +0 -1
- package/dist/LexicalSelection.prod-C1JYA_go.js +0 -114
- package/dist/LexicalSelection.prod-C1JYA_go.js.map +0 -1
- package/dist/LexicalTable.prod-CZ1mYUR-.js.map +0 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsx as m, jsxs as
|
|
2
|
-
import { t as
|
|
3
|
-
import { aK as
|
|
4
|
-
import { useMemo as X, useLayoutEffect as O, useEffect as E, useState as
|
|
5
|
-
import { a as Ht, T as Wt } from "../../TableCellResizerPlugin-
|
|
6
|
-
import { T as Jt, R as $e, z as
|
|
7
|
-
import { flushSync as
|
|
8
|
-
import { U, L as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { l as
|
|
12
|
-
import { u as or, h as ar, d as
|
|
13
|
-
import { c as
|
|
1
|
+
import { jsx as m, jsxs as A, Fragment as Ne } from "react/jsx-runtime";
|
|
2
|
+
import { t as je, r as qe, o as D } from "../../LexicalComposerContext.prod-DOyoZx0P.js";
|
|
3
|
+
import { aK as ke, ah as M, A as Xe, a as p, aS as re, aM as ne, an as z, y as oe, P as Ze, r as B, h as g, X as Ve, D as c, aW as Ye, ae as Ge, Z as Qe, _ as et, aX as tt, aY as rt, S as nt, aV as P, aG as ot, aZ as at, a_ as st, a$ as it, j as ee, b0 as lt, b1 as ut, a4 as dt, m as ct, a1 as ft, T as mt, b2 as pt, b3 as le, b as ue, R as gt, M as V, O as ht, a5 as Le, b4 as de, H as vt, E as yt, x as Ct, b5 as ce, z as bt, b6 as Et, b7 as wt, b8 as Pe, aF as St, V as xt, d as De, U as _t, b9 as Nt, W as kt, K as Lt, J as Pt, q as Dt, au as W, at as J, ba as Tt, bb as $t, aw as Bt, bc as te, av as Rt, bd as It, be as At, aQ as Mt } from "../../Lexical.prod-BAE-wnll.js";
|
|
4
|
+
import { useMemo as X, useLayoutEffect as O, useEffect as E, useState as I, Suspense as Ft, forwardRef as Te, useCallback as Kt, Component as zt, createElement as fe, createContext as Ot, useRef as Ut } from "react";
|
|
5
|
+
import { a as Ht, T as Wt } from "../../TableCellResizerPlugin-HPo4ZkHo.js";
|
|
6
|
+
import { T as Jt, R as $e, z as jt, a as ae, A as Be, l as qt, K as Xt, F as Zt, d as Re, b as Vt } from "../../LexicalLink.prod-C6Or2Yo6.js";
|
|
7
|
+
import { flushSync as Yt, createPortal as Gt } from "react-dom";
|
|
8
|
+
import { U, L as K, x as Qt } from "../../LexicalUtils.prod-D8DAKg7O.js";
|
|
9
|
+
import { R as me, F as pe, m as er, g as tr } from "../../LexicalClipboard.prod-BS4qAkmJ.js";
|
|
10
|
+
import { A as ge, Z as he, n as ve } from "../../LexicalSelection.prod-fLzEGOT_.js";
|
|
11
|
+
import { l as Ie, n as Ae, L as rr, b as nr } from "../../LexicalList.prod-rTq41CO0.js";
|
|
12
|
+
import { u as or, h as ar, d as Me, v as sr, N as ir, y as lr, T as Fe, k as ur } from "../../LexicalTable.prod-BBI7yaOy.js";
|
|
13
|
+
import { c as dr } from "../../clsx-OuTLNxxd.js";
|
|
14
14
|
import { exportMap as cr, mergeBoldStrongTags as fr, cleanUpTable as mr } from "./helpers.js";
|
|
15
15
|
import { validateUrl as pr, MATCHERS as gr } from "./Plugins/LinkPlugin/helpers.js";
|
|
16
16
|
import { s as $ } from "../../RteEditor.module-CmYZ4MmA.js";
|
|
17
17
|
import { ToolBarPlugin as hr } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
|
|
18
18
|
import { useTranslation as vr } from "./hooks/useTranslation.js";
|
|
19
|
-
import "../../TablePlugin-
|
|
19
|
+
import "../../TablePlugin-CeZO4BR1.js";
|
|
20
20
|
import "./Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js";
|
|
21
21
|
import "./hooks/components/Flyout.js";
|
|
22
22
|
import "../Accordion/Accordion.js";
|
|
@@ -45,61 +45,61 @@ import { UvaTheme as br } from "./UvaTheme/UvaTheme.js";
|
|
|
45
45
|
import { EditorHeader as Er } from "./EditorHeader/EditorHeader.js";
|
|
46
46
|
import { LanguageProvider as wr, useLanguage as Sr } from "./Providers/LanguageProvider.js";
|
|
47
47
|
import { TableWrapperNode as xr } from "./nodes/TableWrapperNode/TableWrapperNode.js";
|
|
48
|
-
const
|
|
49
|
-
function
|
|
48
|
+
const Ke = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, _r = Ke ? O : E, j = { tag: re };
|
|
49
|
+
function Nr({ initialConfig: r, children: t }) {
|
|
50
50
|
const e = X(() => {
|
|
51
|
-
const { theme: n, namespace: o, nodes: a, onError: s, editorState: i, html: l } = r,
|
|
51
|
+
const { theme: n, namespace: o, nodes: a, onError: s, editorState: i, html: l } = r, d = je(null, n), u = ke({ editable: r.editable, html: l, namespace: o, nodes: a, onError: (f) => s(f, u), theme: n });
|
|
52
52
|
return (function(f, h) {
|
|
53
53
|
if (h !== null) {
|
|
54
54
|
if (h === void 0) f.update(() => {
|
|
55
|
-
const S =
|
|
55
|
+
const S = M();
|
|
56
56
|
if (S.isEmpty()) {
|
|
57
57
|
const v = Xe();
|
|
58
58
|
S.append(v);
|
|
59
|
-
const
|
|
60
|
-
(p() !== null ||
|
|
59
|
+
const N = Ke ? document.activeElement : null;
|
|
60
|
+
(p() !== null || N !== null && N === f.getRootElement()) && v.select();
|
|
61
61
|
}
|
|
62
|
-
},
|
|
62
|
+
}, j);
|
|
63
63
|
else if (h !== null) switch (typeof h) {
|
|
64
64
|
case "string": {
|
|
65
65
|
const S = f.parseEditorState(h);
|
|
66
|
-
f.setEditorState(S,
|
|
66
|
+
f.setEditorState(S, j);
|
|
67
67
|
break;
|
|
68
68
|
}
|
|
69
69
|
case "object":
|
|
70
|
-
f.setEditorState(h,
|
|
70
|
+
f.setEditorState(h, j);
|
|
71
71
|
break;
|
|
72
72
|
case "function":
|
|
73
73
|
f.update(() => {
|
|
74
|
-
|
|
75
|
-
},
|
|
74
|
+
M().isEmpty() && h(f);
|
|
75
|
+
}, j);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
})(
|
|
78
|
+
})(u, i), [u, d];
|
|
79
79
|
}, []);
|
|
80
|
-
return
|
|
80
|
+
return _r(() => {
|
|
81
81
|
const n = r.editable, [o] = e;
|
|
82
82
|
o.setEditable(n === void 0 || n);
|
|
83
|
-
}, []), m(
|
|
83
|
+
}, []), m(qe.Provider, { value: e, children: t });
|
|
84
84
|
}
|
|
85
|
-
const
|
|
86
|
-
function
|
|
87
|
-
return
|
|
85
|
+
const kr = ne({ name: "@lexical/react/ReactProvider" });
|
|
86
|
+
function Lr() {
|
|
87
|
+
return M().getTextContent();
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function Pr(r, t = !0) {
|
|
90
90
|
if (r) return !1;
|
|
91
|
-
let e =
|
|
91
|
+
let e = Lr();
|
|
92
92
|
return t && (e = e.trim()), e === "";
|
|
93
93
|
}
|
|
94
94
|
function Dr(r) {
|
|
95
|
-
if (!
|
|
96
|
-
const t =
|
|
95
|
+
if (!Pr(r, !1)) return !1;
|
|
96
|
+
const t = M().getChildren(), e = t.length;
|
|
97
97
|
if (e > 1) return !1;
|
|
98
98
|
for (let n = 0; n < e; n++) {
|
|
99
99
|
const o = t[n];
|
|
100
|
-
if (
|
|
100
|
+
if (z(o)) return !1;
|
|
101
101
|
if (oe(o)) {
|
|
102
|
-
if (!
|
|
102
|
+
if (!Ze(o) || o.__indent !== 0) return !1;
|
|
103
103
|
const a = o.getChildren(), s = a.length;
|
|
104
104
|
for (let i = 0; i < s; i++) {
|
|
105
105
|
const l = a[n];
|
|
@@ -109,10 +109,10 @@ function Dr(r) {
|
|
|
109
109
|
}
|
|
110
110
|
return !0;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function ze(r) {
|
|
113
113
|
return () => Dr(r);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function Tr(r) {
|
|
116
116
|
const t = window.location.origin, e = (n) => {
|
|
117
117
|
if (n.origin !== t) return;
|
|
118
118
|
const o = r.getRootElement();
|
|
@@ -130,16 +130,16 @@ function Pr(r) {
|
|
|
130
130
|
if (i && i.functionId === "makeChanges") {
|
|
131
131
|
const l = i.args;
|
|
132
132
|
if (l) {
|
|
133
|
-
const [
|
|
133
|
+
const [d, u, f, h, S] = l;
|
|
134
134
|
r.update(() => {
|
|
135
135
|
const v = p();
|
|
136
136
|
if (g(v)) {
|
|
137
|
-
const
|
|
138
|
-
let x =
|
|
139
|
-
if (B(x) &&
|
|
137
|
+
const N = v.anchor;
|
|
138
|
+
let x = N.getNode(), w = 0, y = 0;
|
|
139
|
+
if (B(x) && d >= 0 && u >= 0 && (w = d, y = d + u, v.setTextNodeRange(x, w, x, y)), w === y && f === "" || (v.insertRawText(f), x = N.getNode()), B(x)) {
|
|
140
140
|
w = h, y = h + S;
|
|
141
|
-
const
|
|
142
|
-
w = w >
|
|
141
|
+
const _ = x.getTextContentSize();
|
|
142
|
+
w = w > _ ? _ : w, y = y > _ ? _ : y, v.setTextNodeRange(x, w, x, y);
|
|
143
143
|
}
|
|
144
144
|
n.stopImmediatePropagation();
|
|
145
145
|
}
|
|
@@ -164,10 +164,10 @@ function ye(r, t) {
|
|
|
164
164
|
}
|
|
165
165
|
return null;
|
|
166
166
|
}
|
|
167
|
-
const
|
|
168
|
-
function
|
|
167
|
+
const F = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, $r = F && "documentMode" in document ? document.documentMode : null, Br = F && /Mac|iPod|iPhone|iPad/.test(navigator.platform), Rr = !(!F || !("InputEvent" in window) || $r) && "getTargetRanges" in new window.InputEvent("input"), Ir = F && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Ce = F && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Ar = F && /^(?=.*Chrome).*/i.test(navigator.userAgent), Mr = F && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && Br && !Ar, be = Qe("DRAG_DROP_PASTE_FILE");
|
|
168
|
+
function q(r) {
|
|
169
169
|
let t = null;
|
|
170
|
-
if (
|
|
170
|
+
if (K(r, DragEvent) ? t = r.dataTransfer : K(r, ClipboardEvent) && (t = r.clipboardData), t === null) return [!1, [], !1];
|
|
171
171
|
const e = t.types, n = e.includes("Files"), o = e.includes("text/html") || e.includes("text/plain");
|
|
172
172
|
return [n, Array.from(t.files), o];
|
|
173
173
|
}
|
|
@@ -178,7 +178,7 @@ function Ee(r) {
|
|
|
178
178
|
for (let o = 0; o < n.length; o++) {
|
|
179
179
|
const a = n[o], s = a.getKey();
|
|
180
180
|
if (e.has(s)) continue;
|
|
181
|
-
const i = De(a, (
|
|
181
|
+
const i = De(a, (d) => oe(d) && !d.isInline());
|
|
182
182
|
if (i === null) continue;
|
|
183
183
|
const l = i.getKey();
|
|
184
184
|
i.canIndent() && !e.has(l) && (e.add(l), r(i));
|
|
@@ -187,25 +187,25 @@ function Ee(r) {
|
|
|
187
187
|
}
|
|
188
188
|
function we(r) {
|
|
189
189
|
const t = ee(r);
|
|
190
|
-
return
|
|
190
|
+
return z(t);
|
|
191
191
|
}
|
|
192
|
-
function
|
|
192
|
+
function Y(r) {
|
|
193
193
|
for (const t of ["lowercase", "uppercase", "capitalize"]) r.hasFormat(t) && r.toggleFormat(t);
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function Fr(r) {
|
|
196
196
|
return U(r.registerCommand(Dt, (t) => {
|
|
197
197
|
const e = p();
|
|
198
|
-
return !!
|
|
199
|
-
}, c), r.registerCommand(
|
|
198
|
+
return !!P(e) && (e.clear(), !0);
|
|
199
|
+
}, c), r.registerCommand(V, (t) => {
|
|
200
200
|
const e = p();
|
|
201
|
-
return g(e) ? (e.deleteCharacter(t), !0) : !!
|
|
202
|
-
}, c), r.registerCommand(
|
|
201
|
+
return g(e) ? (e.deleteCharacter(t), !0) : !!P(e) && (e.deleteNodes(), !0);
|
|
202
|
+
}, c), r.registerCommand(Pt, (t) => {
|
|
203
203
|
const e = p();
|
|
204
204
|
return !!g(e) && (e.deleteWord(t), !0);
|
|
205
|
-
}, c), r.registerCommand(
|
|
205
|
+
}, c), r.registerCommand(Lt, (t) => {
|
|
206
206
|
const e = p();
|
|
207
207
|
return !!g(e) && (e.deleteLine(t), !0);
|
|
208
|
-
}, c), r.registerCommand(
|
|
208
|
+
}, c), r.registerCommand(kt, (t) => {
|
|
209
209
|
const e = p();
|
|
210
210
|
if (typeof t == "string") e !== null && e.insertText(t);
|
|
211
211
|
else {
|
|
@@ -218,15 +218,15 @@ function Kr(r) {
|
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
return !0;
|
|
221
|
-
}, c), r.registerCommand(
|
|
221
|
+
}, c), r.registerCommand(Nt, () => {
|
|
222
222
|
const t = p();
|
|
223
223
|
return !!g(t) && (t.removeText(), !0);
|
|
224
|
-
}, c), r.registerCommand(
|
|
224
|
+
}, c), r.registerCommand(_t, (t) => {
|
|
225
225
|
const e = p();
|
|
226
226
|
return !!g(e) && (e.formatText(t), !0);
|
|
227
227
|
}, c), r.registerCommand(xt, (t) => {
|
|
228
228
|
const e = p();
|
|
229
|
-
if (!g(e) && !
|
|
229
|
+
if (!g(e) && !P(e)) return !1;
|
|
230
230
|
const n = e.getNodes();
|
|
231
231
|
for (const o of n) {
|
|
232
232
|
const a = De(o, (s) => oe(s) && !s.isInline());
|
|
@@ -236,42 +236,42 @@ function Kr(r) {
|
|
|
236
236
|
}, c), r.registerCommand(le, (t) => {
|
|
237
237
|
const e = p();
|
|
238
238
|
return !!g(e) && (e.insertLineBreak(t), !0);
|
|
239
|
-
}, c), r.registerCommand(
|
|
239
|
+
}, c), r.registerCommand(ue, () => {
|
|
240
240
|
const t = p();
|
|
241
241
|
return !!g(t) && (t.insertParagraph(), !0);
|
|
242
|
-
}, c), r.registerCommand(wt, () => (
|
|
242
|
+
}, c), r.registerCommand(wt, () => (Pe([St()]), !0), c), r.registerCommand(Et, () => Ee((t) => {
|
|
243
243
|
const e = t.getIndent();
|
|
244
244
|
t.setIndent(e + 1);
|
|
245
|
-
}), c), r.registerCommand(
|
|
245
|
+
}), c), r.registerCommand(de, () => Ee((t) => {
|
|
246
246
|
const e = t.getIndent();
|
|
247
247
|
e > 0 && t.setIndent(Math.max(0, e - 1));
|
|
248
248
|
}), c), r.registerCommand(bt, (t) => {
|
|
249
249
|
const e = p();
|
|
250
|
-
if (
|
|
250
|
+
if (P(e)) {
|
|
251
251
|
const n = e.getNodes();
|
|
252
|
-
if (n.length > 0) return n[0].selectPrevious(), !0;
|
|
252
|
+
if (n.length > 0) return t.preventDefault(), n[0].selectPrevious(), !0;
|
|
253
253
|
} else if (g(e)) {
|
|
254
254
|
const n = ce(e.focus, !0);
|
|
255
|
-
if (!t.shiftKey &&
|
|
255
|
+
if (!t.shiftKey && z(n) && !n.isIsolated() && !n.isInline()) return n.selectPrevious(), t.preventDefault(), !0;
|
|
256
256
|
}
|
|
257
257
|
return !1;
|
|
258
258
|
}, c), r.registerCommand(Ct, (t) => {
|
|
259
259
|
const e = p();
|
|
260
|
-
if (
|
|
260
|
+
if (P(e)) {
|
|
261
261
|
const n = e.getNodes();
|
|
262
|
-
if (n.length > 0) return n[0].selectNext(0, 0), !0;
|
|
262
|
+
if (n.length > 0) return t.preventDefault(), n[0].selectNext(0, 0), !0;
|
|
263
263
|
} else if (g(e)) {
|
|
264
264
|
if ((function(o) {
|
|
265
265
|
const a = o.focus;
|
|
266
|
-
return a.key === "root" && a.offset ===
|
|
266
|
+
return a.key === "root" && a.offset === M().getChildrenSize();
|
|
267
267
|
})(e)) return t.preventDefault(), !0;
|
|
268
268
|
const n = ce(e.focus, !1);
|
|
269
|
-
if (!t.shiftKey &&
|
|
269
|
+
if (!t.shiftKey && z(n) && !n.isIsolated() && !n.isInline()) return n.selectNext(), t.preventDefault(), !0;
|
|
270
270
|
}
|
|
271
271
|
return !1;
|
|
272
272
|
}, c), r.registerCommand(yt, (t) => {
|
|
273
273
|
const e = p();
|
|
274
|
-
if (
|
|
274
|
+
if (P(e)) {
|
|
275
275
|
const n = e.getNodes();
|
|
276
276
|
if (n.length > 0) return t.preventDefault(), ge(n[0]) ? n[0].selectNext(0, 0) : n[0].selectPrevious(), !0;
|
|
277
277
|
}
|
|
@@ -283,7 +283,7 @@ function Kr(r) {
|
|
|
283
283
|
return !1;
|
|
284
284
|
}, c), r.registerCommand(vt, (t) => {
|
|
285
285
|
const e = p();
|
|
286
|
-
if (
|
|
286
|
+
if (P(e)) {
|
|
287
287
|
const o = e.getNodes();
|
|
288
288
|
if (o.length > 0) return t.preventDefault(), ge(o[0]) ? o[0].selectPrevious() : o[0].selectNext(0, 0), !0;
|
|
289
289
|
}
|
|
@@ -299,43 +299,43 @@ function Kr(r) {
|
|
|
299
299
|
const { anchor: o } = n;
|
|
300
300
|
if (o.offset !== 0) return !1;
|
|
301
301
|
const a = o.getNode();
|
|
302
|
-
if (
|
|
302
|
+
if (Le(a)) return !1;
|
|
303
303
|
const s = Qt(a);
|
|
304
304
|
return s.getIndent() > 0 && (s.is(a) || a.is(s.getFirstDescendant()));
|
|
305
|
-
})(e)) return t.preventDefault(), r.dispatchCommand(
|
|
305
|
+
})(e)) return t.preventDefault(), r.dispatchCommand(de, void 0);
|
|
306
306
|
if (Ce && navigator.language === "ko-KR") return !1;
|
|
307
|
-
} else if (!
|
|
308
|
-
return t.preventDefault(), r.dispatchCommand(
|
|
307
|
+
} else if (!P(e)) return !1;
|
|
308
|
+
return t.preventDefault(), r.dispatchCommand(V, !0);
|
|
309
309
|
}, c), r.registerCommand(gt, (t) => {
|
|
310
310
|
if (we(t.target)) return !1;
|
|
311
311
|
const e = p();
|
|
312
|
-
return !(!g(e) && !
|
|
312
|
+
return !(!g(e) && !P(e)) && (t.preventDefault(), r.dispatchCommand(V, !1));
|
|
313
313
|
}, c), r.registerCommand(pt, (t) => {
|
|
314
314
|
const e = p();
|
|
315
315
|
if (!g(e)) return !1;
|
|
316
|
-
if (
|
|
317
|
-
if ((Ce ||
|
|
316
|
+
if (Y(e), t !== null) {
|
|
317
|
+
if ((Ce || Ir || Mr) && Rr) return !1;
|
|
318
318
|
if (t.preventDefault(), t.shiftKey) return r.dispatchCommand(le, !1);
|
|
319
319
|
}
|
|
320
|
-
return r.dispatchCommand(
|
|
320
|
+
return r.dispatchCommand(ue, void 0);
|
|
321
321
|
}, c), r.registerCommand(mt, () => {
|
|
322
322
|
const t = p();
|
|
323
323
|
return !!g(t) && (r.blur(), !0);
|
|
324
|
-
}, c), r.registerCommand(
|
|
325
|
-
const [, e] =
|
|
324
|
+
}, c), r.registerCommand(ut, (t) => {
|
|
325
|
+
const [, e] = q(t);
|
|
326
326
|
if (e.length > 0) {
|
|
327
327
|
const o = ye(t.clientX, t.clientY);
|
|
328
328
|
if (o !== null) {
|
|
329
329
|
const { offset: a, node: s } = o, i = ee(s);
|
|
330
330
|
if (i !== null) {
|
|
331
|
-
const l =
|
|
331
|
+
const l = dt();
|
|
332
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 u = i.getParentOrThrow().getKey(), f = i.getIndexWithinParent() + 1;
|
|
335
|
+
l.anchor.set(u, f, "element"), l.focus.set(u, f, "element");
|
|
336
336
|
}
|
|
337
|
-
const
|
|
338
|
-
ft(
|
|
337
|
+
const d = ct(l);
|
|
338
|
+
ft(d);
|
|
339
339
|
}
|
|
340
340
|
r.dispatchCommand(be, e);
|
|
341
341
|
}
|
|
@@ -344,50 +344,50 @@ function Kr(r) {
|
|
|
344
344
|
const n = p();
|
|
345
345
|
return !!g(n);
|
|
346
346
|
}, c), r.registerCommand(lt, (t) => {
|
|
347
|
-
const [e] =
|
|
347
|
+
const [e] = q(t), n = p();
|
|
348
348
|
return !(e && !g(n));
|
|
349
349
|
}, c), r.registerCommand(it, (t) => {
|
|
350
|
-
const [e] =
|
|
350
|
+
const [e] = q(t), n = p();
|
|
351
351
|
if (e && !g(n)) return !1;
|
|
352
352
|
const o = ye(t.clientX, t.clientY);
|
|
353
353
|
if (o !== null) {
|
|
354
354
|
const a = ee(o.node);
|
|
355
|
-
|
|
355
|
+
z(a) && t.preventDefault();
|
|
356
356
|
}
|
|
357
357
|
return !0;
|
|
358
|
-
}, c), r.registerCommand(at, () => (st(), !0), c), r.registerCommand(ot, (t) => (pe(r,
|
|
359
|
-
await pe(n,
|
|
358
|
+
}, c), r.registerCommand(at, () => (st(), !0), c), r.registerCommand(ot, (t) => (pe(r, K(t, ClipboardEvent) ? t : null), !0), c), r.registerCommand(nt, (t) => ((async function(e, n) {
|
|
359
|
+
await pe(n, K(e, ClipboardEvent) ? e : null), n.update(() => {
|
|
360
360
|
const o = p();
|
|
361
|
-
g(o) ? o.removeText() :
|
|
361
|
+
g(o) ? o.removeText() : P(o) && o.getNodes().forEach((a) => a.remove());
|
|
362
362
|
});
|
|
363
|
-
})(t, r), !0), c), r.registerCommand(
|
|
364
|
-
const [, e, n] =
|
|
363
|
+
})(t, r), !0), c), r.registerCommand(Ge, (t) => {
|
|
364
|
+
const [, e, n] = q(t);
|
|
365
365
|
return e.length > 0 && !n ? (r.dispatchCommand(be, e), !0) : et(t.target) && tt(t.target) ? !1 : p() !== null && ((function(o, a) {
|
|
366
366
|
o.preventDefault(), a.update(() => {
|
|
367
|
-
const s = p(), i =
|
|
367
|
+
const s = p(), i = K(o, InputEvent) || K(o, KeyboardEvent) ? null : o.clipboardData;
|
|
368
368
|
i != null && s !== null && me(i, s, a);
|
|
369
369
|
}, { tag: rt });
|
|
370
370
|
})(t, r), !0);
|
|
371
|
-
}, c), r.registerCommand(
|
|
371
|
+
}, c), r.registerCommand(Ye, (t) => {
|
|
372
372
|
const e = p();
|
|
373
|
-
return g(e) &&
|
|
374
|
-
}, c), r.registerCommand(
|
|
373
|
+
return g(e) && Y(e), !1;
|
|
374
|
+
}, c), r.registerCommand(Ve, (t) => {
|
|
375
375
|
const e = p();
|
|
376
|
-
return g(e) &&
|
|
376
|
+
return g(e) && Y(e), !1;
|
|
377
377
|
}, c));
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function Kr(r, ...t) {
|
|
380
380
|
const e = new URL("https://lexical.dev/docs/error"), n = new URLSearchParams();
|
|
381
381
|
n.append("code", r);
|
|
382
382
|
for (const o of t) n.append("v", o);
|
|
383
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
384
|
}
|
|
385
385
|
const se = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? O : E;
|
|
386
|
-
function
|
|
386
|
+
function zr({ editor: r, ErrorBoundary: t }) {
|
|
387
387
|
return (function(e, n) {
|
|
388
|
-
const [o, a] =
|
|
388
|
+
const [o, a] = I(() => e.getDecorators());
|
|
389
389
|
return se(() => e.registerDecoratorListener((s) => {
|
|
390
|
-
|
|
390
|
+
Yt(() => {
|
|
391
391
|
a(s);
|
|
392
392
|
});
|
|
393
393
|
}), [e]), E(() => {
|
|
@@ -395,8 +395,8 @@ function Fr({ editor: r, ErrorBoundary: t }) {
|
|
|
395
395
|
}, [e]), X(() => {
|
|
396
396
|
const s = [], i = Object.keys(o);
|
|
397
397
|
for (let l = 0; l < i.length; l++) {
|
|
398
|
-
const
|
|
399
|
-
f !== null && s.push(
|
|
398
|
+
const d = i[l], u = m(n, { onError: (h) => e._onError(h), children: m(Ft, { fallback: null, children: o[d] }) }), f = e.getElementByKey(d);
|
|
399
|
+
f !== null && s.push(Gt(u, f, d));
|
|
400
400
|
}
|
|
401
401
|
return s;
|
|
402
402
|
}, [n, o, e]);
|
|
@@ -405,25 +405,25 @@ function Fr({ editor: r, ErrorBoundary: t }) {
|
|
|
405
405
|
function Or({ editor: r, ErrorBoundary: t }) {
|
|
406
406
|
return (function(e) {
|
|
407
407
|
const n = Jt.maybeFromEditor(e);
|
|
408
|
-
if (n && n.hasExtensionByName(
|
|
409
|
-
for (const o of ["@lexical/plain-text", "@lexical/rich-text"]) n.hasExtensionByName(o) &&
|
|
408
|
+
if (n && n.hasExtensionByName(kr.name)) {
|
|
409
|
+
for (const o of ["@lexical/plain-text", "@lexical/rich-text"]) n.hasExtensionByName(o) && Kr(320, o);
|
|
410
410
|
return !0;
|
|
411
411
|
}
|
|
412
412
|
return !1;
|
|
413
|
-
})(r) ? null : m(
|
|
413
|
+
})(r) ? null : m(zr, { editor: r, ErrorBoundary: t });
|
|
414
414
|
}
|
|
415
415
|
function Se(r) {
|
|
416
|
-
return r.getEditorState().read(
|
|
416
|
+
return r.getEditorState().read(ze(r.isComposing()));
|
|
417
417
|
}
|
|
418
418
|
function Ur({ contentEditable: r, placeholder: t = null, ErrorBoundary: e }) {
|
|
419
419
|
const [n] = D();
|
|
420
420
|
return (function(o) {
|
|
421
|
-
se(() => U(
|
|
422
|
-
})(n),
|
|
421
|
+
se(() => U(Fr(o), Tr(o)), [o]);
|
|
422
|
+
})(n), A(Ne, { children: [r, m(Hr, { content: t }), m(Or, { editor: n, ErrorBoundary: e })] });
|
|
423
423
|
}
|
|
424
424
|
function Hr({ content: r }) {
|
|
425
425
|
const [t] = D(), e = (function(o) {
|
|
426
|
-
const [a, s] =
|
|
426
|
+
const [a, s] = I(() => Se(o));
|
|
427
427
|
return se(() => {
|
|
428
428
|
function i() {
|
|
429
429
|
const l = Se(o);
|
|
@@ -439,55 +439,55 @@ function Hr({ content: r }) {
|
|
|
439
439
|
return e ? typeof r == "function" ? r(n) : r : null;
|
|
440
440
|
}
|
|
441
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:
|
|
443
|
-
const [C,
|
|
444
|
-
|
|
445
|
-
}, [r]), Je = X(() => /* @__PURE__ */ (function(...
|
|
442
|
+
function Wr({ editor: r, ariaActiveDescendant: t, ariaAutoComplete: e, ariaControls: n, ariaDescribedBy: o, ariaErrorMessage: a, ariaExpanded: s, ariaInvalid: i, ariaLabel: l, ariaLabelledBy: d, ariaMultiline: u, ariaOwns: f, ariaRequired: h, autoCapitalize: S, className: v, id: N, role: x = "textbox", spellCheck: w = !0, style: y, tabIndex: _, "data-testid": L, ...b }, k) {
|
|
443
|
+
const [C, T] = I(r.isEditable()), Z = Kt((R) => {
|
|
444
|
+
R && R.ownerDocument && R.ownerDocument.defaultView ? r.setRootElement(R) : r.setRootElement(null);
|
|
445
|
+
}, [r]), Je = X(() => /* @__PURE__ */ (function(...R) {
|
|
446
446
|
return (ie) => {
|
|
447
|
-
for (const H of
|
|
447
|
+
for (const H of R) typeof H == "function" ? H(ie) : H != null && (H.current = ie);
|
|
448
448
|
};
|
|
449
|
-
})(
|
|
450
|
-
return Oe(() => (
|
|
451
|
-
|
|
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":
|
|
449
|
+
})(k, Z), [Z, k]);
|
|
450
|
+
return Oe(() => (T(r.isEditable()), r.registerEditableListener((R) => {
|
|
451
|
+
T(R);
|
|
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": d, "aria-multiline": u, "aria-owns": C ? f : void 0, "aria-readonly": !C || void 0, "aria-required": h, autoCapitalize: S, className: v, contentEditable: C, "data-testid": L, id: N, ref: Je, role: x, spellCheck: w, style: y, tabIndex: _, ...b });
|
|
453
453
|
}
|
|
454
|
-
const Jr =
|
|
454
|
+
const Jr = Te(Wr);
|
|
455
455
|
function xe(r) {
|
|
456
|
-
return r.getEditorState().read(
|
|
456
|
+
return r.getEditorState().read(ze(r.isComposing()));
|
|
457
457
|
}
|
|
458
|
-
const
|
|
459
|
-
function
|
|
458
|
+
const jr = Te(qr);
|
|
459
|
+
function qr(r, t) {
|
|
460
460
|
const { placeholder: e, ...n } = r, [o] = D();
|
|
461
|
-
return
|
|
461
|
+
return A(Ne, { children: [m(Jr, { editor: o, ...n, ref: t }), e != null && m(Xr, { editor: o, content: e })] });
|
|
462
462
|
}
|
|
463
463
|
function Xr({ content: r, editor: t }) {
|
|
464
464
|
const e = (function(s) {
|
|
465
|
-
const [i, l] =
|
|
465
|
+
const [i, l] = I(() => xe(s));
|
|
466
466
|
return Oe(() => {
|
|
467
|
-
function
|
|
468
|
-
const
|
|
469
|
-
l(
|
|
467
|
+
function d() {
|
|
468
|
+
const u = xe(s);
|
|
469
|
+
l(u);
|
|
470
470
|
}
|
|
471
|
-
return
|
|
472
|
-
|
|
471
|
+
return d(), U(s.registerUpdateListener(() => {
|
|
472
|
+
d();
|
|
473
473
|
}), s.registerEditableListener(() => {
|
|
474
|
-
|
|
474
|
+
d();
|
|
475
475
|
}));
|
|
476
476
|
}, [s]), i;
|
|
477
|
-
})(t), [n, o] =
|
|
477
|
+
})(t), [n, o] = I(t.isEditable());
|
|
478
478
|
if (O(() => (o(t.isEditable()), t.registerEditableListener((s) => {
|
|
479
479
|
o(s);
|
|
480
480
|
})), [t]), !e) return null;
|
|
481
481
|
let a = null;
|
|
482
482
|
return typeof r == "function" ? a = r(n) : r !== null && (a = r), a === null ? null : m("div", { "aria-hidden": !0, children: a });
|
|
483
483
|
}
|
|
484
|
-
const
|
|
484
|
+
const Zr = Ot(null), G = {
|
|
485
485
|
didCatch: !1,
|
|
486
486
|
error: null
|
|
487
487
|
};
|
|
488
|
-
class
|
|
488
|
+
class Vr extends zt {
|
|
489
489
|
constructor(t) {
|
|
490
|
-
super(t), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state =
|
|
490
|
+
super(t), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = G;
|
|
491
491
|
}
|
|
492
492
|
static getDerivedStateFromError(t) {
|
|
493
493
|
return {
|
|
@@ -505,7 +505,7 @@ class Gr extends Ft {
|
|
|
505
505
|
(e = (n = this.props).onReset) === null || e === void 0 || e.call(n, {
|
|
506
506
|
args: a,
|
|
507
507
|
reason: "imperative-api"
|
|
508
|
-
}), this.setState(
|
|
508
|
+
}), this.setState(G);
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
511
|
componentDidCatch(t, e) {
|
|
@@ -518,13 +518,13 @@ class Gr extends Ft {
|
|
|
518
518
|
} = this.state, {
|
|
519
519
|
resetKeys: o
|
|
520
520
|
} = this.props;
|
|
521
|
-
if (n && e.error !== null &&
|
|
521
|
+
if (n && e.error !== null && Yr(t.resetKeys, o)) {
|
|
522
522
|
var a, s;
|
|
523
523
|
(a = (s = this.props).onReset) === null || a === void 0 || a.call(s, {
|
|
524
524
|
next: o,
|
|
525
525
|
prev: t.resetKeys,
|
|
526
526
|
reason: "keys"
|
|
527
|
-
}), this.setState(
|
|
527
|
+
}), this.setState(G);
|
|
528
528
|
}
|
|
529
529
|
}
|
|
530
530
|
render() {
|
|
@@ -552,7 +552,7 @@ class Gr extends Ft {
|
|
|
552
552
|
else
|
|
553
553
|
throw s;
|
|
554
554
|
}
|
|
555
|
-
return fe(
|
|
555
|
+
return fe(Zr.Provider, {
|
|
556
556
|
value: {
|
|
557
557
|
didCatch: a,
|
|
558
558
|
error: s,
|
|
@@ -561,12 +561,12 @@ class Gr extends Ft {
|
|
|
561
561
|
}, i);
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
|
-
function
|
|
564
|
+
function Yr() {
|
|
565
565
|
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
|
|
566
566
|
return r.length !== t.length || r.some((e, n) => !Object.is(e, t[n]));
|
|
567
567
|
}
|
|
568
|
-
function
|
|
569
|
-
return m(
|
|
568
|
+
function Gr({ children: r, onError: t }) {
|
|
569
|
+
return m(Vr, { fallback: m("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: t, children: r });
|
|
570
570
|
}
|
|
571
571
|
const Qr = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? O : E;
|
|
572
572
|
function en({ ignoreHistoryMergeTagChange: r = !0, ignoreSelectionChange: t = !1, onChange: e }) {
|
|
@@ -580,7 +580,7 @@ function en({ ignoreHistoryMergeTagChange: r = !0, ignoreSelectionChange: t = !1
|
|
|
580
580
|
function tn({ hasStrictIndent: r = !1 }) {
|
|
581
581
|
const [t] = D();
|
|
582
582
|
return E(() => {
|
|
583
|
-
if (!t.hasNodes([
|
|
583
|
+
if (!t.hasNodes([Ie, Ae])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
|
|
584
584
|
}, [t]), E(() => {
|
|
585
585
|
if (r) return rr(t);
|
|
586
586
|
}, [t, r]), (function(e) {
|
|
@@ -591,7 +591,7 @@ function rn({ validateUrl: r, attributes: t }) {
|
|
|
591
591
|
const [e] = D();
|
|
592
592
|
return E(() => {
|
|
593
593
|
if (!e.hasNodes([$e])) throw new Error("LinkPlugin: LinkNode not registered on editor");
|
|
594
|
-
}), E(() =>
|
|
594
|
+
}), E(() => jt(e, ae({ attributes: t, validateUrl: r })), [e, r, t]), null;
|
|
595
595
|
}
|
|
596
596
|
function nn(r, t, e) {
|
|
597
597
|
E(() => {
|
|
@@ -601,7 +601,7 @@ function nn(r, t, e) {
|
|
|
601
601
|
for (const i of o) s.append("v", i);
|
|
602
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
603
|
})(77);
|
|
604
|
-
}), E(() =>
|
|
604
|
+
}), E(() => qt(r, { changeHandlers: e ? [e] : [], matchers: t }), [r, t, e]);
|
|
605
605
|
}
|
|
606
606
|
function on({ matchers: r, onChange: t }) {
|
|
607
607
|
const [e] = D();
|
|
@@ -616,77 +616,77 @@ function sn(r, t, e, n, o) {
|
|
|
616
616
|
const a = t._selection, s = r._selection;
|
|
617
617
|
if (o) return 1;
|
|
618
618
|
if (!(g(a) && g(s) && s.isCollapsed() && a.isCollapsed())) return 0;
|
|
619
|
-
const i = (function(w, y,
|
|
620
|
-
const
|
|
621
|
-
for (const
|
|
622
|
-
const C =
|
|
619
|
+
const i = (function(w, y, _) {
|
|
620
|
+
const L = w._nodeMap, b = [];
|
|
621
|
+
for (const k of y) {
|
|
622
|
+
const C = L.get(k);
|
|
623
623
|
C !== void 0 && b.push(C);
|
|
624
624
|
}
|
|
625
|
-
for (const [
|
|
625
|
+
for (const [k, C] of _) {
|
|
626
626
|
if (!C) continue;
|
|
627
|
-
const
|
|
628
|
-
|
|
627
|
+
const T = L.get(k);
|
|
628
|
+
T === void 0 || Le(T) || b.push(T);
|
|
629
629
|
}
|
|
630
630
|
return b;
|
|
631
631
|
})(t, e, n);
|
|
632
632
|
if (i.length === 0) return 0;
|
|
633
633
|
if (i.length > 1) {
|
|
634
|
-
const w = t._nodeMap, y = w.get(a.anchor.key),
|
|
635
|
-
return y &&
|
|
634
|
+
const w = t._nodeMap, y = w.get(a.anchor.key), _ = w.get(s.anchor.key);
|
|
635
|
+
return y && _ && !r._nodeMap.has(y.__key) && B(y) && y.__text.length === 1 && a.anchor.offset === 1 ? 2 : 0;
|
|
636
636
|
}
|
|
637
|
-
const l = i[0],
|
|
638
|
-
if (!B(
|
|
639
|
-
const
|
|
640
|
-
if (
|
|
637
|
+
const l = i[0], d = r._nodeMap.get(l.__key);
|
|
638
|
+
if (!B(d) || !B(l) || d.__mode !== l.__mode) return 0;
|
|
639
|
+
const u = d.__text, f = l.__text;
|
|
640
|
+
if (u === f) return 0;
|
|
641
641
|
const h = a.anchor, S = s.anchor;
|
|
642
642
|
if (h.key !== S.key || h.type !== "text") return 0;
|
|
643
|
-
const v = h.offset,
|
|
644
|
-
return x === 1 &&
|
|
643
|
+
const v = h.offset, N = S.offset, x = f.length - u.length;
|
|
644
|
+
return x === 1 && N === v - 1 ? 2 : x === -1 && N === v + 1 ? 3 : x === -1 && N === v ? 4 : 0;
|
|
645
645
|
}
|
|
646
646
|
function ln(r, t) {
|
|
647
647
|
let e = Date.now(), n = 0;
|
|
648
|
-
return (o, a, s, i, l,
|
|
649
|
-
const
|
|
650
|
-
if (
|
|
648
|
+
return (o, a, s, i, l, d) => {
|
|
649
|
+
const u = Date.now();
|
|
650
|
+
if (d.has(te)) return n = 0, e = u, 2;
|
|
651
651
|
const f = sn(o, a, i, l, r.isComposing()), h = (() => {
|
|
652
|
-
const S = s === null || s.editor === r, v =
|
|
653
|
-
if (!v && S &&
|
|
652
|
+
const S = s === null || s.editor === r, v = d.has(It);
|
|
653
|
+
if (!v && S && d.has(re)) return 0;
|
|
654
654
|
if (o === null) return 1;
|
|
655
|
-
const
|
|
656
|
-
if (!(i.size > 0 || l.size > 0)) return
|
|
655
|
+
const N = a._selection;
|
|
656
|
+
if (!(i.size > 0 || l.size > 0)) return N !== null ? 0 : 2;
|
|
657
657
|
const x = typeof t == "number" ? t : t.peek();
|
|
658
|
-
return v === !1 && f !== 0 && f === n &&
|
|
659
|
-
const
|
|
660
|
-
return !(g(
|
|
658
|
+
return v === !1 && f !== 0 && f === n && u < e + x && S || i.size === 1 && (function(w, y, _) {
|
|
659
|
+
const L = y._nodeMap.get(w), b = _._nodeMap.get(w), k = y._selection, C = _._selection;
|
|
660
|
+
return !(g(k) && g(C) && k.anchor.type === "element" && k.focus.type === "element" && C.anchor.type === "text" && C.focus.type === "text" || !B(L) || !B(b) || L.__parent !== b.__parent) && JSON.stringify(y.read(() => L.exportJSON())) === JSON.stringify(_.read(() => b.exportJSON()));
|
|
661
661
|
})(Array.from(i)[0], o, a) ? 0 : 1;
|
|
662
662
|
})();
|
|
663
|
-
return e =
|
|
663
|
+
return e = u, n = f, h;
|
|
664
664
|
};
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function _e(r) {
|
|
667
667
|
r.undoStack = [], r.redoStack = [], r.current = null;
|
|
668
668
|
}
|
|
669
669
|
function Ue(r, t, e) {
|
|
670
670
|
const n = ln(r, e);
|
|
671
|
-
return U(r.registerCommand(
|
|
671
|
+
return U(r.registerCommand(Rt, () => ((function(a, s) {
|
|
672
672
|
const i = s.redoStack, l = s.undoStack;
|
|
673
673
|
if (l.length !== 0) {
|
|
674
|
-
const
|
|
675
|
-
|
|
674
|
+
const d = s.current, u = l.pop();
|
|
675
|
+
d !== null && (i.push(d), a.dispatchCommand(W, !0)), l.length === 0 && a.dispatchCommand(J, !1), s.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: te });
|
|
676
676
|
}
|
|
677
677
|
})(r, t), !0), c), r.registerCommand(Bt, () => ((function(a, s) {
|
|
678
678
|
const i = s.redoStack, l = s.undoStack;
|
|
679
679
|
if (i.length !== 0) {
|
|
680
|
-
const
|
|
681
|
-
|
|
682
|
-
const
|
|
683
|
-
i.length === 0 && a.dispatchCommand(W, !1), s.current =
|
|
680
|
+
const d = s.current;
|
|
681
|
+
d !== null && (l.push(d), a.dispatchCommand(J, !0));
|
|
682
|
+
const u = i.pop();
|
|
683
|
+
i.length === 0 && a.dispatchCommand(W, !1), s.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: te });
|
|
684
684
|
}
|
|
685
|
-
})(r, t), !0), c), r.registerCommand($t, () => (
|
|
686
|
-
const
|
|
687
|
-
if (
|
|
688
|
-
const v = n(s, a,
|
|
689
|
-
if (v === 1) f.length !== 0 && (t.redoStack = [], r.dispatchCommand(W, !1)),
|
|
685
|
+
})(r, t), !0), c), r.registerCommand($t, () => (_e(t), !1), c), r.registerCommand(Tt, () => (_e(t), r.dispatchCommand(W, !1), r.dispatchCommand(J, !1), !0), c), r.registerUpdateListener(({ editorState: a, prevEditorState: s, dirtyLeaves: i, dirtyElements: l, tags: d }) => {
|
|
686
|
+
const u = t.current, f = t.redoStack, h = t.undoStack, S = u === null ? null : u.editorState;
|
|
687
|
+
if (u !== null && a === S) return;
|
|
688
|
+
const v = n(s, a, u, i, l, d);
|
|
689
|
+
if (v === 1) f.length !== 0 && (t.redoStack = [], r.dispatchCommand(W, !1)), u !== null && (h.push({ ...u }), r.dispatchCommand(J, !0));
|
|
690
690
|
else if (v === 2) return;
|
|
691
691
|
t.current = { editor: r, editorState: a };
|
|
692
692
|
}));
|
|
@@ -694,39 +694,39 @@ function Ue(r, t, e) {
|
|
|
694
694
|
function He() {
|
|
695
695
|
return { current: null, redoStack: [], undoStack: [] };
|
|
696
696
|
}
|
|
697
|
-
const Q = ne({ build: (r, { delay: t, createInitialHistoryState: e, disabled: n }) => ae({ delay: t, disabled: n, historyState: e(r) }), config:
|
|
697
|
+
const Q = ne({ build: (r, { delay: t, createInitialHistoryState: e, disabled: n }) => ae({ delay: t, disabled: n, historyState: e(r) }), config: Mt({ createInitialHistoryState: He, delay: 300, disabled: typeof window > "u" }), name: "@lexical/history/History", register: (r, t, e) => {
|
|
698
698
|
const n = e.getOutput();
|
|
699
|
-
return
|
|
699
|
+
return Re(() => n.disabled.value ? void 0 : Ue(r, n.historyState.value, n.delay));
|
|
700
700
|
} });
|
|
701
|
-
ne({ dependencies: [
|
|
701
|
+
ne({ dependencies: [At(Q, { createInitialHistoryState: () => {
|
|
702
702
|
throw new Error("SharedHistory did not inherit parent history");
|
|
703
703
|
}, disabled: !0 })], name: "@lexical/history/SharedHistory", register(r, t, e) {
|
|
704
704
|
const { output: n } = e.getDependency(Q), o = (function(s) {
|
|
705
|
-
return s ?
|
|
705
|
+
return s ? Zt(s, Q.name) : null;
|
|
706
706
|
})(r._parentEditor);
|
|
707
707
|
if (!o) return () => {
|
|
708
708
|
};
|
|
709
709
|
const a = o.output;
|
|
710
|
-
return
|
|
710
|
+
return Re(() => Vt(() => {
|
|
711
711
|
n.delay.value = a.delay.value, n.historyState.value = a.historyState.value, n.disabled.value = a.disabled.value;
|
|
712
712
|
}));
|
|
713
713
|
} });
|
|
714
|
-
function
|
|
714
|
+
function un({ delay: r, externalHistoryState: t }) {
|
|
715
715
|
const [e] = D();
|
|
716
716
|
return (function(n, o, a = 1e3) {
|
|
717
717
|
const s = X(() => o || He(), [o]);
|
|
718
718
|
E(() => Ue(n, s, a), [a, n, s]);
|
|
719
719
|
})(e, t, r), null;
|
|
720
720
|
}
|
|
721
|
-
function
|
|
721
|
+
function dn({ hasCellMerge: r = !0, hasCellBackgroundColor: t = !0, hasTabHandler: e = !0, hasHorizontalScroll: n = !1 }) {
|
|
722
722
|
const [o] = D();
|
|
723
723
|
return E(() => {
|
|
724
|
-
or(o) !== n && (ar(o, n), o.registerNodeTransform(
|
|
724
|
+
or(o) !== n && (ar(o, n), o.registerNodeTransform(Me, () => {
|
|
725
725
|
})());
|
|
726
726
|
}, [o, n]), E(() => sr(o), [o]), E(() => ir(o, e), [o, e]), E(() => {
|
|
727
727
|
if (!r) return lr(o);
|
|
728
728
|
}, [o, r]), E(() => {
|
|
729
|
-
if (!t) return o.registerNodeTransform(
|
|
729
|
+
if (!t) return o.registerNodeTransform(Fe, (a) => {
|
|
730
730
|
a.getBackgroundColor() !== null && a.setBackgroundColor(null);
|
|
731
731
|
});
|
|
732
732
|
}, [o, t, r]), null;
|
|
@@ -741,9 +741,9 @@ const We = 200, cn = ({
|
|
|
741
741
|
notValidatedText: s = "",
|
|
742
742
|
maxHeightInRem: i = "20rem",
|
|
743
743
|
maxWords: l = We,
|
|
744
|
-
onChange:
|
|
744
|
+
onChange: d
|
|
745
745
|
}) => {
|
|
746
|
-
const { switchLanguage:
|
|
746
|
+
const { switchLanguage: u } = Sr(), f = vr(), [h] = I(() => ke()), [S, v] = I(0), [N, x] = I(0), w = Ut(null), y = {
|
|
747
747
|
html: {
|
|
748
748
|
export: cr
|
|
749
749
|
},
|
|
@@ -753,39 +753,39 @@ const We = 200, cn = ({
|
|
|
753
753
|
onError(b) {
|
|
754
754
|
throw b;
|
|
755
755
|
},
|
|
756
|
-
nodes: [
|
|
756
|
+
nodes: [Ie, Ae, $e, Be, Fe, ur, Me, xr],
|
|
757
757
|
editorState: (b) => {
|
|
758
|
-
const C = new DOMParser().parseFromString(t, "text/html"),
|
|
759
|
-
|
|
758
|
+
const C = new DOMParser().parseFromString(t, "text/html"), T = er(b, C);
|
|
759
|
+
M().clear(), console.log(T), Pe(T);
|
|
760
760
|
}
|
|
761
|
-
},
|
|
761
|
+
}, _ = (b) => b.trim().length === 0 ? 0 : b.split(" ").length, L = (b, k) => {
|
|
762
762
|
b.read(() => {
|
|
763
763
|
let C = "";
|
|
764
|
-
v(
|
|
764
|
+
v(_(M().getTextContent().replace(/\s+/g, " ").trim())), C = fr(tr(k)), C = mr(C), d(C);
|
|
765
765
|
});
|
|
766
766
|
};
|
|
767
767
|
return E(() => {
|
|
768
|
-
|
|
769
|
-
}, [r,
|
|
768
|
+
u(r.toLocaleLowerCase());
|
|
769
|
+
}, [r, u]), E(() => {
|
|
770
770
|
const b = t.replace(/<br\s*\/?>| /gi, " ").replace(/<\/?[^>]+(>|$)|&[a-z]+;/g, "").replace(/\s+/g, " ").trim();
|
|
771
|
-
v(
|
|
772
|
-
}, []), /* @__PURE__ */
|
|
773
|
-
/* @__PURE__ */
|
|
771
|
+
v(_(b));
|
|
772
|
+
}, []), /* @__PURE__ */ A("div", { className: $.editor__container, children: [
|
|
773
|
+
/* @__PURE__ */ A("div", { className: $.editor__header, children: [
|
|
774
774
|
/* @__PURE__ */ m(Er, { label: n, info: o, required: a }),
|
|
775
|
-
/* @__PURE__ */
|
|
776
|
-
/* @__PURE__ */ m("span", { className:
|
|
775
|
+
/* @__PURE__ */ A("div", { className: $["editor__header-word-count"], children: [
|
|
776
|
+
/* @__PURE__ */ m("span", { className: dr({ [$["editor__header-word-count--alert"]]: S > l }), children: S }),
|
|
777
777
|
" / ",
|
|
778
778
|
l
|
|
779
779
|
] })
|
|
780
780
|
] }),
|
|
781
|
-
/* @__PURE__ */ m("div", { className: $.editor, children: /* @__PURE__ */
|
|
782
|
-
/* @__PURE__ */ m(hr, { editorScrollPosition:
|
|
783
|
-
/* @__PURE__ */
|
|
781
|
+
/* @__PURE__ */ m("div", { className: $.editor, children: /* @__PURE__ */ A(Nr, { initialConfig: y, children: [
|
|
782
|
+
/* @__PURE__ */ m(hr, { editorScrollPosition: N }),
|
|
783
|
+
/* @__PURE__ */ A("div", { className: $["editor__field-wrapper"], children: [
|
|
784
784
|
/* @__PURE__ */ m(
|
|
785
785
|
Ur,
|
|
786
786
|
{
|
|
787
787
|
contentEditable: /* @__PURE__ */ m(
|
|
788
|
-
|
|
788
|
+
jr,
|
|
789
789
|
{
|
|
790
790
|
className: $.editor__field,
|
|
791
791
|
"aria-label": f.common.rteAriaLabel,
|
|
@@ -800,17 +800,17 @@ const We = 200, cn = ({
|
|
|
800
800
|
}
|
|
801
801
|
),
|
|
802
802
|
placeholder: /* @__PURE__ */ m("div", { className: $.editor__placeholder, children: e }),
|
|
803
|
-
ErrorBoundary:
|
|
803
|
+
ErrorBoundary: Gr
|
|
804
804
|
}
|
|
805
805
|
),
|
|
806
|
-
/* @__PURE__ */ m(un, {}),
|
|
807
|
-
/* @__PURE__ */ m(Wt, {}),
|
|
808
806
|
/* @__PURE__ */ m(dn, {}),
|
|
807
|
+
/* @__PURE__ */ m(Wt, {}),
|
|
808
|
+
/* @__PURE__ */ m(un, {}),
|
|
809
809
|
/* @__PURE__ */ m(tn, {}),
|
|
810
810
|
/* @__PURE__ */ m(rn, { validateUrl: pr }),
|
|
811
811
|
/* @__PURE__ */ m(on, { matchers: gr }),
|
|
812
812
|
/* @__PURE__ */ m(an, {}),
|
|
813
|
-
/* @__PURE__ */ m(en, { onChange:
|
|
813
|
+
/* @__PURE__ */ m(en, { onChange: L }),
|
|
814
814
|
/* @__PURE__ */ m(Cr, {})
|
|
815
815
|
] })
|
|
816
816
|
] }) }),
|