@uva-glass/component-library 3.42.4 → 3.43.0
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-qYl_ifJ6.js → Lexical.prod-nXWuyOKD.js} +1299 -1322
- package/dist/Lexical.prod-nXWuyOKD.js.map +1 -0
- package/dist/{LexicalClipboard.prod-DIGbXq4v.js → LexicalClipboard.prod-BP8LNbol.js} +104 -104
- package/dist/LexicalClipboard.prod-BP8LNbol.js.map +1 -0
- package/dist/{LexicalLink.prod-ZZwC5ABn.js → LexicalLink.prod-Brzpgs_K.js} +51 -51
- package/dist/{LexicalLink.prod-ZZwC5ABn.js.map → LexicalLink.prod-Brzpgs_K.js.map} +1 -1
- package/dist/{LexicalList.prod-UurCu6DK.js → LexicalList.prod-D6IAptR7.js} +53 -53
- package/dist/{LexicalList.prod-UurCu6DK.js.map → LexicalList.prod-D6IAptR7.js.map} +1 -1
- package/dist/LexicalSelection.prod-ZvNRDI9l.js +119 -0
- package/dist/LexicalSelection.prod-ZvNRDI9l.js.map +1 -0
- package/dist/LexicalTable.prod-DJktN6jF.js +1763 -0
- package/dist/LexicalTable.prod-DJktN6jF.js.map +1 -0
- package/dist/{LexicalUtils.prod-C3To3vrm.js → LexicalUtils.prod-Ckfw0Hjt.js} +34 -34
- package/dist/{LexicalUtils.prod-C3To3vrm.js.map → LexicalUtils.prod-Ckfw0Hjt.js.map} +1 -1
- package/dist/{TableCellResizerPlugin-B9MT1fxA.js → TableCellResizerPlugin-DFzNK-ve.js} +32 -32
- package/dist/{TableCellResizerPlugin-B9MT1fxA.js.map → TableCellResizerPlugin-DFzNK-ve.js.map} +1 -1
- package/dist/{TablePlugin-FQQwnq2m.js → TablePlugin-CAoOq8iA.js} +52 -52
- package/dist/{TablePlugin-FQQwnq2m.js.map → TablePlugin-CAoOq8iA.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 +37 -37
- package/dist/components/PeriodSelector/PeriodSelector.js.map +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 +6 -6
- 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 +27 -27
- package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +5 -5
- package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/TableCellResizerPlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +7 -7
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +18 -18
- package/dist/components/RteEditor/Plugins/index.js +2 -2
- package/dist/components/RteEditor/RteEditor.js +233 -233
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/RteEditor/helpers.js +4 -4
- package/dist/components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js +16 -16
- package/dist/components/index.js +1 -1
- package/dist/{helpers-D3SODeVc.js → helpers-mE437H2Y.js} +38 -38
- package/dist/{helpers-D3SODeVc.js.map → helpers-mE437H2Y.js.map} +1 -1
- package/dist/index.js +1 -1
- package/package.json +19 -19
- package/dist/Lexical.prod-qYl_ifJ6.js.map +0 -1
- package/dist/LexicalClipboard.prod-DIGbXq4v.js.map +0 -1
- package/dist/LexicalSelection.prod-DXruZeFN.js +0 -103
- package/dist/LexicalSelection.prod-DXruZeFN.js.map +0 -1
- package/dist/LexicalTable.prod-COFf1Spn.js +0 -1763
- package/dist/LexicalTable.prod-COFf1Spn.js.map +0 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsx as h, jsxs as z, Fragment as
|
|
2
|
-
import { t as Ge, r as
|
|
3
|
-
import { aK as Me, ah as F,
|
|
1
|
+
import { jsx as h, jsxs as z, Fragment as Ie } from "react/jsx-runtime";
|
|
2
|
+
import { t as Ge, r as Qe, o as M } from "../../LexicalComposerContext.prod-DOyoZx0P.js";
|
|
3
|
+
import { aK as Me, ah as F, F as Ke, w as p, aL as de, ao as H, h as J, L as Ve, Z as I, a as g, a0 as Ze, I as m, aM as et, af as Oe, o as tt, x as ze, aN as rt, aO as nt, S as ot, f as T, aG as at, aP as st, aQ as it, aR as lt, n as ee, aS as ut, aT as ct, a5 as dt, g as ft, k as mt, G as pt, aU as gt, aV as me, b as pe, P as ht, N as re, O as vt, a6 as Ae, aW as ge, C as Ct, B as yt, z as Et, aX as he, A as wt, aY as bt, aZ as St, a_ as _t, aF as kt, X as xt, U as Nt, a$ as Lt, Y as Dt, J as $t, H as Tt, u as Pt, K as ve, b0 as Rt, e as It, au as X, at as G, b1 as Mt, b2 as Kt, aw as Ot, b3 as se, av as zt, b4 as At } from "../../Lexical.prod-nXWuyOKD.js";
|
|
4
4
|
import * as ne from "react";
|
|
5
|
-
import { useMemo as te, useLayoutEffect as
|
|
6
|
-
import { a as
|
|
7
|
-
import { j as U, L as A, y as
|
|
8
|
-
import { flushSync as
|
|
9
|
-
import { A as Ce, F as ye, m as
|
|
10
|
-
import {
|
|
11
|
-
import { r as
|
|
12
|
-
import { g as
|
|
13
|
-
import { s as
|
|
14
|
-
import { a as
|
|
15
|
-
import { c as
|
|
16
|
-
import { exportMap as
|
|
5
|
+
import { useMemo as te, useLayoutEffect as W, useEffect as k, useState as K, Suspense as Ft, forwardRef as Fe, useCallback as Bt, useRef as Ut } from "react";
|
|
6
|
+
import { a as jt, T as Ht } from "../../TableCellResizerPlugin-DFzNK-ve.js";
|
|
7
|
+
import { j as U, L as A, y as Jt, w as fe } from "../../LexicalUtils.prod-Ckfw0Hjt.js";
|
|
8
|
+
import { flushSync as Wt, createPortal as Yt } from "react-dom";
|
|
9
|
+
import { A as Ce, F as ye, m as qt, g as Xt } from "../../LexicalClipboard.prod-BP8LNbol.js";
|
|
10
|
+
import { R as Ee, Q as we, e as be } from "../../LexicalSelection.prod-ZvNRDI9l.js";
|
|
11
|
+
import { r as Be, Y as Ue, v as Gt, S as Qt } from "../../LexicalList.prod-D6IAptR7.js";
|
|
12
|
+
import { g as je, k as Se, v as oe, p as Vt, m as Zt } from "../../LexicalLink.prod-Brzpgs_K.js";
|
|
13
|
+
import { s as er, d as tr, b as He, e as rr, w as nr, S as or, y as Je, O as ar } from "../../LexicalTable.prod-DJktN6jF.js";
|
|
14
|
+
import { a as sr, w as ir, M as lr } from "../../helpers-mE437H2Y.js";
|
|
15
|
+
import { c as ur } from "../../clsx-OuTLNxxd.js";
|
|
16
|
+
import { exportMap as cr, isStartingWithHtmlTag as dr, mergeBoldStrongTags as fr, cleanUpTable as mr } from "./helpers.js";
|
|
17
17
|
import { s as R } from "../../RteEditor.module-dE9wQTC9.js";
|
|
18
|
-
import { ToolBarPlugin as
|
|
19
|
-
import { useTranslation as
|
|
20
|
-
import "../../TablePlugin-
|
|
18
|
+
import { ToolBarPlugin as pr } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
|
|
19
|
+
import { useTranslation as gr } from "./hooks/useTranslation.js";
|
|
20
|
+
import "../../TablePlugin-CAoOq8iA.js";
|
|
21
21
|
import "./Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js";
|
|
22
22
|
import "./hooks/components/Flyout.js";
|
|
23
23
|
import "../Accordion/Accordion.js";
|
|
@@ -25,7 +25,7 @@ import "../Buttons/Button.js";
|
|
|
25
25
|
import "../Buttons/LinkButton.js";
|
|
26
26
|
import "@react-aria/button";
|
|
27
27
|
import "../Checkbox/Checkbox.js";
|
|
28
|
-
import { FeedbackBox as
|
|
28
|
+
import { FeedbackBox as hr } from "../FeedbackBox/FeedbackBox.js";
|
|
29
29
|
import "@react-aria/dialog";
|
|
30
30
|
import "@react-aria/focus";
|
|
31
31
|
import "@react-aria/overlays";
|
|
@@ -39,12 +39,12 @@ import "../SelectListbox/SelectListbox.js";
|
|
|
39
39
|
import "../SelectListbox/SelectProvider.js";
|
|
40
40
|
import "../Sortable/components/SortableItem.js";
|
|
41
41
|
import "../../SortableProvider-l8-7ClBJ.js";
|
|
42
|
-
import { PasteHandlerPlugin as
|
|
43
|
-
import { UvaTheme as
|
|
44
|
-
import { EditorHeader as
|
|
45
|
-
import { LanguageProvider as
|
|
46
|
-
import { TableWrapperNode as
|
|
47
|
-
const
|
|
42
|
+
import { PasteHandlerPlugin as vr } from "./Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js";
|
|
43
|
+
import { UvaTheme as Cr } from "./UvaTheme/UvaTheme.js";
|
|
44
|
+
import { EditorHeader as yr } from "./EditorHeader/EditorHeader.js";
|
|
45
|
+
import { LanguageProvider as Er, useLanguage as wr } from "./Providers/LanguageProvider.js";
|
|
46
|
+
import { TableWrapperNode as br } from "./nodes/TableWrapperNode/TableWrapperNode.js";
|
|
47
|
+
const We = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Sr = We ? W : k, Q = { tag: de };
|
|
48
48
|
function _r({ initialConfig: r, children: e }) {
|
|
49
49
|
const t = te((() => {
|
|
50
50
|
const { theme: o, namespace: a, nodes: n, onError: s, editorState: i, html: l } = r, c = Ge(null, o), u = Me({ editable: r.editable, html: l, namespace: a, nodes: n, onError: (d) => s(d, u), theme: o });
|
|
@@ -53,64 +53,64 @@ function _r({ initialConfig: r, children: e }) {
|
|
|
53
53
|
if (f === void 0) d.update((() => {
|
|
54
54
|
const v = F();
|
|
55
55
|
if (v.isEmpty()) {
|
|
56
|
-
const C =
|
|
56
|
+
const C = Ke();
|
|
57
57
|
v.append(C);
|
|
58
|
-
const w =
|
|
58
|
+
const w = We ? document.activeElement : null;
|
|
59
59
|
(p() !== null || w !== null && w === d.getRootElement()) && C.select();
|
|
60
60
|
}
|
|
61
|
-
}),
|
|
61
|
+
}), Q);
|
|
62
62
|
else if (f !== null) switch (typeof f) {
|
|
63
63
|
case "string": {
|
|
64
64
|
const v = d.parseEditorState(f);
|
|
65
|
-
d.setEditorState(v,
|
|
65
|
+
d.setEditorState(v, Q);
|
|
66
66
|
break;
|
|
67
67
|
}
|
|
68
68
|
case "object":
|
|
69
|
-
d.setEditorState(f,
|
|
69
|
+
d.setEditorState(f, Q);
|
|
70
70
|
break;
|
|
71
71
|
case "function":
|
|
72
72
|
d.update((() => {
|
|
73
73
|
F().isEmpty() && f(d);
|
|
74
|
-
}),
|
|
74
|
+
}), Q);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
})(u, i), [u, c];
|
|
78
78
|
}), []);
|
|
79
|
-
return
|
|
79
|
+
return Sr((() => {
|
|
80
80
|
const o = r.editable, [a] = t;
|
|
81
81
|
a.setEditable(o === void 0 || o);
|
|
82
|
-
}), []), h(
|
|
82
|
+
}), []), h(Qe.Provider, { value: t, children: e });
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function kr() {
|
|
85
85
|
return F().getTextContent();
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function xr(r, e = !0) {
|
|
88
88
|
if (r) return !1;
|
|
89
|
-
let t =
|
|
89
|
+
let t = kr();
|
|
90
90
|
return e && (t = t.trim()), t === "";
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
if (!
|
|
92
|
+
function Nr(r) {
|
|
93
|
+
if (!xr(r, !1)) return !1;
|
|
94
94
|
const e = F().getChildren(), t = e.length;
|
|
95
95
|
if (t > 1) return !1;
|
|
96
96
|
for (let o = 0; o < t; o++) {
|
|
97
97
|
const a = e[o];
|
|
98
98
|
if (H(a)) return !1;
|
|
99
|
-
if (
|
|
99
|
+
if (J(a)) {
|
|
100
100
|
if (!Ve(a) || a.__indent !== 0) return !1;
|
|
101
101
|
const n = a.getChildren(), s = n.length;
|
|
102
102
|
for (let i = 0; i < s; i++) {
|
|
103
103
|
const l = n[o];
|
|
104
|
-
if (!
|
|
104
|
+
if (!I(l)) return !1;
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
return !0;
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
return () =>
|
|
110
|
+
function Ye(r) {
|
|
111
|
+
return () => Nr(r);
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function Lr(r) {
|
|
114
114
|
const e = window.location.origin, t = (o) => {
|
|
115
115
|
if (o.origin !== e) return;
|
|
116
116
|
const a = r.getRootElement();
|
|
@@ -133,11 +133,11 @@ function Nr(r) {
|
|
|
133
133
|
const w = p();
|
|
134
134
|
if (g(w)) {
|
|
135
135
|
const x = w.anchor;
|
|
136
|
-
let y = x.getNode(), E = 0,
|
|
137
|
-
if (
|
|
138
|
-
E = f,
|
|
136
|
+
let y = x.getNode(), E = 0, S = 0;
|
|
137
|
+
if (I(y) && c >= 0 && u >= 0 && (E = c, S = c + u, w.setTextNodeRange(y, E, y, S)), E === S && d === "" || (w.insertRawText(d), y = x.getNode()), I(y)) {
|
|
138
|
+
E = f, S = f + v;
|
|
139
139
|
const N = y.getTextContentSize();
|
|
140
|
-
E = E > N ? N : E,
|
|
140
|
+
E = E > N ? N : E, S = S > N ? N : S, w.setTextNodeRange(y, E, y, S);
|
|
141
141
|
}
|
|
142
142
|
o.stopImmediatePropagation();
|
|
143
143
|
}
|
|
@@ -162,45 +162,45 @@ function _e(r, e) {
|
|
|
162
162
|
}
|
|
163
163
|
return null;
|
|
164
164
|
}
|
|
165
|
-
const
|
|
166
|
-
function
|
|
165
|
+
const j = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Dr = j && "documentMode" in document ? document.documentMode : null, $r = !(!j || !("InputEvent" in window) || Dr) && "getTargetRanges" in new window.InputEvent("input"), Tr = j && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), ke = j && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Pr = j && /^(?=.*Chrome).*/i.test(navigator.userAgent), Rr = j && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !Pr, xe = tt("DRAG_DROP_PASTE_FILE");
|
|
166
|
+
function V(r) {
|
|
167
167
|
let e = null;
|
|
168
168
|
if (A(r, DragEvent) ? e = r.dataTransfer : A(r, ClipboardEvent) && (e = r.clipboardData), e === null) return [!1, [], !1];
|
|
169
169
|
const t = e.types, o = t.includes("Files"), a = t.includes("text/html") || t.includes("text/plain");
|
|
170
170
|
return [o, Array.from(e.files), a];
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function Ne(r) {
|
|
173
173
|
const e = p();
|
|
174
174
|
if (!g(e)) return !1;
|
|
175
175
|
const t = /* @__PURE__ */ new Set(), o = e.getNodes();
|
|
176
176
|
for (let a = 0; a < o.length; a++) {
|
|
177
177
|
const n = o[a], s = n.getKey();
|
|
178
178
|
if (t.has(s)) continue;
|
|
179
|
-
const i = fe(n, ((c) =>
|
|
179
|
+
const i = fe(n, ((c) => J(c) && !c.isInline()));
|
|
180
180
|
if (i === null) continue;
|
|
181
181
|
const l = i.getKey();
|
|
182
182
|
i.canIndent() && !t.has(l) && (t.add(l), r(i));
|
|
183
183
|
}
|
|
184
184
|
return t.size > 0;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function Le(r) {
|
|
187
187
|
const e = ee(r);
|
|
188
188
|
return H(e);
|
|
189
189
|
}
|
|
190
190
|
function ae(r) {
|
|
191
191
|
for (const e of ["lowercase", "uppercase", "capitalize"]) r.hasFormat(e) && r.toggleFormat(e);
|
|
192
192
|
}
|
|
193
|
-
function
|
|
194
|
-
return U(r.registerCommand(
|
|
193
|
+
function Ir(r) {
|
|
194
|
+
return U(r.registerCommand(Pt, ((e) => {
|
|
195
195
|
const t = p();
|
|
196
196
|
return !!T(t) && (t.clear(), !0);
|
|
197
197
|
}), m), r.registerCommand(re, ((e) => {
|
|
198
198
|
const t = p();
|
|
199
199
|
return g(t) ? (t.deleteCharacter(e), !0) : !!T(t) && (t.deleteNodes(), !0);
|
|
200
|
-
}), m), r.registerCommand(
|
|
200
|
+
}), m), r.registerCommand(Tt, ((e) => {
|
|
201
201
|
const t = p();
|
|
202
202
|
return !!g(t) && (t.deleteWord(e), !0);
|
|
203
|
-
}), m), r.registerCommand(
|
|
203
|
+
}), m), r.registerCommand($t, ((e) => {
|
|
204
204
|
const t = p();
|
|
205
205
|
return !!g(t) && (t.deleteLine(e), !0);
|
|
206
206
|
}), m), r.registerCommand(Dt, ((e) => {
|
|
@@ -216,18 +216,18 @@ function Rr(r) {
|
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
return !0;
|
|
219
|
-
}), m), r.registerCommand(
|
|
219
|
+
}), m), r.registerCommand(Lt, (() => {
|
|
220
220
|
const e = p();
|
|
221
221
|
return !!g(e) && (e.removeText(), !0);
|
|
222
|
-
}), m), r.registerCommand(
|
|
222
|
+
}), m), r.registerCommand(Nt, ((e) => {
|
|
223
223
|
const t = p();
|
|
224
224
|
return !!g(t) && (t.formatText(e), !0);
|
|
225
|
-
}), m), r.registerCommand(
|
|
225
|
+
}), m), r.registerCommand(xt, ((e) => {
|
|
226
226
|
const t = p();
|
|
227
227
|
if (!g(t) && !T(t)) return !1;
|
|
228
228
|
const o = t.getNodes();
|
|
229
229
|
for (const a of o) {
|
|
230
|
-
const n = fe(a, ((s) =>
|
|
230
|
+
const n = fe(a, ((s) => J(s) && !s.isInline()));
|
|
231
231
|
n !== null && n.setFormat(e);
|
|
232
232
|
}
|
|
233
233
|
return !0;
|
|
@@ -237,13 +237,13 @@ function Rr(r) {
|
|
|
237
237
|
}), m), r.registerCommand(pe, (() => {
|
|
238
238
|
const e = p();
|
|
239
239
|
return !!g(e) && (e.insertParagraph(), !0);
|
|
240
|
-
}), m), r.registerCommand(
|
|
240
|
+
}), m), r.registerCommand(St, (() => (_t([kt()]), !0)), m), r.registerCommand(bt, (() => Ne(((e) => {
|
|
241
241
|
const t = e.getIndent();
|
|
242
242
|
e.setIndent(t + 1);
|
|
243
|
-
}))), m), r.registerCommand(ge, (() =>
|
|
243
|
+
}))), m), r.registerCommand(ge, (() => Ne(((e) => {
|
|
244
244
|
const t = e.getIndent();
|
|
245
245
|
t > 0 && e.setIndent(Math.max(0, t - 1));
|
|
246
|
-
}))), m), r.registerCommand(
|
|
246
|
+
}))), m), r.registerCommand(wt, ((e) => {
|
|
247
247
|
const t = p();
|
|
248
248
|
if (T(t)) {
|
|
249
249
|
const o = t.getNodes();
|
|
@@ -253,7 +253,7 @@ function Rr(r) {
|
|
|
253
253
|
if (!e.shiftKey && H(o) && !o.isIsolated() && !o.isInline()) return o.selectPrevious(), e.preventDefault(), !0;
|
|
254
254
|
}
|
|
255
255
|
return !1;
|
|
256
|
-
}), m), r.registerCommand(
|
|
256
|
+
}), m), r.registerCommand(Et, ((e) => {
|
|
257
257
|
const t = p();
|
|
258
258
|
if (T(t)) {
|
|
259
259
|
const o = t.getNodes();
|
|
@@ -267,29 +267,29 @@ function Rr(r) {
|
|
|
267
267
|
if (!e.shiftKey && H(o) && !o.isIsolated() && !o.isInline()) return o.selectNext(), e.preventDefault(), !0;
|
|
268
268
|
}
|
|
269
269
|
return !1;
|
|
270
|
-
}), m), r.registerCommand(
|
|
270
|
+
}), m), r.registerCommand(yt, ((e) => {
|
|
271
271
|
const t = p();
|
|
272
272
|
if (T(t)) {
|
|
273
273
|
const o = t.getNodes();
|
|
274
|
-
if (o.length > 0) return e.preventDefault(), o[0].selectPrevious(), !0;
|
|
274
|
+
if (o.length > 0) return e.preventDefault(), Ee(o[0]) ? o[0].selectNext(0, 0) : o[0].selectPrevious(), !0;
|
|
275
275
|
}
|
|
276
276
|
if (!g(t)) return !1;
|
|
277
|
-
if (
|
|
277
|
+
if (we(t, !0)) {
|
|
278
278
|
const o = e.shiftKey;
|
|
279
|
-
return e.preventDefault(),
|
|
279
|
+
return e.preventDefault(), be(t, o, !0), !0;
|
|
280
280
|
}
|
|
281
281
|
return !1;
|
|
282
|
-
}), m), r.registerCommand(
|
|
282
|
+
}), m), r.registerCommand(Ct, ((e) => {
|
|
283
283
|
const t = p();
|
|
284
284
|
if (T(t)) {
|
|
285
285
|
const a = t.getNodes();
|
|
286
|
-
if (a.length > 0) return e.preventDefault(), a[0].selectNext(0, 0), !0;
|
|
286
|
+
if (a.length > 0) return e.preventDefault(), Ee(a[0]) ? a[0].selectPrevious() : a[0].selectNext(0, 0), !0;
|
|
287
287
|
}
|
|
288
288
|
if (!g(t)) return !1;
|
|
289
289
|
const o = e.shiftKey;
|
|
290
|
-
return !!
|
|
291
|
-
}), m), r.registerCommand(
|
|
292
|
-
if (
|
|
290
|
+
return !!we(t, !1) && (e.preventDefault(), be(t, o, !1), !0);
|
|
291
|
+
}), m), r.registerCommand(vt, ((e) => {
|
|
292
|
+
if (Le(e.target)) return !1;
|
|
293
293
|
const t = p();
|
|
294
294
|
if (g(t)) {
|
|
295
295
|
if ((function(o) {
|
|
@@ -297,55 +297,55 @@ function Rr(r) {
|
|
|
297
297
|
const { anchor: a } = o;
|
|
298
298
|
if (a.offset !== 0) return !1;
|
|
299
299
|
const n = a.getNode();
|
|
300
|
-
if (
|
|
301
|
-
const s =
|
|
300
|
+
if (Ae(n)) return !1;
|
|
301
|
+
const s = Jt(n);
|
|
302
302
|
return s.getIndent() > 0 && (s.is(n) || n.is(s.getFirstDescendant()));
|
|
303
303
|
})(t)) return e.preventDefault(), r.dispatchCommand(ge, void 0);
|
|
304
|
-
if (
|
|
304
|
+
if (ke && navigator.language === "ko-KR") return !1;
|
|
305
305
|
} else if (!T(t)) return !1;
|
|
306
306
|
return e.preventDefault(), r.dispatchCommand(re, !0);
|
|
307
|
-
}), m), r.registerCommand(
|
|
308
|
-
if (
|
|
307
|
+
}), m), r.registerCommand(ht, ((e) => {
|
|
308
|
+
if (Le(e.target)) return !1;
|
|
309
309
|
const t = p();
|
|
310
310
|
return !(!g(t) && !T(t)) && (e.preventDefault(), r.dispatchCommand(re, !1));
|
|
311
|
-
}), m), r.registerCommand(
|
|
311
|
+
}), m), r.registerCommand(gt, ((e) => {
|
|
312
312
|
const t = p();
|
|
313
313
|
if (!g(t)) return !1;
|
|
314
314
|
if (ae(t), e !== null) {
|
|
315
|
-
if ((
|
|
315
|
+
if ((ke || Tr || Rr) && $r) return !1;
|
|
316
316
|
if (e.preventDefault(), e.shiftKey) return r.dispatchCommand(me, !1);
|
|
317
317
|
}
|
|
318
318
|
return r.dispatchCommand(pe, void 0);
|
|
319
|
-
}), m), r.registerCommand(
|
|
319
|
+
}), m), r.registerCommand(pt, (() => {
|
|
320
320
|
const e = p();
|
|
321
321
|
return !!g(e) && (r.blur(), !0);
|
|
322
|
-
}), m), r.registerCommand(
|
|
323
|
-
const [, t] =
|
|
322
|
+
}), m), r.registerCommand(ct, ((e) => {
|
|
323
|
+
const [, t] = V(e);
|
|
324
324
|
if (t.length > 0) {
|
|
325
325
|
const a = _e(e.clientX, e.clientY);
|
|
326
326
|
if (a !== null) {
|
|
327
327
|
const { offset: n, node: s } = a, i = ee(s);
|
|
328
328
|
if (i !== null) {
|
|
329
|
-
const l =
|
|
330
|
-
if (
|
|
329
|
+
const l = dt();
|
|
330
|
+
if (I(i)) l.anchor.set(i.getKey(), n, "text"), l.focus.set(i.getKey(), n, "text");
|
|
331
331
|
else {
|
|
332
332
|
const u = i.getParentOrThrow().getKey(), d = i.getIndexWithinParent() + 1;
|
|
333
333
|
l.anchor.set(u, d, "element"), l.focus.set(u, d, "element");
|
|
334
334
|
}
|
|
335
|
-
const c =
|
|
336
|
-
|
|
335
|
+
const c = ft(l);
|
|
336
|
+
mt(c);
|
|
337
337
|
}
|
|
338
|
-
r.dispatchCommand(
|
|
338
|
+
r.dispatchCommand(xe, t);
|
|
339
339
|
}
|
|
340
340
|
return e.preventDefault(), !0;
|
|
341
341
|
}
|
|
342
342
|
const o = p();
|
|
343
343
|
return !!g(o);
|
|
344
|
-
}), m), r.registerCommand(
|
|
345
|
-
const [t] =
|
|
344
|
+
}), m), r.registerCommand(ut, ((e) => {
|
|
345
|
+
const [t] = V(e), o = p();
|
|
346
346
|
return !(t && !g(o));
|
|
347
|
-
}), m), r.registerCommand(
|
|
348
|
-
const [t] =
|
|
347
|
+
}), m), r.registerCommand(lt, ((e) => {
|
|
348
|
+
const [t] = V(e), o = p();
|
|
349
349
|
if (t && !g(o)) return !1;
|
|
350
350
|
const a = _e(e.clientX, e.clientY);
|
|
351
351
|
if (a !== null) {
|
|
@@ -353,20 +353,20 @@ function Rr(r) {
|
|
|
353
353
|
H(n) && e.preventDefault();
|
|
354
354
|
}
|
|
355
355
|
return !0;
|
|
356
|
-
}), m), r.registerCommand(
|
|
356
|
+
}), 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) {
|
|
357
357
|
await ye(o, A(t, ClipboardEvent) ? t : null), o.update((() => {
|
|
358
358
|
const a = p();
|
|
359
359
|
g(a) ? a.removeText() : T(a) && a.getNodes().forEach(((n) => n.remove()));
|
|
360
360
|
}));
|
|
361
361
|
})(e, r), !0)), m), r.registerCommand(Oe, ((e) => {
|
|
362
|
-
const [, t, o] =
|
|
363
|
-
return t.length > 0 && !o ? (r.dispatchCommand(
|
|
362
|
+
const [, t, o] = V(e);
|
|
363
|
+
return t.length > 0 && !o ? (r.dispatchCommand(xe, t), !0) : ze(e.target) && rt(e.target) ? !1 : p() !== null && ((function(a, n) {
|
|
364
364
|
a.preventDefault(), n.update((() => {
|
|
365
365
|
const s = p(), i = A(a, InputEvent) || A(a, KeyboardEvent) ? null : a.clipboardData;
|
|
366
366
|
i != null && s !== null && Ce(i, s, n);
|
|
367
|
-
}), { tag:
|
|
367
|
+
}), { tag: nt });
|
|
368
368
|
})(e, r), !0);
|
|
369
|
-
}), m), r.registerCommand(
|
|
369
|
+
}), m), r.registerCommand(et, ((e) => {
|
|
370
370
|
const t = p();
|
|
371
371
|
return g(t) && ae(t), !1;
|
|
372
372
|
}), m), r.registerCommand(Ze, ((e) => {
|
|
@@ -374,15 +374,15 @@ function Rr(r) {
|
|
|
374
374
|
return g(t) && ae(t), !1;
|
|
375
375
|
}), m));
|
|
376
376
|
}
|
|
377
|
-
const ie = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ?
|
|
377
|
+
const ie = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? W : k;
|
|
378
378
|
function De(r) {
|
|
379
|
-
return r.getEditorState().read(
|
|
379
|
+
return r.getEditorState().read(Ye(r.isComposing()));
|
|
380
380
|
}
|
|
381
381
|
function Mr({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
|
|
382
|
-
const [o] =
|
|
383
|
-
const [i, l] =
|
|
382
|
+
const [o] = M(), a = (function(n, s) {
|
|
383
|
+
const [i, l] = K((() => n.getDecorators()));
|
|
384
384
|
return ie((() => n.registerDecoratorListener(((c) => {
|
|
385
|
-
|
|
385
|
+
Wt((() => {
|
|
386
386
|
l(c);
|
|
387
387
|
}));
|
|
388
388
|
}))), [n]), k((() => {
|
|
@@ -390,19 +390,19 @@ function Mr({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
|
|
|
390
390
|
}), [n]), te((() => {
|
|
391
391
|
const c = [], u = Object.keys(i);
|
|
392
392
|
for (let d = 0; d < u.length; d++) {
|
|
393
|
-
const f = u[d], v = h(s, { onError: (w) => n._onError(w), children: h(
|
|
394
|
-
C !== null && c.push(
|
|
393
|
+
const f = u[d], v = h(s, { onError: (w) => n._onError(w), children: h(Ft, { fallback: null, children: i[f] }) }), C = n.getElementByKey(f);
|
|
394
|
+
C !== null && c.push(Yt(v, C, f));
|
|
395
395
|
}
|
|
396
396
|
return c;
|
|
397
397
|
}), [s, i, n]);
|
|
398
398
|
})(o, t);
|
|
399
399
|
return (function(n) {
|
|
400
|
-
ie((() => U(
|
|
401
|
-
})(o), z(
|
|
400
|
+
ie((() => U(Ir(n), Lr(n))), [n]);
|
|
401
|
+
})(o), z(Ie, { children: [r, h(Kr, { content: e }), a] });
|
|
402
402
|
}
|
|
403
|
-
function
|
|
404
|
-
const [e] =
|
|
405
|
-
const [n, s] =
|
|
403
|
+
function Kr({ content: r }) {
|
|
404
|
+
const [e] = M(), t = (function(a) {
|
|
405
|
+
const [n, s] = K((() => De(a)));
|
|
406
406
|
return ie((() => {
|
|
407
407
|
function i() {
|
|
408
408
|
const l = De(a);
|
|
@@ -414,39 +414,39 @@ function Ir({ content: r }) {
|
|
|
414
414
|
i();
|
|
415
415
|
})));
|
|
416
416
|
}), [a]), n;
|
|
417
|
-
})(e), o =
|
|
417
|
+
})(e), o = jt();
|
|
418
418
|
return t ? typeof r == "function" ? r(o) : r : null;
|
|
419
419
|
}
|
|
420
|
-
const
|
|
421
|
-
function Or({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: o, ariaDescribedBy: a, ariaErrorMessage: n, ariaExpanded: s, ariaInvalid: i, ariaLabel: l, ariaLabelledBy: c, ariaMultiline: u, ariaOwns: d, ariaRequired: f, autoCapitalize: v, className: C, id: w, role: x = "textbox", spellCheck: y = !0, style: E, tabIndex:
|
|
422
|
-
const [
|
|
423
|
-
|
|
424
|
-
}), [r]), B = te((() => /* @__PURE__ */ (function(...
|
|
425
|
-
return (
|
|
426
|
-
|
|
427
|
-
typeof q == "function" ? q(
|
|
420
|
+
const qe = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? W : k;
|
|
421
|
+
function Or({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: o, ariaDescribedBy: a, ariaErrorMessage: n, ariaExpanded: s, ariaInvalid: i, ariaLabel: l, ariaLabelledBy: c, ariaMultiline: u, ariaOwns: d, ariaRequired: f, autoCapitalize: v, className: C, id: w, role: x = "textbox", spellCheck: y = !0, style: E, tabIndex: S, "data-testid": N, ...b }, L) {
|
|
422
|
+
const [_, P] = K(r.isEditable()), O = Bt(((D) => {
|
|
423
|
+
D && D.ownerDocument && D.ownerDocument.defaultView ? r.setRootElement(D) : r.setRootElement(null);
|
|
424
|
+
}), [r]), B = te((() => /* @__PURE__ */ (function(...D) {
|
|
425
|
+
return (Y) => {
|
|
426
|
+
D.forEach(((q) => {
|
|
427
|
+
typeof q == "function" ? q(Y) : q != null && (q.current = Y);
|
|
428
428
|
}));
|
|
429
429
|
};
|
|
430
|
-
})(
|
|
431
|
-
return
|
|
432
|
-
P(
|
|
433
|
-
})))), [r]), h("div", { "aria-activedescendant":
|
|
430
|
+
})(L, O)), [O, L]);
|
|
431
|
+
return qe((() => (P(r.isEditable()), r.registerEditableListener(((D) => {
|
|
432
|
+
P(D);
|
|
433
|
+
})))), [r]), h("div", { "aria-activedescendant": _ ? e : void 0, "aria-autocomplete": _ ? t : "none", "aria-controls": _ ? o : void 0, "aria-describedby": a, ...n != null ? { "aria-errormessage": n } : {}, "aria-expanded": _ && x === "combobox" ? !!s : void 0, ...i != null ? { "aria-invalid": i } : {}, "aria-label": l, "aria-labelledby": c, "aria-multiline": u, "aria-owns": _ ? d : void 0, "aria-readonly": !_ || void 0, "aria-required": f, autoCapitalize: v, className: C, contentEditable: _, "data-testid": N, id: w, ref: B, role: x, spellCheck: y, style: E, tabIndex: S, ...b });
|
|
434
434
|
}
|
|
435
|
-
const
|
|
436
|
-
function
|
|
437
|
-
return r.getEditorState().read(
|
|
435
|
+
const zr = Fe(Or);
|
|
436
|
+
function $e(r) {
|
|
437
|
+
return r.getEditorState().read(Ye(r.isComposing()));
|
|
438
438
|
}
|
|
439
|
-
const
|
|
440
|
-
function
|
|
441
|
-
const { placeholder: t, ...o } = r, [a] =
|
|
442
|
-
return z(
|
|
439
|
+
const Ar = Fe(Fr);
|
|
440
|
+
function Fr(r, e) {
|
|
441
|
+
const { placeholder: t, ...o } = r, [a] = M();
|
|
442
|
+
return z(Ie, { children: [h(zr, { editor: a, ...o, ref: e }), t != null && h(Br, { editor: a, content: t })] });
|
|
443
443
|
}
|
|
444
|
-
function
|
|
444
|
+
function Br({ content: r, editor: e }) {
|
|
445
445
|
const t = (function(s) {
|
|
446
|
-
const [i, l] =
|
|
447
|
-
return
|
|
446
|
+
const [i, l] = K((() => $e(s)));
|
|
447
|
+
return qe((() => {
|
|
448
448
|
function c() {
|
|
449
|
-
const u =
|
|
449
|
+
const u = $e(s);
|
|
450
450
|
l(u);
|
|
451
451
|
}
|
|
452
452
|
return c(), U(s.registerUpdateListener((() => {
|
|
@@ -455,8 +455,8 @@ function Fr({ content: r, editor: e }) {
|
|
|
455
455
|
c();
|
|
456
456
|
})));
|
|
457
457
|
}), [s]), i;
|
|
458
|
-
})(e), [o, a] =
|
|
459
|
-
if (
|
|
458
|
+
})(e), [o, a] = K(e.isEditable());
|
|
459
|
+
if (W((() => (a(e.isEditable()), e.registerEditableListener(((s) => {
|
|
460
460
|
a(s);
|
|
461
461
|
})))), [e]), !t) return null;
|
|
462
462
|
let n = null;
|
|
@@ -467,11 +467,11 @@ function le(r, e) {
|
|
|
467
467
|
return t.__proto__ = o, t;
|
|
468
468
|
}, le(r, e);
|
|
469
469
|
}
|
|
470
|
-
var
|
|
470
|
+
var Te = { error: null }, Ur = (function(r) {
|
|
471
471
|
var e, t;
|
|
472
472
|
function o() {
|
|
473
473
|
for (var n, s = arguments.length, i = new Array(s), l = 0; l < s; l++) i[l] = arguments[l];
|
|
474
|
-
return (n = r.call.apply(r, [this].concat(i)) || this).state =
|
|
474
|
+
return (n = r.call.apply(r, [this].concat(i)) || this).state = Te, n.resetErrorBoundary = function() {
|
|
475
475
|
for (var c, u = arguments.length, d = new Array(u), f = 0; f < u; f++) d[f] = arguments[f];
|
|
476
476
|
n.props.onReset == null || (c = n.props).onReset.apply(c, d), n.reset();
|
|
477
477
|
}, n;
|
|
@@ -481,7 +481,7 @@ var $e = { error: null }, Br = (function(r) {
|
|
|
481
481
|
};
|
|
482
482
|
var a = o.prototype;
|
|
483
483
|
return a.reset = function() {
|
|
484
|
-
this.setState(
|
|
484
|
+
this.setState(Te);
|
|
485
485
|
}, a.componentDidCatch = function(n, s) {
|
|
486
486
|
var i, l;
|
|
487
487
|
(i = (l = this.props).onError) == null || i.call(l, n, s);
|
|
@@ -502,33 +502,33 @@ var $e = { error: null }, Br = (function(r) {
|
|
|
502
502
|
return this.props.children;
|
|
503
503
|
}, o;
|
|
504
504
|
})(ne.Component);
|
|
505
|
-
function
|
|
506
|
-
return h(
|
|
505
|
+
function jr({ children: r, onError: e }) {
|
|
506
|
+
return h(Ur, { fallback: h("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: r });
|
|
507
507
|
}
|
|
508
|
-
const
|
|
509
|
-
function
|
|
510
|
-
const [o] =
|
|
511
|
-
return
|
|
508
|
+
const Hr = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? W : k;
|
|
509
|
+
function Jr({ ignoreHistoryMergeTagChange: r = !0, ignoreSelectionChange: e = !1, onChange: t }) {
|
|
510
|
+
const [o] = M();
|
|
511
|
+
return Hr((() => {
|
|
512
512
|
if (t) return o.registerUpdateListener((({ editorState: a, dirtyElements: n, dirtyLeaves: s, prevEditorState: i, tags: l }) => {
|
|
513
513
|
e && n.size === 0 && s.size === 0 || r && l.has(de) || i.isEmpty() || t(a, o, l);
|
|
514
514
|
}));
|
|
515
515
|
}), [o, r, e, t]), null;
|
|
516
516
|
}
|
|
517
|
-
function
|
|
518
|
-
const [e] =
|
|
517
|
+
function Wr({ hasStrictIndent: r = !1 }) {
|
|
518
|
+
const [e] = M();
|
|
519
519
|
return k((() => {
|
|
520
|
-
if (!e.hasNodes([
|
|
520
|
+
if (!e.hasNodes([Be, Ue])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
|
|
521
521
|
}), [e]), k((() => {
|
|
522
522
|
if (r) return Gt(e);
|
|
523
523
|
}), [e, r]), (function(t) {
|
|
524
|
-
k((() =>
|
|
524
|
+
k((() => Qt(t)), [t]);
|
|
525
525
|
})(e), null;
|
|
526
526
|
}
|
|
527
|
-
function
|
|
528
|
-
const [t] =
|
|
527
|
+
function Yr({ validateUrl: r, attributes: e }) {
|
|
528
|
+
const [t] = M();
|
|
529
529
|
return k((() => {
|
|
530
|
-
if (!t.hasNodes([
|
|
531
|
-
return U(t.registerCommand(
|
|
530
|
+
if (!t.hasNodes([je])) throw new Error("LinkPlugin: LinkNode not registered on editor");
|
|
531
|
+
return U(t.registerCommand(Se, ((o) => {
|
|
532
532
|
if (o === null) return oe(o), !0;
|
|
533
533
|
if (typeof o == "string") return !(r !== void 0 && !r(o)) && (oe(o, e), !0);
|
|
534
534
|
{
|
|
@@ -539,24 +539,24 @@ function Jr({ validateUrl: r, attributes: e }) {
|
|
|
539
539
|
const a = p();
|
|
540
540
|
if (!g(a) || a.isCollapsed() || !A(o, ClipboardEvent) || o.clipboardData === null) return !1;
|
|
541
541
|
const n = o.clipboardData.getData("text");
|
|
542
|
-
return !!r(n) && !a.getNodes().some(((s) =>
|
|
542
|
+
return !!r(n) && !a.getNodes().some(((s) => J(s))) && (t.dispatchCommand(Se, { ...e, url: n }), o.preventDefault(), !0);
|
|
543
543
|
}), ve) : () => {
|
|
544
544
|
});
|
|
545
545
|
}), [t, r, e]), null;
|
|
546
546
|
}
|
|
547
|
-
function
|
|
548
|
-
const [t] =
|
|
547
|
+
function qr({ newTab: r = !0, disabled: e = !1 }) {
|
|
548
|
+
const [t] = M();
|
|
549
549
|
return k((() => {
|
|
550
550
|
const o = (n) => {
|
|
551
551
|
const s = n.target;
|
|
552
|
-
if (!
|
|
553
|
-
const i =
|
|
552
|
+
if (!ze(s)) return;
|
|
553
|
+
const i = Rt(s);
|
|
554
554
|
if (i === null) return;
|
|
555
555
|
let l = null, c = null;
|
|
556
556
|
if (i.update((() => {
|
|
557
557
|
const f = ee(s);
|
|
558
558
|
if (f !== null) {
|
|
559
|
-
const v = fe(f,
|
|
559
|
+
const v = fe(f, J);
|
|
560
560
|
if (!e) if (Vt(v)) l = v.sanitizeUrl(v.getURL()), c = v.getTarget();
|
|
561
561
|
else {
|
|
562
562
|
const C = (function(w, x) {
|
|
@@ -566,7 +566,7 @@ function Xr({ newTab: r = !0, disabled: e = !1 }) {
|
|
|
566
566
|
y = y.parentNode;
|
|
567
567
|
}
|
|
568
568
|
return null;
|
|
569
|
-
})(s,
|
|
569
|
+
})(s, It);
|
|
570
570
|
C !== null && (l = C.href, c = C.target);
|
|
571
571
|
}
|
|
572
572
|
}
|
|
@@ -583,38 +583,38 @@ function Xr({ newTab: r = !0, disabled: e = !1 }) {
|
|
|
583
583
|
}));
|
|
584
584
|
}), [t, r, e]), null;
|
|
585
585
|
}
|
|
586
|
-
const
|
|
586
|
+
const Z = 0, ue = 1, ce = 2, $ = 0, Xr = 1, Pe = 2, Gr = 3, Qr = 4;
|
|
587
587
|
function Vr(r, e, t, o, a) {
|
|
588
588
|
if (r === null || t.size === 0 && o.size === 0 && !a) return $;
|
|
589
589
|
const n = e._selection, s = r._selection;
|
|
590
|
-
if (a) return
|
|
590
|
+
if (a) return Xr;
|
|
591
591
|
if (!(g(n) && g(s) && s.isCollapsed() && n.isCollapsed())) return $;
|
|
592
|
-
const i = (function(y, E,
|
|
592
|
+
const i = (function(y, E, S) {
|
|
593
593
|
const N = y._nodeMap, b = [];
|
|
594
|
-
for (const
|
|
595
|
-
const
|
|
596
|
-
|
|
594
|
+
for (const L of E) {
|
|
595
|
+
const _ = N.get(L);
|
|
596
|
+
_ !== void 0 && b.push(_);
|
|
597
597
|
}
|
|
598
|
-
for (const [
|
|
599
|
-
if (!
|
|
600
|
-
const P = N.get(
|
|
601
|
-
P === void 0 ||
|
|
598
|
+
for (const [L, _] of S) {
|
|
599
|
+
if (!_) continue;
|
|
600
|
+
const P = N.get(L);
|
|
601
|
+
P === void 0 || Ae(P) || b.push(P);
|
|
602
602
|
}
|
|
603
603
|
return b;
|
|
604
604
|
})(e, t, o);
|
|
605
605
|
if (i.length === 0) return $;
|
|
606
606
|
if (i.length > 1) {
|
|
607
|
-
const y = e._nodeMap, E = y.get(n.anchor.key),
|
|
608
|
-
return E &&
|
|
607
|
+
const y = e._nodeMap, E = y.get(n.anchor.key), S = y.get(s.anchor.key);
|
|
608
|
+
return E && S && !r._nodeMap.has(E.__key) && I(E) && E.__text.length === 1 && n.anchor.offset === 1 ? Pe : $;
|
|
609
609
|
}
|
|
610
610
|
const l = i[0], c = r._nodeMap.get(l.__key);
|
|
611
|
-
if (!
|
|
611
|
+
if (!I(c) || !I(l) || c.__mode !== l.__mode) return $;
|
|
612
612
|
const u = c.__text, d = l.__text;
|
|
613
613
|
if (u === d) return $;
|
|
614
614
|
const f = n.anchor, v = s.anchor;
|
|
615
615
|
if (f.key !== v.key || f.type !== "text") return $;
|
|
616
616
|
const C = f.offset, w = v.offset, x = d.length - u.length;
|
|
617
|
-
return x === 1 && w === C - 1 ?
|
|
617
|
+
return x === 1 && w === C - 1 ? Pe : x === -1 && w === C + 1 ? Gr : x === -1 && w === C ? Qr : $;
|
|
618
618
|
}
|
|
619
619
|
function Zr(r, e) {
|
|
620
620
|
let t = Date.now(), o = $;
|
|
@@ -622,70 +622,70 @@ function Zr(r, e) {
|
|
|
622
622
|
const u = Date.now();
|
|
623
623
|
if (c.has(se)) return o = $, t = u, ce;
|
|
624
624
|
const d = Vr(a, n, i, l, r.isComposing()), f = (() => {
|
|
625
|
-
const v = s === null || s.editor === r, C = c.has(
|
|
626
|
-
if (!C && v && c.has(de)) return
|
|
625
|
+
const v = s === null || s.editor === r, C = c.has(At);
|
|
626
|
+
if (!C && v && c.has(de)) return Z;
|
|
627
627
|
if (a === null) return ue;
|
|
628
628
|
const w = n._selection;
|
|
629
629
|
return i.size > 0 || l.size > 0 ? C === !1 && d !== $ && d === o && u < t + e && v || i.size === 1 && (function(x, y, E) {
|
|
630
|
-
const
|
|
631
|
-
return !(g(b) && g(
|
|
632
|
-
})(Array.from(i)[0], a, n) ?
|
|
630
|
+
const S = y._nodeMap.get(x), N = E._nodeMap.get(x), b = y._selection, L = E._selection;
|
|
631
|
+
return !(g(b) && g(L) && b.anchor.type === "element" && b.focus.type === "element" && L.anchor.type === "text" && L.focus.type === "text" || !I(S) || !I(N) || S.__parent !== N.__parent) && JSON.stringify(y.read((() => S.exportJSON()))) === JSON.stringify(E.read((() => N.exportJSON())));
|
|
632
|
+
})(Array.from(i)[0], a, n) ? Z : ue : w !== null ? Z : ce;
|
|
633
633
|
})();
|
|
634
634
|
return t = u, o = d, f;
|
|
635
635
|
};
|
|
636
636
|
}
|
|
637
|
-
function
|
|
637
|
+
function Re(r) {
|
|
638
638
|
r.undoStack = [], r.redoStack = [], r.current = null;
|
|
639
639
|
}
|
|
640
|
-
function
|
|
640
|
+
function en(r, e, t) {
|
|
641
641
|
const o = Zr(r, t);
|
|
642
|
-
return U(r.registerCommand(
|
|
642
|
+
return U(r.registerCommand(zt, (() => ((function(n, s) {
|
|
643
643
|
const i = s.redoStack, l = s.undoStack;
|
|
644
644
|
if (l.length !== 0) {
|
|
645
645
|
const c = s.current, u = l.pop();
|
|
646
|
-
c !== null && (i.push(c), n.dispatchCommand(
|
|
646
|
+
c !== null && (i.push(c), n.dispatchCommand(X, !0)), l.length === 0 && n.dispatchCommand(G, !1), s.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: se });
|
|
647
647
|
}
|
|
648
648
|
})(r, e), !0)), m), r.registerCommand(Ot, (() => ((function(n, s) {
|
|
649
649
|
const i = s.redoStack, l = s.undoStack;
|
|
650
650
|
if (i.length !== 0) {
|
|
651
651
|
const c = s.current;
|
|
652
|
-
c !== null && (l.push(c), n.dispatchCommand(
|
|
652
|
+
c !== null && (l.push(c), n.dispatchCommand(G, !0));
|
|
653
653
|
const u = i.pop();
|
|
654
|
-
i.length === 0 && n.dispatchCommand(
|
|
654
|
+
i.length === 0 && n.dispatchCommand(X, !1), s.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: se });
|
|
655
655
|
}
|
|
656
|
-
})(r, e), !0)), m), r.registerCommand(
|
|
656
|
+
})(r, e), !0)), m), r.registerCommand(Kt, (() => (Re(e), !1)), m), r.registerCommand(Mt, (() => (Re(e), r.dispatchCommand(X, !1), r.dispatchCommand(G, !1), !0)), m), r.registerUpdateListener((({ editorState: n, prevEditorState: s, dirtyLeaves: i, dirtyElements: l, tags: c }) => {
|
|
657
657
|
const u = e.current, d = e.redoStack, f = e.undoStack, v = u === null ? null : u.editorState;
|
|
658
658
|
if (u !== null && n === v) return;
|
|
659
659
|
const C = o(s, n, u, i, l, c);
|
|
660
|
-
if (C === ue) d.length !== 0 && (e.redoStack = [], r.dispatchCommand(
|
|
660
|
+
if (C === ue) d.length !== 0 && (e.redoStack = [], r.dispatchCommand(X, !1)), u !== null && (f.push({ ...u }), r.dispatchCommand(G, !0));
|
|
661
661
|
else if (C === ce) return;
|
|
662
662
|
e.current = { editor: r, editorState: n };
|
|
663
663
|
})));
|
|
664
664
|
}
|
|
665
|
-
function
|
|
665
|
+
function tn() {
|
|
666
666
|
return { current: null, redoStack: [], undoStack: [] };
|
|
667
667
|
}
|
|
668
|
-
function
|
|
669
|
-
const [t] =
|
|
668
|
+
function rn({ delay: r, externalHistoryState: e }) {
|
|
669
|
+
const [t] = M();
|
|
670
670
|
return (function(o, a, n = 1e3) {
|
|
671
|
-
const s = te((() => a ||
|
|
672
|
-
k((() =>
|
|
671
|
+
const s = te((() => a || tn()), [a]);
|
|
672
|
+
k((() => en(o, s, n)), [n, o, s]);
|
|
673
673
|
})(t, e, r), null;
|
|
674
674
|
}
|
|
675
|
-
function
|
|
676
|
-
const [a] =
|
|
675
|
+
function nn({ hasCellMerge: r = !0, hasCellBackgroundColor: e = !0, hasTabHandler: t = !0, hasHorizontalScroll: o = !1 }) {
|
|
676
|
+
const [a] = M();
|
|
677
677
|
return k((() => {
|
|
678
|
-
|
|
678
|
+
er(a) !== o && (tr(a, o), a.registerNodeTransform(He, (() => {
|
|
679
679
|
}))());
|
|
680
|
-
}), [a, o]), k((() =>
|
|
681
|
-
if (!r) return
|
|
680
|
+
}), [a, o]), k((() => rr(a)), [a]), k((() => nr(a, t)), [a, t]), k((() => {
|
|
681
|
+
if (!r) return or(a);
|
|
682
682
|
}), [a, r]), k((() => {
|
|
683
|
-
if (!e) return a.registerNodeTransform(
|
|
683
|
+
if (!e) return a.registerNodeTransform(Je, ((n) => {
|
|
684
684
|
n.getBackgroundColor() !== null && n.setBackgroundColor(null);
|
|
685
685
|
}));
|
|
686
686
|
}), [a, e, r]), null;
|
|
687
687
|
}
|
|
688
|
-
const
|
|
688
|
+
const Xe = 200, on = ({
|
|
689
689
|
currentLanguage: r = "NL",
|
|
690
690
|
initialValue: e = "",
|
|
691
691
|
placeholder: t = "",
|
|
@@ -694,61 +694,61 @@ const qe = 200, nn = ({
|
|
|
694
694
|
required: n = !1,
|
|
695
695
|
notValidatedText: s = "",
|
|
696
696
|
maxHeightInRem: i = "20rem",
|
|
697
|
-
maxWords: l =
|
|
697
|
+
maxWords: l = Xe,
|
|
698
698
|
onChange: c
|
|
699
699
|
}) => {
|
|
700
|
-
const { switchLanguage: u } =
|
|
700
|
+
const { switchLanguage: u } = wr(), d = gr(), [f] = K(() => Me()), [v, C] = K(0), [w, x] = K(0), y = Ut(null), E = {
|
|
701
701
|
html: {
|
|
702
|
-
export:
|
|
702
|
+
export: cr
|
|
703
703
|
},
|
|
704
704
|
namespace: "UvaRte",
|
|
705
705
|
editor: f,
|
|
706
|
-
theme:
|
|
706
|
+
theme: Cr,
|
|
707
707
|
onError(b) {
|
|
708
708
|
throw b;
|
|
709
709
|
},
|
|
710
|
-
nodes: [
|
|
710
|
+
nodes: [Be, Ue, je, Zt, Je, ar, He, br],
|
|
711
711
|
editorState: (b) => {
|
|
712
|
-
const
|
|
713
|
-
if (
|
|
712
|
+
const _ = new DOMParser().parseFromString(e, "text/html"), P = qt(b, _), O = F();
|
|
713
|
+
if (O.clear(), dr(e))
|
|
714
714
|
P.forEach((B) => {
|
|
715
|
-
|
|
715
|
+
O.append(B);
|
|
716
716
|
});
|
|
717
717
|
else {
|
|
718
|
-
const B =
|
|
719
|
-
P.forEach((
|
|
720
|
-
|
|
718
|
+
const B = Ke();
|
|
719
|
+
P.forEach((D, Y) => {
|
|
720
|
+
Y === 0 ? (B.append(D), O.append(B)) : O.append(D);
|
|
721
721
|
});
|
|
722
722
|
}
|
|
723
723
|
}
|
|
724
|
-
},
|
|
724
|
+
}, S = (b) => b.trim().length === 0 ? 0 : b.split(" ").length, N = (b, L) => {
|
|
725
725
|
b.read(() => {
|
|
726
|
-
let
|
|
727
|
-
C(
|
|
726
|
+
let _ = "";
|
|
727
|
+
C(S(F().getTextContent().replace(/\s+/g, " ").trim())), _ = fr(Xt(L)), _ = mr(_), c(_);
|
|
728
728
|
});
|
|
729
729
|
};
|
|
730
730
|
return k(() => {
|
|
731
731
|
u(r.toLocaleLowerCase());
|
|
732
732
|
}, [r, u]), k(() => {
|
|
733
733
|
const b = e.replace(/<br\s*\/?>| /gi, " ").replace(/<\/?[^>]+(>|$)|&[a-z]+;/g, "").replace(/\s+/g, " ").trim();
|
|
734
|
-
C(
|
|
734
|
+
C(S(b));
|
|
735
735
|
}, []), /* @__PURE__ */ z("div", { className: R.editor__container, children: [
|
|
736
736
|
/* @__PURE__ */ z("div", { className: R.editor__header, children: [
|
|
737
|
-
/* @__PURE__ */ h(
|
|
737
|
+
/* @__PURE__ */ h(yr, { label: o, info: a, required: n }),
|
|
738
738
|
/* @__PURE__ */ z("div", { className: R["editor__header-word-count"], children: [
|
|
739
|
-
/* @__PURE__ */ h("span", { className:
|
|
739
|
+
/* @__PURE__ */ h("span", { className: ur({ [R["editor__header-word-count--alert"]]: v > l }), children: v }),
|
|
740
740
|
" / ",
|
|
741
741
|
l
|
|
742
742
|
] })
|
|
743
743
|
] }),
|
|
744
744
|
/* @__PURE__ */ h("div", { className: R.editor, children: /* @__PURE__ */ z(_r, { initialConfig: E, children: [
|
|
745
|
-
/* @__PURE__ */ h(
|
|
745
|
+
/* @__PURE__ */ h(pr, { editorScrollPosition: w }),
|
|
746
746
|
/* @__PURE__ */ z("div", { className: R["editor__field-wrapper"], children: [
|
|
747
747
|
/* @__PURE__ */ h(
|
|
748
748
|
Mr,
|
|
749
749
|
{
|
|
750
750
|
contentEditable: /* @__PURE__ */ h(
|
|
751
|
-
|
|
751
|
+
Ar,
|
|
752
752
|
{
|
|
753
753
|
className: R.editor__field,
|
|
754
754
|
"aria-label": d.common.rteAriaLabel,
|
|
@@ -763,23 +763,23 @@ const qe = 200, nn = ({
|
|
|
763
763
|
}
|
|
764
764
|
),
|
|
765
765
|
placeholder: /* @__PURE__ */ h("div", { className: R.editor__placeholder, children: t }),
|
|
766
|
-
ErrorBoundary:
|
|
766
|
+
ErrorBoundary: jr
|
|
767
767
|
}
|
|
768
768
|
),
|
|
769
|
+
/* @__PURE__ */ h(nn, {}),
|
|
770
|
+
/* @__PURE__ */ h(Ht, {}),
|
|
769
771
|
/* @__PURE__ */ h(rn, {}),
|
|
770
|
-
/* @__PURE__ */ h(
|
|
771
|
-
/* @__PURE__ */ h(
|
|
772
|
-
/* @__PURE__ */ h(
|
|
773
|
-
/* @__PURE__ */ h(
|
|
774
|
-
/* @__PURE__ */ h(
|
|
775
|
-
/* @__PURE__ */ h(
|
|
776
|
-
/* @__PURE__ */ h(Hr, { onChange: N }),
|
|
777
|
-
/* @__PURE__ */ h(hr, {})
|
|
772
|
+
/* @__PURE__ */ h(Wr, {}),
|
|
773
|
+
/* @__PURE__ */ h(Yr, { validateUrl: sr }),
|
|
774
|
+
/* @__PURE__ */ h(ir, { matchers: lr }),
|
|
775
|
+
/* @__PURE__ */ h(qr, {}),
|
|
776
|
+
/* @__PURE__ */ h(Jr, { onChange: N }),
|
|
777
|
+
/* @__PURE__ */ h(vr, {})
|
|
778
778
|
] })
|
|
779
779
|
] }) }),
|
|
780
|
-
s !== "" && /* @__PURE__ */ h(
|
|
780
|
+
s !== "" && /* @__PURE__ */ h(hr, { level: "error", feedback: s })
|
|
781
781
|
] });
|
|
782
|
-
},
|
|
782
|
+
}, Qn = ({
|
|
783
783
|
currentLanguage: r = "NL",
|
|
784
784
|
initialValue: e = "",
|
|
785
785
|
placeholder: t = "",
|
|
@@ -787,10 +787,10 @@ const qe = 200, nn = ({
|
|
|
787
787
|
info: a = "",
|
|
788
788
|
required: n = !1,
|
|
789
789
|
notValidatedText: s = "",
|
|
790
|
-
maxWords: i =
|
|
790
|
+
maxWords: i = Xe,
|
|
791
791
|
onChange: l
|
|
792
|
-
}) => /* @__PURE__ */ h(
|
|
793
|
-
|
|
792
|
+
}) => /* @__PURE__ */ h(Er, { children: /* @__PURE__ */ h(
|
|
793
|
+
on,
|
|
794
794
|
{
|
|
795
795
|
currentLanguage: r,
|
|
796
796
|
initialValue: e,
|
|
@@ -804,7 +804,7 @@ const qe = 200, nn = ({
|
|
|
804
804
|
}
|
|
805
805
|
) });
|
|
806
806
|
export {
|
|
807
|
-
|
|
808
|
-
|
|
807
|
+
on as Rte,
|
|
808
|
+
Qn as RteEditor
|
|
809
809
|
};
|
|
810
810
|
//# sourceMappingURL=RteEditor.js.map
|