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