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