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