@uva-glass/component-library 1.62.2 → 1.62.4
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-qM_1BY0u.js → Lexical.prod-eo-UKDld.js} +23 -23
- package/dist/{Lexical.prod-qM_1BY0u.js.map → Lexical.prod-eo-UKDld.js.map} +1 -1
- package/dist/{LexicalUtils.prod-BFSPHHi1.js → LexicalUtils.prod-DzksRdFe.js} +2 -2
- package/dist/{LexicalUtils.prod-BFSPHHi1.js.map → LexicalUtils.prod-DzksRdFe.js.map} +1 -1
- package/dist/{ListPlugin-D-Ki_zib.js → ListPlugin-BaGD7Mnf.js} +4 -4
- package/dist/{ListPlugin-D-Ki_zib.js.map → ListPlugin-BaGD7Mnf.js.map} +1 -1
- package/dist/RteEditor.module-D98nXtwi.js +29 -0
- package/dist/RteEditor.module-D98nXtwi.js.map +1 -0
- package/dist/TablePlugin-Dhg4yUqE.js +308 -0
- package/dist/TablePlugin-Dhg4yUqE.js.map +1 -0
- package/dist/assets/Container.css +1 -1
- package/dist/assets/EditorHeader.css +1 -1
- package/dist/assets/FormInput.css +1 -1
- package/dist/assets/RteEditor.css +1 -1
- package/dist/assets/TableCellContextMenu.css +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
- package/dist/components/FormInput/FormInput.js +18 -18
- package/dist/components/FormInput/FormInput.js.map +1 -1
- package/dist/components/FormInput/FormInput.stories.js.map +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/ProgrammeCard/ProgrammeCard.stories.js +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +3 -3
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +2 -2
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +3 -3
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.js +2 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +85 -73
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +3 -3
- package/dist/components/RteEditor/Plugins/ListPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js +57 -43
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js.map +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +5 -5
- package/dist/components/RteEditor/Plugins/index.js +2 -2
- package/dist/components/RteEditor/RteEditor.js +169 -169
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/RteEditor/UvaTheme/UvaTheme.js +1 -1
- package/dist/components/RteEditor/hooks/useFlyout.d.ts +1 -1
- package/dist/components/RteEditor/hooks/useFlyout.js +8 -8
- package/dist/components/RteEditor/hooks/useFlyout.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{helpers-BB6Byf50.js → helpers-BD3Y_bqE.js} +3 -3
- package/dist/{helpers-BB6Byf50.js.map → helpers-BD3Y_bqE.js.map} +1 -1
- package/dist/{helpers-D9T1Tgkj.js → helpers-DONVwywj.js} +3 -3
- package/dist/{helpers-D9T1Tgkj.js.map → helpers-DONVwywj.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/storyComponents/Container/Container.js +22 -22
- package/package.json +14 -14
- package/dist/RteEditor.module-BwAtWRHo.js +0 -29
- package/dist/RteEditor.module-BwAtWRHo.js.map +0 -1
- package/dist/TablePlugin-BuP29PqZ.js +0 -295
- package/dist/TablePlugin-BuP29PqZ.js.map +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsx as y, jsxs as F, Fragment as Fe } from "react/jsx-runtime";
|
|
2
|
-
import { l as Xe, o as Ye, u as
|
|
3
|
-
import { ak as Ie, w as
|
|
2
|
+
import { l as Xe, o as Ye, u as M } from "../../LexicalComposerContext.prod-Dyvim1tK.js";
|
|
3
|
+
import { ak as Ie, w as I, F as fe, A as v, k as q, b as W, D as Ge, c as R, x as C, al as Ke, am as Ze, L as p, a8 as Qe, S as A, G as et, an as tt, ao as nt, ap as rt, R as oe, aq as ot, ar as it, af as st, ah as at, E as lt, a2 as ct, as as ut, at as ge, o as he, a7 as dt, a5 as ie, a6 as ft, n as Ae, au as ve, a1 as mt, a0 as pt, V as gt, X as Ce, Y as ht, av as vt, aw as Ct, ax as yt, u as Et, a9 as wt, d as bt, ay as $t, aa as St, a4 as _t, a3 as xt, r as kt, t as Lt, O as ye, az as Nt, j as Dt, K as X, $ as Y, aA as Tt, aB as Pt, g as Rt, h as Mt, ae as Ot } from "../../Lexical.prod-eo-UKDld.js";
|
|
4
4
|
import * as se from "react";
|
|
5
|
-
import { useMemo as H, useLayoutEffect as
|
|
6
|
-
import { L as
|
|
5
|
+
import { useMemo as H, useLayoutEffect as B, useEffect as x, useRef as Ft, useState as O, Suspense as It, forwardRef as ze, useCallback as Kt } from "react";
|
|
6
|
+
import { L as U, i as z, e as At, t as me, r as zt, u as Ut } from "../../LexicalUtils.prod-DzksRdFe.js";
|
|
7
7
|
import { r as Ee } from "../../index-DsprzSCj.js";
|
|
8
|
-
import { _ as we, O as be, L as $e, $ as Se, u as
|
|
9
|
-
import { J as Be, D as je, Z as Zt } from "../../ListPlugin-
|
|
10
|
-
import { a as qe, U as ke, m as ae, g as
|
|
8
|
+
import { _ as we, O as be, L as $e, $ as Se, u as ne, f as re, h as Ue, K as Bt, n as _e, r as jt, j as qt, k as Wt, l as Ht, F as Jt, m as xe, o as Vt, U as Xt, p as Yt, q as Gt } from "../../helpers-DONVwywj.js";
|
|
9
|
+
import { J as Be, D as je, Z as Zt } from "../../ListPlugin-BaGD7Mnf.js";
|
|
10
|
+
import { a as qe, U as ke, m as ae, g as Qt, b as en, F as tn, M as nn, f as rn } from "../../helpers-BD3Y_bqE.js";
|
|
11
11
|
import { c as on } from "../../clsx-OuTLNxxd.js";
|
|
12
|
-
import { s as
|
|
12
|
+
import { s as P } from "../../RteEditor.module-D98nXtwi.js";
|
|
13
13
|
import { ToolBarPlugin as sn } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
|
|
14
14
|
import { Icon as an } from "../Icon/Icon.js";
|
|
15
15
|
import { useTranslation as ln } from "./hooks/useTranslation.js";
|
|
16
|
-
import "../../TablePlugin-
|
|
16
|
+
import "../../TablePlugin-Dhg4yUqE.js";
|
|
17
17
|
import "./hooks/components/Flyout.js";
|
|
18
18
|
import "../Buttons/Button.js";
|
|
19
19
|
import "../Buttons/LinkButton.js";
|
|
@@ -34,34 +34,34 @@ import "../../SortableProvider-BUsvniX7.js";
|
|
|
34
34
|
import { UvaTheme as cn } from "./UvaTheme/UvaTheme.js";
|
|
35
35
|
import { EditorHeader as un } from "./EditorHeader/EditorHeader.js";
|
|
36
36
|
import { useLanguage as dn, LanguageProvider as fn } from "./Providers/LanguageProvider.js";
|
|
37
|
-
const We = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, mn = We ?
|
|
37
|
+
const We = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, mn = We ? B : x, G = { tag: "history-merge" };
|
|
38
38
|
function pn({ initialConfig: e, children: t }) {
|
|
39
39
|
const n = H(() => {
|
|
40
40
|
const { theme: r, namespace: i, nodes: o, onError: s, editorState: a, html: l } = e, c = Ye(null, r), u = Ie({ editable: e.editable, html: l, namespace: i, nodes: o, onError: (d) => s(d, u), theme: r });
|
|
41
41
|
return function(d, f) {
|
|
42
42
|
if (f !== null) {
|
|
43
43
|
if (f === void 0) d.update(() => {
|
|
44
|
-
const m =
|
|
44
|
+
const m = I();
|
|
45
45
|
if (m.isEmpty()) {
|
|
46
46
|
const g = fe();
|
|
47
47
|
m.append(g);
|
|
48
48
|
const h = We ? document.activeElement : null;
|
|
49
49
|
(v() !== null || h !== null && h === d.getRootElement()) && g.select();
|
|
50
50
|
}
|
|
51
|
-
},
|
|
51
|
+
}, G);
|
|
52
52
|
else if (f !== null) switch (typeof f) {
|
|
53
53
|
case "string": {
|
|
54
54
|
const m = d.parseEditorState(f);
|
|
55
|
-
d.setEditorState(m,
|
|
55
|
+
d.setEditorState(m, G);
|
|
56
56
|
break;
|
|
57
57
|
}
|
|
58
58
|
case "object":
|
|
59
|
-
d.setEditorState(f,
|
|
59
|
+
d.setEditorState(f, G);
|
|
60
60
|
break;
|
|
61
61
|
case "function":
|
|
62
62
|
d.update(() => {
|
|
63
|
-
|
|
64
|
-
},
|
|
63
|
+
I().isEmpty() && f(d);
|
|
64
|
+
}, G);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
}(u, a), [u, c];
|
|
@@ -71,13 +71,13 @@ function pn({ initialConfig: e, children: t }) {
|
|
|
71
71
|
i.setEditable(r === void 0 || r);
|
|
72
72
|
}, []), y(Xe.Provider, { value: n, children: t });
|
|
73
73
|
}
|
|
74
|
-
const gn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ?
|
|
74
|
+
const gn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? B : x;
|
|
75
75
|
function hn(e) {
|
|
76
76
|
return { initialValueFn: () => e.isEditable(), subscribe: (t) => e.registerEditableListener(t) };
|
|
77
77
|
}
|
|
78
78
|
function vn() {
|
|
79
79
|
return function(e) {
|
|
80
|
-
const [t] =
|
|
80
|
+
const [t] = M(), n = H(() => e(t), [t, e]), r = Ft(n.initialValueFn()), [i, o] = O(r.current);
|
|
81
81
|
return gn(() => {
|
|
82
82
|
const { initialValueFn: s, subscribe: a } = n, l = s();
|
|
83
83
|
return r.current !== l && (r.current = l, o(l)), a((c) => {
|
|
@@ -87,7 +87,7 @@ function vn() {
|
|
|
87
87
|
}(hn);
|
|
88
88
|
}
|
|
89
89
|
function Cn() {
|
|
90
|
-
return
|
|
90
|
+
return I().getTextContent();
|
|
91
91
|
}
|
|
92
92
|
function yn(e, t = !0) {
|
|
93
93
|
if (e) return !1;
|
|
@@ -96,17 +96,17 @@ function yn(e, t = !0) {
|
|
|
96
96
|
}
|
|
97
97
|
function En(e) {
|
|
98
98
|
if (!yn(e, !1)) return !1;
|
|
99
|
-
const t =
|
|
99
|
+
const t = I().getChildren(), n = t.length;
|
|
100
100
|
if (n > 1) return !1;
|
|
101
101
|
for (let r = 0; r < n; r++) {
|
|
102
102
|
const i = t[r];
|
|
103
103
|
if (q(i)) return !1;
|
|
104
104
|
if (W(i)) {
|
|
105
|
-
if (!
|
|
105
|
+
if (!Ge(i) || i.__indent !== 0) return !1;
|
|
106
106
|
const o = i.getChildren(), s = o.length;
|
|
107
107
|
for (let a = 0; a < s; a++) {
|
|
108
108
|
const l = o[r];
|
|
109
|
-
if (!
|
|
109
|
+
if (!R(l)) return !1;
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
}
|
|
@@ -146,12 +146,12 @@ function bn(e) {
|
|
|
146
146
|
e.update(() => {
|
|
147
147
|
const h = v();
|
|
148
148
|
if (C(h)) {
|
|
149
|
-
const
|
|
150
|
-
let E =
|
|
151
|
-
if (
|
|
152
|
-
|
|
153
|
-
const
|
|
154
|
-
|
|
149
|
+
const S = h.anchor;
|
|
150
|
+
let E = S.getNode(), w = 0, $ = 0;
|
|
151
|
+
if (R(E) && c >= 0 && u >= 0 && (w = c, $ = c + u, h.setTextNodeRange(E, w, E, $)), w === $ && d === "" || (h.insertRawText(d), E = S.getNode()), R(E)) {
|
|
152
|
+
w = f, $ = f + m;
|
|
153
|
+
const b = E.getTextContentSize();
|
|
154
|
+
w = w > b ? b : w, $ = $ > b ? b : $, h.setTextNodeRange(E, w, E, $);
|
|
155
155
|
}
|
|
156
156
|
r.stopImmediatePropagation();
|
|
157
157
|
}
|
|
@@ -176,10 +176,10 @@ function Le(e, t) {
|
|
|
176
176
|
}
|
|
177
177
|
return null;
|
|
178
178
|
}
|
|
179
|
-
const
|
|
180
|
-
function
|
|
179
|
+
const j = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, $n = j && "documentMode" in document ? document.documentMode : null, Sn = !(!j || !("InputEvent" in window) || $n) && "getTargetRanges" in new window.InputEvent("input"), _n = j && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), xn = j && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, kn = j && /^(?=.*Chrome).*/i.test(navigator.userAgent), Ln = j && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !kn, Ne = Lt();
|
|
180
|
+
function Z(e) {
|
|
181
181
|
let t = null;
|
|
182
|
-
if (
|
|
182
|
+
if (z(e, DragEvent) ? t = e.dataTransfer : z(e, ClipboardEvent) && (t = e.clipboardData), t === null) return [!1, [], !1];
|
|
183
183
|
const n = t.types, r = n.includes("Files"), i = n.includes("text/html") || n.includes("text/plain");
|
|
184
184
|
return [r, Array.from(t.files), i];
|
|
185
185
|
}
|
|
@@ -197,14 +197,14 @@ function De(e) {
|
|
|
197
197
|
}
|
|
198
198
|
return n.size > 0;
|
|
199
199
|
}
|
|
200
|
-
function
|
|
201
|
-
const t =
|
|
200
|
+
function Q(e) {
|
|
201
|
+
const t = oe(e);
|
|
202
202
|
return q(t);
|
|
203
203
|
}
|
|
204
204
|
function Nn(e) {
|
|
205
|
-
return
|
|
205
|
+
return U(e.registerCommand(kt, (t) => {
|
|
206
206
|
const n = v();
|
|
207
|
-
return !!
|
|
207
|
+
return !!A(n) && (n.clear(), !0);
|
|
208
208
|
}, 0), e.registerCommand(ie, (t) => {
|
|
209
209
|
const n = v();
|
|
210
210
|
return !!C(n) && (n.deleteCharacter(t), !0);
|
|
@@ -235,7 +235,7 @@ function Nn(e) {
|
|
|
235
235
|
return !!C(n) && (n.formatText(t), !0);
|
|
236
236
|
}, p), e.registerCommand(wt, (t) => {
|
|
237
237
|
const n = v();
|
|
238
|
-
if (!C(n) && !
|
|
238
|
+
if (!C(n) && !A(n)) return !1;
|
|
239
239
|
const r = n.getNodes();
|
|
240
240
|
for (const i of r) {
|
|
241
241
|
const o = me(i, (s) => W(s) && !s.isInline());
|
|
@@ -256,7 +256,7 @@ function Nn(e) {
|
|
|
256
256
|
n > 0 && t.setIndent(n - 1);
|
|
257
257
|
}), p), e.registerCommand(ht, (t) => {
|
|
258
258
|
const n = v();
|
|
259
|
-
if (
|
|
259
|
+
if (A(n) && !Q(t.target)) {
|
|
260
260
|
const r = n.getNodes();
|
|
261
261
|
if (r.length > 0) return r[0].selectPrevious(), !0;
|
|
262
262
|
} else if (C(n)) {
|
|
@@ -266,13 +266,13 @@ function Nn(e) {
|
|
|
266
266
|
return !1;
|
|
267
267
|
}, p), e.registerCommand(gt, (t) => {
|
|
268
268
|
const n = v();
|
|
269
|
-
if (
|
|
269
|
+
if (A(n)) {
|
|
270
270
|
const r = n.getNodes();
|
|
271
271
|
if (r.length > 0) return r[0].selectNext(0, 0), !0;
|
|
272
272
|
} else if (C(n)) {
|
|
273
273
|
if (function(i) {
|
|
274
274
|
const o = i.focus;
|
|
275
|
-
return o.key === "root" && o.offset ===
|
|
275
|
+
return o.key === "root" && o.offset === I().getChildrenSize();
|
|
276
276
|
}(n)) return t.preventDefault(), !0;
|
|
277
277
|
const r = Ce(n.focus, !1);
|
|
278
278
|
if (!t.shiftKey && q(r) && !r.isIsolated() && !r.isInline()) return r.selectNext(), t.preventDefault(), !0;
|
|
@@ -280,7 +280,7 @@ function Nn(e) {
|
|
|
280
280
|
return !1;
|
|
281
281
|
}, p), e.registerCommand(pt, (t) => {
|
|
282
282
|
const n = v();
|
|
283
|
-
if (
|
|
283
|
+
if (A(n)) {
|
|
284
284
|
const r = n.getNodes();
|
|
285
285
|
if (r.length > 0) return t.preventDefault(), r[0].selectPrevious(), !0;
|
|
286
286
|
}
|
|
@@ -292,7 +292,7 @@ function Nn(e) {
|
|
|
292
292
|
return !1;
|
|
293
293
|
}, p), e.registerCommand(mt, (t) => {
|
|
294
294
|
const n = v();
|
|
295
|
-
if (
|
|
295
|
+
if (A(n) && !Q(t.target)) {
|
|
296
296
|
const i = n.getNodes();
|
|
297
297
|
if (i.length > 0) return t.preventDefault(), i[0].selectNext(0, 0), !0;
|
|
298
298
|
}
|
|
@@ -300,14 +300,14 @@ function Nn(e) {
|
|
|
300
300
|
const r = t.shiftKey;
|
|
301
301
|
return !!$e(n, !1) && (t.preventDefault(), Se(n, r, !1), !0);
|
|
302
302
|
}, p), e.registerCommand(ft, (t) => {
|
|
303
|
-
if (
|
|
303
|
+
if (Q(t.target)) return !1;
|
|
304
304
|
const n = v();
|
|
305
305
|
if (!C(n)) return !1;
|
|
306
306
|
t.preventDefault();
|
|
307
307
|
const { anchor: r } = n, i = r.getNode();
|
|
308
308
|
return n.isCollapsed() && r.offset === 0 && !Ae(i) && At(i).getIndent() > 0 ? e.dispatchCommand(ve, void 0) : e.dispatchCommand(ie, !0);
|
|
309
309
|
}, p), e.registerCommand(dt, (t) => {
|
|
310
|
-
if (
|
|
310
|
+
if (Q(t.target)) return !1;
|
|
311
311
|
const n = v();
|
|
312
312
|
return !!C(n) && (t.preventDefault(), e.dispatchCommand(ie, !1));
|
|
313
313
|
}, p), e.registerCommand(ut, (t) => {
|
|
@@ -322,14 +322,14 @@ function Nn(e) {
|
|
|
322
322
|
const t = v();
|
|
323
323
|
return !!C(t) && (e.blur(), !0);
|
|
324
324
|
}, p), e.registerCommand(it, (t) => {
|
|
325
|
-
const [, n] =
|
|
325
|
+
const [, n] = Z(t);
|
|
326
326
|
if (n.length > 0) {
|
|
327
327
|
const i = Le(t.clientX, t.clientY);
|
|
328
328
|
if (i !== null) {
|
|
329
|
-
const { offset: o, node: s } = i, a =
|
|
329
|
+
const { offset: o, node: s } = i, a = oe(s);
|
|
330
330
|
if (a !== null) {
|
|
331
331
|
const l = st();
|
|
332
|
-
if (
|
|
332
|
+
if (R(a)) l.anchor.set(a.getKey(), o, "text"), l.focus.set(a.getKey(), o, "text");
|
|
333
333
|
else {
|
|
334
334
|
const u = a.getParentOrThrow().getKey(), d = a.getIndexWithinParent() + 1;
|
|
335
335
|
l.anchor.set(u, d, "element"), l.focus.set(u, d, "element");
|
|
@@ -344,44 +344,44 @@ function Nn(e) {
|
|
|
344
344
|
const r = v();
|
|
345
345
|
return !!C(r);
|
|
346
346
|
}, p), e.registerCommand(ot, (t) => {
|
|
347
|
-
const [n] =
|
|
347
|
+
const [n] = Z(t), r = v();
|
|
348
348
|
return !(n && !C(r));
|
|
349
349
|
}, p), e.registerCommand(rt, (t) => {
|
|
350
|
-
const [n] =
|
|
350
|
+
const [n] = Z(t), r = v();
|
|
351
351
|
if (n && !C(r)) return !1;
|
|
352
352
|
const i = Le(t.clientX, t.clientY);
|
|
353
353
|
if (i !== null) {
|
|
354
|
-
const o =
|
|
354
|
+
const o = oe(i.node);
|
|
355
355
|
q(o) && t.preventDefault();
|
|
356
356
|
}
|
|
357
357
|
return !0;
|
|
358
|
-
}, p), e.registerCommand(tt, () => (nt(), !0), p), e.registerCommand(et, (t) => (be(e,
|
|
359
|
-
await be(r,
|
|
358
|
+
}, p), e.registerCommand(tt, () => (nt(), !0), p), e.registerCommand(et, (t) => (be(e, z(t, ClipboardEvent) ? t : null), !0), p), e.registerCommand(Qe, (t) => (async function(n, r) {
|
|
359
|
+
await be(r, z(n, ClipboardEvent) ? n : null), r.update(() => {
|
|
360
360
|
const i = v();
|
|
361
|
-
C(i) ? i.removeText() :
|
|
361
|
+
C(i) ? i.removeText() : A(i) && i.getNodes().forEach((o) => o.remove());
|
|
362
362
|
});
|
|
363
363
|
}(t, e), !0), p), e.registerCommand(Ke, (t) => {
|
|
364
|
-
const [, n, r] =
|
|
364
|
+
const [, n, r] = Z(t);
|
|
365
365
|
return n.length > 0 && !r ? (e.dispatchCommand(Ne, n), !0) : Ze(t.target) ? !1 : v() !== null && (function(i, o) {
|
|
366
366
|
i.preventDefault(), o.update(() => {
|
|
367
|
-
const s = v(), a =
|
|
367
|
+
const s = v(), a = z(i, InputEvent) || z(i, KeyboardEvent) ? null : i.clipboardData;
|
|
368
368
|
a != null && s !== null && we(a, s, o);
|
|
369
369
|
}, { tag: "paste" });
|
|
370
370
|
}(t, e), !0);
|
|
371
371
|
}, p));
|
|
372
372
|
}
|
|
373
|
-
const le = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ?
|
|
373
|
+
const le = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? B : x;
|
|
374
374
|
function Te(e) {
|
|
375
375
|
return e.getEditorState().read(He(e.isComposing()));
|
|
376
376
|
}
|
|
377
377
|
function Dn({ contentEditable: e, placeholder: t = null, ErrorBoundary: n }) {
|
|
378
|
-
const [r] =
|
|
379
|
-
const [a, l] =
|
|
378
|
+
const [r] = M(), i = function(o, s) {
|
|
379
|
+
const [a, l] = O(() => o.getDecorators());
|
|
380
380
|
return le(() => o.registerDecoratorListener((c) => {
|
|
381
381
|
Ee.flushSync(() => {
|
|
382
382
|
l(c);
|
|
383
383
|
});
|
|
384
|
-
}), [o]),
|
|
384
|
+
}), [o]), x(() => {
|
|
385
385
|
l(o.getDecorators());
|
|
386
386
|
}, [o]), H(() => {
|
|
387
387
|
const c = [], u = Object.keys(a);
|
|
@@ -393,18 +393,18 @@ function Dn({ contentEditable: e, placeholder: t = null, ErrorBoundary: n }) {
|
|
|
393
393
|
}, [s, a, o]);
|
|
394
394
|
}(r, n);
|
|
395
395
|
return function(o) {
|
|
396
|
-
le(() =>
|
|
396
|
+
le(() => U(Nn(o), bn(o)), [o]);
|
|
397
397
|
}(r), F(Fe, { children: [e, y(Tn, { content: t }), i] });
|
|
398
398
|
}
|
|
399
399
|
function Tn({ content: e }) {
|
|
400
|
-
const [t] =
|
|
401
|
-
const [o, s] =
|
|
400
|
+
const [t] = M(), n = function(i) {
|
|
401
|
+
const [o, s] = O(() => Te(i));
|
|
402
402
|
return le(() => {
|
|
403
403
|
function a() {
|
|
404
404
|
const l = Te(i);
|
|
405
405
|
s(l);
|
|
406
406
|
}
|
|
407
|
-
return a(),
|
|
407
|
+
return a(), U(i.registerUpdateListener(() => {
|
|
408
408
|
a();
|
|
409
409
|
}), i.registerEditableListener(() => {
|
|
410
410
|
a();
|
|
@@ -413,20 +413,20 @@ function Tn({ content: e }) {
|
|
|
413
413
|
}(t), r = vn();
|
|
414
414
|
return n ? typeof e == "function" ? e(r) : e : null;
|
|
415
415
|
}
|
|
416
|
-
const Je = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ?
|
|
417
|
-
function Pn({ editor: e, ariaActiveDescendant: t, ariaAutoComplete: n, ariaControls: r, ariaDescribedBy: i, ariaErrorMessage: o, ariaExpanded: s, ariaInvalid: a, ariaLabel: l, ariaLabelledBy: c, ariaMultiline: u, ariaOwns: d, ariaRequired: f, autoCapitalize: m, className: g, id: h, role:
|
|
418
|
-
const [
|
|
419
|
-
|
|
420
|
-
}, [e]),
|
|
416
|
+
const Je = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? B : x;
|
|
417
|
+
function Pn({ editor: e, ariaActiveDescendant: t, ariaAutoComplete: n, ariaControls: r, ariaDescribedBy: i, ariaErrorMessage: o, ariaExpanded: s, ariaInvalid: a, ariaLabel: l, ariaLabelledBy: c, ariaMultiline: u, ariaOwns: d, ariaRequired: f, autoCapitalize: m, className: g, id: h, role: S = "textbox", spellCheck: E = !0, style: w, tabIndex: $, "data-testid": b, ...L }, k) {
|
|
418
|
+
const [_, N] = O(e.isEditable()), K = Kt((T) => {
|
|
419
|
+
T && T.ownerDocument && T.ownerDocument.defaultView ? e.setRootElement(T) : e.setRootElement(null);
|
|
420
|
+
}, [e]), J = H(() => /* @__PURE__ */ function(...T) {
|
|
421
421
|
return (pe) => {
|
|
422
|
-
|
|
423
|
-
typeof
|
|
422
|
+
T.forEach((V) => {
|
|
423
|
+
typeof V == "function" ? V(pe) : V != null && (V.current = pe);
|
|
424
424
|
});
|
|
425
425
|
};
|
|
426
|
-
}(
|
|
427
|
-
return Je(() => (N(e.isEditable()), e.registerEditableListener((
|
|
428
|
-
N(
|
|
429
|
-
})), [e]), y("div", { ...L, "aria-activedescendant":
|
|
426
|
+
}(k, K), [K, k]);
|
|
427
|
+
return Je(() => (N(e.isEditable()), e.registerEditableListener((T) => {
|
|
428
|
+
N(T);
|
|
429
|
+
})), [e]), y("div", { ...L, "aria-activedescendant": _ ? t : void 0, "aria-autocomplete": _ ? n : "none", "aria-controls": _ ? r : void 0, "aria-describedby": i, ...o != null ? { "aria-errormessage": o } : {}, "aria-expanded": _ && S === "combobox" ? !!s : void 0, ...a != null ? { "aria-invalid": a } : {}, "aria-label": l, "aria-labelledby": c, "aria-multiline": u, "aria-owns": _ ? d : void 0, "aria-readonly": !_ || void 0, "aria-required": f, autoCapitalize: m, className: g, contentEditable: _, "data-testid": b, id: h, ref: J, role: _ ? S : void 0, spellCheck: E, style: w, tabIndex: $ });
|
|
430
430
|
}
|
|
431
431
|
const Rn = ze(Pn);
|
|
432
432
|
function Pe(e) {
|
|
@@ -434,25 +434,25 @@ function Pe(e) {
|
|
|
434
434
|
}
|
|
435
435
|
const Mn = ze(On);
|
|
436
436
|
function On(e, t) {
|
|
437
|
-
const { placeholder: n, ...r } = e, [i] =
|
|
437
|
+
const { placeholder: n, ...r } = e, [i] = M();
|
|
438
438
|
return F(Fe, { children: [y(Rn, { editor: i, ...r, ref: t }), n != null && y(Fn, { editor: i, content: n })] });
|
|
439
439
|
}
|
|
440
440
|
function Fn({ content: e, editor: t }) {
|
|
441
441
|
const n = function(s) {
|
|
442
|
-
const [a, l] =
|
|
442
|
+
const [a, l] = O(() => Pe(s));
|
|
443
443
|
return Je(() => {
|
|
444
444
|
function c() {
|
|
445
445
|
const u = Pe(s);
|
|
446
446
|
l(u);
|
|
447
447
|
}
|
|
448
|
-
return c(),
|
|
448
|
+
return c(), U(s.registerUpdateListener(() => {
|
|
449
449
|
c();
|
|
450
450
|
}), s.registerEditableListener(() => {
|
|
451
451
|
c();
|
|
452
452
|
}));
|
|
453
453
|
}, [s]), a;
|
|
454
|
-
}(t), [r, i] =
|
|
455
|
-
if (
|
|
454
|
+
}(t), [r, i] = O(t.isEditable());
|
|
455
|
+
if (B(() => (i(t.isEditable()), t.registerEditableListener((s) => {
|
|
456
456
|
i(s);
|
|
457
457
|
})), [t]), !n) return null;
|
|
458
458
|
let o = null;
|
|
@@ -501,9 +501,9 @@ var Re = { error: null }, In = function(e) {
|
|
|
501
501
|
function Kn({ children: e, onError: t }) {
|
|
502
502
|
return y(In, { fallback: y("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: t, children: e });
|
|
503
503
|
}
|
|
504
|
-
const An = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ?
|
|
504
|
+
const An = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? B : x;
|
|
505
505
|
function zn({ ignoreHistoryMergeTagChange: e = !0, ignoreSelectionChange: t = !1, onChange: n }) {
|
|
506
|
-
const [r] =
|
|
506
|
+
const [r] = M();
|
|
507
507
|
return An(() => {
|
|
508
508
|
if (n) return r.registerUpdateListener(({ editorState: i, dirtyElements: o, dirtyLeaves: s, prevEditorState: a, tags: l }) => {
|
|
509
509
|
t && o.size === 0 && s.size === 0 || e && l.has("history-merge") || a.isEmpty() || n(i, r, l);
|
|
@@ -511,18 +511,18 @@ function zn({ ignoreHistoryMergeTagChange: e = !0, ignoreSelectionChange: t = !1
|
|
|
511
511
|
}, [r, e, t, n]), null;
|
|
512
512
|
}
|
|
513
513
|
function Un() {
|
|
514
|
-
const [e] =
|
|
515
|
-
return
|
|
514
|
+
const [e] = M();
|
|
515
|
+
return x(() => {
|
|
516
516
|
if (!e.hasNodes([Be, je])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
|
|
517
517
|
}, [e]), function(t) {
|
|
518
|
-
|
|
518
|
+
x(() => Zt(t), [t]);
|
|
519
519
|
}(e), null;
|
|
520
520
|
}
|
|
521
521
|
function Bn({ validateUrl: e, attributes: t }) {
|
|
522
|
-
const [n] =
|
|
523
|
-
return
|
|
522
|
+
const [n] = M();
|
|
523
|
+
return x(() => {
|
|
524
524
|
if (!n.hasNodes([qe])) throw new Error("LinkPlugin: LinkNode not registered on editor");
|
|
525
|
-
return
|
|
525
|
+
return U(n.registerCommand(ke, (r) => {
|
|
526
526
|
if (r === null) return ae(r), !0;
|
|
527
527
|
if (typeof r == "string") return !(e !== void 0 && !e(r)) && (ae(r, t), !0);
|
|
528
528
|
{
|
|
@@ -531,7 +531,7 @@ function Bn({ validateUrl: e, attributes: t }) {
|
|
|
531
531
|
}
|
|
532
532
|
}, ye), e !== void 0 ? n.registerCommand(Ke, (r) => {
|
|
533
533
|
const i = v();
|
|
534
|
-
if (!C(i) || i.isCollapsed() || !
|
|
534
|
+
if (!C(i) || i.isCollapsed() || !z(r, ClipboardEvent)) return !1;
|
|
535
535
|
const o = r;
|
|
536
536
|
if (o.clipboardData === null) return !1;
|
|
537
537
|
const s = o.clipboardData.getData("text");
|
|
@@ -541,8 +541,8 @@ function Bn({ validateUrl: e, attributes: t }) {
|
|
|
541
541
|
}, [n, e, t]), null;
|
|
542
542
|
}
|
|
543
543
|
function jn({ newTab: e = !0, disabled: t = !1 }) {
|
|
544
|
-
const [n] =
|
|
545
|
-
return
|
|
544
|
+
const [n] = M();
|
|
545
|
+
return x(() => {
|
|
546
546
|
const r = (o) => {
|
|
547
547
|
const s = o.target;
|
|
548
548
|
if (!(s instanceof Node)) return;
|
|
@@ -550,15 +550,15 @@ function jn({ newTab: e = !0, disabled: t = !1 }) {
|
|
|
550
550
|
if (a === null) return;
|
|
551
551
|
let l = null, c = null;
|
|
552
552
|
if (a.update(() => {
|
|
553
|
-
const f =
|
|
553
|
+
const f = oe(s);
|
|
554
554
|
if (f !== null) {
|
|
555
555
|
const m = me(f, W);
|
|
556
|
-
if (!t) if (
|
|
556
|
+
if (!t) if (Qt(m)) l = m.sanitizeUrl(m.getURL()), c = m.getTarget();
|
|
557
557
|
else {
|
|
558
|
-
const g = function(h,
|
|
558
|
+
const g = function(h, S) {
|
|
559
559
|
let E = h;
|
|
560
560
|
for (; E != null; ) {
|
|
561
|
-
if (
|
|
561
|
+
if (S(E)) return E;
|
|
562
562
|
E = E.parentNode;
|
|
563
563
|
}
|
|
564
564
|
return null;
|
|
@@ -579,38 +579,38 @@ function jn({ newTab: e = !0, disabled: t = !1 }) {
|
|
|
579
579
|
});
|
|
580
580
|
}, [n, e, t]), null;
|
|
581
581
|
}
|
|
582
|
-
const
|
|
582
|
+
const ee = 0, ue = 1, de = 2, D = 0, qn = 1, Me = 2, Wn = 3, Hn = 4;
|
|
583
583
|
function Jn(e, t, n, r, i) {
|
|
584
584
|
if (e === null || n.size === 0 && r.size === 0 && !i) return D;
|
|
585
585
|
const o = t._selection, s = e._selection;
|
|
586
586
|
if (i) return qn;
|
|
587
587
|
if (!(C(o) && C(s) && s.isCollapsed() && o.isCollapsed())) return D;
|
|
588
|
-
const a = function(E,
|
|
589
|
-
const
|
|
590
|
-
for (const
|
|
591
|
-
const
|
|
592
|
-
|
|
588
|
+
const a = function(E, w, $) {
|
|
589
|
+
const b = E._nodeMap, L = [];
|
|
590
|
+
for (const k of w) {
|
|
591
|
+
const _ = b.get(k);
|
|
592
|
+
_ !== void 0 && L.push(_);
|
|
593
593
|
}
|
|
594
|
-
for (const [
|
|
595
|
-
if (!
|
|
596
|
-
const N =
|
|
594
|
+
for (const [k, _] of $) {
|
|
595
|
+
if (!_) continue;
|
|
596
|
+
const N = b.get(k);
|
|
597
597
|
N === void 0 || Ae(N) || L.push(N);
|
|
598
598
|
}
|
|
599
599
|
return L;
|
|
600
600
|
}(t, n, r);
|
|
601
601
|
if (a.length === 0) return D;
|
|
602
602
|
if (a.length > 1) {
|
|
603
|
-
const E = t._nodeMap,
|
|
604
|
-
return
|
|
603
|
+
const E = t._nodeMap, w = E.get(o.anchor.key), $ = E.get(s.anchor.key);
|
|
604
|
+
return w && $ && !e._nodeMap.has(w.__key) && R(w) && w.__text.length === 1 && o.anchor.offset === 1 ? Me : D;
|
|
605
605
|
}
|
|
606
606
|
const l = a[0], c = e._nodeMap.get(l.__key);
|
|
607
|
-
if (!
|
|
607
|
+
if (!R(c) || !R(l) || c.__mode !== l.__mode) return D;
|
|
608
608
|
const u = c.__text, d = l.__text;
|
|
609
609
|
if (u === d) return D;
|
|
610
610
|
const f = o.anchor, m = s.anchor;
|
|
611
611
|
if (f.key !== m.key || f.type !== "text") return D;
|
|
612
|
-
const g = f.offset, h = m.offset,
|
|
613
|
-
return
|
|
612
|
+
const g = f.offset, h = m.offset, S = d.length - u.length;
|
|
613
|
+
return S === 1 && h === g - 1 ? Me : S === -1 && h === g + 1 ? Wn : S === -1 && h === g ? Hn : D;
|
|
614
614
|
}
|
|
615
615
|
function Vn(e, t) {
|
|
616
616
|
let n = Date.now(), r = D;
|
|
@@ -619,13 +619,13 @@ function Vn(e, t) {
|
|
|
619
619
|
if (c.has("historic")) return r = D, n = u, de;
|
|
620
620
|
const d = Jn(i, o, a, l, e.isComposing()), f = (() => {
|
|
621
621
|
const m = s === null || s.editor === e, g = c.has("history-push");
|
|
622
|
-
if (!g && m && c.has("history-merge")) return
|
|
622
|
+
if (!g && m && c.has("history-merge")) return ee;
|
|
623
623
|
if (i === null) return ue;
|
|
624
624
|
const h = o._selection;
|
|
625
|
-
return a.size > 0 || l.size > 0 ? g === !1 && d !== D && d === r && u < n + t && m || a.size === 1 && function(
|
|
626
|
-
const
|
|
627
|
-
return !(C(L) && C(
|
|
628
|
-
}(Array.from(a)[0], i, o) ?
|
|
625
|
+
return a.size > 0 || l.size > 0 ? g === !1 && d !== D && d === r && u < n + t && m || a.size === 1 && function(S, E, w) {
|
|
626
|
+
const $ = E._nodeMap.get(S), b = w._nodeMap.get(S), L = E._selection, k = w._selection;
|
|
627
|
+
return !(C(L) && C(k) && L.anchor.type === "element" && L.focus.type === "element" && k.anchor.type === "text" && k.focus.type === "text" || !R($) || !R(b) || $.__parent !== b.__parent) && JSON.stringify(E.read(() => $.exportJSON())) === JSON.stringify(w.read(() => b.exportJSON()));
|
|
628
|
+
}(Array.from(a)[0], i, o) ? ee : ue : h !== null ? ee : de;
|
|
629
629
|
})();
|
|
630
630
|
return n = u, r = d, f;
|
|
631
631
|
};
|
|
@@ -635,25 +635,25 @@ function Oe(e) {
|
|
|
635
635
|
}
|
|
636
636
|
function Xn(e, t, n) {
|
|
637
637
|
const r = Vn(e, n);
|
|
638
|
-
return
|
|
638
|
+
return U(e.registerCommand(Mt, () => (function(o, s) {
|
|
639
639
|
const a = s.redoStack, l = s.undoStack;
|
|
640
640
|
if (l.length !== 0) {
|
|
641
641
|
const c = s.current, u = l.pop();
|
|
642
|
-
c !== null && (a.push(c), o.dispatchCommand(
|
|
642
|
+
c !== null && (a.push(c), o.dispatchCommand(X, !0)), l.length === 0 && o.dispatchCommand(Y, !1), s.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: "historic" });
|
|
643
643
|
}
|
|
644
644
|
}(e, t), !0), p), e.registerCommand(Rt, () => (function(o, s) {
|
|
645
645
|
const a = s.redoStack, l = s.undoStack;
|
|
646
646
|
if (a.length !== 0) {
|
|
647
647
|
const c = s.current;
|
|
648
|
-
c !== null && (l.push(c), o.dispatchCommand(
|
|
648
|
+
c !== null && (l.push(c), o.dispatchCommand(Y, !0));
|
|
649
649
|
const u = a.pop();
|
|
650
|
-
a.length === 0 && o.dispatchCommand(
|
|
650
|
+
a.length === 0 && o.dispatchCommand(X, !1), s.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: "historic" });
|
|
651
651
|
}
|
|
652
|
-
}(e, t), !0), p), e.registerCommand(Pt, () => (Oe(t), !1), p), e.registerCommand(Tt, () => (Oe(t), e.dispatchCommand(
|
|
652
|
+
}(e, t), !0), p), e.registerCommand(Pt, () => (Oe(t), !1), p), e.registerCommand(Tt, () => (Oe(t), e.dispatchCommand(X, !1), e.dispatchCommand(Y, !1), !0), p), e.registerUpdateListener(({ editorState: o, prevEditorState: s, dirtyLeaves: a, dirtyElements: l, tags: c }) => {
|
|
653
653
|
const u = t.current, d = t.redoStack, f = t.undoStack, m = u === null ? null : u.editorState;
|
|
654
654
|
if (u !== null && o === m) return;
|
|
655
655
|
const g = r(s, o, u, a, l, c);
|
|
656
|
-
if (g === ue) d.length !== 0 && (t.redoStack = [], e.dispatchCommand(
|
|
656
|
+
if (g === ue) d.length !== 0 && (t.redoStack = [], e.dispatchCommand(X, !1)), u !== null && (f.push({ ...u }), e.dispatchCommand(Y, !0));
|
|
657
657
|
else if (g === de) return;
|
|
658
658
|
t.current = { editor: e, editorState: o };
|
|
659
659
|
}));
|
|
@@ -661,30 +661,30 @@ function Xn(e, t, n) {
|
|
|
661
661
|
function Yn() {
|
|
662
662
|
return { current: null, redoStack: [], undoStack: [] };
|
|
663
663
|
}
|
|
664
|
-
function
|
|
665
|
-
const [n] =
|
|
664
|
+
function Gn({ delay: e, externalHistoryState: t }) {
|
|
665
|
+
const [n] = M();
|
|
666
666
|
return function(r, i, o = 1e3) {
|
|
667
667
|
const s = H(() => i || Yn(), [i]);
|
|
668
|
-
|
|
668
|
+
x(() => Xn(r, s, o), [o, r, s]);
|
|
669
669
|
}(n, t, e), null;
|
|
670
670
|
}
|
|
671
671
|
function Zn(e) {
|
|
672
672
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
673
673
|
}
|
|
674
|
-
var
|
|
674
|
+
var te = Zn(function(e) {
|
|
675
675
|
const t = new URLSearchParams();
|
|
676
676
|
t.append("code", e);
|
|
677
677
|
for (let n = 1; n < arguments.length; n++) t.append("v", arguments[n]);
|
|
678
678
|
throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
679
679
|
});
|
|
680
|
-
function
|
|
681
|
-
const [r] =
|
|
682
|
-
return
|
|
680
|
+
function Qn({ hasCellMerge: e = !0, hasCellBackgroundColor: t = !0, hasTabHandler: n = !0 }) {
|
|
681
|
+
const [r] = M();
|
|
682
|
+
return x(() => (r.hasNodes([ne, re, Ue]) || te(10), U(r.registerCommand(jt, ({ columns: i, rows: o, includeHeaders: s }) => {
|
|
683
683
|
const a = qt(Number(o), Number(i), s);
|
|
684
684
|
zt(a);
|
|
685
685
|
const l = a.getFirstDescendant();
|
|
686
|
-
return
|
|
687
|
-
}, p), r.registerNodeTransform(
|
|
686
|
+
return R(l) && l.select(), !0;
|
|
687
|
+
}, p), r.registerNodeTransform(ne, (i) => {
|
|
688
688
|
const [o] = Bt(i, null, null), s = o.reduce((l, c) => Math.max(l, c.length), 0), a = i.getChildren();
|
|
689
689
|
for (let l = 0; l < o.length; ++l) {
|
|
690
690
|
const c = a[l];
|
|
@@ -695,11 +695,11 @@ function Gn({ hasCellMerge: e = !0, hasCellBackgroundColor: t = !0, hasTabHandle
|
|
|
695
695
|
f.append(fe()), c.append(f);
|
|
696
696
|
}
|
|
697
697
|
}
|
|
698
|
-
}))), [r]),
|
|
698
|
+
}))), [r]), x(() => {
|
|
699
699
|
const i = /* @__PURE__ */ new Map(), o = (a, l, c) => {
|
|
700
700
|
const u = c, d = Xt(a, u, r, n);
|
|
701
701
|
i.set(l, [d, u]);
|
|
702
|
-
}, s = r.registerMutationListener(
|
|
702
|
+
}, s = r.registerMutationListener(ne, (a) => {
|
|
703
703
|
for (const [l, c] of a) if (c === "created" || c === "updated") {
|
|
704
704
|
const u = i.get(l), d = r.getElementByKey(l);
|
|
705
705
|
u && d === u[1] || (u && (u[0].removeListeners(), i.delete(l)), d !== null && r.getEditorState().read(() => {
|
|
@@ -715,31 +715,31 @@ function Gn({ hasCellMerge: e = !0, hasCellBackgroundColor: t = !0, hasTabHandle
|
|
|
715
715
|
s();
|
|
716
716
|
for (const [, [a]] of i) a.removeListeners();
|
|
717
717
|
};
|
|
718
|
-
}, [r, n]),
|
|
719
|
-
if (!e) return r.registerNodeTransform(
|
|
718
|
+
}, [r, n]), x(() => {
|
|
719
|
+
if (!e) return r.registerNodeTransform(re, (i) => {
|
|
720
720
|
if (i.getColSpan() > 1 || i.getRowSpan() > 1) {
|
|
721
721
|
const [, , o] = Ht(i), [s] = Jt(o, i, i), a = s.length, l = s[0].length;
|
|
722
722
|
let c = o.getFirstChild();
|
|
723
|
-
xe(c) ||
|
|
723
|
+
xe(c) || te(175);
|
|
724
724
|
const u = [];
|
|
725
725
|
for (let d = 0; d < a; d++) {
|
|
726
|
-
d !== 0 && (c = c.getNextSibling(), xe(c) ||
|
|
726
|
+
d !== 0 && (c = c.getNextSibling(), xe(c) || te(175));
|
|
727
727
|
let f = null;
|
|
728
728
|
for (let m = 0; m < l; m++) {
|
|
729
729
|
const g = s[d][m], h = g.cell;
|
|
730
730
|
if (g.startRow === d && g.startColumn === m) f = h, u.push(h);
|
|
731
731
|
else if (h.getColSpan() > 1 || h.getRowSpan() > 1) {
|
|
732
|
-
Vt(h) ||
|
|
733
|
-
const
|
|
734
|
-
f !== null ? f.insertAfter(
|
|
732
|
+
Vt(h) || te(176);
|
|
733
|
+
const S = _e(h.__headerState);
|
|
734
|
+
f !== null ? f.insertAfter(S) : Ut(c, S);
|
|
735
735
|
}
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
738
|
for (const d of u) d.setColSpan(1), d.setRowSpan(1);
|
|
739
739
|
}
|
|
740
740
|
});
|
|
741
|
-
}, [r, e]),
|
|
742
|
-
if (!t) return r.registerNodeTransform(
|
|
741
|
+
}, [r, e]), x(() => {
|
|
742
|
+
if (!t) return r.registerNodeTransform(re, (i) => {
|
|
743
743
|
i.getBackgroundColor() !== null && i.setBackgroundColor(null);
|
|
744
744
|
});
|
|
745
745
|
}, [r, t, e]), null;
|
|
@@ -756,79 +756,79 @@ const Ve = 200, er = (e) => /^<(b|i|u|strong|em|mark|small|del|ins|sub|sup|div|p
|
|
|
756
756
|
maxWords: l = Ve,
|
|
757
757
|
onChange: c
|
|
758
758
|
}) => {
|
|
759
|
-
const { switchLanguage: u } = dn(), d = ln(), [f] =
|
|
759
|
+
const { switchLanguage: u } = dn(), d = ln(), [f] = O(() => Ie()), [m, g] = O(0), [h, S] = O(0), E = {
|
|
760
760
|
namespace: "UvaEditor",
|
|
761
761
|
editor: f,
|
|
762
762
|
theme: cn,
|
|
763
|
-
onError(
|
|
764
|
-
throw
|
|
763
|
+
onError(b) {
|
|
764
|
+
throw b;
|
|
765
765
|
},
|
|
766
|
-
nodes: [Be, je, qe, rn,
|
|
767
|
-
editorState: (
|
|
768
|
-
const
|
|
769
|
-
if (
|
|
770
|
-
|
|
771
|
-
|
|
766
|
+
nodes: [Be, je, qe, rn, re, Ue, ne],
|
|
767
|
+
editorState: (b) => {
|
|
768
|
+
const k = new DOMParser().parseFromString(t, "text/html"), _ = Yt(b, k), N = I();
|
|
769
|
+
if (N.clear(), er(t))
|
|
770
|
+
_.forEach((K) => {
|
|
771
|
+
N.append(K);
|
|
772
772
|
});
|
|
773
773
|
else {
|
|
774
|
-
const
|
|
775
|
-
|
|
776
|
-
|
|
774
|
+
const K = fe();
|
|
775
|
+
_.forEach((J, T) => {
|
|
776
|
+
T === 0 ? (K.append(J), N.append(K)) : N.append(J);
|
|
777
777
|
});
|
|
778
778
|
}
|
|
779
|
+
g(w(I().getTextContent().replace(/\s+/g, " ").trim()) || 0);
|
|
779
780
|
}
|
|
780
|
-
}, b = (
|
|
781
|
-
|
|
782
|
-
let
|
|
783
|
-
|
|
784
|
-
x.trim().length === 0 ? g(0) : (g(x.split(" ").length), L = Qt(_)), c(L);
|
|
781
|
+
}, w = (b) => b.trim().length === 0 ? 0 : b.split(" ").length, $ = (b, L) => {
|
|
782
|
+
b.read(() => {
|
|
783
|
+
let k = "";
|
|
784
|
+
g(w(I().getTextContent().replace(/\s+/g, " ").trim())), k = Gt(L), c(k);
|
|
785
785
|
});
|
|
786
786
|
};
|
|
787
|
-
return
|
|
787
|
+
return x(() => {
|
|
788
788
|
u(e.toLocaleLowerCase());
|
|
789
|
-
}, [e, u]), /* @__PURE__ */ F("div", { className:
|
|
790
|
-
/* @__PURE__ */ F("div", { className:
|
|
789
|
+
}, [e, u]), /* @__PURE__ */ F("div", { className: P.editor__container, children: [
|
|
790
|
+
/* @__PURE__ */ F("div", { className: P.editor__header, children: [
|
|
791
791
|
/* @__PURE__ */ y(un, { label: r, info: i, required: o }),
|
|
792
|
-
|
|
793
|
-
/* @__PURE__ */ y("span", { className: on({ [
|
|
792
|
+
/* @__PURE__ */ F("div", { className: P["editor__header-word-count"], children: [
|
|
793
|
+
/* @__PURE__ */ y("span", { className: on({ [P["editor__header-word-count--alert"]]: m > l }), children: m }),
|
|
794
794
|
" / ",
|
|
795
795
|
l
|
|
796
796
|
] })
|
|
797
797
|
] }),
|
|
798
|
-
/* @__PURE__ */ y("div", { className:
|
|
798
|
+
/* @__PURE__ */ y("div", { className: P.editor, children: /* @__PURE__ */ F(pn, { initialConfig: E, children: [
|
|
799
799
|
/* @__PURE__ */ y(sn, { editorScrollPosition: h }),
|
|
800
|
-
/* @__PURE__ */ F("div", { className:
|
|
800
|
+
/* @__PURE__ */ F("div", { className: P["editor__field-wrapper"], children: [
|
|
801
801
|
/* @__PURE__ */ y(
|
|
802
802
|
Dn,
|
|
803
803
|
{
|
|
804
804
|
contentEditable: /* @__PURE__ */ y(
|
|
805
805
|
Mn,
|
|
806
806
|
{
|
|
807
|
-
className:
|
|
807
|
+
className: P.editor__field,
|
|
808
808
|
"aria-label": d.common.rteAriaLabel,
|
|
809
809
|
"aria-placeholder": n,
|
|
810
810
|
title: d.common.rteTitle,
|
|
811
|
-
placeholder: /* @__PURE__ */ y("div", { className:
|
|
811
|
+
placeholder: /* @__PURE__ */ y("div", { className: P.editor__placeholder, children: n }),
|
|
812
812
|
spellCheck: !1,
|
|
813
813
|
id: "rteEditor",
|
|
814
814
|
style: { height: `${a}`, maxHeight: `${a}` },
|
|
815
|
-
onScroll: (
|
|
815
|
+
onScroll: (b) => S(b.currentTarget.scrollTop)
|
|
816
816
|
}
|
|
817
817
|
),
|
|
818
|
-
placeholder: /* @__PURE__ */ y("div", { className:
|
|
818
|
+
placeholder: /* @__PURE__ */ y("div", { className: P.editor__placeholder, children: n }),
|
|
819
819
|
ErrorBoundary: Kn
|
|
820
820
|
}
|
|
821
821
|
),
|
|
822
|
-
/* @__PURE__ */ y(Gn, {}),
|
|
823
822
|
/* @__PURE__ */ y(Qn, {}),
|
|
823
|
+
/* @__PURE__ */ y(Gn, {}),
|
|
824
824
|
/* @__PURE__ */ y(Un, {}),
|
|
825
825
|
/* @__PURE__ */ y(Bn, { validateUrl: en }),
|
|
826
826
|
/* @__PURE__ */ y(tn, { matchers: nn }),
|
|
827
827
|
/* @__PURE__ */ y(jn, {}),
|
|
828
|
-
/* @__PURE__ */ y(zn, { onChange:
|
|
828
|
+
/* @__PURE__ */ y(zn, { onChange: $ })
|
|
829
829
|
] })
|
|
830
830
|
] }) }),
|
|
831
|
-
s !== "" && /* @__PURE__ */ F("div", { className:
|
|
831
|
+
s !== "" && /* @__PURE__ */ F("div", { className: P.editor__error, children: [
|
|
832
832
|
/* @__PURE__ */ y(an, { name: "ExclamationTriangleFill", size: 24 }),
|
|
833
833
|
s
|
|
834
834
|
] })
|