@uva-glass/component-library 1.62.9 → 1.62.11
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-B6kL_nwF.js → Lexical.prod-DOTdxgeo.js} +436 -435
- package/dist/Lexical.prod-DOTdxgeo.js.map +1 -0
- package/dist/LexicalLink.prod-Cqa5Im8X.js +208 -0
- package/dist/LexicalLink.prod-Cqa5Im8X.js.map +1 -0
- package/dist/LexicalList.prod-DlqzsJTH.js +564 -0
- package/dist/LexicalList.prod-DlqzsJTH.js.map +1 -0
- package/dist/LexicalTable.prod-BKz2StgB.js +1525 -0
- package/dist/LexicalTable.prod-BKz2StgB.js.map +1 -0
- package/dist/{LexicalUtils.prod-BBoyOK4A.js → LexicalUtils.prod-DlLRWqta.js} +2 -2
- package/dist/{LexicalUtils.prod-BBoyOK4A.js.map → LexicalUtils.prod-DlLRWqta.js.map} +1 -1
- package/dist/RteEditor.module-DcvGRx3a.js +21 -0
- package/dist/RteEditor.module-DcvGRx3a.js.map +1 -0
- package/dist/TablePlugin-B3ZkyOU_.js +304 -0
- package/dist/TablePlugin-B3ZkyOU_.js.map +1 -0
- package/dist/assets/Flyout.css +1 -1
- package/dist/assets/LinkContextMenu.css +1 -0
- package/dist/assets/RteEditor.css +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.js +4 -3
- package/dist/components/CheckboxTree/CheckboxTree.js.map +1 -1
- package/dist/components/FormInput/FormInput.js +8 -7
- package/dist/components/FormInput/FormInput.js.map +1 -1
- package/dist/components/Icon/icons/index.d.ts +6 -0
- package/dist/components/Icon/icons/index.js +46 -41
- package/dist/components/Icon/icons/index.js.map +1 -1
- package/dist/components/InputField/InputField.stories.js +4 -3
- package/dist/components/InputField/InputField.stories.js.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +3 -2
- package/dist/components/MultiSelect/components/MultiSelectHeader.js.map +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.js +4 -3
- package/dist/components/PeriodSelector/PeriodSelector.js.map +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +4 -3
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js.map +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +8 -7
- 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 +9 -8
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/{AddLinkFrom.d.ts → AddLinkForm/AddLinkFrom.d.ts} +0 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +32 -0
- package/dist/components/RteEditor/Plugins/LinkPlugin/{AddLinkFrom.js.map → AddLinkForm/AddLinkFrom.js.map} +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.d.ts +11 -0
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +55 -0
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js.map +1 -0
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.d.ts +5 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +157 -129
- 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 +69 -10
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +4 -2
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js.map +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js.map +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +7 -5
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +63 -8
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js.map +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +52 -47
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/index.js +5 -5
- package/dist/components/RteEditor/RteEditor.d.ts +2 -2
- package/dist/components/RteEditor/RteEditor.js +449 -442
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/RteEditor/UvaTheme/UvaTheme.d.ts +3 -0
- package/dist/components/RteEditor/UvaTheme/UvaTheme.js +12 -10
- package/dist/components/RteEditor/UvaTheme/UvaTheme.js.map +1 -1
- package/dist/components/RteEditor/helpers.d.ts +7 -0
- package/dist/components/RteEditor/helpers.js +40 -0
- package/dist/components/RteEditor/helpers.js.map +1 -0
- package/dist/components/RteEditor/hooks/components/Flyout.d.ts +4 -0
- package/dist/components/RteEditor/hooks/components/Flyout.js +18 -10
- package/dist/components/RteEditor/hooks/components/Flyout.js.map +1 -1
- package/dist/components/RteEditor/hooks/useFlyout.d.ts +4 -0
- package/dist/components/RteEditor/hooks/useFlyout.js +10 -9
- package/dist/components/RteEditor/hooks/useFlyout.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/helpers-CC9_diXm.js +168 -0
- package/dist/helpers-CC9_diXm.js.map +1 -0
- package/dist/index.js +1 -1
- package/package.json +11 -11
- package/dist/Lexical.prod-B6kL_nwF.js.map +0 -1
- package/dist/ListPlugin-CpLcVKRP.js +0 -627
- package/dist/ListPlugin-CpLcVKRP.js.map +0 -1
- package/dist/RteEditor.module-CHbWzGpE.js +0 -28
- package/dist/RteEditor.module-CHbWzGpE.js.map +0 -1
- package/dist/TablePlugin-DQR5VWGq.js +0 -301
- package/dist/TablePlugin-DQR5VWGq.js.map +0 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.js +0 -31
- package/dist/helpers-C7Yo7VY3.js +0 -367
- package/dist/helpers-C7Yo7VY3.js.map +0 -1
- package/dist/helpers-CVB_4CnL.js +0 -1580
- package/dist/helpers-CVB_4CnL.js.map +0 -1
|
@@ -1,627 +0,0 @@
|
|
|
1
|
-
import { jsx as w } from "react/jsx-runtime";
|
|
2
|
-
import { u as it } from "./LexicalComposerContext.prod-Dyvim1tK.js";
|
|
3
|
-
import { U as Y, $ as G, L as st, Z as ot } from "./LexicalUtils.prod-BBoyOK4A.js";
|
|
4
|
-
import { t as K, m as H, b as L, D as B, L as Q, v as T, f as X, S as tt, c as ct, o as lt, I as S, M as A, u as I, i as et, _ as at, O as ut } from "./Lexical.prod-B6kL_nwF.js";
|
|
5
|
-
import { useState as F, useEffect as U } from "react";
|
|
6
|
-
import { c as ht } from "./clsx-OuTLNxxd.js";
|
|
7
|
-
import { Icon as gt } from "./components/Icon/Icon.js";
|
|
8
|
-
import { s as k } from "./RteEditor.module-CHbWzGpE.js";
|
|
9
|
-
import { useTranslation as dt } from "./components/RteEditor/hooks/useTranslation.js";
|
|
10
|
-
function ft(r) {
|
|
11
|
-
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
12
|
-
}
|
|
13
|
-
var m = ft(function(r) {
|
|
14
|
-
const t = new URLSearchParams();
|
|
15
|
-
t.append("code", r);
|
|
16
|
-
for (let e = 1; e < arguments.length; e++) t.append("v", arguments[e]);
|
|
17
|
-
throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
18
|
-
});
|
|
19
|
-
function pt(r) {
|
|
20
|
-
let t = 1, e = r.getParent();
|
|
21
|
-
for (; e != null; ) {
|
|
22
|
-
if (g(e)) {
|
|
23
|
-
const n = e.getParent();
|
|
24
|
-
if (u(n)) {
|
|
25
|
-
t++, e = n.getParent();
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
m(40);
|
|
29
|
-
}
|
|
30
|
-
return t;
|
|
31
|
-
}
|
|
32
|
-
return t;
|
|
33
|
-
}
|
|
34
|
-
function D(r) {
|
|
35
|
-
let t = r.getParent();
|
|
36
|
-
u(t) || m(40);
|
|
37
|
-
let e = t;
|
|
38
|
-
for (; e !== null; ) e = e.getParent(), u(e) && (t = e);
|
|
39
|
-
return t;
|
|
40
|
-
}
|
|
41
|
-
function nt(r) {
|
|
42
|
-
let t = [];
|
|
43
|
-
const e = r.getChildren().filter(g);
|
|
44
|
-
for (let n = 0; n < e.length; n++) {
|
|
45
|
-
const s = e[n], i = s.getFirstChild();
|
|
46
|
-
u(i) ? t = t.concat(nt(i)) : t.push(s);
|
|
47
|
-
}
|
|
48
|
-
return t;
|
|
49
|
-
}
|
|
50
|
-
function _(r) {
|
|
51
|
-
return g(r) && u(r.getFirstChild());
|
|
52
|
-
}
|
|
53
|
-
function W(r) {
|
|
54
|
-
return f().append(r);
|
|
55
|
-
}
|
|
56
|
-
function rt(r, t) {
|
|
57
|
-
return g(r) && (t.length === 0 || t.length === 1 && r.is(t[0]) && r.getChildrenSize() === 0);
|
|
58
|
-
}
|
|
59
|
-
function z(r, t) {
|
|
60
|
-
r.update(() => {
|
|
61
|
-
const e = A();
|
|
62
|
-
if (e !== null) {
|
|
63
|
-
const n = e.getNodes();
|
|
64
|
-
if (T(e)) {
|
|
65
|
-
const i = e.getStartEndPoints();
|
|
66
|
-
i === null && m(143);
|
|
67
|
-
const [o] = i, l = o.getNode(), a = l.getParent();
|
|
68
|
-
if (rt(l, n)) {
|
|
69
|
-
const c = d(t);
|
|
70
|
-
if (I(a)) {
|
|
71
|
-
l.replace(c);
|
|
72
|
-
const h = f();
|
|
73
|
-
L(l) && (h.setFormat(l.getFormatType()), h.setIndent(l.getIndent())), c.append(h);
|
|
74
|
-
} else if (g(l)) {
|
|
75
|
-
const h = l.getParentOrThrow();
|
|
76
|
-
v(c, h.getChildren()), h.replace(c);
|
|
77
|
-
}
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
const s = /* @__PURE__ */ new Set();
|
|
82
|
-
for (let i = 0; i < n.length; i++) {
|
|
83
|
-
const o = n[i];
|
|
84
|
-
if (!L(o) || !o.isEmpty() || g(o) || s.has(o.getKey())) {
|
|
85
|
-
if (et(o)) {
|
|
86
|
-
let l = o.getParent();
|
|
87
|
-
for (; l != null; ) {
|
|
88
|
-
const a = l.getKey();
|
|
89
|
-
if (u(l)) {
|
|
90
|
-
if (!s.has(a)) {
|
|
91
|
-
const c = d(t);
|
|
92
|
-
v(c, l.getChildren()), l.replace(c), s.add(a);
|
|
93
|
-
}
|
|
94
|
-
break;
|
|
95
|
-
}
|
|
96
|
-
{
|
|
97
|
-
const c = l.getParent();
|
|
98
|
-
if (I(c) && !s.has(a)) {
|
|
99
|
-
s.add(a), V(l, t);
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
|
-
l = c;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
} else V(o, t);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
function v(r, t) {
|
|
112
|
-
r.splice(r.getChildrenSize(), 0, t);
|
|
113
|
-
}
|
|
114
|
-
function V(r, t) {
|
|
115
|
-
if (u(r)) return r;
|
|
116
|
-
const e = r.getPreviousSibling(), n = r.getNextSibling(), s = f();
|
|
117
|
-
let i;
|
|
118
|
-
if (v(s, r.getChildren()), u(e) && t === e.getListType()) e.append(s), u(n) && t === n.getListType() && (v(e, n.getChildren()), n.remove()), i = e;
|
|
119
|
-
else if (u(n) && t === n.getListType()) n.getFirstChildOrThrow().insertBefore(s), i = n;
|
|
120
|
-
else {
|
|
121
|
-
const o = d(t);
|
|
122
|
-
o.append(s), r.replace(o), i = o;
|
|
123
|
-
}
|
|
124
|
-
return s.setFormat(r.getFormatType()), s.setIndent(r.getIndent()), r.remove(), i;
|
|
125
|
-
}
|
|
126
|
-
function $(r, t) {
|
|
127
|
-
const e = r.getLastChild(), n = t.getFirstChild();
|
|
128
|
-
e && n && _(e) && _(n) && ($(e.getFirstChild(), n.getFirstChild()), n.remove());
|
|
129
|
-
const s = t.getChildren();
|
|
130
|
-
s.length > 0 && r.append(...s), t.remove();
|
|
131
|
-
}
|
|
132
|
-
function mt(r) {
|
|
133
|
-
r.update(() => {
|
|
134
|
-
const t = A();
|
|
135
|
-
if (T(t)) {
|
|
136
|
-
const e = /* @__PURE__ */ new Set(), n = t.getNodes(), s = t.anchor.getNode();
|
|
137
|
-
if (rt(s, n)) e.add(D(s));
|
|
138
|
-
else for (let i = 0; i < n.length; i++) {
|
|
139
|
-
const o = n[i];
|
|
140
|
-
if (et(o)) {
|
|
141
|
-
const l = ot(o, P);
|
|
142
|
-
l != null && e.add(D(l));
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
for (const i of e) {
|
|
146
|
-
let o = i;
|
|
147
|
-
const l = nt(i);
|
|
148
|
-
for (const a of l) {
|
|
149
|
-
const c = B();
|
|
150
|
-
v(c, a.getChildren()), o.insertAfter(c), o = c, a.__key === t.anchor.key && t.anchor.set(c.getKey(), 0, "element"), a.__key === t.focus.key && t.focus.set(c.getKey(), 0, "element"), a.remove();
|
|
151
|
-
}
|
|
152
|
-
i.remove();
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
function _t(r) {
|
|
158
|
-
const t = /* @__PURE__ */ new Set();
|
|
159
|
-
if (_(r) || t.has(r.getKey())) return;
|
|
160
|
-
const e = r.getParent(), n = r.getNextSibling(), s = r.getPreviousSibling();
|
|
161
|
-
if (_(n) && _(s)) {
|
|
162
|
-
const i = s.getFirstChild();
|
|
163
|
-
if (u(i)) {
|
|
164
|
-
i.append(r);
|
|
165
|
-
const o = n.getFirstChild();
|
|
166
|
-
u(o) && (v(i, o.getChildren()), n.remove(), t.add(n.getKey()));
|
|
167
|
-
}
|
|
168
|
-
} else if (_(n)) {
|
|
169
|
-
const i = n.getFirstChild();
|
|
170
|
-
if (u(i)) {
|
|
171
|
-
const o = i.getFirstChild();
|
|
172
|
-
o !== null && o.insertBefore(r);
|
|
173
|
-
}
|
|
174
|
-
} else if (_(s)) {
|
|
175
|
-
const i = s.getFirstChild();
|
|
176
|
-
u(i) && i.append(r);
|
|
177
|
-
} else if (u(e)) {
|
|
178
|
-
const i = f(), o = d(e.getListType());
|
|
179
|
-
i.append(o), o.append(r), s ? s.insertAfter(i) : n ? n.insertBefore(i) : e.append(i);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
function bt(r) {
|
|
183
|
-
if (_(r)) return;
|
|
184
|
-
const t = r.getParent(), e = t ? t.getParent() : void 0;
|
|
185
|
-
if (u(e ? e.getParent() : void 0) && g(e) && u(t)) {
|
|
186
|
-
const n = t ? t.getFirstChild() : void 0, s = t ? t.getLastChild() : void 0;
|
|
187
|
-
if (r.is(n)) e.insertBefore(r), t.isEmpty() && e.remove();
|
|
188
|
-
else if (r.is(s)) e.insertAfter(r), t.isEmpty() && e.remove();
|
|
189
|
-
else {
|
|
190
|
-
const i = t.getListType(), o = f(), l = d(i);
|
|
191
|
-
o.append(l), r.getPreviousSiblings().forEach((h) => l.append(h));
|
|
192
|
-
const a = f(), c = d(i);
|
|
193
|
-
a.append(c), v(c, r.getNextSiblings()), e.insertBefore(o), e.insertAfter(a), e.replace(r);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
function vt() {
|
|
198
|
-
const r = A();
|
|
199
|
-
if (!T(r) || !r.isCollapsed()) return !1;
|
|
200
|
-
const t = r.anchor.getNode();
|
|
201
|
-
if (!g(t) || t.getChildrenSize() !== 0) return !1;
|
|
202
|
-
const e = D(t), n = t.getParent();
|
|
203
|
-
u(n) || m(40);
|
|
204
|
-
const s = n.getParent();
|
|
205
|
-
let i;
|
|
206
|
-
if (I(s)) i = B(), e.insertAfter(i);
|
|
207
|
-
else {
|
|
208
|
-
if (!g(s)) return !1;
|
|
209
|
-
i = f(), s.insertAfter(i);
|
|
210
|
-
}
|
|
211
|
-
i.select();
|
|
212
|
-
const o = t.getNextSiblings();
|
|
213
|
-
if (o.length > 0) {
|
|
214
|
-
const l = d(n.getListType());
|
|
215
|
-
if (Q(i)) i.insertAfter(l);
|
|
216
|
-
else {
|
|
217
|
-
const a = f();
|
|
218
|
-
a.append(l), i.insertAfter(a);
|
|
219
|
-
}
|
|
220
|
-
o.forEach((a) => {
|
|
221
|
-
a.remove(), l.append(a);
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
return function(l) {
|
|
225
|
-
let a = l;
|
|
226
|
-
for (; a.getNextSibling() == null && a.getPreviousSibling() == null; ) {
|
|
227
|
-
const c = a.getParent();
|
|
228
|
-
if (c == null || !g(a) && !u(a)) break;
|
|
229
|
-
a = c;
|
|
230
|
-
}
|
|
231
|
-
a.remove();
|
|
232
|
-
}(t), !0;
|
|
233
|
-
}
|
|
234
|
-
function x(...r) {
|
|
235
|
-
const t = [];
|
|
236
|
-
for (const e of r) if (e && typeof e == "string") for (const [n] of e.matchAll(/\S+/g)) t.push(n);
|
|
237
|
-
return t;
|
|
238
|
-
}
|
|
239
|
-
class P extends H {
|
|
240
|
-
static getType() {
|
|
241
|
-
return "listitem";
|
|
242
|
-
}
|
|
243
|
-
static clone(t) {
|
|
244
|
-
return new P(t.__value, t.__checked, t.__key);
|
|
245
|
-
}
|
|
246
|
-
constructor(t, e, n) {
|
|
247
|
-
super(n), this.__value = t === void 0 ? 1 : t, this.__checked = e;
|
|
248
|
-
}
|
|
249
|
-
createDOM(t) {
|
|
250
|
-
const e = document.createElement("li"), n = this.getParent();
|
|
251
|
-
return u(n) && n.getListType() === "check" && R(e, this, null), e.value = this.__value, J(e, t.theme, this), e;
|
|
252
|
-
}
|
|
253
|
-
updateDOM(t, e, n) {
|
|
254
|
-
const s = this.getParent();
|
|
255
|
-
return u(s) && s.getListType() === "check" && R(e, this, t), e.value = this.__value, J(e, n.theme, this), !1;
|
|
256
|
-
}
|
|
257
|
-
static transform() {
|
|
258
|
-
return (t) => {
|
|
259
|
-
if (g(t) || m(144), t.__checked == null) return;
|
|
260
|
-
const e = t.getParent();
|
|
261
|
-
u(e) && e.getListType() !== "check" && t.getChecked() != null && t.setChecked(void 0);
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
static importDOM() {
|
|
265
|
-
return { li: () => ({ conversion: yt, priority: 0 }) };
|
|
266
|
-
}
|
|
267
|
-
static importJSON(t) {
|
|
268
|
-
const e = f();
|
|
269
|
-
return e.setChecked(t.checked), e.setValue(t.value), e.setFormat(t.format), e.setDirection(t.direction), e;
|
|
270
|
-
}
|
|
271
|
-
exportDOM(t) {
|
|
272
|
-
const e = this.createDOM(t._config);
|
|
273
|
-
return e.style.textAlign = this.getFormatType(), { element: e };
|
|
274
|
-
}
|
|
275
|
-
exportJSON() {
|
|
276
|
-
return { ...super.exportJSON(), checked: this.getChecked(), type: "listitem", value: this.getValue(), version: 1 };
|
|
277
|
-
}
|
|
278
|
-
append(...t) {
|
|
279
|
-
for (let e = 0; e < t.length; e++) {
|
|
280
|
-
const n = t[e];
|
|
281
|
-
if (L(n) && this.canMergeWith(n)) {
|
|
282
|
-
const s = n.getChildren();
|
|
283
|
-
this.append(...s), n.remove();
|
|
284
|
-
} else super.append(n);
|
|
285
|
-
}
|
|
286
|
-
return this;
|
|
287
|
-
}
|
|
288
|
-
replace(t, e) {
|
|
289
|
-
if (g(t)) return super.replace(t);
|
|
290
|
-
this.setIndent(0);
|
|
291
|
-
const n = this.getParentOrThrow();
|
|
292
|
-
if (!u(n)) return t;
|
|
293
|
-
if (n.__first === this.getKey()) n.insertBefore(t);
|
|
294
|
-
else if (n.__last === this.getKey()) n.insertAfter(t);
|
|
295
|
-
else {
|
|
296
|
-
const s = d(n.getListType());
|
|
297
|
-
let i = this.getNextSibling();
|
|
298
|
-
for (; i; ) {
|
|
299
|
-
const o = i;
|
|
300
|
-
i = i.getNextSibling(), s.append(o);
|
|
301
|
-
}
|
|
302
|
-
n.insertAfter(t), t.insertAfter(s);
|
|
303
|
-
}
|
|
304
|
-
return e && (L(t) || m(139), this.getChildren().forEach((s) => {
|
|
305
|
-
t.append(s);
|
|
306
|
-
})), this.remove(), n.getChildrenSize() === 0 && n.remove(), t;
|
|
307
|
-
}
|
|
308
|
-
insertAfter(t, e = !0) {
|
|
309
|
-
const n = this.getParentOrThrow();
|
|
310
|
-
if (u(n) || m(39), g(t)) return super.insertAfter(t, e);
|
|
311
|
-
const s = this.getNextSiblings();
|
|
312
|
-
if (n.insertAfter(t, e), s.length !== 0) {
|
|
313
|
-
const i = d(n.getListType());
|
|
314
|
-
s.forEach((o) => i.append(o)), t.insertAfter(i, e);
|
|
315
|
-
}
|
|
316
|
-
return t;
|
|
317
|
-
}
|
|
318
|
-
remove(t) {
|
|
319
|
-
const e = this.getPreviousSibling(), n = this.getNextSibling();
|
|
320
|
-
super.remove(t), e && n && _(e) && _(n) && ($(e.getFirstChild(), n.getFirstChild()), n.remove());
|
|
321
|
-
}
|
|
322
|
-
insertNewAfter(t, e = !0) {
|
|
323
|
-
const n = f(this.__checked == null && void 0);
|
|
324
|
-
return this.insertAfter(n, e), n;
|
|
325
|
-
}
|
|
326
|
-
collapseAtStart(t) {
|
|
327
|
-
const e = B();
|
|
328
|
-
this.getChildren().forEach((o) => e.append(o));
|
|
329
|
-
const n = this.getParentOrThrow(), s = n.getParentOrThrow(), i = g(s);
|
|
330
|
-
if (n.getChildrenSize() === 1) if (i) n.remove(), s.select();
|
|
331
|
-
else {
|
|
332
|
-
n.insertBefore(e), n.remove();
|
|
333
|
-
const o = t.anchor, l = t.focus, a = e.getKey();
|
|
334
|
-
o.type === "element" && o.getNode().is(this) && o.set(a, o.offset, "element"), l.type === "element" && l.getNode().is(this) && l.set(a, l.offset, "element");
|
|
335
|
-
}
|
|
336
|
-
else n.insertBefore(e), this.remove();
|
|
337
|
-
return !0;
|
|
338
|
-
}
|
|
339
|
-
getValue() {
|
|
340
|
-
return this.getLatest().__value;
|
|
341
|
-
}
|
|
342
|
-
setValue(t) {
|
|
343
|
-
this.getWritable().__value = t;
|
|
344
|
-
}
|
|
345
|
-
getChecked() {
|
|
346
|
-
const t = this.getLatest();
|
|
347
|
-
let e;
|
|
348
|
-
const n = this.getParent();
|
|
349
|
-
return u(n) && (e = n.getListType()), e === "check" ? !!t.__checked : void 0;
|
|
350
|
-
}
|
|
351
|
-
setChecked(t) {
|
|
352
|
-
this.getWritable().__checked = t;
|
|
353
|
-
}
|
|
354
|
-
toggleChecked() {
|
|
355
|
-
this.setChecked(!this.__checked);
|
|
356
|
-
}
|
|
357
|
-
getIndent() {
|
|
358
|
-
const t = this.getParent();
|
|
359
|
-
if (t === null) return this.getLatest().__indent;
|
|
360
|
-
let e = t.getParentOrThrow(), n = 0;
|
|
361
|
-
for (; g(e); ) e = e.getParentOrThrow().getParentOrThrow(), n++;
|
|
362
|
-
return n;
|
|
363
|
-
}
|
|
364
|
-
setIndent(t) {
|
|
365
|
-
typeof t != "number" && m(117), (t = Math.floor(t)) >= 0 || m(199);
|
|
366
|
-
let e = this.getIndent();
|
|
367
|
-
for (; e !== t; ) e < t ? (_t(this), e++) : (bt(this), e--);
|
|
368
|
-
return this;
|
|
369
|
-
}
|
|
370
|
-
canInsertAfter(t) {
|
|
371
|
-
return g(t);
|
|
372
|
-
}
|
|
373
|
-
canReplaceWith(t) {
|
|
374
|
-
return g(t);
|
|
375
|
-
}
|
|
376
|
-
canMergeWith(t) {
|
|
377
|
-
return Q(t) || g(t);
|
|
378
|
-
}
|
|
379
|
-
extractWithChild(t, e) {
|
|
380
|
-
if (!T(e)) return !1;
|
|
381
|
-
const n = e.anchor.getNode(), s = e.focus.getNode();
|
|
382
|
-
return this.isParentOf(n) && this.isParentOf(s) && this.getTextContent().length === e.getTextContent().length;
|
|
383
|
-
}
|
|
384
|
-
isParentRequired() {
|
|
385
|
-
return !0;
|
|
386
|
-
}
|
|
387
|
-
createParentElementNode() {
|
|
388
|
-
return d("bullet");
|
|
389
|
-
}
|
|
390
|
-
canMergeWhenEmpty() {
|
|
391
|
-
return !0;
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
function J(r, t, e) {
|
|
395
|
-
const n = [], s = [], i = t.list, o = i ? i.listitem : void 0;
|
|
396
|
-
let l;
|
|
397
|
-
if (i && i.nested && (l = i.nested.listitem), o !== void 0 && n.push(...x(o)), i) {
|
|
398
|
-
const a = e.getParent(), c = u(a) && a.getListType() === "check", h = e.getChecked();
|
|
399
|
-
c && !h || s.push(i.listitemUnchecked), c && h || s.push(i.listitemChecked), c && n.push(h ? i.listitemChecked : i.listitemUnchecked);
|
|
400
|
-
}
|
|
401
|
-
if (l !== void 0) {
|
|
402
|
-
const a = x(l);
|
|
403
|
-
e.getChildren().some((c) => u(c)) ? n.push(...a) : s.push(...a);
|
|
404
|
-
}
|
|
405
|
-
s.length > 0 && Y(r, ...s), n.length > 0 && G(r, ...n);
|
|
406
|
-
}
|
|
407
|
-
function R(r, t, e, n) {
|
|
408
|
-
u(t.getFirstChild()) ? (r.removeAttribute("role"), r.removeAttribute("tabIndex"), r.removeAttribute("aria-checked")) : (r.setAttribute("role", "checkbox"), r.setAttribute("tabIndex", "-1"), e && t.__checked === e.__checked || r.setAttribute("aria-checked", t.getChecked() ? "true" : "false"));
|
|
409
|
-
}
|
|
410
|
-
function yt(r) {
|
|
411
|
-
if (r.classList.contains("task-list-item")) {
|
|
412
|
-
for (const e of r.children) if (e.tagName === "INPUT") return Ct(e);
|
|
413
|
-
}
|
|
414
|
-
const t = r.getAttribute("aria-checked");
|
|
415
|
-
return { node: f(t === "true" || t !== "false" && void 0) };
|
|
416
|
-
}
|
|
417
|
-
function Ct(r) {
|
|
418
|
-
return r.getAttribute("type") !== "checkbox" ? { node: null } : { node: f(r.hasAttribute("checked")) };
|
|
419
|
-
}
|
|
420
|
-
function f(r) {
|
|
421
|
-
return X(new P(void 0, r));
|
|
422
|
-
}
|
|
423
|
-
function g(r) {
|
|
424
|
-
return r instanceof P;
|
|
425
|
-
}
|
|
426
|
-
class O extends H {
|
|
427
|
-
static getType() {
|
|
428
|
-
return "list";
|
|
429
|
-
}
|
|
430
|
-
static clone(t) {
|
|
431
|
-
const e = t.__listType || q[t.__tag];
|
|
432
|
-
return new O(e, t.__start, t.__key);
|
|
433
|
-
}
|
|
434
|
-
constructor(t, e, n) {
|
|
435
|
-
super(n);
|
|
436
|
-
const s = q[t] || t;
|
|
437
|
-
this.__listType = s, this.__tag = s === "number" ? "ol" : "ul", this.__start = e;
|
|
438
|
-
}
|
|
439
|
-
getTag() {
|
|
440
|
-
return this.__tag;
|
|
441
|
-
}
|
|
442
|
-
setListType(t) {
|
|
443
|
-
const e = this.getWritable();
|
|
444
|
-
e.__listType = t, e.__tag = t === "number" ? "ol" : "ul";
|
|
445
|
-
}
|
|
446
|
-
getListType() {
|
|
447
|
-
return this.__listType;
|
|
448
|
-
}
|
|
449
|
-
getStart() {
|
|
450
|
-
return this.__start;
|
|
451
|
-
}
|
|
452
|
-
createDOM(t, e) {
|
|
453
|
-
const n = this.__tag, s = document.createElement(n);
|
|
454
|
-
return this.__start !== 1 && s.setAttribute("start", String(this.__start)), s.__lexicalListType = this.__listType, j(s, t.theme, this), s;
|
|
455
|
-
}
|
|
456
|
-
updateDOM(t, e, n) {
|
|
457
|
-
return t.__tag !== this.__tag || (j(e, n.theme, this), !1);
|
|
458
|
-
}
|
|
459
|
-
static transform() {
|
|
460
|
-
return (t) => {
|
|
461
|
-
u(t) || m(163), function(e) {
|
|
462
|
-
const n = e.getNextSibling();
|
|
463
|
-
u(n) && e.getListType() === n.getListType() && $(e, n);
|
|
464
|
-
}(t), function(e) {
|
|
465
|
-
const n = e.getListType() !== "check";
|
|
466
|
-
let s = e.getStart();
|
|
467
|
-
for (const i of e.getChildren()) g(i) && (i.getValue() !== s && i.setValue(s), n && i.getLatest().__checked != null && i.setChecked(void 0), u(i.getFirstChild()) || s++);
|
|
468
|
-
}(t);
|
|
469
|
-
};
|
|
470
|
-
}
|
|
471
|
-
static importDOM() {
|
|
472
|
-
return { ol: () => ({ conversion: Z, priority: 0 }), ul: () => ({ conversion: Z, priority: 0 }) };
|
|
473
|
-
}
|
|
474
|
-
static importJSON(t) {
|
|
475
|
-
const e = d(t.listType, t.start);
|
|
476
|
-
return e.setFormat(t.format), e.setIndent(t.indent), e.setDirection(t.direction), e;
|
|
477
|
-
}
|
|
478
|
-
exportDOM(t) {
|
|
479
|
-
const e = this.createDOM(t._config, t);
|
|
480
|
-
return e && tt(e) && (this.__start !== 1 && e.setAttribute("start", String(this.__start)), this.__listType === "check" && e.setAttribute("__lexicalListType", "check")), { element: e };
|
|
481
|
-
}
|
|
482
|
-
exportJSON() {
|
|
483
|
-
return { ...super.exportJSON(), listType: this.getListType(), start: this.getStart(), tag: this.getTag(), type: "list", version: 1 };
|
|
484
|
-
}
|
|
485
|
-
canBeEmpty() {
|
|
486
|
-
return !1;
|
|
487
|
-
}
|
|
488
|
-
canIndent() {
|
|
489
|
-
return !1;
|
|
490
|
-
}
|
|
491
|
-
append(...t) {
|
|
492
|
-
for (let e = 0; e < t.length; e++) {
|
|
493
|
-
const n = t[e];
|
|
494
|
-
if (g(n)) super.append(n);
|
|
495
|
-
else {
|
|
496
|
-
const s = f();
|
|
497
|
-
if (u(n)) s.append(n);
|
|
498
|
-
else if (L(n)) {
|
|
499
|
-
const i = ct(n.getTextContent());
|
|
500
|
-
s.append(i);
|
|
501
|
-
} else s.append(n);
|
|
502
|
-
super.append(s);
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
return this;
|
|
506
|
-
}
|
|
507
|
-
extractWithChild(t) {
|
|
508
|
-
return g(t);
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
function j(r, t, e) {
|
|
512
|
-
const n = [], s = [], i = t.list;
|
|
513
|
-
if (i !== void 0) {
|
|
514
|
-
const o = i[`${e.__tag}Depth`] || [], l = pt(e) - 1, a = l % o.length, c = o[a], h = i[e.__tag];
|
|
515
|
-
let y;
|
|
516
|
-
const b = i.nested, C = i.checklist;
|
|
517
|
-
if (b !== void 0 && b.list && (y = b.list), h !== void 0 && n.push(h), C !== void 0 && e.__listType === "check" && n.push(C), c !== void 0) {
|
|
518
|
-
n.push(...x(c));
|
|
519
|
-
for (let p = 0; p < o.length; p++) p !== a && s.push(e.__tag + p);
|
|
520
|
-
}
|
|
521
|
-
if (y !== void 0) {
|
|
522
|
-
const p = x(y);
|
|
523
|
-
l > 1 ? n.push(...p) : s.push(...p);
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
s.length > 0 && Y(r, ...s), n.length > 0 && G(r, ...n);
|
|
527
|
-
}
|
|
528
|
-
function kt(r) {
|
|
529
|
-
const t = [];
|
|
530
|
-
for (let e = 0; e < r.length; e++) {
|
|
531
|
-
const n = r[e];
|
|
532
|
-
if (g(n)) {
|
|
533
|
-
t.push(n);
|
|
534
|
-
const s = n.getChildren();
|
|
535
|
-
s.length > 1 && s.forEach((i) => {
|
|
536
|
-
u(i) && t.push(W(i));
|
|
537
|
-
});
|
|
538
|
-
} else t.push(W(n));
|
|
539
|
-
}
|
|
540
|
-
return t;
|
|
541
|
-
}
|
|
542
|
-
function Z(r) {
|
|
543
|
-
const t = r.nodeName.toLowerCase();
|
|
544
|
-
let e = null;
|
|
545
|
-
return t === "ol" ? e = d("number", r.start) : t === "ul" && (e = function(n) {
|
|
546
|
-
if (n.getAttribute("__lexicallisttype") === "check" || n.classList.contains("contains-task-list")) return !0;
|
|
547
|
-
for (const s of n.childNodes) if (tt(s) && s.hasAttribute("aria-checked")) return !0;
|
|
548
|
-
return !1;
|
|
549
|
-
}(r) ? d("check") : d("bullet")), { after: kt, node: e };
|
|
550
|
-
}
|
|
551
|
-
const q = { ol: "number", ul: "bullet" };
|
|
552
|
-
function d(r, t = 1) {
|
|
553
|
-
return X(new O(r, t));
|
|
554
|
-
}
|
|
555
|
-
function u(r) {
|
|
556
|
-
return r instanceof O;
|
|
557
|
-
}
|
|
558
|
-
const E = K(), M = K(), N = K();
|
|
559
|
-
function Dt(r) {
|
|
560
|
-
return st(r.registerCommand(M, () => (z(r, "number"), !0), S), r.registerCommand(E, () => (z(r, "bullet"), !0), S), r.registerCommand(N, () => (mt(r), !0), S), r.registerCommand(lt, () => !!vt(), S));
|
|
561
|
-
}
|
|
562
|
-
const Lt = {
|
|
563
|
-
bullet: "BulletList",
|
|
564
|
-
number: "NumberedList"
|
|
565
|
-
}, Tt = ["bullet", "number"], Et = () => {
|
|
566
|
-
const r = dt(), [t] = it(), [e, n] = F("paragraph"), [s, i] = F(!1), [o, l] = F(!1), a = (c) => {
|
|
567
|
-
c === "number" && e !== "number" ? (t.dispatchCommand(M, void 0), n("number")) : c === "bullet" && e !== "bullet" ? (t.dispatchCommand(E, void 0), n("bullet")) : (t.dispatchCommand(N, void 0), n("paragraph"));
|
|
568
|
-
};
|
|
569
|
-
return U(() => {
|
|
570
|
-
const c = t.registerCommand(
|
|
571
|
-
at,
|
|
572
|
-
(h) => h.ctrlKey && h.shiftKey && h.code === "Digit7" ? (h.preventDefault(), o ? t.dispatchCommand(N, void 0) : t.dispatchCommand(M, void 0), !0) : h.ctrlKey && h.shiftKey && h.code === "Digit8" ? (h.preventDefault(), s ? t.dispatchCommand(N, void 0) : t.dispatchCommand(E, void 0), !0) : !1,
|
|
573
|
-
ut
|
|
574
|
-
);
|
|
575
|
-
return () => {
|
|
576
|
-
c();
|
|
577
|
-
};
|
|
578
|
-
}, [t, o, s]), U(() => {
|
|
579
|
-
const c = t.registerUpdateListener(({ editorState: h }) => {
|
|
580
|
-
h.read(() => {
|
|
581
|
-
const y = A();
|
|
582
|
-
if (T(y)) {
|
|
583
|
-
let b = y.anchor.getNode();
|
|
584
|
-
for (; b !== null; ) {
|
|
585
|
-
if (u(b)) {
|
|
586
|
-
const p = b.getTag();
|
|
587
|
-
i(p === "ul"), l(p === "ol"), p === "ul" && n("bullet"), p === "ol" && n("number");
|
|
588
|
-
return;
|
|
589
|
-
}
|
|
590
|
-
const C = b.getParent();
|
|
591
|
-
if (C === null) break;
|
|
592
|
-
b = C;
|
|
593
|
-
}
|
|
594
|
-
i(!1), l(!1), n("paragraph");
|
|
595
|
-
}
|
|
596
|
-
return !1;
|
|
597
|
-
});
|
|
598
|
-
});
|
|
599
|
-
return () => {
|
|
600
|
-
c();
|
|
601
|
-
};
|
|
602
|
-
}, [t]), /* @__PURE__ */ w("div", { className: k["editor__toolbar-button-group"], children: Tt.map((c) => /* @__PURE__ */ w(
|
|
603
|
-
"button",
|
|
604
|
-
{
|
|
605
|
-
onClick: () => a(c),
|
|
606
|
-
title: r.format[`${c}Tooltip`],
|
|
607
|
-
className: ht(
|
|
608
|
-
k["editor__toolbar-button"],
|
|
609
|
-
k[`editor__toolbar-button--${c}`],
|
|
610
|
-
c === "bullet" && s && k["editor__toolbar-button--active"],
|
|
611
|
-
c === "number" && o && k["editor__toolbar-button--active"]
|
|
612
|
-
),
|
|
613
|
-
"aria-label": r.aria.labels[c],
|
|
614
|
-
"aria-keyshortcuts": r.aria.keyshortcuts[c],
|
|
615
|
-
type: "button",
|
|
616
|
-
children: /* @__PURE__ */ w(gt, { name: Lt[c], size: 24 })
|
|
617
|
-
},
|
|
618
|
-
c
|
|
619
|
-
)) });
|
|
620
|
-
};
|
|
621
|
-
export {
|
|
622
|
-
P as D,
|
|
623
|
-
O as J,
|
|
624
|
-
Et as L,
|
|
625
|
-
Dt as Z
|
|
626
|
-
};
|
|
627
|
-
//# sourceMappingURL=ListPlugin-CpLcVKRP.js.map
|