@uva-glass/component-library 1.59.2 → 1.61.0

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.
Files changed (80) hide show
  1. package/dist/{Lexical.prod-CO0gPAfo.js → Lexical.prod-qM_1BY0u.js} +961 -952
  2. package/dist/Lexical.prod-qM_1BY0u.js.map +1 -0
  3. package/dist/{LexicalUtils.prod-PbdOb6JG.js → LexicalUtils.prod-BFSPHHi1.js} +20 -20
  4. package/dist/{LexicalUtils.prod-PbdOb6JG.js.map → LexicalUtils.prod-BFSPHHi1.js.map} +1 -1
  5. package/dist/ListPlugin-Bhkh3IBK.js +625 -0
  6. package/dist/ListPlugin-Bhkh3IBK.js.map +1 -0
  7. package/dist/RteEditor.module-Cku3JY-0.js +29 -0
  8. package/dist/RteEditor.module-Cku3JY-0.js.map +1 -0
  9. package/dist/TablePlugin-CLPV2OjO.js +294 -0
  10. package/dist/TablePlugin-CLPV2OjO.js.map +1 -0
  11. package/dist/assets/EditorHeader.css +1 -1
  12. package/dist/assets/Periods.css +1 -1
  13. package/dist/assets/RteEditor.css +1 -1
  14. package/dist/assets/TableCellContextMenu.css +1 -1
  15. package/dist/assets/TablePlugin.css +1 -1
  16. package/dist/components/CheckboxTree/CheckboxTree.js +2 -2
  17. package/dist/components/InputField/InputField.stories.js +2 -2
  18. package/dist/components/MultiSelect/MultiSelect.js +1 -1
  19. package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
  20. package/dist/components/MultiSelect/components/MultiSelectHeader.js +2 -2
  21. package/dist/components/MultiSelect/index.js +1 -1
  22. package/dist/components/Periods/Periods.js +19 -19
  23. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +2 -2
  24. package/dist/components/RteEditor/EditorHeader/EditorHeader.js +19 -19
  25. package/dist/components/RteEditor/EditorHeader/EditorHeader.js.map +1 -1
  26. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.d.ts +1 -6
  27. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +34 -20
  28. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js.map +1 -1
  29. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +36 -31
  30. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js.map +1 -1
  31. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.d.ts +3 -3
  32. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.js +4 -4
  33. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.d.ts +7 -6
  34. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +157 -54
  35. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
  36. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.d.ts +1 -3
  37. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +5 -6
  38. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js.map +1 -1
  39. package/dist/components/RteEditor/Plugins/LinkPlugin/index.js +3 -2
  40. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.d.ts +1 -6
  41. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +10 -31
  42. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js.map +1 -1
  43. package/dist/components/RteEditor/Plugins/ListPlugin/index.js +1 -1
  44. package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +2 -2
  45. package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.d.ts +2 -1
  46. package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js +104 -31
  47. package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js.map +1 -1
  48. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +6 -5
  49. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js.map +1 -1
  50. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +1 -1
  51. package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
  52. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.d.ts +6 -7
  53. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +42 -46
  54. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
  55. package/dist/components/RteEditor/Plugins/index.js +13 -12
  56. package/dist/components/RteEditor/RteEditor.d.ts +13 -4
  57. package/dist/components/RteEditor/RteEditor.js +593 -601
  58. package/dist/components/RteEditor/RteEditor.js.map +1 -1
  59. package/dist/components/RteEditor/UvaTheme/UvaTheme.js +1 -1
  60. package/dist/components/RteEditor/hooks/components/Flyout.js.map +1 -1
  61. package/dist/components/RteEditor/hooks/useTranslation.d.ts +98 -6
  62. package/dist/components/RteEditor/translations.d.ts +98 -6
  63. package/dist/components/RteEditor/translations.js +104 -12
  64. package/dist/components/RteEditor/translations.js.map +1 -1
  65. package/dist/components/index.js +1 -1
  66. package/dist/{helpers-Ec7CfNnA.js → helpers-BB6Byf50.js} +92 -103
  67. package/dist/helpers-BB6Byf50.js.map +1 -0
  68. package/dist/{helpers-BewZrn6E.js → helpers-D9T1Tgkj.js} +581 -515
  69. package/dist/helpers-D9T1Tgkj.js.map +1 -0
  70. package/dist/index.js +1 -1
  71. package/package.json +9 -9
  72. package/dist/Lexical.prod-CO0gPAfo.js.map +0 -1
  73. package/dist/LexicalList.prod-BceA-cJD.js +0 -562
  74. package/dist/LexicalList.prod-BceA-cJD.js.map +0 -1
  75. package/dist/RteEditor.module-Dz9a8vaK.js +0 -29
  76. package/dist/RteEditor.module-Dz9a8vaK.js.map +0 -1
  77. package/dist/TablePlugin-Cj6IBz2k.js +0 -249
  78. package/dist/TablePlugin-Cj6IBz2k.js.map +0 -1
  79. package/dist/helpers-BewZrn6E.js.map +0 -1
  80. package/dist/helpers-Ec7CfNnA.js.map +0 -1
@@ -0,0 +1,625 @@
1
+ import { jsx as F } 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-BFSPHHi1.js";
4
+ import { t as K, y as H, b as T, F as B, D as Q, x as L, f as X, v as tt, l as ct, o as lt, O as S, A, a as I, i as et, _ as at, L as ut } from "./Lexical.prod-qM_1BY0u.js";
5
+ import { useState as w, 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-Cku3JY-0.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 (L(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
+ T(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 (!T(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 (L(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 (!L(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 N(...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 (T(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 && (T(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 (!L(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(...N(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 = N(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 (T(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 p = i.nested, C = i.checklist;
517
+ if (p !== void 0 && p.list && (y = p.list), h !== void 0 && n.push(h), C !== void 0 && e.__listType === "check" && n.push(C), c !== void 0) {
518
+ n.push(...N(c));
519
+ for (let b = 0; b < o.length; b++) b !== a && s.push(e.__tag + b);
520
+ }
521
+ if (y !== void 0) {
522
+ const b = N(y);
523
+ l > 1 ? n.push(...b) : s.push(...b);
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(), x = 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(x, () => (mt(r), !0), S), r.registerCommand(lt, () => !!vt(), S));
561
+ }
562
+ const Tt = {
563
+ bullet: "BulletList",
564
+ number: "NumberedList"
565
+ }, Lt = ["bullet", "number"], Et = () => {
566
+ const r = dt(), [t] = it(), [e, n] = w("paragraph"), [s, i] = w(!1), [o, l] = w(!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(x, 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(x, void 0) : t.dispatchCommand(M, void 0), !0) : h.ctrlKey && h.shiftKey && h.code === "Digit8" ? (h.preventDefault(), s ? t.dispatchCommand(x, 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 (L(y)) {
583
+ let p = y.anchor.getNode();
584
+ for (; p !== null; ) {
585
+ if (u(p)) {
586
+ i(p.getTag() === "ul"), l(p.getTag() === "ol");
587
+ return;
588
+ }
589
+ const C = p.getParent();
590
+ if (C === null) break;
591
+ p = C;
592
+ }
593
+ i(!1), l(!1);
594
+ }
595
+ return !1;
596
+ });
597
+ });
598
+ return () => {
599
+ c();
600
+ };
601
+ }, [t]), /* @__PURE__ */ F("div", { className: k["editor__toolbar-button-group"], children: Lt.map((c) => /* @__PURE__ */ F(
602
+ "button",
603
+ {
604
+ onClick: () => a(c),
605
+ title: r.format[`${c}Tooltip`],
606
+ className: ht(
607
+ k["editor__toolbar-button"],
608
+ k[`editor__toolbar-button--${c}`],
609
+ c === "bullet" && s && k["editor__toolbar-button--active"],
610
+ c === "number" && o && k["editor__toolbar-button--active"]
611
+ ),
612
+ "aria-label": r.aria.labels[c],
613
+ "aria-keyshortcuts": r.aria.keyshortcuts[c],
614
+ children: /* @__PURE__ */ F(gt, { name: Tt[c], size: 24 })
615
+ },
616
+ c
617
+ )) });
618
+ };
619
+ export {
620
+ P as D,
621
+ O as J,
622
+ Et as L,
623
+ Dt as Z
624
+ };
625
+ //# sourceMappingURL=ListPlugin-Bhkh3IBK.js.map