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