@uva-glass/component-library 3.54.1 → 3.54.2
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-YJ1n9pVJ.js → Lexical.prod-A4JuKqM3.js} +1494 -1428
- package/dist/Lexical.prod-A4JuKqM3.js.map +1 -0
- package/dist/{LexicalClipboard.prod-CDPAGlNs.js → LexicalClipboard.prod-CoyZP29w.js} +60 -60
- package/dist/{LexicalClipboard.prod-CDPAGlNs.js.map → LexicalClipboard.prod-CoyZP29w.js.map} +1 -1
- package/dist/{LexicalExtension.prod-2-giLTv9.js → LexicalExtension.prod-DFPuTMk1.js} +94 -93
- package/dist/LexicalExtension.prod-DFPuTMk1.js.map +1 -0
- package/dist/LexicalLink.prod-Dp06n3Hn.js +561 -0
- package/dist/LexicalLink.prod-Dp06n3Hn.js.map +1 -0
- package/dist/LexicalList.prod-D3TdO_Pq.js +632 -0
- package/dist/LexicalList.prod-D3TdO_Pq.js.map +1 -0
- package/dist/{LexicalSelection.prod-CpZE7Sey.js → LexicalSelection.prod-BapitO0n.js} +39 -39
- package/dist/{LexicalSelection.prod-CpZE7Sey.js.map → LexicalSelection.prod-BapitO0n.js.map} +1 -1
- package/dist/LexicalTable.prod-bzYpvqMi.js +1892 -0
- package/dist/LexicalTable.prod-bzYpvqMi.js.map +1 -0
- package/dist/LexicalUtils.prod-CAsHFX57.js +134 -0
- package/dist/LexicalUtils.prod-CAsHFX57.js.map +1 -0
- package/dist/{TableCellResizerPlugin-BTfuE_kM.js → TableCellResizerPlugin-ffA1s2mD.js} +62 -62
- package/dist/{TableCellResizerPlugin-BTfuE_kM.js.map → TableCellResizerPlugin-ffA1s2mD.js.map} +1 -1
- package/dist/{TablePlugin-bFqq2Yd9.js → TablePlugin-CzmrXpxk.js} +89 -89
- package/dist/{TablePlugin-bFqq2Yd9.js.map → TablePlugin-CzmrXpxk.js.map} +1 -1
- package/dist/{chunk-2N4WE3KZ-nJkI9rUN.js → chunk-OPOZOKLO-nJkI9rUN.js} +1 -1
- package/dist/{chunk-2N4WE3KZ-nJkI9rUN.js.map → chunk-OPOZOKLO-nJkI9rUN.js.map} +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.stories.js +1 -1
- package/dist/components/FormInput/FormInput.js +1 -1
- package/dist/components/InputField/InputField.stories.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.js +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js +51 -51
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +2 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +42 -42
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +7 -7
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +22 -22
- package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +13 -13
- package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/TableCellResizerPlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +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 +34 -34
- package/dist/components/RteEditor/Plugins/index.js +2 -2
- package/dist/components/RteEditor/RteEditor.js +488 -494
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/RteEditor/helpers.js +20 -20
- package/dist/components/RteEditor/nodes/CourseCatalogueNode/CourseCatalogueNode.js +15 -15
- package/dist/components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js +13 -13
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/storybook__react.d.js +1 -1
- package/package.json +15 -15
- package/dist/Lexical.prod-YJ1n9pVJ.js.map +0 -1
- package/dist/LexicalExtension.prod-2-giLTv9.js.map +0 -1
- package/dist/LexicalLink.prod-u8L4ioQd.js +0 -528
- package/dist/LexicalLink.prod-u8L4ioQd.js.map +0 -1
- package/dist/LexicalList.prod-DMU0XSLO.js +0 -630
- package/dist/LexicalList.prod-DMU0XSLO.js.map +0 -1
- package/dist/LexicalTable.prod-BOlKc5zf.js +0 -1846
- package/dist/LexicalTable.prod-BOlKc5zf.js.map +0 -1
- package/dist/LexicalUtils.prod-BQnuAaA9.js +0 -92
- package/dist/LexicalUtils.prod-BQnuAaA9.js.map +0 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { jsx as f, jsxs as A, Fragment as
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
import * as
|
|
5
|
-
import { useMemo as
|
|
6
|
-
import { a as
|
|
7
|
-
import {
|
|
8
|
-
import { flushSync as
|
|
9
|
-
import { R as
|
|
10
|
-
import { A as
|
|
11
|
-
import { A as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { c as
|
|
16
|
-
import { exportMap as
|
|
17
|
-
import { validateUrl as
|
|
1
|
+
import { jsx as f, jsxs as A, Fragment as Pe } from "react/jsx-runtime";
|
|
2
|
+
import { t as We, r as Ve, o as D } from "../../LexicalComposerContext.prod-DOyoZx0P.js";
|
|
3
|
+
import { az as Le, K, V as Ge, $ as g, aI as oe, aC as ae, aJ as q, P as De, Y as Xe, y as B, w as h, e as H, ab as Qe, E as c, b4 as Ze, o as et, n as tt, f as rt, b5 as nt, b6 as ot, a7 as at, i as T, aP as st, U as it, b7 as lt, b8 as ut, D as re, b9 as dt, ba as ct, ag as ft, c as mt, m as Te, a1 as pt, bb as gt, bc as le, d as ue, a6 as ht, a4 as Q, a5 as vt, ah as Re, bd as de, X as yt, W as Ct, N as bt, be as ce, R as Et, bf as wt, bg as St, b0 as xt, ar as Ie, a9 as Nt, q as _t, a8 as $t, bh as kt, aa as Pt, a3 as Lt, a2 as Dt, B as Tt, aR as Y, aQ as W, bi as Rt, bj as It, aT as Bt, bk as ne, aS as Ft, bl as Mt, bm as At, bn as Kt, bo as zt, aG as Ut } from "../../Lexical.prod-A4JuKqM3.js";
|
|
4
|
+
import * as Ht from "react";
|
|
5
|
+
import { useMemo as X, useLayoutEffect as J, useEffect as b, useState as F, Suspense as Ot, forwardRef as Be, useCallback as qt, Component as Jt, createElement as fe, createContext as jt, useId as Yt } from "react";
|
|
6
|
+
import { a as Wt, T as Vt } from "../../TableCellResizerPlugin-ffA1s2mD.js";
|
|
7
|
+
import { n as Gt, p as se, a as Xt, g as Fe, H as Qt, o as Zt } from "../../LexicalExtension.prod-DFPuTMk1.js";
|
|
8
|
+
import { flushSync as er, createPortal as tr } from "react-dom";
|
|
9
|
+
import { R as me, F as pe, m as rr, g as nr } from "../../LexicalClipboard.prod-CoyZP29w.js";
|
|
10
|
+
import { A as ge, Z as he, n as ve } from "../../LexicalSelection.prod-BapitO0n.js";
|
|
11
|
+
import { A as U, y as or, b as ye } from "../../LexicalUtils.prod-CAsHFX57.js";
|
|
12
|
+
import { u as Me, s as Ae, N as ar, L as Ce } from "../../LexicalList.prod-D3TdO_Pq.js";
|
|
13
|
+
import { E as Ke, V as sr, $ as ze, p as ir, Y as lr } from "../../LexicalLink.prod-Dp06n3Hn.js";
|
|
14
|
+
import { m as ur, C as dr, _ as Ue, a as cr, A as fr, F as mr, K as He, z as pr } from "../../LexicalTable.prod-bzYpvqMi.js";
|
|
15
|
+
import { c as be } from "../../clsx-OuTLNxxd.js";
|
|
16
|
+
import { exportMap as gr, mergeBoldStrongTags as hr, cleanUpTable as vr } from "./helpers.js";
|
|
17
|
+
import { validateUrl as yr, MATCHERS as Cr } from "./Plugins/LinkPlugin/helpers.js";
|
|
18
18
|
import { s as R } from "../../RteEditor.module-DaBh86FK.js";
|
|
19
|
-
import { ToolBarPlugin as
|
|
20
|
-
import { useTranslation as
|
|
21
|
-
import "../../TablePlugin-
|
|
19
|
+
import { ToolBarPlugin as br } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
|
|
20
|
+
import { useTranslation as Er } from "./hooks/useTranslation.js";
|
|
21
|
+
import "../../TablePlugin-CzmrXpxk.js";
|
|
22
22
|
import "./Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js";
|
|
23
23
|
import "./hooks/components/Flyout.js";
|
|
24
24
|
import "../Accordion/Accordion.js";
|
|
@@ -26,7 +26,7 @@ import "../Buttons/Button.js";
|
|
|
26
26
|
import "../Buttons/LinkButton.js";
|
|
27
27
|
import "@react-aria/button";
|
|
28
28
|
import "../Checkbox/Checkbox.js";
|
|
29
|
-
import { FeedbackBox as
|
|
29
|
+
import { FeedbackBox as wr } from "../FeedbackBox/FeedbackBox.js";
|
|
30
30
|
import "@react-aria/dialog";
|
|
31
31
|
import "@react-aria/focus";
|
|
32
32
|
import "@react-aria/overlays";
|
|
@@ -42,107 +42,107 @@ import "../SelectListbox/SelectProvider.js";
|
|
|
42
42
|
import "../Sortable/components/SortableItem.js";
|
|
43
43
|
import "../../SortableProvider-BbwlEPIr.js";
|
|
44
44
|
import "../WeekSelector/components/WeekSelectorOptionContainer.js";
|
|
45
|
-
import { PasteHandlerPlugin as
|
|
46
|
-
import { UvaTheme as
|
|
47
|
-
import { EditorHeader as
|
|
48
|
-
import { LanguageProvider as
|
|
49
|
-
import { TableWrapperNode as
|
|
50
|
-
import { CourseCatalogueNode as
|
|
51
|
-
const Oe = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0,
|
|
52
|
-
function
|
|
53
|
-
const t =
|
|
54
|
-
const { theme: n, namespace: o, nodes:
|
|
55
|
-
return (function(m,
|
|
56
|
-
if (
|
|
57
|
-
if (
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
(
|
|
45
|
+
import { PasteHandlerPlugin as Sr } from "./Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js";
|
|
46
|
+
import { UvaTheme as xr } from "./UvaTheme/UvaTheme.js";
|
|
47
|
+
import { EditorHeader as Nr } from "./EditorHeader/EditorHeader.js";
|
|
48
|
+
import { LanguageProvider as _r, useLanguage as $r } from "./Providers/LanguageProvider.js";
|
|
49
|
+
import { TableWrapperNode as kr } from "./nodes/TableWrapperNode/TableWrapperNode.js";
|
|
50
|
+
import { CourseCatalogueNode as Pr, CourseCatalogueLinkPlugin as Lr } from "./nodes/CourseCatalogueNode/CourseCatalogueNode.js";
|
|
51
|
+
const Oe = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Dr = Oe ? J : b, V = { tag: oe };
|
|
52
|
+
function Tr({ initialConfig: r, children: e }) {
|
|
53
|
+
const t = X(() => {
|
|
54
|
+
const { theme: n, namespace: o, nodes: s, onError: a, editorState: i, html: l } = r, d = We(null, n), u = Le({ editable: r.editable, html: l, namespace: o, nodes: s, onError: (m) => a(m, u), theme: n });
|
|
55
|
+
return (function(m, p) {
|
|
56
|
+
if (p !== null) {
|
|
57
|
+
if (p === void 0) m.update(() => {
|
|
58
|
+
const w = K();
|
|
59
|
+
if (w.isEmpty()) {
|
|
60
|
+
const v = Ge();
|
|
61
|
+
w.append(v);
|
|
62
|
+
const N = Oe ? document.activeElement : null;
|
|
63
|
+
(g() !== null || N !== null && N === m.getRootElement()) && v.select();
|
|
64
64
|
}
|
|
65
|
-
},
|
|
66
|
-
else if (
|
|
65
|
+
}, V);
|
|
66
|
+
else if (p !== null) switch (typeof p) {
|
|
67
67
|
case "string": {
|
|
68
|
-
const
|
|
69
|
-
m.setEditorState(
|
|
68
|
+
const w = m.parseEditorState(p);
|
|
69
|
+
m.setEditorState(w, V);
|
|
70
70
|
break;
|
|
71
71
|
}
|
|
72
72
|
case "object":
|
|
73
|
-
m.setEditorState(
|
|
73
|
+
m.setEditorState(p, V);
|
|
74
74
|
break;
|
|
75
75
|
case "function":
|
|
76
76
|
m.update(() => {
|
|
77
|
-
|
|
78
|
-
},
|
|
77
|
+
K().isEmpty() && p(m);
|
|
78
|
+
}, V);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
})(u, i), [u,
|
|
81
|
+
})(u, i), [u, d];
|
|
82
82
|
}, []);
|
|
83
|
-
return
|
|
83
|
+
return Dr(() => {
|
|
84
84
|
const n = r.editable, [o] = t;
|
|
85
85
|
o.setEditable(n === void 0 || n);
|
|
86
|
-
}, []), f(
|
|
86
|
+
}, []), f(Ve.Provider, { value: t, children: e });
|
|
87
87
|
}
|
|
88
|
-
const
|
|
89
|
-
function
|
|
90
|
-
return
|
|
88
|
+
const Rr = ae({ name: "@lexical/react/ReactProvider" });
|
|
89
|
+
function Ir() {
|
|
90
|
+
return K().getTextContent();
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function Br(r, e = !0) {
|
|
93
93
|
if (r) return !1;
|
|
94
|
-
let t =
|
|
94
|
+
let t = Ir();
|
|
95
95
|
return e && (t = t.trim()), t === "";
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
if (!
|
|
99
|
-
const e =
|
|
97
|
+
function Fr(r) {
|
|
98
|
+
if (!Br(r, !1)) return !1;
|
|
99
|
+
const e = K().getChildren(), t = e.length;
|
|
100
100
|
if (t > 1) return !1;
|
|
101
101
|
for (let n = 0; n < t; n++) {
|
|
102
102
|
const o = e[n];
|
|
103
|
-
if (
|
|
104
|
-
if (
|
|
103
|
+
if (q(o)) return !1;
|
|
104
|
+
if (De(o)) {
|
|
105
105
|
if (!Xe(o) || o.__indent !== 0) return !1;
|
|
106
|
-
const
|
|
107
|
-
for (let i = 0; i <
|
|
108
|
-
const l =
|
|
106
|
+
const s = o.getChildren(), a = s.length;
|
|
107
|
+
for (let i = 0; i < a; i++) {
|
|
108
|
+
const l = s[n];
|
|
109
109
|
if (!B(l)) return !1;
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
return !0;
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
return () =>
|
|
115
|
+
function qe(r) {
|
|
116
|
+
return () => Fr(r);
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function Mr(r) {
|
|
119
119
|
const e = window.location.origin, t = (n) => {
|
|
120
120
|
if (n.origin !== e) return;
|
|
121
121
|
const o = r.getRootElement();
|
|
122
122
|
if (document.activeElement !== o) return;
|
|
123
|
-
const
|
|
124
|
-
if (typeof
|
|
125
|
-
let
|
|
123
|
+
const s = n.data;
|
|
124
|
+
if (typeof s == "string") {
|
|
125
|
+
let a;
|
|
126
126
|
try {
|
|
127
|
-
|
|
127
|
+
a = JSON.parse(s);
|
|
128
128
|
} catch {
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
|
-
if (
|
|
132
|
-
const i =
|
|
131
|
+
if (a && a.protocol === "nuanria_messaging" && a.type === "request") {
|
|
132
|
+
const i = a.payload;
|
|
133
133
|
if (i && i.functionId === "makeChanges") {
|
|
134
134
|
const l = i.args;
|
|
135
135
|
if (l) {
|
|
136
|
-
const [
|
|
136
|
+
const [d, u, m, p, w] = l;
|
|
137
137
|
r.update(() => {
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
140
|
-
const
|
|
141
|
-
let E =
|
|
142
|
-
if (B(E) &&
|
|
143
|
-
C =
|
|
144
|
-
const
|
|
145
|
-
C = C >
|
|
138
|
+
const v = g();
|
|
139
|
+
if (h(v)) {
|
|
140
|
+
const N = v.anchor;
|
|
141
|
+
let E = N.getNode(), C = 0, y = 0;
|
|
142
|
+
if (B(E) && d >= 0 && u >= 0 && (C = d, y = d + u, v.setTextNodeRange(E, C, E, y)), C === y && m === "" || (v.insertRawText(m), E = N.getNode()), B(E)) {
|
|
143
|
+
C = p, y = p + w;
|
|
144
|
+
const $ = E.getTextContentSize();
|
|
145
|
+
C = C > $ ? $ : C, y = y > $ ? $ : y, v.setTextNodeRange(E, C, E, y);
|
|
146
146
|
}
|
|
147
147
|
n.stopImmediatePropagation();
|
|
148
148
|
}
|
|
@@ -156,7 +156,7 @@ function Br(r) {
|
|
|
156
156
|
window.removeEventListener("message", t, !0);
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function Ee(r, e) {
|
|
160
160
|
if (document.caretRangeFromPoint !== void 0) {
|
|
161
161
|
const t = document.caretRangeFromPoint(r, e);
|
|
162
162
|
return t === null ? null : { node: t.startContainer, offset: t.startOffset };
|
|
@@ -167,328 +167,317 @@ function be(r, e) {
|
|
|
167
167
|
}
|
|
168
168
|
return null;
|
|
169
169
|
}
|
|
170
|
-
const
|
|
171
|
-
function
|
|
170
|
+
const z = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Ar = z && "documentMode" in document ? document.documentMode : null, Kr = z && /Mac|iPod|iPhone|iPad/.test(navigator.platform), zr = !(!z || !("InputEvent" in window) || Ar) && "getTargetRanges" in new window.InputEvent("input"), Ur = z && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), we = z && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Hr = z && /^(?=.*Chrome).*/i.test(navigator.userAgent), Or = z && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && Kr && !Hr, Se = tt("DRAG_DROP_PASTE_FILE");
|
|
171
|
+
function G(r) {
|
|
172
172
|
let e = null;
|
|
173
|
-
if (
|
|
173
|
+
if (U(r, DragEvent) ? e = r.dataTransfer : U(r, ClipboardEvent) && (e = r.clipboardData), e === null) return [!1, [], !1];
|
|
174
174
|
const t = e.types, n = t.includes("Files"), o = t.includes("text/html") || t.includes("text/plain");
|
|
175
175
|
return [n, Array.from(e.files), o];
|
|
176
176
|
}
|
|
177
|
-
function Se(r) {
|
|
178
|
-
const e = p();
|
|
179
|
-
if (!g(e)) return !1;
|
|
180
|
-
const t = /* @__PURE__ */ new Set(), n = e.getNodes();
|
|
181
|
-
for (let o = 0; o < n.length; o++) {
|
|
182
|
-
const a = n[o], s = a.getKey();
|
|
183
|
-
if (t.has(s)) continue;
|
|
184
|
-
const i = Re(a, (c) => se(c) && !c.isInline());
|
|
185
|
-
if (i === null) continue;
|
|
186
|
-
const l = i.getKey();
|
|
187
|
-
i.canIndent() && !t.has(l) && (t.add(l), r(i));
|
|
188
|
-
}
|
|
189
|
-
return t.size > 0;
|
|
190
|
-
}
|
|
191
177
|
function xe(r) {
|
|
192
178
|
const e = re(r);
|
|
193
|
-
return
|
|
179
|
+
return q(e);
|
|
194
180
|
}
|
|
195
|
-
function
|
|
181
|
+
function Z(r) {
|
|
196
182
|
for (const e of ["lowercase", "uppercase", "capitalize"]) r.hasFormat(e) && r.toggleFormat(e);
|
|
197
183
|
}
|
|
198
|
-
function
|
|
199
|
-
return H(r.registerCommand(
|
|
200
|
-
const t =
|
|
201
|
-
return !!
|
|
202
|
-
},
|
|
203
|
-
const t =
|
|
204
|
-
return
|
|
205
|
-
},
|
|
206
|
-
const t =
|
|
207
|
-
return !!
|
|
208
|
-
},
|
|
209
|
-
const t =
|
|
210
|
-
return !!
|
|
211
|
-
},
|
|
212
|
-
const t =
|
|
184
|
+
function qr(r) {
|
|
185
|
+
return H(r.registerCommand(Tt, (e) => {
|
|
186
|
+
const t = g();
|
|
187
|
+
return !!T(t) && (t.clear(), !0);
|
|
188
|
+
}, c), r.registerCommand(Q, (e) => {
|
|
189
|
+
const t = g();
|
|
190
|
+
return h(t) ? (t.deleteCharacter(e), !0) : !!T(t) && (t.deleteNodes(), !0);
|
|
191
|
+
}, c), r.registerCommand(Dt, (e) => {
|
|
192
|
+
const t = g();
|
|
193
|
+
return !!h(t) && (t.deleteWord(e), !0);
|
|
194
|
+
}, c), r.registerCommand(Lt, (e) => {
|
|
195
|
+
const t = g();
|
|
196
|
+
return !!h(t) && (t.deleteLine(e), !0);
|
|
197
|
+
}, c), r.registerCommand(Pt, (e) => {
|
|
198
|
+
const t = g();
|
|
213
199
|
if (typeof e == "string") t !== null && t.insertText(e);
|
|
214
200
|
else {
|
|
215
201
|
if (t === null) return !1;
|
|
216
202
|
const n = e.dataTransfer;
|
|
217
|
-
if (n != null)
|
|
218
|
-
else if (
|
|
203
|
+
if (n != null) me(n, t, r);
|
|
204
|
+
else if (h(t)) {
|
|
219
205
|
const o = e.data;
|
|
220
206
|
return o && t.insertText(o), !0;
|
|
221
207
|
}
|
|
222
208
|
}
|
|
223
209
|
return !0;
|
|
224
|
-
},
|
|
225
|
-
const e =
|
|
226
|
-
return !!
|
|
227
|
-
},
|
|
228
|
-
const t =
|
|
229
|
-
return !!
|
|
230
|
-
},
|
|
231
|
-
const t =
|
|
232
|
-
if (!
|
|
210
|
+
}, c), r.registerCommand(kt, () => {
|
|
211
|
+
const e = g();
|
|
212
|
+
return !!h(e) && (e.removeText(), !0);
|
|
213
|
+
}, c), r.registerCommand($t, (e) => {
|
|
214
|
+
const t = g();
|
|
215
|
+
return !!h(t) && (t.formatText(e), !0);
|
|
216
|
+
}, c), r.registerCommand(Nt, (e) => {
|
|
217
|
+
const t = g();
|
|
218
|
+
if (!h(t) && !T(t)) return !1;
|
|
233
219
|
const n = t.getNodes();
|
|
234
220
|
for (const o of n) {
|
|
235
|
-
const
|
|
236
|
-
|
|
221
|
+
const s = _t(o, (a) => De(a) && !a.isInline());
|
|
222
|
+
s !== null && s.setFormat(e);
|
|
237
223
|
}
|
|
238
224
|
return !0;
|
|
239
|
-
},
|
|
240
|
-
const t =
|
|
241
|
-
return !!
|
|
242
|
-
},
|
|
243
|
-
const e =
|
|
244
|
-
return !!
|
|
245
|
-
},
|
|
225
|
+
}, c), r.registerCommand(le, (e) => {
|
|
226
|
+
const t = g();
|
|
227
|
+
return !!h(t) && (t.insertLineBreak(e), !0);
|
|
228
|
+
}, c), r.registerCommand(ue, () => {
|
|
229
|
+
const e = g();
|
|
230
|
+
return !!h(e) && (e.insertParagraph(), !0);
|
|
231
|
+
}, c), r.registerCommand(St, () => {
|
|
232
|
+
const e = xt(), t = g();
|
|
233
|
+
return h(t) && (e.setFormat(t.format), e.setStyle(t.style)), Ie([e]), !0;
|
|
234
|
+
}, c), r.registerCommand(wt, () => ye((e) => {
|
|
246
235
|
const t = e.getIndent();
|
|
247
236
|
e.setIndent(t + 1);
|
|
248
|
-
}),
|
|
237
|
+
}), c), r.registerCommand(de, () => ye((e) => {
|
|
249
238
|
const t = e.getIndent();
|
|
250
239
|
t > 0 && e.setIndent(Math.max(0, t - 1));
|
|
251
|
-
}),
|
|
252
|
-
const t =
|
|
253
|
-
if (
|
|
240
|
+
}), c), r.registerCommand(Et, (e) => {
|
|
241
|
+
const t = g();
|
|
242
|
+
if (T(t)) {
|
|
254
243
|
const n = t.getNodes();
|
|
255
244
|
if (n.length > 0) return e.preventDefault(), n[0].selectPrevious(), !0;
|
|
256
|
-
} else if (
|
|
257
|
-
const n =
|
|
258
|
-
if (!e.shiftKey &&
|
|
245
|
+
} else if (h(t)) {
|
|
246
|
+
const n = ce(t.focus, !0);
|
|
247
|
+
if (!e.shiftKey && q(n) && !n.isIsolated() && !n.isInline()) return n.selectPrevious(), e.preventDefault(), !0;
|
|
259
248
|
}
|
|
260
249
|
return !1;
|
|
261
|
-
},
|
|
262
|
-
const t =
|
|
263
|
-
if (
|
|
250
|
+
}, c), r.registerCommand(bt, (e) => {
|
|
251
|
+
const t = g();
|
|
252
|
+
if (T(t)) {
|
|
264
253
|
const n = t.getNodes();
|
|
265
254
|
if (n.length > 0) return e.preventDefault(), n[0].selectNext(0, 0), !0;
|
|
266
|
-
} else if (
|
|
255
|
+
} else if (h(t)) {
|
|
267
256
|
if ((function(o) {
|
|
268
|
-
const
|
|
269
|
-
return
|
|
257
|
+
const s = o.focus;
|
|
258
|
+
return s.key === "root" && s.offset === K().getChildrenSize();
|
|
270
259
|
})(t)) return e.preventDefault(), !0;
|
|
271
|
-
const n =
|
|
272
|
-
if (!e.shiftKey &&
|
|
260
|
+
const n = ce(t.focus, !1);
|
|
261
|
+
if (!e.shiftKey && q(n) && !n.isIsolated() && !n.isInline()) return n.selectNext(), e.preventDefault(), !0;
|
|
273
262
|
}
|
|
274
263
|
return !1;
|
|
275
|
-
},
|
|
276
|
-
const t =
|
|
277
|
-
if (
|
|
264
|
+
}, c), r.registerCommand(Ct, (e) => {
|
|
265
|
+
const t = g();
|
|
266
|
+
if (T(t)) {
|
|
278
267
|
const n = t.getNodes();
|
|
279
|
-
if (n.length > 0) return e.preventDefault(),
|
|
268
|
+
if (n.length > 0) return e.preventDefault(), ge(n[0]) ? n[0].selectNext(0, 0) : n[0].selectPrevious(), !0;
|
|
280
269
|
}
|
|
281
|
-
if (!
|
|
282
|
-
if (
|
|
270
|
+
if (!h(t)) return !1;
|
|
271
|
+
if (he(t, !0)) {
|
|
283
272
|
const n = e.shiftKey;
|
|
284
|
-
return e.preventDefault(),
|
|
273
|
+
return e.preventDefault(), ve(t, n, !0), !0;
|
|
285
274
|
}
|
|
286
275
|
return !1;
|
|
287
|
-
},
|
|
288
|
-
const t =
|
|
289
|
-
if (
|
|
276
|
+
}, c), r.registerCommand(yt, (e) => {
|
|
277
|
+
const t = g();
|
|
278
|
+
if (T(t)) {
|
|
290
279
|
const o = t.getNodes();
|
|
291
|
-
if (o.length > 0) return e.preventDefault(),
|
|
280
|
+
if (o.length > 0) return e.preventDefault(), ge(o[0]) ? o[0].selectPrevious() : o[0].selectNext(0, 0), !0;
|
|
292
281
|
}
|
|
293
|
-
if (!
|
|
282
|
+
if (!h(t)) return !1;
|
|
294
283
|
const n = e.shiftKey;
|
|
295
|
-
return !!
|
|
296
|
-
},
|
|
284
|
+
return !!he(t, !1) && (e.preventDefault(), ve(t, n, !1), !0);
|
|
285
|
+
}, c), r.registerCommand(vt, (e) => {
|
|
297
286
|
if (xe(e.target)) return !1;
|
|
298
|
-
const t =
|
|
299
|
-
if (
|
|
287
|
+
const t = g();
|
|
288
|
+
if (h(t)) {
|
|
300
289
|
if ((function(n) {
|
|
301
290
|
if (!n.isCollapsed()) return !1;
|
|
302
291
|
const { anchor: o } = n;
|
|
303
292
|
if (o.offset !== 0) return !1;
|
|
304
|
-
const
|
|
305
|
-
if (
|
|
306
|
-
const
|
|
307
|
-
return
|
|
293
|
+
const s = o.getNode();
|
|
294
|
+
if (Re(s)) return !1;
|
|
295
|
+
const a = or(s);
|
|
296
|
+
return a.getIndent() > 0 && (a.is(s) || s.is(a.getFirstDescendant()));
|
|
308
297
|
})(t)) return e.preventDefault(), r.dispatchCommand(de, void 0);
|
|
309
|
-
if (
|
|
310
|
-
} else if (!
|
|
311
|
-
return e.preventDefault(), r.dispatchCommand(
|
|
312
|
-
},
|
|
298
|
+
if (we && navigator.language === "ko-KR") return !1;
|
|
299
|
+
} else if (!T(t)) return !1;
|
|
300
|
+
return e.preventDefault(), r.dispatchCommand(Q, !0);
|
|
301
|
+
}, c), r.registerCommand(ht, (e) => {
|
|
313
302
|
if (xe(e.target)) return !1;
|
|
314
|
-
const t =
|
|
315
|
-
return !(!
|
|
316
|
-
},
|
|
317
|
-
const t =
|
|
318
|
-
if (!
|
|
319
|
-
if (
|
|
320
|
-
if ((
|
|
321
|
-
if (e.preventDefault(), e.shiftKey) return r.dispatchCommand(
|
|
303
|
+
const t = g();
|
|
304
|
+
return !(!h(t) && !T(t)) && (e.preventDefault(), r.dispatchCommand(Q, !1));
|
|
305
|
+
}, c), r.registerCommand(gt, (e) => {
|
|
306
|
+
const t = g();
|
|
307
|
+
if (!h(t)) return !1;
|
|
308
|
+
if (Z(t), e !== null) {
|
|
309
|
+
if ((we || Ur || Or) && zr) return !1;
|
|
310
|
+
if (e.preventDefault(), e.shiftKey) return r.dispatchCommand(le, !1);
|
|
322
311
|
}
|
|
323
|
-
return r.dispatchCommand(
|
|
324
|
-
},
|
|
325
|
-
const e =
|
|
326
|
-
return !!
|
|
327
|
-
},
|
|
328
|
-
const [, t] =
|
|
312
|
+
return r.dispatchCommand(ue, void 0);
|
|
313
|
+
}, c), r.registerCommand(pt, () => {
|
|
314
|
+
const e = g();
|
|
315
|
+
return !!h(e) && (r.blur(), !0);
|
|
316
|
+
}, c), r.registerCommand(ct, (e) => {
|
|
317
|
+
const [, t] = G(e);
|
|
329
318
|
if (t.length > 0) {
|
|
330
|
-
const o =
|
|
319
|
+
const o = Ee(e.clientX, e.clientY);
|
|
331
320
|
if (o !== null) {
|
|
332
|
-
const { offset:
|
|
321
|
+
const { offset: s, node: a } = o, i = re(a);
|
|
333
322
|
if (i !== null) {
|
|
334
|
-
const l =
|
|
335
|
-
if (B(i)) l.anchor.set(i.getKey(),
|
|
323
|
+
const l = ft();
|
|
324
|
+
if (B(i)) l.anchor.set(i.getKey(), s, "text"), l.focus.set(i.getKey(), s, "text");
|
|
336
325
|
else {
|
|
337
326
|
const u = i.getParentOrThrow().getKey(), m = i.getIndexWithinParent() + 1;
|
|
338
327
|
l.anchor.set(u, m, "element"), l.focus.set(u, m, "element");
|
|
339
328
|
}
|
|
340
|
-
const
|
|
341
|
-
|
|
329
|
+
const d = mt(l);
|
|
330
|
+
Te(d);
|
|
342
331
|
}
|
|
343
|
-
r.dispatchCommand(
|
|
332
|
+
r.dispatchCommand(Se, t);
|
|
344
333
|
}
|
|
345
334
|
return e.preventDefault(), !0;
|
|
346
335
|
}
|
|
347
|
-
const n =
|
|
348
|
-
return !!
|
|
349
|
-
},
|
|
350
|
-
const [t] =
|
|
351
|
-
return !(t && !
|
|
352
|
-
},
|
|
353
|
-
const [t] =
|
|
354
|
-
if (t && !
|
|
355
|
-
const o =
|
|
336
|
+
const n = g();
|
|
337
|
+
return !!h(n);
|
|
338
|
+
}, c), r.registerCommand(dt, (e) => {
|
|
339
|
+
const [t] = G(e), n = g();
|
|
340
|
+
return !(t && !h(n));
|
|
341
|
+
}, c), r.registerCommand(ut, (e) => {
|
|
342
|
+
const [t] = G(e), n = g();
|
|
343
|
+
if (t && !h(n)) return !1;
|
|
344
|
+
const o = Ee(e.clientX, e.clientY);
|
|
356
345
|
if (o !== null) {
|
|
357
|
-
const
|
|
358
|
-
|
|
346
|
+
const s = re(o.node);
|
|
347
|
+
q(s) && e.preventDefault();
|
|
359
348
|
}
|
|
360
349
|
return !0;
|
|
361
|
-
},
|
|
362
|
-
await
|
|
363
|
-
const o =
|
|
364
|
-
|
|
350
|
+
}, c), r.registerCommand(it, () => (lt(), !0), c), r.registerCommand(st, (e) => (pe(r, U(e, ClipboardEvent) ? e : null), !0), c), r.registerCommand(at, (e) => ((async function(t, n) {
|
|
351
|
+
await pe(n, U(t, ClipboardEvent) ? t : null), n.update(() => {
|
|
352
|
+
const o = g();
|
|
353
|
+
h(o) ? o.removeText() : T(o) && o.getNodes().forEach((s) => s.remove());
|
|
365
354
|
});
|
|
366
|
-
})(e, r), !0),
|
|
367
|
-
const [, t, n] =
|
|
368
|
-
return t.length > 0 && !n ? (r.dispatchCommand(
|
|
369
|
-
o.preventDefault(),
|
|
370
|
-
const
|
|
371
|
-
i != null &&
|
|
372
|
-
}, { tag:
|
|
355
|
+
})(e, r), !0), c), r.registerCommand(et, (e) => {
|
|
356
|
+
const [, t, n] = G(e);
|
|
357
|
+
return t.length > 0 && !n ? (r.dispatchCommand(Se, t), !0) : rt(e.target) && nt(e.target) ? !1 : g() !== null && ((function(o, s) {
|
|
358
|
+
o.preventDefault(), s.update(() => {
|
|
359
|
+
const a = g(), i = U(o, InputEvent) || U(o, KeyboardEvent) ? null : o.clipboardData;
|
|
360
|
+
i != null && a !== null && me(i, a, s);
|
|
361
|
+
}, { tag: ot });
|
|
373
362
|
})(e, r), !0);
|
|
374
|
-
},
|
|
375
|
-
const t =
|
|
376
|
-
return
|
|
377
|
-
},
|
|
378
|
-
const t =
|
|
379
|
-
return
|
|
380
|
-
},
|
|
381
|
-
}
|
|
382
|
-
function
|
|
363
|
+
}, c), r.registerCommand(Ze, (e) => {
|
|
364
|
+
const t = g();
|
|
365
|
+
return h(t) && Z(t), !1;
|
|
366
|
+
}, c), r.registerCommand(Qe, (e) => {
|
|
367
|
+
const t = g();
|
|
368
|
+
return h(t) && Z(t), !1;
|
|
369
|
+
}, c));
|
|
370
|
+
}
|
|
371
|
+
function Jr(r, ...e) {
|
|
383
372
|
const t = new URL("https://lexical.dev/docs/error"), n = new URLSearchParams();
|
|
384
373
|
n.append("code", r);
|
|
385
374
|
for (const o of e) n.append("v", o);
|
|
386
375
|
throw t.search = n.toString(), Error(`Minified Lexical error #${r}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
387
376
|
}
|
|
388
|
-
const
|
|
389
|
-
function
|
|
377
|
+
const ie = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? J : b;
|
|
378
|
+
function jr({ editor: r, ErrorBoundary: e }) {
|
|
390
379
|
return (function(t, n) {
|
|
391
|
-
const [o,
|
|
392
|
-
return
|
|
393
|
-
|
|
394
|
-
a
|
|
380
|
+
const [o, s] = F(() => t.getDecorators());
|
|
381
|
+
return ie(() => t.registerDecoratorListener((a) => {
|
|
382
|
+
er(() => {
|
|
383
|
+
s(a);
|
|
395
384
|
});
|
|
396
385
|
}), [t]), b(() => {
|
|
397
|
-
|
|
398
|
-
}, [t]),
|
|
399
|
-
const
|
|
386
|
+
s(t.getDecorators());
|
|
387
|
+
}, [t]), X(() => {
|
|
388
|
+
const a = [], i = Object.keys(o);
|
|
400
389
|
for (let l = 0; l < i.length; l++) {
|
|
401
|
-
const
|
|
402
|
-
m !== null &&
|
|
390
|
+
const d = i[l], u = f(n, { onError: (p) => t._onError(p), children: f(Ot, { fallback: null, children: o[d] }) }), m = t.getElementByKey(d);
|
|
391
|
+
m !== null && a.push(tr(u, m, d));
|
|
403
392
|
}
|
|
404
|
-
return
|
|
393
|
+
return a;
|
|
405
394
|
}, [n, o, t]);
|
|
406
395
|
})(r, e);
|
|
407
396
|
}
|
|
408
|
-
function
|
|
397
|
+
function Yr({ editor: r, ErrorBoundary: e }) {
|
|
409
398
|
return (function(t) {
|
|
410
|
-
const n =
|
|
411
|
-
if (n && n.hasExtensionByName(
|
|
412
|
-
for (const o of ["@lexical/plain-text", "@lexical/rich-text"]) n.hasExtensionByName(o) &&
|
|
399
|
+
const n = Gt.maybeFromEditor(t);
|
|
400
|
+
if (n && n.hasExtensionByName(Rr.name)) {
|
|
401
|
+
for (const o of ["@lexical/plain-text", "@lexical/rich-text"]) n.hasExtensionByName(o) && Jr(320, o);
|
|
413
402
|
return !0;
|
|
414
403
|
}
|
|
415
404
|
return !1;
|
|
416
|
-
})(r) ? null : f(
|
|
405
|
+
})(r) ? null : f(jr, { editor: r, ErrorBoundary: e });
|
|
417
406
|
}
|
|
418
|
-
function
|
|
419
|
-
return r.getEditorState().read(
|
|
407
|
+
function Ne(r) {
|
|
408
|
+
return r.getEditorState().read(qe(r.isComposing()));
|
|
420
409
|
}
|
|
421
|
-
function
|
|
422
|
-
const [n] =
|
|
410
|
+
function Wr({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
|
|
411
|
+
const [n] = D();
|
|
423
412
|
return (function(o) {
|
|
424
|
-
|
|
425
|
-
})(n), A(
|
|
413
|
+
ie(() => H(qr(o), Mr(o)), [o]);
|
|
414
|
+
})(n), A(Pe, { children: [r, f(Vr, { content: e }), f(Yr, { editor: n, ErrorBoundary: t })] });
|
|
426
415
|
}
|
|
427
|
-
function
|
|
428
|
-
const [e] =
|
|
429
|
-
const [
|
|
430
|
-
return
|
|
416
|
+
function Vr({ content: r }) {
|
|
417
|
+
const [e] = D(), t = (function(o) {
|
|
418
|
+
const [s, a] = F(() => Ne(o));
|
|
419
|
+
return ie(() => {
|
|
431
420
|
function i() {
|
|
432
|
-
const l =
|
|
433
|
-
|
|
421
|
+
const l = Ne(o);
|
|
422
|
+
a(l);
|
|
434
423
|
}
|
|
435
424
|
return i(), H(o.registerUpdateListener(() => {
|
|
436
425
|
i();
|
|
437
426
|
}), o.registerEditableListener(() => {
|
|
438
427
|
i();
|
|
439
428
|
}));
|
|
440
|
-
}, [o]),
|
|
441
|
-
})(e), n =
|
|
429
|
+
}, [o]), s;
|
|
430
|
+
})(e), n = Wt();
|
|
442
431
|
return t ? typeof r == "function" ? r(n) : r : null;
|
|
443
432
|
}
|
|
444
|
-
const
|
|
445
|
-
function
|
|
446
|
-
const [
|
|
447
|
-
|
|
448
|
-
}, [r]),
|
|
449
|
-
return (
|
|
450
|
-
for (const
|
|
433
|
+
const Je = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? J : b;
|
|
434
|
+
function Gr({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: n, ariaDescribedBy: o, ariaErrorMessage: s, ariaExpanded: a, ariaInvalid: i, ariaLabel: l, ariaLabelledBy: d, ariaMultiline: u, ariaOwns: m, ariaRequired: p, autoCapitalize: w, className: v, id: N, role: E = "textbox", spellCheck: C = !0, style: y, tabIndex: $, "data-testid": I, ...L }, k) {
|
|
435
|
+
const [S, P] = F(r.isEditable()), x = qt((_) => {
|
|
436
|
+
_ && _.ownerDocument && _.ownerDocument.defaultView ? r.setRootElement(_) : r.setRootElement(null);
|
|
437
|
+
}, [r]), M = X(() => /* @__PURE__ */ (function(..._) {
|
|
438
|
+
return (j) => {
|
|
439
|
+
for (const O of _) typeof O == "function" ? O(j) : O != null && (O.current = j);
|
|
451
440
|
};
|
|
452
|
-
})(k,
|
|
453
|
-
return
|
|
454
|
-
|
|
455
|
-
})), [r]), f("div", { "aria-activedescendant":
|
|
441
|
+
})(k, x), [x, k]);
|
|
442
|
+
return Je(() => (P(r.isEditable()), r.registerEditableListener((_) => {
|
|
443
|
+
P(_);
|
|
444
|
+
})), [r]), f("div", { "aria-activedescendant": S ? e : void 0, "aria-autocomplete": S ? t : "none", "aria-controls": S ? n : void 0, "aria-describedby": o, ...s != null ? { "aria-errormessage": s } : {}, "aria-expanded": S && E === "combobox" ? !!a : void 0, ...i != null ? { "aria-invalid": i } : {}, "aria-label": l, "aria-labelledby": d, "aria-multiline": u, "aria-owns": S ? m : void 0, "aria-readonly": !S || void 0, "aria-required": p, autoCapitalize: w, className: v, contentEditable: S, "data-testid": I, id: N, ref: M, role: E, spellCheck: C, style: y, tabIndex: $, ...L });
|
|
456
445
|
}
|
|
457
|
-
const
|
|
458
|
-
function
|
|
459
|
-
return r.getEditorState().read(
|
|
460
|
-
}
|
|
461
|
-
const Qr = Be(
|
|
462
|
-
function
|
|
463
|
-
const { placeholder: t, ...n } = r, [o] =
|
|
464
|
-
return A(
|
|
465
|
-
}
|
|
466
|
-
function
|
|
467
|
-
const t = (function(
|
|
468
|
-
const [i, l] =
|
|
469
|
-
return
|
|
470
|
-
function
|
|
471
|
-
const u =
|
|
446
|
+
const Xr = Be(Gr);
|
|
447
|
+
function _e(r) {
|
|
448
|
+
return r.getEditorState().read(qe(r.isComposing()));
|
|
449
|
+
}
|
|
450
|
+
const Qr = Be(Zr);
|
|
451
|
+
function Zr(r, e) {
|
|
452
|
+
const { placeholder: t, ...n } = r, [o] = D();
|
|
453
|
+
return A(Pe, { children: [f(Xr, { editor: o, ...n, ref: e }), t != null && f(en, { editor: o, content: t })] });
|
|
454
|
+
}
|
|
455
|
+
function en({ content: r, editor: e }) {
|
|
456
|
+
const t = (function(a) {
|
|
457
|
+
const [i, l] = F(() => _e(a));
|
|
458
|
+
return Je(() => {
|
|
459
|
+
function d() {
|
|
460
|
+
const u = _e(a);
|
|
472
461
|
l(u);
|
|
473
462
|
}
|
|
474
|
-
return
|
|
475
|
-
|
|
476
|
-
}),
|
|
477
|
-
|
|
463
|
+
return d(), H(a.registerUpdateListener(() => {
|
|
464
|
+
d();
|
|
465
|
+
}), a.registerEditableListener(() => {
|
|
466
|
+
d();
|
|
478
467
|
}));
|
|
479
|
-
}, [
|
|
480
|
-
})(e), [n, o] =
|
|
481
|
-
if (J(() => (o(e.isEditable()), e.registerEditableListener((
|
|
482
|
-
o(
|
|
468
|
+
}, [a]), i;
|
|
469
|
+
})(e), [n, o] = F(e.isEditable());
|
|
470
|
+
if (J(() => (o(e.isEditable()), e.registerEditableListener((a) => {
|
|
471
|
+
o(a);
|
|
483
472
|
})), [e]), !t) return null;
|
|
484
|
-
let
|
|
485
|
-
return typeof r == "function" ?
|
|
473
|
+
let s = null;
|
|
474
|
+
return typeof r == "function" ? s = r(n) : r !== null && (s = r), s === null ? null : f("div", { "aria-hidden": !0, children: s });
|
|
486
475
|
}
|
|
487
|
-
const
|
|
476
|
+
const tn = jt(null), ee = {
|
|
488
477
|
didCatch: !1,
|
|
489
478
|
error: null
|
|
490
479
|
};
|
|
491
|
-
class
|
|
480
|
+
let rn = class extends Jt {
|
|
492
481
|
constructor(e) {
|
|
493
482
|
super(e), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = ee;
|
|
494
483
|
}
|
|
@@ -507,368 +496,373 @@ class Vr extends zt {
|
|
|
507
496
|
}
|
|
508
497
|
componentDidUpdate(e, t) {
|
|
509
498
|
const { didCatch: n } = this.state, { resetKeys: o } = this.props;
|
|
510
|
-
n && t.error !== null &&
|
|
499
|
+
n && t.error !== null && nn(e.resetKeys, o) && (this.props.onReset?.({
|
|
511
500
|
next: o,
|
|
512
501
|
prev: e.resetKeys,
|
|
513
502
|
reason: "keys"
|
|
514
503
|
}), this.setState(ee));
|
|
515
504
|
}
|
|
516
505
|
render() {
|
|
517
|
-
const { children: e, fallbackRender: t, FallbackComponent: n, fallback: o } = this.props, { didCatch:
|
|
506
|
+
const { children: e, fallbackRender: t, FallbackComponent: n, fallback: o } = this.props, { didCatch: s, error: a } = this.state;
|
|
518
507
|
let i = e;
|
|
519
|
-
if (
|
|
508
|
+
if (s) {
|
|
520
509
|
const l = {
|
|
521
|
-
error:
|
|
510
|
+
error: a,
|
|
522
511
|
resetErrorBoundary: this.resetErrorBoundary
|
|
523
512
|
};
|
|
524
513
|
if (typeof t == "function")
|
|
525
514
|
i = t(l);
|
|
526
515
|
else if (n)
|
|
527
|
-
i =
|
|
516
|
+
i = fe(n, l);
|
|
528
517
|
else if (o !== void 0)
|
|
529
518
|
i = o;
|
|
530
519
|
else
|
|
531
|
-
throw
|
|
520
|
+
throw a;
|
|
532
521
|
}
|
|
533
|
-
return
|
|
534
|
-
|
|
522
|
+
return fe(
|
|
523
|
+
tn.Provider,
|
|
535
524
|
{
|
|
536
525
|
value: {
|
|
537
|
-
didCatch:
|
|
538
|
-
error:
|
|
526
|
+
didCatch: s,
|
|
527
|
+
error: a,
|
|
539
528
|
resetErrorBoundary: this.resetErrorBoundary
|
|
540
529
|
}
|
|
541
530
|
},
|
|
542
531
|
i
|
|
543
532
|
);
|
|
544
533
|
}
|
|
545
|
-
}
|
|
546
|
-
function
|
|
534
|
+
};
|
|
535
|
+
function nn(r = [], e = []) {
|
|
547
536
|
return r.length !== e.length || r.some((t, n) => !Object.is(t, e[n]));
|
|
548
537
|
}
|
|
549
|
-
function
|
|
550
|
-
return f(
|
|
538
|
+
function on({ children: r, onError: e }) {
|
|
539
|
+
return f(rn, { fallback: f("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: r });
|
|
551
540
|
}
|
|
552
|
-
const
|
|
553
|
-
function
|
|
554
|
-
const [n] =
|
|
555
|
-
return
|
|
556
|
-
if (t) return n.registerUpdateListener(({ editorState: o, dirtyElements:
|
|
557
|
-
e &&
|
|
541
|
+
const an = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? J : b;
|
|
542
|
+
function sn({ ignoreHistoryMergeTagChange: r = !0, ignoreSelectionChange: e = !1, onChange: t }) {
|
|
543
|
+
const [n] = D();
|
|
544
|
+
return an(() => {
|
|
545
|
+
if (t) return n.registerUpdateListener(({ editorState: o, dirtyElements: s, dirtyLeaves: a, prevEditorState: i, tags: l }) => {
|
|
546
|
+
e && s.size === 0 && a.size === 0 || r && l.has(oe) || i.isEmpty() || t(o, n, l);
|
|
558
547
|
});
|
|
559
548
|
}, [n, r, e, t]), null;
|
|
560
549
|
}
|
|
561
|
-
function
|
|
562
|
-
const [
|
|
550
|
+
function ln({ hasStrictIndent: r = !1, shouldPreserveNumbering: e = !1 }) {
|
|
551
|
+
const [t] = D();
|
|
563
552
|
return b(() => {
|
|
564
|
-
if (!
|
|
565
|
-
}, [
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
const [t] = L();
|
|
553
|
+
if (!t.hasNodes([Me, Ae])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
|
|
554
|
+
}, [t]), b(() => H(Ce(t, { restoreNumbering: e }), r ? ar(t) : () => {
|
|
555
|
+
}), [t, r, e]), (function(n) {
|
|
556
|
+
b(() => Ce(n), [n]);
|
|
557
|
+
})(t), null;
|
|
558
|
+
}
|
|
559
|
+
function un({ validateUrl: r, attributes: e }) {
|
|
560
|
+
const [t] = D();
|
|
573
561
|
return b(() => {
|
|
574
|
-
if (!t.hasNodes([
|
|
575
|
-
}), b(() =>
|
|
562
|
+
if (!t.hasNodes([Ke])) throw new Error("LinkPlugin: LinkNode not registered on editor");
|
|
563
|
+
}), b(() => sr(t, se({ attributes: e, validateUrl: r })), [t, r, e]), null;
|
|
576
564
|
}
|
|
577
|
-
function
|
|
565
|
+
function dn(r, e, t, n) {
|
|
578
566
|
b(() => {
|
|
579
|
-
r.hasNodes([
|
|
580
|
-
const a = new URL("https://lexical.dev/docs/error"),
|
|
581
|
-
|
|
582
|
-
for (const
|
|
583
|
-
throw a.search =
|
|
567
|
+
r.hasNodes([ze]) || (function(o, ...s) {
|
|
568
|
+
const a = new URL("https://lexical.dev/docs/error"), i = new URLSearchParams();
|
|
569
|
+
i.append("code", o);
|
|
570
|
+
for (const l of s) i.append("v", l);
|
|
571
|
+
throw a.search = i.toString(), Error(`Minified Lexical error #${o}; visit ${a.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
584
572
|
})(77);
|
|
585
|
-
}), b(() =>
|
|
573
|
+
}), b(() => ir(r, { changeHandlers: t ? [t] : [], excludeParents: n ?? [], matchers: e }), [r, e, t, n]);
|
|
586
574
|
}
|
|
587
|
-
function
|
|
588
|
-
const [
|
|
589
|
-
return
|
|
575
|
+
function cn({ matchers: r, onChange: e, excludeParents: t }) {
|
|
576
|
+
const [n] = D();
|
|
577
|
+
return dn(n, r, e, t), null;
|
|
590
578
|
}
|
|
591
|
-
function
|
|
592
|
-
const [t] =
|
|
593
|
-
return b(() =>
|
|
579
|
+
function fn({ newTab: r = !0, disabled: e = !1 }) {
|
|
580
|
+
const [t] = D();
|
|
581
|
+
return b(() => lr(t, se({ disabled: e, newTab: r })), [t, r, e]), null;
|
|
594
582
|
}
|
|
595
|
-
function
|
|
583
|
+
function mn(r, e, t, n, o) {
|
|
596
584
|
if (r === null || t.size === 0 && n.size === 0 && !o) return 0;
|
|
597
|
-
const
|
|
585
|
+
const s = e._selection, a = r._selection;
|
|
598
586
|
if (o) return 1;
|
|
599
|
-
if (!(
|
|
600
|
-
const i = (function(C,
|
|
601
|
-
const
|
|
602
|
-
for (const k of
|
|
603
|
-
const
|
|
604
|
-
|
|
587
|
+
if (!(h(s) && h(a) && a.isCollapsed() && s.isCollapsed())) return 0;
|
|
588
|
+
const i = (function(C, y, $) {
|
|
589
|
+
const I = C._nodeMap, L = [];
|
|
590
|
+
for (const k of y) {
|
|
591
|
+
const S = I.get(k);
|
|
592
|
+
S !== void 0 && L.push(S);
|
|
605
593
|
}
|
|
606
|
-
for (const [k,
|
|
607
|
-
if (!
|
|
608
|
-
const
|
|
609
|
-
|
|
594
|
+
for (const [k, S] of $) {
|
|
595
|
+
if (!S) continue;
|
|
596
|
+
const P = I.get(k);
|
|
597
|
+
P === void 0 || Re(P) || L.push(P);
|
|
610
598
|
}
|
|
611
|
-
return
|
|
599
|
+
return L;
|
|
612
600
|
})(e, t, n);
|
|
613
601
|
if (i.length === 0) return 0;
|
|
614
602
|
if (i.length > 1) {
|
|
615
|
-
const C = e._nodeMap,
|
|
616
|
-
return
|
|
603
|
+
const C = e._nodeMap, y = C.get(s.anchor.key), $ = C.get(a.anchor.key);
|
|
604
|
+
return y && $ && !r._nodeMap.has(y.__key) && B(y) && y.__text.length === 1 && s.anchor.offset === 1 ? 2 : 0;
|
|
617
605
|
}
|
|
618
|
-
const l = i[0],
|
|
619
|
-
if (!B(
|
|
620
|
-
const u =
|
|
606
|
+
const l = i[0], d = r._nodeMap.get(l.__key);
|
|
607
|
+
if (!B(d) || !B(l) || d.__mode !== l.__mode) return 0;
|
|
608
|
+
const u = d.__text, m = l.__text;
|
|
621
609
|
if (u === m) return 0;
|
|
622
|
-
const
|
|
623
|
-
if (
|
|
624
|
-
const
|
|
625
|
-
return E === 1 &&
|
|
626
|
-
}
|
|
627
|
-
function
|
|
628
|
-
let t = Date.now(), n = 0;
|
|
629
|
-
return (
|
|
630
|
-
const
|
|
631
|
-
if (
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
if (
|
|
636
|
-
|
|
637
|
-
if (
|
|
638
|
-
const
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
610
|
+
const p = s.anchor, w = a.anchor;
|
|
611
|
+
if (p.key !== w.key || p.type !== "text") return 0;
|
|
612
|
+
const v = p.offset, N = w.offset, E = m.length - u.length;
|
|
613
|
+
return E === 1 && N === v - 1 ? 2 : E === -1 && N === v + 1 ? 3 : E === -1 && N === v ? 4 : 0;
|
|
614
|
+
}
|
|
615
|
+
function pn(r, e) {
|
|
616
|
+
let t = Date.now(), n = 0, o = Date.now(), s = 0, a = null;
|
|
617
|
+
return (i, l, d, u, m, p) => {
|
|
618
|
+
const w = Date.now();
|
|
619
|
+
if (p.has(Mt) && (o = t, s = n, a = i), p.has(ne)) return n = 0, t = w, 2;
|
|
620
|
+
p.has(At) && a && (t = o, n = s, i = a);
|
|
621
|
+
const v = mn(i, l, u, m, r.isComposing()), N = (() => {
|
|
622
|
+
const E = d === null || d.editor === r, C = p.has(Kt);
|
|
623
|
+
if (!C && E && p.has(oe)) return 0;
|
|
624
|
+
if (v === 1) return 2;
|
|
625
|
+
if (i === null) return 1;
|
|
626
|
+
const y = l._selection;
|
|
627
|
+
if (!(u.size > 0 || m.size > 0)) return y !== null ? 0 : 2;
|
|
628
|
+
const $ = typeof e == "number" ? e : e.peek();
|
|
629
|
+
return C === !1 && v !== 0 && v === n && w < t + $ && E || u.size === 1 && (function(I, L, k) {
|
|
630
|
+
const S = L._nodeMap.get(I), P = k._nodeMap.get(I), x = L._selection, M = k._selection;
|
|
631
|
+
return !(h(x) && h(M) && x.anchor.type === "element" && x.focus.type === "element" && M.anchor.type === "text" && M.focus.type === "text" || !B(S) || !B(P) || S.__parent !== P.__parent) && JSON.stringify(L.read(() => S.exportJSON())) === JSON.stringify(k.read(() => P.exportJSON()));
|
|
632
|
+
})(Array.from(u)[0], i, l) ? 0 : 1;
|
|
643
633
|
})();
|
|
644
|
-
return t =
|
|
634
|
+
return t = w, n = v, N;
|
|
645
635
|
};
|
|
646
636
|
}
|
|
647
637
|
function $e(r) {
|
|
648
638
|
r.undoStack = [], r.redoStack = [], r.current = null;
|
|
649
639
|
}
|
|
650
|
-
function
|
|
651
|
-
const n =
|
|
652
|
-
return H(r.registerCommand(
|
|
653
|
-
const i =
|
|
640
|
+
function je(r, e, t) {
|
|
641
|
+
const n = pn(r, t);
|
|
642
|
+
return H(r.registerCommand(Ft, () => ((function(s, a) {
|
|
643
|
+
const i = a.redoStack, l = a.undoStack;
|
|
654
644
|
if (l.length !== 0) {
|
|
655
|
-
const
|
|
656
|
-
|
|
645
|
+
const d = a.current, u = l.pop();
|
|
646
|
+
d !== null && (i.push(d), s.dispatchCommand(Y, !0)), l.length === 0 && s.dispatchCommand(W, !1), a.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: ne });
|
|
657
647
|
}
|
|
658
|
-
})(r, e), !0),
|
|
659
|
-
const i =
|
|
648
|
+
})(r, e), !0), c), r.registerCommand(Bt, () => ((function(s, a) {
|
|
649
|
+
const i = a.redoStack, l = a.undoStack;
|
|
660
650
|
if (i.length !== 0) {
|
|
661
|
-
const
|
|
662
|
-
|
|
651
|
+
const d = a.current;
|
|
652
|
+
d !== null && (l.push(d), s.dispatchCommand(W, !0));
|
|
663
653
|
const u = i.pop();
|
|
664
|
-
i.length === 0 &&
|
|
654
|
+
i.length === 0 && s.dispatchCommand(Y, !1), a.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: ne });
|
|
665
655
|
}
|
|
666
|
-
})(r, e), !0),
|
|
667
|
-
const u = e.current, m = e.redoStack,
|
|
668
|
-
if (u !== null &&
|
|
669
|
-
const
|
|
670
|
-
if (
|
|
671
|
-
else if (
|
|
672
|
-
e.current = { editor: r, editorState:
|
|
656
|
+
})(r, e), !0), c), r.registerCommand(It, () => ($e(e), !1), c), r.registerCommand(Rt, () => ($e(e), r.dispatchCommand(Y, !1), r.dispatchCommand(W, !1), !0), c), r.registerUpdateListener(({ editorState: s, prevEditorState: a, dirtyLeaves: i, dirtyElements: l, tags: d }) => {
|
|
657
|
+
const u = e.current, m = e.redoStack, p = e.undoStack, w = u === null ? null : u.editorState;
|
|
658
|
+
if (u !== null && s === w) return;
|
|
659
|
+
const v = n(a, s, u, i, l, d);
|
|
660
|
+
if (v === 1) m.length !== 0 && (e.redoStack = [], r.dispatchCommand(Y, !1)), u !== null && (p.push({ ...u }), r.dispatchCommand(W, !0));
|
|
661
|
+
else if (v === 2) return;
|
|
662
|
+
e.current = { editor: r, editorState: s };
|
|
673
663
|
}));
|
|
674
664
|
}
|
|
675
|
-
function
|
|
665
|
+
function Ye() {
|
|
676
666
|
return { current: null, redoStack: [], undoStack: [] };
|
|
677
667
|
}
|
|
678
|
-
const te = ae({ build: (r, { delay: e, createInitialHistoryState: t, disabled: n }) =>
|
|
668
|
+
const te = ae({ build: (r, { delay: e, createInitialHistoryState: t, disabled: n }) => se({ delay: e, disabled: n, historyState: t(r) }), config: Ut({ createInitialHistoryState: Ye, delay: 300, disabled: typeof window > "u" }), name: "@lexical/history/History", register: (r, e, t) => {
|
|
679
669
|
const n = t.getOutput();
|
|
680
|
-
return
|
|
670
|
+
return Fe(() => n.disabled.value ? void 0 : je(r, n.historyState.value, n.delay));
|
|
681
671
|
} });
|
|
682
|
-
ae({ dependencies: [
|
|
672
|
+
ae({ dependencies: [zt(te, { createInitialHistoryState: () => {
|
|
683
673
|
throw new Error("SharedHistory did not inherit parent history");
|
|
684
674
|
}, disabled: !0 })], name: "@lexical/history/SharedHistory", register(r, e, t) {
|
|
685
|
-
const { output: n } = t.getDependency(te), o = (function(
|
|
686
|
-
return
|
|
675
|
+
const { output: n } = t.getDependency(te), o = (function(a) {
|
|
676
|
+
return a ? Xt(a, te.name) : null;
|
|
687
677
|
})(r._parentEditor);
|
|
688
678
|
if (!o) return () => {
|
|
689
679
|
};
|
|
690
|
-
const
|
|
691
|
-
return
|
|
692
|
-
n.delay.value =
|
|
680
|
+
const s = o.output;
|
|
681
|
+
return Fe(() => Qt(() => {
|
|
682
|
+
n.delay.value = s.delay.value, n.historyState.value = s.historyState.value, n.disabled.value = s.disabled.value;
|
|
693
683
|
}));
|
|
694
684
|
} });
|
|
695
|
-
function
|
|
696
|
-
const [t] =
|
|
697
|
-
return (function(n, o,
|
|
698
|
-
const
|
|
699
|
-
b(() =>
|
|
685
|
+
function gn({ delay: r, externalHistoryState: e }) {
|
|
686
|
+
const [t] = D();
|
|
687
|
+
return (function(n, o, s = 1e3) {
|
|
688
|
+
const a = X(() => o || Ye(), [o]);
|
|
689
|
+
b(() => je(n, a, s), [s, n, a]);
|
|
700
690
|
})(t, e, r), null;
|
|
701
691
|
}
|
|
702
|
-
function
|
|
703
|
-
const [a] =
|
|
692
|
+
function hn({ hasCellMerge: r = !0, hasCellBackgroundColor: e = !0, hasTabHandler: t = !0, hasHorizontalScroll: n = !1, hasNestedTables: o = !1, hasFitNestedTables: s = !1 }) {
|
|
693
|
+
const [a] = D();
|
|
704
694
|
b(() => {
|
|
705
|
-
|
|
695
|
+
ur(a) !== n && (dr(a, n), a.registerNodeTransform(Ue, () => {
|
|
706
696
|
})());
|
|
707
697
|
}, [a, n]);
|
|
708
|
-
const
|
|
709
|
-
return
|
|
710
|
-
if (!r) return
|
|
698
|
+
const i = ke(o), l = ke(s);
|
|
699
|
+
return b(() => cr(a, { hasFitNestedTables: l, hasNestedTables: i }), [a, i, l]), b(() => fr(a, t), [a, t]), b(() => {
|
|
700
|
+
if (!r) return mr(a);
|
|
711
701
|
}, [a, r]), b(() => {
|
|
712
|
-
if (!e) return a.registerNodeTransform(
|
|
713
|
-
|
|
702
|
+
if (!e) return a.registerNodeTransform(He, (d) => {
|
|
703
|
+
d.getBackgroundColor() !== null && d.setBackgroundColor(null);
|
|
714
704
|
});
|
|
715
705
|
}, [a, e, r]), null;
|
|
716
706
|
}
|
|
717
|
-
function
|
|
718
|
-
const [e] =
|
|
719
|
-
return
|
|
707
|
+
function ke(r) {
|
|
708
|
+
const [e] = F(() => Zt(r));
|
|
709
|
+
return e.peek() !== r && (e.value = r), e;
|
|
710
|
+
}
|
|
711
|
+
function vn({ editorRef: r }) {
|
|
712
|
+
const [e] = D();
|
|
713
|
+
return Ht.useEffect(() => {
|
|
720
714
|
typeof r == "function" ? r(e) : typeof r == "object" && (r.current = e);
|
|
721
715
|
}, [e]), null;
|
|
722
716
|
}
|
|
723
|
-
const
|
|
717
|
+
const yn = ({
|
|
724
718
|
currentLanguage: r = "NL",
|
|
725
719
|
initialValue: e = "",
|
|
726
720
|
placeholder: t = "",
|
|
727
721
|
label: n = "",
|
|
728
722
|
info: o = "",
|
|
729
|
-
required:
|
|
730
|
-
notValid:
|
|
723
|
+
required: s = !1,
|
|
724
|
+
notValid: a = !1,
|
|
731
725
|
notValidatedText: i = "",
|
|
732
726
|
maxHeightInRem: l = "20rem",
|
|
733
|
-
maxWords:
|
|
727
|
+
maxWords: d,
|
|
734
728
|
rteRef: u = null,
|
|
735
729
|
onChange: m,
|
|
736
|
-
onCatalogueLinkSearch:
|
|
737
|
-
catalogueSearchResponse:
|
|
730
|
+
onCatalogueLinkSearch: p,
|
|
731
|
+
catalogueSearchResponse: w = { state: "idle", results: [] }
|
|
738
732
|
}) => {
|
|
739
|
-
const { switchLanguage:
|
|
733
|
+
const { switchLanguage: v } = $r(), N = Er(), [E] = F(() => Le()), [C, y] = F(0), [$, I] = F(0), L = Yt(), k = {
|
|
740
734
|
html: {
|
|
741
|
-
export:
|
|
735
|
+
export: gr
|
|
742
736
|
},
|
|
743
737
|
namespace: "UvaRte",
|
|
744
738
|
editor: E,
|
|
745
|
-
theme:
|
|
746
|
-
onError(
|
|
747
|
-
throw
|
|
739
|
+
theme: xr,
|
|
740
|
+
onError(x) {
|
|
741
|
+
throw x;
|
|
748
742
|
},
|
|
749
743
|
nodes: [
|
|
750
744
|
Me,
|
|
751
745
|
Ae,
|
|
752
|
-
Fe,
|
|
753
|
-
Ue,
|
|
754
|
-
ze,
|
|
755
|
-
dr,
|
|
756
746
|
Ke,
|
|
757
|
-
|
|
758
|
-
|
|
747
|
+
ze,
|
|
748
|
+
He,
|
|
749
|
+
pr,
|
|
750
|
+
Ue,
|
|
751
|
+
kr,
|
|
752
|
+
Pr
|
|
759
753
|
],
|
|
760
|
-
editorState: (
|
|
761
|
-
const
|
|
762
|
-
|
|
754
|
+
editorState: (x) => {
|
|
755
|
+
const _ = new DOMParser().parseFromString(e, "text/html"), j = rr(x, _);
|
|
756
|
+
K().clear(), Ie(j), Te(null);
|
|
763
757
|
}
|
|
764
|
-
},
|
|
765
|
-
|
|
766
|
-
let
|
|
767
|
-
|
|
758
|
+
}, S = (x) => x.trim().length === 0 ? 0 : x.split(" ").length, P = (x, M) => {
|
|
759
|
+
x.read(() => {
|
|
760
|
+
let _ = "";
|
|
761
|
+
y(S(K().getTextContent().replace(/\s+/g, " ").trim())), _ = hr(nr(M)), _ = vr(_), m(_);
|
|
768
762
|
});
|
|
769
763
|
};
|
|
770
764
|
return b(() => {
|
|
771
|
-
|
|
772
|
-
}, [r,
|
|
773
|
-
const
|
|
774
|
-
|
|
765
|
+
v(r.toUpperCase());
|
|
766
|
+
}, [r, v]), b(() => {
|
|
767
|
+
const x = e.replace(/<br\s*\/?>| /gi, " ").replace(/<\/?[^>]+(>|$)|&[a-z]+;/g, "").replace(/\s+/g, " ").trim();
|
|
768
|
+
y(S(x));
|
|
775
769
|
}, [e]), /* @__PURE__ */ A("div", { className: R.editor__container, children: [
|
|
776
770
|
/* @__PURE__ */ A("div", { className: R.editor__header, children: [
|
|
777
|
-
/* @__PURE__ */ f(
|
|
778
|
-
|
|
779
|
-
/* @__PURE__ */ f("span", { className:
|
|
771
|
+
/* @__PURE__ */ f(Nr, { label: n, info: o, required: s }),
|
|
772
|
+
d && d > 0 && /* @__PURE__ */ A("div", { className: R["editor__header-word-count"], children: [
|
|
773
|
+
/* @__PURE__ */ f("span", { className: be({ [R["editor__header-word-count--alert"]]: C > d }), children: C }),
|
|
780
774
|
" / ",
|
|
781
|
-
|
|
775
|
+
d
|
|
782
776
|
] })
|
|
783
777
|
] }),
|
|
784
778
|
/* @__PURE__ */ f(
|
|
785
779
|
"div",
|
|
786
780
|
{
|
|
787
|
-
className:
|
|
788
|
-
[R["not-valid"]]:
|
|
781
|
+
className: be(R.editor, {
|
|
782
|
+
[R["not-valid"]]: a
|
|
789
783
|
}),
|
|
790
|
-
children: /* @__PURE__ */ A(
|
|
784
|
+
children: /* @__PURE__ */ A(Tr, { initialConfig: k, children: [
|
|
791
785
|
/* @__PURE__ */ f(
|
|
792
|
-
|
|
786
|
+
br,
|
|
793
787
|
{
|
|
794
|
-
editorScrollPosition:
|
|
795
|
-
onCatalogueLinkSearch:
|
|
796
|
-
catalogueSearchResponse:
|
|
788
|
+
editorScrollPosition: $,
|
|
789
|
+
onCatalogueLinkSearch: p,
|
|
790
|
+
catalogueSearchResponse: w
|
|
797
791
|
}
|
|
798
792
|
),
|
|
799
793
|
/* @__PURE__ */ A("div", { className: R["editor__field-wrapper"], children: [
|
|
800
794
|
/* @__PURE__ */ f(
|
|
801
|
-
|
|
795
|
+
Wr,
|
|
802
796
|
{
|
|
803
797
|
contentEditable: /* @__PURE__ */ f(
|
|
804
798
|
Qr,
|
|
805
799
|
{
|
|
806
800
|
className: R.editor__field,
|
|
807
|
-
"aria-label":
|
|
801
|
+
"aria-label": N.common.rteAriaLabel,
|
|
808
802
|
"aria-placeholder": t,
|
|
809
|
-
title:
|
|
803
|
+
title: N.common.rteTitle,
|
|
810
804
|
placeholder: /* @__PURE__ */ f("div", { className: R.editor__placeholder, children: t }),
|
|
811
805
|
spellCheck: !1,
|
|
812
|
-
id: `${
|
|
806
|
+
id: `${L}_rteEditor`,
|
|
813
807
|
style: { height: `${l}`, maxHeight: `${l}` },
|
|
814
|
-
onScroll: (
|
|
808
|
+
onScroll: (x) => I(x.currentTarget.scrollTop)
|
|
815
809
|
}
|
|
816
810
|
),
|
|
817
811
|
placeholder: /* @__PURE__ */ f("div", { className: R.editor__placeholder, children: t }),
|
|
818
|
-
ErrorBoundary:
|
|
812
|
+
ErrorBoundary: on
|
|
819
813
|
}
|
|
820
814
|
),
|
|
821
|
-
/* @__PURE__ */ f(
|
|
822
|
-
/* @__PURE__ */ f(
|
|
815
|
+
/* @__PURE__ */ f(hn, {}),
|
|
816
|
+
/* @__PURE__ */ f(Vt, {}),
|
|
817
|
+
/* @__PURE__ */ f(gn, {}),
|
|
818
|
+
/* @__PURE__ */ f(ln, {}),
|
|
819
|
+
/* @__PURE__ */ f(un, { validateUrl: yr }),
|
|
820
|
+
/* @__PURE__ */ f(cn, { matchers: Cr }),
|
|
823
821
|
/* @__PURE__ */ f(fn, {}),
|
|
824
|
-
/* @__PURE__ */ f(
|
|
825
|
-
/* @__PURE__ */ f(
|
|
826
|
-
/* @__PURE__ */ f(
|
|
827
|
-
/* @__PURE__ */ f(
|
|
828
|
-
/* @__PURE__ */ f(nn, { onChange: I }),
|
|
829
|
-
/* @__PURE__ */ f(br, {}),
|
|
830
|
-
/* @__PURE__ */ f($r, {}),
|
|
831
|
-
u && /* @__PURE__ */ f(pn, { editorRef: u })
|
|
822
|
+
/* @__PURE__ */ f(sn, { onChange: P }),
|
|
823
|
+
/* @__PURE__ */ f(Sr, {}),
|
|
824
|
+
/* @__PURE__ */ f(Lr, {}),
|
|
825
|
+
u && /* @__PURE__ */ f(vn, { editorRef: u })
|
|
832
826
|
] })
|
|
833
827
|
] })
|
|
834
828
|
}
|
|
835
829
|
),
|
|
836
|
-
i !== "" && /* @__PURE__ */ f(
|
|
830
|
+
i !== "" && /* @__PURE__ */ f(wr, { level: "error", feedback: i })
|
|
837
831
|
] });
|
|
838
|
-
},
|
|
832
|
+
}, ho = ({
|
|
839
833
|
currentLanguage: r = "NL",
|
|
840
834
|
initialValue: e = "",
|
|
841
835
|
placeholder: t = "",
|
|
842
836
|
label: n = "",
|
|
843
837
|
info: o = "",
|
|
844
|
-
required:
|
|
845
|
-
notValid:
|
|
838
|
+
required: s = !1,
|
|
839
|
+
notValid: a = !1,
|
|
846
840
|
notValidatedText: i = "",
|
|
847
841
|
maxWords: l,
|
|
848
|
-
rteRef:
|
|
842
|
+
rteRef: d,
|
|
849
843
|
onChange: u,
|
|
850
844
|
onCatalogueLinkSearch: m,
|
|
851
|
-
catalogueSearchResponse:
|
|
852
|
-
}) => /* @__PURE__ */ f(
|
|
853
|
-
|
|
845
|
+
catalogueSearchResponse: p = { state: "idle", results: [] }
|
|
846
|
+
}) => /* @__PURE__ */ f(_r, { children: /* @__PURE__ */ f(
|
|
847
|
+
yn,
|
|
854
848
|
{
|
|
855
849
|
currentLanguage: r.toUpperCase(),
|
|
856
850
|
initialValue: e,
|
|
857
851
|
placeholder: t,
|
|
858
852
|
label: n,
|
|
859
853
|
info: o,
|
|
860
|
-
required:
|
|
861
|
-
notValid:
|
|
854
|
+
required: s,
|
|
855
|
+
notValid: a,
|
|
862
856
|
notValidatedText: i,
|
|
863
857
|
maxWords: l,
|
|
864
|
-
rteRef:
|
|
858
|
+
rteRef: d,
|
|
865
859
|
onChange: u,
|
|
866
860
|
onCatalogueLinkSearch: m,
|
|
867
|
-
catalogueSearchResponse:
|
|
861
|
+
catalogueSearchResponse: p
|
|
868
862
|
}
|
|
869
863
|
) });
|
|
870
864
|
export {
|
|
871
|
-
|
|
872
|
-
|
|
865
|
+
yn as Rte,
|
|
866
|
+
ho as RteEditor
|
|
873
867
|
};
|
|
874
868
|
//# sourceMappingURL=RteEditor.js.map
|