@uva-glass/component-library 3.34.1 → 3.34.2
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-BjpEXQJZ.js → Lexical.prod-C7FcGFd7.js} +528 -522
- package/dist/Lexical.prod-C7FcGFd7.js.map +1 -0
- package/dist/{LexicalClipboard.prod-B4j0EyWx.js → LexicalClipboard.prod-CeOlk1NB.js} +104 -104
- package/dist/{LexicalClipboard.prod-B4j0EyWx.js.map → LexicalClipboard.prod-CeOlk1NB.js.map} +1 -1
- package/dist/{LexicalLink.prod-CYNCWmMx.js → LexicalLink.prod-CSI9BSPD.js} +46 -46
- package/dist/{LexicalLink.prod-CYNCWmMx.js.map → LexicalLink.prod-CSI9BSPD.js.map} +1 -1
- package/dist/{LexicalList.prod-BRwEushm.js → LexicalList.prod-TMA2LN4v.js} +46 -46
- package/dist/{LexicalList.prod-BRwEushm.js.map → LexicalList.prod-TMA2LN4v.js.map} +1 -1
- package/dist/{LexicalSelection.prod-DYo5_Y2k.js → LexicalSelection.prod-DDwSrdAV.js} +31 -31
- package/dist/{LexicalSelection.prod-DYo5_Y2k.js.map → LexicalSelection.prod-DDwSrdAV.js.map} +1 -1
- package/dist/{LexicalTable.prod-BArw8Dt5.js → LexicalTable.prod-DYP5JQC0.js} +268 -268
- package/dist/{LexicalTable.prod-BArw8Dt5.js.map → LexicalTable.prod-DYP5JQC0.js.map} +1 -1
- package/dist/{LexicalUtils.prod-DJRX2pwP.js → LexicalUtils.prod-D_SPJ6vo.js} +42 -42
- package/dist/{LexicalUtils.prod-DJRX2pwP.js.map → LexicalUtils.prod-D_SPJ6vo.js.map} +1 -1
- package/dist/{TablePlugin-BagQHe1w.js → TablePlugin-CI_6HCsd.js} +56 -56
- package/dist/{TablePlugin-BagQHe1w.js.map → TablePlugin-CI_6HCsd.js.map} +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
- package/dist/components/FormInput/FormInput.js +1 -1
- package/dist/components/InputField/InputField.stories.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.js +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +6 -6
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +10 -10
- 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 +43 -43
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +30 -30
- package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +5 -5
- 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 +12 -12
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +17 -17
- package/dist/components/RteEditor/Plugins/index.js +1 -1
- package/dist/components/RteEditor/RteEditor.js +201 -201
- package/dist/components/RteEditor/helpers.js +6 -6
- package/dist/components/index.js +1 -1
- package/dist/{helpers-DM8qHaKY.js → helpers-CYiLlioz.js} +38 -38
- package/dist/{helpers-DM8qHaKY.js.map → helpers-CYiLlioz.js.map} +1 -1
- package/dist/index.js +1 -1
- package/package.json +5 -5
- package/dist/Lexical.prod-BjpEXQJZ.js.map +0 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsx as h, jsxs as
|
|
2
|
-
import { t as
|
|
3
|
-
import { aJ as
|
|
1
|
+
import { jsx as h, jsxs as K, Fragment as Re } from "react/jsx-runtime";
|
|
2
|
+
import { t as Ge, r as Ye, o as T } from "../../LexicalComposerContext.prod-DLlRM5wP.js";
|
|
3
|
+
import { aJ as Me, ag as z, B as Ie, P as p, aK as de, an as j, x as J, W as Qe, s as I, _ as g, X as Ze, J as m, aL as et, af as Fe, d as tt, r as Oe, aM as rt, aN as nt, L as ot, y as P, aF as at, aO as st, aP as it, aQ as lt, l as te, aR as ut, aS as ct, a2 as dt, E as ft, M as mt, z as pt, aT as gt, aU as me, a as pe, K as ht, G as re, H as vt, a3 as Ke, aV as ge, w as Ct, u as yt, t as Et, aW as he, D as wt, aX as bt, aY as _t, aZ as St, aE as kt, Q as xt, N as Nt, a_ as Lt, R as $t, C as Dt, A as Pt, n as Tt, $ as ve, a$ as Rt, c as Mt, at as G, as as Y, b0 as It, b1 as Ft, av as Ot, b2 as se, au as Kt, b3 as At } from "../../Lexical.prod-C7FcGFd7.js";
|
|
4
4
|
import * as ne from "react";
|
|
5
|
-
import { useMemo as
|
|
6
|
-
import { j, L as
|
|
7
|
-
import { flushSync as
|
|
8
|
-
import { A as Ce, F as ye, m as
|
|
9
|
-
import { X as Ee, J as we } from "../../LexicalSelection.prod-
|
|
10
|
-
import { r as Be, Y as Ue, v as
|
|
11
|
-
import { g as
|
|
12
|
-
import { s as
|
|
13
|
-
import { a as nr, w as or, M as ar } from "../../helpers-
|
|
5
|
+
import { useMemo as X, useLayoutEffect as U, useEffect as S, useState as F, useRef as Ae, Suspense as zt, forwardRef as ze, useCallback as Bt } from "react";
|
|
6
|
+
import { j as H, L as A, y as Ut, w as fe } from "../../LexicalUtils.prod-D_SPJ6vo.js";
|
|
7
|
+
import { flushSync as Ht, createPortal as Wt } from "react-dom";
|
|
8
|
+
import { A as Ce, F as ye, m as jt, g as Jt } from "../../LexicalClipboard.prod-CeOlk1NB.js";
|
|
9
|
+
import { X as Ee, J as we } from "../../LexicalSelection.prod-DDwSrdAV.js";
|
|
10
|
+
import { r as Be, Y as Ue, v as Xt, S as qt } from "../../LexicalList.prod-TMA2LN4v.js";
|
|
11
|
+
import { g as He, k as be, v as oe, p as Vt, m as Gt } from "../../LexicalLink.prod-CSI9BSPD.js";
|
|
12
|
+
import { s as Yt, c as Qt, a as We, b as Zt, w as er, S as tr, y as je, O as rr } from "../../LexicalTable.prod-DYP5JQC0.js";
|
|
13
|
+
import { a as nr, w as or, M as ar } from "../../helpers-CYiLlioz.js";
|
|
14
14
|
import { c as sr } from "../../clsx-OuTLNxxd.js";
|
|
15
15
|
import { exportMap as ir, isStartingWithHtmlTag as lr, mergeBoldStrongTags as ur } from "./helpers.js";
|
|
16
|
-
import { s as
|
|
16
|
+
import { s as M } from "../../RteEditor.module-B_3uFnFu.js";
|
|
17
17
|
import { ToolBarPlugin as cr } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
|
|
18
18
|
import { useTranslation as dr } from "./hooks/useTranslation.js";
|
|
19
|
-
import "../../TablePlugin-
|
|
19
|
+
import "../../TablePlugin-CI_6HCsd.js";
|
|
20
20
|
import "./Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js";
|
|
21
21
|
import "./hooks/components/Flyout.js";
|
|
22
22
|
import "../Buttons/Button.js";
|
|
@@ -41,18 +41,18 @@ import { UvaTheme as mr } from "./UvaTheme/UvaTheme.js";
|
|
|
41
41
|
import { EditorHeader as pr } from "./EditorHeader/EditorHeader.js";
|
|
42
42
|
import { LanguageProvider as gr, useLanguage as hr } from "./Providers/LanguageProvider.js";
|
|
43
43
|
import { PasteHandlerPlugin as vr } from "./Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js";
|
|
44
|
-
const
|
|
44
|
+
const Je = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Cr = Je ? U : S, Q = { tag: de };
|
|
45
45
|
function yr({ initialConfig: r, children: e }) {
|
|
46
|
-
const t =
|
|
47
|
-
const { theme: o, namespace: a, nodes: n, onError: s, editorState: i, html: l } = r, u =
|
|
46
|
+
const t = X(() => {
|
|
47
|
+
const { theme: o, namespace: a, nodes: n, onError: s, editorState: i, html: l } = r, u = Ge(null, o), c = Me({ editable: r.editable, html: l, namespace: a, nodes: n, onError: (d) => s(d, c), theme: o });
|
|
48
48
|
return function(d, f) {
|
|
49
49
|
if (f !== null) {
|
|
50
50
|
if (f === void 0) d.update(() => {
|
|
51
51
|
const v = z();
|
|
52
52
|
if (v.isEmpty()) {
|
|
53
|
-
const C =
|
|
53
|
+
const C = Ie();
|
|
54
54
|
v.append(C);
|
|
55
|
-
const w =
|
|
55
|
+
const w = Je ? document.activeElement : null;
|
|
56
56
|
(p() !== null || w !== null && w === d.getRootElement()) && C.select();
|
|
57
57
|
}
|
|
58
58
|
}, Q);
|
|
@@ -76,15 +76,15 @@ function yr({ initialConfig: r, children: e }) {
|
|
|
76
76
|
return Cr(() => {
|
|
77
77
|
const o = r.editable, [a] = t;
|
|
78
78
|
a.setEditable(o === void 0 || o);
|
|
79
|
-
}, []), h(
|
|
79
|
+
}, []), h(Ye.Provider, { value: t, children: e });
|
|
80
80
|
}
|
|
81
|
-
const Er = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U :
|
|
81
|
+
const Er = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U : S;
|
|
82
82
|
function wr(r) {
|
|
83
83
|
return { initialValueFn: () => r.isEditable(), subscribe: (e) => r.registerEditableListener(e) };
|
|
84
84
|
}
|
|
85
85
|
function br() {
|
|
86
86
|
return function(r) {
|
|
87
|
-
const [e] =
|
|
87
|
+
const [e] = T(), t = X(() => r(e), [e, r]), [o, a] = F(() => t.initialValueFn()), n = Ae(o);
|
|
88
88
|
return Er(() => {
|
|
89
89
|
const { initialValueFn: s, subscribe: i } = t, l = s();
|
|
90
90
|
return n.current !== l && (n.current = l, a(l)), i((u) => {
|
|
@@ -93,33 +93,33 @@ function br() {
|
|
|
93
93
|
}, [t, r]), o;
|
|
94
94
|
}(wr);
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function _r() {
|
|
97
97
|
return z().getTextContent();
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function Sr(r, e = !0) {
|
|
100
100
|
if (r) return !1;
|
|
101
|
-
let t =
|
|
101
|
+
let t = _r();
|
|
102
102
|
return e && (t = t.trim()), t === "";
|
|
103
103
|
}
|
|
104
104
|
function kr(r) {
|
|
105
|
-
if (!
|
|
105
|
+
if (!Sr(r, !1)) return !1;
|
|
106
106
|
const e = z().getChildren(), t = e.length;
|
|
107
107
|
if (t > 1) return !1;
|
|
108
108
|
for (let o = 0; o < t; o++) {
|
|
109
109
|
const a = e[o];
|
|
110
|
-
if (
|
|
111
|
-
if (
|
|
110
|
+
if (j(a)) return !1;
|
|
111
|
+
if (J(a)) {
|
|
112
112
|
if (!Qe(a) || a.__indent !== 0) return !1;
|
|
113
113
|
const n = a.getChildren(), s = n.length;
|
|
114
114
|
for (let i = 0; i < s; i++) {
|
|
115
115
|
const l = n[o];
|
|
116
|
-
if (!
|
|
116
|
+
if (!I(l)) return !1;
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
return !0;
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function Xe(r) {
|
|
123
123
|
return () => kr(r);
|
|
124
124
|
}
|
|
125
125
|
function xr(r) {
|
|
@@ -145,11 +145,11 @@ function xr(r) {
|
|
|
145
145
|
const w = p();
|
|
146
146
|
if (g(w)) {
|
|
147
147
|
const x = w.anchor;
|
|
148
|
-
let y = x.getNode(), E = 0,
|
|
149
|
-
if (
|
|
150
|
-
E = f,
|
|
148
|
+
let y = x.getNode(), E = 0, _ = 0;
|
|
149
|
+
if (I(y) && u >= 0 && c >= 0 && (E = u, _ = u + c, w.setTextNodeRange(y, E, y, _)), E === _ && d === "" || (w.insertRawText(d), y = x.getNode()), I(y)) {
|
|
150
|
+
E = f, _ = f + v;
|
|
151
151
|
const N = y.getTextContentSize();
|
|
152
|
-
E = E > N ? N : E,
|
|
152
|
+
E = E > N ? N : E, _ = _ > N ? N : _, w.setTextNodeRange(y, E, y, _);
|
|
153
153
|
}
|
|
154
154
|
o.stopImmediatePropagation();
|
|
155
155
|
}
|
|
@@ -163,7 +163,7 @@ function xr(r) {
|
|
|
163
163
|
window.removeEventListener("message", t, !0);
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function _e(r, e) {
|
|
167
167
|
if (document.caretRangeFromPoint !== void 0) {
|
|
168
168
|
const t = document.caretRangeFromPoint(r, e);
|
|
169
169
|
return t === null ? null : { node: t.startContainer, offset: t.startOffset };
|
|
@@ -174,10 +174,10 @@ function Se(r, e) {
|
|
|
174
174
|
}
|
|
175
175
|
return null;
|
|
176
176
|
}
|
|
177
|
-
const
|
|
177
|
+
const W = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Nr = W && "documentMode" in document ? document.documentMode : null, Lr = !(!W || !("InputEvent" in window) || Nr) && "getTargetRanges" in new window.InputEvent("input"), $r = W && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Se = W && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Dr = W && /^(?=.*Chrome).*/i.test(navigator.userAgent), Pr = W && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !Dr, ke = tt("DRAG_DROP_PASTE_FILE");
|
|
178
178
|
function Z(r) {
|
|
179
179
|
let e = null;
|
|
180
|
-
if (
|
|
180
|
+
if (A(r, DragEvent) ? e = r.dataTransfer : A(r, ClipboardEvent) && (e = r.clipboardData), e === null) return [!1, [], !1];
|
|
181
181
|
const t = e.types, o = t.includes("Files"), a = t.includes("text/html") || t.includes("text/plain");
|
|
182
182
|
return [o, Array.from(e.files), a];
|
|
183
183
|
}
|
|
@@ -188,7 +188,7 @@ function xe(r) {
|
|
|
188
188
|
for (let a = 0; a < o.length; a++) {
|
|
189
189
|
const n = o[a], s = n.getKey();
|
|
190
190
|
if (t.has(s)) continue;
|
|
191
|
-
const i = fe(n, (u) =>
|
|
191
|
+
const i = fe(n, (u) => J(u) && !u.isInline());
|
|
192
192
|
if (i === null) continue;
|
|
193
193
|
const l = i.getKey();
|
|
194
194
|
i.canIndent() && !t.has(l) && (t.add(l), r(i));
|
|
@@ -197,25 +197,25 @@ function xe(r) {
|
|
|
197
197
|
}
|
|
198
198
|
function Ne(r) {
|
|
199
199
|
const e = te(r);
|
|
200
|
-
return
|
|
200
|
+
return j(e);
|
|
201
201
|
}
|
|
202
202
|
function ae(r) {
|
|
203
203
|
for (const e of ["lowercase", "uppercase", "capitalize"]) r.hasFormat(e) && r.toggleFormat(e);
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
return
|
|
205
|
+
function Tr(r) {
|
|
206
|
+
return H(r.registerCommand(Tt, (e) => {
|
|
207
207
|
const t = p();
|
|
208
|
-
return !!
|
|
208
|
+
return !!P(t) && (t.clear(), !0);
|
|
209
209
|
}, m), r.registerCommand(re, (e) => {
|
|
210
210
|
const t = p();
|
|
211
|
-
return g(t) ? (t.deleteCharacter(e), !0) : !!
|
|
212
|
-
}, m), r.registerCommand(
|
|
211
|
+
return g(t) ? (t.deleteCharacter(e), !0) : !!P(t) && (t.deleteNodes(), !0);
|
|
212
|
+
}, m), r.registerCommand(Pt, (e) => {
|
|
213
213
|
const t = p();
|
|
214
214
|
return !!g(t) && (t.deleteWord(e), !0);
|
|
215
|
-
}, m), r.registerCommand(
|
|
215
|
+
}, m), r.registerCommand(Dt, (e) => {
|
|
216
216
|
const t = p();
|
|
217
217
|
return !!g(t) && (t.deleteLine(e), !0);
|
|
218
|
-
}, m), r.registerCommand(
|
|
218
|
+
}, m), r.registerCommand($t, (e) => {
|
|
219
219
|
const t = p();
|
|
220
220
|
if (typeof e == "string") t !== null && t.insertText(e);
|
|
221
221
|
else {
|
|
@@ -228,7 +228,7 @@ function Pr(r) {
|
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
return !0;
|
|
231
|
-
}, m), r.registerCommand(
|
|
231
|
+
}, m), r.registerCommand(Lt, () => {
|
|
232
232
|
const e = p();
|
|
233
233
|
return !!g(e) && (e.removeText(), !0);
|
|
234
234
|
}, m), r.registerCommand(Nt, (e) => {
|
|
@@ -236,10 +236,10 @@ function Pr(r) {
|
|
|
236
236
|
return !!g(t) && (t.formatText(e), !0);
|
|
237
237
|
}, m), r.registerCommand(xt, (e) => {
|
|
238
238
|
const t = p();
|
|
239
|
-
if (!g(t) && !
|
|
239
|
+
if (!g(t) && !P(t)) return !1;
|
|
240
240
|
const o = t.getNodes();
|
|
241
241
|
for (const a of o) {
|
|
242
|
-
const n = fe(a, (s) =>
|
|
242
|
+
const n = fe(a, (s) => J(s) && !s.isInline());
|
|
243
243
|
n !== null && n.setFormat(e);
|
|
244
244
|
}
|
|
245
245
|
return !0;
|
|
@@ -249,7 +249,7 @@ function Pr(r) {
|
|
|
249
249
|
}, m), r.registerCommand(pe, () => {
|
|
250
250
|
const e = p();
|
|
251
251
|
return !!g(e) && (e.insertParagraph(), !0);
|
|
252
|
-
}, m), r.registerCommand(
|
|
252
|
+
}, m), r.registerCommand(_t, () => (St([kt()]), !0), m), r.registerCommand(bt, () => xe((e) => {
|
|
253
253
|
const t = e.getIndent();
|
|
254
254
|
e.setIndent(t + 1);
|
|
255
255
|
}), m), r.registerCommand(ge, () => xe((e) => {
|
|
@@ -257,17 +257,17 @@ function Pr(r) {
|
|
|
257
257
|
t > 0 && e.setIndent(Math.max(0, t - 1));
|
|
258
258
|
}), m), r.registerCommand(wt, (e) => {
|
|
259
259
|
const t = p();
|
|
260
|
-
if (
|
|
260
|
+
if (P(t)) {
|
|
261
261
|
const o = t.getNodes();
|
|
262
262
|
if (o.length > 0) return o[0].selectPrevious(), !0;
|
|
263
263
|
} else if (g(t)) {
|
|
264
264
|
const o = he(t.focus, !0);
|
|
265
|
-
if (!e.shiftKey &&
|
|
265
|
+
if (!e.shiftKey && j(o) && !o.isIsolated() && !o.isInline()) return o.selectPrevious(), e.preventDefault(), !0;
|
|
266
266
|
}
|
|
267
267
|
return !1;
|
|
268
268
|
}, m), r.registerCommand(Et, (e) => {
|
|
269
269
|
const t = p();
|
|
270
|
-
if (
|
|
270
|
+
if (P(t)) {
|
|
271
271
|
const o = t.getNodes();
|
|
272
272
|
if (o.length > 0) return o[0].selectNext(0, 0), !0;
|
|
273
273
|
} else if (g(t)) {
|
|
@@ -276,12 +276,12 @@ function Pr(r) {
|
|
|
276
276
|
return n.key === "root" && n.offset === z().getChildrenSize();
|
|
277
277
|
}(t)) return e.preventDefault(), !0;
|
|
278
278
|
const o = he(t.focus, !1);
|
|
279
|
-
if (!e.shiftKey &&
|
|
279
|
+
if (!e.shiftKey && j(o) && !o.isIsolated() && !o.isInline()) return o.selectNext(), e.preventDefault(), !0;
|
|
280
280
|
}
|
|
281
281
|
return !1;
|
|
282
282
|
}, m), r.registerCommand(yt, (e) => {
|
|
283
283
|
const t = p();
|
|
284
|
-
if (
|
|
284
|
+
if (P(t)) {
|
|
285
285
|
const o = t.getNodes();
|
|
286
286
|
if (o.length > 0) return e.preventDefault(), o[0].selectPrevious(), !0;
|
|
287
287
|
}
|
|
@@ -293,7 +293,7 @@ function Pr(r) {
|
|
|
293
293
|
return !1;
|
|
294
294
|
}, m), r.registerCommand(Ct, (e) => {
|
|
295
295
|
const t = p();
|
|
296
|
-
if (
|
|
296
|
+
if (P(t)) {
|
|
297
297
|
const a = t.getNodes();
|
|
298
298
|
if (a.length > 0) return e.preventDefault(), a[0].selectNext(0, 0), !0;
|
|
299
299
|
}
|
|
@@ -309,22 +309,22 @@ function Pr(r) {
|
|
|
309
309
|
const { anchor: a } = o;
|
|
310
310
|
if (a.offset !== 0) return !1;
|
|
311
311
|
const n = a.getNode();
|
|
312
|
-
if (
|
|
312
|
+
if (Ke(n)) return !1;
|
|
313
313
|
const s = Ut(n);
|
|
314
314
|
return s.getIndent() > 0 && (s.is(n) || n.is(s.getFirstDescendant()));
|
|
315
315
|
}(t)) return e.preventDefault(), r.dispatchCommand(ge, void 0);
|
|
316
|
-
if (
|
|
317
|
-
} else if (!
|
|
316
|
+
if (Se && navigator.language === "ko-KR") return !1;
|
|
317
|
+
} else if (!P(t)) return !1;
|
|
318
318
|
return e.preventDefault(), r.dispatchCommand(re, !0);
|
|
319
319
|
}, m), r.registerCommand(ht, (e) => {
|
|
320
320
|
if (Ne(e.target)) return !1;
|
|
321
321
|
const t = p();
|
|
322
|
-
return !(!g(t) && !
|
|
322
|
+
return !(!g(t) && !P(t)) && (e.preventDefault(), r.dispatchCommand(re, !1));
|
|
323
323
|
}, m), r.registerCommand(gt, (e) => {
|
|
324
324
|
const t = p();
|
|
325
325
|
if (!g(t)) return !1;
|
|
326
326
|
if (ae(t), e !== null) {
|
|
327
|
-
if ((
|
|
327
|
+
if ((Se || $r || Pr) && Lr) return !1;
|
|
328
328
|
if (e.preventDefault(), e.shiftKey) return r.dispatchCommand(me, !1);
|
|
329
329
|
}
|
|
330
330
|
return r.dispatchCommand(pe, void 0);
|
|
@@ -334,12 +334,12 @@ function Pr(r) {
|
|
|
334
334
|
}, m), r.registerCommand(ct, (e) => {
|
|
335
335
|
const [, t] = Z(e);
|
|
336
336
|
if (t.length > 0) {
|
|
337
|
-
const a =
|
|
337
|
+
const a = _e(e.clientX, e.clientY);
|
|
338
338
|
if (a !== null) {
|
|
339
339
|
const { offset: n, node: s } = a, i = te(s);
|
|
340
340
|
if (i !== null) {
|
|
341
341
|
const l = dt();
|
|
342
|
-
if (
|
|
342
|
+
if (I(i)) l.anchor.set(i.getKey(), n, "text"), l.focus.set(i.getKey(), n, "text");
|
|
343
343
|
else {
|
|
344
344
|
const c = i.getParentOrThrow().getKey(), d = i.getIndexWithinParent() + 1;
|
|
345
345
|
l.anchor.set(c, d, "element"), l.focus.set(c, d, "element");
|
|
@@ -359,22 +359,22 @@ function Pr(r) {
|
|
|
359
359
|
}, m), r.registerCommand(lt, (e) => {
|
|
360
360
|
const [t] = Z(e), o = p();
|
|
361
361
|
if (t && !g(o)) return !1;
|
|
362
|
-
const a =
|
|
362
|
+
const a = _e(e.clientX, e.clientY);
|
|
363
363
|
if (a !== null) {
|
|
364
364
|
const n = te(a.node);
|
|
365
|
-
|
|
365
|
+
j(n) && e.preventDefault();
|
|
366
366
|
}
|
|
367
367
|
return !0;
|
|
368
|
-
}, m), r.registerCommand(st, () => (it(), !0), m), r.registerCommand(at, (e) => (ye(r,
|
|
369
|
-
await ye(o,
|
|
368
|
+
}, m), r.registerCommand(st, () => (it(), !0), m), r.registerCommand(at, (e) => (ye(r, A(e, ClipboardEvent) ? e : null), !0), m), r.registerCommand(ot, (e) => (async function(t, o) {
|
|
369
|
+
await ye(o, A(t, ClipboardEvent) ? t : null), o.update(() => {
|
|
370
370
|
const a = p();
|
|
371
|
-
g(a) ? a.removeText() :
|
|
371
|
+
g(a) ? a.removeText() : P(a) && a.getNodes().forEach((n) => n.remove());
|
|
372
372
|
});
|
|
373
373
|
}(e, r), !0), m), r.registerCommand(Fe, (e) => {
|
|
374
374
|
const [, t, o] = Z(e);
|
|
375
375
|
return t.length > 0 && !o ? (r.dispatchCommand(ke, t), !0) : Oe(e.target) && rt(e.target) ? !1 : p() !== null && (function(a, n) {
|
|
376
376
|
a.preventDefault(), n.update(() => {
|
|
377
|
-
const s = p(), i =
|
|
377
|
+
const s = p(), i = A(a, InputEvent) || A(a, KeyboardEvent) ? null : a.clipboardData;
|
|
378
378
|
i != null && s !== null && Ce(i, s, n);
|
|
379
379
|
}, { tag: nt });
|
|
380
380
|
}(e, r), !0);
|
|
@@ -386,41 +386,41 @@ function Pr(r) {
|
|
|
386
386
|
return g(t) && ae(t), !1;
|
|
387
387
|
}, m));
|
|
388
388
|
}
|
|
389
|
-
const ie = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U :
|
|
390
|
-
function
|
|
391
|
-
return r.getEditorState().read(
|
|
389
|
+
const ie = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U : S;
|
|
390
|
+
function Le(r) {
|
|
391
|
+
return r.getEditorState().read(Xe(r.isComposing()));
|
|
392
392
|
}
|
|
393
393
|
function Rr({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
|
|
394
|
-
const [o] =
|
|
394
|
+
const [o] = T(), a = function(n, s) {
|
|
395
395
|
const [i, l] = F(() => n.getDecorators());
|
|
396
396
|
return ie(() => n.registerDecoratorListener((u) => {
|
|
397
|
-
|
|
397
|
+
Ht(() => {
|
|
398
398
|
l(u);
|
|
399
399
|
});
|
|
400
|
-
}), [n]),
|
|
400
|
+
}), [n]), S(() => {
|
|
401
401
|
l(n.getDecorators());
|
|
402
|
-
}, [n]),
|
|
402
|
+
}, [n]), X(() => {
|
|
403
403
|
const u = [], c = Object.keys(i);
|
|
404
404
|
for (let d = 0; d < c.length; d++) {
|
|
405
405
|
const f = c[d], v = h(s, { onError: (w) => n._onError(w), children: h(zt, { fallback: null, children: i[f] }) }), C = n.getElementByKey(f);
|
|
406
|
-
C !== null && u.push(
|
|
406
|
+
C !== null && u.push(Wt(v, C, f));
|
|
407
407
|
}
|
|
408
408
|
return u;
|
|
409
409
|
}, [s, i, n]);
|
|
410
410
|
}(o, t);
|
|
411
411
|
return function(n) {
|
|
412
|
-
ie(() =>
|
|
413
|
-
}(o),
|
|
412
|
+
ie(() => H(Tr(n), xr(n)), [n]);
|
|
413
|
+
}(o), K(Re, { children: [r, h(Mr, { content: e }), a] });
|
|
414
414
|
}
|
|
415
|
-
function
|
|
416
|
-
const [e] =
|
|
417
|
-
const [n, s] = F(() =>
|
|
415
|
+
function Mr({ content: r }) {
|
|
416
|
+
const [e] = T(), t = function(a) {
|
|
417
|
+
const [n, s] = F(() => Le(a));
|
|
418
418
|
return ie(() => {
|
|
419
419
|
function i() {
|
|
420
|
-
const l =
|
|
420
|
+
const l = Le(a);
|
|
421
421
|
s(l);
|
|
422
422
|
}
|
|
423
|
-
return i(),
|
|
423
|
+
return i(), H(a.registerUpdateListener(() => {
|
|
424
424
|
i();
|
|
425
425
|
}), a.registerEditableListener(() => {
|
|
426
426
|
i();
|
|
@@ -429,39 +429,39 @@ function Ir({ content: r }) {
|
|
|
429
429
|
}(e), o = br();
|
|
430
430
|
return t ? typeof r == "function" ? r(o) : r : null;
|
|
431
431
|
}
|
|
432
|
-
const
|
|
433
|
-
function
|
|
434
|
-
const [k, R] = F(r.isEditable()), O = Bt((
|
|
435
|
-
|
|
436
|
-
}, [r]), B =
|
|
437
|
-
return (
|
|
438
|
-
|
|
439
|
-
typeof V == "function" ? V(
|
|
432
|
+
const qe = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U : S;
|
|
433
|
+
function Ir({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: o, ariaDescribedBy: a, ariaErrorMessage: n, ariaExpanded: s, ariaInvalid: i, ariaLabel: l, ariaLabelledBy: u, ariaMultiline: c, ariaOwns: d, ariaRequired: f, autoCapitalize: v, className: C, id: w, role: x = "textbox", spellCheck: y = !0, style: E, tabIndex: _, "data-testid": N, ...b }, L) {
|
|
434
|
+
const [k, R] = F(r.isEditable()), O = Bt(($) => {
|
|
435
|
+
$ && $.ownerDocument && $.ownerDocument.defaultView ? r.setRootElement($) : r.setRootElement(null);
|
|
436
|
+
}, [r]), B = X(() => /* @__PURE__ */ function(...$) {
|
|
437
|
+
return (q) => {
|
|
438
|
+
$.forEach((V) => {
|
|
439
|
+
typeof V == "function" ? V(q) : V != null && (V.current = q);
|
|
440
440
|
});
|
|
441
441
|
};
|
|
442
|
-
}(
|
|
443
|
-
return
|
|
444
|
-
R(
|
|
445
|
-
})), [r]), h("div", { "aria-activedescendant": k ? e : void 0, "aria-autocomplete": k ? t : "none", "aria-controls": k ? o : void 0, "aria-describedby": a, ...n != null ? { "aria-errormessage": n } : {}, "aria-expanded": k && x === "combobox" ? !!s : void 0, ...i != null ? { "aria-invalid": i } : {}, "aria-label": l, "aria-labelledby": u, "aria-multiline": c, "aria-owns": k ? d : void 0, "aria-readonly": !k || void 0, "aria-required": f, autoCapitalize: v, className: C, contentEditable: k, "data-testid": N, id: w, ref: B, role: x, spellCheck: y, style: E, tabIndex:
|
|
442
|
+
}(L, O), [O, L]);
|
|
443
|
+
return qe(() => (R(r.isEditable()), r.registerEditableListener(($) => {
|
|
444
|
+
R($);
|
|
445
|
+
})), [r]), h("div", { "aria-activedescendant": k ? e : void 0, "aria-autocomplete": k ? t : "none", "aria-controls": k ? o : void 0, "aria-describedby": a, ...n != null ? { "aria-errormessage": n } : {}, "aria-expanded": k && x === "combobox" ? !!s : void 0, ...i != null ? { "aria-invalid": i } : {}, "aria-label": l, "aria-labelledby": u, "aria-multiline": c, "aria-owns": k ? d : void 0, "aria-readonly": !k || void 0, "aria-required": f, autoCapitalize: v, className: C, contentEditable: k, "data-testid": N, id: w, ref: B, role: x, spellCheck: y, style: E, tabIndex: _, ...b });
|
|
446
446
|
}
|
|
447
|
-
const Fr = ze(
|
|
448
|
-
function
|
|
449
|
-
return r.getEditorState().read(
|
|
447
|
+
const Fr = ze(Ir);
|
|
448
|
+
function $e(r) {
|
|
449
|
+
return r.getEditorState().read(Xe(r.isComposing()));
|
|
450
450
|
}
|
|
451
|
-
const Or = ze(
|
|
452
|
-
function
|
|
453
|
-
const { placeholder: t, ...o } = r, [a] =
|
|
454
|
-
return
|
|
451
|
+
const Or = ze(Kr);
|
|
452
|
+
function Kr(r, e) {
|
|
453
|
+
const { placeholder: t, ...o } = r, [a] = T();
|
|
454
|
+
return K(Re, { children: [h(Fr, { editor: a, ...o, ref: e }), t != null && h(Ar, { editor: a, content: t })] });
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function Ar({ content: r, editor: e }) {
|
|
457
457
|
const t = function(s) {
|
|
458
|
-
const [i, l] = F(() =>
|
|
459
|
-
return
|
|
458
|
+
const [i, l] = F(() => $e(s));
|
|
459
|
+
return qe(() => {
|
|
460
460
|
function u() {
|
|
461
|
-
const c =
|
|
461
|
+
const c = $e(s);
|
|
462
462
|
l(c);
|
|
463
463
|
}
|
|
464
|
-
return u(),
|
|
464
|
+
return u(), H(s.registerUpdateListener(() => {
|
|
465
465
|
u();
|
|
466
466
|
}), s.registerEditableListener(() => {
|
|
467
467
|
u();
|
|
@@ -479,11 +479,11 @@ function le(r, e) {
|
|
|
479
479
|
return t.__proto__ = o, t;
|
|
480
480
|
}, le(r, e);
|
|
481
481
|
}
|
|
482
|
-
var
|
|
482
|
+
var De = { error: null }, zr = function(r) {
|
|
483
483
|
var e, t;
|
|
484
484
|
function o() {
|
|
485
485
|
for (var n, s = arguments.length, i = new Array(s), l = 0; l < s; l++) i[l] = arguments[l];
|
|
486
|
-
return (n = r.call.apply(r, [this].concat(i)) || this).state =
|
|
486
|
+
return (n = r.call.apply(r, [this].concat(i)) || this).state = De, n.resetErrorBoundary = function() {
|
|
487
487
|
for (var u, c = arguments.length, d = new Array(c), f = 0; f < c; f++) d[f] = arguments[f];
|
|
488
488
|
n.props.onReset == null || (u = n.props).onReset.apply(u, d), n.reset();
|
|
489
489
|
}, n;
|
|
@@ -493,7 +493,7 @@ var $e = { error: null }, zr = function(r) {
|
|
|
493
493
|
};
|
|
494
494
|
var a = o.prototype;
|
|
495
495
|
return a.reset = function() {
|
|
496
|
-
this.setState(
|
|
496
|
+
this.setState(De);
|
|
497
497
|
}, a.componentDidCatch = function(n, s) {
|
|
498
498
|
var i, l;
|
|
499
499
|
(i = (l = this.props).onError) == null || i.call(l, n, s);
|
|
@@ -517,30 +517,30 @@ var $e = { error: null }, zr = function(r) {
|
|
|
517
517
|
function Br({ children: r, onError: e }) {
|
|
518
518
|
return h(zr, { fallback: h("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: r });
|
|
519
519
|
}
|
|
520
|
-
const Ur = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U :
|
|
521
|
-
function
|
|
522
|
-
const [o] =
|
|
520
|
+
const Ur = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U : S;
|
|
521
|
+
function Hr({ ignoreHistoryMergeTagChange: r = !0, ignoreSelectionChange: e = !1, onChange: t }) {
|
|
522
|
+
const [o] = T();
|
|
523
523
|
return Ur(() => {
|
|
524
524
|
if (t) return o.registerUpdateListener(({ editorState: a, dirtyElements: n, dirtyLeaves: s, prevEditorState: i, tags: l }) => {
|
|
525
525
|
e && n.size === 0 && s.size === 0 || r && l.has(de) || i.isEmpty() || t(a, o, l);
|
|
526
526
|
});
|
|
527
527
|
}, [o, r, e, t]), null;
|
|
528
528
|
}
|
|
529
|
-
function
|
|
530
|
-
const [e] =
|
|
531
|
-
return
|
|
529
|
+
function Wr({ hasStrictIndent: r = !1 }) {
|
|
530
|
+
const [e] = T();
|
|
531
|
+
return S(() => {
|
|
532
532
|
if (!e.hasNodes([Be, Ue])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
|
|
533
|
-
}, [e]),
|
|
534
|
-
if (r) return
|
|
533
|
+
}, [e]), S(() => {
|
|
534
|
+
if (r) return Xt(e);
|
|
535
535
|
}, [e, r]), function(t) {
|
|
536
|
-
|
|
536
|
+
S(() => qt(t), [t]);
|
|
537
537
|
}(e), null;
|
|
538
538
|
}
|
|
539
|
-
function
|
|
540
|
-
const [t] =
|
|
541
|
-
return
|
|
542
|
-
if (!t.hasNodes([
|
|
543
|
-
return
|
|
539
|
+
function jr({ validateUrl: r, attributes: e }) {
|
|
540
|
+
const [t] = T();
|
|
541
|
+
return S(() => {
|
|
542
|
+
if (!t.hasNodes([He])) throw new Error("LinkPlugin: LinkNode not registered on editor");
|
|
543
|
+
return H(t.registerCommand(be, (o) => {
|
|
544
544
|
if (o === null) return oe(o), !0;
|
|
545
545
|
if (typeof o == "string") return !(r !== void 0 && !r(o)) && (oe(o, e), !0);
|
|
546
546
|
{
|
|
@@ -549,16 +549,16 @@ function Wr({ validateUrl: r, attributes: e }) {
|
|
|
549
549
|
}
|
|
550
550
|
}, ve), r !== void 0 ? t.registerCommand(Fe, (o) => {
|
|
551
551
|
const a = p();
|
|
552
|
-
if (!g(a) || a.isCollapsed() || !
|
|
552
|
+
if (!g(a) || a.isCollapsed() || !A(o, ClipboardEvent) || o.clipboardData === null) return !1;
|
|
553
553
|
const n = o.clipboardData.getData("text");
|
|
554
|
-
return !!r(n) && !a.getNodes().some((s) =>
|
|
554
|
+
return !!r(n) && !a.getNodes().some((s) => J(s)) && (t.dispatchCommand(be, { ...e, url: n }), o.preventDefault(), !0);
|
|
555
555
|
}, ve) : () => {
|
|
556
556
|
});
|
|
557
557
|
}, [t, r, e]), null;
|
|
558
558
|
}
|
|
559
|
-
function
|
|
560
|
-
const [t] =
|
|
561
|
-
return
|
|
559
|
+
function Jr({ newTab: r = !0, disabled: e = !1 }) {
|
|
560
|
+
const [t] = T();
|
|
561
|
+
return S(() => {
|
|
562
562
|
const o = (n) => {
|
|
563
563
|
const s = n.target;
|
|
564
564
|
if (!Oe(s)) return;
|
|
@@ -568,7 +568,7 @@ function Hr({ newTab: r = !0, disabled: e = !1 }) {
|
|
|
568
568
|
if (i.update(() => {
|
|
569
569
|
const f = te(s);
|
|
570
570
|
if (f !== null) {
|
|
571
|
-
const v = fe(f,
|
|
571
|
+
const v = fe(f, J);
|
|
572
572
|
if (!e) if (Vt(v)) l = v.sanitizeUrl(v.getURL()), u = v.getTarget();
|
|
573
573
|
else {
|
|
574
574
|
const C = function(w, x) {
|
|
@@ -578,7 +578,7 @@ function Hr({ newTab: r = !0, disabled: e = !1 }) {
|
|
|
578
578
|
y = y.parentNode;
|
|
579
579
|
}
|
|
580
580
|
return null;
|
|
581
|
-
}(s,
|
|
581
|
+
}(s, Mt);
|
|
582
582
|
C !== null && (l = C.href, u = C.target);
|
|
583
583
|
}
|
|
584
584
|
}
|
|
@@ -595,81 +595,81 @@ function Hr({ newTab: r = !0, disabled: e = !1 }) {
|
|
|
595
595
|
});
|
|
596
596
|
}, [t, r, e]), null;
|
|
597
597
|
}
|
|
598
|
-
const ee = 0, ue = 1, ce = 2,
|
|
599
|
-
function
|
|
600
|
-
if (r === null || t.size === 0 && o.size === 0 && !a) return
|
|
598
|
+
const ee = 0, ue = 1, ce = 2, D = 0, Xr = 1, Pe = 2, qr = 3, Vr = 4;
|
|
599
|
+
function Gr(r, e, t, o, a) {
|
|
600
|
+
if (r === null || t.size === 0 && o.size === 0 && !a) return D;
|
|
601
601
|
const n = e._selection, s = r._selection;
|
|
602
|
-
if (a) return
|
|
603
|
-
if (!(g(n) && g(s) && s.isCollapsed() && n.isCollapsed())) return
|
|
604
|
-
const i = function(y, E,
|
|
602
|
+
if (a) return Xr;
|
|
603
|
+
if (!(g(n) && g(s) && s.isCollapsed() && n.isCollapsed())) return D;
|
|
604
|
+
const i = function(y, E, _) {
|
|
605
605
|
const N = y._nodeMap, b = [];
|
|
606
|
-
for (const
|
|
607
|
-
const k = N.get(
|
|
606
|
+
for (const L of E) {
|
|
607
|
+
const k = N.get(L);
|
|
608
608
|
k !== void 0 && b.push(k);
|
|
609
609
|
}
|
|
610
|
-
for (const [
|
|
610
|
+
for (const [L, k] of _) {
|
|
611
611
|
if (!k) continue;
|
|
612
|
-
const R = N.get(
|
|
613
|
-
R === void 0 ||
|
|
612
|
+
const R = N.get(L);
|
|
613
|
+
R === void 0 || Ke(R) || b.push(R);
|
|
614
614
|
}
|
|
615
615
|
return b;
|
|
616
616
|
}(e, t, o);
|
|
617
|
-
if (i.length === 0) return
|
|
617
|
+
if (i.length === 0) return D;
|
|
618
618
|
if (i.length > 1) {
|
|
619
|
-
const y = e._nodeMap, E = y.get(n.anchor.key),
|
|
620
|
-
return E &&
|
|
619
|
+
const y = e._nodeMap, E = y.get(n.anchor.key), _ = y.get(s.anchor.key);
|
|
620
|
+
return E && _ && !r._nodeMap.has(E.__key) && I(E) && E.__text.length === 1 && n.anchor.offset === 1 ? Pe : D;
|
|
621
621
|
}
|
|
622
622
|
const l = i[0], u = r._nodeMap.get(l.__key);
|
|
623
|
-
if (!
|
|
623
|
+
if (!I(u) || !I(l) || u.__mode !== l.__mode) return D;
|
|
624
624
|
const c = u.__text, d = l.__text;
|
|
625
|
-
if (c === d) return
|
|
625
|
+
if (c === d) return D;
|
|
626
626
|
const f = n.anchor, v = s.anchor;
|
|
627
|
-
if (f.key !== v.key || f.type !== "text") return
|
|
627
|
+
if (f.key !== v.key || f.type !== "text") return D;
|
|
628
628
|
const C = f.offset, w = v.offset, x = d.length - c.length;
|
|
629
|
-
return x === 1 && w === C - 1 ?
|
|
629
|
+
return x === 1 && w === C - 1 ? Pe : x === -1 && w === C + 1 ? qr : x === -1 && w === C ? Vr : D;
|
|
630
630
|
}
|
|
631
|
-
function
|
|
632
|
-
let t = Date.now(), o =
|
|
631
|
+
function Yr(r, e) {
|
|
632
|
+
let t = Date.now(), o = D;
|
|
633
633
|
return (a, n, s, i, l, u) => {
|
|
634
634
|
const c = Date.now();
|
|
635
|
-
if (u.has(se)) return o =
|
|
636
|
-
const d =
|
|
637
|
-
const v = s === null || s.editor === r, C = u.has(
|
|
635
|
+
if (u.has(se)) return o = D, t = c, ce;
|
|
636
|
+
const d = Gr(a, n, i, l, r.isComposing()), f = (() => {
|
|
637
|
+
const v = s === null || s.editor === r, C = u.has(At);
|
|
638
638
|
if (!C && v && u.has(de)) return ee;
|
|
639
639
|
if (a === null) return ue;
|
|
640
640
|
const w = n._selection;
|
|
641
|
-
return i.size > 0 || l.size > 0 ? C === !1 && d !==
|
|
642
|
-
const
|
|
643
|
-
return !(g(b) && g(
|
|
641
|
+
return i.size > 0 || l.size > 0 ? C === !1 && d !== D && d === o && c < t + e && v || i.size === 1 && function(x, y, E) {
|
|
642
|
+
const _ = y._nodeMap.get(x), N = E._nodeMap.get(x), b = y._selection, L = E._selection;
|
|
643
|
+
return !(g(b) && g(L) && b.anchor.type === "element" && b.focus.type === "element" && L.anchor.type === "text" && L.focus.type === "text" || !I(_) || !I(N) || _.__parent !== N.__parent) && JSON.stringify(y.read(() => _.exportJSON())) === JSON.stringify(E.read(() => N.exportJSON()));
|
|
644
644
|
}(Array.from(i)[0], a, n) ? ee : ue : w !== null ? ee : ce;
|
|
645
645
|
})();
|
|
646
646
|
return t = c, o = d, f;
|
|
647
647
|
};
|
|
648
648
|
}
|
|
649
|
-
function
|
|
649
|
+
function Te(r) {
|
|
650
650
|
r.undoStack = [], r.redoStack = [], r.current = null;
|
|
651
651
|
}
|
|
652
652
|
function Qr(r, e, t) {
|
|
653
|
-
const o =
|
|
654
|
-
return
|
|
653
|
+
const o = Yr(r, t);
|
|
654
|
+
return H(r.registerCommand(Kt, () => (function(n, s) {
|
|
655
655
|
const i = s.redoStack, l = s.undoStack;
|
|
656
656
|
if (l.length !== 0) {
|
|
657
657
|
const u = s.current, c = l.pop();
|
|
658
|
-
u !== null && (i.push(u), n.dispatchCommand(
|
|
658
|
+
u !== null && (i.push(u), n.dispatchCommand(G, !0)), l.length === 0 && n.dispatchCommand(Y, !1), s.current = c || null, c && c.editor.setEditorState(c.editorState, { tag: se });
|
|
659
659
|
}
|
|
660
660
|
}(r, e), !0), m), r.registerCommand(Ot, () => (function(n, s) {
|
|
661
661
|
const i = s.redoStack, l = s.undoStack;
|
|
662
662
|
if (i.length !== 0) {
|
|
663
663
|
const u = s.current;
|
|
664
|
-
u !== null && (l.push(u), n.dispatchCommand(
|
|
664
|
+
u !== null && (l.push(u), n.dispatchCommand(Y, !0));
|
|
665
665
|
const c = i.pop();
|
|
666
|
-
i.length === 0 && n.dispatchCommand(
|
|
666
|
+
i.length === 0 && n.dispatchCommand(G, !1), s.current = c || null, c && c.editor.setEditorState(c.editorState, { tag: se });
|
|
667
667
|
}
|
|
668
|
-
}(r, e), !0), m), r.registerCommand(Ft, () => (
|
|
668
|
+
}(r, e), !0), m), r.registerCommand(Ft, () => (Te(e), !1), m), r.registerCommand(It, () => (Te(e), r.dispatchCommand(G, !1), r.dispatchCommand(Y, !1), !0), m), r.registerUpdateListener(({ editorState: n, prevEditorState: s, dirtyLeaves: i, dirtyElements: l, tags: u }) => {
|
|
669
669
|
const c = e.current, d = e.redoStack, f = e.undoStack, v = c === null ? null : c.editorState;
|
|
670
670
|
if (c !== null && n === v) return;
|
|
671
671
|
const C = o(s, n, c, i, l, u);
|
|
672
|
-
if (C === ue) d.length !== 0 && (e.redoStack = [], r.dispatchCommand(
|
|
672
|
+
if (C === ue) d.length !== 0 && (e.redoStack = [], r.dispatchCommand(G, !1)), c !== null && (f.push({ ...c }), r.dispatchCommand(Y, !0));
|
|
673
673
|
else if (C === ce) return;
|
|
674
674
|
e.current = { editor: r, editorState: n };
|
|
675
675
|
}));
|
|
@@ -678,21 +678,21 @@ function Zr() {
|
|
|
678
678
|
return { current: null, redoStack: [], undoStack: [] };
|
|
679
679
|
}
|
|
680
680
|
function en({ delay: r, externalHistoryState: e }) {
|
|
681
|
-
const [t] =
|
|
681
|
+
const [t] = T();
|
|
682
682
|
return function(o, a, n = 1e3) {
|
|
683
|
-
const s =
|
|
684
|
-
|
|
683
|
+
const s = X(() => a || Zr(), [a]);
|
|
684
|
+
S(() => Qr(o, s, n), [n, o, s]);
|
|
685
685
|
}(t, e, r), null;
|
|
686
686
|
}
|
|
687
687
|
function tn({ hasCellMerge: r = !0, hasCellBackgroundColor: e = !0, hasTabHandler: t = !0, hasHorizontalScroll: o = !1 }) {
|
|
688
|
-
const [a] =
|
|
689
|
-
return
|
|
690
|
-
|
|
688
|
+
const [a] = T();
|
|
689
|
+
return S(() => {
|
|
690
|
+
Yt(a) !== o && (Qt(a, o), a.registerNodeTransform(We, () => {
|
|
691
691
|
})());
|
|
692
|
-
}, [a, o]),
|
|
692
|
+
}, [a, o]), S(() => Zt(a), [a]), S(() => er(a, t), [a, t]), S(() => {
|
|
693
693
|
if (!r) return tr(a);
|
|
694
|
-
}, [a, r]),
|
|
695
|
-
if (!e) return a.registerNodeTransform(
|
|
694
|
+
}, [a, r]), S(() => {
|
|
695
|
+
if (!e) return a.registerNodeTransform(je, (n) => {
|
|
696
696
|
n.getBackgroundColor() !== null && n.setBackgroundColor(null);
|
|
697
697
|
});
|
|
698
698
|
}, [a, e, r]), null;
|
|
@@ -709,7 +709,7 @@ const Ve = 200, rn = ({
|
|
|
709
709
|
maxWords: l = Ve,
|
|
710
710
|
onChange: u
|
|
711
711
|
}) => {
|
|
712
|
-
const { switchLanguage: c } = hr(), d = dr(), [f] = F(() =>
|
|
712
|
+
const { switchLanguage: c } = hr(), d = dr(), [f] = F(() => Me()), [v, C] = F(0), [w, x] = F(0), y = Ae(null), E = {
|
|
713
713
|
html: {
|
|
714
714
|
export: ir
|
|
715
715
|
},
|
|
@@ -719,54 +719,54 @@ const Ve = 200, rn = ({
|
|
|
719
719
|
onError(b) {
|
|
720
720
|
throw b;
|
|
721
721
|
},
|
|
722
|
-
nodes: [Be, Ue,
|
|
722
|
+
nodes: [Be, Ue, He, Gt, je, rr, We],
|
|
723
723
|
editorState: (b) => {
|
|
724
|
-
const k = new DOMParser().parseFromString(e, "text/html"), R =
|
|
724
|
+
const k = new DOMParser().parseFromString(e, "text/html"), R = jt(b, k), O = z();
|
|
725
725
|
if (O.clear(), lr(e))
|
|
726
726
|
R.forEach((B) => {
|
|
727
727
|
O.append(B);
|
|
728
728
|
});
|
|
729
729
|
else {
|
|
730
|
-
const B =
|
|
731
|
-
R.forEach((
|
|
732
|
-
|
|
730
|
+
const B = Ie();
|
|
731
|
+
R.forEach(($, q) => {
|
|
732
|
+
q === 0 ? (B.append($), O.append(B)) : O.append($);
|
|
733
733
|
});
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
|
-
},
|
|
736
|
+
}, _ = (b) => b.trim().length === 0 ? 0 : b.split(" ").length, N = (b, L) => {
|
|
737
737
|
b.read(() => {
|
|
738
738
|
let k = "";
|
|
739
|
-
C(
|
|
739
|
+
C(_(z().getTextContent().replace(/\s+/g, " ").trim())), k = ur(Jt(L)), u(k);
|
|
740
740
|
});
|
|
741
741
|
};
|
|
742
|
-
return
|
|
742
|
+
return S(() => {
|
|
743
743
|
c(r.toLocaleLowerCase());
|
|
744
|
-
}, [r, c]),
|
|
744
|
+
}, [r, c]), S(() => {
|
|
745
745
|
const b = e.replace(/<br\s*\/?>| /gi, " ").replace(/<\/?[^>]+(>|$)|&[a-z]+;/g, "").replace(/\s+/g, " ").trim();
|
|
746
|
-
C(
|
|
747
|
-
}, []), /* @__PURE__ */
|
|
748
|
-
/* @__PURE__ */
|
|
746
|
+
C(_(b));
|
|
747
|
+
}, []), /* @__PURE__ */ K("div", { className: M.editor__container, children: [
|
|
748
|
+
/* @__PURE__ */ K("div", { className: M.editor__header, children: [
|
|
749
749
|
/* @__PURE__ */ h(pr, { label: o, info: a, required: n }),
|
|
750
|
-
/* @__PURE__ */
|
|
751
|
-
/* @__PURE__ */ h("span", { className: sr({ [
|
|
750
|
+
/* @__PURE__ */ K("div", { className: M["editor__header-word-count"], children: [
|
|
751
|
+
/* @__PURE__ */ h("span", { className: sr({ [M["editor__header-word-count--alert"]]: v > l }), children: v }),
|
|
752
752
|
" / ",
|
|
753
753
|
l
|
|
754
754
|
] })
|
|
755
755
|
] }),
|
|
756
|
-
/* @__PURE__ */ h("div", { className:
|
|
756
|
+
/* @__PURE__ */ h("div", { className: M.editor, children: /* @__PURE__ */ K(yr, { initialConfig: E, children: [
|
|
757
757
|
/* @__PURE__ */ h(cr, { editorScrollPosition: w }),
|
|
758
|
-
/* @__PURE__ */
|
|
758
|
+
/* @__PURE__ */ K("div", { className: M["editor__field-wrapper"], children: [
|
|
759
759
|
/* @__PURE__ */ h(
|
|
760
760
|
Rr,
|
|
761
761
|
{
|
|
762
762
|
contentEditable: /* @__PURE__ */ h(
|
|
763
763
|
Or,
|
|
764
764
|
{
|
|
765
|
-
className:
|
|
765
|
+
className: M.editor__field,
|
|
766
766
|
"aria-label": d.common.rteAriaLabel,
|
|
767
767
|
"aria-placeholder": t,
|
|
768
768
|
title: d.common.rteTitle,
|
|
769
|
-
placeholder: /* @__PURE__ */ h("div", { className:
|
|
769
|
+
placeholder: /* @__PURE__ */ h("div", { className: M.editor__placeholder, children: t }),
|
|
770
770
|
spellCheck: !1,
|
|
771
771
|
id: "rteEditor",
|
|
772
772
|
style: { height: `${i}`, maxHeight: `${i}` },
|
|
@@ -774,23 +774,23 @@ const Ve = 200, rn = ({
|
|
|
774
774
|
ref: y
|
|
775
775
|
}
|
|
776
776
|
),
|
|
777
|
-
placeholder: /* @__PURE__ */ h("div", { className:
|
|
777
|
+
placeholder: /* @__PURE__ */ h("div", { className: M.editor__placeholder, children: t }),
|
|
778
778
|
ErrorBoundary: Br
|
|
779
779
|
}
|
|
780
780
|
),
|
|
781
781
|
/* @__PURE__ */ h(tn, {}),
|
|
782
782
|
/* @__PURE__ */ h(en, {}),
|
|
783
|
-
/* @__PURE__ */ h(
|
|
784
|
-
/* @__PURE__ */ h(
|
|
783
|
+
/* @__PURE__ */ h(Wr, {}),
|
|
784
|
+
/* @__PURE__ */ h(jr, { validateUrl: nr }),
|
|
785
785
|
/* @__PURE__ */ h(or, { matchers: ar }),
|
|
786
|
-
/* @__PURE__ */ h(
|
|
787
|
-
/* @__PURE__ */ h(
|
|
786
|
+
/* @__PURE__ */ h(Jr, {}),
|
|
787
|
+
/* @__PURE__ */ h(Hr, { onChange: N }),
|
|
788
788
|
/* @__PURE__ */ h(vr, {})
|
|
789
789
|
] })
|
|
790
790
|
] }) }),
|
|
791
791
|
s !== "" && /* @__PURE__ */ h(fr, { level: "error", feedback: s })
|
|
792
792
|
] });
|
|
793
|
-
},
|
|
793
|
+
}, Jn = ({
|
|
794
794
|
currentLanguage: r = "NL",
|
|
795
795
|
initialValue: e = "",
|
|
796
796
|
placeholder: t = "",
|
|
@@ -816,6 +816,6 @@ const Ve = 200, rn = ({
|
|
|
816
816
|
) });
|
|
817
817
|
export {
|
|
818
818
|
rn as Rte,
|
|
819
|
-
|
|
819
|
+
Jn as RteEditor
|
|
820
820
|
};
|
|
821
821
|
//# sourceMappingURL=RteEditor.js.map
|