@uva-glass/component-library 3.0.4 → 3.0.5
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-CZAqLAjm.js → Lexical.prod-DTADK2yJ.js} +1496 -1469
- package/dist/Lexical.prod-DTADK2yJ.js.map +1 -0
- package/dist/LexicalClipboard.prod-Dx5Fm6e5.js +258 -0
- package/dist/LexicalClipboard.prod-Dx5Fm6e5.js.map +1 -0
- package/dist/{LexicalLink.prod-kqeQGYSo.js → LexicalLink.prod-JpC4y56U.js} +32 -32
- package/dist/LexicalLink.prod-JpC4y56U.js.map +1 -0
- package/dist/LexicalList.prod-w0kSq9sB.js +579 -0
- package/dist/LexicalList.prod-w0kSq9sB.js.map +1 -0
- package/dist/LexicalSelection.prod-DQLHaigk.js +78 -0
- package/dist/LexicalSelection.prod-DQLHaigk.js.map +1 -0
- package/dist/{LexicalTable.prod-DtAMjSWg.js → LexicalTable.prod-DjfZc87j.js} +351 -333
- package/dist/LexicalTable.prod-DjfZc87j.js.map +1 -0
- package/dist/{LexicalUtils.prod-C-NXnTzK.js → LexicalUtils.prod-BBwue2Aj.js} +38 -38
- package/dist/LexicalUtils.prod-BBwue2Aj.js.map +1 -0
- package/dist/{TablePlugin-DkL40qIf.js → TablePlugin-Co5vgBHF.js} +45 -45
- package/dist/{TablePlugin-DkL40qIf.js.map → TablePlugin-Co5vgBHF.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/OverlayStepBar/OverlayStepBar.js +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +3 -3
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +2 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +2 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +45 -45
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +27 -27
- package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +7 -7
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +3 -3
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +10 -10
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +15 -15
- package/dist/components/RteEditor/Plugins/index.js +1 -1
- package/dist/components/RteEditor/RteEditor.js +240 -240
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/RteEditor/helpers.js +4 -4
- package/dist/components/index.js +1 -1
- package/dist/{helpers-DYmWlhgC.js → helpers-DgTW1vIO.js} +30 -30
- package/dist/{helpers-DYmWlhgC.js.map → helpers-DgTW1vIO.js.map} +1 -1
- package/dist/index.js +1 -1
- package/package.json +7 -7
- package/dist/Lexical.prod-CZAqLAjm.js.map +0 -1
- package/dist/LexicalClipboard.prod-B0GrUtzr.js +0 -258
- package/dist/LexicalClipboard.prod-B0GrUtzr.js.map +0 -1
- package/dist/LexicalLink.prod-kqeQGYSo.js.map +0 -1
- package/dist/LexicalList.prod-BEKqHUO2.js +0 -576
- package/dist/LexicalList.prod-BEKqHUO2.js.map +0 -1
- package/dist/LexicalSelection.prod-B1DTqn9H.js +0 -86
- package/dist/LexicalSelection.prod-B1DTqn9H.js.map +0 -1
- package/dist/LexicalTable.prod-DtAMjSWg.js.map +0 -1
- package/dist/LexicalUtils.prod-C-NXnTzK.js.map +0 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsx as h, jsxs as z, Fragment as Pe } from "react/jsx-runtime";
|
|
2
|
-
import { o as
|
|
3
|
-
import {
|
|
2
|
+
import { o as Ve, l as Je, u as P } from "../../LexicalComposerContext.prod-BCXERl09.js";
|
|
3
|
+
import { aq as Te, a2 as K, j as Me, q as p, T as q, M as W, H as Xe, C as R, a as g, I as Ge, g as m, ar as Ye, a1 as Re, e as Qe, F as Fe, as as Ze, B as et, ap as O, am as tt, at as nt, au as rt, av as ot, f as ne, aw as it, ax as at, U as st, s as lt, c as ut, l as ct, ay as dt, az as fe, o as me, N as ft, r as re, t as mt, a5 as Ie, aA as pe, p as pt, y as gt, k as ht, a4 as ge, v as Ct, aB as yt, aC as Et, aD as vt, al as wt, z as bt, w as $t, aE as St, D as _t, n as kt, u as xt, a9 as Nt, G as he, aF as Lt, E as Dt, ab as G, aa as Y, aG as Pt, aH as Tt, ad as Mt, ac as Rt } from "../../Lexical.prod-DTADK2yJ.js";
|
|
4
4
|
import * as oe from "react";
|
|
5
|
-
import { useMemo as
|
|
6
|
-
import { N as
|
|
7
|
-
import { flushSync as zt, createPortal as
|
|
8
|
-
import { N as Ce, O as ye, h as
|
|
9
|
-
import { M as Ee, j as ve } from "../../LexicalSelection.prod-
|
|
10
|
-
import { V as
|
|
11
|
-
import { f as Be, N as we, x as
|
|
12
|
-
import {
|
|
13
|
-
import { a as
|
|
5
|
+
import { useMemo as V, useLayoutEffect as U, useEffect as _, useState as F, useRef as Oe, Suspense as Ft, forwardRef as ze, useCallback as It } from "react";
|
|
6
|
+
import { N as j, d as A, l as Ot, i as de } from "../../LexicalUtils.prod-BBwue2Aj.js";
|
|
7
|
+
import { flushSync as zt, createPortal as At } from "react-dom";
|
|
8
|
+
import { N as Ce, O as ye, h as Kt, m as Bt } from "../../LexicalClipboard.prod-Dx5Fm6e5.js";
|
|
9
|
+
import { M as Ee, j as ve } from "../../LexicalSelection.prod-DQLHaigk.js";
|
|
10
|
+
import { V as Ae, I as Ke, Z as Ut } from "../../LexicalList.prod-w0kSq9sB.js";
|
|
11
|
+
import { f as Be, N as we, x as ie, m as jt, O as Ht } from "../../LexicalLink.prod-JpC4y56U.js";
|
|
12
|
+
import { P as qt, V as Wt, j as Vt, X as Jt, u as Ue, S as Xt, W as Gt } from "../../LexicalTable.prod-DjfZc87j.js";
|
|
13
|
+
import { a as Yt, F as Qt, M as Zt } from "../../helpers-DgTW1vIO.js";
|
|
14
14
|
import { c as en } from "../../clsx-OuTLNxxd.js";
|
|
15
15
|
import { exportMap as tn, isStartingWithHtmlTag as nn, mergeBoldStrongTags as rn } from "./helpers.js";
|
|
16
16
|
import { s as M } from "../../RteEditor.module-oFMKEW6f.js";
|
|
17
17
|
import { ToolBarPlugin as on } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
|
|
18
|
-
import { useTranslation as
|
|
19
|
-
import "../../TablePlugin-
|
|
18
|
+
import { useTranslation as an } from "./hooks/useTranslation.js";
|
|
19
|
+
import "../../TablePlugin-Co5vgBHF.js";
|
|
20
20
|
import "./Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js";
|
|
21
21
|
import "./hooks/components/Flyout.js";
|
|
22
22
|
import "../Buttons/Button.js";
|
|
@@ -27,7 +27,7 @@ import "@react-aria/dialog";
|
|
|
27
27
|
import "@react-aria/focus";
|
|
28
28
|
import "@react-aria/overlays";
|
|
29
29
|
import "../OverlayCloseButton/OverlayCloseButton.js";
|
|
30
|
-
import { FeedbackBox as
|
|
30
|
+
import { FeedbackBox as sn } from "../FeedbackBox/FeedbackBox.js";
|
|
31
31
|
import "../GridRow/GridRow.js";
|
|
32
32
|
import "../IconButton/IconButton.js";
|
|
33
33
|
import "../Input/Input.js";
|
|
@@ -41,60 +41,60 @@ import { UvaTheme as ln } from "./UvaTheme/UvaTheme.js";
|
|
|
41
41
|
import { EditorHeader as un } from "./EditorHeader/EditorHeader.js";
|
|
42
42
|
import { LanguageProvider as cn, useLanguage as dn } from "./Providers/LanguageProvider.js";
|
|
43
43
|
import { PasteHandlerPlugin as fn } from "./Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js";
|
|
44
|
-
const
|
|
44
|
+
const je = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, mn = je ? U : _, Q = { tag: "history-merge" };
|
|
45
45
|
function pn({ initialConfig: t, children: e }) {
|
|
46
|
-
const n =
|
|
47
|
-
const { theme: o, namespace:
|
|
46
|
+
const n = V(() => {
|
|
47
|
+
const { theme: o, namespace: i, nodes: r, onError: a, editorState: s, html: l } = t, u = Ve(null, o), c = Te({ editable: t.editable, html: l, namespace: i, nodes: r, onError: (d) => a(d, c), theme: o });
|
|
48
48
|
return function(d, f) {
|
|
49
49
|
if (f !== null) {
|
|
50
50
|
if (f === void 0) d.update(() => {
|
|
51
|
-
const C =
|
|
51
|
+
const C = K();
|
|
52
52
|
if (C.isEmpty()) {
|
|
53
53
|
const y = Me();
|
|
54
54
|
C.append(y);
|
|
55
|
-
const w =
|
|
55
|
+
const w = je ? document.activeElement : null;
|
|
56
56
|
(p() !== null || w !== null && w === d.getRootElement()) && y.select();
|
|
57
57
|
}
|
|
58
|
-
},
|
|
58
|
+
}, Q);
|
|
59
59
|
else if (f !== null) switch (typeof f) {
|
|
60
60
|
case "string": {
|
|
61
61
|
const C = d.parseEditorState(f);
|
|
62
|
-
d.setEditorState(C,
|
|
62
|
+
d.setEditorState(C, Q);
|
|
63
63
|
break;
|
|
64
64
|
}
|
|
65
65
|
case "object":
|
|
66
|
-
d.setEditorState(f,
|
|
66
|
+
d.setEditorState(f, Q);
|
|
67
67
|
break;
|
|
68
68
|
case "function":
|
|
69
69
|
d.update(() => {
|
|
70
|
-
|
|
71
|
-
},
|
|
70
|
+
K().isEmpty() && f(d);
|
|
71
|
+
}, Q);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
}(c,
|
|
74
|
+
}(c, s), [c, u];
|
|
75
75
|
}, []);
|
|
76
76
|
return mn(() => {
|
|
77
|
-
const o = t.editable, [
|
|
78
|
-
|
|
77
|
+
const o = t.editable, [i] = n;
|
|
78
|
+
i.setEditable(o === void 0 || o);
|
|
79
79
|
}, []), h(Je.Provider, { value: n, children: e });
|
|
80
80
|
}
|
|
81
|
-
const gn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ?
|
|
81
|
+
const gn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U : _;
|
|
82
82
|
function hn(t) {
|
|
83
83
|
return { initialValueFn: () => t.isEditable(), subscribe: (e) => t.registerEditableListener(e) };
|
|
84
84
|
}
|
|
85
85
|
function Cn() {
|
|
86
86
|
return function(t) {
|
|
87
|
-
const [e] = P(), n =
|
|
87
|
+
const [e] = P(), n = V(() => t(e), [e, t]), [o, i] = F(() => n.initialValueFn()), r = Oe(o);
|
|
88
88
|
return gn(() => {
|
|
89
|
-
const { initialValueFn: a, subscribe:
|
|
90
|
-
return r.current !== l && (r.current = l,
|
|
91
|
-
r.current = u,
|
|
89
|
+
const { initialValueFn: a, subscribe: s } = n, l = a();
|
|
90
|
+
return r.current !== l && (r.current = l, i(l)), s((u) => {
|
|
91
|
+
r.current = u, i(u);
|
|
92
92
|
});
|
|
93
93
|
}, [n, t]), o;
|
|
94
94
|
}(hn);
|
|
95
95
|
}
|
|
96
96
|
function yn() {
|
|
97
|
-
return
|
|
97
|
+
return K().getTextContent();
|
|
98
98
|
}
|
|
99
99
|
function En(t, e = !0) {
|
|
100
100
|
if (t) return !1;
|
|
@@ -103,15 +103,15 @@ function En(t, e = !0) {
|
|
|
103
103
|
}
|
|
104
104
|
function vn(t) {
|
|
105
105
|
if (!En(t, !1)) return !1;
|
|
106
|
-
const e =
|
|
106
|
+
const e = K().getChildren(), n = e.length;
|
|
107
107
|
if (n > 1) return !1;
|
|
108
108
|
for (let o = 0; o < n; o++) {
|
|
109
|
-
const
|
|
110
|
-
if (q(
|
|
111
|
-
if (
|
|
112
|
-
if (!Xe(
|
|
113
|
-
const r =
|
|
114
|
-
for (let
|
|
109
|
+
const i = e[o];
|
|
110
|
+
if (q(i)) return !1;
|
|
111
|
+
if (W(i)) {
|
|
112
|
+
if (!Xe(i) || i.__indent !== 0) return !1;
|
|
113
|
+
const r = i.getChildren(), a = r.length;
|
|
114
|
+
for (let s = 0; s < a; s++) {
|
|
115
115
|
const l = r[o];
|
|
116
116
|
if (!R(l)) return !1;
|
|
117
117
|
}
|
|
@@ -134,8 +134,8 @@ wn(function(t) {
|
|
|
134
134
|
function bn(t) {
|
|
135
135
|
const e = window.location.origin, n = (o) => {
|
|
136
136
|
if (o.origin !== e) return;
|
|
137
|
-
const
|
|
138
|
-
if (document.activeElement !==
|
|
137
|
+
const i = t.getRootElement();
|
|
138
|
+
if (document.activeElement !== i) return;
|
|
139
139
|
const r = o.data;
|
|
140
140
|
if (typeof r == "string") {
|
|
141
141
|
let a;
|
|
@@ -145,9 +145,9 @@ function bn(t) {
|
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
147
|
if (a && a.protocol === "nuanria_messaging" && a.type === "request") {
|
|
148
|
-
const
|
|
149
|
-
if (
|
|
150
|
-
const l =
|
|
148
|
+
const s = a.payload;
|
|
149
|
+
if (s && s.functionId === "makeChanges") {
|
|
150
|
+
const l = s.args;
|
|
151
151
|
if (l) {
|
|
152
152
|
const [u, c, d, f, C, y] = l;
|
|
153
153
|
t.update(() => {
|
|
@@ -183,24 +183,24 @@ function be(t, e) {
|
|
|
183
183
|
}
|
|
184
184
|
return null;
|
|
185
185
|
}
|
|
186
|
-
const H = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, $n = H && "documentMode" in document ? document.documentMode : null, Sn = !(!H || !("InputEvent" in window) || $n) && "getTargetRanges" in new window.InputEvent("input"), _n = H && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), $e = H && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, kn = H && /^(?=.*Chrome).*/i.test(navigator.userAgent), xn = H && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !kn, Se =
|
|
187
|
-
function
|
|
186
|
+
const H = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, $n = H && "documentMode" in document ? document.documentMode : null, Sn = !(!H || !("InputEvent" in window) || $n) && "getTargetRanges" in new window.InputEvent("input"), _n = H && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), $e = H && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, kn = H && /^(?=.*Chrome).*/i.test(navigator.userAgent), xn = H && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !kn, Se = Qe();
|
|
187
|
+
function Z(t) {
|
|
188
188
|
let e = null;
|
|
189
|
-
if (
|
|
190
|
-
const n = e.types, o = n.includes("Files"),
|
|
191
|
-
return [o, Array.from(e.files),
|
|
189
|
+
if (A(t, DragEvent) ? e = t.dataTransfer : A(t, ClipboardEvent) && (e = t.clipboardData), e === null) return [!1, [], !1];
|
|
190
|
+
const n = e.types, o = n.includes("Files"), i = n.includes("text/html") || n.includes("text/plain");
|
|
191
|
+
return [o, Array.from(e.files), i];
|
|
192
192
|
}
|
|
193
193
|
function _e(t) {
|
|
194
194
|
const e = p();
|
|
195
195
|
if (!g(e)) return !1;
|
|
196
196
|
const n = /* @__PURE__ */ new Set(), o = e.getNodes();
|
|
197
|
-
for (let
|
|
198
|
-
const r = o[
|
|
197
|
+
for (let i = 0; i < o.length; i++) {
|
|
198
|
+
const r = o[i], a = r.getKey();
|
|
199
199
|
if (n.has(a)) continue;
|
|
200
|
-
const
|
|
201
|
-
if (
|
|
202
|
-
const l =
|
|
203
|
-
|
|
200
|
+
const s = de(r, (u) => W(u) && !u.isInline());
|
|
201
|
+
if (s === null) continue;
|
|
202
|
+
const l = s.getKey();
|
|
203
|
+
s.canIndent() && !n.has(l) && (n.add(l), t(s));
|
|
204
204
|
}
|
|
205
205
|
return n.size > 0;
|
|
206
206
|
}
|
|
@@ -212,9 +212,9 @@ function ae(t) {
|
|
|
212
212
|
for (const e of ["lowercase", "uppercase", "capitalize"]) t.hasFormat(e) && t.toggleFormat(e);
|
|
213
213
|
}
|
|
214
214
|
function Nn(t) {
|
|
215
|
-
return
|
|
215
|
+
return j(t.registerCommand(Nt, (e) => {
|
|
216
216
|
const n = p();
|
|
217
|
-
return !!
|
|
217
|
+
return !!O(n) && (n.clear(), !0);
|
|
218
218
|
}, 0), t.registerCommand(re, (e) => {
|
|
219
219
|
const n = p();
|
|
220
220
|
return !!g(n) && (n.deleteCharacter(e), !0);
|
|
@@ -232,8 +232,8 @@ function Nn(t) {
|
|
|
232
232
|
const o = e.dataTransfer;
|
|
233
233
|
if (o != null) Ce(o, n, t);
|
|
234
234
|
else if (g(n)) {
|
|
235
|
-
const
|
|
236
|
-
return
|
|
235
|
+
const i = e.data;
|
|
236
|
+
return i && n.insertText(i), !0;
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
return !0;
|
|
@@ -245,10 +245,10 @@ function Nn(t) {
|
|
|
245
245
|
return !!g(n) && (n.formatText(e), !0);
|
|
246
246
|
}, m), t.registerCommand(bt, (e) => {
|
|
247
247
|
const n = p();
|
|
248
|
-
if (!g(n) && !
|
|
248
|
+
if (!g(n) && !O(n)) return !1;
|
|
249
249
|
const o = n.getNodes();
|
|
250
|
-
for (const
|
|
251
|
-
const r = de(
|
|
250
|
+
for (const i of o) {
|
|
251
|
+
const r = de(i, (a) => W(a) && !a.isInline());
|
|
252
252
|
r !== null && r.setFormat(e);
|
|
253
253
|
}
|
|
254
254
|
return !0;
|
|
@@ -266,7 +266,7 @@ function Nn(t) {
|
|
|
266
266
|
n > 0 && e.setIndent(n - 1);
|
|
267
267
|
}), m), t.registerCommand(Ct, (e) => {
|
|
268
268
|
const n = p();
|
|
269
|
-
if (
|
|
269
|
+
if (O(n) && !ee(e.target)) {
|
|
270
270
|
const o = n.getNodes();
|
|
271
271
|
if (o.length > 0) return o[0].selectPrevious(), !0;
|
|
272
272
|
} else if (g(n)) {
|
|
@@ -276,13 +276,13 @@ function Nn(t) {
|
|
|
276
276
|
return !1;
|
|
277
277
|
}, m), t.registerCommand(ht, (e) => {
|
|
278
278
|
const n = p();
|
|
279
|
-
if (
|
|
279
|
+
if (O(n)) {
|
|
280
280
|
const o = n.getNodes();
|
|
281
281
|
if (o.length > 0) return o[0].selectNext(0, 0), !0;
|
|
282
282
|
} else if (g(n)) {
|
|
283
|
-
if (function(
|
|
284
|
-
const r =
|
|
285
|
-
return r.key === "root" && r.offset ===
|
|
283
|
+
if (function(i) {
|
|
284
|
+
const r = i.focus;
|
|
285
|
+
return r.key === "root" && r.offset === K().getChildrenSize();
|
|
286
286
|
}(n)) return e.preventDefault(), !0;
|
|
287
287
|
const o = ge(n.focus, !1);
|
|
288
288
|
if (!e.shiftKey && q(o) && !o.isIsolated() && !o.isInline()) return o.selectNext(), e.preventDefault(), !0;
|
|
@@ -290,7 +290,7 @@ function Nn(t) {
|
|
|
290
290
|
return !1;
|
|
291
291
|
}, m), t.registerCommand(gt, (e) => {
|
|
292
292
|
const n = p();
|
|
293
|
-
if (
|
|
293
|
+
if (O(n)) {
|
|
294
294
|
const o = n.getNodes();
|
|
295
295
|
if (o.length > 0) return e.preventDefault(), o[0].selectPrevious(), !0;
|
|
296
296
|
}
|
|
@@ -302,9 +302,9 @@ function Nn(t) {
|
|
|
302
302
|
return !1;
|
|
303
303
|
}, m), t.registerCommand(pt, (e) => {
|
|
304
304
|
const n = p();
|
|
305
|
-
if (
|
|
306
|
-
const
|
|
307
|
-
if (
|
|
305
|
+
if (O(n) && !ee(e.target)) {
|
|
306
|
+
const i = n.getNodes();
|
|
307
|
+
if (i.length > 0) return e.preventDefault(), i[0].selectNext(0, 0), !0;
|
|
308
308
|
}
|
|
309
309
|
if (!g(n)) return !1;
|
|
310
310
|
const o = e.shiftKey;
|
|
@@ -313,8 +313,8 @@ function Nn(t) {
|
|
|
313
313
|
if (ee(e.target)) return !1;
|
|
314
314
|
const n = p();
|
|
315
315
|
if (!g(n)) return !1;
|
|
316
|
-
const { anchor: o } = n,
|
|
317
|
-
return n.isCollapsed() && o.offset === 0 && !
|
|
316
|
+
const { anchor: o } = n, i = o.getNode();
|
|
317
|
+
return n.isCollapsed() && o.offset === 0 && !Ie(i) && Ot(i).getIndent() > 0 ? (e.preventDefault(), t.dispatchCommand(pe, void 0)) : (!$e || navigator.language !== "ko-KR") && (e.preventDefault(), t.dispatchCommand(re, !0));
|
|
318
318
|
}, m), t.registerCommand(ft, (e) => {
|
|
319
319
|
if (ee(e.target)) return !1;
|
|
320
320
|
const n = p();
|
|
@@ -331,16 +331,16 @@ function Nn(t) {
|
|
|
331
331
|
const e = p();
|
|
332
332
|
return !!g(e) && (t.blur(), !0);
|
|
333
333
|
}, m), t.registerCommand(at, (e) => {
|
|
334
|
-
const [, n] =
|
|
334
|
+
const [, n] = Z(e);
|
|
335
335
|
if (n.length > 0) {
|
|
336
|
-
const
|
|
337
|
-
if (
|
|
338
|
-
const { offset: r, node: a } =
|
|
339
|
-
if (
|
|
340
|
-
const l =
|
|
341
|
-
if (R(
|
|
336
|
+
const i = be(e.clientX, e.clientY);
|
|
337
|
+
if (i !== null) {
|
|
338
|
+
const { offset: r, node: a } = i, s = ne(a);
|
|
339
|
+
if (s !== null) {
|
|
340
|
+
const l = st();
|
|
341
|
+
if (R(s)) l.anchor.set(s.getKey(), r, "text"), l.focus.set(s.getKey(), r, "text");
|
|
342
342
|
else {
|
|
343
|
-
const c =
|
|
343
|
+
const c = s.getParentOrThrow().getKey(), d = s.getIndexWithinParent() + 1;
|
|
344
344
|
l.anchor.set(c, d, "element"), l.focus.set(c, d, "element");
|
|
345
345
|
}
|
|
346
346
|
const u = lt(l);
|
|
@@ -352,96 +352,96 @@ function Nn(t) {
|
|
|
352
352
|
}
|
|
353
353
|
const o = p();
|
|
354
354
|
return !!g(o);
|
|
355
|
-
}, m), t.registerCommand(
|
|
356
|
-
const [n] =
|
|
355
|
+
}, m), t.registerCommand(it, (e) => {
|
|
356
|
+
const [n] = Z(e), o = p();
|
|
357
357
|
return !(n && !g(o));
|
|
358
358
|
}, m), t.registerCommand(ot, (e) => {
|
|
359
|
-
const [n] =
|
|
359
|
+
const [n] = Z(e), o = p();
|
|
360
360
|
if (n && !g(o)) return !1;
|
|
361
|
-
const
|
|
362
|
-
if (
|
|
363
|
-
const r = ne(
|
|
361
|
+
const i = be(e.clientX, e.clientY);
|
|
362
|
+
if (i !== null) {
|
|
363
|
+
const r = ne(i.node);
|
|
364
364
|
q(r) && e.preventDefault();
|
|
365
365
|
}
|
|
366
366
|
return !0;
|
|
367
|
-
}, m), t.registerCommand(nt, () => (rt(), !0), m), t.registerCommand(tt, (e) => (ye(t,
|
|
368
|
-
await ye(o,
|
|
369
|
-
const
|
|
370
|
-
g(
|
|
367
|
+
}, m), t.registerCommand(nt, () => (rt(), !0), m), t.registerCommand(tt, (e) => (ye(t, A(e, ClipboardEvent) ? e : null), !0), m), t.registerCommand(et, (e) => (async function(n, o) {
|
|
368
|
+
await ye(o, A(n, ClipboardEvent) ? n : null), o.update(() => {
|
|
369
|
+
const i = p();
|
|
370
|
+
g(i) ? i.removeText() : O(i) && i.getNodes().forEach((r) => r.remove());
|
|
371
371
|
});
|
|
372
372
|
}(e, t), !0), m), t.registerCommand(Re, (e) => {
|
|
373
|
-
const [, n, o] =
|
|
374
|
-
return n.length > 0 && !o ? (t.dispatchCommand(Se, n), !0) :
|
|
375
|
-
|
|
376
|
-
const a = p(),
|
|
377
|
-
|
|
373
|
+
const [, n, o] = Z(e);
|
|
374
|
+
return n.length > 0 && !o ? (t.dispatchCommand(Se, n), !0) : Fe(e.target) && Ze(e.target) ? !1 : p() !== null && (function(i, r) {
|
|
375
|
+
i.preventDefault(), r.update(() => {
|
|
376
|
+
const a = p(), s = A(i, InputEvent) || A(i, KeyboardEvent) ? null : i.clipboardData;
|
|
377
|
+
s != null && a !== null && Ce(s, a, r);
|
|
378
378
|
}, { tag: "paste" });
|
|
379
379
|
}(e, t), !0);
|
|
380
|
-
}, m), t.registerCommand(
|
|
380
|
+
}, m), t.registerCommand(Ye, (e) => {
|
|
381
381
|
const n = p();
|
|
382
382
|
return g(n) && ae(n), !1;
|
|
383
|
-
}, m), t.registerCommand(
|
|
383
|
+
}, m), t.registerCommand(Ge, (e) => {
|
|
384
384
|
const n = p();
|
|
385
385
|
return g(n) && ae(n), !1;
|
|
386
386
|
}, m));
|
|
387
387
|
}
|
|
388
|
-
const
|
|
388
|
+
const se = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U : _;
|
|
389
389
|
function ke(t) {
|
|
390
390
|
return t.getEditorState().read(He(t.isComposing()));
|
|
391
391
|
}
|
|
392
392
|
function Ln({ contentEditable: t, placeholder: e = null, ErrorBoundary: n }) {
|
|
393
|
-
const [o] = P(),
|
|
394
|
-
const [
|
|
395
|
-
return
|
|
393
|
+
const [o] = P(), i = function(r, a) {
|
|
394
|
+
const [s, l] = F(() => r.getDecorators());
|
|
395
|
+
return se(() => r.registerDecoratorListener((u) => {
|
|
396
396
|
zt(() => {
|
|
397
397
|
l(u);
|
|
398
398
|
});
|
|
399
399
|
}), [r]), _(() => {
|
|
400
400
|
l(r.getDecorators());
|
|
401
|
-
}, [r]),
|
|
402
|
-
const u = [], c = Object.keys(
|
|
401
|
+
}, [r]), V(() => {
|
|
402
|
+
const u = [], c = Object.keys(s);
|
|
403
403
|
for (let d = 0; d < c.length; d++) {
|
|
404
|
-
const f = c[d], C = h(a, { onError: (w) => r._onError(w), children: h(
|
|
405
|
-
y !== null && u.push(
|
|
404
|
+
const f = c[d], C = h(a, { onError: (w) => r._onError(w), children: h(Ft, { fallback: null, children: s[f] }) }), y = r.getElementByKey(f);
|
|
405
|
+
y !== null && u.push(At(C, y, f));
|
|
406
406
|
}
|
|
407
407
|
return u;
|
|
408
|
-
}, [a,
|
|
408
|
+
}, [a, s, r]);
|
|
409
409
|
}(o, n);
|
|
410
410
|
return function(r) {
|
|
411
|
-
|
|
412
|
-
}(o), z(Pe, { children: [t, h(Dn, { content: e }),
|
|
411
|
+
se(() => j(Nn(r), bn(r)), [r]);
|
|
412
|
+
}(o), z(Pe, { children: [t, h(Dn, { content: e }), i] });
|
|
413
413
|
}
|
|
414
414
|
function Dn({ content: t }) {
|
|
415
|
-
const [e] = P(), n = function(
|
|
416
|
-
const [r, a] =
|
|
417
|
-
return
|
|
418
|
-
function
|
|
419
|
-
const l = ke(
|
|
415
|
+
const [e] = P(), n = function(i) {
|
|
416
|
+
const [r, a] = F(() => ke(i));
|
|
417
|
+
return se(() => {
|
|
418
|
+
function s() {
|
|
419
|
+
const l = ke(i);
|
|
420
420
|
a(l);
|
|
421
421
|
}
|
|
422
|
-
return
|
|
423
|
-
|
|
424
|
-
}),
|
|
425
|
-
|
|
422
|
+
return s(), j(i.registerUpdateListener(() => {
|
|
423
|
+
s();
|
|
424
|
+
}), i.registerEditableListener(() => {
|
|
425
|
+
s();
|
|
426
426
|
}));
|
|
427
|
-
}, [
|
|
427
|
+
}, [i]), r;
|
|
428
428
|
}(e), o = Cn();
|
|
429
429
|
return n ? typeof t == "function" ? t(o) : t : null;
|
|
430
430
|
}
|
|
431
|
-
const qe = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ?
|
|
432
|
-
function Pn({ editor: t, ariaActiveDescendant: e, ariaAutoComplete: n, ariaControls: o, ariaDescribedBy:
|
|
433
|
-
const [S, T] =
|
|
431
|
+
const qe = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U : _;
|
|
432
|
+
function Pn({ editor: t, ariaActiveDescendant: e, ariaAutoComplete: n, ariaControls: o, ariaDescribedBy: i, ariaErrorMessage: r, ariaExpanded: a, ariaInvalid: s, ariaLabel: l, ariaLabelledBy: u, ariaMultiline: c, ariaOwns: d, ariaRequired: f, autoCapitalize: C, className: y, id: w, role: k = "textbox", spellCheck: E = !0, style: v, tabIndex: $, "data-testid": x, ...b }, N) {
|
|
433
|
+
const [S, T] = F(t.isEditable()), I = It((L) => {
|
|
434
434
|
L && L.ownerDocument && L.ownerDocument.defaultView ? t.setRootElement(L) : t.setRootElement(null);
|
|
435
|
-
}, [t]), B =
|
|
435
|
+
}, [t]), B = V(() => /* @__PURE__ */ function(...L) {
|
|
436
436
|
return (J) => {
|
|
437
437
|
L.forEach((X) => {
|
|
438
438
|
typeof X == "function" ? X(J) : X != null && (X.current = J);
|
|
439
439
|
});
|
|
440
440
|
};
|
|
441
|
-
}(N,
|
|
441
|
+
}(N, I), [I, N]);
|
|
442
442
|
return qe(() => (T(t.isEditable()), t.registerEditableListener((L) => {
|
|
443
443
|
T(L);
|
|
444
|
-
})), [t]), h("div", { "aria-activedescendant": S ? e : void 0, "aria-autocomplete": S ? n : "none", "aria-controls": S ? o : void 0, "aria-describedby":
|
|
444
|
+
})), [t]), h("div", { "aria-activedescendant": S ? e : void 0, "aria-autocomplete": S ? n : "none", "aria-controls": S ? o : void 0, "aria-describedby": i, ...r != null ? { "aria-errormessage": r } : {}, "aria-expanded": S && k === "combobox" ? !!a : void 0, ...s != null ? { "aria-invalid": s } : {}, "aria-label": l, "aria-labelledby": u, "aria-multiline": c, "aria-owns": S ? d : void 0, "aria-readonly": !S || void 0, "aria-required": f, autoCapitalize: C, className: y, contentEditable: S, "data-testid": x, id: w, ref: B, role: S ? k : void 0, spellCheck: E, style: v, tabIndex: $, ...b });
|
|
445
445
|
}
|
|
446
446
|
const Tn = ze(Pn);
|
|
447
447
|
function xe(t) {
|
|
@@ -449,26 +449,26 @@ function xe(t) {
|
|
|
449
449
|
}
|
|
450
450
|
const Mn = ze(Rn);
|
|
451
451
|
function Rn(t, e) {
|
|
452
|
-
const { placeholder: n, ...o } = t, [
|
|
453
|
-
return z(Pe, { children: [h(Tn, { editor:
|
|
452
|
+
const { placeholder: n, ...o } = t, [i] = P();
|
|
453
|
+
return z(Pe, { children: [h(Tn, { editor: i, ...o, ref: e }), n != null && h(Fn, { editor: i, content: n })] });
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function Fn({ content: t, editor: e }) {
|
|
456
456
|
const n = function(a) {
|
|
457
|
-
const [
|
|
457
|
+
const [s, l] = F(() => xe(a));
|
|
458
458
|
return qe(() => {
|
|
459
459
|
function u() {
|
|
460
460
|
const c = xe(a);
|
|
461
461
|
l(c);
|
|
462
462
|
}
|
|
463
|
-
return u(),
|
|
463
|
+
return u(), j(a.registerUpdateListener(() => {
|
|
464
464
|
u();
|
|
465
465
|
}), a.registerEditableListener(() => {
|
|
466
466
|
u();
|
|
467
467
|
}));
|
|
468
|
-
}, [a]),
|
|
469
|
-
}(e), [o,
|
|
470
|
-
if (
|
|
471
|
-
|
|
468
|
+
}, [a]), s;
|
|
469
|
+
}(e), [o, i] = F(e.isEditable());
|
|
470
|
+
if (U(() => (i(e.isEditable()), e.registerEditableListener((a) => {
|
|
471
|
+
i(a);
|
|
472
472
|
})), [e]), !n) return null;
|
|
473
473
|
let r = null;
|
|
474
474
|
return typeof t == "function" ? r = t(o) : t !== null && (r = t), r === null ? null : h("div", { "aria-hidden": !0, children: r });
|
|
@@ -478,11 +478,11 @@ function le(t, e) {
|
|
|
478
478
|
return n.__proto__ = o, n;
|
|
479
479
|
}, le(t, e);
|
|
480
480
|
}
|
|
481
|
-
var Ne = { error: null },
|
|
481
|
+
var Ne = { error: null }, In = function(t) {
|
|
482
482
|
var e, n;
|
|
483
483
|
function o() {
|
|
484
|
-
for (var r, a = arguments.length,
|
|
485
|
-
return (r = t.call.apply(t, [this].concat(
|
|
484
|
+
for (var r, a = arguments.length, s = new Array(a), l = 0; l < a; l++) s[l] = arguments[l];
|
|
485
|
+
return (r = t.call.apply(t, [this].concat(s)) || this).state = Ne, r.resetErrorBoundary = function() {
|
|
486
486
|
for (var u, c = arguments.length, d = new Array(c), f = 0; f < c; f++) d[f] = arguments[f];
|
|
487
487
|
r.props.onReset == null || (u = r.props).onReset.apply(u, d), r.reset();
|
|
488
488
|
}, r;
|
|
@@ -490,85 +490,85 @@ var Ne = { error: null }, Fn = function(t) {
|
|
|
490
490
|
n = t, (e = o).prototype = Object.create(n.prototype), e.prototype.constructor = e, le(e, n), o.getDerivedStateFromError = function(r) {
|
|
491
491
|
return { error: r };
|
|
492
492
|
};
|
|
493
|
-
var
|
|
494
|
-
return
|
|
493
|
+
var i = o.prototype;
|
|
494
|
+
return i.reset = function() {
|
|
495
495
|
this.setState(Ne);
|
|
496
|
-
},
|
|
497
|
-
var
|
|
498
|
-
(
|
|
499
|
-
},
|
|
500
|
-
var
|
|
496
|
+
}, i.componentDidCatch = function(r, a) {
|
|
497
|
+
var s, l;
|
|
498
|
+
(s = (l = this.props).onError) == null || s.call(l, r, a);
|
|
499
|
+
}, i.componentDidUpdate = function(r, a) {
|
|
500
|
+
var s, l, u, c, d = this.state.error, f = this.props.resetKeys;
|
|
501
501
|
d !== null && a.error !== null && ((u = r.resetKeys) === void 0 && (u = []), (c = f) === void 0 && (c = []), u.length !== c.length || u.some(function(C, y) {
|
|
502
502
|
return !Object.is(C, c[y]);
|
|
503
|
-
})) && ((
|
|
504
|
-
},
|
|
505
|
-
var r = this.state.error, a = this.props,
|
|
503
|
+
})) && ((s = (l = this.props).onResetKeysChange) == null || s.call(l, r.resetKeys, f), this.reset());
|
|
504
|
+
}, i.render = function() {
|
|
505
|
+
var r = this.state.error, a = this.props, s = a.fallbackRender, l = a.FallbackComponent, u = a.fallback;
|
|
506
506
|
if (r !== null) {
|
|
507
507
|
var c = { error: r, resetErrorBoundary: this.resetErrorBoundary };
|
|
508
508
|
if (oe.isValidElement(u)) return u;
|
|
509
|
-
if (typeof
|
|
509
|
+
if (typeof s == "function") return s(c);
|
|
510
510
|
if (l) return oe.createElement(l, c);
|
|
511
511
|
throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop");
|
|
512
512
|
}
|
|
513
513
|
return this.props.children;
|
|
514
514
|
}, o;
|
|
515
515
|
}(oe.Component);
|
|
516
|
-
function
|
|
517
|
-
return h(
|
|
516
|
+
function On({ children: t, onError: e }) {
|
|
517
|
+
return h(In, { fallback: h("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: t });
|
|
518
518
|
}
|
|
519
|
-
const zn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ?
|
|
520
|
-
function
|
|
519
|
+
const zn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U : _;
|
|
520
|
+
function An({ ignoreHistoryMergeTagChange: t = !0, ignoreSelectionChange: e = !1, onChange: n }) {
|
|
521
521
|
const [o] = P();
|
|
522
522
|
return zn(() => {
|
|
523
|
-
if (n) return o.registerUpdateListener(({ editorState:
|
|
524
|
-
e && r.size === 0 && a.size === 0 || t && l.has("history-merge") ||
|
|
523
|
+
if (n) return o.registerUpdateListener(({ editorState: i, dirtyElements: r, dirtyLeaves: a, prevEditorState: s, tags: l }) => {
|
|
524
|
+
e && r.size === 0 && a.size === 0 || t && l.has("history-merge") || s.isEmpty() || n(i, o, l);
|
|
525
525
|
});
|
|
526
526
|
}, [o, t, e, n]), null;
|
|
527
527
|
}
|
|
528
|
-
function
|
|
528
|
+
function Kn() {
|
|
529
529
|
const [t] = P();
|
|
530
530
|
return _(() => {
|
|
531
|
-
if (!t.hasNodes([
|
|
531
|
+
if (!t.hasNodes([Ae, Ke])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
|
|
532
532
|
}, [t]), function(e) {
|
|
533
|
-
_(() =>
|
|
533
|
+
_(() => Ut(e), [e]);
|
|
534
534
|
}(t), null;
|
|
535
535
|
}
|
|
536
536
|
function Bn({ validateUrl: t, attributes: e }) {
|
|
537
537
|
const [n] = P();
|
|
538
538
|
return _(() => {
|
|
539
539
|
if (!n.hasNodes([Be])) throw new Error("LinkPlugin: LinkNode not registered on editor");
|
|
540
|
-
return
|
|
541
|
-
if (o === null) return
|
|
542
|
-
if (typeof o == "string") return !(t !== void 0 && !t(o)) && (
|
|
540
|
+
return j(n.registerCommand(we, (o) => {
|
|
541
|
+
if (o === null) return ie(o), !0;
|
|
542
|
+
if (typeof o == "string") return !(t !== void 0 && !t(o)) && (ie(o, e), !0);
|
|
543
543
|
{
|
|
544
|
-
const { url:
|
|
545
|
-
return
|
|
544
|
+
const { url: i, target: r, rel: a, title: s } = o;
|
|
545
|
+
return ie(i, { ...e, rel: a, target: r, title: s }), !0;
|
|
546
546
|
}
|
|
547
547
|
}, he), t !== void 0 ? n.registerCommand(Re, (o) => {
|
|
548
|
-
const
|
|
549
|
-
if (!g(
|
|
548
|
+
const i = p();
|
|
549
|
+
if (!g(i) || i.isCollapsed() || !A(o, ClipboardEvent)) return !1;
|
|
550
550
|
const r = o;
|
|
551
551
|
if (r.clipboardData === null) return !1;
|
|
552
552
|
const a = r.clipboardData.getData("text");
|
|
553
|
-
return !!t(a) && !
|
|
553
|
+
return !!t(a) && !i.getNodes().some((s) => W(s)) && (n.dispatchCommand(we, { ...e, url: a }), o.preventDefault(), !0);
|
|
554
554
|
}, he) : () => {
|
|
555
555
|
});
|
|
556
556
|
}, [n, t, e]), null;
|
|
557
557
|
}
|
|
558
|
-
function
|
|
558
|
+
function Un({ newTab: t = !0, disabled: e = !1 }) {
|
|
559
559
|
const [n] = P();
|
|
560
560
|
return _(() => {
|
|
561
561
|
const o = (r) => {
|
|
562
562
|
const a = r.target;
|
|
563
|
-
if (!
|
|
564
|
-
const
|
|
565
|
-
if (
|
|
563
|
+
if (!Fe(a)) return;
|
|
564
|
+
const s = Lt(a);
|
|
565
|
+
if (s === null) return;
|
|
566
566
|
let l = null, u = null;
|
|
567
|
-
if (
|
|
567
|
+
if (s.update(() => {
|
|
568
568
|
const f = ne(a);
|
|
569
569
|
if (f !== null) {
|
|
570
|
-
const C = de(f,
|
|
571
|
-
if (!e) if (
|
|
570
|
+
const C = de(f, W);
|
|
571
|
+
if (!e) if (jt(C)) l = C.sanitizeUrl(C.getURL()), u = C.getTarget();
|
|
572
572
|
else {
|
|
573
573
|
const y = function(w, k) {
|
|
574
574
|
let E = w;
|
|
@@ -586,21 +586,21 @@ function jn({ newTab: t = !0, disabled: e = !1 }) {
|
|
|
586
586
|
if (g(c) && !c.isCollapsed()) return void r.preventDefault();
|
|
587
587
|
const d = r.type === "auxclick" && r.button === 1;
|
|
588
588
|
window.open(l, t || d || r.metaKey || r.ctrlKey || u === "_blank" ? "_blank" : "_self"), r.preventDefault();
|
|
589
|
-
},
|
|
589
|
+
}, i = (r) => {
|
|
590
590
|
r.button === 1 && o(r);
|
|
591
591
|
};
|
|
592
592
|
return n.registerRootListener((r, a) => {
|
|
593
|
-
a !== null && (a.removeEventListener("click", o), a.removeEventListener("mouseup",
|
|
593
|
+
a !== null && (a.removeEventListener("click", o), a.removeEventListener("mouseup", i)), r !== null && (r.addEventListener("click", o), r.addEventListener("mouseup", i));
|
|
594
594
|
});
|
|
595
595
|
}, [n, t, e]), null;
|
|
596
596
|
}
|
|
597
|
-
const te = 0, ue = 1, ce = 2, D = 0,
|
|
598
|
-
function
|
|
599
|
-
if (t === null || n.size === 0 && o.size === 0 && !
|
|
597
|
+
const te = 0, ue = 1, ce = 2, D = 0, jn = 1, Le = 2, Hn = 3, qn = 4;
|
|
598
|
+
function Wn(t, e, n, o, i) {
|
|
599
|
+
if (t === null || n.size === 0 && o.size === 0 && !i) return D;
|
|
600
600
|
const r = e._selection, a = t._selection;
|
|
601
|
-
if (
|
|
601
|
+
if (i) return jn;
|
|
602
602
|
if (!(g(r) && g(a) && a.isCollapsed() && r.isCollapsed())) return D;
|
|
603
|
-
const
|
|
603
|
+
const s = function(E, v, $) {
|
|
604
604
|
const x = E._nodeMap, b = [];
|
|
605
605
|
for (const N of v) {
|
|
606
606
|
const S = x.get(N);
|
|
@@ -609,16 +609,16 @@ function Vn(t, e, n, o, s) {
|
|
|
609
609
|
for (const [N, S] of $) {
|
|
610
610
|
if (!S) continue;
|
|
611
611
|
const T = x.get(N);
|
|
612
|
-
T === void 0 ||
|
|
612
|
+
T === void 0 || Ie(T) || b.push(T);
|
|
613
613
|
}
|
|
614
614
|
return b;
|
|
615
615
|
}(e, n, o);
|
|
616
|
-
if (
|
|
617
|
-
if (
|
|
616
|
+
if (s.length === 0) return D;
|
|
617
|
+
if (s.length > 1) {
|
|
618
618
|
const E = e._nodeMap, v = E.get(r.anchor.key), $ = E.get(a.anchor.key);
|
|
619
619
|
return v && $ && !t._nodeMap.has(v.__key) && R(v) && v.__text.length === 1 && r.anchor.offset === 1 ? Le : D;
|
|
620
620
|
}
|
|
621
|
-
const l =
|
|
621
|
+
const l = s[0], u = t._nodeMap.get(l.__key);
|
|
622
622
|
if (!R(u) || !R(l) || u.__mode !== l.__mode) return D;
|
|
623
623
|
const c = u.__text, d = l.__text;
|
|
624
624
|
if (c === d) return D;
|
|
@@ -627,20 +627,20 @@ function Vn(t, e, n, o, s) {
|
|
|
627
627
|
const y = f.offset, w = C.offset, k = d.length - c.length;
|
|
628
628
|
return k === 1 && w === y - 1 ? Le : k === -1 && w === y + 1 ? Hn : k === -1 && w === y ? qn : D;
|
|
629
629
|
}
|
|
630
|
-
function
|
|
630
|
+
function Vn(t, e) {
|
|
631
631
|
let n = Date.now(), o = D;
|
|
632
|
-
return (
|
|
632
|
+
return (i, r, a, s, l, u) => {
|
|
633
633
|
const c = Date.now();
|
|
634
634
|
if (u.has("historic")) return o = D, n = c, ce;
|
|
635
|
-
const d =
|
|
635
|
+
const d = Wn(i, r, s, l, t.isComposing()), f = (() => {
|
|
636
636
|
const C = a === null || a.editor === t, y = u.has("history-push");
|
|
637
637
|
if (!y && C && u.has("history-merge")) return te;
|
|
638
|
-
if (
|
|
638
|
+
if (i === null) return ue;
|
|
639
639
|
const w = r._selection;
|
|
640
|
-
return
|
|
640
|
+
return s.size > 0 || l.size > 0 ? y === !1 && d !== D && d === o && c < n + e && C || s.size === 1 && function(k, E, v) {
|
|
641
641
|
const $ = E._nodeMap.get(k), x = v._nodeMap.get(k), b = E._selection, N = v._selection;
|
|
642
642
|
return !(g(b) && g(N) && b.anchor.type === "element" && b.focus.type === "element" && N.anchor.type === "text" && N.focus.type === "text" || !R($) || !R(x) || $.__parent !== x.__parent) && JSON.stringify(E.read(() => $.exportJSON())) === JSON.stringify(v.read(() => x.exportJSON()));
|
|
643
|
-
}(Array.from(
|
|
643
|
+
}(Array.from(s)[0], i, r) ? te : ue : w !== null ? te : ce;
|
|
644
644
|
})();
|
|
645
645
|
return n = c, o = d, f;
|
|
646
646
|
};
|
|
@@ -649,26 +649,26 @@ function De(t) {
|
|
|
649
649
|
t.undoStack = [], t.redoStack = [], t.current = null;
|
|
650
650
|
}
|
|
651
651
|
function Jn(t, e, n) {
|
|
652
|
-
const o =
|
|
653
|
-
return
|
|
654
|
-
const
|
|
652
|
+
const o = Vn(t, n);
|
|
653
|
+
return j(t.registerCommand(Rt, () => (function(r, a) {
|
|
654
|
+
const s = a.redoStack, l = a.undoStack;
|
|
655
655
|
if (l.length !== 0) {
|
|
656
656
|
const u = a.current, c = l.pop();
|
|
657
|
-
u !== null && (
|
|
657
|
+
u !== null && (s.push(u), r.dispatchCommand(G, !0)), l.length === 0 && r.dispatchCommand(Y, !1), a.current = c || null, c && c.editor.setEditorState(c.editorState, { tag: "historic" });
|
|
658
658
|
}
|
|
659
659
|
}(t, e), !0), m), t.registerCommand(Mt, () => (function(r, a) {
|
|
660
|
-
const
|
|
661
|
-
if (
|
|
660
|
+
const s = a.redoStack, l = a.undoStack;
|
|
661
|
+
if (s.length !== 0) {
|
|
662
662
|
const u = a.current;
|
|
663
|
-
u !== null && (l.push(u), r.dispatchCommand(
|
|
664
|
-
const c =
|
|
665
|
-
|
|
663
|
+
u !== null && (l.push(u), r.dispatchCommand(Y, !0));
|
|
664
|
+
const c = s.pop();
|
|
665
|
+
s.length === 0 && r.dispatchCommand(G, !1), a.current = c || null, c && c.editor.setEditorState(c.editorState, { tag: "historic" });
|
|
666
666
|
}
|
|
667
|
-
}(t, e), !0), m), t.registerCommand(Tt, () => (De(e), !1), m), t.registerCommand(Pt, () => (De(e), t.dispatchCommand(
|
|
667
|
+
}(t, e), !0), m), t.registerCommand(Tt, () => (De(e), !1), m), t.registerCommand(Pt, () => (De(e), t.dispatchCommand(G, !1), t.dispatchCommand(Y, !1), !0), m), t.registerUpdateListener(({ editorState: r, prevEditorState: a, dirtyLeaves: s, dirtyElements: l, tags: u }) => {
|
|
668
668
|
const c = e.current, d = e.redoStack, f = e.undoStack, C = c === null ? null : c.editorState;
|
|
669
669
|
if (c !== null && r === C) return;
|
|
670
|
-
const y = o(a, r, c,
|
|
671
|
-
if (y === ue) d.length !== 0 && (e.redoStack = [], t.dispatchCommand(
|
|
670
|
+
const y = o(a, r, c, s, l, u);
|
|
671
|
+
if (y === ue) d.length !== 0 && (e.redoStack = [], t.dispatchCommand(G, !1)), c !== null && (f.push({ ...c }), t.dispatchCommand(Y, !0));
|
|
672
672
|
else if (y === ce) return;
|
|
673
673
|
e.current = { editor: t, editorState: r };
|
|
674
674
|
}));
|
|
@@ -676,38 +676,38 @@ function Jn(t, e, n) {
|
|
|
676
676
|
function Xn() {
|
|
677
677
|
return { current: null, redoStack: [], undoStack: [] };
|
|
678
678
|
}
|
|
679
|
-
function
|
|
679
|
+
function Gn({ delay: t, externalHistoryState: e }) {
|
|
680
680
|
const [n] = P();
|
|
681
|
-
return function(o,
|
|
682
|
-
const a =
|
|
681
|
+
return function(o, i, r = 1e3) {
|
|
682
|
+
const a = V(() => i || Xn(), [i]);
|
|
683
683
|
_(() => Jn(o, a, r), [r, o, a]);
|
|
684
684
|
}(n, e, t), null;
|
|
685
685
|
}
|
|
686
|
-
function
|
|
687
|
-
const [
|
|
686
|
+
function Yn({ hasCellMerge: t = !0, hasCellBackgroundColor: e = !0, hasTabHandler: n = !0, hasHorizontalScroll: o = !1 }) {
|
|
687
|
+
const [i] = P();
|
|
688
688
|
return _(() => {
|
|
689
|
-
qt(
|
|
690
|
-
}, [
|
|
691
|
-
if (!t) return Jt(
|
|
692
|
-
}, [
|
|
693
|
-
if (!e) return
|
|
689
|
+
qt(i, o);
|
|
690
|
+
}, [i, o]), _(() => Wt(i), [i]), _(() => Vt(i, n), [i, n]), _(() => {
|
|
691
|
+
if (!t) return Jt(i);
|
|
692
|
+
}, [i, t]), _(() => {
|
|
693
|
+
if (!e) return i.registerNodeTransform(Ue, (r) => {
|
|
694
694
|
r.getBackgroundColor() !== null && r.setBackgroundColor(null);
|
|
695
695
|
});
|
|
696
|
-
}, [
|
|
696
|
+
}, [i, e, t]), null;
|
|
697
697
|
}
|
|
698
|
-
const
|
|
698
|
+
const We = 200, Qn = ({
|
|
699
699
|
currentLanguage: t = "NL",
|
|
700
700
|
initialValue: e = "",
|
|
701
701
|
placeholder: n = "",
|
|
702
702
|
label: o = "",
|
|
703
|
-
info:
|
|
703
|
+
info: i = "",
|
|
704
704
|
required: r = !1,
|
|
705
705
|
notValidatedText: a = "",
|
|
706
|
-
maxHeightInRem:
|
|
707
|
-
maxWords: l =
|
|
706
|
+
maxHeightInRem: s = "20rem",
|
|
707
|
+
maxWords: l = We,
|
|
708
708
|
onChange: u
|
|
709
709
|
}) => {
|
|
710
|
-
const { switchLanguage: c } = dn(), d =
|
|
710
|
+
const { switchLanguage: c } = dn(), d = an(), [f] = F(() => Te()), [C, y] = F(0), [w, k] = F(0), E = Oe(null), v = {
|
|
711
711
|
html: {
|
|
712
712
|
export: tn
|
|
713
713
|
},
|
|
@@ -717,24 +717,24 @@ const Ve = 200, Gn = ({
|
|
|
717
717
|
onError(b) {
|
|
718
718
|
throw b;
|
|
719
719
|
},
|
|
720
|
-
nodes: [
|
|
720
|
+
nodes: [Ae, Ke, Be, Ht, Ue, Xt, Gt],
|
|
721
721
|
editorState: (b) => {
|
|
722
|
-
const S = new DOMParser().parseFromString(e, "text/html"), T =
|
|
723
|
-
if (
|
|
722
|
+
const S = new DOMParser().parseFromString(e, "text/html"), T = Kt(b, S), I = K();
|
|
723
|
+
if (I.clear(), nn(e))
|
|
724
724
|
T.forEach((B) => {
|
|
725
|
-
|
|
725
|
+
I.append(B);
|
|
726
726
|
});
|
|
727
727
|
else {
|
|
728
728
|
const B = Me();
|
|
729
729
|
T.forEach((L, J) => {
|
|
730
|
-
J === 0 ? (B.append(L),
|
|
730
|
+
J === 0 ? (B.append(L), I.append(B)) : I.append(L);
|
|
731
731
|
});
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
734
|
}, $ = (b) => b.trim().length === 0 ? 0 : b.split(" ").length, x = (b, N) => {
|
|
735
735
|
b.read(() => {
|
|
736
736
|
let S = "";
|
|
737
|
-
y($(
|
|
737
|
+
y($(K().getTextContent().replace(/\s+/g, " ").trim())), S = rn(Bt(N)), u(S);
|
|
738
738
|
});
|
|
739
739
|
};
|
|
740
740
|
return _(() => {
|
|
@@ -744,7 +744,7 @@ const Ve = 200, Gn = ({
|
|
|
744
744
|
y($(b));
|
|
745
745
|
}, []), /* @__PURE__ */ z("div", { className: M.editor__container, children: [
|
|
746
746
|
/* @__PURE__ */ z("div", { className: M.editor__header, children: [
|
|
747
|
-
/* @__PURE__ */ h(un, { label: o, info:
|
|
747
|
+
/* @__PURE__ */ h(un, { label: o, info: i, required: r }),
|
|
748
748
|
/* @__PURE__ */ z("div", { className: M["editor__header-word-count"], children: [
|
|
749
749
|
/* @__PURE__ */ h("span", { className: en({ [M["editor__header-word-count--alert"]]: C > l }), children: C }),
|
|
750
750
|
" / ",
|
|
@@ -767,53 +767,53 @@ const Ve = 200, Gn = ({
|
|
|
767
767
|
placeholder: /* @__PURE__ */ h("div", { className: M.editor__placeholder, children: n }),
|
|
768
768
|
spellCheck: !1,
|
|
769
769
|
id: "rteEditor",
|
|
770
|
-
style: { height: `${
|
|
770
|
+
style: { height: `${s}`, maxHeight: `${s}` },
|
|
771
771
|
onScroll: (b) => k(b.currentTarget.scrollTop),
|
|
772
772
|
ref: E
|
|
773
773
|
}
|
|
774
774
|
),
|
|
775
775
|
placeholder: /* @__PURE__ */ h("div", { className: M.editor__placeholder, children: n }),
|
|
776
|
-
ErrorBoundary:
|
|
776
|
+
ErrorBoundary: On
|
|
777
777
|
}
|
|
778
778
|
),
|
|
779
|
-
/* @__PURE__ */ h(Zn, {}),
|
|
780
779
|
/* @__PURE__ */ h(Yn, {}),
|
|
781
|
-
/* @__PURE__ */ h(
|
|
782
|
-
/* @__PURE__ */ h(
|
|
783
|
-
/* @__PURE__ */ h(
|
|
784
|
-
/* @__PURE__ */ h(
|
|
785
|
-
/* @__PURE__ */ h(
|
|
780
|
+
/* @__PURE__ */ h(Gn, {}),
|
|
781
|
+
/* @__PURE__ */ h(Kn, {}),
|
|
782
|
+
/* @__PURE__ */ h(Bn, { validateUrl: Yt }),
|
|
783
|
+
/* @__PURE__ */ h(Qt, { matchers: Zt }),
|
|
784
|
+
/* @__PURE__ */ h(Un, {}),
|
|
785
|
+
/* @__PURE__ */ h(An, { onChange: x }),
|
|
786
786
|
/* @__PURE__ */ h(fn, {})
|
|
787
787
|
] })
|
|
788
788
|
] }) }),
|
|
789
|
-
a !== "" && /* @__PURE__ */ h(
|
|
789
|
+
a !== "" && /* @__PURE__ */ h(sn, { level: "error", feedback: a })
|
|
790
790
|
] });
|
|
791
791
|
}, Br = ({
|
|
792
792
|
currentLanguage: t = "NL",
|
|
793
793
|
initialValue: e = "",
|
|
794
794
|
placeholder: n = "",
|
|
795
795
|
label: o = "",
|
|
796
|
-
info:
|
|
796
|
+
info: i = "",
|
|
797
797
|
required: r = !1,
|
|
798
798
|
notValidatedText: a = "",
|
|
799
|
-
maxWords:
|
|
799
|
+
maxWords: s = We,
|
|
800
800
|
onChange: l
|
|
801
801
|
}) => /* @__PURE__ */ h(cn, { children: /* @__PURE__ */ h(
|
|
802
|
-
|
|
802
|
+
Qn,
|
|
803
803
|
{
|
|
804
804
|
currentLanguage: t,
|
|
805
805
|
initialValue: e,
|
|
806
806
|
placeholder: n,
|
|
807
807
|
label: o,
|
|
808
|
-
info:
|
|
808
|
+
info: i,
|
|
809
809
|
required: r,
|
|
810
810
|
notValidatedText: a,
|
|
811
|
-
maxWords:
|
|
811
|
+
maxWords: s,
|
|
812
812
|
onChange: l
|
|
813
813
|
}
|
|
814
814
|
) });
|
|
815
815
|
export {
|
|
816
|
-
|
|
816
|
+
Qn as Rte,
|
|
817
817
|
Br as RteEditor
|
|
818
818
|
};
|
|
819
819
|
//# sourceMappingURL=RteEditor.js.map
|