@uva-glass/component-library 3.53.13 → 3.53.15

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