@uva-glass/component-library 2.6.0 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Lexical.prod-BAr6tzpa.js +4236 -0
- package/dist/Lexical.prod-BAr6tzpa.js.map +1 -0
- package/dist/{LexicalClipboard.prod-Dg23ixPD.js → LexicalClipboard.prod-CLCBYtDj.js} +56 -56
- package/dist/LexicalClipboard.prod-CLCBYtDj.js.map +1 -0
- package/dist/LexicalLink.prod-CBgZ4B3x.js +263 -0
- package/dist/LexicalLink.prod-CBgZ4B3x.js.map +1 -0
- package/dist/LexicalList.prod-haeqjypw.js +576 -0
- package/dist/LexicalList.prod-haeqjypw.js.map +1 -0
- package/dist/{LexicalSelection.prod-CNWFGVlh.js → LexicalSelection.prod-C8x7KK4L.js} +38 -38
- package/dist/LexicalSelection.prod-C8x7KK4L.js.map +1 -0
- package/dist/LexicalTable.prod-8RqiGUG-.js +1447 -0
- package/dist/LexicalTable.prod-8RqiGUG-.js.map +1 -0
- package/dist/LexicalUtils.prod-Dsec_Kl-.js +122 -0
- package/dist/LexicalUtils.prod-Dsec_Kl-.js.map +1 -0
- package/dist/{TablePlugin-E6UFlCgy.js → TablePlugin-sPSGmCno.js} +69 -69
- package/dist/{TablePlugin-E6UFlCgy.js.map → TablePlugin-sPSGmCno.js.map} +1 -1
- package/dist/assets/CheckboxTree.css +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.js +42 -42
- package/dist/components/FormInput/FormInput.js +1 -1
- package/dist/components/InputField/InputField.stories.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/OverlayStepBar/OverlayStepBar.js +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +3 -3
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +2 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +2 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +37 -37
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +23 -23
- 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 +26 -26
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +17 -17
- package/dist/components/RteEditor/Plugins/index.js +1 -1
- package/dist/components/RteEditor/RteEditor.js +501 -557
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/RteEditor/helpers.js +11 -11
- package/dist/components/index.js +1 -1
- package/dist/{helpers-BVGma1u6.js → helpers-DHHQR5ys.js} +44 -44
- package/dist/{helpers-BVGma1u6.js.map → helpers-DHHQR5ys.js.map} +1 -1
- package/dist/index.js +1 -1
- package/package.json +16 -16
- package/dist/Lexical.prod-Bzma_w4s.js +0 -4216
- package/dist/Lexical.prod-Bzma_w4s.js.map +0 -1
- package/dist/LexicalClipboard.prod-Dg23ixPD.js.map +0 -1
- package/dist/LexicalLink.prod-C1RDJLfo.js +0 -208
- package/dist/LexicalLink.prod-C1RDJLfo.js.map +0 -1
- package/dist/LexicalList.prod-BGzfDPU0.js +0 -568
- package/dist/LexicalList.prod-BGzfDPU0.js.map +0 -1
- package/dist/LexicalSelection.prod-CNWFGVlh.js.map +0 -1
- package/dist/LexicalTable.prod-D-4NN9o5.js +0 -1366
- package/dist/LexicalTable.prod-D-4NN9o5.js.map +0 -1
- package/dist/LexicalUtils.prod-Cg2siy-c.js +0 -94
- package/dist/LexicalUtils.prod-Cg2siy-c.js.map +0 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { l as
|
|
3
|
-
import {
|
|
4
|
-
import * as
|
|
5
|
-
import { useMemo as
|
|
6
|
-
import { N as
|
|
7
|
-
import { r as
|
|
8
|
-
import { N as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { a as
|
|
14
|
-
import { c as
|
|
15
|
-
import { exportMap as
|
|
16
|
-
import { s as
|
|
17
|
-
import { ToolBarPlugin as
|
|
18
|
-
import { useTranslation as
|
|
19
|
-
import "../../TablePlugin-
|
|
1
|
+
import { jsx as h, jsxs as K, Fragment as Te } from "react/jsx-runtime";
|
|
2
|
+
import { l as Je, o as Xe, u as P } from "../../LexicalComposerContext.prod-Dyvim1tK.js";
|
|
3
|
+
import { ap as Re, a2 as A, V as Me, H as p, I as H, L as V, j as Ge, v as M, a as g, N as Ye, f as m, aq as Ze, a1 as Ie, F as Oe, ar as Qe, B as et, ao as F, am as tt, as as nt, at as rt, au as ot, d as ne, av as it, aw as at, w as st, i as lt, M as ct, k as ut, ax as dt, ay as fe, o as me, U as ft, R as re, T as mt, a6 as Fe, az as pe, D as pt, C as gt, S as ht, a5 as ge, z as vt, aA as Ct, aB as yt, aC as Et, ak as wt, m as bt, l as $t, aD as St, p as _t, K as kt, G as xt, a8 as Nt, e as Lt, q as he, aE as Dt, E as Pt, aa as G, a9 as Y, aF as Tt, aG as Rt, ac as Mt, ab as It } from "../../Lexical.prod-BAr6tzpa.js";
|
|
4
|
+
import * as oe from "react";
|
|
5
|
+
import { useMemo as W, useLayoutEffect as j, useEffect as _, useState as I, useRef as Ke, Suspense as Ot, forwardRef as ze, useCallback as Ft } from "react";
|
|
6
|
+
import { N as U, c as z, o as Kt, r as de } from "../../LexicalUtils.prod-Dsec_Kl-.js";
|
|
7
|
+
import { r as zt } from "../../index-B9BWML6P.js";
|
|
8
|
+
import { N as ve, O as Ce, h as At, m as Bt } from "../../LexicalClipboard.prod-CLCBYtDj.js";
|
|
9
|
+
import { M as ye, j as Ee } from "../../LexicalSelection.prod-C8x7KK4L.js";
|
|
10
|
+
import { V as Ae, I as Be, Z as jt } from "../../LexicalList.prod-haeqjypw.js";
|
|
11
|
+
import { f as je, N as we, x as ie, m as Ut, O as qt } from "../../LexicalLink.prod-CBgZ4B3x.js";
|
|
12
|
+
import { a as Ht, j as Vt, X as Wt, q as Jt, u as Ue, S as Xt, P as Gt } from "../../LexicalTable.prod-8RqiGUG-.js";
|
|
13
|
+
import { a as Yt, F as Zt, M as Qt } from "../../helpers-DHHQR5ys.js";
|
|
14
|
+
import { c as en } from "../../clsx-OuTLNxxd.js";
|
|
15
|
+
import { exportMap as tn, isStartingWithHtmlTag as nn, mergeBoldStrongTags as rn } from "./helpers.js";
|
|
16
|
+
import { s as R } from "../../RteEditor.module-oFMKEW6f.js";
|
|
17
|
+
import { ToolBarPlugin as on } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
|
|
18
|
+
import { useTranslation as an } from "./hooks/useTranslation.js";
|
|
19
|
+
import "../../TablePlugin-sPSGmCno.js";
|
|
20
20
|
import "./Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js";
|
|
21
21
|
import "./hooks/components/Flyout.js";
|
|
22
22
|
import "../Buttons/Button.js";
|
|
@@ -26,7 +26,7 @@ import "@react-aria/dialog";
|
|
|
26
26
|
import "@react-aria/focus";
|
|
27
27
|
import "@react-aria/overlays";
|
|
28
28
|
import "../OverlayCloseButton/OverlayCloseButton.js";
|
|
29
|
-
import { FeedbackBox as
|
|
29
|
+
import { FeedbackBox as sn } from "../FeedbackBox/FeedbackBox.js";
|
|
30
30
|
import "../GridRow/GridRow.js";
|
|
31
31
|
import "../IconButton/IconButton.js";
|
|
32
32
|
import "../Input/Input.js";
|
|
@@ -36,129 +36,129 @@ import "../SelectListbox/SelectListbox.js";
|
|
|
36
36
|
import "../SelectListbox/SelectProvider.js";
|
|
37
37
|
import "../Sortable/components/SortableItem.js";
|
|
38
38
|
import "../../SortableProvider-BUsvniX7.js";
|
|
39
|
-
import { UvaTheme as
|
|
40
|
-
import { EditorHeader as
|
|
41
|
-
import { useLanguage as
|
|
42
|
-
import { PasteHandlerPlugin as
|
|
43
|
-
const qe = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0,
|
|
44
|
-
function
|
|
45
|
-
const n =
|
|
46
|
-
const { theme: o, namespace: i, nodes: r, onError:
|
|
47
|
-
return function(
|
|
48
|
-
if (
|
|
49
|
-
if (
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
(
|
|
39
|
+
import { UvaTheme as ln } from "./UvaTheme/UvaTheme.js";
|
|
40
|
+
import { EditorHeader as cn } from "./EditorHeader/EditorHeader.js";
|
|
41
|
+
import { useLanguage as un, LanguageProvider as dn } from "./Providers/LanguageProvider.js";
|
|
42
|
+
import { PasteHandlerPlugin as fn } from "./Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js";
|
|
43
|
+
const qe = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, mn = qe ? j : _, Z = { tag: "history-merge" };
|
|
44
|
+
function pn({ initialConfig: t, children: e }) {
|
|
45
|
+
const n = W(() => {
|
|
46
|
+
const { theme: o, namespace: i, nodes: r, onError: a, editorState: s, html: l } = t, c = Xe(null, o), u = Re({ editable: t.editable, html: l, namespace: i, nodes: r, onError: (d) => a(d, u), theme: o });
|
|
47
|
+
return function(d, f) {
|
|
48
|
+
if (f !== null) {
|
|
49
|
+
if (f === void 0) d.update(() => {
|
|
50
|
+
const v = A();
|
|
51
|
+
if (v.isEmpty()) {
|
|
52
|
+
const C = Me();
|
|
53
|
+
v.append(C);
|
|
54
|
+
const w = qe ? document.activeElement : null;
|
|
55
|
+
(p() !== null || w !== null && w === d.getRootElement()) && C.select();
|
|
56
56
|
}
|
|
57
|
-
},
|
|
58
|
-
else if (
|
|
57
|
+
}, Z);
|
|
58
|
+
else if (f !== null) switch (typeof f) {
|
|
59
59
|
case "string": {
|
|
60
|
-
const
|
|
61
|
-
|
|
60
|
+
const v = d.parseEditorState(f);
|
|
61
|
+
d.setEditorState(v, Z);
|
|
62
62
|
break;
|
|
63
63
|
}
|
|
64
64
|
case "object":
|
|
65
|
-
|
|
65
|
+
d.setEditorState(f, Z);
|
|
66
66
|
break;
|
|
67
67
|
case "function":
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
},
|
|
68
|
+
d.update(() => {
|
|
69
|
+
A().isEmpty() && f(d);
|
|
70
|
+
}, Z);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
}(
|
|
73
|
+
}(u, s), [u, c];
|
|
74
74
|
}, []);
|
|
75
|
-
return
|
|
75
|
+
return mn(() => {
|
|
76
76
|
const o = t.editable, [i] = n;
|
|
77
77
|
i.setEditable(o === void 0 || o);
|
|
78
|
-
}, []),
|
|
78
|
+
}, []), h(Je.Provider, { value: n, children: e });
|
|
79
79
|
}
|
|
80
|
-
const
|
|
81
|
-
function
|
|
80
|
+
const gn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? j : _;
|
|
81
|
+
function hn(t) {
|
|
82
82
|
return { initialValueFn: () => t.isEditable(), subscribe: (e) => t.registerEditableListener(e) };
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function vn() {
|
|
85
85
|
return function(t) {
|
|
86
|
-
const [e] =
|
|
87
|
-
return
|
|
88
|
-
const { initialValueFn:
|
|
89
|
-
return r.current !== l && (r.current = l, i(l)),
|
|
86
|
+
const [e] = P(), n = W(() => t(e), [e, t]), [o, i] = I(() => n.initialValueFn()), r = Ke(o);
|
|
87
|
+
return gn(() => {
|
|
88
|
+
const { initialValueFn: a, subscribe: s } = n, l = a();
|
|
89
|
+
return r.current !== l && (r.current = l, i(l)), s((c) => {
|
|
90
90
|
r.current = c, i(c);
|
|
91
91
|
});
|
|
92
92
|
}, [n, t]), o;
|
|
93
|
-
}(
|
|
93
|
+
}(hn);
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
return
|
|
95
|
+
function Cn() {
|
|
96
|
+
return A().getTextContent();
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function yn(t, e = !0) {
|
|
99
99
|
if (t) return !1;
|
|
100
|
-
let n =
|
|
100
|
+
let n = Cn();
|
|
101
101
|
return e && (n = n.trim()), n === "";
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
if (!
|
|
105
|
-
const e =
|
|
103
|
+
function En(t) {
|
|
104
|
+
if (!yn(t, !1)) return !1;
|
|
105
|
+
const e = A().getChildren(), n = e.length;
|
|
106
106
|
if (n > 1) return !1;
|
|
107
107
|
for (let o = 0; o < n; o++) {
|
|
108
108
|
const i = e[o];
|
|
109
|
-
if (
|
|
110
|
-
if (
|
|
111
|
-
if (!
|
|
112
|
-
const r = i.getChildren(),
|
|
113
|
-
for (let
|
|
109
|
+
if (H(i)) return !1;
|
|
110
|
+
if (V(i)) {
|
|
111
|
+
if (!Ge(i) || i.__indent !== 0) return !1;
|
|
112
|
+
const r = i.getChildren(), a = r.length;
|
|
113
|
+
for (let s = 0; s < a; s++) {
|
|
114
114
|
const l = r[o];
|
|
115
|
-
if (!
|
|
115
|
+
if (!M(l)) return !1;
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
return !0;
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
return () =>
|
|
121
|
+
function He(t) {
|
|
122
|
+
return () => En(t);
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function wn(t) {
|
|
125
125
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
126
126
|
}
|
|
127
|
-
|
|
127
|
+
wn(function(t) {
|
|
128
128
|
const e = new URLSearchParams();
|
|
129
129
|
e.append("code", t);
|
|
130
130
|
for (let n = 1; n < arguments.length; n++) e.append("v", arguments[n]);
|
|
131
131
|
throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
132
132
|
});
|
|
133
|
-
var
|
|
134
|
-
function
|
|
133
|
+
var be = zt();
|
|
134
|
+
function bn(t) {
|
|
135
135
|
const e = window.location.origin, n = (o) => {
|
|
136
136
|
if (o.origin !== e) return;
|
|
137
137
|
const i = t.getRootElement();
|
|
138
138
|
if (document.activeElement !== i) return;
|
|
139
139
|
const r = o.data;
|
|
140
140
|
if (typeof r == "string") {
|
|
141
|
-
let
|
|
141
|
+
let a;
|
|
142
142
|
try {
|
|
143
|
-
|
|
143
|
+
a = JSON.parse(r);
|
|
144
144
|
} catch {
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
|
-
if (
|
|
148
|
-
const
|
|
149
|
-
if (
|
|
150
|
-
const l =
|
|
147
|
+
if (a && a.protocol === "nuanria_messaging" && a.type === "request") {
|
|
148
|
+
const s = a.payload;
|
|
149
|
+
if (s && s.functionId === "makeChanges") {
|
|
150
|
+
const l = s.args;
|
|
151
151
|
if (l) {
|
|
152
|
-
const [c, d, f,
|
|
152
|
+
const [c, u, d, f, v, C] = l;
|
|
153
153
|
t.update(() => {
|
|
154
|
-
const
|
|
155
|
-
if (
|
|
156
|
-
const
|
|
157
|
-
let
|
|
158
|
-
if (
|
|
159
|
-
|
|
160
|
-
const
|
|
161
|
-
|
|
154
|
+
const w = p();
|
|
155
|
+
if (g(w)) {
|
|
156
|
+
const k = w.anchor;
|
|
157
|
+
let y = k.getNode(), E = 0, $ = 0;
|
|
158
|
+
if (M(y) && c >= 0 && u >= 0 && (E = c, $ = c + u, w.setTextNodeRange(y, E, y, $)), E === $ && d === "" || (w.insertRawText(d), y = k.getNode()), M(y)) {
|
|
159
|
+
E = f, $ = f + v;
|
|
160
|
+
const x = y.getTextContentSize();
|
|
161
|
+
E = E > x ? x : E, $ = $ > x ? x : $, w.setTextNodeRange(y, E, y, $);
|
|
162
162
|
}
|
|
163
163
|
o.stopImmediatePropagation();
|
|
164
164
|
}
|
|
@@ -172,7 +172,7 @@ function Ln(t) {
|
|
|
172
172
|
window.removeEventListener("message", n, !0);
|
|
173
173
|
};
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function $e(t, e) {
|
|
176
176
|
if (document.caretRangeFromPoint !== void 0) {
|
|
177
177
|
const n = document.caretRangeFromPoint(t, e);
|
|
178
178
|
return n === null ? null : { node: n.startContainer, offset: n.startOffset };
|
|
@@ -183,679 +183,623 @@ function Ne(t, e) {
|
|
|
183
183
|
}
|
|
184
184
|
return null;
|
|
185
185
|
}
|
|
186
|
-
const
|
|
186
|
+
const q = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, $n = q && "documentMode" in document ? document.documentMode : null, Sn = !(!q || !("InputEvent" in window) || $n) && "getTargetRanges" in new window.InputEvent("input"), _n = q && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Se = q && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, kn = q && /^(?=.*Chrome).*/i.test(navigator.userAgent), xn = q && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !kn, _e = Lt();
|
|
187
187
|
function Q(t) {
|
|
188
188
|
let e = null;
|
|
189
|
-
if (
|
|
189
|
+
if (z(t, DragEvent) ? e = t.dataTransfer : z(t, ClipboardEvent) && (e = t.clipboardData), e === null) return [!1, [], !1];
|
|
190
190
|
const n = e.types, o = n.includes("Files"), i = n.includes("text/html") || n.includes("text/plain");
|
|
191
191
|
return [o, Array.from(e.files), i];
|
|
192
192
|
}
|
|
193
|
-
function
|
|
194
|
-
const e =
|
|
195
|
-
if (!
|
|
193
|
+
function ke(t) {
|
|
194
|
+
const e = p();
|
|
195
|
+
if (!g(e)) return !1;
|
|
196
196
|
const n = /* @__PURE__ */ new Set(), o = e.getNodes();
|
|
197
197
|
for (let i = 0; i < o.length; i++) {
|
|
198
|
-
const r = o[i],
|
|
199
|
-
if (n.has(
|
|
200
|
-
const
|
|
201
|
-
if (
|
|
202
|
-
const l =
|
|
203
|
-
|
|
198
|
+
const r = o[i], a = r.getKey();
|
|
199
|
+
if (n.has(a)) continue;
|
|
200
|
+
const s = de(r, (c) => V(c) && !c.isInline());
|
|
201
|
+
if (s === null) continue;
|
|
202
|
+
const l = s.getKey();
|
|
203
|
+
s.canIndent() && !n.has(l) && (n.add(l), t(s));
|
|
204
204
|
}
|
|
205
205
|
return n.size > 0;
|
|
206
206
|
}
|
|
207
207
|
function ee(t) {
|
|
208
|
-
const e =
|
|
209
|
-
return
|
|
210
|
-
}
|
|
211
|
-
function
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
const n =
|
|
217
|
-
return !!
|
|
218
|
-
},
|
|
219
|
-
const n =
|
|
220
|
-
return !!
|
|
221
|
-
},
|
|
222
|
-
const n =
|
|
223
|
-
return !!
|
|
224
|
-
},
|
|
225
|
-
const n =
|
|
208
|
+
const e = ne(t);
|
|
209
|
+
return H(e);
|
|
210
|
+
}
|
|
211
|
+
function ae(t) {
|
|
212
|
+
for (const e of ["lowercase", "uppercase", "capitalize"]) t.hasFormat(e) && t.toggleFormat(e);
|
|
213
|
+
}
|
|
214
|
+
function Nn(t) {
|
|
215
|
+
return U(t.registerCommand(Nt, (e) => {
|
|
216
|
+
const n = p();
|
|
217
|
+
return !!F(n) && (n.clear(), !0);
|
|
218
|
+
}, 0), t.registerCommand(re, (e) => {
|
|
219
|
+
const n = p();
|
|
220
|
+
return !!g(n) && (n.deleteCharacter(e), !0);
|
|
221
|
+
}, m), t.registerCommand(xt, (e) => {
|
|
222
|
+
const n = p();
|
|
223
|
+
return !!g(n) && (n.deleteWord(e), !0);
|
|
224
|
+
}, m), t.registerCommand(kt, (e) => {
|
|
225
|
+
const n = p();
|
|
226
|
+
return !!g(n) && (n.deleteLine(e), !0);
|
|
227
|
+
}, m), t.registerCommand(_t, (e) => {
|
|
228
|
+
const n = p();
|
|
226
229
|
if (typeof e == "string") n !== null && n.insertText(e);
|
|
227
230
|
else {
|
|
228
231
|
if (n === null) return !1;
|
|
229
232
|
const o = e.dataTransfer;
|
|
230
|
-
if (o != null)
|
|
231
|
-
else if (
|
|
233
|
+
if (o != null) ve(o, n, t);
|
|
234
|
+
else if (g(n)) {
|
|
232
235
|
const i = e.data;
|
|
233
236
|
return i && n.insertText(i), !0;
|
|
234
237
|
}
|
|
235
238
|
}
|
|
236
239
|
return !0;
|
|
237
|
-
},
|
|
238
|
-
const e =
|
|
239
|
-
return !!
|
|
240
|
-
},
|
|
241
|
-
const n =
|
|
242
|
-
return !!
|
|
243
|
-
},
|
|
244
|
-
const n =
|
|
245
|
-
if (!
|
|
240
|
+
}, m), t.registerCommand(St, () => {
|
|
241
|
+
const e = p();
|
|
242
|
+
return !!g(e) && (e.removeText(), !0);
|
|
243
|
+
}, m), t.registerCommand($t, (e) => {
|
|
244
|
+
const n = p();
|
|
245
|
+
return !!g(n) && (n.formatText(e), !0);
|
|
246
|
+
}, m), t.registerCommand(bt, (e) => {
|
|
247
|
+
const n = p();
|
|
248
|
+
if (!g(n) && !F(n)) return !1;
|
|
246
249
|
const o = n.getNodes();
|
|
247
250
|
for (const i of o) {
|
|
248
|
-
const r =
|
|
251
|
+
const r = de(i, (a) => V(a) && !a.isInline());
|
|
249
252
|
r !== null && r.setFormat(e);
|
|
250
253
|
}
|
|
251
254
|
return !0;
|
|
252
|
-
},
|
|
253
|
-
const n =
|
|
254
|
-
return !!
|
|
255
|
-
},
|
|
256
|
-
const e =
|
|
257
|
-
return !!
|
|
258
|
-
},
|
|
255
|
+
}, m), t.registerCommand(fe, (e) => {
|
|
256
|
+
const n = p();
|
|
257
|
+
return !!g(n) && (n.insertLineBreak(e), !0);
|
|
258
|
+
}, m), t.registerCommand(me, () => {
|
|
259
|
+
const e = p();
|
|
260
|
+
return !!g(e) && (e.insertParagraph(), !0);
|
|
261
|
+
}, m), t.registerCommand(yt, () => (Et([wt()]), !0), m), t.registerCommand(Ct, () => ke((e) => {
|
|
259
262
|
const n = e.getIndent();
|
|
260
263
|
e.setIndent(n + 1);
|
|
261
|
-
}),
|
|
264
|
+
}), m), t.registerCommand(pe, () => ke((e) => {
|
|
262
265
|
const n = e.getIndent();
|
|
263
266
|
n > 0 && e.setIndent(n - 1);
|
|
264
|
-
}),
|
|
265
|
-
const n =
|
|
266
|
-
if (
|
|
267
|
+
}), m), t.registerCommand(vt, (e) => {
|
|
268
|
+
const n = p();
|
|
269
|
+
if (F(n) && !ee(e.target)) {
|
|
267
270
|
const o = n.getNodes();
|
|
268
271
|
if (o.length > 0) return o[0].selectPrevious(), !0;
|
|
269
|
-
} else if (
|
|
270
|
-
const o =
|
|
271
|
-
if (!e.shiftKey &&
|
|
272
|
+
} else if (g(n)) {
|
|
273
|
+
const o = ge(n.focus, !0);
|
|
274
|
+
if (!e.shiftKey && H(o) && !o.isIsolated() && !o.isInline()) return o.selectPrevious(), e.preventDefault(), !0;
|
|
272
275
|
}
|
|
273
276
|
return !1;
|
|
274
|
-
},
|
|
275
|
-
const n =
|
|
276
|
-
if (
|
|
277
|
+
}, m), t.registerCommand(ht, (e) => {
|
|
278
|
+
const n = p();
|
|
279
|
+
if (F(n)) {
|
|
277
280
|
const o = n.getNodes();
|
|
278
281
|
if (o.length > 0) return o[0].selectNext(0, 0), !0;
|
|
279
|
-
} else if (
|
|
282
|
+
} else if (g(n)) {
|
|
280
283
|
if (function(i) {
|
|
281
284
|
const r = i.focus;
|
|
282
|
-
return r.key === "root" && r.offset ===
|
|
285
|
+
return r.key === "root" && r.offset === A().getChildrenSize();
|
|
283
286
|
}(n)) return e.preventDefault(), !0;
|
|
284
|
-
const o =
|
|
285
|
-
if (!e.shiftKey &&
|
|
287
|
+
const o = ge(n.focus, !1);
|
|
288
|
+
if (!e.shiftKey && H(o) && !o.isIsolated() && !o.isInline()) return o.selectNext(), e.preventDefault(), !0;
|
|
286
289
|
}
|
|
287
290
|
return !1;
|
|
288
|
-
},
|
|
289
|
-
const n =
|
|
290
|
-
if (
|
|
291
|
+
}, m), t.registerCommand(gt, (e) => {
|
|
292
|
+
const n = p();
|
|
293
|
+
if (F(n)) {
|
|
291
294
|
const o = n.getNodes();
|
|
292
295
|
if (o.length > 0) return e.preventDefault(), o[0].selectPrevious(), !0;
|
|
293
296
|
}
|
|
294
|
-
if (!
|
|
295
|
-
if (
|
|
297
|
+
if (!g(n)) return !1;
|
|
298
|
+
if (ye(n, !0)) {
|
|
296
299
|
const o = e.shiftKey;
|
|
297
|
-
return e.preventDefault(),
|
|
300
|
+
return e.preventDefault(), Ee(n, o, !0), !0;
|
|
298
301
|
}
|
|
299
302
|
return !1;
|
|
300
|
-
},
|
|
301
|
-
const n =
|
|
302
|
-
if (
|
|
303
|
+
}, m), t.registerCommand(pt, (e) => {
|
|
304
|
+
const n = p();
|
|
305
|
+
if (F(n) && !ee(e.target)) {
|
|
303
306
|
const i = n.getNodes();
|
|
304
307
|
if (i.length > 0) return e.preventDefault(), i[0].selectNext(0, 0), !0;
|
|
305
308
|
}
|
|
306
|
-
if (!
|
|
309
|
+
if (!g(n)) return !1;
|
|
307
310
|
const o = e.shiftKey;
|
|
308
|
-
return !!
|
|
309
|
-
},
|
|
311
|
+
return !!ye(n, !1) && (e.preventDefault(), Ee(n, o, !1), !0);
|
|
312
|
+
}, m), t.registerCommand(mt, (e) => {
|
|
310
313
|
if (ee(e.target)) return !1;
|
|
311
|
-
const n =
|
|
312
|
-
if (!
|
|
314
|
+
const n = p();
|
|
315
|
+
if (!g(n)) return !1;
|
|
313
316
|
const { anchor: o } = n, i = o.getNode();
|
|
314
|
-
return n.isCollapsed() && o.offset === 0 && !
|
|
315
|
-
},
|
|
317
|
+
return n.isCollapsed() && o.offset === 0 && !Fe(i) && Kt(i).getIndent() > 0 ? (e.preventDefault(), t.dispatchCommand(pe, void 0)) : (!Se || navigator.language !== "ko-KR") && (e.preventDefault(), t.dispatchCommand(re, !0));
|
|
318
|
+
}, m), t.registerCommand(ft, (e) => {
|
|
316
319
|
if (ee(e.target)) return !1;
|
|
317
|
-
const n =
|
|
318
|
-
return !!
|
|
319
|
-
},
|
|
320
|
-
const n =
|
|
321
|
-
if (!
|
|
322
|
-
if (e !== null) {
|
|
323
|
-
if ((
|
|
324
|
-
if (e.preventDefault(), e.shiftKey) return t.dispatchCommand(
|
|
320
|
+
const n = p();
|
|
321
|
+
return !!g(n) && (e.preventDefault(), t.dispatchCommand(re, !1));
|
|
322
|
+
}, m), t.registerCommand(dt, (e) => {
|
|
323
|
+
const n = p();
|
|
324
|
+
if (!g(n)) return !1;
|
|
325
|
+
if (ae(n), e !== null) {
|
|
326
|
+
if ((Se || _n || xn) && Sn) return !1;
|
|
327
|
+
if (e.preventDefault(), e.shiftKey) return t.dispatchCommand(fe, !1);
|
|
325
328
|
}
|
|
326
|
-
return t.dispatchCommand(
|
|
327
|
-
},
|
|
328
|
-
const e =
|
|
329
|
-
return !!
|
|
330
|
-
},
|
|
329
|
+
return t.dispatchCommand(me, void 0);
|
|
330
|
+
}, m), t.registerCommand(ut, () => {
|
|
331
|
+
const e = p();
|
|
332
|
+
return !!g(e) && (t.blur(), !0);
|
|
333
|
+
}, m), t.registerCommand(at, (e) => {
|
|
331
334
|
const [, n] = Q(e);
|
|
332
335
|
if (n.length > 0) {
|
|
333
|
-
const i =
|
|
336
|
+
const i = $e(e.clientX, e.clientY);
|
|
334
337
|
if (i !== null) {
|
|
335
|
-
const { offset: r, node:
|
|
336
|
-
if (
|
|
337
|
-
const l =
|
|
338
|
-
if (
|
|
338
|
+
const { offset: r, node: a } = i, s = ne(a);
|
|
339
|
+
if (s !== null) {
|
|
340
|
+
const l = st();
|
|
341
|
+
if (M(s)) l.anchor.set(s.getKey(), r, "text"), l.focus.set(s.getKey(), r, "text");
|
|
339
342
|
else {
|
|
340
|
-
const
|
|
341
|
-
l.anchor.set(
|
|
343
|
+
const u = s.getParentOrThrow().getKey(), d = s.getIndexWithinParent() + 1;
|
|
344
|
+
l.anchor.set(u, d, "element"), l.focus.set(u, d, "element");
|
|
342
345
|
}
|
|
343
|
-
const c =
|
|
344
|
-
|
|
346
|
+
const c = lt(l);
|
|
347
|
+
ct(c);
|
|
345
348
|
}
|
|
346
|
-
t.dispatchCommand(
|
|
349
|
+
t.dispatchCommand(_e, n);
|
|
347
350
|
}
|
|
348
351
|
return e.preventDefault(), !0;
|
|
349
352
|
}
|
|
350
|
-
const o =
|
|
351
|
-
return !!
|
|
352
|
-
},
|
|
353
|
-
const [n] = Q(e), o =
|
|
354
|
-
return !(n && !
|
|
355
|
-
},
|
|
356
|
-
const [n] = Q(e), o =
|
|
357
|
-
if (n && !
|
|
358
|
-
const i =
|
|
353
|
+
const o = p();
|
|
354
|
+
return !!g(o);
|
|
355
|
+
}, m), t.registerCommand(it, (e) => {
|
|
356
|
+
const [n] = Q(e), o = p();
|
|
357
|
+
return !(n && !g(o));
|
|
358
|
+
}, m), t.registerCommand(ot, (e) => {
|
|
359
|
+
const [n] = Q(e), o = p();
|
|
360
|
+
if (n && !g(o)) return !1;
|
|
361
|
+
const i = $e(e.clientX, e.clientY);
|
|
359
362
|
if (i !== null) {
|
|
360
|
-
const r =
|
|
361
|
-
|
|
363
|
+
const r = ne(i.node);
|
|
364
|
+
H(r) && e.preventDefault();
|
|
362
365
|
}
|
|
363
366
|
return !0;
|
|
364
|
-
},
|
|
365
|
-
await
|
|
366
|
-
const i =
|
|
367
|
-
|
|
367
|
+
}, m), t.registerCommand(nt, () => (rt(), !0), m), t.registerCommand(tt, (e) => (Ce(t, z(e, ClipboardEvent) ? e : null), !0), m), t.registerCommand(et, (e) => (async function(n, o) {
|
|
368
|
+
await Ce(o, z(n, ClipboardEvent) ? n : null), o.update(() => {
|
|
369
|
+
const i = p();
|
|
370
|
+
g(i) ? i.removeText() : F(i) && i.getNodes().forEach((r) => r.remove());
|
|
368
371
|
});
|
|
369
|
-
}(e, t), !0),
|
|
372
|
+
}(e, t), !0), m), t.registerCommand(Ie, (e) => {
|
|
370
373
|
const [, n, o] = Q(e);
|
|
371
|
-
return n.length > 0 && !o ? (t.dispatchCommand(
|
|
374
|
+
return n.length > 0 && !o ? (t.dispatchCommand(_e, n), !0) : Oe(e.target) && Qe(e.target) ? !1 : p() !== null && (function(i, r) {
|
|
372
375
|
i.preventDefault(), r.update(() => {
|
|
373
|
-
const
|
|
374
|
-
|
|
376
|
+
const a = p(), s = z(i, InputEvent) || z(i, KeyboardEvent) ? null : i.clipboardData;
|
|
377
|
+
s != null && a !== null && ve(s, a, r);
|
|
375
378
|
}, { tag: "paste" });
|
|
376
379
|
}(e, t), !0);
|
|
377
|
-
},
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
380
|
+
}, m), t.registerCommand(Ze, (e) => {
|
|
381
|
+
const n = p();
|
|
382
|
+
return g(n) && ae(n), !1;
|
|
383
|
+
}, m), t.registerCommand(Ye, (e) => {
|
|
384
|
+
const n = p();
|
|
385
|
+
return g(n) && ae(n), !1;
|
|
386
|
+
}, m));
|
|
387
|
+
}
|
|
388
|
+
const se = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? j : _;
|
|
389
|
+
function xe(t) {
|
|
390
|
+
return t.getEditorState().read(He(t.isComposing()));
|
|
391
|
+
}
|
|
392
|
+
function Ln({ contentEditable: t, placeholder: e = null, ErrorBoundary: n }) {
|
|
393
|
+
const [o] = P(), i = function(r, a) {
|
|
394
|
+
const [s, l] = I(() => r.getDecorators());
|
|
395
|
+
return se(() => r.registerDecoratorListener((c) => {
|
|
396
|
+
be.flushSync(() => {
|
|
388
397
|
l(c);
|
|
389
398
|
});
|
|
390
|
-
}), [r]),
|
|
399
|
+
}), [r]), _(() => {
|
|
391
400
|
l(r.getDecorators());
|
|
392
|
-
}, [r]),
|
|
393
|
-
const c = [],
|
|
394
|
-
for (let
|
|
395
|
-
const
|
|
396
|
-
|
|
401
|
+
}, [r]), W(() => {
|
|
402
|
+
const c = [], u = Object.keys(s);
|
|
403
|
+
for (let d = 0; d < u.length; d++) {
|
|
404
|
+
const f = u[d], v = h(a, { onError: (w) => r._onError(w), children: h(Ot, { fallback: null, children: s[f] }) }), C = r.getElementByKey(f);
|
|
405
|
+
C !== null && c.push(be.createPortal(v, C, f));
|
|
397
406
|
}
|
|
398
407
|
return c;
|
|
399
|
-
}, [
|
|
408
|
+
}, [a, s, r]);
|
|
400
409
|
}(o, n);
|
|
401
410
|
return function(r) {
|
|
402
|
-
|
|
403
|
-
}(o),
|
|
404
|
-
}
|
|
405
|
-
function
|
|
406
|
-
const [e] =
|
|
407
|
-
const [r,
|
|
408
|
-
return
|
|
409
|
-
function
|
|
410
|
-
const l =
|
|
411
|
-
|
|
411
|
+
se(() => U(Nn(r), bn(r)), [r]);
|
|
412
|
+
}(o), K(Te, { children: [t, h(Dn, { content: e }), i] });
|
|
413
|
+
}
|
|
414
|
+
function Dn({ content: t }) {
|
|
415
|
+
const [e] = P(), n = function(i) {
|
|
416
|
+
const [r, a] = I(() => xe(i));
|
|
417
|
+
return se(() => {
|
|
418
|
+
function s() {
|
|
419
|
+
const l = xe(i);
|
|
420
|
+
a(l);
|
|
412
421
|
}
|
|
413
|
-
return
|
|
414
|
-
|
|
422
|
+
return s(), U(i.registerUpdateListener(() => {
|
|
423
|
+
s();
|
|
415
424
|
}), i.registerEditableListener(() => {
|
|
416
|
-
|
|
425
|
+
s();
|
|
417
426
|
}));
|
|
418
427
|
}, [i]), r;
|
|
419
|
-
}(e), o =
|
|
428
|
+
}(e), o = vn();
|
|
420
429
|
return n ? typeof t == "function" ? t(o) : t : null;
|
|
421
430
|
}
|
|
422
|
-
const
|
|
423
|
-
function
|
|
424
|
-
const [
|
|
431
|
+
const Ve = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? j : _;
|
|
432
|
+
function Pn({ editor: t, ariaActiveDescendant: e, ariaAutoComplete: n, ariaControls: o, ariaDescribedBy: i, ariaErrorMessage: r, ariaExpanded: a, ariaInvalid: s, ariaLabel: l, ariaLabelledBy: c, ariaMultiline: u, ariaOwns: d, ariaRequired: f, autoCapitalize: v, className: C, id: w, role: k = "textbox", spellCheck: y = !0, style: E, tabIndex: $, "data-testid": x, ...b }, N) {
|
|
433
|
+
const [S, T] = I(t.isEditable()), O = Ft((L) => {
|
|
425
434
|
L && L.ownerDocument && L.ownerDocument.defaultView ? t.setRootElement(L) : t.setRootElement(null);
|
|
426
|
-
}, [t]),
|
|
427
|
-
return (
|
|
435
|
+
}, [t]), B = W(() => /* @__PURE__ */ function(...L) {
|
|
436
|
+
return (J) => {
|
|
428
437
|
L.forEach((X) => {
|
|
429
|
-
typeof X == "function" ? X(
|
|
438
|
+
typeof X == "function" ? X(J) : X != null && (X.current = J);
|
|
430
439
|
});
|
|
431
440
|
};
|
|
432
|
-
}(N,
|
|
433
|
-
return
|
|
441
|
+
}(N, O), [O, N]);
|
|
442
|
+
return Ve(() => (T(t.isEditable()), t.registerEditableListener((L) => {
|
|
434
443
|
T(L);
|
|
435
|
-
})), [t]),
|
|
444
|
+
})), [t]), h("div", { "aria-activedescendant": S ? e : void 0, "aria-autocomplete": S ? n : "none", "aria-controls": S ? o : void 0, "aria-describedby": i, ...r != null ? { "aria-errormessage": r } : {}, "aria-expanded": S && k === "combobox" ? !!a : void 0, ...s != null ? { "aria-invalid": s } : {}, "aria-label": l, "aria-labelledby": c, "aria-multiline": u, "aria-owns": S ? d : void 0, "aria-readonly": !S || void 0, "aria-required": f, autoCapitalize: v, className: C, contentEditable: S, "data-testid": x, id: w, ref: B, role: S ? k : void 0, spellCheck: y, style: E, tabIndex: $, ...b });
|
|
436
445
|
}
|
|
437
|
-
const
|
|
438
|
-
function
|
|
439
|
-
return t.getEditorState().read(
|
|
446
|
+
const Tn = ze(Pn);
|
|
447
|
+
function Ne(t) {
|
|
448
|
+
return t.getEditorState().read(He(t.isComposing()));
|
|
440
449
|
}
|
|
441
|
-
const
|
|
442
|
-
function
|
|
443
|
-
const { placeholder: n, ...o } = t, [i] =
|
|
444
|
-
return
|
|
450
|
+
const Rn = ze(Mn);
|
|
451
|
+
function Mn(t, e) {
|
|
452
|
+
const { placeholder: n, ...o } = t, [i] = P();
|
|
453
|
+
return K(Te, { children: [h(Tn, { editor: i, ...o, ref: e }), n != null && h(In, { editor: i, content: n })] });
|
|
445
454
|
}
|
|
446
|
-
function
|
|
447
|
-
const n = function(
|
|
448
|
-
const [
|
|
449
|
-
return
|
|
455
|
+
function In({ content: t, editor: e }) {
|
|
456
|
+
const n = function(a) {
|
|
457
|
+
const [s, l] = I(() => Ne(a));
|
|
458
|
+
return Ve(() => {
|
|
450
459
|
function c() {
|
|
451
|
-
const
|
|
452
|
-
l(
|
|
460
|
+
const u = Ne(a);
|
|
461
|
+
l(u);
|
|
453
462
|
}
|
|
454
|
-
return c(),
|
|
463
|
+
return c(), U(a.registerUpdateListener(() => {
|
|
455
464
|
c();
|
|
456
|
-
}),
|
|
465
|
+
}), a.registerEditableListener(() => {
|
|
457
466
|
c();
|
|
458
467
|
}));
|
|
459
|
-
}, [
|
|
460
|
-
}(e), [o, i] =
|
|
461
|
-
if (
|
|
462
|
-
i(
|
|
468
|
+
}, [a]), s;
|
|
469
|
+
}(e), [o, i] = I(e.isEditable());
|
|
470
|
+
if (j(() => (i(e.isEditable()), e.registerEditableListener((a) => {
|
|
471
|
+
i(a);
|
|
463
472
|
})), [e]), !n) return null;
|
|
464
473
|
let r = null;
|
|
465
|
-
return typeof t == "function" ? r = t(o) : t !== null && (r = t), r === null ? null :
|
|
474
|
+
return typeof t == "function" ? r = t(o) : t !== null && (r = t), r === null ? null : h("div", { "aria-hidden": !0, children: r });
|
|
466
475
|
}
|
|
467
|
-
function
|
|
468
|
-
return
|
|
476
|
+
function le(t, e) {
|
|
477
|
+
return le = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, o) {
|
|
469
478
|
return n.__proto__ = o, n;
|
|
470
|
-
},
|
|
479
|
+
}, le(t, e);
|
|
471
480
|
}
|
|
472
|
-
var
|
|
481
|
+
var Le = { error: null }, On = function(t) {
|
|
473
482
|
var e, n;
|
|
474
483
|
function o() {
|
|
475
|
-
for (var r,
|
|
476
|
-
return (r = t.call.apply(t, [this].concat(
|
|
477
|
-
for (var c,
|
|
478
|
-
r.props.onReset == null || (c = r.props).onReset.apply(c,
|
|
484
|
+
for (var r, a = arguments.length, s = new Array(a), l = 0; l < a; l++) s[l] = arguments[l];
|
|
485
|
+
return (r = t.call.apply(t, [this].concat(s)) || this).state = Le, r.resetErrorBoundary = function() {
|
|
486
|
+
for (var c, u = arguments.length, d = new Array(u), f = 0; f < u; f++) d[f] = arguments[f];
|
|
487
|
+
r.props.onReset == null || (c = r.props).onReset.apply(c, d), r.reset();
|
|
479
488
|
}, r;
|
|
480
489
|
}
|
|
481
|
-
n = t, (e = o).prototype = Object.create(n.prototype), e.prototype.constructor = e,
|
|
490
|
+
n = t, (e = o).prototype = Object.create(n.prototype), e.prototype.constructor = e, le(e, n), o.getDerivedStateFromError = function(r) {
|
|
482
491
|
return { error: r };
|
|
483
492
|
};
|
|
484
493
|
var i = o.prototype;
|
|
485
494
|
return i.reset = function() {
|
|
486
|
-
this.setState(
|
|
487
|
-
}, i.componentDidCatch = function(r,
|
|
488
|
-
var
|
|
489
|
-
(
|
|
490
|
-
}, i.componentDidUpdate = function(r,
|
|
491
|
-
var
|
|
492
|
-
|
|
493
|
-
return !Object.is(
|
|
494
|
-
})) && ((
|
|
495
|
+
this.setState(Le);
|
|
496
|
+
}, i.componentDidCatch = function(r, a) {
|
|
497
|
+
var s, l;
|
|
498
|
+
(s = (l = this.props).onError) == null || s.call(l, r, a);
|
|
499
|
+
}, i.componentDidUpdate = function(r, a) {
|
|
500
|
+
var s, l, c, u, d = this.state.error, f = this.props.resetKeys;
|
|
501
|
+
d !== null && a.error !== null && ((c = r.resetKeys) === void 0 && (c = []), (u = f) === void 0 && (u = []), c.length !== u.length || c.some(function(v, C) {
|
|
502
|
+
return !Object.is(v, u[C]);
|
|
503
|
+
})) && ((s = (l = this.props).onResetKeysChange) == null || s.call(l, r.resetKeys, f), this.reset());
|
|
495
504
|
}, i.render = function() {
|
|
496
|
-
var r = this.state.error,
|
|
505
|
+
var r = this.state.error, a = this.props, s = a.fallbackRender, l = a.FallbackComponent, c = a.fallback;
|
|
497
506
|
if (r !== null) {
|
|
498
|
-
var
|
|
499
|
-
if (
|
|
500
|
-
if (typeof
|
|
501
|
-
if (l) return
|
|
507
|
+
var u = { error: r, resetErrorBoundary: this.resetErrorBoundary };
|
|
508
|
+
if (oe.isValidElement(c)) return c;
|
|
509
|
+
if (typeof s == "function") return s(u);
|
|
510
|
+
if (l) return oe.createElement(l, u);
|
|
502
511
|
throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop");
|
|
503
512
|
}
|
|
504
513
|
return this.props.children;
|
|
505
514
|
}, o;
|
|
506
|
-
}(
|
|
507
|
-
function
|
|
508
|
-
return
|
|
509
|
-
}
|
|
510
|
-
const
|
|
511
|
-
function
|
|
512
|
-
const [o] =
|
|
513
|
-
return
|
|
514
|
-
if (n) return o.registerUpdateListener(({ editorState: i, dirtyElements: r, dirtyLeaves:
|
|
515
|
-
e && r.size === 0 &&
|
|
515
|
+
}(oe.Component);
|
|
516
|
+
function Fn({ children: t, onError: e }) {
|
|
517
|
+
return h(On, { fallback: h("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: t });
|
|
518
|
+
}
|
|
519
|
+
const Kn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? j : _;
|
|
520
|
+
function zn({ ignoreHistoryMergeTagChange: t = !0, ignoreSelectionChange: e = !1, onChange: n }) {
|
|
521
|
+
const [o] = P();
|
|
522
|
+
return Kn(() => {
|
|
523
|
+
if (n) return o.registerUpdateListener(({ editorState: i, dirtyElements: r, dirtyLeaves: a, prevEditorState: s, tags: l }) => {
|
|
524
|
+
e && r.size === 0 && a.size === 0 || t && l.has("history-merge") || s.isEmpty() || n(i, o, l);
|
|
516
525
|
});
|
|
517
526
|
}, [o, t, e, n]), null;
|
|
518
527
|
}
|
|
519
|
-
function
|
|
520
|
-
const [t] =
|
|
521
|
-
return
|
|
522
|
-
if (!t.hasNodes([
|
|
528
|
+
function An() {
|
|
529
|
+
const [t] = P();
|
|
530
|
+
return _(() => {
|
|
531
|
+
if (!t.hasNodes([Ae, Be])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
|
|
523
532
|
}, [t]), function(e) {
|
|
524
|
-
|
|
533
|
+
_(() => jt(e), [e]);
|
|
525
534
|
}(t), null;
|
|
526
535
|
}
|
|
527
|
-
function
|
|
528
|
-
const [n] =
|
|
529
|
-
return
|
|
530
|
-
if (!n.hasNodes([
|
|
531
|
-
return
|
|
532
|
-
if (o === null) return
|
|
533
|
-
if (typeof o == "string") return !(t !== void 0 && !t(o)) && (
|
|
536
|
+
function Bn({ validateUrl: t, attributes: e }) {
|
|
537
|
+
const [n] = P();
|
|
538
|
+
return _(() => {
|
|
539
|
+
if (!n.hasNodes([je])) throw new Error("LinkPlugin: LinkNode not registered on editor");
|
|
540
|
+
return U(n.registerCommand(we, (o) => {
|
|
541
|
+
if (o === null) return ie(o), !0;
|
|
542
|
+
if (typeof o == "string") return !(t !== void 0 && !t(o)) && (ie(o, e), !0);
|
|
534
543
|
{
|
|
535
|
-
const { url: i, target: r, rel:
|
|
536
|
-
return
|
|
544
|
+
const { url: i, target: r, rel: a, title: s } = o;
|
|
545
|
+
return ie(i, { ...e, rel: a, target: r, title: s }), !0;
|
|
537
546
|
}
|
|
538
|
-
},
|
|
539
|
-
const i =
|
|
540
|
-
if (!
|
|
547
|
+
}, he), t !== void 0 ? n.registerCommand(Ie, (o) => {
|
|
548
|
+
const i = p();
|
|
549
|
+
if (!g(i) || i.isCollapsed() || !z(o, ClipboardEvent)) return !1;
|
|
541
550
|
const r = o;
|
|
542
551
|
if (r.clipboardData === null) return !1;
|
|
543
|
-
const
|
|
544
|
-
return !!t(
|
|
545
|
-
},
|
|
552
|
+
const a = r.clipboardData.getData("text");
|
|
553
|
+
return !!t(a) && !i.getNodes().some((s) => V(s)) && (n.dispatchCommand(we, { ...e, url: a }), o.preventDefault(), !0);
|
|
554
|
+
}, he) : () => {
|
|
546
555
|
});
|
|
547
556
|
}, [n, t, e]), null;
|
|
548
557
|
}
|
|
549
|
-
function
|
|
550
|
-
const [n] =
|
|
551
|
-
return
|
|
558
|
+
function jn({ newTab: t = !0, disabled: e = !1 }) {
|
|
559
|
+
const [n] = P();
|
|
560
|
+
return _(() => {
|
|
552
561
|
const o = (r) => {
|
|
553
|
-
const
|
|
554
|
-
if (!(
|
|
555
|
-
const
|
|
556
|
-
if (
|
|
562
|
+
const a = r.target;
|
|
563
|
+
if (!Oe(a)) return;
|
|
564
|
+
const s = Dt(a);
|
|
565
|
+
if (s === null) return;
|
|
557
566
|
let l = null, c = null;
|
|
558
|
-
if (
|
|
559
|
-
const
|
|
560
|
-
if (
|
|
561
|
-
const
|
|
562
|
-
if (!e) if (
|
|
567
|
+
if (s.update(() => {
|
|
568
|
+
const f = ne(a);
|
|
569
|
+
if (f !== null) {
|
|
570
|
+
const v = de(f, V);
|
|
571
|
+
if (!e) if (Ut(v)) l = v.sanitizeUrl(v.getURL()), c = v.getTarget();
|
|
563
572
|
else {
|
|
564
|
-
const
|
|
565
|
-
let
|
|
566
|
-
for (;
|
|
567
|
-
if (
|
|
568
|
-
|
|
573
|
+
const C = function(w, k) {
|
|
574
|
+
let y = w;
|
|
575
|
+
for (; y != null; ) {
|
|
576
|
+
if (k(y)) return y;
|
|
577
|
+
y = y.parentNode;
|
|
569
578
|
}
|
|
570
579
|
return null;
|
|
571
|
-
}(
|
|
572
|
-
|
|
580
|
+
}(a, Pt);
|
|
581
|
+
C !== null && (l = C.href, c = C.target);
|
|
573
582
|
}
|
|
574
583
|
}
|
|
575
584
|
}), l === null || l === "") return;
|
|
576
|
-
const
|
|
577
|
-
if (
|
|
578
|
-
const
|
|
579
|
-
window.open(l, t ||
|
|
585
|
+
const u = n.getEditorState().read(p);
|
|
586
|
+
if (g(u) && !u.isCollapsed()) return void r.preventDefault();
|
|
587
|
+
const d = r.type === "auxclick" && r.button === 1;
|
|
588
|
+
window.open(l, t || d || r.metaKey || r.ctrlKey || c === "_blank" ? "_blank" : "_self"), r.preventDefault();
|
|
580
589
|
}, i = (r) => {
|
|
581
590
|
r.button === 1 && o(r);
|
|
582
591
|
};
|
|
583
|
-
return n.registerRootListener((r,
|
|
584
|
-
|
|
592
|
+
return n.registerRootListener((r, a) => {
|
|
593
|
+
a !== null && (a.removeEventListener("click", o), a.removeEventListener("mouseup", i)), r !== null && (r.addEventListener("click", o), r.addEventListener("mouseup", i));
|
|
585
594
|
});
|
|
586
595
|
}, [n, t, e]), null;
|
|
587
596
|
}
|
|
588
|
-
const te = 0,
|
|
589
|
-
function
|
|
597
|
+
const te = 0, ce = 1, ue = 2, D = 0, Un = 1, De = 2, qn = 3, Hn = 4;
|
|
598
|
+
function Vn(t, e, n, o, i) {
|
|
590
599
|
if (t === null || n.size === 0 && o.size === 0 && !i) return D;
|
|
591
|
-
const r = e._selection,
|
|
592
|
-
if (i) return
|
|
593
|
-
if (!(
|
|
594
|
-
const
|
|
595
|
-
const
|
|
596
|
-
for (const N of
|
|
597
|
-
const
|
|
598
|
-
|
|
600
|
+
const r = e._selection, a = t._selection;
|
|
601
|
+
if (i) return Un;
|
|
602
|
+
if (!(g(r) && g(a) && a.isCollapsed() && r.isCollapsed())) return D;
|
|
603
|
+
const s = function(y, E, $) {
|
|
604
|
+
const x = y._nodeMap, b = [];
|
|
605
|
+
for (const N of E) {
|
|
606
|
+
const S = x.get(N);
|
|
607
|
+
S !== void 0 && b.push(S);
|
|
599
608
|
}
|
|
600
|
-
for (const [N,
|
|
601
|
-
if (!
|
|
602
|
-
const T =
|
|
603
|
-
T === void 0 ||
|
|
609
|
+
for (const [N, S] of $) {
|
|
610
|
+
if (!S) continue;
|
|
611
|
+
const T = x.get(N);
|
|
612
|
+
T === void 0 || Fe(T) || b.push(T);
|
|
604
613
|
}
|
|
605
|
-
return
|
|
614
|
+
return b;
|
|
606
615
|
}(e, n, o);
|
|
607
|
-
if (
|
|
608
|
-
if (
|
|
609
|
-
const
|
|
610
|
-
return
|
|
616
|
+
if (s.length === 0) return D;
|
|
617
|
+
if (s.length > 1) {
|
|
618
|
+
const y = e._nodeMap, E = y.get(r.anchor.key), $ = y.get(a.anchor.key);
|
|
619
|
+
return E && $ && !t._nodeMap.has(E.__key) && M(E) && E.__text.length === 1 && r.anchor.offset === 1 ? De : D;
|
|
611
620
|
}
|
|
612
|
-
const l =
|
|
613
|
-
if (!
|
|
614
|
-
const
|
|
615
|
-
if (
|
|
616
|
-
const
|
|
617
|
-
if (
|
|
618
|
-
const
|
|
619
|
-
return
|
|
620
|
-
}
|
|
621
|
-
function
|
|
621
|
+
const l = s[0], c = t._nodeMap.get(l.__key);
|
|
622
|
+
if (!M(c) || !M(l) || c.__mode !== l.__mode) return D;
|
|
623
|
+
const u = c.__text, d = l.__text;
|
|
624
|
+
if (u === d) return D;
|
|
625
|
+
const f = r.anchor, v = a.anchor;
|
|
626
|
+
if (f.key !== v.key || f.type !== "text") return D;
|
|
627
|
+
const C = f.offset, w = v.offset, k = d.length - u.length;
|
|
628
|
+
return k === 1 && w === C - 1 ? De : k === -1 && w === C + 1 ? qn : k === -1 && w === C ? Hn : D;
|
|
629
|
+
}
|
|
630
|
+
function Wn(t, e) {
|
|
622
631
|
let n = Date.now(), o = D;
|
|
623
|
-
return (i, r,
|
|
624
|
-
const
|
|
625
|
-
if (c.has("historic")) return o = D, n =
|
|
626
|
-
const
|
|
627
|
-
const
|
|
628
|
-
if (!
|
|
629
|
-
if (i === null) return
|
|
630
|
-
const
|
|
631
|
-
return
|
|
632
|
-
const $ =
|
|
633
|
-
return !(
|
|
634
|
-
}(Array.from(
|
|
632
|
+
return (i, r, a, s, l, c) => {
|
|
633
|
+
const u = Date.now();
|
|
634
|
+
if (c.has("historic")) return o = D, n = u, ue;
|
|
635
|
+
const d = Vn(i, r, s, l, t.isComposing()), f = (() => {
|
|
636
|
+
const v = a === null || a.editor === t, C = c.has("history-push");
|
|
637
|
+
if (!C && v && c.has("history-merge")) return te;
|
|
638
|
+
if (i === null) return ce;
|
|
639
|
+
const w = r._selection;
|
|
640
|
+
return s.size > 0 || l.size > 0 ? C === !1 && d !== D && d === o && u < n + e && v || s.size === 1 && function(k, y, E) {
|
|
641
|
+
const $ = y._nodeMap.get(k), x = E._nodeMap.get(k), b = y._selection, N = E._selection;
|
|
642
|
+
return !(g(b) && g(N) && b.anchor.type === "element" && b.focus.type === "element" && N.anchor.type === "text" && N.focus.type === "text" || !M($) || !M(x) || $.__parent !== x.__parent) && JSON.stringify(y.read(() => $.exportJSON())) === JSON.stringify(E.read(() => x.exportJSON()));
|
|
643
|
+
}(Array.from(s)[0], i, r) ? te : ce : w !== null ? te : ue;
|
|
635
644
|
})();
|
|
636
|
-
return n =
|
|
645
|
+
return n = u, o = d, f;
|
|
637
646
|
};
|
|
638
647
|
}
|
|
639
|
-
function
|
|
648
|
+
function Pe(t) {
|
|
640
649
|
t.undoStack = [], t.redoStack = [], t.current = null;
|
|
641
650
|
}
|
|
642
|
-
function
|
|
643
|
-
const o =
|
|
644
|
-
return
|
|
645
|
-
const
|
|
651
|
+
function Jn(t, e, n) {
|
|
652
|
+
const o = Wn(t, n);
|
|
653
|
+
return U(t.registerCommand(It, () => (function(r, a) {
|
|
654
|
+
const s = a.redoStack, l = a.undoStack;
|
|
646
655
|
if (l.length !== 0) {
|
|
647
|
-
const c =
|
|
648
|
-
c !== null && (
|
|
656
|
+
const c = a.current, u = l.pop();
|
|
657
|
+
c !== null && (s.push(c), r.dispatchCommand(G, !0)), l.length === 0 && r.dispatchCommand(Y, !1), a.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: "historic" });
|
|
649
658
|
}
|
|
650
|
-
}(t, e), !0),
|
|
651
|
-
const
|
|
652
|
-
if (
|
|
653
|
-
const c =
|
|
654
|
-
c !== null && (l.push(c), r.dispatchCommand(
|
|
655
|
-
const
|
|
656
|
-
|
|
659
|
+
}(t, e), !0), m), t.registerCommand(Mt, () => (function(r, a) {
|
|
660
|
+
const s = a.redoStack, l = a.undoStack;
|
|
661
|
+
if (s.length !== 0) {
|
|
662
|
+
const c = a.current;
|
|
663
|
+
c !== null && (l.push(c), r.dispatchCommand(Y, !0));
|
|
664
|
+
const u = s.pop();
|
|
665
|
+
s.length === 0 && r.dispatchCommand(G, !1), a.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: "historic" });
|
|
657
666
|
}
|
|
658
|
-
}(t, e), !0),
|
|
659
|
-
const
|
|
660
|
-
if (
|
|
661
|
-
const
|
|
662
|
-
if (
|
|
663
|
-
else if (
|
|
667
|
+
}(t, e), !0), m), t.registerCommand(Rt, () => (Pe(e), !1), m), t.registerCommand(Tt, () => (Pe(e), t.dispatchCommand(G, !1), t.dispatchCommand(Y, !1), !0), m), t.registerUpdateListener(({ editorState: r, prevEditorState: a, dirtyLeaves: s, dirtyElements: l, tags: c }) => {
|
|
668
|
+
const u = e.current, d = e.redoStack, f = e.undoStack, v = u === null ? null : u.editorState;
|
|
669
|
+
if (u !== null && r === v) return;
|
|
670
|
+
const C = o(a, r, u, s, l, c);
|
|
671
|
+
if (C === ce) d.length !== 0 && (e.redoStack = [], t.dispatchCommand(G, !1)), u !== null && (f.push({ ...u }), t.dispatchCommand(Y, !0));
|
|
672
|
+
else if (C === ue) return;
|
|
664
673
|
e.current = { editor: t, editorState: r };
|
|
665
674
|
}));
|
|
666
675
|
}
|
|
667
|
-
function
|
|
676
|
+
function Xn() {
|
|
668
677
|
return { current: null, redoStack: [], undoStack: [] };
|
|
669
678
|
}
|
|
670
|
-
function
|
|
671
|
-
const [n] =
|
|
679
|
+
function Gn({ delay: t, externalHistoryState: e }) {
|
|
680
|
+
const [n] = P();
|
|
672
681
|
return function(o, i, r = 1e3) {
|
|
673
|
-
const
|
|
674
|
-
|
|
682
|
+
const a = W(() => i || Xn(), [i]);
|
|
683
|
+
_(() => Jn(o, a, r), [r, o, a]);
|
|
675
684
|
}(n, e, t), null;
|
|
676
685
|
}
|
|
677
|
-
function
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
});
|
|
686
|
-
function ir({ hasCellMerge: t = !0, hasCellBackgroundColor: e = !0, hasTabHandler: n = !0, hasHorizontalScroll: o = !1 }) {
|
|
687
|
-
const [i] = R();
|
|
688
|
-
return x(() => {
|
|
689
|
-
Vt(i, o);
|
|
690
|
-
}, [i, o]), x(() => (i.hasNodes([re, oe, Je]) || ne(10), B(i.registerCommand(Yt, ({ columns: r, rows: s, includeHeaders: a }) => {
|
|
691
|
-
const l = Zt(Number(s), Number(r), a);
|
|
692
|
-
zt(l);
|
|
693
|
-
const c = l.getFirstDescendant();
|
|
694
|
-
return P(c) && c.select(), !0;
|
|
695
|
-
}, g), i.registerNodeTransform(re, (r) => {
|
|
696
|
-
const [s] = Xt(r, null, null), a = s.reduce((c, d) => Math.max(c, d.length), 0), l = r.getChildren();
|
|
697
|
-
for (let c = 0; c < s.length; ++c) {
|
|
698
|
-
const d = l[c];
|
|
699
|
-
if (!d) continue;
|
|
700
|
-
const f = s[c].reduce((u, m) => m ? 1 + u : u, 0);
|
|
701
|
-
if (f !== a) for (let u = f; u < a; ++u) {
|
|
702
|
-
const m = _e(0);
|
|
703
|
-
m.append(me()), d.append(m);
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
}))), [i]), x(() => {
|
|
707
|
-
const r = /* @__PURE__ */ new Map(), s = (l, c, d) => {
|
|
708
|
-
const f = nn(l, d), u = rn(l, f, i, n);
|
|
709
|
-
r.set(c, [u, f]);
|
|
710
|
-
}, a = i.registerMutationListener(re, (l) => {
|
|
711
|
-
i.getEditorState().read(() => {
|
|
712
|
-
for (const [c, d] of l) {
|
|
713
|
-
const f = r.get(c);
|
|
714
|
-
if (d === "created" || d === "updated") {
|
|
715
|
-
const { tableNode: u, tableElement: m } = Gt(c);
|
|
716
|
-
f === void 0 ? s(u, c, m) : m !== f[1] && (f[0].removeListeners(), r.delete(c), s(u, c, m));
|
|
717
|
-
} else d === "destroyed" && f !== void 0 && (f[0].removeListeners(), r.delete(c));
|
|
718
|
-
}
|
|
719
|
-
}, { editor: i });
|
|
720
|
-
}, { skipInitialization: !1 });
|
|
721
|
-
return () => {
|
|
722
|
-
a();
|
|
723
|
-
for (const [, [l]] of r) l.removeListeners();
|
|
724
|
-
};
|
|
725
|
-
}, [i, n]), x(() => {
|
|
726
|
-
if (!t) return i.registerNodeTransform(oe, (r) => {
|
|
727
|
-
if (r.getColSpan() > 1 || r.getRowSpan() > 1) {
|
|
728
|
-
const [, , s] = Qt(r), [a] = en(s, r, r), l = a.length, c = a[0].length;
|
|
729
|
-
let d = s.getFirstChild();
|
|
730
|
-
xe(d) || ne(175);
|
|
731
|
-
const f = [];
|
|
732
|
-
for (let u = 0; u < l; u++) {
|
|
733
|
-
u !== 0 && (d = d.getNextSibling(), xe(d) || ne(175));
|
|
734
|
-
let m = null;
|
|
735
|
-
for (let p = 0; p < c; p++) {
|
|
736
|
-
const E = a[u][p], w = E.cell;
|
|
737
|
-
if (E.startRow === u && E.startColumn === p) m = w, f.push(w);
|
|
738
|
-
else if (w.getColSpan() > 1 || w.getRowSpan() > 1) {
|
|
739
|
-
tn(w) || ne(176);
|
|
740
|
-
const h = _e(w.__headerState);
|
|
741
|
-
m !== null ? m.insertAfter(h) : Bt(d, h);
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
for (const u of f) u.setColSpan(1), u.setRowSpan(1);
|
|
746
|
-
}
|
|
747
|
-
});
|
|
748
|
-
}, [i, t]), x(() => {
|
|
749
|
-
if (!e) return i.registerNodeTransform(oe, (r) => {
|
|
686
|
+
function Yn({ hasCellMerge: t = !0, hasCellBackgroundColor: e = !0, hasTabHandler: n = !0, hasHorizontalScroll: o = !1 }) {
|
|
687
|
+
const [i] = P();
|
|
688
|
+
return _(() => {
|
|
689
|
+
Ht(i, o);
|
|
690
|
+
}, [i, o]), _(() => Vt(i), [i]), _(() => Wt(i, n), [i, n]), _(() => {
|
|
691
|
+
if (!t) return Jt(i);
|
|
692
|
+
}, [i, t]), _(() => {
|
|
693
|
+
if (!e) return i.registerNodeTransform(Ue, (r) => {
|
|
750
694
|
r.getBackgroundColor() !== null && r.setBackgroundColor(null);
|
|
751
695
|
});
|
|
752
696
|
}, [i, e, t]), null;
|
|
753
697
|
}
|
|
754
|
-
const
|
|
698
|
+
const We = 200, Zn = ({
|
|
755
699
|
currentLanguage: t = "NL",
|
|
756
700
|
initialValue: e = "",
|
|
757
701
|
placeholder: n = "",
|
|
758
702
|
label: o = "",
|
|
759
703
|
info: i = "",
|
|
760
704
|
required: r = !1,
|
|
761
|
-
notValidatedText:
|
|
762
|
-
maxHeightInRem:
|
|
763
|
-
maxWords: l =
|
|
705
|
+
notValidatedText: a = "",
|
|
706
|
+
maxHeightInRem: s = "20rem",
|
|
707
|
+
maxWords: l = We,
|
|
764
708
|
onChange: c
|
|
765
709
|
}) => {
|
|
766
|
-
const { switchLanguage:
|
|
710
|
+
const { switchLanguage: u } = un(), d = an(), [f] = I(() => Re()), [v, C] = I(0), [w, k] = I(0), y = Ke(null), E = {
|
|
767
711
|
html: {
|
|
768
|
-
export:
|
|
712
|
+
export: tn
|
|
769
713
|
},
|
|
770
714
|
namespace: "UvaRte",
|
|
771
|
-
editor:
|
|
772
|
-
theme:
|
|
773
|
-
onError(
|
|
774
|
-
throw
|
|
715
|
+
editor: f,
|
|
716
|
+
theme: ln,
|
|
717
|
+
onError(b) {
|
|
718
|
+
throw b;
|
|
775
719
|
},
|
|
776
|
-
nodes: [
|
|
777
|
-
editorState: (
|
|
778
|
-
const
|
|
779
|
-
if (
|
|
780
|
-
T.forEach((
|
|
781
|
-
|
|
720
|
+
nodes: [Ae, Be, je, qt, Ue, Xt, Gt],
|
|
721
|
+
editorState: (b) => {
|
|
722
|
+
const S = new DOMParser().parseFromString(e, "text/html"), T = At(b, S), O = A();
|
|
723
|
+
if (O.clear(), nn(e))
|
|
724
|
+
T.forEach((B) => {
|
|
725
|
+
O.append(B);
|
|
782
726
|
});
|
|
783
727
|
else {
|
|
784
|
-
const
|
|
785
|
-
T.forEach((L,
|
|
786
|
-
|
|
728
|
+
const B = Me();
|
|
729
|
+
T.forEach((L, J) => {
|
|
730
|
+
J === 0 ? (B.append(L), O.append(B)) : O.append(L);
|
|
787
731
|
});
|
|
788
732
|
}
|
|
789
733
|
}
|
|
790
|
-
}, $ = (
|
|
791
|
-
|
|
792
|
-
let
|
|
793
|
-
|
|
734
|
+
}, $ = (b) => b.trim().length === 0 ? 0 : b.split(" ").length, x = (b, N) => {
|
|
735
|
+
b.read(() => {
|
|
736
|
+
let S = "";
|
|
737
|
+
C($(A().getTextContent().replace(/\s+/g, " ").trim())), S = rn(Bt(N)), c(S);
|
|
794
738
|
});
|
|
795
739
|
};
|
|
796
|
-
return
|
|
797
|
-
|
|
798
|
-
}, [t,
|
|
799
|
-
const
|
|
800
|
-
|
|
801
|
-
}, []), /* @__PURE__ */
|
|
802
|
-
/* @__PURE__ */
|
|
803
|
-
/* @__PURE__ */
|
|
804
|
-
/* @__PURE__ */
|
|
805
|
-
/* @__PURE__ */
|
|
740
|
+
return _(() => {
|
|
741
|
+
u(t.toLocaleLowerCase());
|
|
742
|
+
}, [t, u]), _(() => {
|
|
743
|
+
const b = e.replace(/<br\s*\/?>| /gi, " ").replace(/<\/?[^>]+(>|$)|&[a-z]+;/g, "").replace(/\s+/g, " ").trim();
|
|
744
|
+
C($(b));
|
|
745
|
+
}, []), /* @__PURE__ */ K("div", { className: R.editor__container, children: [
|
|
746
|
+
/* @__PURE__ */ K("div", { className: R.editor__header, children: [
|
|
747
|
+
/* @__PURE__ */ h(cn, { label: o, info: i, required: r }),
|
|
748
|
+
/* @__PURE__ */ K("div", { className: R["editor__header-word-count"], children: [
|
|
749
|
+
/* @__PURE__ */ h("span", { className: en({ [R["editor__header-word-count--alert"]]: v > l }), children: v }),
|
|
806
750
|
" / ",
|
|
807
751
|
l
|
|
808
752
|
] })
|
|
809
753
|
] }),
|
|
810
|
-
/* @__PURE__ */
|
|
811
|
-
/* @__PURE__ */
|
|
812
|
-
/* @__PURE__ */
|
|
813
|
-
/* @__PURE__ */
|
|
814
|
-
|
|
754
|
+
/* @__PURE__ */ h("div", { className: R.editor, children: /* @__PURE__ */ K(pn, { initialConfig: E, children: [
|
|
755
|
+
/* @__PURE__ */ h(on, { editorScrollPosition: w }),
|
|
756
|
+
/* @__PURE__ */ K("div", { className: R["editor__field-wrapper"], children: [
|
|
757
|
+
/* @__PURE__ */ h(
|
|
758
|
+
Ln,
|
|
815
759
|
{
|
|
816
|
-
contentEditable: /* @__PURE__ */
|
|
817
|
-
|
|
760
|
+
contentEditable: /* @__PURE__ */ h(
|
|
761
|
+
Rn,
|
|
818
762
|
{
|
|
819
|
-
className:
|
|
820
|
-
"aria-label":
|
|
763
|
+
className: R.editor__field,
|
|
764
|
+
"aria-label": d.common.rteAriaLabel,
|
|
821
765
|
"aria-placeholder": n,
|
|
822
|
-
title:
|
|
823
|
-
placeholder: /* @__PURE__ */
|
|
766
|
+
title: d.common.rteTitle,
|
|
767
|
+
placeholder: /* @__PURE__ */ h("div", { className: R.editor__placeholder, children: n }),
|
|
824
768
|
spellCheck: !1,
|
|
825
769
|
id: "rteEditor",
|
|
826
|
-
style: { height: `${
|
|
827
|
-
onScroll: (
|
|
828
|
-
ref:
|
|
770
|
+
style: { height: `${s}`, maxHeight: `${s}` },
|
|
771
|
+
onScroll: (b) => k(b.currentTarget.scrollTop),
|
|
772
|
+
ref: y
|
|
829
773
|
}
|
|
830
774
|
),
|
|
831
|
-
placeholder: /* @__PURE__ */
|
|
832
|
-
ErrorBoundary:
|
|
775
|
+
placeholder: /* @__PURE__ */ h("div", { className: R.editor__placeholder, children: n }),
|
|
776
|
+
ErrorBoundary: Fn
|
|
833
777
|
}
|
|
834
778
|
),
|
|
835
|
-
/* @__PURE__ */
|
|
836
|
-
/* @__PURE__ */
|
|
837
|
-
/* @__PURE__ */
|
|
838
|
-
/* @__PURE__ */
|
|
839
|
-
/* @__PURE__ */
|
|
840
|
-
/* @__PURE__ */
|
|
841
|
-
/* @__PURE__ */
|
|
842
|
-
/* @__PURE__ */
|
|
779
|
+
/* @__PURE__ */ h(Yn, {}),
|
|
780
|
+
/* @__PURE__ */ h(Gn, {}),
|
|
781
|
+
/* @__PURE__ */ h(An, {}),
|
|
782
|
+
/* @__PURE__ */ h(Bn, { validateUrl: Yt }),
|
|
783
|
+
/* @__PURE__ */ h(Zt, { matchers: Qt }),
|
|
784
|
+
/* @__PURE__ */ h(jn, {}),
|
|
785
|
+
/* @__PURE__ */ h(zn, { onChange: x }),
|
|
786
|
+
/* @__PURE__ */ h(fn, {})
|
|
843
787
|
] })
|
|
844
788
|
] }) }),
|
|
845
|
-
|
|
789
|
+
a !== "" && /* @__PURE__ */ h(sn, { level: "error", feedback: a })
|
|
846
790
|
] });
|
|
847
|
-
},
|
|
791
|
+
}, Ar = ({
|
|
848
792
|
currentLanguage: t = "NL",
|
|
849
793
|
initialValue: e = "",
|
|
850
794
|
placeholder: n = "",
|
|
851
795
|
label: o = "",
|
|
852
796
|
info: i = "",
|
|
853
797
|
required: r = !1,
|
|
854
|
-
notValidatedText:
|
|
855
|
-
maxWords:
|
|
798
|
+
notValidatedText: a = "",
|
|
799
|
+
maxWords: s = We,
|
|
856
800
|
onChange: l
|
|
857
|
-
}) => /* @__PURE__ */
|
|
858
|
-
|
|
801
|
+
}) => /* @__PURE__ */ h(dn, { children: /* @__PURE__ */ h(
|
|
802
|
+
Zn,
|
|
859
803
|
{
|
|
860
804
|
currentLanguage: t,
|
|
861
805
|
initialValue: e,
|
|
@@ -863,13 +807,13 @@ const Ye = 200, sr = ({
|
|
|
863
807
|
label: o,
|
|
864
808
|
info: i,
|
|
865
809
|
required: r,
|
|
866
|
-
notValidatedText:
|
|
867
|
-
maxWords:
|
|
810
|
+
notValidatedText: a,
|
|
811
|
+
maxWords: s,
|
|
868
812
|
onChange: l
|
|
869
813
|
}
|
|
870
814
|
) });
|
|
871
815
|
export {
|
|
872
|
-
|
|
873
|
-
|
|
816
|
+
Zn as Rte,
|
|
817
|
+
Ar as RteEditor
|
|
874
818
|
};
|
|
875
819
|
//# sourceMappingURL=RteEditor.js.map
|