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