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