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