@uva-glass/component-library 3.54.0 → 3.54.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { jsx as f, jsxs as A, Fragment as ke } from "react/jsx-runtime";
|
|
2
|
-
import { t as
|
|
3
|
-
import { aw as
|
|
4
|
-
import * as
|
|
5
|
-
import { useMemo as j, useLayoutEffect as J, useEffect as b, useState as M, Suspense as
|
|
6
|
-
import { a as
|
|
7
|
-
import { T as
|
|
8
|
-
import { flushSync as
|
|
9
|
-
import { R as pe, F as ge, m as
|
|
2
|
+
import { t as Ye, r as qe, o as L } from "../../LexicalComposerContext.prod-DOyoZx0P.js";
|
|
3
|
+
import { aw as Pe, J as F, j as Qe, a as p, aE as oe, ay as ae, aF as O, O as se, $ as Xe, _ as B, N as g, Q as H, a8 as Ze, y as d, b0 as Ge, s as Ve, n as et, i as tt, b1 as rt, b2 as nt, a4 as ot, l as D, aL as at, A as st, b3 as it, b4 as lt, M as re, b5 as ut, b6 as ct, ad as dt, C as ft, r as Le, Y as mt, b7 as pt, b8 as ue, d as ce, a3 as gt, a1 as G, a2 as ht, ae as Te, b9 as de, R as vt, T as yt, K as Ct, ba as fe, P as bt, bb as Et, bc as wt, ap as De, aY as St, a6 as xt, U as Re, a5 as _t, bd as Nt, a7 as $t, a0 as kt, Z as Pt, x as Lt, aN as q, aM as Q, be as Tt, bf as Dt, aP as Rt, bg as ne, aO as Bt, bh as It, bi as Mt, aC as At } from "../../Lexical.prod-YJ1n9pVJ.js";
|
|
4
|
+
import * as Ft from "react";
|
|
5
|
+
import { useMemo as j, useLayoutEffect as J, useEffect as b, useState as M, Suspense as Ut, forwardRef as Be, useCallback as Kt, Component as zt, createElement as me, createContext as Ot, useId as Ht } from "react";
|
|
6
|
+
import { a as jt, T as Jt } from "../../TableCellResizerPlugin-BTfuE_kM.js";
|
|
7
|
+
import { T as Wt, d as ie, F as Yt, c as Ie, B as qt, Q as Qt } from "../../LexicalExtension.prod-2-giLTv9.js";
|
|
8
|
+
import { flushSync as Xt, createPortal as Zt } from "react-dom";
|
|
9
|
+
import { R as pe, F as ge, m as Gt, g as Vt } from "../../LexicalClipboard.prod-CDPAGlNs.js";
|
|
10
10
|
import { A as he, Z as ve, n as ye } from "../../LexicalSelection.prod-CpZE7Sey.js";
|
|
11
|
-
import { A as K, y as
|
|
12
|
-
import { l as Me, n as Ae, L as
|
|
13
|
-
import { N as Fe, K as
|
|
14
|
-
import { f as
|
|
11
|
+
import { A as K, y as er } from "../../LexicalUtils.prod-BQnuAaA9.js";
|
|
12
|
+
import { l as Me, n as Ae, L as tr, b as rr } from "../../LexicalList.prod-DMU0XSLO.js";
|
|
13
|
+
import { N as Fe, K as nr, w as Ue, l as or, z as ar } from "../../LexicalLink.prod-u8L4ioQd.js";
|
|
14
|
+
import { f as sr, g as ir, m as Ke, R as lr, T as ur, x as cr, A as ze, W as dr } from "../../LexicalTable.prod-BOlKc5zf.js";
|
|
15
15
|
import { c as Ce } from "../../clsx-OuTLNxxd.js";
|
|
16
|
-
import { exportMap as
|
|
17
|
-
import { validateUrl as
|
|
16
|
+
import { exportMap as fr, mergeBoldStrongTags as mr, cleanUpTable as pr } from "./helpers.js";
|
|
17
|
+
import { validateUrl as gr, MATCHERS as hr } from "./Plugins/LinkPlugin/helpers.js";
|
|
18
18
|
import { s as R } from "../../RteEditor.module-DaBh86FK.js";
|
|
19
|
-
import { ToolBarPlugin as
|
|
20
|
-
import { useTranslation as
|
|
19
|
+
import { ToolBarPlugin as vr } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
|
|
20
|
+
import { useTranslation as yr } from "./hooks/useTranslation.js";
|
|
21
21
|
import "../../TablePlugin-bFqq2Yd9.js";
|
|
22
22
|
import "./Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js";
|
|
23
23
|
import "./hooks/components/Flyout.js";
|
|
@@ -26,7 +26,7 @@ import "../Buttons/Button.js";
|
|
|
26
26
|
import "../Buttons/LinkButton.js";
|
|
27
27
|
import "@react-aria/button";
|
|
28
28
|
import "../Checkbox/Checkbox.js";
|
|
29
|
-
import { FeedbackBox as
|
|
29
|
+
import { FeedbackBox as Cr } from "../FeedbackBox/FeedbackBox.js";
|
|
30
30
|
import "@react-aria/dialog";
|
|
31
31
|
import "@react-aria/focus";
|
|
32
32
|
import "@react-aria/overlays";
|
|
@@ -42,16 +42,16 @@ import "../SelectListbox/SelectProvider.js";
|
|
|
42
42
|
import "../Sortable/components/SortableItem.js";
|
|
43
43
|
import "../../SortableProvider-BbwlEPIr.js";
|
|
44
44
|
import "../WeekSelector/components/WeekSelectorOptionContainer.js";
|
|
45
|
-
import { PasteHandlerPlugin as
|
|
46
|
-
import { UvaTheme as
|
|
47
|
-
import { EditorHeader as
|
|
48
|
-
import { LanguageProvider as
|
|
49
|
-
import { TableWrapperNode as
|
|
50
|
-
import { CourseCatalogueNode as
|
|
51
|
-
const Oe = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0,
|
|
45
|
+
import { PasteHandlerPlugin as br } from "./Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js";
|
|
46
|
+
import { UvaTheme as Er } from "./UvaTheme/UvaTheme.js";
|
|
47
|
+
import { EditorHeader as wr } from "./EditorHeader/EditorHeader.js";
|
|
48
|
+
import { LanguageProvider as Sr, useLanguage as xr } from "./Providers/LanguageProvider.js";
|
|
49
|
+
import { TableWrapperNode as _r } from "./nodes/TableWrapperNode/TableWrapperNode.js";
|
|
50
|
+
import { CourseCatalogueNode as Nr, CourseCatalogueLinkPlugin as $r } from "./nodes/CourseCatalogueNode/CourseCatalogueNode.js";
|
|
51
|
+
const Oe = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, kr = Oe ? J : b, X = { tag: oe };
|
|
52
52
|
function Pr({ initialConfig: r, children: e }) {
|
|
53
53
|
const t = j(() => {
|
|
54
|
-
const { theme: n, namespace: o, nodes: a, onError: s, editorState: i, html: l } = r, c =
|
|
54
|
+
const { theme: n, namespace: o, nodes: a, onError: s, editorState: i, html: l } = r, c = Ye(null, n), u = Pe({ 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(() => {
|
|
@@ -62,47 +62,47 @@ function Pr({ initialConfig: r, children: e }) {
|
|
|
62
62
|
const x = Oe ? document.activeElement : null;
|
|
63
63
|
(p() !== null || x !== null && x === m.getRootElement()) && y.select();
|
|
64
64
|
}
|
|
65
|
-
},
|
|
65
|
+
}, X);
|
|
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, X);
|
|
70
70
|
break;
|
|
71
71
|
}
|
|
72
72
|
case "object":
|
|
73
|
-
m.setEditorState(h,
|
|
73
|
+
m.setEditorState(h, X);
|
|
74
74
|
break;
|
|
75
75
|
case "function":
|
|
76
76
|
m.update(() => {
|
|
77
77
|
F().isEmpty() && h(m);
|
|
78
|
-
},
|
|
78
|
+
}, X);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
})(u, i), [u, c];
|
|
82
82
|
}, []);
|
|
83
|
-
return
|
|
83
|
+
return kr(() => {
|
|
84
84
|
const n = r.editable, [o] = t;
|
|
85
85
|
o.setEditable(n === void 0 || n);
|
|
86
|
-
}, []), f(
|
|
86
|
+
}, []), f(qe.Provider, { value: t, children: e });
|
|
87
87
|
}
|
|
88
|
-
const
|
|
89
|
-
function
|
|
88
|
+
const Lr = ae({ name: "@lexical/react/ReactProvider" });
|
|
89
|
+
function Tr() {
|
|
90
90
|
return F().getTextContent();
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function Dr(r, e = !0) {
|
|
93
93
|
if (r) return !1;
|
|
94
|
-
let t =
|
|
94
|
+
let t = Tr();
|
|
95
95
|
return e && (t = t.trim()), t === "";
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
if (!
|
|
97
|
+
function Rr(r) {
|
|
98
|
+
if (!Dr(r, !1)) return !1;
|
|
99
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
103
|
if (O(o)) return !1;
|
|
104
104
|
if (se(o)) {
|
|
105
|
-
if (!
|
|
105
|
+
if (!Xe(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];
|
|
@@ -113,9 +113,9 @@ function Br(r) {
|
|
|
113
113
|
return !0;
|
|
114
114
|
}
|
|
115
115
|
function He(r) {
|
|
116
|
-
return () =>
|
|
116
|
+
return () => Rr(r);
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function Br(r) {
|
|
119
119
|
const e = window.location.origin, t = (n) => {
|
|
120
120
|
if (n.origin !== e) return;
|
|
121
121
|
const o = r.getRootElement();
|
|
@@ -167,7 +167,7 @@ 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,
|
|
170
|
+
const U = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Ir = U && "documentMode" in document ? document.documentMode : null, Mr = U && /Mac|iPod|iPhone|iPad/.test(navigator.platform), Ar = !(!U || !("InputEvent" in window) || Ir) && "getTargetRanges" in new window.InputEvent("input"), Fr = U && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Ee = U && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Ur = U && /^(?=.*Chrome).*/i.test(navigator.userAgent), Kr = U && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && Mr && !Ur, we = et("DRAG_DROP_PASTE_FILE");
|
|
171
171
|
function Z(r) {
|
|
172
172
|
let e = null;
|
|
173
173
|
if (K(r, DragEvent) ? e = r.dataTransfer : K(r, ClipboardEvent) && (e = r.clipboardData), e === null) return [!1, [], !1];
|
|
@@ -195,8 +195,8 @@ function xe(r) {
|
|
|
195
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 H(r.registerCommand(
|
|
198
|
+
function zr(r) {
|
|
199
|
+
return H(r.registerCommand(Lt, (e) => {
|
|
200
200
|
const t = p();
|
|
201
201
|
return !!D(t) && (t.clear(), !0);
|
|
202
202
|
}, d), r.registerCommand(G, (e) => {
|
|
@@ -205,10 +205,10 @@ function Or(r) {
|
|
|
205
205
|
}, d), r.registerCommand(Pt, (e) => {
|
|
206
206
|
const t = p();
|
|
207
207
|
return !!g(t) && (t.deleteWord(e), !0);
|
|
208
|
-
}, d), r.registerCommand(
|
|
208
|
+
}, d), r.registerCommand(kt, (e) => {
|
|
209
209
|
const t = p();
|
|
210
210
|
return !!g(t) && (t.deleteLine(e), !0);
|
|
211
|
-
}, d), r.registerCommand(
|
|
211
|
+
}, d), r.registerCommand($t, (e) => {
|
|
212
212
|
const t = p();
|
|
213
213
|
if (typeof e == "string") t !== null && t.insertText(e);
|
|
214
214
|
else {
|
|
@@ -221,13 +221,13 @@ function Or(r) {
|
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
return !0;
|
|
224
|
-
}, d), r.registerCommand(
|
|
224
|
+
}, d), r.registerCommand(Nt, () => {
|
|
225
225
|
const e = p();
|
|
226
226
|
return !!g(e) && (e.removeText(), !0);
|
|
227
|
-
}, d), r.registerCommand(
|
|
227
|
+
}, d), r.registerCommand(_t, (e) => {
|
|
228
228
|
const t = p();
|
|
229
229
|
return !!g(t) && (t.formatText(e), !0);
|
|
230
|
-
}, d), r.registerCommand(
|
|
230
|
+
}, d), r.registerCommand(xt, (e) => {
|
|
231
231
|
const t = p();
|
|
232
232
|
if (!g(t) && !D(t)) return !1;
|
|
233
233
|
const n = t.getNodes();
|
|
@@ -242,13 +242,13 @@ function Or(r) {
|
|
|
242
242
|
}, d), r.registerCommand(ce, () => {
|
|
243
243
|
const e = p();
|
|
244
244
|
return !!g(e) && (e.insertParagraph(), !0);
|
|
245
|
-
}, d), r.registerCommand(
|
|
245
|
+
}, d), r.registerCommand(wt, () => (De([St()]), !0), d), r.registerCommand(Et, () => 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
|
-
}), d), r.registerCommand(
|
|
251
|
+
}), d), r.registerCommand(bt, (e) => {
|
|
252
252
|
const t = p();
|
|
253
253
|
if (D(t)) {
|
|
254
254
|
const n = t.getNodes();
|
|
@@ -258,7 +258,7 @@ function Or(r) {
|
|
|
258
258
|
if (!e.shiftKey && O(n) && !n.isIsolated() && !n.isInline()) return n.selectPrevious(), e.preventDefault(), !0;
|
|
259
259
|
}
|
|
260
260
|
return !1;
|
|
261
|
-
}, d), r.registerCommand(
|
|
261
|
+
}, d), r.registerCommand(Ct, (e) => {
|
|
262
262
|
const t = p();
|
|
263
263
|
if (D(t)) {
|
|
264
264
|
const n = t.getNodes();
|
|
@@ -272,7 +272,7 @@ function Or(r) {
|
|
|
272
272
|
if (!e.shiftKey && O(n) && !n.isIsolated() && !n.isInline()) return n.selectNext(), e.preventDefault(), !0;
|
|
273
273
|
}
|
|
274
274
|
return !1;
|
|
275
|
-
}, d), r.registerCommand(
|
|
275
|
+
}, d), r.registerCommand(yt, (e) => {
|
|
276
276
|
const t = p();
|
|
277
277
|
if (D(t)) {
|
|
278
278
|
const n = t.getNodes();
|
|
@@ -284,7 +284,7 @@ function Or(r) {
|
|
|
284
284
|
return e.preventDefault(), ye(t, n, !0), !0;
|
|
285
285
|
}
|
|
286
286
|
return !1;
|
|
287
|
-
}, d), r.registerCommand(
|
|
287
|
+
}, d), r.registerCommand(vt, (e) => {
|
|
288
288
|
const t = p();
|
|
289
289
|
if (D(t)) {
|
|
290
290
|
const o = t.getNodes();
|
|
@@ -293,7 +293,7 @@ function Or(r) {
|
|
|
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
|
-
}, d), r.registerCommand(
|
|
296
|
+
}, d), r.registerCommand(ht, (e) => {
|
|
297
297
|
if (xe(e.target)) return !1;
|
|
298
298
|
const t = p();
|
|
299
299
|
if (g(t)) {
|
|
@@ -303,42 +303,42 @@ function Or(r) {
|
|
|
303
303
|
if (o.offset !== 0) return !1;
|
|
304
304
|
const a = o.getNode();
|
|
305
305
|
if (Te(a)) return !1;
|
|
306
|
-
const s =
|
|
306
|
+
const s = er(a);
|
|
307
307
|
return s.getIndent() > 0 && (s.is(a) || a.is(s.getFirstDescendant()));
|
|
308
308
|
})(t)) return e.preventDefault(), r.dispatchCommand(de, void 0);
|
|
309
309
|
if (Ee && navigator.language === "ko-KR") return !1;
|
|
310
310
|
} else if (!D(t)) return !1;
|
|
311
311
|
return e.preventDefault(), r.dispatchCommand(G, !0);
|
|
312
|
-
}, d), r.registerCommand(
|
|
312
|
+
}, d), r.registerCommand(gt, (e) => {
|
|
313
313
|
if (xe(e.target)) return !1;
|
|
314
314
|
const t = p();
|
|
315
315
|
return !(!g(t) && !D(t)) && (e.preventDefault(), r.dispatchCommand(G, !1));
|
|
316
|
-
}, d), r.registerCommand(
|
|
316
|
+
}, d), r.registerCommand(pt, (e) => {
|
|
317
317
|
const t = p();
|
|
318
318
|
if (!g(t)) return !1;
|
|
319
319
|
if (V(t), e !== null) {
|
|
320
|
-
if ((Ee ||
|
|
320
|
+
if ((Ee || Fr || Kr) && Ar) return !1;
|
|
321
321
|
if (e.preventDefault(), e.shiftKey) return r.dispatchCommand(ue, !1);
|
|
322
322
|
}
|
|
323
323
|
return r.dispatchCommand(ce, void 0);
|
|
324
|
-
}, d), r.registerCommand(
|
|
324
|
+
}, d), r.registerCommand(mt, () => {
|
|
325
325
|
const e = p();
|
|
326
326
|
return !!g(e) && (r.blur(), !0);
|
|
327
|
-
}, d), r.registerCommand(
|
|
327
|
+
}, d), r.registerCommand(ct, (e) => {
|
|
328
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
|
-
const l =
|
|
334
|
+
const l = dt();
|
|
335
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 c =
|
|
341
|
-
|
|
340
|
+
const c = ft(l);
|
|
341
|
+
Le(c);
|
|
342
342
|
}
|
|
343
343
|
r.dispatchCommand(we, t);
|
|
344
344
|
}
|
|
@@ -346,10 +346,10 @@ function Or(r) {
|
|
|
346
346
|
}
|
|
347
347
|
const n = p();
|
|
348
348
|
return !!g(n);
|
|
349
|
-
}, d), r.registerCommand(
|
|
349
|
+
}, d), r.registerCommand(ut, (e) => {
|
|
350
350
|
const [t] = Z(e), n = p();
|
|
351
351
|
return !(t && !g(n));
|
|
352
|
-
}, d), r.registerCommand(
|
|
352
|
+
}, d), r.registerCommand(lt, (e) => {
|
|
353
353
|
const [t] = Z(e), n = p();
|
|
354
354
|
if (t && !g(n)) return !1;
|
|
355
355
|
const o = be(e.clientX, e.clientY);
|
|
@@ -358,39 +358,39 @@ function Or(r) {
|
|
|
358
358
|
O(a) && e.preventDefault();
|
|
359
359
|
}
|
|
360
360
|
return !0;
|
|
361
|
-
}, d), r.registerCommand(
|
|
361
|
+
}, d), r.registerCommand(st, () => (it(), !0), d), r.registerCommand(at, (e) => (ge(r, K(e, ClipboardEvent) ? e : null), !0), d), r.registerCommand(ot, (e) => ((async function(t, n) {
|
|
362
362
|
await ge(n, K(t, ClipboardEvent) ? t : null), n.update(() => {
|
|
363
363
|
const o = p();
|
|
364
364
|
g(o) ? o.removeText() : D(o) && o.getNodes().forEach((a) => a.remove());
|
|
365
365
|
});
|
|
366
|
-
})(e, r), !0), d), r.registerCommand(
|
|
366
|
+
})(e, r), !0), d), r.registerCommand(Ve, (e) => {
|
|
367
367
|
const [, t, n] = Z(e);
|
|
368
|
-
return t.length > 0 && !n ? (r.dispatchCommand(we, t), !0) :
|
|
368
|
+
return t.length > 0 && !n ? (r.dispatchCommand(we, t), !0) : tt(e.target) && rt(e.target) ? !1 : p() !== null && ((function(o, a) {
|
|
369
369
|
o.preventDefault(), a.update(() => {
|
|
370
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
|
-
}, { tag:
|
|
372
|
+
}, { tag: nt });
|
|
373
373
|
})(e, r), !0);
|
|
374
|
-
}, d), r.registerCommand(
|
|
374
|
+
}, d), r.registerCommand(Ge, (e) => {
|
|
375
375
|
const t = p();
|
|
376
376
|
return g(t) && V(t), !1;
|
|
377
|
-
}, d), r.registerCommand(
|
|
377
|
+
}, d), r.registerCommand(Ze, (e) => {
|
|
378
378
|
const t = p();
|
|
379
379
|
return g(t) && V(t), !1;
|
|
380
380
|
}, d));
|
|
381
381
|
}
|
|
382
|
-
function
|
|
382
|
+
function Or(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
388
|
const le = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? J : b;
|
|
389
|
-
function
|
|
389
|
+
function Hr({ 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
|
+
Xt(() => {
|
|
394
394
|
a(s);
|
|
395
395
|
});
|
|
396
396
|
}), [t]), b(() => {
|
|
@@ -398,34 +398,34 @@ function jr({ editor: r, ErrorBoundary: e }) {
|
|
|
398
398
|
}, [t]), j(() => {
|
|
399
399
|
const s = [], i = Object.keys(o);
|
|
400
400
|
for (let l = 0; l < i.length; l++) {
|
|
401
|
-
const c = i[l], u = f(n, { onError: (h) => t._onError(h), children: f(
|
|
402
|
-
m !== null && s.push(
|
|
401
|
+
const c = i[l], u = f(n, { onError: (h) => t._onError(h), children: f(Ut, { fallback: null, children: o[c] }) }), m = t.getElementByKey(c);
|
|
402
|
+
m !== null && s.push(Zt(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 = Wt.maybeFromEditor(t);
|
|
411
|
+
if (n && n.hasExtensionByName(Lr.name)) {
|
|
412
|
+
for (const o of ["@lexical/plain-text", "@lexical/rich-text"]) n.hasExtensionByName(o) && Or(320, o);
|
|
413
413
|
return !0;
|
|
414
414
|
}
|
|
415
415
|
return !1;
|
|
416
|
-
})(r) ? null : f(
|
|
416
|
+
})(r) ? null : f(Hr, { editor: r, ErrorBoundary: e });
|
|
417
417
|
}
|
|
418
418
|
function _e(r) {
|
|
419
419
|
return r.getEditorState().read(He(r.isComposing()));
|
|
420
420
|
}
|
|
421
|
-
function
|
|
422
|
-
const [n] =
|
|
421
|
+
function Jr({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
|
|
422
|
+
const [n] = L();
|
|
423
423
|
return (function(o) {
|
|
424
|
-
le(() => H(
|
|
425
|
-
})(n), A(ke, { children: [r, f(
|
|
424
|
+
le(() => H(zr(o), Br(o)), [o]);
|
|
425
|
+
})(n), A(ke, { children: [r, f(Wr, { content: e }), f(jr, { editor: n, ErrorBoundary: t })] });
|
|
426
426
|
}
|
|
427
|
-
function
|
|
428
|
-
const [e] =
|
|
427
|
+
function Wr({ content: r }) {
|
|
428
|
+
const [e] = L(), t = (function(o) {
|
|
429
429
|
const [a, s] = M(() => _e(o));
|
|
430
430
|
return le(() => {
|
|
431
431
|
function i() {
|
|
@@ -438,12 +438,12 @@ function Yr({ content: r }) {
|
|
|
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
444
|
const je = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? J : b;
|
|
445
|
-
function
|
|
446
|
-
const [w, I] = M(r.isEditable()), N =
|
|
445
|
+
function Yr({ 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, ...P }, k) {
|
|
446
|
+
const [w, I] = M(r.isEditable()), N = Kt(($) => {
|
|
447
447
|
$ && $.ownerDocument && $.ownerDocument.defaultView ? r.setRootElement($) : r.setRootElement(null);
|
|
448
448
|
}, [r]), W = j(() => /* @__PURE__ */ (function(...$) {
|
|
449
449
|
return (Y) => {
|
|
@@ -452,18 +452,18 @@ function qr({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaContr
|
|
|
452
452
|
})(k, N), [N, k]);
|
|
453
453
|
return je(() => (I(r.isEditable()), r.registerEditableListener(($) => {
|
|
454
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: _, ...
|
|
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: _, ...P });
|
|
456
456
|
}
|
|
457
|
-
const
|
|
457
|
+
const qr = Be(Yr);
|
|
458
458
|
function Ne(r) {
|
|
459
459
|
return r.getEditorState().read(He(r.isComposing()));
|
|
460
460
|
}
|
|
461
|
-
const Qr = Be(
|
|
462
|
-
function
|
|
463
|
-
const { placeholder: t, ...n } = r, [o] =
|
|
464
|
-
return A(ke, { children: [f(
|
|
461
|
+
const Qr = Be(Xr);
|
|
462
|
+
function Xr(r, e) {
|
|
463
|
+
const { placeholder: t, ...n } = r, [o] = L();
|
|
464
|
+
return A(ke, { children: [f(qr, { editor: o, ...n, ref: e }), t != null && f(Zr, { editor: o, content: t })] });
|
|
465
465
|
}
|
|
466
|
-
function
|
|
466
|
+
function Zr({ content: r, editor: e }) {
|
|
467
467
|
const t = (function(s) {
|
|
468
468
|
const [i, l] = M(() => Ne(s));
|
|
469
469
|
return je(() => {
|
|
@@ -484,11 +484,11 @@ function Gr({ content: r, editor: e }) {
|
|
|
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 Gr = Ot(null), ee = {
|
|
488
488
|
didCatch: !1,
|
|
489
489
|
error: null
|
|
490
490
|
};
|
|
491
|
-
class
|
|
491
|
+
class Vr extends zt {
|
|
492
492
|
constructor(e) {
|
|
493
493
|
super(e), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = ee;
|
|
494
494
|
}
|
|
@@ -507,7 +507,7 @@ class en extends Ot {
|
|
|
507
507
|
}
|
|
508
508
|
componentDidUpdate(e, t) {
|
|
509
509
|
const { didCatch: n } = this.state, { resetKeys: o } = this.props;
|
|
510
|
-
n && t.error !== null &&
|
|
510
|
+
n && t.error !== null && en(e.resetKeys, o) && (this.props.onReset?.({
|
|
511
511
|
next: o,
|
|
512
512
|
prev: e.resetKeys,
|
|
513
513
|
reason: "keys"
|
|
@@ -531,7 +531,7 @@ class en extends Ot {
|
|
|
531
531
|
throw s;
|
|
532
532
|
}
|
|
533
533
|
return me(
|
|
534
|
-
|
|
534
|
+
Gr.Provider,
|
|
535
535
|
{
|
|
536
536
|
value: {
|
|
537
537
|
didCatch: a,
|
|
@@ -543,38 +543,38 @@ class en extends Ot {
|
|
|
543
543
|
);
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
|
-
function
|
|
546
|
+
function en(r = [], e = []) {
|
|
547
547
|
return r.length !== e.length || r.some((t, n) => !Object.is(t, e[n]));
|
|
548
548
|
}
|
|
549
|
-
function
|
|
550
|
-
return f(
|
|
549
|
+
function tn({ children: r, onError: e }) {
|
|
550
|
+
return f(Vr, { 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
|
|
553
|
-
function
|
|
554
|
-
const [n] =
|
|
555
|
-
return
|
|
552
|
+
const rn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? J : b;
|
|
553
|
+
function nn({ ignoreHistoryMergeTagChange: r = !0, ignoreSelectionChange: e = !1, onChange: t }) {
|
|
554
|
+
const [n] = L();
|
|
555
|
+
return rn(() => {
|
|
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);
|
|
558
558
|
});
|
|
559
559
|
}, [n, r, e, t]), null;
|
|
560
560
|
}
|
|
561
|
-
function
|
|
562
|
-
const [e] =
|
|
561
|
+
function on({ hasStrictIndent: r = !1 }) {
|
|
562
|
+
const [e] = L();
|
|
563
563
|
return b(() => {
|
|
564
564
|
if (!e.hasNodes([Me, Ae])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
|
|
565
565
|
}, [e]), b(() => {
|
|
566
|
-
if (r) return
|
|
566
|
+
if (r) return tr(e);
|
|
567
567
|
}, [e, r]), (function(t) {
|
|
568
|
-
b(() =>
|
|
568
|
+
b(() => rr(t), [t]);
|
|
569
569
|
})(e), null;
|
|
570
570
|
}
|
|
571
|
-
function
|
|
572
|
-
const [t] =
|
|
571
|
+
function an({ validateUrl: r, attributes: e }) {
|
|
572
|
+
const [t] = L();
|
|
573
573
|
return b(() => {
|
|
574
574
|
if (!t.hasNodes([Fe])) throw new Error("LinkPlugin: LinkNode not registered on editor");
|
|
575
|
-
}), b(() =>
|
|
575
|
+
}), b(() => nr(t, ie({ attributes: e, validateUrl: r })), [t, r, e]), null;
|
|
576
576
|
}
|
|
577
|
-
function
|
|
577
|
+
function sn(r, e, t) {
|
|
578
578
|
b(() => {
|
|
579
579
|
r.hasNodes([Ue]) || (function(n, ...o) {
|
|
580
580
|
const a = new URL("https://lexical.dev/docs/error"), s = new URLSearchParams();
|
|
@@ -582,33 +582,33 @@ function ln(r, e, t) {
|
|
|
582
582
|
for (const i of o) s.append("v", i);
|
|
583
583
|
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.`);
|
|
584
584
|
})(77);
|
|
585
|
-
}), b(() =>
|
|
585
|
+
}), b(() => or(r, { changeHandlers: t ? [t] : [], matchers: e }), [r, e, t]);
|
|
586
586
|
}
|
|
587
|
-
function
|
|
588
|
-
const [t] =
|
|
589
|
-
return
|
|
587
|
+
function ln({ matchers: r, onChange: e }) {
|
|
588
|
+
const [t] = L();
|
|
589
|
+
return sn(t, r, e), null;
|
|
590
590
|
}
|
|
591
|
-
function
|
|
592
|
-
const [t] =
|
|
593
|
-
return b(() =>
|
|
591
|
+
function un({ newTab: r = !0, disabled: e = !1 }) {
|
|
592
|
+
const [t] = L();
|
|
593
|
+
return b(() => ar(t, ie({ disabled: e, newTab: r })), [t, r, e]), null;
|
|
594
594
|
}
|
|
595
|
-
function
|
|
595
|
+
function cn(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 T = C._nodeMap,
|
|
601
|
+
const T = C._nodeMap, P = [];
|
|
602
602
|
for (const k of v) {
|
|
603
603
|
const w = T.get(k);
|
|
604
|
-
w !== void 0 &&
|
|
604
|
+
w !== void 0 && P.push(w);
|
|
605
605
|
}
|
|
606
606
|
for (const [k, w] of _) {
|
|
607
607
|
if (!w) continue;
|
|
608
608
|
const I = T.get(k);
|
|
609
|
-
I === void 0 || Te(I) ||
|
|
609
|
+
I === void 0 || Te(I) || P.push(I);
|
|
610
610
|
}
|
|
611
|
-
return
|
|
611
|
+
return P;
|
|
612
612
|
})(e, t, n);
|
|
613
613
|
if (i.length === 0) return 0;
|
|
614
614
|
if (i.length > 1) {
|
|
@@ -624,21 +624,21 @@ function dn(r, e, t, n, o) {
|
|
|
624
624
|
const y = h.offset, x = S.offset, E = m.length - u.length;
|
|
625
625
|
return E === 1 && x === y - 1 ? 2 : E === -1 && x === y + 1 ? 3 : E === -1 && x === y ? 4 : 0;
|
|
626
626
|
}
|
|
627
|
-
function
|
|
627
|
+
function dn(r, e) {
|
|
628
628
|
let t = Date.now(), n = 0;
|
|
629
629
|
return (o, a, s, i, l, c) => {
|
|
630
630
|
const u = Date.now();
|
|
631
631
|
if (c.has(ne)) return n = 0, t = u, 2;
|
|
632
|
-
const m =
|
|
633
|
-
const S = s === null || s.editor === r, y = c.has(
|
|
632
|
+
const m = cn(o, a, i, l, r.isComposing()), h = (() => {
|
|
633
|
+
const S = s === null || s.editor === r, y = c.has(It);
|
|
634
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 T = v._nodeMap.get(C),
|
|
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(
|
|
640
|
+
const T = v._nodeMap.get(C), P = _._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(P) || T.__parent !== P.__parent) && JSON.stringify(v.read(() => T.exportJSON())) === JSON.stringify(_.read(() => P.exportJSON()));
|
|
642
642
|
})(Array.from(i)[0], o, a) ? 0 : 1;
|
|
643
643
|
})();
|
|
644
644
|
return t = u, n = m, h;
|
|
@@ -648,26 +648,26 @@ function $e(r) {
|
|
|
648
648
|
r.undoStack = [], r.redoStack = [], r.current = null;
|
|
649
649
|
}
|
|
650
650
|
function Je(r, e, t) {
|
|
651
|
-
const n =
|
|
652
|
-
return H(r.registerCommand(
|
|
651
|
+
const n = dn(r, t);
|
|
652
|
+
return H(r.registerCommand(Bt, () => ((function(a, s) {
|
|
653
653
|
const i = s.redoStack, l = s.undoStack;
|
|
654
654
|
if (l.length !== 0) {
|
|
655
655
|
const c = s.current, u = l.pop();
|
|
656
|
-
c !== null && (i.push(c), a.dispatchCommand(q, !0)), l.length === 0 && a.dispatchCommand(
|
|
656
|
+
c !== null && (i.push(c), a.dispatchCommand(q, !0)), l.length === 0 && a.dispatchCommand(Q, !1), s.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: ne });
|
|
657
657
|
}
|
|
658
|
-
})(r, e), !0), d), r.registerCommand(
|
|
658
|
+
})(r, e), !0), d), r.registerCommand(Rt, () => ((function(a, s) {
|
|
659
659
|
const i = s.redoStack, l = s.undoStack;
|
|
660
660
|
if (i.length !== 0) {
|
|
661
661
|
const c = s.current;
|
|
662
|
-
c !== null && (l.push(c), a.dispatchCommand(
|
|
662
|
+
c !== null && (l.push(c), a.dispatchCommand(Q, !0));
|
|
663
663
|
const u = i.pop();
|
|
664
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), d), r.registerCommand(
|
|
666
|
+
})(r, e), !0), d), r.registerCommand(Dt, () => ($e(e), !1), d), r.registerCommand(Tt, () => ($e(e), r.dispatchCommand(q, !1), r.dispatchCommand(Q, !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
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(
|
|
670
|
+
if (y === 1) m.length !== 0 && (e.redoStack = [], r.dispatchCommand(q, !1)), u !== null && (h.push({ ...u }), r.dispatchCommand(Q, !0));
|
|
671
671
|
else if (y === 2) return;
|
|
672
672
|
e.current = { editor: r, editorState: a };
|
|
673
673
|
}));
|
|
@@ -675,52 +675,52 @@ function Je(r, e, t) {
|
|
|
675
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: At({ createInitialHistoryState: We, delay: 300, disabled: typeof window > "u" }), name: "@lexical/history/History", register: (r, e, t) => {
|
|
679
679
|
const n = t.getOutput();
|
|
680
680
|
return Ie(() => n.disabled.value ? void 0 : Je(r, n.historyState.value, n.delay));
|
|
681
681
|
} });
|
|
682
|
-
ae({ dependencies: [
|
|
682
|
+
ae({ dependencies: [Mt(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 ? Yt(s, te.name) : null;
|
|
687
687
|
})(r._parentEditor);
|
|
688
688
|
if (!o) return () => {
|
|
689
689
|
};
|
|
690
690
|
const a = o.output;
|
|
691
|
-
return Ie(() =>
|
|
691
|
+
return Ie(() => qt(() => {
|
|
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
|
-
function
|
|
696
|
-
const [t] =
|
|
695
|
+
function fn({ delay: r, externalHistoryState: e }) {
|
|
696
|
+
const [t] = L();
|
|
697
697
|
return (function(n, o, a = 1e3) {
|
|
698
698
|
const s = j(() => o || We(), [o]);
|
|
699
699
|
b(() => Je(n, s, a), [a, n, s]);
|
|
700
700
|
})(t, e, r), null;
|
|
701
701
|
}
|
|
702
|
-
function
|
|
703
|
-
const [a] =
|
|
702
|
+
function mn({ hasCellMerge: r = !0, hasCellBackgroundColor: e = !0, hasTabHandler: t = !0, hasHorizontalScroll: n = !1, hasNestedTables: o = !1 }) {
|
|
703
|
+
const [a] = L();
|
|
704
704
|
b(() => {
|
|
705
|
-
|
|
705
|
+
sr(a) !== n && (ir(a, n), a.registerNodeTransform(Ke, () => {
|
|
706
706
|
})());
|
|
707
707
|
}, [a, n]);
|
|
708
708
|
const s = j(() => Qt(!1), []);
|
|
709
|
-
return s.peek() !== o && (s.value = o), b(() =>
|
|
710
|
-
if (!r) return
|
|
709
|
+
return s.peek() !== o && (s.value = o), b(() => lr(a, { hasNestedTables: s }), [a, s]), b(() => ur(a, t), [a, t]), b(() => {
|
|
710
|
+
if (!r) return cr(a);
|
|
711
711
|
}, [a, r]), b(() => {
|
|
712
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
|
-
function
|
|
718
|
-
const [e] =
|
|
719
|
-
return
|
|
717
|
+
function pn({ editorRef: r }) {
|
|
718
|
+
const [e] = L();
|
|
719
|
+
return Ft.useEffect(() => {
|
|
720
720
|
typeof r == "function" ? r(e) : typeof r == "object" && (r.current = e);
|
|
721
721
|
}, [e]), null;
|
|
722
722
|
}
|
|
723
|
-
const
|
|
723
|
+
const gn = ({
|
|
724
724
|
currentLanguage: r = "NL",
|
|
725
725
|
initialValue: e = "",
|
|
726
726
|
placeholder: t = "",
|
|
@@ -730,19 +730,19 @@ const Ye = 200, hn = ({
|
|
|
730
730
|
notValid: s = !1,
|
|
731
731
|
notValidatedText: i = "",
|
|
732
732
|
maxHeightInRem: l = "20rem",
|
|
733
|
-
maxWords: c
|
|
733
|
+
maxWords: c,
|
|
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 } =
|
|
739
|
+
const { switchLanguage: y } = xr(), x = yr(), [E] = M(() => Pe()), [C, v] = M(0), [_, T] = M(0), P = Ht(), k = {
|
|
740
740
|
html: {
|
|
741
|
-
export:
|
|
741
|
+
export: fr
|
|
742
742
|
},
|
|
743
743
|
namespace: "UvaRte",
|
|
744
744
|
editor: E,
|
|
745
|
-
theme:
|
|
745
|
+
theme: Er,
|
|
746
746
|
onError(N) {
|
|
747
747
|
throw N;
|
|
748
748
|
},
|
|
@@ -752,19 +752,19 @@ const Ye = 200, hn = ({
|
|
|
752
752
|
Fe,
|
|
753
753
|
Ue,
|
|
754
754
|
ze,
|
|
755
|
-
|
|
755
|
+
dr,
|
|
756
756
|
Ke,
|
|
757
|
-
|
|
758
|
-
|
|
757
|
+
_r,
|
|
758
|
+
Nr
|
|
759
759
|
],
|
|
760
760
|
editorState: (N) => {
|
|
761
|
-
const $ = new DOMParser().parseFromString(e, "text/html"), Y =
|
|
762
|
-
F().clear(), De(Y),
|
|
761
|
+
const $ = new DOMParser().parseFromString(e, "text/html"), Y = Gt(N, $);
|
|
762
|
+
F().clear(), De(Y), Le(null);
|
|
763
763
|
}
|
|
764
764
|
}, w = (N) => N.trim().length === 0 ? 0 : N.split(" ").length, I = (N, W) => {
|
|
765
765
|
N.read(() => {
|
|
766
766
|
let $ = "";
|
|
767
|
-
v(w(F().getTextContent().replace(/\s+/g, " ").trim())), $ =
|
|
767
|
+
v(w(F().getTextContent().replace(/\s+/g, " ").trim())), $ = mr(Vt(W)), $ = pr($), m($);
|
|
768
768
|
});
|
|
769
769
|
};
|
|
770
770
|
return b(() => {
|
|
@@ -774,8 +774,8 @@ const Ye = 200, hn = ({
|
|
|
774
774
|
v(w(N));
|
|
775
775
|
}, [e]), /* @__PURE__ */ A("div", { className: R.editor__container, children: [
|
|
776
776
|
/* @__PURE__ */ A("div", { className: R.editor__header, children: [
|
|
777
|
-
/* @__PURE__ */ f(
|
|
778
|
-
/* @__PURE__ */ A("div", { className: R["editor__header-word-count"], children: [
|
|
777
|
+
/* @__PURE__ */ f(wr, { label: n, info: o, required: a }),
|
|
778
|
+
c && c > 0 && /* @__PURE__ */ A("div", { className: R["editor__header-word-count"], children: [
|
|
779
779
|
/* @__PURE__ */ f("span", { className: Ce({ [R["editor__header-word-count--alert"]]: C > c }), children: C }),
|
|
780
780
|
" / ",
|
|
781
781
|
c
|
|
@@ -789,7 +789,7 @@ const Ye = 200, hn = ({
|
|
|
789
789
|
}),
|
|
790
790
|
children: /* @__PURE__ */ A(Pr, { initialConfig: k, children: [
|
|
791
791
|
/* @__PURE__ */ f(
|
|
792
|
-
|
|
792
|
+
vr,
|
|
793
793
|
{
|
|
794
794
|
editorScrollPosition: _,
|
|
795
795
|
onCatalogueLinkSearch: h,
|
|
@@ -798,7 +798,7 @@ const Ye = 200, hn = ({
|
|
|
798
798
|
),
|
|
799
799
|
/* @__PURE__ */ A("div", { className: R["editor__field-wrapper"], children: [
|
|
800
800
|
/* @__PURE__ */ f(
|
|
801
|
-
|
|
801
|
+
Jr,
|
|
802
802
|
{
|
|
803
803
|
contentEditable: /* @__PURE__ */ f(
|
|
804
804
|
Qr,
|
|
@@ -809,33 +809,33 @@ const Ye = 200, hn = ({
|
|
|
809
809
|
title: x.common.rteTitle,
|
|
810
810
|
placeholder: /* @__PURE__ */ f("div", { className: R.editor__placeholder, children: t }),
|
|
811
811
|
spellCheck: !1,
|
|
812
|
-
id: `${
|
|
812
|
+
id: `${P}_rteEditor`,
|
|
813
813
|
style: { height: `${l}`, maxHeight: `${l}` },
|
|
814
814
|
onScroll: (N) => T(N.currentTarget.scrollTop)
|
|
815
815
|
}
|
|
816
816
|
),
|
|
817
817
|
placeholder: /* @__PURE__ */ f("div", { className: R.editor__placeholder, children: t }),
|
|
818
|
-
ErrorBoundary:
|
|
818
|
+
ErrorBoundary: tn
|
|
819
819
|
}
|
|
820
820
|
),
|
|
821
|
-
/* @__PURE__ */ f(pn, {}),
|
|
822
|
-
/* @__PURE__ */ f(Wt, {}),
|
|
823
821
|
/* @__PURE__ */ f(mn, {}),
|
|
824
|
-
/* @__PURE__ */ f(
|
|
825
|
-
/* @__PURE__ */ f(
|
|
826
|
-
/* @__PURE__ */ f(
|
|
827
|
-
/* @__PURE__ */ f(
|
|
828
|
-
/* @__PURE__ */ f(
|
|
829
|
-
/* @__PURE__ */ f(
|
|
830
|
-
/* @__PURE__ */ f(
|
|
831
|
-
|
|
822
|
+
/* @__PURE__ */ f(Jt, {}),
|
|
823
|
+
/* @__PURE__ */ f(fn, {}),
|
|
824
|
+
/* @__PURE__ */ f(on, {}),
|
|
825
|
+
/* @__PURE__ */ f(an, { validateUrl: gr }),
|
|
826
|
+
/* @__PURE__ */ f(ln, { matchers: hr }),
|
|
827
|
+
/* @__PURE__ */ f(un, {}),
|
|
828
|
+
/* @__PURE__ */ f(nn, { onChange: I }),
|
|
829
|
+
/* @__PURE__ */ f(br, {}),
|
|
830
|
+
/* @__PURE__ */ f($r, {}),
|
|
831
|
+
u && /* @__PURE__ */ f(pn, { editorRef: u })
|
|
832
832
|
] })
|
|
833
833
|
] })
|
|
834
834
|
}
|
|
835
835
|
),
|
|
836
|
-
i !== "" && /* @__PURE__ */ f(
|
|
836
|
+
i !== "" && /* @__PURE__ */ f(Cr, { level: "error", feedback: i })
|
|
837
837
|
] });
|
|
838
|
-
},
|
|
838
|
+
}, fo = ({
|
|
839
839
|
currentLanguage: r = "NL",
|
|
840
840
|
initialValue: e = "",
|
|
841
841
|
placeholder: t = "",
|
|
@@ -844,13 +844,13 @@ const Ye = 200, hn = ({
|
|
|
844
844
|
required: a = !1,
|
|
845
845
|
notValid: s = !1,
|
|
846
846
|
notValidatedText: i = "",
|
|
847
|
-
maxWords: l
|
|
847
|
+
maxWords: l,
|
|
848
848
|
rteRef: c,
|
|
849
849
|
onChange: u,
|
|
850
850
|
onCatalogueLinkSearch: m,
|
|
851
851
|
catalogueSearchResponse: h = { state: "idle", results: [] }
|
|
852
|
-
}) => /* @__PURE__ */ f(
|
|
853
|
-
|
|
852
|
+
}) => /* @__PURE__ */ f(Sr, { children: /* @__PURE__ */ f(
|
|
853
|
+
gn,
|
|
854
854
|
{
|
|
855
855
|
currentLanguage: r.toUpperCase(),
|
|
856
856
|
initialValue: e,
|
|
@@ -868,7 +868,7 @@ const Ye = 200, hn = ({
|
|
|
868
868
|
}
|
|
869
869
|
) });
|
|
870
870
|
export {
|
|
871
|
-
|
|
872
|
-
|
|
871
|
+
gn as Rte,
|
|
872
|
+
fo as RteEditor
|
|
873
873
|
};
|
|
874
874
|
//# sourceMappingURL=RteEditor.js.map
|