@caspeco/casper-ui-library 9.11.1 → 9.13.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 (34) hide show
  1. package/dist/components/date-picker/base-date-picker.d.ts +1 -1
  2. package/dist/components/date-picker/base-date-picker.d.ts.map +1 -1
  3. package/dist/components/date-picker/base-date-picker.js +198 -178
  4. package/dist/components/date-picker/date-multi-picker.d.ts +8 -0
  5. package/dist/components/date-picker/date-multi-picker.d.ts.map +1 -0
  6. package/dist/components/date-picker/date-multi-picker.js +54 -0
  7. package/dist/components/date-picker/date-picker.composition.d.ts +3 -0
  8. package/dist/components/date-picker/date-picker.composition.d.ts.map +1 -1
  9. package/dist/components/date-picker/index.d.ts +2 -1
  10. package/dist/components/date-picker/index.d.ts.map +1 -1
  11. package/dist/components/date-picker/types.d.ts +16 -0
  12. package/dist/components/date-picker/types.d.ts.map +1 -1
  13. package/dist/components/spinner/index.d.ts +3 -0
  14. package/dist/components/spinner/index.d.ts.map +1 -0
  15. package/dist/components/spinner/spinner.composition.d.ts +3 -0
  16. package/dist/components/spinner/spinner.composition.d.ts.map +1 -0
  17. package/dist/components/spinner/spinner.d.ts +3 -0
  18. package/dist/components/spinner/spinner.d.ts.map +1 -0
  19. package/dist/components/spinner/spinner.js +52 -0
  20. package/dist/components/spinner/spinner.spec.d.ts +2 -0
  21. package/dist/components/spinner/spinner.spec.d.ts.map +1 -0
  22. package/dist/components/spinner/spinner.visual.test.d.ts +2 -0
  23. package/dist/components/spinner/spinner.visual.test.d.ts.map +1 -0
  24. package/dist/components/spinner/types.d.ts +6 -0
  25. package/dist/components/spinner/types.d.ts.map +1 -0
  26. package/dist/index.d.ts +1 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +664 -660
  29. package/dist/node_modules/@tiptap/core/dist/index.js +541 -525
  30. package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js +1464 -27
  31. package/dist/node_modules/@tiptap/extension-code/dist/index.js +26 -9
  32. package/dist/node_modules/@tiptap/extension-list/dist/index.js +314 -250
  33. package/dist/node_modules/@tiptap/extensions/dist/index.js +205 -182
  34. package/package.json +9 -9
@@ -1,8 +1,9 @@
1
- import { Node as g, wrappingInputRule as b, mergeAttributes as L, renderNestedMarkdownContent as $, Extension as S, isNodeActive as I, isAtStartOfNode as K, isAtEndOfNode as z, getNodeType as O, getNodeAtPosition as V, getRenderedAttributes as X, parseIndentedBlocks as x } from "../../core/dist/index.js";
1
+ import { Node as g, wrappingInputRule as b, mergeAttributes as L, renderNestedMarkdownContent as $, Extension as A, isNodeActive as I, isAtStartOfNode as j, isAtEndOfNode as K, getNodeAtPosition as z, getNodeType as B, getRenderedAttributes as V, parseIndentedBlocks as w } from "../../core/dist/index.js";
2
+ import { Fragment as X } from "../../../prosemirror-model/dist/index.js";
2
3
  var F = Object.defineProperty, G = (t, e) => {
3
4
  for (var s in e)
4
5
  F(t, s, { get: e[s], enumerable: !0 });
5
- }, W = "listItem", w = "textStyle", C = /^\s*([-+*])\s$/, q = g.create({
6
+ }, W = "listItem", C = "textStyle", N = /^\s*([-+*])\s$/, q = g.create({
6
7
  name: "bulletList",
7
8
  addOptions() {
8
9
  return {
@@ -34,7 +35,7 @@ var F = Object.defineProperty, G = (t, e) => {
34
35
  },
35
36
  addCommands() {
36
37
  return {
37
- toggleBulletList: () => ({ commands: t, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(W, this.editor.getAttributes(w)).run() : t.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
38
+ toggleBulletList: () => ({ commands: t, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(W, this.editor.getAttributes(C)).run() : t.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
38
39
  };
39
40
  },
40
41
  addKeyboardShortcuts() {
@@ -44,25 +45,83 @@ var F = Object.defineProperty, G = (t, e) => {
44
45
  },
45
46
  addInputRules() {
46
47
  let t = b({
47
- find: C,
48
+ find: N,
48
49
  type: this.type
49
50
  });
50
51
  return (this.options.keepMarks || this.options.keepAttributes) && (t = b({
51
- find: C,
52
+ find: N,
52
53
  type: this.type,
53
54
  keepMarks: this.options.keepMarks,
54
55
  keepAttributes: this.options.keepAttributes,
55
- getAttributes: () => this.editor.getAttributes(w),
56
+ getAttributes: () => this.editor.getAttributes(C),
56
57
  editor: this.editor
57
58
  })), [t];
58
59
  }
60
+ }), Y = (t, e, s) => {
61
+ const { selection: r } = t;
62
+ if (!r.empty)
63
+ return null;
64
+ const { $from: n } = r;
65
+ if (!n.parent.isTextblock || n.parentOffset !== n.parent.content.size)
66
+ return null;
67
+ let i = -1;
68
+ for (let d = n.depth; d > 0; d -= 1)
69
+ if (n.node(d).type.name === e) {
70
+ i = d;
71
+ break;
72
+ }
73
+ if (i < 0)
74
+ return null;
75
+ const l = n.node(i), o = n.index(i);
76
+ if (o + 1 >= l.childCount)
77
+ return null;
78
+ const p = l.child(o + 1);
79
+ if (!s.includes(p.type.name))
80
+ return null;
81
+ const h = t.schema.nodes[e];
82
+ let c = !1;
83
+ if (p.forEach((d) => {
84
+ d.type === h && d.childCount > 1 && (c = !0);
85
+ }), !c)
86
+ return null;
87
+ const a = t.doc.resolve(n.after()).nodeAfter;
88
+ if (!a || !s.includes(a.type.name))
89
+ return null;
90
+ const u = [];
91
+ return a.forEach((d) => {
92
+ u.push(d);
93
+ }), u.length === 0 ? null : {
94
+ listItemDepth: i,
95
+ nestedList: a,
96
+ nestedListPos: n.after(),
97
+ insertPos: n.after(i),
98
+ items: u
99
+ };
100
+ }, J = (t, e, s, r) => {
101
+ const n = Y(t, s, r);
102
+ if (!n)
103
+ return !1;
104
+ const { selection: i } = t, { nestedList: l, nestedListPos: o, insertPos: p, items: h } = n, c = t.tr;
105
+ c.delete(o, o + l.nodeSize);
106
+ const a = c.mapping.map(p);
107
+ return c.insert(a, X.from(h)), c.setSelection(i.map(c.doc, c.mapping)), e && e(c), !0;
108
+ }, Q = (t, e, s) => J(t.state, t.view.dispatch, e, s), D = (t, e) => A.create({
109
+ name: `${t}BranchingDeleteKeymap`,
110
+ priority: 101,
111
+ addKeyboardShortcuts() {
112
+ const s = () => Q(this.editor, t, e);
113
+ return {
114
+ Delete: s,
115
+ "Mod-Delete": s
116
+ };
117
+ }
59
118
  });
60
- function Y(t) {
119
+ function U(t) {
61
120
  var e, s;
62
- const n = (e = t.tokens) == null ? void 0 : e[0];
63
- return !!(t.text && ((s = t.tokens) == null ? void 0 : s.length) === 1 && n?.type === "list" && n.ordered && n.raw === t.text);
121
+ const r = (e = t.tokens) == null ? void 0 : e[0];
122
+ return !!(t.text && ((s = t.tokens) == null ? void 0 : s.length) === 1 && r?.type === "list" && r.ordered && r.raw === t.text);
64
123
  }
65
- function J(t, e) {
124
+ function Z(t, e) {
66
125
  return e.tokenizeInline ? e.parseInline(e.tokenizeInline(t)) : e.parseInline([
67
126
  {
68
127
  type: "text",
@@ -71,7 +130,7 @@ function J(t, e) {
71
130
  }
72
131
  ]);
73
132
  }
74
- var Q = g.create({
133
+ var tt = g.create({
75
134
  name: "listItem",
76
135
  addOptions() {
77
136
  return {
@@ -97,56 +156,64 @@ var Q = g.create({
97
156
  var s;
98
157
  if (t.type !== "list_item")
99
158
  return [];
100
- const n = (s = e.parseBlockChildren) != null ? s : e.parseChildren;
101
- let r = [];
159
+ const r = (s = e.parseBlockChildren) != null ? s : e.parseChildren;
160
+ let n = [];
102
161
  if (t.tokens && t.tokens.length > 0) {
103
- if (Y(t))
162
+ if (U(t))
104
163
  return {
105
164
  type: "listItem",
106
165
  content: [
107
166
  {
108
167
  type: "paragraph",
109
- content: J(t.text || "", e)
168
+ content: Z(t.text || "", e)
110
169
  }
111
170
  ]
112
171
  };
113
- if (t.tokens.some((u) => u.type === "paragraph"))
114
- r = n(t.tokens);
172
+ if (t.tokens.some((l) => l.type === "paragraph"))
173
+ n = r(t.tokens);
115
174
  else {
116
- const u = t.tokens[0];
117
- if (u && u.type === "text" && u.tokens && u.tokens.length > 0) {
118
- if (r = [
175
+ const l = t.tokens[0];
176
+ if (l && l.type === "text" && l.tokens && l.tokens.length > 0) {
177
+ if (n = [
119
178
  {
120
179
  type: "paragraph",
121
- content: e.parseInline(u.tokens)
180
+ content: e.parseInline(l.tokens)
122
181
  }
123
182
  ], t.tokens.length > 1) {
124
- const p = t.tokens.slice(1), h = n(p);
125
- r.push(...h);
183
+ const p = t.tokens.slice(1), h = r(p);
184
+ n.push(...h);
126
185
  }
127
186
  } else
128
- r = n(t.tokens);
187
+ n = r(t.tokens);
129
188
  }
130
189
  }
131
- return r.length === 0 && (r = [
190
+ return n.length === 0 && (n = [
132
191
  {
133
192
  type: "paragraph",
134
193
  content: []
135
194
  }
136
195
  ]), {
137
196
  type: "listItem",
138
- content: r
197
+ content: n
139
198
  };
140
199
  },
141
200
  renderMarkdown: (t, e, s) => $(
142
201
  t,
143
202
  e,
144
- (n) => {
145
- var r, i;
146
- return n.parentType === "bulletList" ? "- " : n.parentType === "orderedList" ? `${(((i = (r = n.meta) == null ? void 0 : r.parentAttrs) == null ? void 0 : i.start) || 1) + n.index}. ` : "- ";
203
+ (r) => {
204
+ var n, i;
205
+ return r.parentType === "bulletList" ? "- " : r.parentType === "orderedList" ? `${(((i = (n = r.meta) == null ? void 0 : n.parentAttrs) == null ? void 0 : i.start) || 1) + r.index}. ` : "- ";
147
206
  },
148
207
  s
149
208
  ),
209
+ addExtensions() {
210
+ return [
211
+ D(this.name, [
212
+ this.options.bulletListTypeName,
213
+ this.options.orderedListTypeName
214
+ ])
215
+ ];
216
+ },
150
217
  addKeyboardShortcuts() {
151
218
  return {
152
219
  Enter: () => this.editor.commands.splitListItem(this.name),
@@ -154,85 +221,79 @@ var Q = g.create({
154
221
  "Shift-Tab": () => this.editor.commands.liftListItem(this.name)
155
222
  };
156
223
  }
157
- }), U = {};
158
- G(U, {
224
+ }), et = {};
225
+ G(et, {
159
226
  findListItemPos: () => y,
160
- getNextListDepth: () => A,
227
+ getNextListDepth: () => M,
161
228
  handleBackspace: () => T,
162
- handleDelete: () => M,
163
- hasListBefore: () => _,
164
- hasListItemAfter: () => Z,
165
- hasListItemBefore: () => B,
166
- listItemHasSubList: () => P,
167
- nextListIsDeeper: () => D,
168
- nextListIsHigher: () => j
229
+ handleDelete: () => x,
230
+ hasListBefore: () => O,
231
+ hasListItemAfter: () => st,
232
+ hasListItemBefore: () => nt,
233
+ listItemHasSubList: () => rt,
234
+ nextListIsDeeper: () => P,
235
+ nextListIsHigher: () => _
169
236
  });
170
237
  var y = (t, e) => {
171
- const { $from: s } = e.selection, n = O(t, e.schema);
172
- let r = null, i = s.depth, u = s.pos, a = null;
173
- for (; i > 0 && a === null; )
174
- r = s.node(i), r.type === n ? a = i : (i -= 1, u -= 1);
175
- return a === null ? null : { $pos: e.doc.resolve(u), depth: a };
176
- }, A = (t, e) => {
238
+ const { $from: s } = e.selection, r = B(t, e.schema);
239
+ let n = null, i = s.depth, l = s.pos, o = null;
240
+ for (; i > 0 && o === null; )
241
+ n = s.node(i), n.type === r ? o = i : (i -= 1, l -= 1);
242
+ return o === null ? null : { $pos: e.doc.resolve(l), depth: o };
243
+ }, M = (t, e) => {
177
244
  const s = y(t, e);
178
245
  if (!s)
179
246
  return !1;
180
- const [, n] = V(e, t, s.$pos.pos + 4);
181
- return n;
182
- }, _ = (t, e, s) => {
183
- const { $anchor: n } = t.selection, r = Math.max(0, n.pos - 2), i = t.doc.resolve(r).node();
247
+ const [, r] = z(e, t, s.$pos.pos + 4);
248
+ return r;
249
+ }, O = (t, e, s) => {
250
+ const { $anchor: r } = t.selection, n = Math.max(0, r.pos - 2), i = t.doc.resolve(n).node();
184
251
  return !(!i || !s.includes(i.type.name));
185
- }, B = (t, e) => {
186
- var s;
187
- const { $anchor: n } = e.selection, r = e.doc.resolve(n.pos - 2);
188
- return !(r.index() === 0 || ((s = r.nodeBefore) == null ? void 0 : s.type.name) !== t);
189
- }, P = (t, e, s) => {
190
- if (!s)
191
- return !1;
192
- const n = O(t, e.schema);
193
- let r = !1;
194
- return s.descendants((i) => {
195
- i.type === n && (r = !0);
196
- }), r;
197
252
  }, T = (t, e, s) => {
198
253
  if (t.commands.undoInputRule())
199
254
  return !0;
200
255
  if (t.state.selection.from !== t.state.selection.to)
201
256
  return !1;
202
- if (!I(t.state, e) && _(t.state, e, s)) {
203
- const { $anchor: a } = t.state.selection, p = t.state.doc.resolve(a.before() - 1), h = [];
204
- p.node().descendants((c, l) => {
205
- c.type.name === e && h.push({ node: c, pos: l });
257
+ if (!I(t.state, e) && O(t.state, e, s)) {
258
+ const { $anchor: r } = t.state.selection, n = t.state.doc.resolve(r.before() - 1), i = [];
259
+ n.node().descendants((p, h) => {
260
+ p.type.name === e && i.push({ node: p, pos: h });
206
261
  });
207
- const m = h.at(-1);
208
- if (!m)
262
+ const l = i.at(-1);
263
+ if (!l)
209
264
  return !1;
210
- const o = t.state.doc.resolve(p.start() + m.pos + 1);
211
- return t.chain().cut({ from: a.start() - 1, to: a.end() + 1 }, o.end()).joinForward().run();
265
+ const o = t.state.doc.resolve(n.start() + l.pos + 1);
266
+ return t.chain().cut({ from: r.start() - 1, to: r.end() + 1 }, o.end()).joinForward().run();
212
267
  }
213
- if (!I(t.state, e) || !K(t.state))
214
- return !1;
215
- const n = y(e, t.state);
216
- if (!n)
217
- return !1;
218
- const i = t.state.doc.resolve(n.$pos.pos - 2).node(n.depth), u = P(e, t.state, i);
219
- return B(e, t.state) && !u ? t.commands.joinItemBackward() : t.chain().liftListItem(e).run();
220
- }, D = (t, e) => {
221
- const s = A(t, e), n = y(t, e);
222
- return !n || !s ? !1 : s > n.depth;
223
- }, j = (t, e) => {
224
- const s = A(t, e), n = y(t, e);
225
- return !n || !s ? !1 : s < n.depth;
226
- }, M = (t, e) => {
227
- if (!I(t.state, e) || !z(t.state, e))
268
+ return !I(t.state, e) || !j(t.state) ? !1 : t.chain().liftListItem(e).run();
269
+ }, P = (t, e) => {
270
+ const s = M(t, e), r = y(t, e);
271
+ return !r || !s ? !1 : s > r.depth;
272
+ }, _ = (t, e) => {
273
+ const s = M(t, e), r = y(t, e);
274
+ return !r || !s ? !1 : s < r.depth;
275
+ }, x = (t, e) => {
276
+ if (!I(t.state, e) || !K(t.state, e))
228
277
  return !1;
229
- const { selection: s } = t.state, { $from: n, $to: r } = s;
230
- return !s.empty && n.sameParent(r) ? !1 : D(e, t.state) ? t.chain().focus(t.state.selection.from + 4).lift(e).joinBackward().run() : j(e, t.state) ? t.chain().joinForward().joinBackward().run() : t.commands.joinItemForward();
231
- }, Z = (t, e) => {
278
+ const { selection: s } = t.state, { $from: r, $to: n } = s;
279
+ return !s.empty && r.sameParent(n) ? !1 : P(e, t.state) ? t.chain().focus(t.state.selection.from + 4).lift(e).joinBackward().run() : _(e, t.state) ? t.chain().joinForward().joinBackward().run() : t.commands.joinItemForward();
280
+ }, st = (t, e) => {
232
281
  var s;
233
- const { $anchor: n } = e.selection, r = e.doc.resolve(n.pos - n.parentOffset - 2);
234
- return !(r.index() === r.parent.childCount - 1 || ((s = r.nodeAfter) == null ? void 0 : s.type.name) !== t);
235
- }, tt = S.create({
282
+ const { $anchor: r } = e.selection, n = e.doc.resolve(r.pos - r.parentOffset - 2);
283
+ return !(n.index() === n.parent.childCount - 1 || ((s = n.nodeAfter) == null ? void 0 : s.type.name) !== t);
284
+ }, nt = (t, e) => {
285
+ var s;
286
+ const { $anchor: r } = e.selection, n = e.doc.resolve(r.pos - 2);
287
+ return !(n.index() === 0 || ((s = n.nodeBefore) == null ? void 0 : s.type.name) !== t);
288
+ }, rt = (t, e, s) => {
289
+ if (!s)
290
+ return !1;
291
+ const r = B(t, e.schema);
292
+ let n = !1;
293
+ return s.descendants((i) => {
294
+ i.type === r && (n = !0);
295
+ }), n;
296
+ }, it = A.create({
236
297
  name: "listKeymap",
237
298
  addOptions() {
238
299
  return {
@@ -253,31 +314,31 @@ var y = (t, e) => {
253
314
  Delete: ({ editor: t }) => {
254
315
  let e = !1;
255
316
  return this.options.listTypes.forEach(({ itemName: s }) => {
256
- t.state.schema.nodes[s] !== void 0 && M(t, s) && (e = !0);
317
+ t.state.schema.nodes[s] !== void 0 && x(t, s) && (e = !0);
257
318
  }), e;
258
319
  },
259
320
  "Mod-Delete": ({ editor: t }) => {
260
321
  let e = !1;
261
322
  return this.options.listTypes.forEach(({ itemName: s }) => {
262
- t.state.schema.nodes[s] !== void 0 && M(t, s) && (e = !0);
323
+ t.state.schema.nodes[s] !== void 0 && x(t, s) && (e = !0);
263
324
  }), e;
264
325
  },
265
326
  Backspace: ({ editor: t }) => {
266
327
  let e = !1;
267
- return this.options.listTypes.forEach(({ itemName: s, wrapperNames: n }) => {
268
- t.state.schema.nodes[s] !== void 0 && T(t, s, n) && (e = !0);
328
+ return this.options.listTypes.forEach(({ itemName: s, wrapperNames: r }) => {
329
+ t.state.schema.nodes[s] !== void 0 && T(t, s, r) && (e = !0);
269
330
  }), e;
270
331
  },
271
332
  "Mod-Backspace": ({ editor: t }) => {
272
333
  let e = !1;
273
- return this.options.listTypes.forEach(({ itemName: s, wrapperNames: n }) => {
274
- t.state.schema.nodes[s] !== void 0 && T(t, s, n) && (e = !0);
334
+ return this.options.listTypes.forEach(({ itemName: s, wrapperNames: r }) => {
335
+ t.state.schema.nodes[s] !== void 0 && T(t, s, r) && (e = !0);
275
336
  }), e;
276
337
  }
277
338
  };
278
339
  }
279
- }), N = /^(\s*)(\d+)\.\s+(.*)$/, et = /^\s/;
280
- function st(t) {
340
+ }), E = /^(\s*)(\d+)\.\s+(.*)$/, ot = /^\s/;
341
+ function at(t) {
281
342
  const e = t.trimStart();
282
343
  return (
283
344
  // oxlint-disable-next-line prefer-string-starts-ends-with
@@ -288,134 +349,134 @@ function st(t) {
288
349
  /^~~~/.test(e)
289
350
  );
290
351
  }
291
- function nt(t) {
352
+ function lt(t) {
292
353
  const e = [], s = [];
293
- let n = !1;
294
- return t.forEach((r) => {
295
- if (n) {
296
- s.push(r);
354
+ let r = !1;
355
+ return t.forEach((n) => {
356
+ if (r) {
357
+ s.push(n);
297
358
  return;
298
359
  }
299
- if (r.trim() === "") {
300
- n = !0, s.push(r);
360
+ if (n.trim() === "") {
361
+ r = !0, s.push(n);
301
362
  return;
302
363
  }
303
- if (e.length > 0 && st(r)) {
304
- n = !0, s.push(r);
364
+ if (e.length > 0 && at(n)) {
365
+ r = !0, s.push(n);
305
366
  return;
306
367
  }
307
- e.push(r);
368
+ e.push(n);
308
369
  }), {
309
370
  paragraphLines: e,
310
371
  blockLines: s
311
372
  };
312
373
  }
313
- function rt(t) {
374
+ function ut(t) {
314
375
  const e = [];
315
- let s = 0, n = 0;
376
+ let s = 0, r = 0;
316
377
  for (; s < t.length; ) {
317
- const r = t[s], i = r.match(N);
378
+ const n = t[s], i = n.match(E);
318
379
  if (!i)
319
380
  break;
320
- const [, u, a, p] = i, h = u.length, m = [p];
321
- let o = s + 1;
322
- const c = [r];
323
- let l = !1;
324
- for (; o < t.length; ) {
325
- const d = t[o];
326
- if (d.match(N))
381
+ const [, l, o, p] = i, h = l.length, c = [p];
382
+ let a = s + 1;
383
+ const u = [n];
384
+ let d = !1;
385
+ for (; a < t.length; ) {
386
+ const m = t[a];
387
+ if (m.match(E))
327
388
  break;
328
- if (d.trim() === "")
329
- c.push(d), m.push(""), l = !0, o += 1;
330
- else if (d.match(et))
331
- c.push(d), m.push(d.slice(h + 2)), o += 1;
389
+ if (m.trim() === "")
390
+ u.push(m), c.push(""), d = !0, a += 1;
391
+ else if (m.match(ot))
392
+ u.push(m), c.push(m.slice(h + 2)), a += 1;
332
393
  else {
333
- if (l)
394
+ if (d)
334
395
  break;
335
- c.push(d), m.push(d), o += 1;
396
+ u.push(m), c.push(m), a += 1;
336
397
  }
337
398
  }
338
399
  e.push({
339
400
  indent: h,
340
- number: parseInt(a, 10),
341
- content: m.join(`
401
+ number: parseInt(o, 10),
402
+ content: c.join(`
342
403
  `).trim(),
343
- contentLines: m,
344
- raw: c.join(`
404
+ contentLines: c,
405
+ raw: u.join(`
345
406
  `)
346
- }), n = o, s = o;
407
+ }), r = a, s = a;
347
408
  }
348
- return [e, n];
409
+ return [e, r];
349
410
  }
350
411
  function R(t, e, s) {
351
- const n = [];
352
- let r = 0;
353
- for (; r < t.length; ) {
354
- const i = t[r];
412
+ const r = [];
413
+ let n = 0;
414
+ for (; n < t.length; ) {
415
+ const i = t[n];
355
416
  if (i.indent === e) {
356
- const { paragraphLines: u, blockLines: a } = nt(i.contentLines), p = u.join(`
417
+ const { paragraphLines: l, blockLines: o } = lt(i.contentLines), p = l.join(`
357
418
  `).trim(), h = [];
358
419
  p && h.push({
359
420
  type: "paragraph",
360
421
  raw: p,
361
422
  tokens: s.inlineTokens(p)
362
423
  });
363
- const m = a.join(`
424
+ const c = o.join(`
364
425
  `).trim();
365
- if (m) {
366
- const l = s.blockTokens(m);
367
- h.push(...l);
426
+ if (c) {
427
+ const d = s.blockTokens(c);
428
+ h.push(...d);
368
429
  }
369
- let o = r + 1;
370
- const c = [];
371
- for (; o < t.length && t[o].indent > e; )
372
- c.push(t[o]), o += 1;
373
- if (c.length > 0) {
374
- const l = Math.min(...c.map((f) => f.indent)), d = R(c, l, s);
430
+ let a = n + 1;
431
+ const u = [];
432
+ for (; a < t.length && t[a].indent > e; )
433
+ u.push(t[a]), a += 1;
434
+ if (u.length > 0) {
435
+ const d = Math.min(...u.map((f) => f.indent)), m = R(u, d, s);
375
436
  h.push({
376
437
  type: "list",
377
438
  ordered: !0,
378
- start: c[0].number,
379
- items: d,
380
- raw: c.map((f) => f.raw).join(`
439
+ start: u[0].number,
440
+ items: m,
441
+ raw: u.map((f) => f.raw).join(`
381
442
  `)
382
443
  });
383
444
  }
384
- n.push({
445
+ r.push({
385
446
  type: "list_item",
386
447
  raw: i.raw,
387
448
  tokens: h
388
- }), r = o;
449
+ }), n = a;
389
450
  } else
390
- r += 1;
451
+ n += 1;
391
452
  }
392
- return n;
453
+ return r;
393
454
  }
394
- function it(t, e) {
455
+ function dt(t, e) {
395
456
  return t.map((s) => {
396
457
  if (s.type !== "list_item")
397
458
  return e.parseChildren([s])[0];
398
- const n = [];
399
- return s.tokens && s.tokens.length > 0 && s.tokens.forEach((r) => {
400
- if (r.type === "paragraph" || r.type === "list" || r.type === "blockquote" || r.type === "code")
401
- n.push(...e.parseChildren([r]));
402
- else if (r.type === "text" && r.tokens) {
403
- const i = e.parseChildren([r]);
404
- n.push({
459
+ const r = [];
460
+ return s.tokens && s.tokens.length > 0 && s.tokens.forEach((n) => {
461
+ if (n.type === "paragraph" || n.type === "list" || n.type === "blockquote" || n.type === "code")
462
+ r.push(...e.parseChildren([n]));
463
+ else if (n.type === "text" && n.tokens) {
464
+ const i = e.parseChildren([n]);
465
+ r.push({
405
466
  type: "paragraph",
406
467
  content: i
407
468
  });
408
469
  } else {
409
- const i = e.parseChildren([r]);
410
- i.length > 0 && n.push(...i);
470
+ const i = e.parseChildren([n]);
471
+ i.length > 0 && r.push(...i);
411
472
  }
412
473
  }), {
413
474
  type: "listItem",
414
- content: n
475
+ content: r
415
476
  };
416
477
  });
417
478
  }
418
- var at = "listItem", E = "textStyle", H = /^(\d+)\.\s$/, ot = g.create({
479
+ var ct = "listItem", H = "textStyle", S = /^(\d+)\.\s$/, pt = g.create({
419
480
  name: "orderedList",
420
481
  addOptions() {
421
482
  return {
@@ -456,14 +517,14 @@ var at = "listItem", E = "textStyle", H = /^(\d+)\.\s$/, ot = g.create({
456
517
  parseMarkdown: (t, e) => {
457
518
  if (t.type !== "list" || !t.ordered)
458
519
  return [];
459
- const s = t.start || 1, n = t.items ? it(t.items, e) : [];
520
+ const s = t.start || 1, r = t.items ? dt(t.items, e) : [];
460
521
  return s !== 1 ? {
461
522
  type: "orderedList",
462
523
  attrs: { start: s },
463
- content: n
524
+ content: r
464
525
  } : {
465
526
  type: "orderedList",
466
- content: n
527
+ content: r
467
528
  };
468
529
  },
469
530
  renderMarkdown: (t, e) => t.content ? e.renderChildren(t.content, `
@@ -476,18 +537,18 @@ var at = "listItem", E = "textStyle", H = /^(\d+)\.\s$/, ot = g.create({
476
537
  return s !== void 0 ? s : -1;
477
538
  },
478
539
  tokenize: (t, e, s) => {
479
- var n;
480
- const r = t.split(`
481
- `), [i, u] = rt(r);
540
+ var r;
541
+ const n = t.split(`
542
+ `), [i, l] = ut(n);
482
543
  if (i.length === 0)
483
544
  return;
484
- const a = R(i, 0, s);
485
- return a.length === 0 ? void 0 : {
545
+ const o = R(i, 0, s);
546
+ return o.length === 0 ? void 0 : {
486
547
  type: "list",
487
548
  ordered: !0,
488
- start: ((n = i[0]) == null ? void 0 : n.number) || 1,
489
- items: a,
490
- raw: r.slice(0, u).join(`
549
+ start: ((r = i[0]) == null ? void 0 : r.number) || 1,
550
+ items: o,
551
+ raw: n.slice(0, l).join(`
491
552
  `)
492
553
  };
493
554
  }
@@ -497,7 +558,7 @@ var at = "listItem", E = "textStyle", H = /^(\d+)\.\s$/, ot = g.create({
497
558
  },
498
559
  addCommands() {
499
560
  return {
500
- toggleOrderedList: () => ({ commands: t, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(at, this.editor.getAttributes(E)).run() : t.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
561
+ toggleOrderedList: () => ({ commands: t, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(ct, this.editor.getAttributes(H)).run() : t.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
501
562
  };
502
563
  },
503
564
  addKeyboardShortcuts() {
@@ -507,22 +568,22 @@ var at = "listItem", E = "textStyle", H = /^(\d+)\.\s$/, ot = g.create({
507
568
  },
508
569
  addInputRules() {
509
570
  let t = b({
510
- find: H,
571
+ find: S,
511
572
  type: this.type,
512
573
  getAttributes: (e) => ({ start: +e[1] }),
513
574
  joinPredicate: (e, s) => s.childCount + s.attrs.start === +e[1]
514
575
  });
515
576
  return (this.options.keepMarks || this.options.keepAttributes) && (t = b({
516
- find: H,
577
+ find: S,
517
578
  type: this.type,
518
579
  keepMarks: this.options.keepMarks,
519
580
  keepAttributes: this.options.keepAttributes,
520
- getAttributes: (e) => ({ start: +e[1], ...this.editor.getAttributes(E) }),
581
+ getAttributes: (e) => ({ start: +e[1], ...this.editor.getAttributes(H) }),
521
582
  joinPredicate: (e, s) => s.childCount + s.attrs.start === +e[1],
522
583
  editor: this.editor
523
584
  })), [t];
524
585
  }
525
- }), ut = /^\s*(\[([( |x])?\])\s$/, ct = g.create({
586
+ }), ht = /^\s*(\[([( |x])?\])\s$/, mt = g.create({
526
587
  name: "taskItem",
527
588
  addOptions() {
528
589
  return {
@@ -582,15 +643,18 @@ var at = "listItem", E = "textStyle", H = /^(\d+)\.\s$/, ot = g.create({
582
643
  parseMarkdown: (t, e) => {
583
644
  const s = [];
584
645
  if (t.tokens && t.tokens.length > 0 ? s.push(e.createNode("paragraph", {}, e.parseInline(t.tokens))) : t.text ? s.push(e.createNode("paragraph", {}, [e.createNode("text", { text: t.text })])) : s.push(e.createNode("paragraph", {}, [])), t.nestedTokens && t.nestedTokens.length > 0) {
585
- const n = e.parseChildren(t.nestedTokens);
586
- s.push(...n);
646
+ const r = e.parseChildren(t.nestedTokens);
647
+ s.push(...r);
587
648
  }
588
649
  return e.createNode("taskItem", { checked: t.checked || !1 }, s);
589
650
  },
590
651
  renderMarkdown: (t, e) => {
591
652
  var s;
592
- const r = `- [${(s = t.attrs) != null && s.checked ? "x" : " "}] `;
593
- return $(t, e, r);
653
+ const n = `- [${(s = t.attrs) != null && s.checked ? "x" : " "}] `;
654
+ return $(t, e, n);
655
+ },
656
+ addExtensions() {
657
+ return this.options.nested ? [D(this.name, [this.options.taskListTypeName])] : [];
594
658
  },
595
659
  addKeyboardShortcuts() {
596
660
  const t = {
@@ -603,46 +667,46 @@ var at = "listItem", E = "textStyle", H = /^(\d+)\.\s$/, ot = g.create({
603
667
  } : t;
604
668
  },
605
669
  addNodeView() {
606
- return ({ node: t, HTMLAttributes: e, getPos: s, editor: n }) => {
607
- const r = document.createElement("li"), i = document.createElement("label"), u = document.createElement("span"), a = document.createElement("input"), p = document.createElement("div"), h = (o) => {
608
- var c, l;
609
- a.ariaLabel = ((l = (c = this.options.a11y) == null ? void 0 : c.checkboxLabel) == null ? void 0 : l.call(c, o, a.checked)) || `Task item checkbox for ${o.textContent || "empty task item"}`;
670
+ return ({ node: t, HTMLAttributes: e, getPos: s, editor: r }) => {
671
+ const n = document.createElement("li"), i = document.createElement("label"), l = document.createElement("span"), o = document.createElement("input"), p = document.createElement("div"), h = (a) => {
672
+ var u, d;
673
+ o.ariaLabel = ((d = (u = this.options.a11y) == null ? void 0 : u.checkboxLabel) == null ? void 0 : d.call(u, a, o.checked)) || `Task item checkbox for ${a.textContent || "empty task item"}`;
610
674
  };
611
- h(t), i.contentEditable = "false", a.type = "checkbox", a.addEventListener("mousedown", (o) => o.preventDefault()), a.addEventListener("change", (o) => {
612
- if (!n.isEditable && !this.options.onReadOnlyChecked) {
613
- a.checked = !a.checked;
675
+ h(t), i.contentEditable = "false", o.type = "checkbox", o.addEventListener("mousedown", (a) => a.preventDefault()), o.addEventListener("change", (a) => {
676
+ if (!r.isEditable && !this.options.onReadOnlyChecked) {
677
+ o.checked = !o.checked;
614
678
  return;
615
679
  }
616
- const { checked: c } = o.target;
617
- n.isEditable && typeof s == "function" && n.chain().focus(void 0, { scrollIntoView: !1 }).command(({ tr: l }) => {
618
- const d = s();
619
- if (typeof d != "number")
680
+ const { checked: u } = a.target;
681
+ r.isEditable && typeof s == "function" && r.chain().focus(void 0, { scrollIntoView: !1 }).command(({ tr: d }) => {
682
+ const m = s();
683
+ if (typeof m != "number")
620
684
  return !1;
621
- const f = l.doc.nodeAt(d);
622
- return l.setNodeMarkup(d, void 0, {
685
+ const f = d.doc.nodeAt(m);
686
+ return d.setNodeMarkup(m, void 0, {
623
687
  ...f?.attrs,
624
- checked: c
688
+ checked: u
625
689
  }), !0;
626
- }).run(), !n.isEditable && this.options.onReadOnlyChecked && (this.options.onReadOnlyChecked(t, c) || (a.checked = !a.checked));
627
- }), Object.entries(this.options.HTMLAttributes).forEach(([o, c]) => {
628
- r.setAttribute(o, c);
629
- }), r.dataset.checked = t.attrs.checked, a.checked = t.attrs.checked, i.append(a, u), r.append(i, p), Object.entries(e).forEach(([o, c]) => {
630
- r.setAttribute(o, c);
690
+ }).run(), !r.isEditable && this.options.onReadOnlyChecked && (this.options.onReadOnlyChecked(t, u) || (o.checked = !o.checked));
691
+ }), Object.entries(this.options.HTMLAttributes).forEach(([a, u]) => {
692
+ n.setAttribute(a, u);
693
+ }), n.dataset.checked = t.attrs.checked, o.checked = t.attrs.checked, i.append(o, l), n.append(i, p), Object.entries(e).forEach(([a, u]) => {
694
+ n.setAttribute(a, u);
631
695
  });
632
- let m = new Set(Object.keys(e));
696
+ let c = new Set(Object.keys(e));
633
697
  return {
634
- dom: r,
698
+ dom: n,
635
699
  contentDOM: p,
636
- update: (o) => {
637
- if (o.type !== this.type)
700
+ update: (a) => {
701
+ if (a.type !== this.type)
638
702
  return !1;
639
- r.dataset.checked = o.attrs.checked, a.checked = o.attrs.checked, h(o);
640
- const c = n.extensionManager.attributes, l = X(o, c), d = new Set(Object.keys(l)), f = this.options.HTMLAttributes;
641
- return m.forEach((k) => {
642
- d.has(k) || (k in f ? r.setAttribute(k, f[k]) : r.removeAttribute(k));
643
- }), Object.entries(l).forEach(([k, v]) => {
644
- v == null ? k in f ? r.setAttribute(k, f[k]) : r.removeAttribute(k) : r.setAttribute(k, v);
645
- }), m = d, !0;
703
+ n.dataset.checked = a.attrs.checked, o.checked = a.attrs.checked, h(a);
704
+ const u = r.extensionManager.attributes, d = V(a, u), m = new Set(Object.keys(d)), f = this.options.HTMLAttributes;
705
+ return c.forEach((k) => {
706
+ m.has(k) || (k in f ? n.setAttribute(k, f[k]) : n.removeAttribute(k));
707
+ }), Object.entries(d).forEach(([k, v]) => {
708
+ v == null ? k in f ? n.setAttribute(k, f[k]) : n.removeAttribute(k) : n.setAttribute(k, v);
709
+ }), c = m, !0;
646
710
  }
647
711
  };
648
712
  };
@@ -650,7 +714,7 @@ var at = "listItem", E = "textStyle", H = /^(\d+)\.\s$/, ot = g.create({
650
714
  addInputRules() {
651
715
  return [
652
716
  b({
653
- find: ut,
717
+ find: ht,
654
718
  type: this.type,
655
719
  getAttributes: (t) => ({
656
720
  checked: t[t.length - 1] === "x"
@@ -658,7 +722,7 @@ var at = "listItem", E = "textStyle", H = /^(\d+)\.\s$/, ot = g.create({
658
722
  })
659
723
  ];
660
724
  }
661
- }), lt = g.create({
725
+ }), ft = g.create({
662
726
  name: "taskList",
663
727
  addOptions() {
664
728
  return {
@@ -697,39 +761,39 @@ var at = "listItem", E = "textStyle", H = /^(\d+)\.\s$/, ot = g.create({
697
761
  return s !== void 0 ? s : -1;
698
762
  },
699
763
  tokenize(t, e, s) {
700
- const n = (i) => {
701
- const u = x(
764
+ const r = (i) => {
765
+ const l = w(
702
766
  i,
703
767
  {
704
768
  itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
705
- extractItemData: (a) => ({
706
- indentLevel: a[1].length,
707
- mainContent: a[4],
708
- checked: a[3].toLowerCase() === "x"
769
+ extractItemData: (o) => ({
770
+ indentLevel: o[1].length,
771
+ mainContent: o[4],
772
+ checked: o[3].toLowerCase() === "x"
709
773
  }),
710
- createToken: (a, p) => ({
774
+ createToken: (o, p) => ({
711
775
  type: "taskItem",
712
776
  raw: "",
713
- mainContent: a.mainContent,
714
- indentLevel: a.indentLevel,
715
- checked: a.checked,
716
- text: a.mainContent,
717
- tokens: s.inlineTokens(a.mainContent),
777
+ mainContent: o.mainContent,
778
+ indentLevel: o.indentLevel,
779
+ checked: o.checked,
780
+ text: o.mainContent,
781
+ tokens: s.inlineTokens(o.mainContent),
718
782
  nestedTokens: p
719
783
  }),
720
784
  // Allow recursive nesting
721
- customNestedParser: n
785
+ customNestedParser: r
722
786
  },
723
787
  s
724
788
  );
725
- return u ? [
789
+ return l ? [
726
790
  {
727
791
  type: "taskList",
728
- raw: u.raw,
729
- items: u.items
792
+ raw: l.raw,
793
+ items: l.items
730
794
  }
731
795
  ] : s.blockTokens(i);
732
- }, r = x(
796
+ }, n = w(
733
797
  t,
734
798
  {
735
799
  itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
@@ -738,7 +802,7 @@ var at = "listItem", E = "textStyle", H = /^(\d+)\.\s$/, ot = g.create({
738
802
  mainContent: i[4],
739
803
  checked: i[3].toLowerCase() === "x"
740
804
  }),
741
- createToken: (i, u) => ({
805
+ createToken: (i, l) => ({
742
806
  type: "taskItem",
743
807
  raw: "",
744
808
  mainContent: i.mainContent,
@@ -746,18 +810,18 @@ var at = "listItem", E = "textStyle", H = /^(\d+)\.\s$/, ot = g.create({
746
810
  checked: i.checked,
747
811
  text: i.mainContent,
748
812
  tokens: s.inlineTokens(i.mainContent),
749
- nestedTokens: u
813
+ nestedTokens: l
750
814
  }),
751
815
  // Use the recursive parser for nested content
752
- customNestedParser: n
816
+ customNestedParser: r
753
817
  },
754
818
  s
755
819
  );
756
- if (r)
820
+ if (n)
757
821
  return {
758
822
  type: "taskList",
759
- raw: r.raw,
760
- items: r.items
823
+ raw: n.raw,
824
+ items: n.items
761
825
  };
762
826
  }
763
827
  },
@@ -775,22 +839,22 @@ var at = "listItem", E = "textStyle", H = /^(\d+)\.\s$/, ot = g.create({
775
839
  };
776
840
  }
777
841
  });
778
- S.create({
842
+ A.create({
779
843
  name: "listKit",
780
844
  addExtensions() {
781
845
  const t = [];
782
- return this.options.bulletList !== !1 && t.push(q.configure(this.options.bulletList)), this.options.listItem !== !1 && t.push(Q.configure(this.options.listItem)), this.options.listKeymap !== !1 && t.push(tt.configure(this.options.listKeymap)), this.options.orderedList !== !1 && t.push(ot.configure(this.options.orderedList)), this.options.taskItem !== !1 && t.push(ct.configure(this.options.taskItem)), this.options.taskList !== !1 && t.push(lt.configure(this.options.taskList)), t;
846
+ return this.options.bulletList !== !1 && t.push(q.configure(this.options.bulletList)), this.options.listItem !== !1 && t.push(tt.configure(this.options.listItem)), this.options.listKeymap !== !1 && t.push(it.configure(this.options.listKeymap)), this.options.orderedList !== !1 && t.push(pt.configure(this.options.orderedList)), this.options.taskItem !== !1 && t.push(mt.configure(this.options.taskItem)), this.options.taskList !== !1 && t.push(ft.configure(this.options.taskList)), t;
783
847
  }
784
848
  });
785
849
  export {
786
850
  q as BulletList,
787
- Q as ListItem,
788
- tt as ListKeymap,
789
- ot as OrderedList,
790
- ct as TaskItem,
791
- lt as TaskList,
792
- C as bulletListInputRegex,
793
- ut as inputRegex,
794
- U as listHelpers,
795
- H as orderedListInputRegex
851
+ tt as ListItem,
852
+ it as ListKeymap,
853
+ pt as OrderedList,
854
+ mt as TaskItem,
855
+ ft as TaskList,
856
+ N as bulletListInputRegex,
857
+ ht as inputRegex,
858
+ et as listHelpers,
859
+ S as orderedListInputRegex
796
860
  };