@uva-glass/component-library 3.6.0 → 3.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Lexical.prod-CniF7zEE.js → Lexical.prod-CWyHQUEM.js} +738 -736
- package/dist/Lexical.prod-CWyHQUEM.js.map +1 -0
- package/dist/{LexicalClipboard.prod-BXVNkwwS.js → LexicalClipboard.prod-DbqSWANZ.js} +41 -41
- package/dist/{LexicalClipboard.prod-BXVNkwwS.js.map → LexicalClipboard.prod-DbqSWANZ.js.map} +1 -1
- package/dist/LexicalLink.prod-DbxnRszt.js +275 -0
- package/dist/LexicalLink.prod-DbxnRszt.js.map +1 -0
- package/dist/{LexicalList.prod-BUcoZhe4.js → LexicalList.prod-pZmYrwOC.js} +212 -172
- package/dist/LexicalList.prod-pZmYrwOC.js.map +1 -0
- package/dist/{LexicalSelection.prod-BfAlhGGm.js → LexicalSelection.prod-DkvWlcln.js} +14 -14
- package/dist/{LexicalSelection.prod-BfAlhGGm.js.map → LexicalSelection.prod-DkvWlcln.js.map} +1 -1
- package/dist/LexicalTable.prod-C6duSS2P.js +1720 -0
- package/dist/LexicalTable.prod-C6duSS2P.js.map +1 -0
- package/dist/{LexicalUtils.prod-DVr8VsHc.js → LexicalUtils.prod-Dny9Fu94.js} +43 -43
- package/dist/{LexicalUtils.prod-DVr8VsHc.js.map → LexicalUtils.prod-Dny9Fu94.js.map} +1 -1
- package/dist/{TablePlugin-MjKuocl4.js → TablePlugin-Ba6PaBhf.js} +28 -28
- package/dist/{TablePlugin-MjKuocl4.js.map → TablePlugin-Ba6PaBhf.js.map} +1 -1
- package/dist/components/Accordion/Accordion.test.js +2 -2
- package/dist/components/AccordionCard/AccordionCard.test.js +2 -2
- package/dist/components/ActionList/ActionList.test.js +2 -2
- package/dist/components/AppStatusBar/AppStatusBar.test.js +1 -1
- package/dist/components/Attention/Attention.test.js +1 -1
- package/dist/components/Backdrop/Backdrop.test.js +1 -1
- package/dist/components/Buttons/Button.test.js +1 -1
- package/dist/components/Buttons/LinkButton.test.js +1 -1
- package/dist/components/Buttons/MenuButton.test.js +1 -1
- package/dist/components/Card/Card.test.js +1 -1
- package/dist/components/Checkbox/Checkbox.test.js +1 -1
- package/dist/components/CheckboxButton/CheckboxButton.test.js +1 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
- package/dist/components/FeedbackBar/FeedbackBar.test.js +1 -1
- package/dist/components/FormInput/FormInput.js +1 -1
- package/dist/components/InputField/InputField.stories.js +1 -1
- package/dist/components/Label/Label.test.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/RadioGroup/Radiogroup.test.js +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +1 -1
- 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 +35 -35
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +25 -25
- package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +13 -13
- 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 +11 -11
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +7 -7
- package/dist/components/RteEditor/Plugins/index.js +1 -1
- package/dist/components/RteEditor/RteEditor.js +237 -235
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/RteEditor/helpers.js +4 -4
- package/dist/components/StatusBadge/StatusBadge.test.js +1 -1
- package/dist/components/TextArea/TextArea.test.js +1 -1
- package/dist/components/Timeline/Timeline.test.js +2 -2
- package/dist/components/VarIndicator/VarIndicator.test.js +2 -2
- package/dist/components/index.js +1 -1
- package/dist/{helpers-ChM6xtQG.js → helpers-BUwfVZhW.js} +15 -15
- package/dist/{helpers-ChM6xtQG.js.map → helpers-BUwfVZhW.js.map} +1 -1
- package/dist/{index-hwMTfLfH.js → index-Ck15_vKo.js} +2 -2
- package/dist/{index-hwMTfLfH.js.map → index-Ck15_vKo.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/{react.esm-DI5ilWeT.js → react.esm-CMg7bmSn.js} +372 -366
- package/dist/{react.esm-DI5ilWeT.js.map → react.esm-CMg7bmSn.js.map} +1 -1
- package/package.json +28 -28
- package/dist/Lexical.prod-CniF7zEE.js.map +0 -1
- package/dist/LexicalLink.prod-Du8ZoNsh.js +0 -259
- package/dist/LexicalLink.prod-Du8ZoNsh.js.map +0 -1
- package/dist/LexicalList.prod-BUcoZhe4.js.map +0 -1
- package/dist/LexicalTable.prod-CYafu_j9.js +0 -1555
- package/dist/LexicalTable.prod-CYafu_j9.js.map +0 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsx as h, jsxs as
|
|
2
|
-
import { t as
|
|
3
|
-
import { aF as
|
|
4
|
-
import * as
|
|
5
|
-
import { useMemo as
|
|
6
|
-
import { j
|
|
7
|
-
import { flushSync as
|
|
8
|
-
import { D as
|
|
9
|
-
import { W as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { a as
|
|
14
|
-
import { c as
|
|
15
|
-
import { exportMap as
|
|
1
|
+
import { jsx as h, jsxs as K, Fragment as Te } from "react/jsx-runtime";
|
|
2
|
+
import { t as qe, r as Ve, o as P } from "../../LexicalComposerContext.prod-DLlRM5wP.js";
|
|
3
|
+
import { aF as Pe, af as z, T as Re, a as p, am as W, d as J, w as Ge, Y as M, c as g, S as Xe, N as m, aG as Ye, ae as Ie, o as Qe, r as Me, aH as Ze, O as et, u as T, aC as tt, aI as nt, aJ as rt, aK as ot, i as te, aL as it, aM as st, a1 as at, C as lt, g as ut, L as ct, aN as dt, aO as de, b as fe, K as ft, D as ne, I as mt, a2 as Oe, aP as me, y as pt, x as gt, t as ht, aQ as pe, v as Ct, aR as yt, aS as Et, aT as wt, aB as vt, Q as bt, P as St, aU as _t, R as kt, B as xt, A as Nt, j as Lt, E as ge, aV as Dt, e as $t, ar as X, aq as Y, aW as Tt, aX as Pt, at as Rt, as as It } from "../../Lexical.prod-CWyHQUEM.js";
|
|
4
|
+
import * as re from "react";
|
|
5
|
+
import { useMemo as q, useLayoutEffect as U, useEffect as _, useState as O, useRef as Fe, Suspense as Mt, forwardRef as Ke, useCallback as Ot } from "react";
|
|
6
|
+
import { j, L as A, y as Ft, w as ce } from "../../LexicalUtils.prod-Dny9Fu94.js";
|
|
7
|
+
import { flushSync as Kt, createPortal as At } from "react-dom";
|
|
8
|
+
import { D as he, _ as Ce, h as zt, m as Bt } from "../../LexicalClipboard.prod-DbqSWANZ.js";
|
|
9
|
+
import { W as ye, G as Ee } from "../../LexicalSelection.prod-DkvWlcln.js";
|
|
10
|
+
import { r as Ae, G as ze, v as Ut, T as jt } from "../../LexicalList.prod-pZmYrwOC.js";
|
|
11
|
+
import { g as Be, k as we, N as oe, p as Ht, m as Wt } from "../../LexicalLink.prod-DbxnRszt.js";
|
|
12
|
+
import { c as Jt, b as qt, w as Vt, S as Gt, y as Ue, O as Xt, a as Yt } from "../../LexicalTable.prod-C6duSS2P.js";
|
|
13
|
+
import { a as Qt, w as Zt, M as en } from "../../helpers-BUwfVZhW.js";
|
|
14
|
+
import { c as tn } from "../../clsx-OuTLNxxd.js";
|
|
15
|
+
import { exportMap as nn, isStartingWithHtmlTag as rn, mergeBoldStrongTags as on } from "./helpers.js";
|
|
16
16
|
import { s as I } from "../../RteEditor.module-oFMKEW6f.js";
|
|
17
|
-
import { ToolBarPlugin as
|
|
18
|
-
import { useTranslation as
|
|
19
|
-
import "../../TablePlugin-
|
|
17
|
+
import { ToolBarPlugin as sn } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
|
|
18
|
+
import { useTranslation as an } from "./hooks/useTranslation.js";
|
|
19
|
+
import "../../TablePlugin-Ba6PaBhf.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 ln } from "../FeedbackBox/FeedbackBox.js";
|
|
31
31
|
import "../GridRow/GridRow.js";
|
|
32
32
|
import "../IconButton/IconButton.js";
|
|
33
33
|
import "../Input/Input.js";
|
|
@@ -37,14 +37,14 @@ import "../SelectListbox/SelectListbox.js";
|
|
|
37
37
|
import "../SelectListbox/SelectProvider.js";
|
|
38
38
|
import "../Sortable/components/SortableItem.js";
|
|
39
39
|
import "../../SortableProvider-Ck_XnBVq.js";
|
|
40
|
-
import { UvaTheme as
|
|
41
|
-
import { EditorHeader as
|
|
42
|
-
import { LanguageProvider as
|
|
43
|
-
import { PasteHandlerPlugin as
|
|
44
|
-
const
|
|
45
|
-
function
|
|
46
|
-
const t =
|
|
47
|
-
const { theme: o, namespace: i, nodes: r, onError: s, editorState: a, html: l } = n, u =
|
|
40
|
+
import { UvaTheme as un } from "./UvaTheme/UvaTheme.js";
|
|
41
|
+
import { EditorHeader as cn } from "./EditorHeader/EditorHeader.js";
|
|
42
|
+
import { LanguageProvider as dn, useLanguage as fn } from "./Providers/LanguageProvider.js";
|
|
43
|
+
import { PasteHandlerPlugin as mn } from "./Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js";
|
|
44
|
+
const je = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, pn = je ? U : _, Q = { tag: "history-merge" };
|
|
45
|
+
function gn({ initialConfig: n, children: e }) {
|
|
46
|
+
const t = q(() => {
|
|
47
|
+
const { theme: o, namespace: i, nodes: r, onError: s, editorState: a, html: l } = n, u = qe(null, o), c = Pe({ editable: n.editable, html: l, namespace: i, nodes: r, 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(() => {
|
|
@@ -52,7 +52,7 @@ function pn({ initialConfig: n, children: e }) {
|
|
|
52
52
|
if (C.isEmpty()) {
|
|
53
53
|
const y = Re();
|
|
54
54
|
C.append(y);
|
|
55
|
-
const v =
|
|
55
|
+
const v = je ? document.activeElement : null;
|
|
56
56
|
(p() !== null || v !== null && v === d.getRootElement()) && y.select();
|
|
57
57
|
}
|
|
58
58
|
}, Q);
|
|
@@ -73,43 +73,43 @@ function pn({ initialConfig: n, children: e }) {
|
|
|
73
73
|
}
|
|
74
74
|
}(c, a), [c, u];
|
|
75
75
|
}, []);
|
|
76
|
-
return
|
|
76
|
+
return pn(() => {
|
|
77
77
|
const o = n.editable, [i] = t;
|
|
78
78
|
i.setEditable(o === void 0 || o);
|
|
79
79
|
}, []), h(Ve.Provider, { value: t, children: e });
|
|
80
80
|
}
|
|
81
|
-
const
|
|
82
|
-
function
|
|
81
|
+
const hn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U : _;
|
|
82
|
+
function Cn(n) {
|
|
83
83
|
return { initialValueFn: () => n.isEditable(), subscribe: (e) => n.registerEditableListener(e) };
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function yn() {
|
|
86
86
|
return function(n) {
|
|
87
|
-
const [e] =
|
|
88
|
-
return
|
|
87
|
+
const [e] = P(), t = q(() => n(e), [e, n]), [o, i] = O(() => t.initialValueFn()), r = Fe(o);
|
|
88
|
+
return hn(() => {
|
|
89
89
|
const { initialValueFn: s, subscribe: a } = t, l = s();
|
|
90
90
|
return r.current !== l && (r.current = l, i(l)), a((u) => {
|
|
91
91
|
r.current = u, i(u);
|
|
92
92
|
});
|
|
93
93
|
}, [t, n]), o;
|
|
94
|
-
}(
|
|
94
|
+
}(Cn);
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function En() {
|
|
97
97
|
return z().getTextContent();
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function wn(n, e = !0) {
|
|
100
100
|
if (n) return !1;
|
|
101
|
-
let t =
|
|
101
|
+
let t = En();
|
|
102
102
|
return e && (t = t.trim()), t === "";
|
|
103
103
|
}
|
|
104
|
-
function
|
|
105
|
-
if (!
|
|
104
|
+
function vn(n) {
|
|
105
|
+
if (!wn(n, !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 i = e[o];
|
|
110
110
|
if (W(i)) return !1;
|
|
111
|
-
if (
|
|
112
|
-
if (!
|
|
111
|
+
if (J(i)) {
|
|
112
|
+
if (!Ge(i) || i.__indent !== 0) return !1;
|
|
113
113
|
const r = i.getChildren(), s = r.length;
|
|
114
114
|
for (let a = 0; a < s; a++) {
|
|
115
115
|
const l = r[o];
|
|
@@ -120,9 +120,9 @@ function wn(n) {
|
|
|
120
120
|
return !0;
|
|
121
121
|
}
|
|
122
122
|
function He(n) {
|
|
123
|
-
return () =>
|
|
123
|
+
return () => vn(n);
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function bn(n) {
|
|
126
126
|
const e = window.location.origin, t = (o) => {
|
|
127
127
|
if (o.origin !== e) return;
|
|
128
128
|
const i = n.getRootElement();
|
|
@@ -163,7 +163,7 @@ function vn(n) {
|
|
|
163
163
|
window.removeEventListener("message", t, !0);
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function ve(n, e) {
|
|
167
167
|
if (document.caretRangeFromPoint !== void 0) {
|
|
168
168
|
const t = document.caretRangeFromPoint(n, e);
|
|
169
169
|
return t === null ? null : { node: t.startContainer, offset: t.startOffset };
|
|
@@ -174,41 +174,41 @@ function be(n, e) {
|
|
|
174
174
|
}
|
|
175
175
|
return null;
|
|
176
176
|
}
|
|
177
|
-
const H = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0,
|
|
177
|
+
const H = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Sn = H && "documentMode" in document ? document.documentMode : null, _n = !(!H || !("InputEvent" in window) || Sn) && "getTargetRanges" in new window.InputEvent("input"), kn = H && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), be = H && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, xn = H && /^(?=.*Chrome).*/i.test(navigator.userAgent), Nn = H && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !xn, Se = Qe();
|
|
178
178
|
function Z(n) {
|
|
179
179
|
let e = null;
|
|
180
180
|
if (A(n, DragEvent) ? e = n.dataTransfer : A(n, ClipboardEvent) && (e = n.clipboardData), e === null) return [!1, [], !1];
|
|
181
181
|
const t = e.types, o = t.includes("Files"), i = t.includes("text/html") || t.includes("text/plain");
|
|
182
182
|
return [o, Array.from(e.files), i];
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function _e(n) {
|
|
185
185
|
const e = p();
|
|
186
186
|
if (!g(e)) return !1;
|
|
187
187
|
const t = /* @__PURE__ */ new Set(), o = e.getNodes();
|
|
188
188
|
for (let i = 0; i < o.length; i++) {
|
|
189
189
|
const r = o[i], s = r.getKey();
|
|
190
190
|
if (t.has(s)) continue;
|
|
191
|
-
const a =
|
|
191
|
+
const a = ce(r, (u) => J(u) && !u.isInline());
|
|
192
192
|
if (a === null) continue;
|
|
193
193
|
const l = a.getKey();
|
|
194
194
|
a.canIndent() && !t.has(l) && (t.add(l), n(a));
|
|
195
195
|
}
|
|
196
196
|
return t.size > 0;
|
|
197
197
|
}
|
|
198
|
-
function
|
|
199
|
-
const e =
|
|
198
|
+
function ke(n) {
|
|
199
|
+
const e = te(n);
|
|
200
200
|
return W(e);
|
|
201
201
|
}
|
|
202
|
-
function
|
|
202
|
+
function ie(n) {
|
|
203
203
|
for (const e of ["lowercase", "uppercase", "capitalize"]) n.hasFormat(e) && n.toggleFormat(e);
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
return
|
|
205
|
+
function Ln(n) {
|
|
206
|
+
return j(n.registerCommand(Lt, (e) => {
|
|
207
207
|
const t = p();
|
|
208
|
-
return !!
|
|
209
|
-
}, 0), n.registerCommand(
|
|
208
|
+
return !!T(t) && (t.clear(), !0);
|
|
209
|
+
}, 0), n.registerCommand(ne, (e) => {
|
|
210
210
|
const t = p();
|
|
211
|
-
return g(t) ? (t.deleteCharacter(e), !0) : !!
|
|
211
|
+
return g(t) ? (t.deleteCharacter(e), !0) : !!T(t) && (t.deleteNodes(), !0);
|
|
212
212
|
}, m), n.registerCommand(Nt, (e) => {
|
|
213
213
|
const t = p();
|
|
214
214
|
return !!g(t) && (t.deleteWord(e), !0);
|
|
@@ -221,7 +221,7 @@ function Nn(n) {
|
|
|
221
221
|
else {
|
|
222
222
|
if (t === null) return !1;
|
|
223
223
|
const o = e.dataTransfer;
|
|
224
|
-
if (o != null)
|
|
224
|
+
if (o != null) he(o, t, n);
|
|
225
225
|
else if (g(t)) {
|
|
226
226
|
const i = e.data;
|
|
227
227
|
return i && t.insertText(i), !0;
|
|
@@ -236,38 +236,38 @@ function Nn(n) {
|
|
|
236
236
|
return !!g(t) && (t.formatText(e), !0);
|
|
237
237
|
}, m), n.registerCommand(bt, (e) => {
|
|
238
238
|
const t = p();
|
|
239
|
-
if (!g(t) && !
|
|
239
|
+
if (!g(t) && !T(t)) return !1;
|
|
240
240
|
const o = t.getNodes();
|
|
241
241
|
for (const i of o) {
|
|
242
|
-
const r =
|
|
242
|
+
const r = ce(i, (s) => J(s) && !s.isInline());
|
|
243
243
|
r !== null && r.setFormat(e);
|
|
244
244
|
}
|
|
245
245
|
return !0;
|
|
246
|
-
}, m), n.registerCommand(
|
|
246
|
+
}, m), n.registerCommand(de, (e) => {
|
|
247
247
|
const t = p();
|
|
248
248
|
return !!g(t) && (t.insertLineBreak(e), !0);
|
|
249
|
-
}, m), n.registerCommand(
|
|
249
|
+
}, m), n.registerCommand(fe, () => {
|
|
250
250
|
const e = p();
|
|
251
251
|
return !!g(e) && (e.insertParagraph(), !0);
|
|
252
|
-
}, m), n.registerCommand(Et, () => (wt([vt()]), !0), m), n.registerCommand(yt, () =>
|
|
252
|
+
}, m), n.registerCommand(Et, () => (wt([vt()]), !0), m), n.registerCommand(yt, () => _e((e) => {
|
|
253
253
|
const t = e.getIndent();
|
|
254
254
|
e.setIndent(t + 1);
|
|
255
|
-
}), m), n.registerCommand(
|
|
255
|
+
}), m), n.registerCommand(me, () => _e((e) => {
|
|
256
256
|
const t = e.getIndent();
|
|
257
|
-
t > 0 && e.setIndent(t - 1);
|
|
257
|
+
t > 0 && e.setIndent(Math.max(0, t - 1));
|
|
258
258
|
}), m), n.registerCommand(Ct, (e) => {
|
|
259
259
|
const t = p();
|
|
260
|
-
if (
|
|
260
|
+
if (T(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
|
-
const o =
|
|
264
|
+
const o = pe(t.focus, !0);
|
|
265
265
|
if (!e.shiftKey && W(o) && !o.isIsolated() && !o.isInline()) return o.selectPrevious(), e.preventDefault(), !0;
|
|
266
266
|
}
|
|
267
267
|
return !1;
|
|
268
268
|
}, m), n.registerCommand(ht, (e) => {
|
|
269
269
|
const t = p();
|
|
270
|
-
if (
|
|
270
|
+
if (T(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)) {
|
|
@@ -275,62 +275,62 @@ function Nn(n) {
|
|
|
275
275
|
const r = i.focus;
|
|
276
276
|
return r.key === "root" && r.offset === z().getChildrenSize();
|
|
277
277
|
}(t)) return e.preventDefault(), !0;
|
|
278
|
-
const o =
|
|
278
|
+
const o = pe(t.focus, !1);
|
|
279
279
|
if (!e.shiftKey && W(o) && !o.isIsolated() && !o.isInline()) return o.selectNext(), e.preventDefault(), !0;
|
|
280
280
|
}
|
|
281
281
|
return !1;
|
|
282
282
|
}, m), n.registerCommand(gt, (e) => {
|
|
283
283
|
const t = p();
|
|
284
|
-
if (
|
|
284
|
+
if (T(t)) {
|
|
285
285
|
const o = t.getNodes();
|
|
286
286
|
if (o.length > 0) return e.preventDefault(), o[0].selectPrevious(), !0;
|
|
287
287
|
}
|
|
288
288
|
if (!g(t)) return !1;
|
|
289
|
-
if (
|
|
289
|
+
if (ye(t, !0)) {
|
|
290
290
|
const o = e.shiftKey;
|
|
291
|
-
return e.preventDefault(),
|
|
291
|
+
return e.preventDefault(), Ee(t, o, !0), !0;
|
|
292
292
|
}
|
|
293
293
|
return !1;
|
|
294
294
|
}, m), n.registerCommand(pt, (e) => {
|
|
295
295
|
const t = p();
|
|
296
|
-
if (
|
|
296
|
+
if (T(t)) {
|
|
297
297
|
const i = t.getNodes();
|
|
298
298
|
if (i.length > 0) return e.preventDefault(), i[0].selectNext(0, 0), !0;
|
|
299
299
|
}
|
|
300
300
|
if (!g(t)) return !1;
|
|
301
301
|
const o = e.shiftKey;
|
|
302
|
-
return !!
|
|
302
|
+
return !!ye(t, !1) && (e.preventDefault(), Ee(t, o, !1), !0);
|
|
303
303
|
}, m), n.registerCommand(mt, (e) => {
|
|
304
|
-
if (
|
|
304
|
+
if (ke(e.target)) return !1;
|
|
305
305
|
const t = p();
|
|
306
306
|
if (g(t)) {
|
|
307
307
|
const { anchor: o } = t, i = o.getNode();
|
|
308
|
-
if (t.isCollapsed() && o.offset === 0 && !Oe(i) &&
|
|
309
|
-
return e.preventDefault(), n.dispatchCommand(
|
|
310
|
-
if (
|
|
311
|
-
} else if (!
|
|
312
|
-
return e.preventDefault(), n.dispatchCommand(
|
|
308
|
+
if (t.isCollapsed() && o.offset === 0 && !Oe(i) && Ft(i).getIndent() > 0)
|
|
309
|
+
return e.preventDefault(), n.dispatchCommand(me, void 0);
|
|
310
|
+
if (be && navigator.language === "ko-KR") return !1;
|
|
311
|
+
} else if (!T(t)) return !1;
|
|
312
|
+
return e.preventDefault(), n.dispatchCommand(ne, !0);
|
|
313
313
|
}, m), n.registerCommand(ft, (e) => {
|
|
314
|
-
if (
|
|
314
|
+
if (ke(e.target)) return !1;
|
|
315
315
|
const t = p();
|
|
316
|
-
return !(!g(t) && !
|
|
316
|
+
return !(!g(t) && !T(t)) && (e.preventDefault(), n.dispatchCommand(ne, !1));
|
|
317
317
|
}, m), n.registerCommand(dt, (e) => {
|
|
318
318
|
const t = p();
|
|
319
319
|
if (!g(t)) return !1;
|
|
320
|
-
if (
|
|
321
|
-
if ((
|
|
322
|
-
if (e.preventDefault(), e.shiftKey) return n.dispatchCommand(
|
|
320
|
+
if (ie(t), e !== null) {
|
|
321
|
+
if ((be || kn || Nn) && _n) return !1;
|
|
322
|
+
if (e.preventDefault(), e.shiftKey) return n.dispatchCommand(de, !1);
|
|
323
323
|
}
|
|
324
|
-
return n.dispatchCommand(
|
|
324
|
+
return n.dispatchCommand(fe, void 0);
|
|
325
325
|
}, m), n.registerCommand(ct, () => {
|
|
326
326
|
const e = p();
|
|
327
327
|
return !!g(e) && (n.blur(), !0);
|
|
328
328
|
}, m), n.registerCommand(st, (e) => {
|
|
329
329
|
const [, t] = Z(e);
|
|
330
330
|
if (t.length > 0) {
|
|
331
|
-
const i =
|
|
331
|
+
const i = ve(e.clientX, e.clientY);
|
|
332
332
|
if (i !== null) {
|
|
333
|
-
const { offset: r, node: s } = i, a =
|
|
333
|
+
const { offset: r, node: s } = i, a = te(s);
|
|
334
334
|
if (a !== null) {
|
|
335
335
|
const l = at();
|
|
336
336
|
if (M(a)) l.anchor.set(a.getKey(), r, "text"), l.focus.set(a.getKey(), r, "text");
|
|
@@ -341,7 +341,7 @@ function Nn(n) {
|
|
|
341
341
|
const u = lt(l);
|
|
342
342
|
ut(u);
|
|
343
343
|
}
|
|
344
|
-
n.dispatchCommand(
|
|
344
|
+
n.dispatchCommand(Se, t);
|
|
345
345
|
}
|
|
346
346
|
return e.preventDefault(), !0;
|
|
347
347
|
}
|
|
@@ -353,47 +353,47 @@ function Nn(n) {
|
|
|
353
353
|
}, m), n.registerCommand(ot, (e) => {
|
|
354
354
|
const [t] = Z(e), o = p();
|
|
355
355
|
if (t && !g(o)) return !1;
|
|
356
|
-
const i =
|
|
356
|
+
const i = ve(e.clientX, e.clientY);
|
|
357
357
|
if (i !== null) {
|
|
358
|
-
const r =
|
|
358
|
+
const r = te(i.node);
|
|
359
359
|
W(r) && e.preventDefault();
|
|
360
360
|
}
|
|
361
361
|
return !0;
|
|
362
|
-
}, m), n.registerCommand(nt, () => (rt(), !0), m), n.registerCommand(tt, (e) => (
|
|
363
|
-
await
|
|
362
|
+
}, m), n.registerCommand(nt, () => (rt(), !0), m), n.registerCommand(tt, (e) => (Ce(n, A(e, ClipboardEvent) ? e : null), !0), m), n.registerCommand(et, (e) => (async function(t, o) {
|
|
363
|
+
await Ce(o, A(t, ClipboardEvent) ? t : null), o.update(() => {
|
|
364
364
|
const i = p();
|
|
365
|
-
g(i) ? i.removeText() :
|
|
365
|
+
g(i) ? i.removeText() : T(i) && i.getNodes().forEach((r) => r.remove());
|
|
366
366
|
});
|
|
367
367
|
}(e, n), !0), m), n.registerCommand(Ie, (e) => {
|
|
368
368
|
const [, t, o] = Z(e);
|
|
369
|
-
return t.length > 0 && !o ? (n.dispatchCommand(
|
|
369
|
+
return t.length > 0 && !o ? (n.dispatchCommand(Se, t), !0) : Me(e.target) && Ze(e.target) ? !1 : p() !== null && (function(i, r) {
|
|
370
370
|
i.preventDefault(), r.update(() => {
|
|
371
371
|
const s = p(), a = A(i, InputEvent) || A(i, KeyboardEvent) ? null : i.clipboardData;
|
|
372
|
-
a != null && s !== null &&
|
|
372
|
+
a != null && s !== null && he(a, s, r);
|
|
373
373
|
}, { tag: "paste" });
|
|
374
374
|
}(e, n), !0);
|
|
375
|
-
}, m), n.registerCommand(Ge, (e) => {
|
|
376
|
-
const t = p();
|
|
377
|
-
return g(t) && se(t), !1;
|
|
378
375
|
}, m), n.registerCommand(Ye, (e) => {
|
|
379
376
|
const t = p();
|
|
380
|
-
return g(t) &&
|
|
377
|
+
return g(t) && ie(t), !1;
|
|
378
|
+
}, m), n.registerCommand(Xe, (e) => {
|
|
379
|
+
const t = p();
|
|
380
|
+
return g(t) && ie(t), !1;
|
|
381
381
|
}, m));
|
|
382
382
|
}
|
|
383
|
-
const
|
|
383
|
+
const se = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U : _;
|
|
384
384
|
function xe(n) {
|
|
385
385
|
return n.getEditorState().read(He(n.isComposing()));
|
|
386
386
|
}
|
|
387
|
-
function
|
|
388
|
-
const [o] =
|
|
387
|
+
function Dn({ contentEditable: n, placeholder: e = null, ErrorBoundary: t }) {
|
|
388
|
+
const [o] = P(), i = function(r, s) {
|
|
389
389
|
const [a, l] = O(() => r.getDecorators());
|
|
390
|
-
return
|
|
391
|
-
|
|
390
|
+
return se(() => r.registerDecoratorListener((u) => {
|
|
391
|
+
Kt(() => {
|
|
392
392
|
l(u);
|
|
393
393
|
});
|
|
394
|
-
}), [r]),
|
|
394
|
+
}), [r]), _(() => {
|
|
395
395
|
l(r.getDecorators());
|
|
396
|
-
}, [r]),
|
|
396
|
+
}, [r]), q(() => {
|
|
397
397
|
const u = [], c = Object.keys(a);
|
|
398
398
|
for (let d = 0; d < c.length; d++) {
|
|
399
399
|
const f = c[d], C = h(s, { onError: (v) => r._onError(v), children: h(Mt, { fallback: null, children: a[f] }) }), y = r.getElementByKey(f);
|
|
@@ -403,51 +403,51 @@ function Ln({ contentEditable: n, placeholder: e = null, ErrorBoundary: t }) {
|
|
|
403
403
|
}, [s, a, r]);
|
|
404
404
|
}(o, t);
|
|
405
405
|
return function(r) {
|
|
406
|
-
|
|
407
|
-
}(o),
|
|
406
|
+
se(() => j(Ln(r), bn(r)), [r]);
|
|
407
|
+
}(o), K(Te, { children: [n, h($n, { content: e }), i] });
|
|
408
408
|
}
|
|
409
|
-
function
|
|
410
|
-
const [e] =
|
|
409
|
+
function $n({ content: n }) {
|
|
410
|
+
const [e] = P(), t = function(i) {
|
|
411
411
|
const [r, s] = O(() => xe(i));
|
|
412
|
-
return
|
|
412
|
+
return se(() => {
|
|
413
413
|
function a() {
|
|
414
414
|
const l = xe(i);
|
|
415
415
|
s(l);
|
|
416
416
|
}
|
|
417
|
-
return a(),
|
|
417
|
+
return a(), j(i.registerUpdateListener(() => {
|
|
418
418
|
a();
|
|
419
419
|
}), i.registerEditableListener(() => {
|
|
420
420
|
a();
|
|
421
421
|
}));
|
|
422
422
|
}, [i]), r;
|
|
423
|
-
}(e), o =
|
|
423
|
+
}(e), o = yn();
|
|
424
424
|
return t ? typeof n == "function" ? n(o) : n : null;
|
|
425
425
|
}
|
|
426
|
-
const We = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ?
|
|
427
|
-
function
|
|
428
|
-
const [
|
|
426
|
+
const We = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U : _;
|
|
427
|
+
function Tn({ editor: n, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: o, ariaDescribedBy: i, ariaErrorMessage: r, ariaExpanded: s, ariaInvalid: a, ariaLabel: l, ariaLabelledBy: u, ariaMultiline: c, ariaOwns: d, ariaRequired: f, autoCapitalize: C, className: y, id: v, role: x = "textbox", spellCheck: E = !0, style: w, tabIndex: S, "data-testid": N, ...b }, L) {
|
|
428
|
+
const [k, R] = O(n.isEditable()), F = Ot((D) => {
|
|
429
429
|
D && D.ownerDocument && D.ownerDocument.defaultView ? n.setRootElement(D) : n.setRootElement(null);
|
|
430
|
-
}, [n]), B =
|
|
430
|
+
}, [n]), B = q(() => /* @__PURE__ */ function(...D) {
|
|
431
431
|
return (V) => {
|
|
432
|
-
D.forEach((
|
|
433
|
-
typeof
|
|
432
|
+
D.forEach((G) => {
|
|
433
|
+
typeof G == "function" ? G(V) : G != null && (G.current = V);
|
|
434
434
|
});
|
|
435
435
|
};
|
|
436
|
-
}(L,
|
|
436
|
+
}(L, F), [F, L]);
|
|
437
437
|
return We(() => (R(n.isEditable()), n.registerEditableListener((D) => {
|
|
438
438
|
R(D);
|
|
439
|
-
})), [n]), h("div", { "aria-activedescendant":
|
|
439
|
+
})), [n]), h("div", { "aria-activedescendant": k ? e : void 0, "aria-autocomplete": k ? t : "none", "aria-controls": k ? o : void 0, "aria-describedby": i, ...r != null ? { "aria-errormessage": r } : {}, "aria-expanded": k && x === "combobox" ? !!s : void 0, ...a != null ? { "aria-invalid": a } : {}, "aria-label": l, "aria-labelledby": u, "aria-multiline": c, "aria-owns": k ? d : void 0, "aria-readonly": !k || void 0, "aria-required": f, autoCapitalize: C, className: y, contentEditable: k, "data-testid": N, id: v, ref: B, role: k ? x : void 0, spellCheck: E, style: w, tabIndex: S, ...b });
|
|
440
440
|
}
|
|
441
|
-
const Pn =
|
|
441
|
+
const Pn = Ke(Tn);
|
|
442
442
|
function Ne(n) {
|
|
443
443
|
return n.getEditorState().read(He(n.isComposing()));
|
|
444
444
|
}
|
|
445
|
-
const
|
|
446
|
-
function
|
|
447
|
-
const { placeholder: t, ...o } = n, [i] =
|
|
448
|
-
return
|
|
445
|
+
const Rn = Ke(In);
|
|
446
|
+
function In(n, e) {
|
|
447
|
+
const { placeholder: t, ...o } = n, [i] = P();
|
|
448
|
+
return K(Te, { children: [h(Pn, { editor: i, ...o, ref: e }), t != null && h(Mn, { editor: i, content: t })] });
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function Mn({ content: n, editor: e }) {
|
|
451
451
|
const t = function(s) {
|
|
452
452
|
const [a, l] = O(() => Ne(s));
|
|
453
453
|
return We(() => {
|
|
@@ -455,25 +455,25 @@ function In({ content: n, editor: e }) {
|
|
|
455
455
|
const c = Ne(s);
|
|
456
456
|
l(c);
|
|
457
457
|
}
|
|
458
|
-
return u(),
|
|
458
|
+
return u(), j(s.registerUpdateListener(() => {
|
|
459
459
|
u();
|
|
460
460
|
}), s.registerEditableListener(() => {
|
|
461
461
|
u();
|
|
462
462
|
}));
|
|
463
463
|
}, [s]), a;
|
|
464
464
|
}(e), [o, i] = O(e.isEditable());
|
|
465
|
-
if (
|
|
465
|
+
if (U(() => (i(e.isEditable()), e.registerEditableListener((s) => {
|
|
466
466
|
i(s);
|
|
467
467
|
})), [e]), !t) return null;
|
|
468
468
|
let r = null;
|
|
469
469
|
return typeof n == "function" ? r = n(o) : n !== null && (r = n), r === null ? null : h("div", { "aria-hidden": !0, children: r });
|
|
470
470
|
}
|
|
471
|
-
function
|
|
472
|
-
return
|
|
471
|
+
function ae(n, e) {
|
|
472
|
+
return ae = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, o) {
|
|
473
473
|
return t.__proto__ = o, t;
|
|
474
|
-
},
|
|
474
|
+
}, ae(n, e);
|
|
475
475
|
}
|
|
476
|
-
var Le = { error: null },
|
|
476
|
+
var Le = { error: null }, On = function(n) {
|
|
477
477
|
var e, t;
|
|
478
478
|
function o() {
|
|
479
479
|
for (var r, s = arguments.length, a = new Array(s), l = 0; l < s; l++) a[l] = arguments[l];
|
|
@@ -482,7 +482,7 @@ var Le = { error: null }, Mn = function(n) {
|
|
|
482
482
|
r.props.onReset == null || (u = r.props).onReset.apply(u, d), r.reset();
|
|
483
483
|
}, r;
|
|
484
484
|
}
|
|
485
|
-
t = n, (e = o).prototype = Object.create(t.prototype), e.prototype.constructor = e,
|
|
485
|
+
t = n, (e = o).prototype = Object.create(t.prototype), e.prototype.constructor = e, ae(e, t), o.getDerivedStateFromError = function(r) {
|
|
486
486
|
return { error: r };
|
|
487
487
|
};
|
|
488
488
|
var i = o.prototype;
|
|
@@ -500,57 +500,59 @@ var Le = { error: null }, Mn = function(n) {
|
|
|
500
500
|
var r = this.state.error, s = this.props, a = s.fallbackRender, l = s.FallbackComponent, u = s.fallback;
|
|
501
501
|
if (r !== null) {
|
|
502
502
|
var c = { error: r, resetErrorBoundary: this.resetErrorBoundary };
|
|
503
|
-
if (
|
|
503
|
+
if (re.isValidElement(u)) return u;
|
|
504
504
|
if (typeof a == "function") return a(c);
|
|
505
|
-
if (l) return
|
|
505
|
+
if (l) return re.createElement(l, c);
|
|
506
506
|
throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop");
|
|
507
507
|
}
|
|
508
508
|
return this.props.children;
|
|
509
509
|
}, o;
|
|
510
|
-
}(
|
|
511
|
-
function
|
|
512
|
-
return h(
|
|
510
|
+
}(re.Component);
|
|
511
|
+
function Fn({ children: n, onError: e }) {
|
|
512
|
+
return h(On, { fallback: h("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: n });
|
|
513
513
|
}
|
|
514
|
-
const Kn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ?
|
|
515
|
-
function
|
|
516
|
-
const [o] =
|
|
514
|
+
const Kn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? U : _;
|
|
515
|
+
function An({ ignoreHistoryMergeTagChange: n = !0, ignoreSelectionChange: e = !1, onChange: t }) {
|
|
516
|
+
const [o] = P();
|
|
517
517
|
return Kn(() => {
|
|
518
518
|
if (t) return o.registerUpdateListener(({ editorState: i, dirtyElements: r, dirtyLeaves: s, prevEditorState: a, tags: l }) => {
|
|
519
519
|
e && r.size === 0 && s.size === 0 || n && l.has("history-merge") || a.isEmpty() || t(i, o, l);
|
|
520
520
|
});
|
|
521
521
|
}, [o, n, e, t]), null;
|
|
522
522
|
}
|
|
523
|
-
function
|
|
524
|
-
const [
|
|
525
|
-
return
|
|
526
|
-
if (!
|
|
527
|
-
}, [
|
|
528
|
-
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
523
|
+
function zn({ hasStrictIndent: n = !1 }) {
|
|
524
|
+
const [e] = P();
|
|
525
|
+
return _(() => {
|
|
526
|
+
if (!e.hasNodes([Ae, ze])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
|
|
527
|
+
}, [e]), _(() => {
|
|
528
|
+
if (n) return Ut(e);
|
|
529
|
+
}, [e, n]), function(t) {
|
|
530
|
+
_(() => jt(t), [t]);
|
|
531
|
+
}(e), null;
|
|
532
|
+
}
|
|
533
|
+
function Bn({ validateUrl: n, attributes: e }) {
|
|
534
|
+
const [t] = P();
|
|
535
|
+
return _(() => {
|
|
534
536
|
if (!t.hasNodes([Be])) throw new Error("LinkPlugin: LinkNode not registered on editor");
|
|
535
|
-
return
|
|
536
|
-
if (o === null) return
|
|
537
|
-
if (typeof o == "string") return !(n !== void 0 && !n(o)) && (
|
|
537
|
+
return j(t.registerCommand(we, (o) => {
|
|
538
|
+
if (o === null) return oe(o), !0;
|
|
539
|
+
if (typeof o == "string") return !(n !== void 0 && !n(o)) && (oe(o, e), !0);
|
|
538
540
|
{
|
|
539
541
|
const { url: i, target: r, rel: s, title: a } = o;
|
|
540
|
-
return
|
|
542
|
+
return oe(i, { ...e, rel: s, target: r, title: a }), !0;
|
|
541
543
|
}
|
|
542
|
-
},
|
|
544
|
+
}, ge), n !== void 0 ? t.registerCommand(Ie, (o) => {
|
|
543
545
|
const i = p();
|
|
544
546
|
if (!g(i) || i.isCollapsed() || !A(o, ClipboardEvent) || o.clipboardData === null) return !1;
|
|
545
547
|
const r = o.clipboardData.getData("text");
|
|
546
|
-
return !!n(r) && !i.getNodes().some((s) =>
|
|
547
|
-
},
|
|
548
|
+
return !!n(r) && !i.getNodes().some((s) => J(s)) && (t.dispatchCommand(we, { ...e, url: r }), o.preventDefault(), !0);
|
|
549
|
+
}, ge) : () => {
|
|
548
550
|
});
|
|
549
551
|
}, [t, n, e]), null;
|
|
550
552
|
}
|
|
551
|
-
function
|
|
552
|
-
const [t] =
|
|
553
|
-
return
|
|
553
|
+
function Un({ newTab: n = !0, disabled: e = !1 }) {
|
|
554
|
+
const [t] = P();
|
|
555
|
+
return _(() => {
|
|
554
556
|
const o = (r) => {
|
|
555
557
|
const s = r.target;
|
|
556
558
|
if (!Me(s)) return;
|
|
@@ -558,10 +560,10 @@ function Bn({ newTab: n = !0, disabled: e = !1 }) {
|
|
|
558
560
|
if (a === null) return;
|
|
559
561
|
let l = null, u = null;
|
|
560
562
|
if (a.update(() => {
|
|
561
|
-
const f =
|
|
563
|
+
const f = te(s);
|
|
562
564
|
if (f !== null) {
|
|
563
|
-
const C =
|
|
564
|
-
if (!e) if (
|
|
565
|
+
const C = ce(f, J);
|
|
566
|
+
if (!e) if (Ht(C)) l = C.sanitizeUrl(C.getURL()), u = C.getTarget();
|
|
565
567
|
else {
|
|
566
568
|
const y = function(v, x) {
|
|
567
569
|
let E = v;
|
|
@@ -587,8 +589,8 @@ function Bn({ newTab: n = !0, disabled: e = !1 }) {
|
|
|
587
589
|
});
|
|
588
590
|
}, [t, n, e]), null;
|
|
589
591
|
}
|
|
590
|
-
const
|
|
591
|
-
function
|
|
592
|
+
const ee = 0, le = 1, ue = 2, $ = 0, jn = 1, De = 2, Hn = 3, Wn = 4;
|
|
593
|
+
function Jn(n, e, t, o, i) {
|
|
592
594
|
if (n === null || t.size === 0 && o.size === 0 && !i) return $;
|
|
593
595
|
const r = e._selection, s = n._selection;
|
|
594
596
|
if (i) return jn;
|
|
@@ -596,11 +598,11 @@ function Wn(n, e, t, o, i) {
|
|
|
596
598
|
const a = function(E, w, S) {
|
|
597
599
|
const N = E._nodeMap, b = [];
|
|
598
600
|
for (const L of w) {
|
|
599
|
-
const
|
|
600
|
-
|
|
601
|
+
const k = N.get(L);
|
|
602
|
+
k !== void 0 && b.push(k);
|
|
601
603
|
}
|
|
602
|
-
for (const [L,
|
|
603
|
-
if (!
|
|
604
|
+
for (const [L, k] of S) {
|
|
605
|
+
if (!k) continue;
|
|
604
606
|
const R = N.get(L);
|
|
605
607
|
R === void 0 || Oe(R) || b.push(R);
|
|
606
608
|
}
|
|
@@ -618,22 +620,22 @@ function Wn(n, e, t, o, i) {
|
|
|
618
620
|
const f = r.anchor, C = s.anchor;
|
|
619
621
|
if (f.key !== C.key || f.type !== "text") return $;
|
|
620
622
|
const y = f.offset, v = C.offset, x = d.length - c.length;
|
|
621
|
-
return x === 1 && v === y - 1 ? De : x === -1 && v === y + 1 ?
|
|
623
|
+
return x === 1 && v === y - 1 ? De : x === -1 && v === y + 1 ? Hn : x === -1 && v === y ? Wn : $;
|
|
622
624
|
}
|
|
623
625
|
function qn(n, e) {
|
|
624
626
|
let t = Date.now(), o = $;
|
|
625
627
|
return (i, r, s, a, l, u) => {
|
|
626
628
|
const c = Date.now();
|
|
627
|
-
if (u.has("historic")) return o = $, t = c,
|
|
628
|
-
const d =
|
|
629
|
+
if (u.has("historic")) return o = $, t = c, ue;
|
|
630
|
+
const d = Jn(i, r, a, l, n.isComposing()), f = (() => {
|
|
629
631
|
const C = s === null || s.editor === n, y = u.has("history-push");
|
|
630
|
-
if (!y && C && u.has("history-merge")) return
|
|
631
|
-
if (i === null) return
|
|
632
|
+
if (!y && C && u.has("history-merge")) return ee;
|
|
633
|
+
if (i === null) return le;
|
|
632
634
|
const v = r._selection;
|
|
633
635
|
return a.size > 0 || l.size > 0 ? y === !1 && d !== $ && d === o && c < t + e && C || a.size === 1 && function(x, E, w) {
|
|
634
636
|
const S = E._nodeMap.get(x), N = w._nodeMap.get(x), b = E._selection, L = w._selection;
|
|
635
637
|
return !(g(b) && g(L) && b.anchor.type === "element" && b.focus.type === "element" && L.anchor.type === "text" && L.focus.type === "text" || !M(S) || !M(N) || S.__parent !== N.__parent) && JSON.stringify(E.read(() => S.exportJSON())) === JSON.stringify(w.read(() => N.exportJSON()));
|
|
636
|
-
}(Array.from(a)[0], i, r) ?
|
|
638
|
+
}(Array.from(a)[0], i, r) ? ee : le : v !== null ? ee : ue;
|
|
637
639
|
})();
|
|
638
640
|
return t = c, o = d, f;
|
|
639
641
|
};
|
|
@@ -641,54 +643,54 @@ function qn(n, e) {
|
|
|
641
643
|
function $e(n) {
|
|
642
644
|
n.undoStack = [], n.redoStack = [], n.current = null;
|
|
643
645
|
}
|
|
644
|
-
function
|
|
646
|
+
function Vn(n, e, t) {
|
|
645
647
|
const o = qn(n, t);
|
|
646
|
-
return
|
|
648
|
+
return j(n.registerCommand(It, () => (function(r, s) {
|
|
647
649
|
const a = s.redoStack, l = s.undoStack;
|
|
648
650
|
if (l.length !== 0) {
|
|
649
651
|
const u = s.current, c = l.pop();
|
|
650
|
-
u !== null && (a.push(u), r.dispatchCommand(
|
|
652
|
+
u !== null && (a.push(u), r.dispatchCommand(X, !0)), l.length === 0 && r.dispatchCommand(Y, !1), s.current = c || null, c && c.editor.setEditorState(c.editorState, { tag: "historic" });
|
|
651
653
|
}
|
|
652
654
|
}(n, e), !0), m), n.registerCommand(Rt, () => (function(r, s) {
|
|
653
655
|
const a = s.redoStack, l = s.undoStack;
|
|
654
656
|
if (a.length !== 0) {
|
|
655
657
|
const u = s.current;
|
|
656
|
-
u !== null && (l.push(u), r.dispatchCommand(
|
|
658
|
+
u !== null && (l.push(u), r.dispatchCommand(Y, !0));
|
|
657
659
|
const c = a.pop();
|
|
658
|
-
a.length === 0 && r.dispatchCommand(
|
|
660
|
+
a.length === 0 && r.dispatchCommand(X, !1), s.current = c || null, c && c.editor.setEditorState(c.editorState, { tag: "historic" });
|
|
659
661
|
}
|
|
660
|
-
}(n, e), !0), m), n.registerCommand(
|
|
662
|
+
}(n, e), !0), m), n.registerCommand(Pt, () => ($e(e), !1), m), n.registerCommand(Tt, () => ($e(e), n.dispatchCommand(X, !1), n.dispatchCommand(Y, !1), !0), m), n.registerUpdateListener(({ editorState: r, prevEditorState: s, dirtyLeaves: a, dirtyElements: l, tags: u }) => {
|
|
661
663
|
const c = e.current, d = e.redoStack, f = e.undoStack, C = c === null ? null : c.editorState;
|
|
662
664
|
if (c !== null && r === C) return;
|
|
663
665
|
const y = o(s, r, c, a, l, u);
|
|
664
|
-
if (y ===
|
|
665
|
-
else if (y ===
|
|
666
|
+
if (y === le) d.length !== 0 && (e.redoStack = [], n.dispatchCommand(X, !1)), c !== null && (f.push({ ...c }), n.dispatchCommand(Y, !0));
|
|
667
|
+
else if (y === ue) return;
|
|
666
668
|
e.current = { editor: n, editorState: r };
|
|
667
669
|
}));
|
|
668
670
|
}
|
|
669
|
-
function
|
|
671
|
+
function Gn() {
|
|
670
672
|
return { current: null, redoStack: [], undoStack: [] };
|
|
671
673
|
}
|
|
672
674
|
function Xn({ delay: n, externalHistoryState: e }) {
|
|
673
|
-
const [t] =
|
|
675
|
+
const [t] = P();
|
|
674
676
|
return function(o, i, r = 1e3) {
|
|
675
|
-
const s =
|
|
676
|
-
|
|
677
|
+
const s = q(() => i || Gn(), [i]);
|
|
678
|
+
_(() => Vn(o, s, r), [r, o, s]);
|
|
677
679
|
}(t, e, n), null;
|
|
678
680
|
}
|
|
679
681
|
function Yn({ hasCellMerge: n = !0, hasCellBackgroundColor: e = !0, hasTabHandler: t = !0, hasHorizontalScroll: o = !1 }) {
|
|
680
|
-
const [i] =
|
|
681
|
-
return
|
|
682
|
-
|
|
683
|
-
}, [i, o]),
|
|
684
|
-
if (!n) return
|
|
685
|
-
}, [i, n]),
|
|
686
|
-
if (!e) return i.registerNodeTransform(
|
|
682
|
+
const [i] = P();
|
|
683
|
+
return _(() => {
|
|
684
|
+
Jt(i, o);
|
|
685
|
+
}, [i, o]), _(() => qt(i), [i]), _(() => Vt(i, t), [i, t]), _(() => {
|
|
686
|
+
if (!n) return Gt(i);
|
|
687
|
+
}, [i, n]), _(() => {
|
|
688
|
+
if (!e) return i.registerNodeTransform(Ue, (r) => {
|
|
687
689
|
r.getBackgroundColor() !== null && r.setBackgroundColor(null);
|
|
688
690
|
});
|
|
689
691
|
}, [i, e, n]), null;
|
|
690
692
|
}
|
|
691
|
-
const
|
|
693
|
+
const Je = 200, Qn = ({
|
|
692
694
|
currentLanguage: n = "NL",
|
|
693
695
|
initialValue: e = "",
|
|
694
696
|
placeholder: t = "",
|
|
@@ -697,61 +699,61 @@ const qe = 200, Gn = ({
|
|
|
697
699
|
required: r = !1,
|
|
698
700
|
notValidatedText: s = "",
|
|
699
701
|
maxHeightInRem: a = "20rem",
|
|
700
|
-
maxWords: l =
|
|
702
|
+
maxWords: l = Je,
|
|
701
703
|
onChange: u
|
|
702
704
|
}) => {
|
|
703
|
-
const { switchLanguage: c } =
|
|
705
|
+
const { switchLanguage: c } = fn(), d = an(), [f] = O(() => Pe()), [C, y] = O(0), [v, x] = O(0), E = Fe(null), w = {
|
|
704
706
|
html: {
|
|
705
|
-
export:
|
|
707
|
+
export: nn
|
|
706
708
|
},
|
|
707
709
|
namespace: "UvaRte",
|
|
708
710
|
editor: f,
|
|
709
|
-
theme:
|
|
711
|
+
theme: un,
|
|
710
712
|
onError(b) {
|
|
711
713
|
throw b;
|
|
712
714
|
},
|
|
713
|
-
nodes: [Ae, ze, Be,
|
|
715
|
+
nodes: [Ae, ze, Be, Wt, Ue, Xt, Yt],
|
|
714
716
|
editorState: (b) => {
|
|
715
|
-
const
|
|
716
|
-
if (
|
|
717
|
+
const k = new DOMParser().parseFromString(e, "text/html"), R = zt(b, k), F = z();
|
|
718
|
+
if (F.clear(), rn(e))
|
|
717
719
|
R.forEach((B) => {
|
|
718
|
-
|
|
720
|
+
F.append(B);
|
|
719
721
|
});
|
|
720
722
|
else {
|
|
721
723
|
const B = Re();
|
|
722
724
|
R.forEach((D, V) => {
|
|
723
|
-
V === 0 ? (B.append(D),
|
|
725
|
+
V === 0 ? (B.append(D), F.append(B)) : F.append(D);
|
|
724
726
|
});
|
|
725
727
|
}
|
|
726
728
|
}
|
|
727
729
|
}, S = (b) => b.trim().length === 0 ? 0 : b.split(" ").length, N = (b, L) => {
|
|
728
730
|
b.read(() => {
|
|
729
|
-
let
|
|
730
|
-
y(S(z().getTextContent().replace(/\s+/g, " ").trim())),
|
|
731
|
+
let k = "";
|
|
732
|
+
y(S(z().getTextContent().replace(/\s+/g, " ").trim())), k = on(Bt(L)), u(k);
|
|
731
733
|
});
|
|
732
734
|
};
|
|
733
|
-
return
|
|
735
|
+
return _(() => {
|
|
734
736
|
c(n.toLocaleLowerCase());
|
|
735
|
-
}, [n, c]),
|
|
737
|
+
}, [n, c]), _(() => {
|
|
736
738
|
const b = e.replace(/<br\s*\/?>| /gi, " ").replace(/<\/?[^>]+(>|$)|&[a-z]+;/g, "").replace(/\s+/g, " ").trim();
|
|
737
739
|
y(S(b));
|
|
738
|
-
}, []), /* @__PURE__ */
|
|
739
|
-
/* @__PURE__ */
|
|
740
|
-
/* @__PURE__ */ h(
|
|
741
|
-
/* @__PURE__ */
|
|
742
|
-
/* @__PURE__ */ h("span", { className:
|
|
740
|
+
}, []), /* @__PURE__ */ K("div", { className: I.editor__container, children: [
|
|
741
|
+
/* @__PURE__ */ K("div", { className: I.editor__header, children: [
|
|
742
|
+
/* @__PURE__ */ h(cn, { label: o, info: i, required: r }),
|
|
743
|
+
/* @__PURE__ */ K("div", { className: I["editor__header-word-count"], children: [
|
|
744
|
+
/* @__PURE__ */ h("span", { className: tn({ [I["editor__header-word-count--alert"]]: C > l }), children: C }),
|
|
743
745
|
" / ",
|
|
744
746
|
l
|
|
745
747
|
] })
|
|
746
748
|
] }),
|
|
747
|
-
/* @__PURE__ */ h("div", { className: I.editor, children: /* @__PURE__ */
|
|
748
|
-
/* @__PURE__ */ h(
|
|
749
|
-
/* @__PURE__ */
|
|
749
|
+
/* @__PURE__ */ h("div", { className: I.editor, children: /* @__PURE__ */ K(gn, { initialConfig: w, children: [
|
|
750
|
+
/* @__PURE__ */ h(sn, { editorScrollPosition: v }),
|
|
751
|
+
/* @__PURE__ */ K("div", { className: I["editor__field-wrapper"], children: [
|
|
750
752
|
/* @__PURE__ */ h(
|
|
751
|
-
|
|
753
|
+
Dn,
|
|
752
754
|
{
|
|
753
755
|
contentEditable: /* @__PURE__ */ h(
|
|
754
|
-
|
|
756
|
+
Rn,
|
|
755
757
|
{
|
|
756
758
|
className: I.editor__field,
|
|
757
759
|
"aria-label": d.common.rteAriaLabel,
|
|
@@ -766,22 +768,22 @@ const qe = 200, Gn = ({
|
|
|
766
768
|
}
|
|
767
769
|
),
|
|
768
770
|
placeholder: /* @__PURE__ */ h("div", { className: I.editor__placeholder, children: t }),
|
|
769
|
-
ErrorBoundary:
|
|
771
|
+
ErrorBoundary: Fn
|
|
770
772
|
}
|
|
771
773
|
),
|
|
772
774
|
/* @__PURE__ */ h(Yn, {}),
|
|
773
775
|
/* @__PURE__ */ h(Xn, {}),
|
|
774
|
-
/* @__PURE__ */ h(
|
|
775
|
-
/* @__PURE__ */ h(
|
|
776
|
-
/* @__PURE__ */ h(
|
|
777
|
-
/* @__PURE__ */ h(
|
|
778
|
-
/* @__PURE__ */ h(
|
|
779
|
-
/* @__PURE__ */ h(
|
|
776
|
+
/* @__PURE__ */ h(zn, {}),
|
|
777
|
+
/* @__PURE__ */ h(Bn, { validateUrl: Qt }),
|
|
778
|
+
/* @__PURE__ */ h(Zt, { matchers: en }),
|
|
779
|
+
/* @__PURE__ */ h(Un, {}),
|
|
780
|
+
/* @__PURE__ */ h(An, { onChange: N }),
|
|
781
|
+
/* @__PURE__ */ h(mn, {})
|
|
780
782
|
] })
|
|
781
783
|
] }) }),
|
|
782
|
-
s !== "" && /* @__PURE__ */ h(
|
|
784
|
+
s !== "" && /* @__PURE__ */ h(ln, { level: "error", feedback: s })
|
|
783
785
|
] });
|
|
784
|
-
},
|
|
786
|
+
}, Br = ({
|
|
785
787
|
currentLanguage: n = "NL",
|
|
786
788
|
initialValue: e = "",
|
|
787
789
|
placeholder: t = "",
|
|
@@ -789,10 +791,10 @@ const qe = 200, Gn = ({
|
|
|
789
791
|
info: i = "",
|
|
790
792
|
required: r = !1,
|
|
791
793
|
notValidatedText: s = "",
|
|
792
|
-
maxWords: a =
|
|
794
|
+
maxWords: a = Je,
|
|
793
795
|
onChange: l
|
|
794
|
-
}) => /* @__PURE__ */ h(
|
|
795
|
-
|
|
796
|
+
}) => /* @__PURE__ */ h(dn, { children: /* @__PURE__ */ h(
|
|
797
|
+
Qn,
|
|
796
798
|
{
|
|
797
799
|
currentLanguage: n,
|
|
798
800
|
initialValue: e,
|
|
@@ -806,7 +808,7 @@ const qe = 200, Gn = ({
|
|
|
806
808
|
}
|
|
807
809
|
) });
|
|
808
810
|
export {
|
|
809
|
-
|
|
810
|
-
|
|
811
|
+
Qn as Rte,
|
|
812
|
+
Br as RteEditor
|
|
811
813
|
};
|
|
812
814
|
//# sourceMappingURL=RteEditor.js.map
|