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