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