@blocknote/core 0.9.4 → 0.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/blocknote.js CHANGED
@@ -1,6 +1,6 @@
1
1
  var Yt = Object.defineProperty;
2
- var Jt = (n, e, t) => e in n ? Yt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var u = (n, e, t) => (Jt(n, typeof e != "symbol" ? e + "" : e, t), t);
2
+ var Jt = (n, t, e) => t in n ? Yt(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
+ var u = (n, t, e) => (Jt(n, typeof t != "symbol" ? t + "" : t, e), e);
4
4
  import { Extension as A, Mark as ht, combineTransactionSteps as Zt, getChangedRanges as Qt, findChildrenInRange as te, findChildren as nt, Node as G, mergeAttributes as N, findParentNode as ee, extensions as R, InputRule as Z, isTextSelection as oe, isNodeSelection as ne, posToDOMRect as K, getMarkRange as rt, Editor as re } from "@tiptap/core";
5
5
  import { Bold as ie } from "@tiptap/extension-bold";
6
6
  import { Code as se } from "@tiptap/extension-code";
@@ -16,47 +16,47 @@ import { Strike as fe } from "@tiptap/extension-strike";
16
16
  import { Text as ge } from "@tiptap/extension-text";
17
17
  import { Underline as ke } from "@tiptap/extension-underline";
18
18
  import { Slice as L, Fragment as P, DOMSerializer as Y, DOMParser as be } from "prosemirror-model";
19
- import { Plugin as T, PluginKey as B, NodeSelection as mt, TextSelection as it, Selection as X } from "prosemirror-state";
19
+ import { Plugin as B, PluginKey as M, NodeSelection as mt, TextSelection as it, Selection as X } from "prosemirror-state";
20
20
  import { v4 as ye } from "uuid";
21
21
  import * as ve from "prosemirror-view";
22
- import { Decoration as W, DecorationSet as $ } from "prosemirror-view";
22
+ import { Decoration as $, DecorationSet as W } from "prosemirror-view";
23
23
  import ft from "rehype-parse";
24
24
  import we from "rehype-remark";
25
25
  import gt from "rehype-stringify";
26
26
  import kt from "remark-gfm";
27
27
  import Ce from "remark-parse";
28
28
  import Ee, { defaultHandlers as Se } from "remark-rehype";
29
- import Te from "remark-stringify";
29
+ import Be from "remark-stringify";
30
30
  import { unified as Q } from "unified";
31
31
  import { fromDom as st } from "hast-util-from-dom";
32
- const Me = "_bnEditor_12je0_3", Be = "_bnRoot_12je0_19", xe = "_defaultStyles_12je0_34", Ie = "_dragPreview_12je0_57", D = {
33
- bnEditor: Me,
34
- bnRoot: Be,
32
+ const Te = "_bnEditor_12je0_3", Me = "_bnRoot_12je0_19", xe = "_defaultStyles_12je0_34", Ie = "_dragPreview_12je0_57", D = {
33
+ bnEditor: Te,
34
+ bnRoot: Me,
35
35
  defaultStyles: xe,
36
36
  dragPreview: Ie,
37
37
  "collaboration-cursor__caret": "_collaboration-cursor__caret_12je0_63",
38
38
  "collaboration-cursor__label": "_collaboration-cursor__label_12je0_74"
39
39
  };
40
40
  function bt(n) {
41
- const e = n.attrs.id, t = n.firstChild, o = t.type, r = n.childCount === 2 ? n.lastChild.childCount : 0;
41
+ const t = n.attrs.id, e = n.firstChild, o = e.type, r = n.childCount === 2 ? n.lastChild.childCount : 0;
42
42
  return {
43
- id: e,
43
+ id: t,
44
44
  node: n,
45
- contentNode: t,
45
+ contentNode: e,
46
46
  contentType: o,
47
47
  numChildBlocks: r
48
48
  };
49
49
  }
50
- function b(n, e) {
50
+ function b(n, t) {
51
51
  const o = n.nodeSize - 2;
52
- if (e <= 1)
53
- for (e = 1 + 1; n.resolve(e).parent.type.name !== "blockContainer" && e < o; )
54
- e++;
55
- else if (e >= o)
56
- for (e = o - 1; n.resolve(e).parent.type.name !== "blockContainer" && e > 1; )
57
- e--;
58
- n.resolve(e).parent.type.name === "blockGroup" && e++;
59
- const r = n.resolve(e), i = r.depth;
52
+ if (t <= 1)
53
+ for (t = 1 + 1; n.resolve(t).parent.type.name !== "blockContainer" && t < o; )
54
+ t++;
55
+ else if (t >= o)
56
+ for (t = o - 1; n.resolve(t).parent.type.name !== "blockContainer" && t > 1; )
57
+ t--;
58
+ n.resolve(t).parent.type.name === "blockGroup" && t++;
59
+ const r = n.resolve(t), i = r.depth;
60
60
  let s = r.node(i), l = i;
61
61
  for (; ; ) {
62
62
  if (l < 0)
@@ -110,12 +110,12 @@ const C = {
110
110
  },
111
111
  addCommands() {
112
112
  return {
113
- setBlockBackgroundColor: (n, e) => ({ state: t, view: o }) => {
114
- const r = b(t.doc, n);
115
- return r === void 0 ? !1 : (t.tr.setNodeAttribute(
113
+ setBlockBackgroundColor: (n, t) => ({ state: e, view: o }) => {
114
+ const r = b(e.doc, n);
115
+ return r === void 0 ? !1 : (e.tr.setNodeAttribute(
116
116
  r.startPos - 1,
117
117
  "backgroundColor",
118
- e
118
+ t
119
119
  ), o.focus(), !0);
120
120
  }
121
121
  };
@@ -146,22 +146,22 @@ const C = {
146
146
  },
147
147
  addCommands() {
148
148
  return {
149
- setBackgroundColor: (n) => ({ commands: e }) => n !== C.backgroundColor.default ? e.setMark(this.name, { color: n }) : e.unsetMark(this.name)
149
+ setBackgroundColor: (n) => ({ commands: t }) => n !== C.backgroundColor.default ? t.setMark(this.name, { color: n }) : t.unsetMark(this.name)
150
150
  };
151
151
  }
152
152
  });
153
- function He(n, e = JSON.stringify) {
154
- const t = {};
153
+ function He(n, t = JSON.stringify) {
154
+ const e = {};
155
155
  return n.filter((o) => {
156
- const r = e(o);
157
- return Object.prototype.hasOwnProperty.call(t, r) ? !1 : t[r] = !0;
156
+ const r = t(o);
157
+ return Object.prototype.hasOwnProperty.call(e, r) ? !1 : e[r] = !0;
158
158
  });
159
159
  }
160
160
  function Le(n) {
161
- const e = n.filter(
161
+ const t = n.filter(
162
162
  (o, r) => n.indexOf(o) !== r
163
163
  );
164
- return He(e);
164
+ return He(t);
165
165
  }
166
166
  const j = A.create({
167
167
  name: "uniqueID",
@@ -229,12 +229,12 @@ const j = A.create({
229
229
  // view.dispatch(tr);
230
230
  // },
231
231
  addProseMirrorPlugins() {
232
- let n = null, e = !1;
232
+ let n = null, t = !1;
233
233
  return [
234
- new T({
235
- key: new B("uniqueID"),
236
- appendTransaction: (t, o, r) => {
237
- const i = t.some((f) => f.docChanged) && !o.doc.eq(r.doc), s = this.options.filterTransaction && t.some((f) => {
234
+ new B({
235
+ key: new M("uniqueID"),
236
+ appendTransaction: (e, o, r) => {
237
+ const i = e.some((f) => f.docChanged) && !o.doc.eq(r.doc), s = this.options.filterTransaction && e.some((f) => {
238
238
  let k, v;
239
239
  return !(!((v = (k = this.options).filterTransaction) === null || v === void 0) && v.call(k, f));
240
240
  });
@@ -242,7 +242,7 @@ const j = A.create({
242
242
  return;
243
243
  const { tr: l } = r, { types: a, attributeName: d, generateID: c } = this.options, m = Zt(
244
244
  o.doc,
245
- t
245
+ e
246
246
  ), { mapping: h } = m;
247
247
  if (Qt(m).forEach(({ newRange: f }) => {
248
248
  const k = te(
@@ -252,8 +252,8 @@ const j = A.create({
252
252
  ), v = k.map(({ node: E }) => E.attrs[d]).filter((E) => E !== null), w = Le(v);
253
253
  k.forEach(({ node: E, pos: _ }) => {
254
254
  let y;
255
- const M = (y = l.doc.nodeAt(_)) === null || y === void 0 ? void 0 : y.attrs[d];
256
- if (M === null) {
255
+ const T = (y = l.doc.nodeAt(_)) === null || y === void 0 ? void 0 : y.attrs[d];
256
+ if (T === null) {
257
257
  l.setNodeMarkup(_, void 0, {
258
258
  ...E.attrs,
259
259
  [d]: c()
@@ -261,7 +261,7 @@ const j = A.create({
261
261
  return;
262
262
  }
263
263
  const { deleted: ot } = h.invert().mapResult(_);
264
- ot && w.includes(M) && l.setNodeMarkup(_, void 0, {
264
+ ot && w.includes(T) && l.setNodeMarkup(_, void 0, {
265
265
  ...E.attrs,
266
266
  [d]: c()
267
267
  });
@@ -270,10 +270,10 @@ const j = A.create({
270
270
  return l;
271
271
  },
272
272
  // we register a global drag handler to track the current drag source element
273
- view(t) {
273
+ view(e) {
274
274
  const o = (r) => {
275
275
  let i;
276
- n = !((i = t.dom.parentElement) === null || i === void 0) && i.contains(r.target) ? t.dom.parentElement : null;
276
+ n = !((i = e.dom.parentElement) === null || i === void 0) && i.contains(r.target) ? e.dom.parentElement : null;
277
277
  };
278
278
  return window.addEventListener("dragstart", o), {
279
279
  destroy() {
@@ -287,18 +287,18 @@ const j = A.create({
287
287
  handleDOMEvents: {
288
288
  // only create new ids for dropped content while holding `alt`
289
289
  // or content is dragged from another editor
290
- drop: (t, o) => {
290
+ drop: (e, o) => {
291
291
  let r;
292
- return (n !== t.dom.parentElement || ((r = o.dataTransfer) === null || r === void 0 ? void 0 : r.effectAllowed) === "copy") && (n = null, e = !0), !1;
292
+ return (n !== e.dom.parentElement || ((r = o.dataTransfer) === null || r === void 0 ? void 0 : r.effectAllowed) === "copy") && (n = null, t = !0), !1;
293
293
  },
294
294
  // always create new ids on pasted content
295
- paste: () => (e = !0, !1)
295
+ paste: () => (t = !0, !1)
296
296
  },
297
297
  // we’ll remove ids for every pasted node
298
298
  // so we can create a new one within `appendTransaction`
299
- transformPasted: (t) => {
300
- if (!e)
301
- return t;
299
+ transformPasted: (e) => {
300
+ if (!t)
301
+ return e;
302
302
  const { types: o, attributeName: r } = this.options, i = (s) => {
303
303
  const l = [];
304
304
  return s.forEach((a) => {
@@ -321,10 +321,10 @@ const j = A.create({
321
321
  l.push(d);
322
322
  }), P.from(l);
323
323
  };
324
- return e = !1, new L(
325
- i(t.content),
326
- t.openStart,
327
- t.openEnd
324
+ return t = !1, new L(
325
+ i(e.content),
326
+ e.openStart,
327
+ e.openEnd
328
328
  );
329
329
  }
330
330
  }
@@ -332,15 +332,15 @@ const j = A.create({
332
332
  ];
333
333
  }
334
334
  }), Ne = () => /Mac/.test(navigator.platform) || /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent);
335
- function Mn(n) {
335
+ function Tn(n) {
336
336
  return Ne() ? n.replace("Mod", "⌘") : n.replace("Mod", "Ctrl");
337
337
  }
338
338
  function S(...n) {
339
- return n.filter((e) => e).join(" ");
339
+ return n.filter((t) => t).join(" ");
340
340
  }
341
341
  class Pe extends Error {
342
- constructor(e) {
343
- super(`Unreachable case: ${e}`);
342
+ constructor(t) {
343
+ super(`Unreachable case: ${t}`);
344
344
  }
345
345
  }
346
346
  const yt = /* @__PURE__ */ new Set([
@@ -350,84 +350,84 @@ const yt = /* @__PURE__ */ new Set([
350
350
  "strike",
351
351
  "code"
352
352
  ]), vt = /* @__PURE__ */ new Set(["textColor", "backgroundColor"]);
353
- function at(n, e) {
354
- const t = [];
353
+ function at(n, t) {
354
+ const e = [];
355
355
  for (const [o, r] of Object.entries(n.styles))
356
- yt.has(o) ? t.push(e.mark(o)) : vt.has(o) && t.push(e.mark(o, { color: r }));
356
+ yt.has(o) ? e.push(t.mark(o)) : vt.has(o) && e.push(t.mark(o, { color: r }));
357
357
  return n.text.split(/(\n)/g).filter((o) => o.length > 0).map((o) => o === `
358
- ` ? e.nodes.hardBreak.create() : e.text(o, t));
358
+ ` ? t.nodes.hardBreak.create() : t.text(o, e));
359
359
  }
360
- function De(n, e) {
361
- const t = e.marks.link.create({
360
+ function De(n, t) {
361
+ const e = t.marks.link.create({
362
362
  href: n.href
363
363
  });
364
- return wt(n.content, e).map((o) => {
364
+ return wt(n.content, t).map((o) => {
365
365
  if (o.type.name === "text")
366
- return o.mark([...o.marks, t]);
366
+ return o.mark([...o.marks, e]);
367
367
  if (o.type.name === "hardBreak")
368
368
  return o;
369
369
  throw new Error("unexpected node type");
370
370
  });
371
371
  }
372
- function wt(n, e) {
373
- const t = [];
372
+ function wt(n, t) {
373
+ const e = [];
374
374
  if (typeof n == "string")
375
- return t.push(
376
- ...at({ type: "text", text: n, styles: {} }, e)
377
- ), t;
375
+ return e.push(
376
+ ...at({ type: "text", text: n, styles: {} }, t)
377
+ ), e;
378
378
  for (const o of n)
379
- t.push(...at(o, e));
380
- return t;
379
+ e.push(...at(o, t));
380
+ return e;
381
381
  }
382
- function Ct(n, e) {
383
- const t = [];
382
+ function Ct(n, t) {
383
+ const e = [];
384
384
  for (const o of n)
385
385
  if (o.type === "link")
386
- t.push(...De(o, e));
386
+ e.push(...De(o, t));
387
387
  else if (o.type === "text")
388
- t.push(...wt([o], e));
388
+ e.push(...wt([o], t));
389
389
  else
390
390
  throw new Pe(o);
391
- return t;
391
+ return e;
392
392
  }
393
- function V(n, e) {
394
- let t = n.id;
395
- t === void 0 && (t = j.options.generateID());
393
+ function V(n, t) {
394
+ let e = n.id;
395
+ e === void 0 && (e = j.options.generateID());
396
396
  let o = n.type;
397
397
  o === void 0 && (o = "paragraph");
398
398
  let r;
399
399
  if (!n.content)
400
- r = e.nodes[o].create(n.props);
400
+ r = t.nodes[o].create(n.props);
401
401
  else if (typeof n.content == "string")
402
- r = e.nodes[o].create(
402
+ r = t.nodes[o].create(
403
403
  n.props,
404
- e.text(n.content)
404
+ t.text(n.content)
405
405
  );
406
406
  else {
407
- const l = Ct(n.content, e);
408
- r = e.nodes[o].create(n.props, l);
407
+ const l = Ct(n.content, t);
408
+ r = t.nodes[o].create(n.props, l);
409
409
  }
410
410
  const i = [];
411
411
  if (n.children)
412
412
  for (const l of n.children)
413
- i.push(V(l, e));
414
- const s = e.nodes.blockGroup.create({}, i);
415
- return e.nodes.blockContainer.create(
413
+ i.push(V(l, t));
414
+ const s = t.nodes.blockGroup.create({}, i);
415
+ return t.nodes.blockContainer.create(
416
416
  {
417
- id: t,
417
+ id: e,
418
418
  ...n.props
419
419
  },
420
420
  i.length > 0 ? [r, s] : r
421
421
  );
422
422
  }
423
423
  function Oe(n) {
424
- const e = [];
425
- let t;
424
+ const t = [];
425
+ let e;
426
426
  return n.content.forEach((o) => {
427
427
  if (o.type.name === "hardBreak") {
428
- t ? t.type === "text" ? t.text += `
429
- ` : t.type === "link" && (t.content[t.content.length - 1].text += `
430
- `) : t = {
428
+ e ? e.type === "text" ? e.text += `
429
+ ` : e.type === "link" && (e.content[e.content.length - 1].text += `
430
+ `) : e = {
431
431
  type: "text",
432
432
  text: `
433
433
  `,
@@ -446,7 +446,7 @@ function Oe(n) {
446
446
  r[s.type.name] = s.attrs.color;
447
447
  else
448
448
  throw Error("Mark is of an unrecognized type: " + s.type.name);
449
- t ? t.type === "text" ? i ? (e.push(t), t = {
449
+ e ? e.type === "text" ? i ? (t.push(e), e = {
450
450
  type: "link",
451
451
  href: i.attrs.href,
452
452
  content: [
@@ -456,17 +456,17 @@ function Oe(n) {
456
456
  styles: r
457
457
  }
458
458
  ]
459
- }) : JSON.stringify(t.styles) === JSON.stringify(r) ? t.text += o.textContent : (e.push(t), t = {
459
+ }) : JSON.stringify(e.styles) === JSON.stringify(r) ? e.text += o.textContent : (t.push(e), e = {
460
460
  type: "text",
461
461
  text: o.textContent,
462
462
  styles: r
463
- }) : t.type === "link" && (i ? t.href === i.attrs.href ? JSON.stringify(
464
- t.content[t.content.length - 1].styles
465
- ) === JSON.stringify(r) ? t.content[t.content.length - 1].text += o.textContent : t.content.push({
463
+ }) : e.type === "link" && (i ? e.href === i.attrs.href ? JSON.stringify(
464
+ e.content[e.content.length - 1].styles
465
+ ) === JSON.stringify(r) ? e.content[e.content.length - 1].text += o.textContent : e.content.push({
466
466
  type: "text",
467
467
  text: o.textContent,
468
468
  styles: r
469
- }) : (e.push(t), t = {
469
+ }) : (t.push(e), e = {
470
470
  type: "link",
471
471
  href: i.attrs.href,
472
472
  content: [
@@ -476,11 +476,11 @@ function Oe(n) {
476
476
  styles: r
477
477
  }
478
478
  ]
479
- }) : (e.push(t), t = {
479
+ }) : (t.push(e), e = {
480
480
  type: "text",
481
481
  text: o.textContent,
482
482
  styles: r
483
- })) : i ? t = {
483
+ })) : i ? e = {
484
484
  type: "link",
485
485
  href: i.attrs.href,
486
486
  content: [
@@ -490,19 +490,19 @@ function Oe(n) {
490
490
  styles: r
491
491
  }
492
492
  ]
493
- } : t = {
493
+ } : e = {
494
494
  type: "text",
495
495
  text: o.textContent,
496
496
  styles: r
497
497
  };
498
- }), t && e.push(t), e;
498
+ }), e && t.push(e), t;
499
499
  }
500
- function x(n, e, t) {
500
+ function x(n, t, e) {
501
501
  if (n.type.name !== "blockContainer")
502
502
  throw Error(
503
503
  "Node must be of type blockContainer, but is of type" + n.type.name + "."
504
504
  );
505
- const o = t == null ? void 0 : t.get(n);
505
+ const o = e == null ? void 0 : e.get(n);
506
506
  if (o)
507
507
  return o;
508
508
  const r = bt(n);
@@ -513,7 +513,7 @@ function x(n, e, t) {
513
513
  ...n.attrs,
514
514
  ...r.contentNode.attrs
515
515
  })) {
516
- const h = e[r.contentType.name];
516
+ const h = t[r.contentType.name];
517
517
  if (!h)
518
518
  throw Error(
519
519
  "Block is of an unrecognized type: " + r.contentType.name
@@ -521,10 +521,10 @@ function x(n, e, t) {
521
521
  const p = h.propSchema;
522
522
  c in p ? s[c] = m : c !== "id" && !(c in C) && console.warn("Block has an unrecognized attribute: " + c);
523
523
  }
524
- const l = e[r.contentType.name], a = [];
524
+ const l = t[r.contentType.name], a = [];
525
525
  for (let c = 0; c < r.numChildBlocks; c++)
526
526
  a.push(
527
- x(n.lastChild.child(c), e, t)
527
+ x(n.lastChild.child(c), t, e)
528
528
  );
529
529
  const d = {
530
530
  id: i,
@@ -533,9 +533,9 @@ function x(n, e, t) {
533
533
  content: l.node.config.content === "inline*" ? Oe(r.contentNode) : void 0,
534
534
  children: a
535
535
  };
536
- return t == null || t.set(n, d), d;
536
+ return e == null || e.set(n, d), d;
537
537
  }
538
- const lt = new B("previous-blocks"), Re = {
538
+ const lt = new M("previous-blocks"), Re = {
539
539
  // Numbered List Items
540
540
  index: "index",
541
541
  // Headings
@@ -546,15 +546,15 @@ const lt = new B("previous-blocks"), Re = {
546
546
  "depth-change": "depth-change"
547
547
  }, ze = () => {
548
548
  let n;
549
- return new T({
549
+ return new B({
550
550
  key: lt,
551
- view(e) {
551
+ view(t) {
552
552
  return {
553
- update: async (t, o) => {
553
+ update: async (e, o) => {
554
554
  var r;
555
- ((r = this.key) == null ? void 0 : r.getState(t.state).updatedBlocks.size) > 0 && (n = setTimeout(() => {
556
- t.dispatch(
557
- t.state.tr.setMeta(lt, { clearUpdate: !0 })
555
+ ((r = this.key) == null ? void 0 : r.getState(e.state).updatedBlocks.size) > 0 && (n = setTimeout(() => {
556
+ e.dispatch(
557
+ e.state.tr.setMeta(lt, { clearUpdate: !0 })
558
558
  );
559
559
  }, 0));
560
560
  },
@@ -574,9 +574,9 @@ const lt = new B("previous-blocks"), Re = {
574
574
  updatedBlocks: /* @__PURE__ */ new Set()
575
575
  };
576
576
  },
577
- apply(e, t, o, r) {
578
- if (t.currentTransactionOldBlockAttrs = {}, t.updatedBlocks.clear(), !e.docChanged || o.doc.eq(r.doc))
579
- return t;
577
+ apply(t, e, o, r) {
578
+ if (e.currentTransactionOldBlockAttrs = {}, e.updatedBlocks.clear(), !t.docChanged || o.doc.eq(r.doc))
579
+ return e;
580
580
  const i = {}, s = nt(o.doc, (d) => d.attrs.id), l = new Map(
581
581
  s.map((d) => [d.node.attrs.id, d])
582
582
  ), a = nt(r.doc, (d) => d.attrs.id);
@@ -595,38 +595,38 @@ const lt = new B("previous-blocks"), Re = {
595
595
  type: m.type.name,
596
596
  depth: o.doc.resolve(c.pos).depth
597
597
  };
598
- i[d.node.attrs.id] = f, e.getMeta("numberedListIndexing") && (d.node.attrs.id in t.prevTransactionOldBlockAttrs && (f = t.prevTransactionOldBlockAttrs[d.node.attrs.id]), p.type === "numberedListItem" && (f.index = p.index)), t.currentTransactionOldBlockAttrs[d.node.attrs.id] = f, JSON.stringify(f) !== JSON.stringify(p) && (f["depth-change"] = f.depth - p.depth, t.updatedBlocks.add(d.node.attrs.id));
598
+ i[d.node.attrs.id] = f, t.getMeta("numberedListIndexing") && (d.node.attrs.id in e.prevTransactionOldBlockAttrs && (f = e.prevTransactionOldBlockAttrs[d.node.attrs.id]), p.type === "numberedListItem" && (f.index = p.index)), e.currentTransactionOldBlockAttrs[d.node.attrs.id] = f, JSON.stringify(f) !== JSON.stringify(p) && (f["depth-change"] = f.depth - p.depth, e.updatedBlocks.add(d.node.attrs.id));
599
599
  }
600
600
  }
601
- return t.prevTransactionOldBlockAttrs = i, t;
601
+ return e.prevTransactionOldBlockAttrs = i, e;
602
602
  }
603
603
  },
604
604
  props: {
605
- decorations(e) {
606
- const t = this.getState(e);
607
- if (t.updatedBlocks.size === 0)
605
+ decorations(t) {
606
+ const e = this.getState(t);
607
+ if (e.updatedBlocks.size === 0)
608
608
  return;
609
609
  const o = [];
610
- return e.doc.descendants((r, i) => {
611
- if (!r.attrs.id || !t.updatedBlocks.has(r.attrs.id))
610
+ return t.doc.descendants((r, i) => {
611
+ if (!r.attrs.id || !e.updatedBlocks.has(r.attrs.id))
612
612
  return;
613
- const s = t.currentTransactionOldBlockAttrs[r.attrs.id], l = {};
613
+ const s = e.currentTransactionOldBlockAttrs[r.attrs.id], l = {};
614
614
  for (const [d, c] of Object.entries(s))
615
615
  l["data-prev-" + Re[d]] = c || "none";
616
- const a = W.node(i, i + r.nodeSize, {
616
+ const a = $.node(i, i + r.nodeSize, {
617
617
  ...l
618
618
  });
619
619
  o.push(a);
620
- }), $.create(e.doc, o);
620
+ }), W.create(t.doc, o);
621
621
  }
622
622
  }
623
623
  });
624
- }, Et = "_blockOuter_xo7pf_5", St = "_block_xo7pf_5", Tt = "_reactNodeViewRenderer_xo7pf_17", Mt = "_blockContent_xo7pf_22", Bt = "_blockGroup_xo7pf_42", xt = "_wrapper_xo7pf_226", It = "_addImageButton_xo7pf_234", At = "_addImageButtonIcon_xo7pf_250", _t = "_addImageButtonText_xo7pf_256", Ht = "_imageAndCaptionWrapper_xo7pf_260", Lt = "_imageWrapper_xo7pf_266", Nt = "_image_xo7pf_260", Pt = "_resizeHandle_xo7pf_279", Dt = "_caption_xo7pf_294", Ot = "_isEmpty_xo7pf_300", Rt = "_inlineContent_xo7pf_300", zt = "_isFilter_xo7pf_301", Vt = "_hasAnchor_xo7pf_313", g = {
624
+ }, Et = "_blockOuter_xo7pf_5", St = "_block_xo7pf_5", Bt = "_reactNodeViewRenderer_xo7pf_17", Tt = "_blockContent_xo7pf_22", Mt = "_blockGroup_xo7pf_42", xt = "_wrapper_xo7pf_226", It = "_addImageButton_xo7pf_234", At = "_addImageButtonIcon_xo7pf_250", _t = "_addImageButtonText_xo7pf_256", Ht = "_imageAndCaptionWrapper_xo7pf_260", Lt = "_imageWrapper_xo7pf_266", Nt = "_image_xo7pf_260", Pt = "_resizeHandle_xo7pf_279", Dt = "_caption_xo7pf_294", Ot = "_isEmpty_xo7pf_300", Rt = "_inlineContent_xo7pf_300", zt = "_isFilter_xo7pf_301", Vt = "_hasAnchor_xo7pf_313", g = {
625
625
  blockOuter: Et,
626
626
  block: St,
627
- reactNodeViewRenderer: Tt,
628
- blockContent: Mt,
629
- blockGroup: Bt,
627
+ reactNodeViewRenderer: Bt,
628
+ blockContent: Tt,
629
+ blockGroup: Mt,
630
630
  wrapper: xt,
631
631
  addImageButton: It,
632
632
  addImageButtonIcon: At,
@@ -640,14 +640,14 @@ const lt = new B("previous-blocks"), Re = {
640
640
  inlineContent: Rt,
641
641
  isFilter: zt,
642
642
  hasAnchor: Vt
643
- }, Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
643
+ }, Mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
644
644
  __proto__: null,
645
645
  addImageButton: It,
646
646
  addImageButtonIcon: At,
647
647
  addImageButtonText: _t,
648
648
  block: St,
649
- blockContent: Mt,
650
- blockGroup: Bt,
649
+ blockContent: Tt,
650
+ blockGroup: Mt,
651
651
  blockOuter: Et,
652
652
  caption: Dt,
653
653
  default: g,
@@ -658,7 +658,7 @@ const lt = new B("previous-blocks"), Re = {
658
658
  inlineContent: Rt,
659
659
  isEmpty: Ot,
660
660
  isFilter: zt,
661
- reactNodeViewRenderer: Tt,
661
+ reactNodeViewRenderer: Bt,
662
662
  resizeHandle: Pt,
663
663
  wrapper: xt
664
664
  }, Symbol.toStringTag, { value: "Module" })), Ve = {
@@ -667,14 +667,14 @@ const lt = new B("previous-blocks"), Re = {
667
667
  id: "data-id",
668
668
  depth: "data-depth",
669
669
  depthChange: "data-depth-change"
670
- }, Ue = new B("non-editable-block"), Fe = () => new T({
670
+ }, Ue = new M("non-editable-block"), Fe = () => new B({
671
671
  key: Ue,
672
672
  props: {
673
- handleKeyDown: (n, e) => {
674
- "node" in n.state.selection && e.preventDefault();
673
+ handleKeyDown: (n, t) => {
674
+ "node" in n.state.selection && t.preventDefault();
675
675
  }
676
676
  }
677
- }), We = G.create({
677
+ }), $e = G.create({
678
678
  name: "blockContainer",
679
679
  group: "blockContainer",
680
680
  // A block always contains content, and optionally a blockGroup which contains nested blocks
@@ -689,17 +689,17 @@ const lt = new B("previous-blocks"), Re = {
689
689
  getAttrs: (n) => {
690
690
  if (typeof n == "string")
691
691
  return !1;
692
- const e = {};
693
- for (const [t, o] of Object.entries(Ve))
694
- n.getAttribute(o) && (e[t] = n.getAttribute(o));
695
- return n.getAttribute("data-node-type") === "blockContainer" ? e : !1;
692
+ const t = {};
693
+ for (const [e, o] of Object.entries(Ve))
694
+ n.getAttribute(o) && (t[e] = n.getAttribute(o));
695
+ return n.getAttribute("data-node-type") === "blockContainer" ? t : !1;
696
696
  }
697
697
  }
698
698
  ];
699
699
  },
700
700
  renderHTML({ HTMLAttributes: n }) {
701
- var t;
702
- const e = ((t = this.options.domAttributes) == null ? void 0 : t.blockContainer) || {};
701
+ var e;
702
+ const t = ((e = this.options.domAttributes) == null ? void 0 : e.blockContainer) || {};
703
703
  return [
704
704
  "div",
705
705
  N(n, {
@@ -710,8 +710,8 @@ const lt = new B("previous-blocks"), Re = {
710
710
  "div",
711
711
  N(
712
712
  {
713
- ...e,
714
- class: S(g.block, e.class),
713
+ ...t,
714
+ class: S(g.block, t.class),
715
715
  "data-node-type": this.name
716
716
  },
717
717
  n
@@ -723,66 +723,66 @@ const lt = new B("previous-blocks"), Re = {
723
723
  addCommands() {
724
724
  return {
725
725
  // Creates a new text block at a given position.
726
- BNCreateBlock: (n) => ({ state: e, dispatch: t }) => {
727
- const o = e.schema.nodes.blockContainer.createAndFill();
728
- return t && e.tr.insert(n, o), !0;
726
+ BNCreateBlock: (n) => ({ state: t, dispatch: e }) => {
727
+ const o = t.schema.nodes.blockContainer.createAndFill();
728
+ return e && t.tr.insert(n, o), !0;
729
729
  },
730
730
  // Deletes a block at a given position.
731
- BNDeleteBlock: (n) => ({ state: e, dispatch: t }) => {
732
- const o = b(e.doc, n);
731
+ BNDeleteBlock: (n) => ({ state: t, dispatch: e }) => {
732
+ const o = b(t.doc, n);
733
733
  if (o === void 0)
734
734
  return !1;
735
735
  const { startPos: r, endPos: i } = o;
736
- return t && e.tr.deleteRange(r, i), !0;
736
+ return e && t.tr.deleteRange(r, i), !0;
737
737
  },
738
738
  // Updates a block at a given position.
739
- BNUpdateBlock: (n, e) => ({ state: t, dispatch: o }) => {
740
- const r = b(t.doc, n);
739
+ BNUpdateBlock: (n, t) => ({ state: e, dispatch: o }) => {
740
+ const r = b(e.doc, n);
741
741
  if (r === void 0)
742
742
  return !1;
743
743
  const { startPos: i, endPos: s, node: l, contentNode: a } = r;
744
744
  if (o) {
745
- if (e.children !== void 0) {
745
+ if (t.children !== void 0) {
746
746
  const p = [];
747
- for (const f of e.children)
748
- p.push(V(f, t.schema));
749
- l.childCount === 2 ? t.tr.replace(
747
+ for (const f of t.children)
748
+ p.push(V(f, e.schema));
749
+ l.childCount === 2 ? e.tr.replace(
750
750
  i + a.nodeSize + 1,
751
751
  s - 1,
752
752
  new L(P.from(p), 0, 0)
753
- ) : t.tr.insert(
753
+ ) : e.tr.insert(
754
754
  i + a.nodeSize,
755
- t.schema.nodes.blockGroup.create({}, p)
755
+ e.schema.nodes.blockGroup.create({}, p)
756
756
  );
757
757
  }
758
- if (e.content !== void 0) {
758
+ if (t.content !== void 0) {
759
759
  let p = [];
760
- typeof e.content == "string" ? p.push(t.schema.text(e.content)) : p = Ct(e.content, t.schema), t.tr.replace(
760
+ typeof t.content == "string" ? p.push(e.schema.text(t.content)) : p = Ct(t.content, e.schema), e.tr.replace(
761
761
  i + 1,
762
762
  i + a.nodeSize - 1,
763
763
  new L(P.from(p), 0, 0)
764
764
  );
765
765
  }
766
- const d = a.type.name, c = e.type || d, m = t.schema.nodes[d].spec.content, h = t.schema.nodes[c].spec.content;
767
- m === "inline*" && h === "" ? t.tr.replaceWith(
766
+ const d = a.type.name, c = t.type || d, m = e.schema.nodes[d].spec.content, h = e.schema.nodes[c].spec.content;
767
+ m === "inline*" && h === "" ? e.tr.replaceWith(
768
768
  i,
769
769
  s,
770
- t.schema.nodes[c].create({
770
+ e.schema.nodes[c].create({
771
771
  ...a.attrs,
772
- ...e.props
772
+ ...t.props
773
773
  })
774
774
  ).setSelection(
775
- new mt(t.tr.doc.resolve(i))
776
- ) : t.tr.setNodeMarkup(
775
+ new mt(e.tr.doc.resolve(i))
776
+ ) : e.tr.setNodeMarkup(
777
777
  i,
778
- e.type === void 0 ? void 0 : t.schema.nodes[e.type],
778
+ t.type === void 0 ? void 0 : e.schema.nodes[t.type],
779
779
  {
780
780
  ...a.attrs,
781
- ...e.props
781
+ ...t.props
782
782
  }
783
- ), t.tr.setNodeMarkup(i - 1, void 0, {
783
+ ), e.tr.setNodeMarkup(i - 1, void 0, {
784
784
  ...l.attrs,
785
- ...e.props
785
+ ...t.props
786
786
  });
787
787
  }
788
788
  return !0;
@@ -804,42 +804,42 @@ const lt = new B("previous-blocks"), Re = {
804
804
  // Block2Block3
805
805
  // Block4
806
806
  // Block5
807
- BNMergeBlocks: (n) => ({ state: e, dispatch: t }) => {
808
- const o = e.doc.resolve(n + 1).node().type.name === "blockContainer", r = e.doc.resolve(n - 1).node().type.name === "blockContainer";
807
+ BNMergeBlocks: (n) => ({ state: t, dispatch: e }) => {
808
+ const o = t.doc.resolve(n + 1).node().type.name === "blockContainer", r = t.doc.resolve(n - 1).node().type.name === "blockContainer";
809
809
  if (!o || !r)
810
810
  return !1;
811
811
  const i = b(
812
- e.doc,
812
+ t.doc,
813
813
  n + 1
814
814
  ), { node: s, contentNode: l, startPos: a, endPos: d, depth: c } = i;
815
815
  if (s.childCount === 2) {
816
- const p = e.doc.resolve(
816
+ const p = t.doc.resolve(
817
817
  a + l.nodeSize + 1
818
- ), f = e.doc.resolve(d - 1), k = p.blockRange(f);
819
- t && e.tr.lift(k, c - 1);
818
+ ), f = t.doc.resolve(d - 1), k = p.blockRange(f);
819
+ e && t.tr.lift(k, c - 1);
820
820
  }
821
- let m = n - 1, h = b(e.doc, m);
821
+ let m = n - 1, h = b(t.doc, m);
822
822
  for (; h.numChildBlocks > 0; )
823
- if (m--, h = b(e.doc, m), h === void 0)
823
+ if (m--, h = b(t.doc, m), h === void 0)
824
824
  return !1;
825
- return t && (t(
826
- e.tr.deleteRange(a, a + l.nodeSize).replace(
825
+ return e && (e(
826
+ t.tr.deleteRange(a, a + l.nodeSize).replace(
827
827
  m - 1,
828
828
  a,
829
829
  new L(l.content, 0, 0)
830
830
  ).scrollIntoView()
831
- ), e.tr.setSelection(
832
- new it(e.doc.resolve(m - 1))
831
+ ), t.tr.setSelection(
832
+ new it(t.doc.resolve(m - 1))
833
833
  )), !0;
834
834
  },
835
835
  // Splits a block at a given position. Content after the position is moved to a new block below, at the same
836
836
  // nesting level.
837
- BNSplitBlock: (n, e) => ({ state: t, dispatch: o }) => {
838
- const r = b(t.doc, n);
837
+ BNSplitBlock: (n, t) => ({ state: e, dispatch: o }) => {
838
+ const r = b(e.doc, n);
839
839
  if (r === void 0)
840
840
  return !1;
841
- const { contentNode: i, contentType: s, startPos: l, endPos: a, depth: d } = r, c = t.doc.cut(l + 1, n), m = t.doc.cut(n, a - 1), h = t.schema.nodes.blockContainer.createAndFill(), p = a + 1, f = p + 2;
842
- return o && (t.tr.insert(p, h), t.tr.replace(
841
+ const { contentNode: i, contentType: s, startPos: l, endPos: a, depth: d } = r, c = e.doc.cut(l + 1, n), m = e.doc.cut(n, a - 1), h = e.schema.nodes.blockContainer.createAndFill(), p = a + 1, f = p + 2;
842
+ return o && (e.tr.insert(p, h), e.tr.replace(
843
843
  f,
844
844
  f + 1,
845
845
  m.content.size > 0 ? new L(
@@ -847,14 +847,14 @@ const lt = new B("previous-blocks"), Re = {
847
847
  d + 2,
848
848
  d + 2
849
849
  ) : void 0
850
- ), e && t.tr.setBlockType(
850
+ ), t && e.tr.setBlockType(
851
851
  f,
852
852
  f,
853
- t.schema.node(s).type,
853
+ e.schema.node(s).type,
854
854
  i.attrs
855
- ), t.tr.setSelection(
856
- new it(t.doc.resolve(f))
857
- ), t.tr.replace(
855
+ ), e.tr.setSelection(
856
+ new it(e.doc.resolve(f))
857
+ ), e.tr.replace(
858
858
  l + 1,
859
859
  a - 1,
860
860
  c.content.size > 0 ? new L(
@@ -871,65 +871,85 @@ const lt = new B("previous-blocks"), Re = {
871
871
  },
872
872
  addKeyboardShortcuts() {
873
873
  return {
874
- Backspace: () => this.editor.commands.first(({ commands: t }) => [
874
+ Backspace: () => this.editor.commands.first(({ commands: o }) => [
875
875
  // Deletes the selection if it's not empty.
876
- () => t.deleteSelection(),
876
+ () => o.deleteSelection(),
877
877
  // Undoes an input rule if one was triggered in the last editor state change.
878
- () => t.undoInputRule(),
878
+ () => o.undoInputRule(),
879
879
  // Reverts block content type to a paragraph if the selection is at the start of the block.
880
- () => t.command(({ state: o }) => {
881
- const { contentType: r } = b(
882
- o.doc,
883
- o.selection.from
884
- ), i = o.selection.$anchor.parentOffset === 0, s = r.name === "paragraph";
885
- return i && !s ? t.BNUpdateBlock(o.selection.from, {
880
+ () => o.command(({ state: r }) => {
881
+ const { contentType: i } = b(
882
+ r.doc,
883
+ r.selection.from
884
+ ), s = r.selection.$anchor.parentOffset === 0, l = i.name === "paragraph";
885
+ return s && !l ? o.BNUpdateBlock(r.selection.from, {
886
886
  type: "paragraph",
887
887
  props: {}
888
888
  }) : !1;
889
889
  }),
890
890
  // Removes a level of nesting if the block is indented if the selection is at the start of the block.
891
- () => t.command(({ state: o }) => o.selection.$anchor.parentOffset === 0 ? t.liftListItem("blockContainer") : !1),
891
+ () => o.command(({ state: r }) => r.selection.$anchor.parentOffset === 0 ? o.liftListItem("blockContainer") : !1),
892
892
  // Merges block with the previous one if it isn't indented, isn't the first block in the doc, and the selection
893
893
  // is at the start of the block.
894
- () => t.command(({ state: o }) => {
895
- const { depth: r, startPos: i } = b(
896
- o.doc,
897
- o.selection.from
898
- ), s = o.selection.$anchor.parentOffset === 0, l = o.selection.anchor === o.selection.head, a = i === 2, d = i - 1;
899
- return !a && s && l && r === 2 ? t.BNMergeBlocks(d) : !1;
894
+ () => o.command(({ state: r }) => {
895
+ const { depth: i, startPos: s } = b(
896
+ r.doc,
897
+ r.selection.from
898
+ ), l = r.selection.$anchor.parentOffset === 0, a = r.selection.anchor === r.selection.head, d = s === 2, c = s - 1;
899
+ return !d && l && a && i === 2 ? o.BNMergeBlocks(c) : !1;
900
900
  })
901
901
  ]),
902
- Enter: () => this.editor.commands.first(({ commands: t }) => [
902
+ Delete: () => this.editor.commands.first(({ commands: o }) => [
903
+ // Deletes the selection if it's not empty.
904
+ () => o.deleteSelection(),
905
+ // Merges block with the next one (at the same nesting level or lower),
906
+ // if one exists, the block has no children, and the selection is at the
907
+ // end of the block.
908
+ () => o.command(({ state: r }) => {
909
+ const { node: i, contentNode: s, depth: l, endPos: a } = b(
910
+ r.doc,
911
+ r.selection.from
912
+ ), d = r.selection.$anchor.parentOffset === s.firstChild.nodeSize, c = r.selection.anchor === r.selection.head, m = i.childCount === 2;
913
+ if (d && c && !m) {
914
+ let h = l, p = a + 2, f = r.doc.resolve(p).depth;
915
+ for (; f < h; )
916
+ h = f, p += 2, f = r.doc.resolve(p).depth;
917
+ return o.BNMergeBlocks(p - 1);
918
+ }
919
+ return !1;
920
+ })
921
+ ]),
922
+ Enter: () => this.editor.commands.first(({ commands: o }) => [
903
923
  // Removes a level of nesting if the block is empty & indented, while the selection is also empty & at the start
904
924
  // of the block.
905
- () => t.command(({ state: o }) => {
906
- const { node: r, depth: i } = b(
907
- o.doc,
908
- o.selection.from
909
- ), s = o.selection.$anchor.parentOffset === 0, l = o.selection.anchor === o.selection.head, a = r.textContent.length === 0, d = i > 2;
910
- return s && l && a && d ? t.liftListItem("blockContainer") : !1;
925
+ () => o.command(({ state: r }) => {
926
+ const { node: i, depth: s } = b(
927
+ r.doc,
928
+ r.selection.from
929
+ ), l = r.selection.$anchor.parentOffset === 0, a = r.selection.anchor === r.selection.head, d = i.textContent.length === 0, c = s > 2;
930
+ return l && a && d && c ? o.liftListItem("blockContainer") : !1;
911
931
  }),
912
932
  // Creates a new block and moves the selection to it if the current one is empty, while the selection is also
913
933
  // empty & at the start of the block.
914
- () => t.command(({ state: o, chain: r }) => {
915
- const { node: i, endPos: s } = b(
916
- o.doc,
917
- o.selection.from
918
- ), l = o.selection.$anchor.parentOffset === 0, a = o.selection.anchor === o.selection.head, d = i.textContent.length === 0;
919
- if (l && a && d) {
920
- const c = s + 1, m = c + 2;
921
- return r().BNCreateBlock(c).setTextSelection(m).run(), !0;
934
+ () => o.command(({ state: r, chain: i }) => {
935
+ const { node: s, endPos: l } = b(
936
+ r.doc,
937
+ r.selection.from
938
+ ), a = r.selection.$anchor.parentOffset === 0, d = r.selection.anchor === r.selection.head, c = s.textContent.length === 0;
939
+ if (a && d && c) {
940
+ const m = l + 1, h = m + 2;
941
+ return i().BNCreateBlock(m).setTextSelection(h).run(), !0;
922
942
  }
923
943
  return !1;
924
944
  }),
925
945
  // Splits the current block, moving content inside that's after the cursor to a new text block below. Also
926
946
  // deletes the selection beforehand, if it's not empty.
927
- () => t.command(({ state: o, chain: r }) => {
928
- const { node: i } = b(
929
- o.doc,
930
- o.selection.from
931
- );
932
- return i.textContent.length === 0 ? !1 : (r().deleteSelection().BNSplitBlock(o.selection.from, !1).run(), !0);
947
+ () => o.command(({ state: r, chain: i }) => {
948
+ const { node: s } = b(
949
+ r.doc,
950
+ r.selection.from
951
+ ), l = r.selection.$anchor.parentOffset === 0;
952
+ return s.textContent.length === 0 ? !1 : (i().deleteSelection().BNSplitBlock(r.selection.from, l).run(), !0);
933
953
  })
934
954
  ]),
935
955
  // Always returning true for tab key presses ensures they're not captured by the browser. Otherwise, they blur the
@@ -941,7 +961,7 @@ const lt = new B("previous-blocks"), Re = {
941
961
  )
942
962
  };
943
963
  }
944
- }), $e = G.create({
964
+ }), We = G.create({
945
965
  name: "blockGroup",
946
966
  group: "blockGroup",
947
967
  content: "blockContainer+",
@@ -954,16 +974,16 @@ const lt = new B("previous-blocks"), Re = {
954
974
  ];
955
975
  },
956
976
  renderHTML({ HTMLAttributes: n }) {
957
- var t;
958
- const e = ((t = this.options.domAttributes) == null ? void 0 : t.blockGroup) || {};
977
+ var e;
978
+ const t = ((e = this.options.domAttributes) == null ? void 0 : e.blockGroup) || {};
959
979
  return [
960
980
  "div",
961
981
  N(
962
982
  {
963
- ...e,
983
+ ...t,
964
984
  class: S(
965
985
  g.blockGroup,
966
- e.class
986
+ t.class
967
987
  ),
968
988
  "data-node-type": "blockGroup"
969
989
  },
@@ -977,21 +997,21 @@ const lt = new B("previous-blocks"), Re = {
977
997
  topNode: !0,
978
998
  content: "blockGroup"
979
999
  }), je = (n) => {
980
- const e = Y.fromSchema(n);
1000
+ const t = Y.fromSchema(n);
981
1001
  return new Y(
982
1002
  {
983
- ...e.nodes
1003
+ ...t.nodes
984
1004
  // TODO: If a serializer is defined in the config for a custom block, it
985
1005
  // should be added here. We still need to figure out how the serializer
986
1006
  // should be defined in the custom blocks API though, and implement that,
987
1007
  // before we can do this.
988
1008
  },
989
- e.marks
1009
+ t.marks
990
1010
  );
991
1011
  }, qe = A.create({
992
1012
  addProseMirrorPlugins() {
993
1013
  return [
994
- new T({
1014
+ new B({
995
1015
  props: {
996
1016
  clipboardSerializer: je(this.editor.schema)
997
1017
  }
@@ -1004,16 +1024,16 @@ class U {
1004
1024
  // eslint-disable-next-line @typescript-eslint/ban-types
1005
1025
  u(this, "callbacks", {});
1006
1026
  }
1007
- on(e, t) {
1008
- return this.callbacks[e] || (this.callbacks[e] = []), this.callbacks[e].push(t), () => this.off(e, t);
1027
+ on(t, e) {
1028
+ return this.callbacks[t] || (this.callbacks[t] = []), this.callbacks[t].push(e), () => this.off(t, e);
1009
1029
  }
1010
- emit(e, ...t) {
1011
- const o = this.callbacks[e];
1012
- o && o.forEach((r) => r.apply(this, t));
1030
+ emit(t, ...e) {
1031
+ const o = this.callbacks[t];
1032
+ o && o.forEach((r) => r.apply(this, e));
1013
1033
  }
1014
- off(e, t) {
1015
- const o = this.callbacks[e];
1016
- o && (t ? this.callbacks[e] = o.filter((r) => r !== t) : delete this.callbacks[e]);
1034
+ off(t, e) {
1035
+ const o = this.callbacks[t];
1036
+ o && (e ? this.callbacks[t] = o.filter((r) => r !== e) : delete this.callbacks[t]);
1017
1037
  }
1018
1038
  removeAllListeners() {
1019
1039
  this.callbacks = {};
@@ -1023,28 +1043,28 @@ const Xe = ee(
1023
1043
  (n) => n.type.name === "blockContainer"
1024
1044
  );
1025
1045
  class Ke {
1026
- constructor(e, t, o = () => {
1046
+ constructor(t, e, o = () => {
1027
1047
  }) {
1028
1048
  u(this, "suggestionsMenuState");
1029
1049
  u(this, "updateSuggestionsMenu");
1030
1050
  u(this, "pluginState");
1031
1051
  u(this, "handleScroll", () => {
1032
- var e;
1033
- if ((e = this.suggestionsMenuState) != null && e.show) {
1034
- const t = document.querySelector(
1052
+ var t;
1053
+ if ((t = this.suggestionsMenuState) != null && t.show) {
1054
+ const e = document.querySelector(
1035
1055
  `[data-decoration-id="${this.pluginState.decorationId}"]`
1036
1056
  );
1037
- this.suggestionsMenuState.referencePos = t.getBoundingClientRect(), this.updateSuggestionsMenu();
1057
+ this.suggestionsMenuState.referencePos = e.getBoundingClientRect(), this.updateSuggestionsMenu();
1038
1058
  }
1039
1059
  });
1040
- this.editor = e, this.pluginKey = t, this.pluginState = J(), this.updateSuggestionsMenu = () => {
1060
+ this.editor = t, this.pluginKey = e, this.pluginState = J(), this.updateSuggestionsMenu = () => {
1041
1061
  if (!this.suggestionsMenuState)
1042
1062
  throw new Error("Attempting to update uninitialized suggestions menu");
1043
1063
  o(this.suggestionsMenuState);
1044
1064
  }, document.addEventListener("scroll", this.handleScroll);
1045
1065
  }
1046
- update(e, t) {
1047
- const o = this.pluginKey.getState(t), r = this.pluginKey.getState(e.state), i = !o.active && r.active, s = o.active && !r.active, l = o.active && r.active;
1066
+ update(t, e) {
1067
+ const o = this.pluginKey.getState(e), r = this.pluginKey.getState(t.state), i = !o.active && r.active, s = o.active && !r.active, l = o.active && r.active;
1048
1068
  if (!i && !l && !s)
1049
1069
  return;
1050
1070
  if (this.pluginState = s ? o : r, s || !this.editor.isEditable) {
@@ -1076,21 +1096,21 @@ function J() {
1076
1096
  decorationId: void 0
1077
1097
  };
1078
1098
  }
1079
- const Ye = (n, e, t, o, r = () => [], i = () => {
1099
+ const Ye = (n, t, e, o, r = () => [], i = () => {
1080
1100
  }) => {
1081
1101
  if (o.length !== 1)
1082
1102
  throw new Error("'char' should be a single character");
1083
1103
  let s;
1084
1104
  const l = (a) => {
1085
- a.dispatch(a.state.tr.setMeta(t, { deactivate: !0 }));
1105
+ a.dispatch(a.state.tr.setMeta(e, { deactivate: !0 }));
1086
1106
  };
1087
1107
  return {
1088
- plugin: new T({
1089
- key: t,
1108
+ plugin: new B({
1109
+ key: e,
1090
1110
  view: () => (s = new Ke(
1091
1111
  n,
1092
- t,
1093
- e
1112
+ e,
1113
+ t
1094
1114
  ), s),
1095
1115
  state: {
1096
1116
  // Initialize the plugin's internal state.
@@ -1102,10 +1122,10 @@ const Ye = (n, e, t, o, r = () => [], i = () => {
1102
1122
  var p, f, k, v;
1103
1123
  if (a.getMeta("orderedListIndexing") !== void 0)
1104
1124
  return d;
1105
- if ((p = a.getMeta(t)) != null && p.activate)
1125
+ if ((p = a.getMeta(e)) != null && p.activate)
1106
1126
  return {
1107
1127
  active: !0,
1108
- triggerCharacter: ((f = a.getMeta(t)) == null ? void 0 : f.triggerCharacter) || "",
1128
+ triggerCharacter: ((f = a.getMeta(e)) == null ? void 0 : f.triggerCharacter) || "",
1109
1129
  queryStartPos: m.selection.from,
1110
1130
  items: r(""),
1111
1131
  keyboardHoveredItemIndex: 0,
@@ -1127,15 +1147,15 @@ const Ye = (n, e, t, o, r = () => [], i = () => {
1127
1147
  d.notFoundCount + (m.selection.from - c.selection.from)
1128
1148
  )), // Highlighting text should hide the menu.
1129
1149
  m.selection.from !== m.selection.to || // Transactions with plugin metadata {deactivate: true} should hide the menu.
1130
- (k = a.getMeta(t)) != null && k.deactivate || // Certain mouse events should hide the menu.
1150
+ (k = a.getMeta(e)) != null && k.deactivate || // Certain mouse events should hide the menu.
1131
1151
  // TODO: Change to global mousedown listener.
1132
1152
  a.getMeta("focus") || a.getMeta("blur") || a.getMeta("pointer") || // Moving the caret before the character which triggered the menu should hide it.
1133
1153
  d.active && m.selection.from < d.queryStartPos || // Entering more than 3 characters, after the last query that matched with at least 1 menu item, should hide
1134
1154
  // the menu.
1135
1155
  h.notFoundCount > 3)
1136
1156
  return J();
1137
- if (((v = a.getMeta(t)) == null ? void 0 : v.selectedItemIndexChanged) !== void 0) {
1138
- let w = a.getMeta(t).selectedItemIndexChanged;
1157
+ if (((v = a.getMeta(e)) == null ? void 0 : v.selectedItemIndexChanged) !== void 0) {
1158
+ let w = a.getMeta(e).selectedItemIndexChanged;
1139
1159
  w < 0 ? w = d.items.length - 1 : w >= d.items.length && (w = 0), h.keyboardHoveredItemIndex = w;
1140
1160
  } else
1141
1161
  c.selection.from !== m.selection.from && (h.keyboardHoveredItemIndex = 0);
@@ -1147,7 +1167,7 @@ const Ye = (n, e, t, o, r = () => [], i = () => {
1147
1167
  const c = this.getState(a.state).active;
1148
1168
  if (d.key === o && !c)
1149
1169
  return a.dispatch(
1150
- a.state.tr.insertText(o).scrollIntoView().setMeta(t, {
1170
+ a.state.tr.insertText(o).scrollIntoView().setMeta(e, {
1151
1171
  activate: !0,
1152
1172
  triggerCharacter: o
1153
1173
  })
@@ -1159,22 +1179,22 @@ const Ye = (n, e, t, o, r = () => [], i = () => {
1159
1179
  queryStartPos: h,
1160
1180
  items: p,
1161
1181
  keyboardHoveredItemIndex: f
1162
- } = t.getState(a.state);
1182
+ } = e.getState(a.state);
1163
1183
  return d.key === "ArrowUp" ? (a.dispatch(
1164
- a.state.tr.setMeta(t, {
1184
+ a.state.tr.setMeta(e, {
1165
1185
  selectedItemIndexChanged: f - 1
1166
1186
  })
1167
1187
  ), !0) : d.key === "ArrowDown" ? (a.dispatch(
1168
- a.state.tr.setMeta(t, {
1188
+ a.state.tr.setMeta(e, {
1169
1189
  selectedItemIndexChanged: f + 1
1170
1190
  })
1171
- ), !0) : d.key === "Enter" ? (l(a), n._tiptapEditor.chain().focus().deleteRange({
1191
+ ), !0) : d.key === "Enter" ? (p.length === 0 || (l(a), n._tiptapEditor.chain().focus().deleteRange({
1172
1192
  from: h - m.length,
1173
1193
  to: n._tiptapEditor.state.selection.from
1174
1194
  }).run(), i({
1175
1195
  item: p[f],
1176
1196
  editor: n
1177
- }), !0) : d.key === "Escape" ? (l(a), !0) : !1;
1197
+ })), !0) : d.key === "Escape" ? (l(a), !0) : !1;
1178
1198
  },
1179
1199
  // Setup decorator on the currently active suggestion.
1180
1200
  decorations(a) {
@@ -1184,8 +1204,8 @@ const Ye = (n, e, t, o, r = () => [], i = () => {
1184
1204
  if (h === "") {
1185
1205
  const p = Xe(a.selection);
1186
1206
  if (p)
1187
- return $.create(a.doc, [
1188
- W.node(
1207
+ return W.create(a.doc, [
1208
+ $.node(
1189
1209
  p.pos,
1190
1210
  p.pos + p.node.nodeSize,
1191
1211
  {
@@ -1196,8 +1216,8 @@ const Ye = (n, e, t, o, r = () => [], i = () => {
1196
1216
  )
1197
1217
  ]);
1198
1218
  }
1199
- return $.create(a.doc, [
1200
- W.inline(
1219
+ return W.create(a.doc, [
1220
+ $.inline(
1201
1221
  m - h.length,
1202
1222
  m,
1203
1223
  {
@@ -1220,14 +1240,14 @@ const Ye = (n, e, t, o, r = () => [], i = () => {
1220
1240
  });
1221
1241
  }
1222
1242
  };
1223
- }, tt = new B("SlashMenuPlugin");
1243
+ }, tt = new M("SlashMenuPlugin");
1224
1244
  class Je extends U {
1225
- constructor(t, o) {
1245
+ constructor(e, o) {
1226
1246
  super();
1227
1247
  u(this, "plugin");
1228
1248
  u(this, "itemCallback");
1229
1249
  const r = Ye(
1230
- t,
1250
+ e,
1231
1251
  (i) => {
1232
1252
  this.emit("update", i);
1233
1253
  },
@@ -1242,11 +1262,11 @@ class Je extends U {
1242
1262
  );
1243
1263
  this.plugin = r.plugin, this.itemCallback = r.itemCallback;
1244
1264
  }
1245
- onUpdate(t) {
1246
- return this.on("update", t);
1265
+ onUpdate(e) {
1266
+ return this.on("update", e);
1247
1267
  }
1248
1268
  }
1249
- const Ze = new B("blocknote-placeholder"), Qe = A.create({
1269
+ const Ze = new M("blocknote-placeholder"), Qe = A.create({
1250
1270
  name: "placeholder",
1251
1271
  addOptions() {
1252
1272
  return {
@@ -1262,24 +1282,24 @@ const Ze = new B("blocknote-placeholder"), Qe = A.create({
1262
1282
  },
1263
1283
  addProseMirrorPlugins() {
1264
1284
  return [
1265
- new T({
1285
+ new B({
1266
1286
  key: Ze,
1267
1287
  props: {
1268
1288
  decorations: (n) => {
1269
- const { doc: e, selection: t } = n, o = tt.getState(n), r = this.editor.isEditable || !this.options.showOnlyWhenEditable, { anchor: i } = t, s = [];
1289
+ const { doc: t, selection: e } = n, o = tt.getState(n), r = this.editor.isEditable || !this.options.showOnlyWhenEditable, { anchor: i } = e, s = [];
1270
1290
  if (r)
1271
- return e.descendants((l, a) => {
1291
+ return t.descendants((l, a) => {
1272
1292
  const d = i >= a && i <= a + l.nodeSize, c = !l.isLeaf && !l.childCount;
1273
1293
  if ((d || !this.options.showOnlyCurrent) && c) {
1274
1294
  const m = [this.options.emptyNodeClass];
1275
1295
  this.editor.isEmpty && m.push(this.options.emptyEditorClass), d && m.push(this.options.hasAnchorClass), (o == null ? void 0 : o.triggerCharacter) === "" && (o != null && o.active) && m.push(this.options.isFilterClass);
1276
- const h = W.node(a, a + l.nodeSize, {
1296
+ const h = $.node(a, a + l.nodeSize, {
1277
1297
  class: m.join(" ")
1278
1298
  });
1279
1299
  s.push(h);
1280
1300
  }
1281
1301
  return this.options.includeChildren;
1282
- }), $.create(e, s);
1302
+ }), W.create(t, s);
1283
1303
  }
1284
1304
  }
1285
1305
  })
@@ -1307,18 +1327,18 @@ const Ze = new B("blocknote-placeholder"), Qe = A.create({
1307
1327
  },
1308
1328
  addCommands() {
1309
1329
  return {
1310
- setTextAlignment: (n) => ({ state: e }) => {
1311
- const t = [], o = b(
1312
- e.doc,
1313
- e.selection.from
1330
+ setTextAlignment: (n) => ({ state: t }) => {
1331
+ const e = [], o = b(
1332
+ t.doc,
1333
+ t.selection.from
1314
1334
  );
1315
1335
  if (o === void 0)
1316
1336
  return !1;
1317
1337
  let r = o.startPos;
1318
- for (; r < e.selection.to; )
1319
- e.doc.resolve(r).node().type.spec.group === "blockContent" ? (t.push(r - 1), r += e.doc.resolve(r).node().nodeSize - 1) : r += 1;
1320
- for (const i of t)
1321
- e.tr.setNodeAttribute(i, "textAlignment", n);
1338
+ for (; r < t.selection.to; )
1339
+ t.doc.resolve(r).node().type.spec.group === "blockContent" ? (e.push(r - 1), r += t.doc.resolve(r).node().nodeSize - 1) : r += 1;
1340
+ for (const i of e)
1341
+ t.tr.setNodeAttribute(i, "textAlignment", n);
1322
1342
  return !0;
1323
1343
  }
1324
1344
  };
@@ -1343,9 +1363,9 @@ const Ze = new B("blocknote-placeholder"), Qe = A.create({
1343
1363
  },
1344
1364
  addCommands() {
1345
1365
  return {
1346
- setBlockTextColor: (n, e) => ({ state: t, view: o }) => {
1347
- const r = b(t.doc, n);
1348
- return r === void 0 ? !1 : (t.tr.setNodeAttribute(r.startPos - 1, "textColor", e), o.focus(), !0);
1366
+ setBlockTextColor: (n, t) => ({ state: e, view: o }) => {
1367
+ const r = b(e.doc, n);
1368
+ return r === void 0 ? !1 : (e.tr.setNodeAttribute(r.startPos - 1, "textColor", t), o.focus(), !0);
1349
1369
  }
1350
1370
  };
1351
1371
  }
@@ -1375,17 +1395,17 @@ const Ze = new B("blocknote-placeholder"), Qe = A.create({
1375
1395
  },
1376
1396
  addCommands() {
1377
1397
  return {
1378
- setTextColor: (n) => ({ commands: e }) => n !== C.textColor.default ? e.setMark(this.name, { color: n }) : e.unsetMark(this.name)
1398
+ setTextColor: (n) => ({ commands: t }) => n !== C.textColor.default ? t.setMark(this.name, { color: n }) : t.unsetMark(this.name)
1379
1399
  };
1380
1400
  }
1381
1401
  }), no = A.create({
1382
1402
  name: "trailingNode",
1383
1403
  addProseMirrorPlugins() {
1384
- const n = new B(this.name);
1404
+ const n = new M(this.name);
1385
1405
  return [
1386
- new T({
1406
+ new B({
1387
1407
  key: n,
1388
- appendTransaction: (e, t, o) => {
1408
+ appendTransaction: (t, e, o) => {
1389
1409
  const { doc: r, tr: i, schema: s } = o, l = n.getState(o), a = r.content.size - 2, d = s.nodes.blockContainer, c = s.nodes.paragraph;
1390
1410
  if (l)
1391
1411
  return i.insert(
@@ -1394,12 +1414,12 @@ const Ze = new B("blocknote-placeholder"), Qe = A.create({
1394
1414
  );
1395
1415
  },
1396
1416
  state: {
1397
- init: (e, t) => {
1417
+ init: (t, e) => {
1398
1418
  },
1399
- apply: (e, t) => {
1400
- if (!e.docChanged)
1401
- return t;
1402
- let o = e.doc.lastChild;
1419
+ apply: (t, e) => {
1420
+ if (!t.docChanged)
1421
+ return e;
1422
+ let o = t.doc.lastChild;
1403
1423
  if (!o || o.type.name !== "blockGroup")
1404
1424
  throw new Error("Expected blockGroup");
1405
1425
  if (o = o.lastChild, !o || o.type.name !== "blockContainer")
@@ -1414,8 +1434,8 @@ const Ze = new B("blocknote-placeholder"), Qe = A.create({
1414
1434
  ];
1415
1435
  }
1416
1436
  }), ro = (n) => {
1417
- var t;
1418
- const e = [
1437
+ var e;
1438
+ const t = [
1419
1439
  R.ClipboardTextSerializer,
1420
1440
  R.Commands,
1421
1441
  R.Editable,
@@ -1452,10 +1472,10 @@ const Ze = new B("blocknote-placeholder"), Qe = A.create({
1452
1472
  to,
1453
1473
  // nodes
1454
1474
  Ge,
1455
- We.configure({
1475
+ $e.configure({
1456
1476
  domAttributes: n.domAttributes
1457
1477
  }),
1458
- $e.configure({
1478
+ We.configure({
1459
1479
  domAttributes: n.domAttributes
1460
1480
  }),
1461
1481
  ...Object.values(n.blockSchema).map(
@@ -1471,11 +1491,11 @@ const Ze = new B("blocknote-placeholder"), Qe = A.create({
1471
1491
  no
1472
1492
  ];
1473
1493
  if (n.collaboration) {
1474
- if (e.push(
1494
+ if (t.push(
1475
1495
  ae.configure({
1476
1496
  fragment: n.collaboration.fragment
1477
1497
  })
1478
- ), (t = n.collaboration.provider) != null && t.awareness) {
1498
+ ), (e = n.collaboration.provider) != null && e.awareness) {
1479
1499
  const o = (r) => {
1480
1500
  const i = document.createElement("span");
1481
1501
  i.classList.add(D["collaboration-cursor__caret"]), i.setAttribute("style", `border-color: ${r.color}`);
@@ -1484,7 +1504,7 @@ const Ze = new B("blocknote-placeholder"), Qe = A.create({
1484
1504
  const l = document.createTextNode("⁠"), a = document.createTextNode("⁠");
1485
1505
  return i.insertBefore(l, null), i.insertBefore(s, null), i.insertBefore(a, null), i;
1486
1506
  };
1487
- e.push(
1507
+ t.push(
1488
1508
  le.configure({
1489
1509
  user: n.collaboration.user,
1490
1510
  render: n.collaboration.renderCursor || o,
@@ -1493,25 +1513,25 @@ const Ze = new B("blocknote-placeholder"), Qe = A.create({
1493
1513
  );
1494
1514
  }
1495
1515
  } else
1496
- e.push(pe);
1497
- return e;
1516
+ t.push(pe);
1517
+ return t;
1498
1518
  };
1499
- function et(n, e) {
1500
- let t, o;
1501
- if (e.firstChild.descendants((r, i) => t ? !1 : r.type.name !== "blockContainer" || r.attrs.id !== n ? !0 : (t = r, o = i + 1, !1)), t === void 0 || o === void 0)
1519
+ function et(n, t) {
1520
+ let e, o;
1521
+ if (t.firstChild.descendants((r, i) => e ? !1 : r.type.name !== "blockContainer" || r.attrs.id !== n ? !0 : (e = r, o = i + 1, !1)), e === void 0 || o === void 0)
1502
1522
  throw Error("Could not find block in the editor with matching ID.");
1503
1523
  return {
1504
- node: t,
1524
+ node: e,
1505
1525
  posBeforeNode: o
1506
1526
  };
1507
1527
  }
1508
- function Ut(n, e, t = "before", o) {
1509
- const r = typeof e == "string" ? e : e.id, i = [];
1528
+ function Ut(n, t, e = "before", o) {
1529
+ const r = typeof t == "string" ? t : t.id, i = [];
1510
1530
  for (const d of n)
1511
1531
  i.push(V(d, o.schema));
1512
1532
  let s = -1;
1513
1533
  const { node: l, posBeforeNode: a } = et(r, o.state.doc);
1514
- if (t === "before" && (s = a), t === "after" && (s = a + l.nodeSize), t === "nested") {
1534
+ if (e === "before" && (s = a), e === "after" && (s = a + l.nodeSize), e === "nested") {
1515
1535
  if (l.childCount < 2) {
1516
1536
  s = a + l.firstChild.nodeSize + 1;
1517
1537
  const d = o.state.schema.nodes.blockGroup.create(
@@ -1527,67 +1547,67 @@ function Ut(n, e, t = "before", o) {
1527
1547
  }
1528
1548
  o.view.dispatch(o.state.tr.insert(s, i));
1529
1549
  }
1530
- function io(n, e, t) {
1531
- const o = typeof n == "string" ? n : n.id, { posBeforeNode: r } = et(o, t.state.doc);
1532
- t.commands.BNUpdateBlock(r + 1, e);
1550
+ function io(n, t, e) {
1551
+ const o = typeof n == "string" ? n : n.id, { posBeforeNode: r } = et(o, e.state.doc);
1552
+ e.commands.BNUpdateBlock(r + 1, t);
1533
1553
  }
1534
- function Ft(n, e) {
1535
- const t = new Set(
1554
+ function Ft(n, t) {
1555
+ const e = new Set(
1536
1556
  n.map(
1537
1557
  (r) => typeof r == "string" ? r : r.id
1538
1558
  )
1539
1559
  );
1540
1560
  let o = 0;
1541
- if (e.state.doc.descendants((r, i) => {
1542
- if (t.size === 0)
1561
+ if (t.state.doc.descendants((r, i) => {
1562
+ if (e.size === 0)
1543
1563
  return !1;
1544
- if (r.type.name !== "blockContainer" || !t.has(r.attrs.id))
1564
+ if (r.type.name !== "blockContainer" || !e.has(r.attrs.id))
1545
1565
  return !0;
1546
- t.delete(r.attrs.id);
1547
- const s = e.state.doc.nodeSize;
1548
- e.commands.BNDeleteBlock(i - o + 1);
1549
- const l = e.state.doc.nodeSize;
1566
+ e.delete(r.attrs.id);
1567
+ const s = t.state.doc.nodeSize;
1568
+ t.commands.BNDeleteBlock(i - o + 1);
1569
+ const l = t.state.doc.nodeSize;
1550
1570
  return o += s - l, !1;
1551
- }), t.size > 0) {
1552
- const r = [...t].join(`
1571
+ }), e.size > 0) {
1572
+ const r = [...e].join(`
1553
1573
  `);
1554
1574
  throw Error(
1555
1575
  "Blocks with the following IDs could not be found in the editor: " + r
1556
1576
  );
1557
1577
  }
1558
1578
  }
1559
- function so(n, e, t) {
1560
- Ut(e, n[0], "before", t), Ft(n, t);
1579
+ function so(n, t, e) {
1580
+ Ut(t, n[0], "before", e), Ft(n, e);
1561
1581
  }
1562
1582
  function ao() {
1563
- const n = (e) => {
1564
- let t = e.children.length;
1565
- for (let o = 0; o < t; o++) {
1566
- const r = e.children[o];
1583
+ const n = (t) => {
1584
+ let e = t.children.length;
1585
+ for (let o = 0; o < e; o++) {
1586
+ const r = t.children[o];
1567
1587
  if (r.type === "element" && (n(r), r.tagName === "u"))
1568
1588
  if (r.children.length > 0) {
1569
- e.children.splice(o, 1, ...r.children);
1589
+ t.children.splice(o, 1, ...r.children);
1570
1590
  const i = r.children.length - 1;
1571
- t += i, o += i;
1591
+ e += i, o += i;
1572
1592
  } else
1573
- e.children.splice(o, 1), t--, o--;
1593
+ t.children.splice(o, 1), e--, o--;
1574
1594
  }
1575
1595
  };
1576
1596
  return n;
1577
1597
  }
1578
1598
  function lo(n) {
1579
- const e = /* @__PURE__ */ new Set([
1599
+ const t = /* @__PURE__ */ new Set([
1580
1600
  ...n.orderedListItemBlockTypes,
1581
1601
  ...n.unorderedListItemBlockTypes
1582
- ]), t = (o) => {
1602
+ ]), e = (o) => {
1583
1603
  let r = o.children.length, i;
1584
1604
  for (let s = 0; s < r; s++) {
1585
- const a = o.children[s].children[0], d = a.children[0], c = a.children.length === 2 ? a.children[1] : null, m = e.has(
1605
+ const a = o.children[s].children[0], d = a.children[0], c = a.children.length === 2 ? a.children[1] : null, m = t.has(
1586
1606
  d.properties.dataContentType
1587
1607
  ), h = m ? n.orderedListItemBlockTypes.has(
1588
1608
  d.properties.dataContentType
1589
1609
  ) ? "ol" : "ul" : null;
1590
- if (c !== null && t(c), i && i.tagName !== h) {
1610
+ if (c !== null && e(c), i && i.tagName !== h) {
1591
1611
  o.children.splice(
1592
1612
  s - i.children.length,
1593
1613
  i.children.length,
@@ -1617,74 +1637,85 @@ function lo(n) {
1617
1637
  i
1618
1638
  );
1619
1639
  };
1620
- return t;
1640
+ return e;
1621
1641
  }
1622
- async function Wt(n, e) {
1623
- const t = document.createElement("div"), o = Y.fromSchema(e);
1642
+ async function $t(n, t) {
1643
+ const e = document.createElement("div"), o = Y.fromSchema(t);
1624
1644
  for (const i of n) {
1625
- const s = V(i, e), l = o.serializeNode(s);
1626
- t.appendChild(l);
1645
+ const s = V(i, t), l = o.serializeNode(s);
1646
+ e.appendChild(l);
1627
1647
  }
1628
1648
  return (await Q().use(ft, { fragment: !0 }).use(lo, {
1629
1649
  orderedListItemBlockTypes: /* @__PURE__ */ new Set(["numberedListItem"]),
1630
1650
  unorderedListItemBlockTypes: /* @__PURE__ */ new Set(["bulletListItem"])
1631
- }).use(gt).process(t.innerHTML)).value;
1651
+ }).use(gt).process(e.innerHTML)).value;
1632
1652
  }
1633
- async function $t(n, e, t) {
1653
+ async function Wt(n, t, e) {
1634
1654
  const o = document.createElement("div");
1635
1655
  o.innerHTML = n.trim();
1636
- const i = be.fromSchema(t).parse(o), s = [];
1656
+ const i = be.fromSchema(e).parse(o), s = [];
1637
1657
  for (let l = 0; l < i.firstChild.childCount; l++)
1638
- s.push(x(i.firstChild.child(l), e));
1658
+ s.push(x(i.firstChild.child(l), t));
1639
1659
  return s;
1640
1660
  }
1641
- async function co(n, e) {
1642
- return (await Q().use(ft, { fragment: !0 }).use(ao).use(we).use(kt).use(Te).process(await Wt(n, e))).value;
1661
+ async function co(n, t) {
1662
+ return (await Q().use(ft, { fragment: !0 }).use(ao).use(we).use(kt).use(Be).process(await $t(n, t))).value;
1643
1663
  }
1644
- function uo(n, e) {
1645
- const t = e.value ? e.value + `
1664
+ function uo(n, t) {
1665
+ const e = t.value ? t.value + `
1646
1666
  ` : "", o = {};
1647
- e.lang && (o["data-language"] = e.lang);
1667
+ t.lang && (o["data-language"] = t.lang);
1648
1668
  let r = {
1649
1669
  type: "element",
1650
1670
  tagName: "code",
1651
1671
  properties: o,
1652
- children: [{ type: "text", value: t }]
1672
+ children: [{ type: "text", value: e }]
1653
1673
  };
1654
- return e.meta && (r.data = { meta: e.meta }), n.patch(e, r), r = n.applyData(e, r), r = {
1674
+ return t.meta && (r.data = { meta: t.meta }), n.patch(t, r), r = n.applyData(t, r), r = {
1655
1675
  type: "element",
1656
1676
  tagName: "pre",
1657
1677
  properties: {},
1658
1678
  children: [r]
1659
- }, n.patch(e, r), r;
1679
+ }, n.patch(t, r), r;
1660
1680
  }
1661
- async function po(n, e, t) {
1681
+ async function po(n, t, e) {
1662
1682
  const o = await Q().use(Ce).use(kt).use(Ee, {
1663
1683
  handlers: {
1664
1684
  ...Se,
1665
1685
  code: uo
1666
1686
  }
1667
1687
  }).use(gt).process(n);
1668
- return $t(o.value, e, t);
1688
+ return Wt(o.value, t, e);
1669
1689
  }
1670
1690
  function dt(n) {
1671
1691
  return "data-" + n.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
1672
1692
  }
1673
1693
  function ho(n) {
1674
- const e = {};
1675
- return Object.entries(n.propSchema).forEach(([t, o]) => {
1676
- e[t] = {
1694
+ const t = {};
1695
+ return Object.entries(n.propSchema).forEach(([e, o]) => {
1696
+ t[e] = {
1677
1697
  default: o.default,
1678
1698
  keepOnSplit: !0,
1679
1699
  // Props are displayed in kebab-case as HTML attributes. If a prop's
1680
1700
  // value is the same as its default, we don't display an HTML
1681
1701
  // attribute for it.
1682
- parseHTML: (r) => r.getAttribute(dt(t)),
1683
- renderHTML: (r) => r[t] !== o.default ? {
1684
- [dt(t)]: r[t]
1702
+ parseHTML: (r) => {
1703
+ const i = r.getAttribute(dt(e));
1704
+ if (i === null)
1705
+ return null;
1706
+ if (typeof o.default == "boolean")
1707
+ return i === "true" ? !0 : i === "false" ? !1 : null;
1708
+ if (typeof o.default == "number") {
1709
+ const s = parseFloat(i);
1710
+ return !Number.isNaN(s) && Number.isFinite(s) ? s : null;
1711
+ }
1712
+ return i;
1713
+ },
1714
+ renderHTML: (r) => r[e] !== o.default ? {
1715
+ [dt(e)]: r[e]
1685
1716
  } : {}
1686
1717
  };
1687
- }), e;
1718
+ }), t;
1688
1719
  }
1689
1720
  function mo(n) {
1690
1721
  return [
@@ -1693,17 +1724,17 @@ function mo(n) {
1693
1724
  }
1694
1725
  ];
1695
1726
  }
1696
- function fo(n, e) {
1697
- const t = document.createElement("div");
1698
- t.setAttribute("data-content-type", n.type);
1699
- for (const [r, i] of Object.entries(e))
1700
- t.setAttribute(r, i);
1727
+ function fo(n, t) {
1728
+ const e = document.createElement("div");
1729
+ e.setAttribute("data-content-type", n.type);
1730
+ for (const [r, i] of Object.entries(t))
1731
+ e.setAttribute(r, i);
1701
1732
  let o;
1702
- return n.containsInlineContent ? (o = document.createElement("div"), t.appendChild(o)) : o = void 0, o !== void 0 ? {
1703
- dom: t,
1733
+ return n.containsInlineContent ? (o = document.createElement("div"), e.appendChild(o)) : o = void 0, o !== void 0 ? {
1734
+ dom: e,
1704
1735
  contentDOM: o
1705
1736
  } : {
1706
- dom: t
1737
+ dom: e
1707
1738
  };
1708
1739
  }
1709
1740
  function go(n) {
@@ -1718,11 +1749,11 @@ function go(n) {
1718
1749
  parseHTML() {
1719
1750
  return mo(n);
1720
1751
  },
1721
- renderHTML({ HTMLAttributes: t }) {
1722
- return fo(n, t);
1752
+ renderHTML({ HTMLAttributes: e }) {
1753
+ return fo(n, e);
1723
1754
  },
1724
1755
  addNodeView() {
1725
- return ({ HTMLAttributes: t, getPos: o }) => {
1756
+ return ({ HTMLAttributes: e, getPos: o }) => {
1726
1757
  var p, f;
1727
1758
  const r = document.createElement("div"), i = ((p = this.options.domAttributes) == null ? void 0 : p.blockContent) || {};
1728
1759
  for (const [k, v] of Object.entries(
@@ -1733,7 +1764,7 @@ function go(n) {
1733
1764
  g.blockContent,
1734
1765
  i.class
1735
1766
  ), r.setAttribute("data-content-type", n.type);
1736
- for (const [k, v] of Object.entries(t))
1767
+ for (const [k, v] of Object.entries(e))
1737
1768
  r.setAttribute(k, v);
1738
1769
  const s = this.options.editor;
1739
1770
  if (typeof o == "boolean")
@@ -1799,8 +1830,8 @@ const ko = {
1799
1830
  return [
1800
1831
  ...[1, 2, 3].map((n) => new Z({
1801
1832
  find: new RegExp(`^(#{${n}})\\s$`),
1802
- handler: ({ state: e, chain: t, range: o }) => {
1803
- t().BNUpdateBlock(e.selection.from, {
1833
+ handler: ({ state: t, chain: e, range: o }) => {
1834
+ e().BNUpdateBlock(t.selection.from, {
1804
1835
  type: "heading",
1805
1836
  props: {
1806
1837
  level: n
@@ -1851,16 +1882,16 @@ const ko = {
1851
1882
  }
1852
1883
  ];
1853
1884
  },
1854
- renderHTML({ node: n, HTMLAttributes: e }) {
1885
+ renderHTML({ node: n, HTMLAttributes: t }) {
1855
1886
  var r, i;
1856
- const t = ((r = this.options.domAttributes) == null ? void 0 : r.blockContent) || {}, o = ((i = this.options.domAttributes) == null ? void 0 : i.inlineContent) || {};
1887
+ const e = ((r = this.options.domAttributes) == null ? void 0 : r.blockContent) || {}, o = ((i = this.options.domAttributes) == null ? void 0 : i.inlineContent) || {};
1857
1888
  return [
1858
1889
  "div",
1859
- N(e, {
1860
- ...t,
1890
+ N(t, {
1891
+ ...e,
1861
1892
  class: S(
1862
1893
  g.blockContent,
1863
- t.class
1894
+ e.class
1864
1895
  ),
1865
1896
  "data-content-type": this.name
1866
1897
  }),
@@ -1881,14 +1912,14 @@ const ko = {
1881
1912
  node: bo,
1882
1913
  propSchema: ko
1883
1914
  }, Gt = (n) => {
1884
- const { node: e, contentType: t } = b(
1915
+ const { node: t, contentType: e } = b(
1885
1916
  n.state.doc,
1886
1917
  n.state.selection.from
1887
1918
  ), o = n.state.selection.anchor === n.state.selection.head;
1888
- return !t.name.endsWith("ListItem") || !o ? !1 : n.commands.first(({ state: r, chain: i, commands: s }) => [
1919
+ return !e.name.endsWith("ListItem") || !o ? !1 : n.commands.first(({ state: r, chain: i, commands: s }) => [
1889
1920
  () => (
1890
1921
  // Changes list item block to a text block if the content is empty.
1891
- s.command(() => e.textContent.length === 0 ? s.BNUpdateBlock(r.selection.from, {
1922
+ s.command(() => t.textContent.length === 0 ? s.BNUpdateBlock(r.selection.from, {
1892
1923
  type: "paragraph",
1893
1924
  props: {}
1894
1925
  }) : !1)
@@ -1896,7 +1927,7 @@ const ko = {
1896
1927
  () => (
1897
1928
  // Splits the current block, moving content inside that's after the cursor to a new block of the same type
1898
1929
  // below.
1899
- s.command(() => e.textContent.length > 0 ? (i().deleteSelection().BNSplitBlock(r.selection.from, !0).run(), !0) : !1)
1930
+ s.command(() => t.textContent.length > 0 ? (i().deleteSelection().BNSplitBlock(r.selection.from, !0).run(), !0) : !1)
1900
1931
  )
1901
1932
  ]);
1902
1933
  }, vo = {
@@ -1909,11 +1940,11 @@ const ko = {
1909
1940
  // Creates an unordered list when starting with "-", "+", or "*".
1910
1941
  new Z({
1911
1942
  find: new RegExp("^[-+*]\\s$"),
1912
- handler: ({ state: n, chain: e, range: t }) => {
1913
- e().BNUpdateBlock(n.selection.from, {
1943
+ handler: ({ state: n, chain: t, range: e }) => {
1944
+ t().BNUpdateBlock(n.selection.from, {
1914
1945
  type: "bulletListItem",
1915
1946
  props: {}
1916
- }).deleteRange({ from: t.from, to: t.to });
1947
+ }).deleteRange({ from: e.from, to: e.to });
1917
1948
  }
1918
1949
  })
1919
1950
  ];
@@ -1935,8 +1966,8 @@ const ko = {
1935
1966
  getAttrs: (n) => {
1936
1967
  if (typeof n == "string")
1937
1968
  return !1;
1938
- const e = n.parentElement;
1939
- return e === null ? !1 : e.tagName === "UL" ? {} : !1;
1969
+ const t = n.parentElement;
1970
+ return t === null ? !1 : t.tagName === "UL" ? {} : !1;
1940
1971
  },
1941
1972
  node: "bulletListItem"
1942
1973
  },
@@ -1946,8 +1977,8 @@ const ko = {
1946
1977
  getAttrs: (n) => {
1947
1978
  if (typeof n == "string")
1948
1979
  return !1;
1949
- const e = n.parentElement;
1950
- return e === null ? !1 : e.getAttribute("data-content-type") === "bulletListItem" ? {} : !1;
1980
+ const t = n.parentElement;
1981
+ return t === null ? !1 : t.getAttribute("data-content-type") === "bulletListItem" ? {} : !1;
1951
1982
  },
1952
1983
  priority: 300,
1953
1984
  node: "bulletListItem"
@@ -1956,24 +1987,24 @@ const ko = {
1956
1987
  },
1957
1988
  renderHTML({ HTMLAttributes: n }) {
1958
1989
  var o, r;
1959
- const e = ((o = this.options.domAttributes) == null ? void 0 : o.blockContent) || {}, t = ((r = this.options.domAttributes) == null ? void 0 : r.inlineContent) || {};
1990
+ const t = ((o = this.options.domAttributes) == null ? void 0 : o.blockContent) || {}, e = ((r = this.options.domAttributes) == null ? void 0 : r.inlineContent) || {};
1960
1991
  return [
1961
1992
  "div",
1962
1993
  N(n, {
1963
- ...e,
1994
+ ...t,
1964
1995
  class: S(
1965
1996
  g.blockContent,
1966
- e.class
1997
+ t.class
1967
1998
  ),
1968
1999
  "data-content-type": this.name
1969
2000
  }),
1970
2001
  [
1971
2002
  "p",
1972
2003
  {
1973
- ...t,
2004
+ ...e,
1974
2005
  class: S(
1975
2006
  g.inlineContent,
1976
- t.class
2007
+ e.class
1977
2008
  )
1978
2009
  },
1979
2010
  0
@@ -1983,13 +2014,13 @@ const ko = {
1983
2014
  }), Co = {
1984
2015
  node: wo,
1985
2016
  propSchema: vo
1986
- }, Eo = new B("numbered-list-indexing"), So = () => new T({
2017
+ }, Eo = new M("numbered-list-indexing"), So = () => new B({
1987
2018
  key: Eo,
1988
- appendTransaction: (n, e, t) => {
1989
- const o = t.tr;
2019
+ appendTransaction: (n, t, e) => {
2020
+ const o = e.tr;
1990
2021
  o.setMeta("numberedListIndexing", !0);
1991
2022
  let r = !1;
1992
- return t.doc.descendants((i, s) => {
2023
+ return e.doc.descendants((i, s) => {
1993
2024
  if (i.type.name === "blockContainer" && i.firstChild.type.name === "numberedListItem") {
1994
2025
  let l = "1";
1995
2026
  const a = s === 1, d = b(o.doc, s + 1);
@@ -2013,9 +2044,9 @@ const ko = {
2013
2044
  }
2014
2045
  }), r ? o : null;
2015
2046
  }
2016
- }), To = {
2047
+ }), Bo = {
2017
2048
  ...C
2018
- }, Mo = F({
2049
+ }, To = F({
2019
2050
  name: "numberedListItem",
2020
2051
  content: "inline*",
2021
2052
  addAttributes() {
@@ -2034,11 +2065,11 @@ const ko = {
2034
2065
  // Creates an ordered list when starting with "1.".
2035
2066
  new Z({
2036
2067
  find: new RegExp("^1\\.\\s$"),
2037
- handler: ({ state: n, chain: e, range: t }) => {
2038
- e().BNUpdateBlock(n.selection.from, {
2068
+ handler: ({ state: n, chain: t, range: e }) => {
2069
+ t().BNUpdateBlock(n.selection.from, {
2039
2070
  type: "numberedListItem",
2040
2071
  props: {}
2041
- }).deleteRange({ from: t.from, to: t.to });
2072
+ }).deleteRange({ from: e.from, to: e.to });
2042
2073
  }
2043
2074
  })
2044
2075
  ];
@@ -2064,8 +2095,8 @@ const ko = {
2064
2095
  getAttrs: (n) => {
2065
2096
  if (typeof n == "string")
2066
2097
  return !1;
2067
- const e = n.parentElement;
2068
- return e === null ? !1 : e.tagName === "OL" ? {} : !1;
2098
+ const t = n.parentElement;
2099
+ return t === null ? !1 : t.tagName === "OL" ? {} : !1;
2069
2100
  },
2070
2101
  node: "numberedListItem"
2071
2102
  },
@@ -2076,8 +2107,8 @@ const ko = {
2076
2107
  getAttrs: (n) => {
2077
2108
  if (typeof n == "string")
2078
2109
  return !1;
2079
- const e = n.parentElement;
2080
- return e === null ? !1 : e.getAttribute("data-content-type") === "numberedListItem" ? {} : !1;
2110
+ const t = n.parentElement;
2111
+ return t === null ? !1 : t.getAttribute("data-content-type") === "numberedListItem" ? {} : !1;
2081
2112
  },
2082
2113
  priority: 300,
2083
2114
  node: "numberedListItem"
@@ -2086,14 +2117,14 @@ const ko = {
2086
2117
  },
2087
2118
  renderHTML({ HTMLAttributes: n }) {
2088
2119
  var o, r;
2089
- const e = ((o = this.options.domAttributes) == null ? void 0 : o.blockContent) || {}, t = ((r = this.options.domAttributes) == null ? void 0 : r.inlineContent) || {};
2120
+ const t = ((o = this.options.domAttributes) == null ? void 0 : o.blockContent) || {}, e = ((r = this.options.domAttributes) == null ? void 0 : r.inlineContent) || {};
2090
2121
  return [
2091
2122
  "div",
2092
2123
  N(n, {
2093
- ...e,
2124
+ ...t,
2094
2125
  class: S(
2095
2126
  g.blockContent,
2096
- e.class
2127
+ t.class
2097
2128
  ),
2098
2129
  "data-content-type": this.name
2099
2130
  }),
@@ -2102,19 +2133,19 @@ const ko = {
2102
2133
  [
2103
2134
  "p",
2104
2135
  {
2105
- ...t,
2136
+ ...e,
2106
2137
  class: S(
2107
2138
  g.inlineContent,
2108
- t.class
2139
+ e.class
2109
2140
  )
2110
2141
  },
2111
2142
  0
2112
2143
  ]
2113
2144
  ];
2114
2145
  }
2115
- }), Bo = {
2116
- node: Mo,
2117
- propSchema: To
2146
+ }), Mo = {
2147
+ node: To,
2148
+ propSchema: Bo
2118
2149
  }, xo = {
2119
2150
  ...C
2120
2151
  }, Io = F({
@@ -2131,15 +2162,15 @@ const ko = {
2131
2162
  },
2132
2163
  renderHTML({ HTMLAttributes: n }) {
2133
2164
  var o, r;
2134
- const e = ((o = this.options.domAttributes) == null ? void 0 : o.blockContent) || {}, t = ((r = this.options.domAttributes) == null ? void 0 : r.inlineContent) || {};
2165
+ const t = ((o = this.options.domAttributes) == null ? void 0 : o.blockContent) || {}, e = ((r = this.options.domAttributes) == null ? void 0 : r.inlineContent) || {};
2135
2166
  return [
2136
2167
  "div",
2137
2168
  N(
2138
2169
  {
2139
- ...e,
2170
+ ...t,
2140
2171
  class: S(
2141
2172
  g.blockContent,
2142
- e.class
2173
+ t.class
2143
2174
  ),
2144
2175
  "data-content-type": this.name
2145
2176
  },
@@ -2148,10 +2179,10 @@ const ko = {
2148
2179
  [
2149
2180
  "p",
2150
2181
  {
2151
- ...t,
2182
+ ...e,
2152
2183
  class: S(
2153
2184
  g.inlineContent,
2154
- t.class
2185
+ e.class
2155
2186
  )
2156
2187
  },
2157
2188
  0
@@ -2163,45 +2194,45 @@ const ko = {
2163
2194
  propSchema: xo
2164
2195
  };
2165
2196
  class _o {
2166
- constructor(e, t, o) {
2197
+ constructor(t, e, o) {
2167
2198
  u(this, "imageToolbarState");
2168
2199
  u(this, "updateImageToolbar");
2169
2200
  u(this, "prevWasEditable", null);
2170
- u(this, "shouldShow", (e) => "node" in e.selection && e.selection.node.type.name === "image" && e.selection.node.attrs.src === "");
2201
+ u(this, "shouldShow", (t) => "node" in t.selection && t.selection.node.type.name === "image" && t.selection.node.attrs.src === "");
2171
2202
  u(this, "mouseDownHandler", () => {
2172
- var e;
2173
- (e = this.imageToolbarState) != null && e.show && (this.imageToolbarState.show = !1, this.updateImageToolbar());
2203
+ var t;
2204
+ (t = this.imageToolbarState) != null && t.show && (this.imageToolbarState.show = !1, this.updateImageToolbar());
2174
2205
  });
2175
2206
  // For dragging the whole editor.
2176
2207
  u(this, "dragstartHandler", () => {
2177
- var e;
2178
- (e = this.imageToolbarState) != null && e.show && (this.imageToolbarState.show = !1, this.updateImageToolbar());
2208
+ var t;
2209
+ (t = this.imageToolbarState) != null && t.show && (this.imageToolbarState.show = !1, this.updateImageToolbar());
2179
2210
  });
2180
- u(this, "blurHandler", (e) => {
2211
+ u(this, "blurHandler", (t) => {
2181
2212
  var o;
2182
- const t = this.pmView.dom.parentElement;
2213
+ const e = this.pmView.dom.parentElement;
2183
2214
  // An element is clicked.
2184
- e && e.relatedTarget && // Element is inside the editor.
2185
- (t === e.relatedTarget || t.contains(e.relatedTarget)) || (o = this.imageToolbarState) != null && o.show && (this.imageToolbarState.show = !1, this.updateImageToolbar());
2215
+ t && t.relatedTarget && // Element is inside the editor.
2216
+ (e === t.relatedTarget || e.contains(t.relatedTarget)) || (o = this.imageToolbarState) != null && o.show && (this.imageToolbarState.show = !1, this.updateImageToolbar());
2186
2217
  });
2187
2218
  u(this, "scrollHandler", () => {
2188
- var e;
2189
- if ((e = this.imageToolbarState) != null && e.show) {
2190
- const t = document.querySelector(
2219
+ var t;
2220
+ if ((t = this.imageToolbarState) != null && t.show) {
2221
+ const e = document.querySelector(
2191
2222
  `[data-node-type="blockContainer"][data-id="${this.imageToolbarState.block.id}"]`
2192
2223
  );
2193
- this.imageToolbarState.referencePos = t.getBoundingClientRect(), this.updateImageToolbar();
2224
+ this.imageToolbarState.referencePos = e.getBoundingClientRect(), this.updateImageToolbar();
2194
2225
  }
2195
2226
  });
2196
- this.pluginKey = e, this.pmView = t, this.updateImageToolbar = () => {
2227
+ this.pluginKey = t, this.pmView = e, this.updateImageToolbar = () => {
2197
2228
  if (!this.imageToolbarState)
2198
2229
  throw new Error("Attempting to update uninitialized image toolbar");
2199
2230
  o(this.imageToolbarState);
2200
- }, t.dom.addEventListener("mousedown", this.mouseDownHandler), t.dom.addEventListener("dragstart", this.dragstartHandler), t.dom.addEventListener("blur", this.blurHandler), document.addEventListener("scroll", this.scrollHandler);
2231
+ }, e.dom.addEventListener("mousedown", this.mouseDownHandler), e.dom.addEventListener("dragstart", this.dragstartHandler), e.dom.addEventListener("blur", this.blurHandler), document.addEventListener("scroll", this.scrollHandler);
2201
2232
  }
2202
- update(e, t) {
2233
+ update(t, e) {
2203
2234
  var r, i;
2204
- const o = this.pluginKey.getState(e.state);
2235
+ const o = this.pluginKey.getState(t.state);
2205
2236
  if (!((r = this.imageToolbarState) != null && r.show) && o.block) {
2206
2237
  const s = document.querySelector(
2207
2238
  `[data-node-type="blockContainer"][data-id="${o.block.id}"]`
@@ -2213,19 +2244,19 @@ class _o {
2213
2244
  }, this.updateImageToolbar();
2214
2245
  return;
2215
2246
  }
2216
- (!e.state.selection.eq(t.selection) || !e.state.doc.eq(t.doc)) && (i = this.imageToolbarState) != null && i.show && (this.imageToolbarState.show = !1, this.updateImageToolbar());
2247
+ (!t.state.selection.eq(e.selection) || !t.state.doc.eq(e.doc)) && (i = this.imageToolbarState) != null && i.show && (this.imageToolbarState.show = !1, this.updateImageToolbar());
2217
2248
  }
2218
2249
  destroy() {
2219
2250
  this.pmView.dom.removeEventListener("mousedown", this.mouseDownHandler), this.pmView.dom.removeEventListener("dragstart", this.dragstartHandler), this.pmView.dom.removeEventListener("blur", this.blurHandler), document.removeEventListener("scroll", this.scrollHandler);
2220
2251
  }
2221
2252
  }
2222
- const z = new B("ImageToolbarPlugin");
2253
+ const z = new M("ImageToolbarPlugin");
2223
2254
  class Ho extends U {
2224
- constructor(t) {
2255
+ constructor(e) {
2225
2256
  super();
2226
2257
  u(this, "view");
2227
2258
  u(this, "plugin");
2228
- this.plugin = new T({
2259
+ this.plugin = new B({
2229
2260
  key: z,
2230
2261
  view: (o) => (this.view = new _o(
2231
2262
  // editor,
@@ -2248,8 +2279,8 @@ class Ho extends U {
2248
2279
  }
2249
2280
  });
2250
2281
  }
2251
- onUpdate(t) {
2252
- return this.on("update", t);
2282
+ onUpdate(e) {
2283
+ return this.on("update", e);
2253
2284
  }
2254
2285
  }
2255
2286
  const Lo = {
@@ -2278,9 +2309,9 @@ const Lo = {
2278
2309
  default:
2279
2310
  return "flex-start";
2280
2311
  }
2281
- }, ut = 64, No = (n, e) => {
2282
- const t = document.createElement("div");
2283
- t.className = g.wrapper, t.style.alignItems = ct(
2312
+ }, ut = 64, No = (n, t) => {
2313
+ const e = document.createElement("div");
2314
+ e.className = g.wrapper, e.style.alignItems = ct(
2284
2315
  n.props.textAlignment
2285
2316
  );
2286
2317
  const o = document.createElement("div");
@@ -2296,7 +2327,7 @@ const Lo = {
2296
2327
  const a = document.createElement("img");
2297
2328
  a.className = g.image, a.src = n.props.url, a.alt = "placeholder", a.contentEditable = "false", a.draggable = !1, a.style.width = `${Math.min(
2298
2329
  n.props.width,
2299
- e.domElement.firstElementChild.clientWidth
2330
+ t.domElement.firstElementChild.clientWidth
2300
2331
  )}px`;
2301
2332
  const d = document.createElement("div");
2302
2333
  d.className = g.resizeHandle, d.style.left = "4px";
@@ -2306,20 +2337,20 @@ const Lo = {
2306
2337
  m.className = g.caption, m.innerText = n.props.caption, m.style.padding = n.props.caption ? "4px" : "";
2307
2338
  const h = () => {
2308
2339
  var q;
2309
- const y = ((q = e.getSelection()) == null ? void 0 : q.blocks) || [];
2310
- [e.getTextCursorPosition().block, ...y].find(
2340
+ const y = ((q = t.getSelection()) == null ? void 0 : q.blocks) || [];
2341
+ [t.getTextCursorPosition().block, ...y].find(
2311
2342
  (Kt) => Kt.id === n.id
2312
2343
  ) !== void 0 ? (o.style.outline = "4px solid rgb(100, 160, 255)", s.style.outline = "4px solid rgb(100, 160, 255)") : (o.style.outline = "", s.style.outline = "");
2313
2344
  };
2314
- e.onEditorContentChange(h), e.onEditorSelectionChange(h);
2345
+ t.onEditorContentChange(h), t.onEditorSelectionChange(h);
2315
2346
  let p;
2316
2347
  const f = (y) => {
2317
2348
  if (!p)
2318
2349
  return;
2319
- let M;
2320
- ct(n.props.textAlignment) === "center" ? p.handleUsed === "left" ? M = p.initialWidth + (p.initialClientX - y.clientX) * 2 : M = p.initialWidth + (y.clientX - p.initialClientX) * 2 : p.handleUsed === "left" ? M = p.initialWidth + p.initialClientX - y.clientX : M = p.initialWidth + y.clientX - p.initialClientX, M < ut ? a.style.width = `${ut}px` : M > e.domElement.firstElementChild.clientWidth ? a.style.width = `${e.domElement.firstElementChild.clientWidth}px` : a.style.width = `${M}px`;
2350
+ let T;
2351
+ ct(n.props.textAlignment) === "center" ? p.handleUsed === "left" ? T = p.initialWidth + (p.initialClientX - y.clientX) * 2 : T = p.initialWidth + (y.clientX - p.initialClientX) * 2 : p.handleUsed === "left" ? T = p.initialWidth + p.initialClientX - y.clientX : T = p.initialWidth + y.clientX - p.initialClientX, T < ut ? a.style.width = `${ut}px` : T > t.domElement.firstElementChild.clientWidth ? a.style.width = `${t.domElement.firstElementChild.clientWidth}px` : a.style.width = `${T}px`;
2321
2352
  }, k = (y) => {
2322
- p && ((!y.target || !l.contains(y.target)) && l.contains(d) && l.contains(c) && (d.style.display = "none", c.style.display = "none"), p = void 0, e.updateBlock(n, {
2353
+ p && ((!y.target || !l.contains(y.target)) && l.contains(d) && l.contains(c) && (d.style.display = "none", c.style.display = "none"), p = void 0, t.updateBlock(n, {
2323
2354
  type: "image",
2324
2355
  props: {
2325
2356
  // Removes "px" from the end of the width string and converts to float.
@@ -2329,8 +2360,8 @@ const Lo = {
2329
2360
  }, v = (y) => {
2330
2361
  y.preventDefault();
2331
2362
  }, w = () => {
2332
- e._tiptapEditor.view.dispatch(
2333
- e._tiptapEditor.state.tr.setMeta(z, {
2363
+ t._tiptapEditor.view.dispatch(
2364
+ t._tiptapEditor.state.tr.setMeta(z, {
2334
2365
  block: n
2335
2366
  })
2336
2367
  );
@@ -2347,14 +2378,14 @@ const Lo = {
2347
2378
  initialClientX: y.clientX
2348
2379
  };
2349
2380
  };
2350
- return t.appendChild(o), o.appendChild(r), o.appendChild(i), t.appendChild(s), s.appendChild(l), l.appendChild(a), l.appendChild(d), l.appendChild(c), s.appendChild(m), window.addEventListener("mousemove", f), window.addEventListener("mouseup", k), o.addEventListener("mousedown", v), o.addEventListener("click", w), d.addEventListener(
2381
+ return e.appendChild(o), o.appendChild(r), o.appendChild(i), e.appendChild(s), s.appendChild(l), l.appendChild(a), l.appendChild(d), l.appendChild(c), s.appendChild(m), window.addEventListener("mousemove", f), window.addEventListener("mouseup", k), o.addEventListener("mousedown", v), o.addEventListener("click", w), d.addEventListener(
2351
2382
  "mousedown",
2352
2383
  E
2353
2384
  ), c.addEventListener(
2354
2385
  "mousedown",
2355
2386
  _
2356
2387
  ), {
2357
- dom: t,
2388
+ dom: e,
2358
2389
  destroy: () => {
2359
2390
  window.removeEventListener("mousemove", f), window.removeEventListener("mouseup", k), o.removeEventListener(
2360
2391
  "mousedown",
@@ -2377,19 +2408,19 @@ const Lo = {
2377
2408
  paragraph: Ao,
2378
2409
  heading: yo,
2379
2410
  bulletListItem: Co,
2380
- numberedListItem: Bo,
2411
+ numberedListItem: Mo,
2381
2412
  image: Po
2382
2413
  };
2383
2414
  class Do {
2384
- constructor(e, t, o) {
2415
+ constructor(t, e, o) {
2385
2416
  u(this, "formattingToolbarState");
2386
2417
  u(this, "updateFormattingToolbar");
2387
2418
  u(this, "preventHide", !1);
2388
2419
  u(this, "preventShow", !1);
2389
2420
  u(this, "prevWasEditable", null);
2390
- u(this, "shouldShow", ({ view: e, state: t, from: o, to: r }) => {
2391
- const { doc: i, selection: s } = t, { empty: l } = s, a = !i.textBetween(o, r).length && oe(t.selection);
2392
- return !(!e.hasFocus() || l || a);
2421
+ u(this, "shouldShow", ({ view: t, state: e, from: o, to: r }) => {
2422
+ const { doc: i, selection: s } = e, { empty: l } = s, a = !i.textBetween(o, r).length && oe(e.selection);
2423
+ return !(!t.hasFocus() || l || a);
2393
2424
  });
2394
2425
  u(this, "viewMousedownHandler", () => {
2395
2426
  this.preventShow = !0;
@@ -2399,43 +2430,43 @@ class Do {
2399
2430
  });
2400
2431
  // For dragging the whole editor.
2401
2432
  u(this, "dragstartHandler", () => {
2402
- var e;
2403
- (e = this.formattingToolbarState) != null && e.show && (this.formattingToolbarState.show = !1, this.updateFormattingToolbar());
2433
+ var t;
2434
+ (t = this.formattingToolbarState) != null && t.show && (this.formattingToolbarState.show = !1, this.updateFormattingToolbar());
2404
2435
  });
2405
2436
  u(this, "focusHandler", () => {
2406
2437
  setTimeout(() => this.update(this.pmView));
2407
2438
  });
2408
- u(this, "blurHandler", (e) => {
2439
+ u(this, "blurHandler", (t) => {
2409
2440
  var o;
2410
2441
  if (this.preventHide) {
2411
2442
  this.preventHide = !1;
2412
2443
  return;
2413
2444
  }
2414
- const t = this.pmView.dom.parentElement;
2445
+ const e = this.pmView.dom.parentElement;
2415
2446
  // An element is clicked.
2416
- e && e.relatedTarget && // Element is inside the editor.
2417
- (t === e.relatedTarget || t.contains(e.relatedTarget)) || (o = this.formattingToolbarState) != null && o.show && (this.formattingToolbarState.show = !1, this.updateFormattingToolbar());
2447
+ t && t.relatedTarget && // Element is inside the editor.
2448
+ (e === t.relatedTarget || e.contains(t.relatedTarget)) || (o = this.formattingToolbarState) != null && o.show && (this.formattingToolbarState.show = !1, this.updateFormattingToolbar());
2418
2449
  });
2419
2450
  u(this, "scrollHandler", () => {
2420
- var e;
2421
- (e = this.formattingToolbarState) != null && e.show && (this.formattingToolbarState.referencePos = this.getSelectionBoundingBox(), this.updateFormattingToolbar());
2451
+ var t;
2452
+ (t = this.formattingToolbarState) != null && t.show && (this.formattingToolbarState.referencePos = this.getSelectionBoundingBox(), this.updateFormattingToolbar());
2422
2453
  });
2423
- this.editor = e, this.pmView = t, this.updateFormattingToolbar = () => {
2454
+ this.editor = t, this.pmView = e, this.updateFormattingToolbar = () => {
2424
2455
  if (!this.formattingToolbarState)
2425
2456
  throw new Error(
2426
2457
  "Attempting to update uninitialized formatting toolbar"
2427
2458
  );
2428
2459
  o(this.formattingToolbarState);
2429
- }, t.dom.addEventListener("mousedown", this.viewMousedownHandler), t.dom.addEventListener("mouseup", this.viewMouseupHandler), t.dom.addEventListener("dragstart", this.dragstartHandler), t.dom.addEventListener("focus", this.focusHandler), t.dom.addEventListener("blur", this.blurHandler), document.addEventListener("scroll", this.scrollHandler);
2460
+ }, e.dom.addEventListener("mousedown", this.viewMousedownHandler), e.dom.addEventListener("mouseup", this.viewMouseupHandler), e.dom.addEventListener("dragstart", this.dragstartHandler), e.dom.addEventListener("focus", this.focusHandler), e.dom.addEventListener("blur", this.blurHandler), document.addEventListener("scroll", this.scrollHandler);
2430
2461
  }
2431
- update(e, t) {
2462
+ update(t, e) {
2432
2463
  var h, p;
2433
- const { state: o, composing: r } = e, { doc: i, selection: s } = o, l = t && t.doc.eq(i) && t.selection.eq(s);
2464
+ const { state: o, composing: r } = t, { doc: i, selection: s } = o, l = e && e.doc.eq(i) && e.selection.eq(s);
2434
2465
  if ((this.prevWasEditable === null || this.prevWasEditable === this.editor.isEditable) && (r || l))
2435
2466
  return;
2436
2467
  this.prevWasEditable = this.editor.isEditable;
2437
2468
  const { ranges: a } = s, d = Math.min(...a.map((f) => f.$from.pos)), c = Math.max(...a.map((f) => f.$to.pos)), m = (h = this.shouldShow) == null ? void 0 : h.call(this, {
2438
- view: e,
2469
+ view: t,
2439
2470
  state: o,
2440
2471
  from: d,
2441
2472
  to: c
@@ -2456,8 +2487,8 @@ class Do {
2456
2487
  this.pmView.dom.removeEventListener("mousedown", this.viewMousedownHandler), this.pmView.dom.removeEventListener("mouseup", this.viewMouseupHandler), this.pmView.dom.removeEventListener("dragstart", this.dragstartHandler), this.pmView.dom.removeEventListener("focus", this.focusHandler), this.pmView.dom.removeEventListener("blur", this.blurHandler), document.removeEventListener("scroll", this.scrollHandler);
2457
2488
  }
2458
2489
  getSelectionBoundingBox() {
2459
- const { state: e } = this.pmView, { selection: t } = e, { ranges: o } = t, r = Math.min(...o.map((s) => s.$from.pos)), i = Math.max(...o.map((s) => s.$to.pos));
2460
- if (ne(t)) {
2490
+ const { state: t } = this.pmView, { selection: e } = t, { ranges: o } = e, r = Math.min(...o.map((s) => s.$from.pos)), i = Math.max(...o.map((s) => s.$to.pos));
2491
+ if (ne(e)) {
2461
2492
  const s = this.pmView.nodeDOM(r);
2462
2493
  if (s)
2463
2494
  return s.getBoundingClientRect();
@@ -2465,27 +2496,27 @@ class Do {
2465
2496
  return K(this.pmView, r, i);
2466
2497
  }
2467
2498
  }
2468
- const Oo = new B(
2499
+ const Oo = new M(
2469
2500
  "FormattingToolbarPlugin"
2470
2501
  );
2471
2502
  class Ro extends U {
2472
- constructor(t) {
2503
+ constructor(e) {
2473
2504
  super();
2474
2505
  u(this, "view");
2475
2506
  u(this, "plugin");
2476
- this.plugin = new T({
2507
+ this.plugin = new B({
2477
2508
  key: Oo,
2478
- view: (o) => (this.view = new Do(t, o, (r) => {
2509
+ view: (o) => (this.view = new Do(e, o, (r) => {
2479
2510
  this.emit("update", r);
2480
2511
  }), this.view)
2481
2512
  });
2482
2513
  }
2483
- onUpdate(t) {
2484
- return this.on("update", t);
2514
+ onUpdate(e) {
2515
+ return this.on("update", e);
2485
2516
  }
2486
2517
  }
2487
2518
  class zo {
2488
- constructor(e, t, o) {
2519
+ constructor(t, e, o) {
2489
2520
  u(this, "hyperlinkToolbarState");
2490
2521
  u(this, "updateHyperlinkToolbar");
2491
2522
  u(this, "menuUpdateTimer");
@@ -2497,9 +2528,9 @@ class zo {
2497
2528
  u(this, "keyboardHoveredHyperlinkMarkRange");
2498
2529
  u(this, "hyperlinkMark");
2499
2530
  u(this, "hyperlinkMarkRange");
2500
- u(this, "mouseOverHandler", (e) => {
2501
- if (this.mouseHoveredHyperlinkMark = void 0, this.mouseHoveredHyperlinkMarkRange = void 0, this.stopMenuUpdateTimer(), e.target instanceof HTMLAnchorElement && e.target.nodeName === "A") {
2502
- const t = e.target, o = this.pmView.posAtDOM(t, 0) + 1, r = this.pmView.state.doc.resolve(
2531
+ u(this, "mouseOverHandler", (t) => {
2532
+ if (this.mouseHoveredHyperlinkMark = void 0, this.mouseHoveredHyperlinkMarkRange = void 0, this.stopMenuUpdateTimer(), t.target instanceof HTMLAnchorElement && t.target.nodeName === "A") {
2533
+ const e = t.target, o = this.pmView.posAtDOM(e, 0) + 1, r = this.pmView.state.doc.resolve(
2503
2534
  o
2504
2535
  ), i = r.marks();
2505
2536
  for (const s of i)
@@ -2514,23 +2545,23 @@ class zo {
2514
2545
  }
2515
2546
  return this.startMenuUpdateTimer(), !1;
2516
2547
  });
2517
- u(this, "clickHandler", (e) => {
2548
+ u(this, "clickHandler", (t) => {
2518
2549
  var o;
2519
- const t = this.pmView.dom.parentElement;
2550
+ const e = this.pmView.dom.parentElement;
2520
2551
  // Toolbar is open.
2521
2552
  this.hyperlinkMark && // An element is clicked.
2522
- e && e.target && // The clicked element is not the editor.
2523
- !(t === e.target || t.contains(e.target)) && (o = this.hyperlinkToolbarState) != null && o.show && (this.hyperlinkToolbarState.show = !1, this.updateHyperlinkToolbar());
2553
+ t && t.target && // The clicked element is not the editor.
2554
+ !(e === t.target || e.contains(t.target)) && (o = this.hyperlinkToolbarState) != null && o.show && (this.hyperlinkToolbarState.show = !1, this.updateHyperlinkToolbar());
2524
2555
  });
2525
2556
  u(this, "scrollHandler", () => {
2526
- var e;
2527
- this.hyperlinkMark !== void 0 && (e = this.hyperlinkToolbarState) != null && e.show && (this.hyperlinkToolbarState.referencePos = K(
2557
+ var t;
2558
+ this.hyperlinkMark !== void 0 && (t = this.hyperlinkToolbarState) != null && t.show && (this.hyperlinkToolbarState.referencePos = K(
2528
2559
  this.pmView,
2529
2560
  this.hyperlinkMarkRange.from,
2530
2561
  this.hyperlinkMarkRange.to
2531
2562
  ), this.updateHyperlinkToolbar());
2532
2563
  });
2533
- this.editor = e, this.pmView = t, this.updateHyperlinkToolbar = () => {
2564
+ this.editor = t, this.pmView = e, this.updateHyperlinkToolbar = () => {
2534
2565
  if (!this.hyperlinkToolbarState)
2535
2566
  throw new Error("Attempting to update uninitialized hyperlink toolbar");
2536
2567
  o(this.hyperlinkToolbarState);
@@ -2540,34 +2571,34 @@ class zo {
2540
2571
  }, 250);
2541
2572
  }, this.stopMenuUpdateTimer = () => (this.menuUpdateTimer && (clearTimeout(this.menuUpdateTimer), this.menuUpdateTimer = void 0), !1), this.pmView.dom.addEventListener("mouseover", this.mouseOverHandler), document.addEventListener("click", this.clickHandler, !0), document.addEventListener("scroll", this.scrollHandler);
2542
2573
  }
2543
- editHyperlink(e, t) {
2574
+ editHyperlink(t, e) {
2544
2575
  var r;
2545
2576
  const o = this.pmView.state.tr.insertText(
2546
- t,
2577
+ e,
2547
2578
  this.hyperlinkMarkRange.from,
2548
2579
  this.hyperlinkMarkRange.to
2549
2580
  );
2550
2581
  o.addMark(
2551
2582
  this.hyperlinkMarkRange.from,
2552
- this.hyperlinkMarkRange.from + t.length,
2553
- this.pmView.state.schema.mark("link", { href: e })
2583
+ this.hyperlinkMarkRange.from + e.length,
2584
+ this.pmView.state.schema.mark("link", { href: t })
2554
2585
  ), this.pmView.dispatch(o), this.pmView.focus(), (r = this.hyperlinkToolbarState) != null && r.show && (this.hyperlinkToolbarState.show = !1, this.updateHyperlinkToolbar());
2555
2586
  }
2556
2587
  deleteHyperlink() {
2557
- var e;
2588
+ var t;
2558
2589
  this.pmView.dispatch(
2559
2590
  this.pmView.state.tr.removeMark(
2560
2591
  this.hyperlinkMarkRange.from,
2561
2592
  this.hyperlinkMarkRange.to,
2562
2593
  this.hyperlinkMark.type
2563
2594
  ).setMeta("preventAutolink", !0)
2564
- ), this.pmView.focus(), (e = this.hyperlinkToolbarState) != null && e.show && (this.hyperlinkToolbarState.show = !1, this.updateHyperlinkToolbar());
2595
+ ), this.pmView.focus(), (t = this.hyperlinkToolbarState) != null && t.show && (this.hyperlinkToolbarState.show = !1, this.updateHyperlinkToolbar());
2565
2596
  }
2566
2597
  update() {
2567
- var t;
2598
+ var e;
2568
2599
  if (!this.pmView.hasFocus())
2569
2600
  return;
2570
- const e = this.hyperlinkMark;
2601
+ const t = this.hyperlinkMark;
2571
2602
  if (this.hyperlinkMark = void 0, this.hyperlinkMarkRange = void 0, this.keyboardHoveredHyperlinkMark = void 0, this.keyboardHoveredHyperlinkMarkRange = void 0, this.pmView.state.selection.empty) {
2572
2603
  const o = this.pmView.state.selection.$from.marks();
2573
2604
  for (const r of o)
@@ -2596,7 +2627,7 @@ class zo {
2596
2627
  }, this.updateHyperlinkToolbar();
2597
2628
  return;
2598
2629
  }
2599
- if ((t = this.hyperlinkToolbarState) != null && t.show && e && (!this.hyperlinkMark || !this.editor.isEditable)) {
2630
+ if ((e = this.hyperlinkToolbarState) != null && e.show && t && (!this.hyperlinkMark || !this.editor.isEditable)) {
2600
2631
  this.hyperlinkToolbarState.show = !1, this.updateHyperlinkToolbar();
2601
2632
  return;
2602
2633
  }
@@ -2605,19 +2636,19 @@ class zo {
2605
2636
  this.pmView.dom.removeEventListener("mouseover", this.mouseOverHandler), document.removeEventListener("scroll", this.scrollHandler), document.removeEventListener("click", this.clickHandler, !0);
2606
2637
  }
2607
2638
  }
2608
- const Vo = new B(
2639
+ const Vo = new M(
2609
2640
  "HyperlinkToolbarPlugin"
2610
2641
  );
2611
2642
  class Uo extends U {
2612
- constructor(t) {
2643
+ constructor(e) {
2613
2644
  super();
2614
2645
  u(this, "view");
2615
2646
  u(this, "plugin");
2616
2647
  /**
2617
2648
  * Edit the currently hovered hyperlink.
2618
2649
  */
2619
- u(this, "editHyperlink", (t, o) => {
2620
- this.view.editHyperlink(t, o);
2650
+ u(this, "editHyperlink", (e, o) => {
2651
+ this.view.editHyperlink(e, o);
2621
2652
  });
2622
2653
  /**
2623
2654
  * Delete the currently hovered hyperlink.
@@ -2643,46 +2674,46 @@ class Uo extends U {
2643
2674
  u(this, "stopHideTimer", () => {
2644
2675
  this.view.stopMenuUpdateTimer();
2645
2676
  });
2646
- this.plugin = new T({
2677
+ this.plugin = new B({
2647
2678
  key: Vo,
2648
- view: (o) => (this.view = new zo(t, o, (r) => {
2679
+ view: (o) => (this.view = new zo(e, o, (r) => {
2649
2680
  this.emit("update", r);
2650
2681
  }), this.view)
2651
2682
  });
2652
2683
  }
2653
- onUpdate(t) {
2654
- return this.on("update", t);
2684
+ onUpdate(e) {
2685
+ return this.on("update", e);
2655
2686
  }
2656
2687
  }
2657
2688
  class O extends X {
2658
- constructor(t, o) {
2659
- super(t, o);
2689
+ constructor(e, o) {
2690
+ super(e, o);
2660
2691
  u(this, "nodes");
2661
- const r = t.node();
2662
- this.nodes = [], t.doc.nodesBetween(t.pos, o.pos, (i, s, l) => {
2692
+ const r = e.node();
2693
+ this.nodes = [], e.doc.nodesBetween(e.pos, o.pos, (i, s, l) => {
2663
2694
  if (l !== null && l.eq(r))
2664
2695
  return this.nodes.push(i), !1;
2665
2696
  });
2666
2697
  }
2667
- static create(t, o, r = o) {
2668
- return new O(t.resolve(o), t.resolve(r));
2698
+ static create(e, o, r = o) {
2699
+ return new O(e.resolve(o), e.resolve(r));
2669
2700
  }
2670
2701
  content() {
2671
2702
  return new L(P.from(this.nodes), 0, 0);
2672
2703
  }
2673
- eq(t) {
2674
- if (!(t instanceof O) || this.nodes.length !== t.nodes.length || this.from !== t.from || this.to !== t.to)
2704
+ eq(e) {
2705
+ if (!(e instanceof O) || this.nodes.length !== e.nodes.length || this.from !== e.from || this.to !== e.to)
2675
2706
  return !1;
2676
2707
  for (let o = 0; o < this.nodes.length; o++)
2677
- if (!this.nodes[o].eq(t.nodes[o]))
2708
+ if (!this.nodes[o].eq(e.nodes[o]))
2678
2709
  return !1;
2679
2710
  return !0;
2680
2711
  }
2681
- map(t, o) {
2712
+ map(e, o) {
2682
2713
  const r = o.mapResult(this.from), i = o.mapResult(this.to);
2683
- return i.deleted ? X.near(t.resolve(r.pos)) : r.deleted ? X.near(t.resolve(i.pos)) : new O(
2684
- t.resolve(r.pos),
2685
- t.resolve(i.pos)
2714
+ return i.deleted ? X.near(e.resolve(r.pos)) : r.deleted ? X.near(e.resolve(i.pos)) : new O(
2715
+ e.resolve(r.pos),
2716
+ e.resolve(i.pos)
2686
2717
  );
2687
2718
  }
2688
2719
  toJSON() {
@@ -2691,49 +2722,49 @@ class O extends X {
2691
2722
  }
2692
2723
  const Fo = ve.__serializeForClipboard;
2693
2724
  let I;
2694
- function qt(n, e) {
2725
+ function qt(n, t) {
2695
2726
  var r;
2696
- if (!e.dom.isConnected)
2727
+ if (!t.dom.isConnected)
2697
2728
  return;
2698
- const t = e.posAtCoords(n);
2699
- if (!t)
2729
+ const e = t.posAtCoords(n);
2730
+ if (!e)
2700
2731
  return;
2701
- let o = e.domAtPos(t.pos).node;
2702
- if (o !== e.dom) {
2703
- for (; o && o.parentNode && o.parentNode !== e.dom && !((r = o.hasAttribute) != null && r.call(o, "data-id")); )
2732
+ let o = t.domAtPos(e.pos).node;
2733
+ if (o !== t.dom) {
2734
+ for (; o && o.parentNode && o.parentNode !== t.dom && !((r = o.hasAttribute) != null && r.call(o, "data-id")); )
2704
2735
  o = o.parentNode;
2705
2736
  if (o)
2706
2737
  return { node: o, id: o.getAttribute("data-id") };
2707
2738
  }
2708
2739
  }
2709
- function Wo(n, e) {
2710
- const t = qt(n, e);
2711
- if (t && t.node.nodeType === 1) {
2712
- const o = e.docView, r = o.nearestDesc(t.node, !0);
2740
+ function $o(n, t) {
2741
+ const e = qt(n, t);
2742
+ if (e && e.node.nodeType === 1) {
2743
+ const o = t.docView, r = o.nearestDesc(e.node, !0);
2713
2744
  return !r || r === o ? null : r.posBefore;
2714
2745
  }
2715
2746
  return null;
2716
2747
  }
2717
- function $o(n, e) {
2718
- let t, o;
2719
- const r = e.resolve(n.from).node().type.spec.group === "blockContent", i = e.resolve(n.to).node().type.spec.group === "blockContent", s = Math.min(n.$anchor.depth, n.$head.depth);
2748
+ function Wo(n, t) {
2749
+ let e, o;
2750
+ const r = t.resolve(n.from).node().type.spec.group === "blockContent", i = t.resolve(n.to).node().type.spec.group === "blockContent", s = Math.min(n.$anchor.depth, n.$head.depth);
2720
2751
  if (r && i) {
2721
2752
  const l = n.$from.start(s - 1), a = n.$to.end(s - 1);
2722
- t = e.resolve(l - 1).pos, o = e.resolve(a + 1).pos;
2753
+ e = t.resolve(l - 1).pos, o = t.resolve(a + 1).pos;
2723
2754
  } else
2724
- t = n.from, o = n.to;
2725
- return { from: t, to: o };
2755
+ e = n.from, o = n.to;
2756
+ return { from: e, to: o };
2726
2757
  }
2727
- function pt(n, e, t = e) {
2728
- e === t && (t += n.state.doc.resolve(e + 1).node().nodeSize);
2729
- const o = n.domAtPos(e).node.cloneNode(!0), r = n.domAtPos(e).node, i = (c, m) => Array.prototype.indexOf.call(c.children, m), s = i(
2758
+ function pt(n, t, e = t) {
2759
+ t === e && (e += n.state.doc.resolve(t + 1).node().nodeSize);
2760
+ const o = n.domAtPos(t).node.cloneNode(!0), r = n.domAtPos(t).node, i = (c, m) => Array.prototype.indexOf.call(c.children, m), s = i(
2730
2761
  r,
2731
2762
  // Expects from position to be just before the first selected block.
2732
- n.domAtPos(e + 1).node.parentElement
2763
+ n.domAtPos(t + 1).node.parentElement
2733
2764
  ), l = i(
2734
2765
  r,
2735
2766
  // Expects to position to be just after the last selected block.
2736
- n.domAtPos(t - 1).node.parentElement
2767
+ n.domAtPos(e - 1).node.parentElement
2737
2768
  );
2738
2769
  for (let c = r.childElementCount - 1; c >= 0; c--)
2739
2770
  (c > l || c < s) && o.removeChild(o.children[c]);
@@ -2746,27 +2777,27 @@ function pt(n, e, t = e) {
2746
2777
  function Xt() {
2747
2778
  I !== void 0 && (document.body.removeChild(I), I = void 0);
2748
2779
  }
2749
- function Go(n, e) {
2780
+ function Go(n, t) {
2750
2781
  if (!n.dataTransfer)
2751
2782
  return;
2752
- const t = e.dom.getBoundingClientRect(), o = {
2753
- left: t.left + t.width / 2,
2783
+ const e = t.dom.getBoundingClientRect(), o = {
2784
+ left: e.left + e.width / 2,
2754
2785
  // take middle of editor
2755
2786
  top: n.clientY
2756
- }, r = Wo(o, e);
2787
+ }, r = $o(o, t);
2757
2788
  if (r != null) {
2758
- const i = e.state.selection, s = e.state.doc, { from: l, to: a } = $o(i, s), d = l <= r && r < a, c = i.$anchor.node() !== i.$head.node() || i instanceof O;
2759
- d && c ? (e.dispatch(
2760
- e.state.tr.setSelection(O.create(s, l, a))
2761
- ), pt(e, l, a)) : (e.dispatch(
2762
- e.state.tr.setSelection(mt.create(e.state.doc, r))
2763
- ), pt(e, r));
2764
- const m = e.state.selection.content(), { dom: h, text: p } = Fo(e, m);
2765
- n.dataTransfer.clearData(), n.dataTransfer.setData("text/html", h.innerHTML), n.dataTransfer.setData("text/plain", p), n.dataTransfer.effectAllowed = "move", n.dataTransfer.setDragImage(I, 0, 0), e.dragging = { slice: m, move: !0 };
2789
+ const i = t.state.selection, s = t.state.doc, { from: l, to: a } = Wo(i, s), d = l <= r && r < a, c = i.$anchor.node() !== i.$head.node() || i instanceof O;
2790
+ d && c ? (t.dispatch(
2791
+ t.state.tr.setSelection(O.create(s, l, a))
2792
+ ), pt(t, l, a)) : (t.dispatch(
2793
+ t.state.tr.setSelection(mt.create(t.state.doc, r))
2794
+ ), pt(t, r));
2795
+ const m = t.state.selection.content(), { dom: h, text: p } = Fo(t, m);
2796
+ n.dataTransfer.clearData(), n.dataTransfer.setData("text/html", h.innerHTML), n.dataTransfer.setData("text/plain", p), n.dataTransfer.effectAllowed = "move", n.dataTransfer.setDragImage(I, 0, 0), t.dragging = { slice: m, move: !0 };
2766
2797
  }
2767
2798
  }
2768
2799
  class jo {
2769
- constructor(e, t, o) {
2800
+ constructor(t, e, o) {
2770
2801
  u(this, "sideMenuState");
2771
2802
  // When true, the drag handle with be anchored at the same level as root elements
2772
2803
  // When false, the drag handle with be just to the left of the element
@@ -2788,16 +2819,16 @@ class jo {
2788
2819
  * we dispatch a fake event, so that we can still drop the content
2789
2820
  * when dragging / dropping to the side of the editor
2790
2821
  */
2791
- u(this, "onDrop", (e) => {
2792
- if (this.editor._tiptapEditor.commands.blur(), e.synthetic || !this.isDragging)
2822
+ u(this, "onDrop", (t) => {
2823
+ if (this.editor._tiptapEditor.commands.blur(), t.synthetic || !this.isDragging)
2793
2824
  return;
2794
- const t = this.pmView.posAtCoords({
2795
- left: e.clientX,
2796
- top: e.clientY
2825
+ const e = this.pmView.posAtCoords({
2826
+ left: t.clientX,
2827
+ top: t.clientY
2797
2828
  });
2798
- if (this.isDragging = !1, !t || t.inside === -1) {
2799
- const o = new Event("drop", e), r = this.pmView.dom.firstChild.getBoundingClientRect();
2800
- o.clientX = r.left + r.width / 2, o.clientY = e.clientY, o.dataTransfer = e.dataTransfer, o.preventDefault = () => e.preventDefault(), o.synthetic = !0, this.pmView.dom.dispatchEvent(o);
2829
+ if (this.isDragging = !1, !e || e.inside === -1) {
2830
+ const o = new Event("drop", t), r = this.pmView.dom.firstChild.getBoundingClientRect();
2831
+ o.clientX = r.left + r.width / 2, o.clientY = t.clientY, o.dataTransfer = t.dataTransfer, o.preventDefault = () => t.preventDefault(), o.synthetic = !0, this.pmView.dom.dispatchEvent(o);
2801
2832
  }
2802
2833
  });
2803
2834
  /**
@@ -2805,41 +2836,41 @@ class jo {
2805
2836
  * we dispatch a fake event, so that we can still drop the content
2806
2837
  * when dragging / dropping to the side of the editor
2807
2838
  */
2808
- u(this, "onDragOver", (e) => {
2809
- if (e.synthetic || !this.isDragging)
2839
+ u(this, "onDragOver", (t) => {
2840
+ if (t.synthetic || !this.isDragging)
2810
2841
  return;
2811
- const t = this.pmView.posAtCoords({
2812
- left: e.clientX,
2813
- top: e.clientY
2842
+ const e = this.pmView.posAtCoords({
2843
+ left: t.clientX,
2844
+ top: t.clientY
2814
2845
  });
2815
- if (!t || t.inside === -1) {
2816
- const o = new Event("dragover", e), r = this.pmView.dom.firstChild.getBoundingClientRect();
2817
- o.clientX = r.left + r.width / 2, o.clientY = e.clientY, o.dataTransfer = e.dataTransfer, o.preventDefault = () => e.preventDefault(), o.synthetic = !0, this.pmView.dom.dispatchEvent(o);
2846
+ if (!e || e.inside === -1) {
2847
+ const o = new Event("dragover", t), r = this.pmView.dom.firstChild.getBoundingClientRect();
2848
+ o.clientX = r.left + r.width / 2, o.clientY = t.clientY, o.dataTransfer = t.dataTransfer, o.preventDefault = () => t.preventDefault(), o.synthetic = !0, this.pmView.dom.dispatchEvent(o);
2818
2849
  }
2819
2850
  });
2820
- u(this, "onKeyDown", (e) => {
2821
- var t;
2822
- (t = this.sideMenuState) != null && t.show && (this.sideMenuState.show = !1, this.updateSideMenu(this.sideMenuState)), this.menuFrozen = !1;
2851
+ u(this, "onKeyDown", (t) => {
2852
+ var e;
2853
+ (e = this.sideMenuState) != null && e.show && (this.sideMenuState.show = !1, this.updateSideMenu(this.sideMenuState)), this.menuFrozen = !1;
2823
2854
  });
2824
- u(this, "onMouseMove", (e) => {
2855
+ u(this, "onMouseMove", (t) => {
2825
2856
  var d, c, m, h, p;
2826
2857
  if (this.menuFrozen)
2827
2858
  return;
2828
- const t = this.pmView.dom.firstChild.getBoundingClientRect(), o = this.pmView.dom.getBoundingClientRect(), r = e.clientX >= o.left && e.clientX <= o.right && e.clientY >= o.top && e.clientY <= o.bottom, i = this.pmView.dom.parentElement;
2859
+ const e = this.pmView.dom.firstChild.getBoundingClientRect(), o = this.pmView.dom.getBoundingClientRect(), r = t.clientX >= o.left && t.clientX <= o.right && t.clientY >= o.top && t.clientY <= o.bottom, i = this.pmView.dom.parentElement;
2829
2860
  if (
2830
2861
  // Cursor is within the editor area
2831
2862
  r && // An element is hovered
2832
- e && e.target && // Element is outside the editor
2833
- !(i === e.target || i.contains(e.target))
2863
+ t && t.target && // Element is outside the editor
2864
+ !(i === t.target || i.contains(t.target))
2834
2865
  ) {
2835
2866
  (d = this.sideMenuState) != null && d.show && (this.sideMenuState.show = !1, this.updateSideMenu(this.sideMenuState));
2836
2867
  return;
2837
2868
  }
2838
- this.horizontalPosAnchor = t.x;
2869
+ this.horizontalPosAnchor = e.x;
2839
2870
  const s = {
2840
- left: t.left + t.width / 2,
2871
+ left: e.left + e.width / 2,
2841
2872
  // take middle of editor
2842
- top: e.clientY
2873
+ top: t.clientY
2843
2874
  }, l = qt(s, this.pmView);
2844
2875
  if (!l || !this.editor.isEditable) {
2845
2876
  (c = this.sideMenuState) != null && c.show && (this.sideMenuState.show = !1, this.updateSideMenu(this.sideMenuState));
@@ -2866,8 +2897,8 @@ class jo {
2866
2897
  }
2867
2898
  });
2868
2899
  u(this, "onScroll", () => {
2869
- var e;
2870
- if ((e = this.sideMenuState) != null && e.show) {
2900
+ var t;
2901
+ if ((t = this.sideMenuState) != null && t.show) {
2871
2902
  const o = this.hoveredBlock.firstChild.getBoundingClientRect();
2872
2903
  this.sideMenuState.referencePos = new DOMRect(
2873
2904
  this.horizontalPosAnchoredAtRoot ? this.horizontalPosAnchor : o.x,
@@ -2877,18 +2908,18 @@ class jo {
2877
2908
  ), this.updateSideMenu(this.sideMenuState);
2878
2909
  }
2879
2910
  });
2880
- this.editor = e, this.pmView = t, this.updateSideMenu = o, this.horizontalPosAnchoredAtRoot = !0, this.horizontalPosAnchor = this.pmView.dom.firstChild.getBoundingClientRect().x, document.body.addEventListener("drop", this.onDrop, !0), document.body.addEventListener("dragover", this.onDragOver), this.pmView.dom.addEventListener("dragstart", this.onDragStart), document.body.addEventListener("mousemove", this.onMouseMove, !0), document.addEventListener("scroll", this.onScroll), document.body.addEventListener("keydown", this.onKeyDown, !0);
2911
+ this.editor = t, this.pmView = e, this.updateSideMenu = o, this.horizontalPosAnchoredAtRoot = !0, this.horizontalPosAnchor = this.pmView.dom.firstChild.getBoundingClientRect().x, document.body.addEventListener("drop", this.onDrop, !0), document.body.addEventListener("dragover", this.onDragOver), this.pmView.dom.addEventListener("dragstart", this.onDragStart), document.body.addEventListener("mousemove", this.onMouseMove, !0), document.addEventListener("scroll", this.onScroll), document.body.addEventListener("keydown", this.onKeyDown, !0);
2881
2912
  }
2882
2913
  destroy() {
2883
- var e;
2884
- (e = this.sideMenuState) != null && e.show && (this.sideMenuState.show = !1, this.updateSideMenu(this.sideMenuState)), document.body.removeEventListener("mousemove", this.onMouseMove), document.body.removeEventListener("dragover", this.onDragOver), this.pmView.dom.removeEventListener("dragstart", this.onDragStart), document.body.removeEventListener("drop", this.onDrop, !0), document.removeEventListener("scroll", this.onScroll), document.body.removeEventListener("keydown", this.onKeyDown, !0);
2914
+ var t;
2915
+ (t = this.sideMenuState) != null && t.show && (this.sideMenuState.show = !1, this.updateSideMenu(this.sideMenuState)), document.body.removeEventListener("mousemove", this.onMouseMove), document.body.removeEventListener("dragover", this.onDragOver), this.pmView.dom.removeEventListener("dragstart", this.onDragStart), document.body.removeEventListener("drop", this.onDrop, !0), document.removeEventListener("scroll", this.onScroll), document.body.removeEventListener("keydown", this.onKeyDown, !0);
2885
2916
  }
2886
2917
  addBlock() {
2887
2918
  var l;
2888
2919
  (l = this.sideMenuState) != null && l.show && (this.sideMenuState.show = !1, this.updateSideMenu(this.sideMenuState)), this.menuFrozen = !0;
2889
- const t = this.hoveredBlock.firstChild.getBoundingClientRect(), o = this.pmView.posAtCoords({
2890
- left: t.left + t.width / 2,
2891
- top: t.top + t.height / 2
2920
+ const e = this.hoveredBlock.firstChild.getBoundingClientRect(), o = this.pmView.posAtCoords({
2921
+ left: e.left + e.width / 2,
2922
+ top: e.top + e.height / 2
2892
2923
  });
2893
2924
  if (!o)
2894
2925
  return;
@@ -2913,9 +2944,9 @@ class jo {
2913
2944
  );
2914
2945
  }
2915
2946
  }
2916
- const qo = new B("SideMenuPlugin");
2947
+ const qo = new M("SideMenuPlugin");
2917
2948
  class Xo extends U {
2918
- constructor(t) {
2949
+ constructor(e) {
2919
2950
  super();
2920
2951
  u(this, "sideMenuView");
2921
2952
  u(this, "plugin");
@@ -2927,8 +2958,8 @@ class Xo extends U {
2927
2958
  /**
2928
2959
  * Handles drag & drop events for blocks.
2929
2960
  */
2930
- u(this, "blockDragStart", (t) => {
2931
- this.sideMenuView.isDragging = !0, Go(t, this.editor.prosemirrorView);
2961
+ u(this, "blockDragStart", (e) => {
2962
+ this.sideMenuView.isDragging = !0, Go(e, this.editor.prosemirrorView);
2932
2963
  });
2933
2964
  /**
2934
2965
  * Handles drag & drop events for blocks.
@@ -2946,10 +2977,10 @@ class Xo extends U {
2946
2977
  * mouse cursor.
2947
2978
  */
2948
2979
  u(this, "unfreezeMenu", () => this.sideMenuView.menuFrozen = !1);
2949
- this.editor = t, this.plugin = new T({
2980
+ this.editor = e, this.plugin = new B({
2950
2981
  key: qo,
2951
2982
  view: (o) => (this.sideMenuView = new jo(
2952
- t,
2983
+ e,
2953
2984
  o,
2954
2985
  (r) => {
2955
2986
  this.emit("update", r);
@@ -2957,61 +2988,61 @@ class Xo extends U {
2957
2988
  ), this.sideMenuView)
2958
2989
  });
2959
2990
  }
2960
- onUpdate(t) {
2961
- return this.on("update", t);
2991
+ onUpdate(e) {
2992
+ return this.on("update", e);
2962
2993
  }
2963
2994
  }
2964
- function H(n, e) {
2965
- const t = n.getTextCursorPosition().block;
2966
- if (t.content === void 0)
2995
+ function H(n, t) {
2996
+ const e = n.getTextCursorPosition().block;
2997
+ if (e.content === void 0)
2967
2998
  throw new Error(
2968
2999
  "Slash Menu open in a block that doesn't contain inline content."
2969
3000
  );
2970
- t.content.length === 1 && t.content[0].type === "text" && t.content[0].text === "/" || t.content.length === 0 ? n.updateBlock(t, e) : (n.insertBlocks([e], t, "after"), n.setTextCursorPosition(n.getTextCursorPosition().nextBlock));
3001
+ e.content.length === 1 && e.content[0].type === "text" && e.content[0].text === "/" || e.content.length === 0 ? n.updateBlock(e, t) : (n.insertBlocks([t], e, "after"), n.setTextCursorPosition(n.getTextCursorPosition().nextBlock));
2971
3002
  }
2972
3003
  const Ko = (n = jt) => {
2973
- var t, o, r;
2974
- const e = [];
2975
- return "heading" in n && "level" in n.heading.propSchema && ((t = n.heading.propSchema.level.values) != null && t.includes(1) && e.push({
3004
+ var e, o, r;
3005
+ const t = [];
3006
+ return "heading" in n && "level" in n.heading.propSchema && ((e = n.heading.propSchema.level.values) != null && e.includes(1) && t.push({
2976
3007
  name: "Heading",
2977
3008
  aliases: ["h", "heading1", "h1"],
2978
3009
  execute: (i) => H(i, {
2979
3010
  type: "heading",
2980
3011
  props: { level: 1 }
2981
3012
  })
2982
- }), (o = n.heading.propSchema.level.values) != null && o.includes(2) && e.push({
3013
+ }), (o = n.heading.propSchema.level.values) != null && o.includes(2) && t.push({
2983
3014
  name: "Heading 2",
2984
3015
  aliases: ["h2", "heading2", "subheading"],
2985
3016
  execute: (i) => H(i, {
2986
3017
  type: "heading",
2987
3018
  props: { level: 2 }
2988
3019
  })
2989
- }), (r = n.heading.propSchema.level.values) != null && r.includes(3) && e.push({
3020
+ }), (r = n.heading.propSchema.level.values) != null && r.includes(3) && t.push({
2990
3021
  name: "Heading 3",
2991
3022
  aliases: ["h3", "heading3", "subheading"],
2992
3023
  execute: (i) => H(i, {
2993
3024
  type: "heading",
2994
3025
  props: { level: 3 }
2995
3026
  })
2996
- })), "bulletListItem" in n && e.push({
3027
+ })), "bulletListItem" in n && t.push({
2997
3028
  name: "Bullet List",
2998
3029
  aliases: ["ul", "list", "bulletlist", "bullet list"],
2999
3030
  execute: (i) => H(i, {
3000
3031
  type: "bulletListItem"
3001
3032
  })
3002
- }), "numberedListItem" in n && e.push({
3033
+ }), "numberedListItem" in n && t.push({
3003
3034
  name: "Numbered List",
3004
3035
  aliases: ["li", "list", "numberedlist", "numbered list"],
3005
3036
  execute: (i) => H(i, {
3006
3037
  type: "numberedListItem"
3007
3038
  })
3008
- }), "paragraph" in n && e.push({
3039
+ }), "paragraph" in n && t.push({
3009
3040
  name: "Paragraph",
3010
3041
  aliases: ["p"],
3011
3042
  execute: (i) => H(i, {
3012
3043
  type: "paragraph"
3013
3044
  })
3014
- }), "image" in n && e.push({
3045
+ }), "image" in n && t.push({
3015
3046
  name: "Image",
3016
3047
  aliases: [
3017
3048
  "image",
@@ -3036,14 +3067,14 @@ const Ko = (n = jt) => {
3036
3067
  })
3037
3068
  );
3038
3069
  }
3039
- }), e;
3070
+ }), t;
3040
3071
  }, Yo = {
3041
3072
  enableInputRules: !0,
3042
3073
  enablePasteRules: !0,
3043
3074
  enableCoreExtensions: !1
3044
3075
  };
3045
3076
  class xn {
3046
- constructor(e = {}) {
3077
+ constructor(t = {}) {
3047
3078
  u(this, "_tiptapEditor");
3048
3079
  u(this, "blockCache", /* @__PURE__ */ new WeakMap());
3049
3080
  u(this, "schema");
@@ -3055,26 +3086,26 @@ class xn {
3055
3086
  u(this, "imageToolbar");
3056
3087
  u(this, "uploadFile");
3057
3088
  var l, a, d, c, m;
3058
- this.options = e;
3059
- const t = {
3089
+ this.options = t;
3090
+ const e = {
3060
3091
  defaultStyles: !0,
3061
3092
  // TODO: There's a lot of annoying typing stuff to deal with here. If
3062
3093
  // BSchema is specified, then options.blockSchema should also be required.
3063
3094
  // If BSchema is not specified, then options.blockSchema should also not
3064
3095
  // be defined. Unfortunately, trying to implement these constraints seems
3065
3096
  // to be a huge pain, hence the `as any` casts.
3066
- blockSchema: e.blockSchema || jt,
3067
- ...e
3097
+ blockSchema: t.blockSchema || jt,
3098
+ ...t
3068
3099
  };
3069
3100
  this.sideMenu = new Xo(this), this.formattingToolbar = new Ro(this), this.slashMenu = new Je(
3070
3101
  this,
3071
- t.slashMenuItems || Ko(t.blockSchema)
3102
+ e.slashMenuItems || Ko(e.blockSchema)
3072
3103
  ), this.hyperlinkToolbar = new Uo(this), this.imageToolbar = new Ho(this);
3073
3104
  const o = ro({
3074
3105
  editor: this,
3075
- domAttributes: t.domAttributes || {},
3076
- blockSchema: t.blockSchema,
3077
- collaboration: t.collaboration
3106
+ domAttributes: e.domAttributes || {},
3107
+ blockSchema: e.blockSchema,
3108
+ collaboration: e.collaboration
3078
3109
  }), r = A.create({
3079
3110
  name: "BlockNoteUIExtension",
3080
3111
  addProseMirrorPlugins: () => [
@@ -3085,15 +3116,15 @@ class xn {
3085
3116
  this.imageToolbar.plugin
3086
3117
  ]
3087
3118
  });
3088
- o.push(r), this.schema = t.blockSchema, this.uploadFile = t.uploadFile;
3089
- const i = t.initialContent || (e.collaboration ? void 0 : [
3119
+ o.push(r), this.schema = e.blockSchema, this.uploadFile = e.uploadFile;
3120
+ const i = e.initialContent || (t.collaboration ? void 0 : [
3090
3121
  {
3091
3122
  type: "paragraph",
3092
3123
  id: j.options.generateID()
3093
3124
  }
3094
3125
  ]), s = {
3095
3126
  ...Yo,
3096
- ...t._tiptapOptions,
3127
+ ...e._tiptapOptions,
3097
3128
  onBeforeCreate(h) {
3098
3129
  if (!i)
3099
3130
  return;
@@ -3108,31 +3139,31 @@ class xn {
3108
3139
  },
3109
3140
  onCreate: () => {
3110
3141
  var h;
3111
- i !== void 0 && this.replaceBlocks(this.topLevelBlocks, i), (h = t.onEditorReady) == null || h.call(t, this), this.ready = !0;
3142
+ i !== void 0 && this.replaceBlocks(this.topLevelBlocks, i), (h = e.onEditorReady) == null || h.call(e, this), this.ready = !0;
3112
3143
  },
3113
3144
  onUpdate: () => {
3114
3145
  var h;
3115
- this.ready && ((h = t.onEditorContentChange) == null || h.call(t, this));
3146
+ this.ready && ((h = e.onEditorContentChange) == null || h.call(e, this));
3116
3147
  },
3117
3148
  onSelectionUpdate: () => {
3118
3149
  var h;
3119
- this.ready && ((h = t.onTextCursorPositionChange) == null || h.call(t, this));
3150
+ this.ready && ((h = e.onTextCursorPositionChange) == null || h.call(e, this));
3120
3151
  },
3121
- editable: e.editable === void 0 ? !0 : e.editable,
3122
- extensions: t.enableBlockNoteExtensions === !1 ? (l = t._tiptapOptions) == null ? void 0 : l.extensions : [...((a = t._tiptapOptions) == null ? void 0 : a.extensions) || [], ...o],
3152
+ editable: t.editable === void 0 ? !0 : t.editable,
3153
+ extensions: e.enableBlockNoteExtensions === !1 ? (l = e._tiptapOptions) == null ? void 0 : l.extensions : [...((a = e._tiptapOptions) == null ? void 0 : a.extensions) || [], ...o],
3123
3154
  editorProps: {
3124
3155
  attributes: {
3125
- ...(d = t.domAttributes) == null ? void 0 : d.editor,
3156
+ ...(d = e.domAttributes) == null ? void 0 : d.editor,
3126
3157
  class: S(
3127
3158
  D.bnEditor,
3128
3159
  D.bnRoot,
3129
- t.defaultStyles ? D.defaultStyles : "",
3130
- ((m = (c = t.domAttributes) == null ? void 0 : c.editor) == null ? void 0 : m.class) || ""
3160
+ e.defaultStyles ? D.defaultStyles : "",
3161
+ ((m = (c = e.domAttributes) == null ? void 0 : c.editor) == null ? void 0 : m.class) || ""
3131
3162
  )
3132
3163
  }
3133
3164
  }
3134
3165
  };
3135
- t.parentElement && (s.element = t.parentElement), this._tiptapEditor = new re(s);
3166
+ e.parentElement && (s.element = e.parentElement), this._tiptapEditor = new re(s);
3136
3167
  }
3137
3168
  get prosemirrorView() {
3138
3169
  return this._tiptapEditor.view;
@@ -3151,32 +3182,32 @@ class xn {
3151
3182
  * @returns A snapshot of all top-level (non-nested) blocks in the editor.
3152
3183
  */
3153
3184
  get topLevelBlocks() {
3154
- const e = [];
3155
- return this._tiptapEditor.state.doc.firstChild.descendants((t) => (e.push(x(t, this.schema, this.blockCache)), !1)), e;
3185
+ const t = [];
3186
+ return this._tiptapEditor.state.doc.firstChild.descendants((e) => (t.push(x(e, this.schema, this.blockCache)), !1)), t;
3156
3187
  }
3157
3188
  /**
3158
3189
  * Gets a snapshot of an existing block from the editor.
3159
3190
  * @param blockIdentifier The identifier of an existing block that should be retrieved.
3160
3191
  * @returns The block that matches the identifier, or `undefined` if no matching block was found.
3161
3192
  */
3162
- getBlock(e) {
3163
- const t = typeof e == "string" ? e : e.id;
3193
+ getBlock(t) {
3194
+ const e = typeof t == "string" ? t : t.id;
3164
3195
  let o;
3165
- return this._tiptapEditor.state.doc.firstChild.descendants((r) => typeof o < "u" ? !1 : r.type.name !== "blockContainer" || r.attrs.id !== t ? !0 : (o = x(r, this.schema, this.blockCache), !1)), o;
3196
+ return this._tiptapEditor.state.doc.firstChild.descendants((r) => typeof o < "u" ? !1 : r.type.name !== "blockContainer" || r.attrs.id !== e ? !0 : (o = x(r, this.schema, this.blockCache), !1)), o;
3166
3197
  }
3167
3198
  /**
3168
3199
  * Traverses all blocks in the editor depth-first, and executes a callback for each.
3169
3200
  * @param callback The callback to execute for each block. Returning `false` stops the traversal.
3170
3201
  * @param reverse Whether the blocks should be traversed in reverse order.
3171
3202
  */
3172
- forEachBlock(e, t = !1) {
3203
+ forEachBlock(t, e = !1) {
3173
3204
  const o = this.topLevelBlocks.slice();
3174
- t && o.reverse();
3205
+ e && o.reverse();
3175
3206
  function r(i) {
3176
3207
  for (const s of i) {
3177
- if (!e(s))
3208
+ if (!t(s))
3178
3209
  return !1;
3179
- const l = t ? s.children.slice().reverse() : s.children;
3210
+ const l = e ? s.children.slice().reverse() : s.children;
3180
3211
  if (!r(l))
3181
3212
  return !1;
3182
3213
  }
@@ -3188,30 +3219,30 @@ class xn {
3188
3219
  * Executes a callback whenever the editor's contents change.
3189
3220
  * @param callback The callback to execute.
3190
3221
  */
3191
- onEditorContentChange(e) {
3192
- this._tiptapEditor.on("update", e);
3222
+ onEditorContentChange(t) {
3223
+ this._tiptapEditor.on("update", t);
3193
3224
  }
3194
3225
  /**
3195
3226
  * Executes a callback whenever the editor's selection changes.
3196
3227
  * @param callback The callback to execute.
3197
3228
  */
3198
- onEditorSelectionChange(e) {
3199
- this._tiptapEditor.on("selectionUpdate", e);
3229
+ onEditorSelectionChange(t) {
3230
+ this._tiptapEditor.on("selectionUpdate", t);
3200
3231
  }
3201
3232
  /**
3202
3233
  * Gets a snapshot of the current text cursor position.
3203
3234
  * @returns A snapshot of the current text cursor position.
3204
3235
  */
3205
3236
  getTextCursorPosition() {
3206
- const { node: e, depth: t, startPos: o, endPos: r } = b(
3237
+ const { node: t, depth: e, startPos: o, endPos: r } = b(
3207
3238
  this._tiptapEditor.state.doc,
3208
3239
  this._tiptapEditor.state.selection.from
3209
- ), i = this._tiptapEditor.state.doc.resolve(r).index(t - 1), s = this._tiptapEditor.state.doc.resolve(r + 1).node().childCount;
3240
+ ), i = this._tiptapEditor.state.doc.resolve(r).index(e - 1), s = this._tiptapEditor.state.doc.resolve(r + 1).node().childCount;
3210
3241
  let l;
3211
3242
  i > 0 && (l = this._tiptapEditor.state.doc.resolve(o - 2).node());
3212
3243
  let a;
3213
3244
  return i < s - 1 && (a = this._tiptapEditor.state.doc.resolve(r + 2).node()), {
3214
- block: x(e, this.schema, this.blockCache),
3245
+ block: x(t, this.schema, this.blockCache),
3215
3246
  prevBlock: l === void 0 ? void 0 : x(l, this.schema, this.blockCache),
3216
3247
  nextBlock: a === void 0 ? void 0 : x(a, this.schema, this.blockCache)
3217
3248
  };
@@ -3222,8 +3253,8 @@ class xn {
3222
3253
  * @param targetBlock The identifier of an existing block that the text cursor should be moved to.
3223
3254
  * @param placement Whether the text cursor should be placed at the start or end of the block.
3224
3255
  */
3225
- setTextCursorPosition(e, t = "start") {
3226
- const o = typeof e == "string" ? e : e.id, { posBeforeNode: r } = et(o, this._tiptapEditor.state.doc), { startPos: i, contentNode: s } = b(
3256
+ setTextCursorPosition(t, e = "start") {
3257
+ const o = typeof t == "string" ? t : t.id, { posBeforeNode: r } = et(o, this._tiptapEditor.state.doc), { startPos: i, contentNode: s } = b(
3227
3258
  this._tiptapEditor.state.doc,
3228
3259
  r + 2
3229
3260
  );
@@ -3231,7 +3262,7 @@ class xn {
3231
3262
  this._tiptapEditor.commands.setNodeSelection(i);
3232
3263
  return;
3233
3264
  }
3234
- t === "start" ? this._tiptapEditor.commands.setTextSelection(i + 1) : this._tiptapEditor.commands.setTextSelection(
3265
+ e === "start" ? this._tiptapEditor.commands.setTextSelection(i + 1) : this._tiptapEditor.commands.setTextSelection(
3235
3266
  i + s.nodeSize - 1
3236
3267
  );
3237
3268
  }
@@ -3241,14 +3272,14 @@ class xn {
3241
3272
  getSelection() {
3242
3273
  if (this._tiptapEditor.state.selection.from === this._tiptapEditor.state.selection.to || "node" in this._tiptapEditor.state.selection)
3243
3274
  return;
3244
- const e = [];
3245
- return this._tiptapEditor.state.doc.descendants((t, o) => t.type.spec.group !== "blockContent" || o + t.nodeSize < this._tiptapEditor.state.selection.from || o > this._tiptapEditor.state.selection.to ? !0 : (e.push(
3275
+ const t = [];
3276
+ return this._tiptapEditor.state.doc.descendants((e, o) => e.type.spec.group !== "blockContent" || o + e.nodeSize < this._tiptapEditor.state.selection.from || o > this._tiptapEditor.state.selection.to ? !0 : (t.push(
3246
3277
  x(
3247
3278
  this._tiptapEditor.state.doc.resolve(o).node(),
3248
3279
  this.schema,
3249
3280
  this.blockCache
3250
3281
  )
3251
- ), !1)), { blocks: e };
3282
+ ), !1)), { blocks: t };
3252
3283
  }
3253
3284
  /**
3254
3285
  * Checks if the editor is currently editable, or if it's locked.
@@ -3261,8 +3292,8 @@ class xn {
3261
3292
  * Makes the editor editable or locks it, depending on the argument passed.
3262
3293
  * @param editable True to make the editor editable, or false to lock it.
3263
3294
  */
3264
- set isEditable(e) {
3265
- this._tiptapEditor.setEditable(e);
3295
+ set isEditable(t) {
3296
+ this._tiptapEditor.setEditable(t);
3266
3297
  }
3267
3298
  /**
3268
3299
  * Inserts new blocks into the editor. If a block's `id` is undefined, BlockNote generates one automatically. Throws an
@@ -3272,8 +3303,8 @@ class xn {
3272
3303
  * @param placement Whether the blocks should be inserted just before, just after, or nested inside the
3273
3304
  * `referenceBlock`. Inserts the blocks at the start of the existing block's children if "nested" is used.
3274
3305
  */
3275
- insertBlocks(e, t, o = "before") {
3276
- Ut(e, t, o, this._tiptapEditor);
3306
+ insertBlocks(t, e, o = "before") {
3307
+ Ut(t, e, o, this._tiptapEditor);
3277
3308
  }
3278
3309
  /**
3279
3310
  * Updates an existing block in the editor. Since updatedBlock is a PartialBlock object, some fields might not be
@@ -3282,15 +3313,15 @@ class xn {
3282
3313
  * @param blockToUpdate The block that should be updated.
3283
3314
  * @param update A partial block which defines how the existing block should be changed.
3284
3315
  */
3285
- updateBlock(e, t) {
3286
- io(e, t, this._tiptapEditor);
3316
+ updateBlock(t, e) {
3317
+ io(t, e, this._tiptapEditor);
3287
3318
  }
3288
3319
  /**
3289
3320
  * Removes existing blocks from the editor. Throws an error if any of the blocks could not be found.
3290
3321
  * @param blocksToRemove An array of identifiers for existing blocks that should be removed.
3291
3322
  */
3292
- removeBlocks(e) {
3293
- Ft(e, this._tiptapEditor);
3323
+ removeBlocks(t) {
3324
+ Ft(t, this._tiptapEditor);
3294
3325
  }
3295
3326
  /**
3296
3327
  * Replaces existing blocks in the editor with new blocks. If the blocks that should be removed are not adjacent or
@@ -3299,30 +3330,30 @@ class xn {
3299
3330
  * @param blocksToRemove An array of blocks that should be replaced.
3300
3331
  * @param blocksToInsert An array of partial blocks to replace the old ones with.
3301
3332
  */
3302
- replaceBlocks(e, t) {
3303
- so(e, t, this._tiptapEditor);
3333
+ replaceBlocks(t, e) {
3334
+ so(t, e, this._tiptapEditor);
3304
3335
  }
3305
3336
  /**
3306
3337
  * Gets the active text styles at the text cursor position or at the end of the current selection if it's active.
3307
3338
  */
3308
3339
  getActiveStyles() {
3309
- const e = {}, t = this._tiptapEditor.state.selection.$to.marks(), o = /* @__PURE__ */ new Set([
3340
+ const t = {}, e = this._tiptapEditor.state.selection.$to.marks(), o = /* @__PURE__ */ new Set([
3310
3341
  "bold",
3311
3342
  "italic",
3312
3343
  "underline",
3313
3344
  "strike",
3314
3345
  "code"
3315
3346
  ]), r = /* @__PURE__ */ new Set(["textColor", "backgroundColor"]);
3316
- for (const i of t)
3317
- o.has(i.type.name) ? e[i.type.name] = !0 : r.has(i.type.name) && (e[i.type.name] = i.attrs.color);
3318
- return e;
3347
+ for (const i of e)
3348
+ o.has(i.type.name) ? t[i.type.name] = !0 : r.has(i.type.name) && (t[i.type.name] = i.attrs.color);
3349
+ return t;
3319
3350
  }
3320
3351
  /**
3321
3352
  * Adds styles to the currently selected content.
3322
3353
  * @param styles The styles to add.
3323
3354
  */
3324
- addStyles(e) {
3325
- const t = /* @__PURE__ */ new Set([
3355
+ addStyles(t) {
3356
+ const e = /* @__PURE__ */ new Set([
3326
3357
  "bold",
3327
3358
  "italic",
3328
3359
  "underline",
@@ -3330,24 +3361,24 @@ class xn {
3330
3361
  "code"
3331
3362
  ]), o = /* @__PURE__ */ new Set(["textColor", "backgroundColor"]);
3332
3363
  this._tiptapEditor.view.focus();
3333
- for (const [r, i] of Object.entries(e))
3334
- t.has(r) ? this._tiptapEditor.commands.setMark(r) : o.has(r) && this._tiptapEditor.commands.setMark(r, { color: i });
3364
+ for (const [r, i] of Object.entries(t))
3365
+ e.has(r) ? this._tiptapEditor.commands.setMark(r) : o.has(r) && this._tiptapEditor.commands.setMark(r, { color: i });
3335
3366
  }
3336
3367
  /**
3337
3368
  * Removes styles from the currently selected content.
3338
3369
  * @param styles The styles to remove.
3339
3370
  */
3340
- removeStyles(e) {
3371
+ removeStyles(t) {
3341
3372
  this._tiptapEditor.view.focus();
3342
- for (const t of Object.keys(e))
3343
- this._tiptapEditor.commands.unsetMark(t);
3373
+ for (const e of Object.keys(t))
3374
+ this._tiptapEditor.commands.unsetMark(e);
3344
3375
  }
3345
3376
  /**
3346
3377
  * Toggles styles on the currently selected content.
3347
3378
  * @param styles The styles to toggle.
3348
3379
  */
3349
- toggleStyles(e) {
3350
- const t = /* @__PURE__ */ new Set([
3380
+ toggleStyles(t) {
3381
+ const e = /* @__PURE__ */ new Set([
3351
3382
  "bold",
3352
3383
  "italic",
3353
3384
  "underline",
@@ -3355,8 +3386,8 @@ class xn {
3355
3386
  "code"
3356
3387
  ]), o = /* @__PURE__ */ new Set(["textColor", "backgroundColor"]);
3357
3388
  this._tiptapEditor.view.focus();
3358
- for (const [r, i] of Object.entries(e))
3359
- t.has(r) ? this._tiptapEditor.commands.toggleMark(r) : o.has(r) && this._tiptapEditor.commands.toggleMark(r, { color: i });
3389
+ for (const [r, i] of Object.entries(t))
3390
+ e.has(r) ? this._tiptapEditor.commands.toggleMark(r) : o.has(r) && this._tiptapEditor.commands.toggleMark(r, { color: i });
3360
3391
  }
3361
3392
  /**
3362
3393
  * Gets the currently selected text.
@@ -3378,25 +3409,25 @@ class xn {
3378
3409
  * @param url The link URL.
3379
3410
  * @param text The text to display the link with.
3380
3411
  */
3381
- createLink(e, t) {
3382
- if (e === "")
3412
+ createLink(t, e) {
3413
+ if (t === "")
3383
3414
  return;
3384
3415
  const { from: o, to: r } = this._tiptapEditor.state.selection;
3385
- t || (t = this._tiptapEditor.state.doc.textBetween(o, r));
3386
- const i = this._tiptapEditor.schema.mark("link", { href: e });
3416
+ e || (e = this._tiptapEditor.state.doc.textBetween(o, r));
3417
+ const i = this._tiptapEditor.schema.mark("link", { href: t });
3387
3418
  this._tiptapEditor.view.dispatch(
3388
- this._tiptapEditor.view.state.tr.insertText(t, o, r).addMark(o, o + t.length, i)
3419
+ this._tiptapEditor.view.state.tr.insertText(e, o, r).addMark(o, o + e.length, i)
3389
3420
  );
3390
3421
  }
3391
3422
  /**
3392
3423
  * Checks if the block containing the text cursor can be nested.
3393
3424
  */
3394
3425
  canNestBlock() {
3395
- const { startPos: e, depth: t } = b(
3426
+ const { startPos: t, depth: e } = b(
3396
3427
  this._tiptapEditor.state.doc,
3397
3428
  this._tiptapEditor.state.selection.from
3398
3429
  );
3399
- return this._tiptapEditor.state.doc.resolve(e).index(t - 1) > 0;
3430
+ return this._tiptapEditor.state.doc.resolve(t).index(e - 1) > 0;
3400
3431
  }
3401
3432
  /**
3402
3433
  * Nests the block containing the text cursor into the block above it.
@@ -3408,11 +3439,11 @@ class xn {
3408
3439
  * Checks if the block containing the text cursor is nested.
3409
3440
  */
3410
3441
  canUnnestBlock() {
3411
- const { depth: e } = b(
3442
+ const { depth: t } = b(
3412
3443
  this._tiptapEditor.state.doc,
3413
3444
  this._tiptapEditor.state.selection.from
3414
3445
  );
3415
- return e > 2;
3446
+ return t > 2;
3416
3447
  }
3417
3448
  /**
3418
3449
  * Lifts the block containing the text cursor out of its parent.
@@ -3426,8 +3457,8 @@ class xn {
3426
3457
  * @param blocks An array of blocks that should be serialized into HTML.
3427
3458
  * @returns The blocks, serialized as an HTML string.
3428
3459
  */
3429
- async blocksToHTML(e) {
3430
- return Wt(e, this._tiptapEditor.schema);
3460
+ async blocksToHTML(t) {
3461
+ return $t(t, this._tiptapEditor.schema);
3431
3462
  }
3432
3463
  /**
3433
3464
  * Parses blocks from an HTML string. Tries to create `Block` objects out of any HTML block-level elements, and
@@ -3436,8 +3467,8 @@ class xn {
3436
3467
  * @param html The HTML string to parse blocks from.
3437
3468
  * @returns The blocks parsed from the HTML string.
3438
3469
  */
3439
- async HTMLToBlocks(e) {
3440
- return $t(e, this.schema, this._tiptapEditor.schema);
3470
+ async HTMLToBlocks(t) {
3471
+ return Wt(t, this.schema, this._tiptapEditor.schema);
3441
3472
  }
3442
3473
  /**
3443
3474
  * Serializes blocks into a Markdown string. The output is simplified as Markdown does not support all features of
@@ -3445,8 +3476,8 @@ class xn {
3445
3476
  * @param blocks An array of blocks that should be serialized into Markdown.
3446
3477
  * @returns The blocks, serialized as a Markdown string.
3447
3478
  */
3448
- async blocksToMarkdown(e) {
3449
- return co(e, this._tiptapEditor.schema);
3479
+ async blocksToMarkdown(t) {
3480
+ return co(t, this._tiptapEditor.schema);
3450
3481
  }
3451
3482
  /**
3452
3483
  * Creates a list of blocks from a Markdown string. Tries to create `Block` and `InlineNode` objects based on
@@ -3455,25 +3486,25 @@ class xn {
3455
3486
  * @param markdown The Markdown string to parse blocks from.
3456
3487
  * @returns The blocks parsed from the Markdown string.
3457
3488
  */
3458
- async markdownToBlocks(e) {
3459
- return po(e, this.schema, this._tiptapEditor.schema);
3489
+ async markdownToBlocks(t) {
3490
+ return po(t, this.schema, this._tiptapEditor.schema);
3460
3491
  }
3461
3492
  /**
3462
3493
  * Updates the user info for the current user that's shown to other collaborators.
3463
3494
  */
3464
- updateCollaborationUserInfo(e) {
3495
+ updateCollaborationUserInfo(t) {
3465
3496
  if (!this.options.collaboration)
3466
3497
  throw new Error(
3467
3498
  "Cannot update collaboration user info when collaboration is disabled."
3468
3499
  );
3469
- this._tiptapEditor.commands.updateUser(e);
3500
+ this._tiptapEditor.commands.updateUser(t);
3470
3501
  }
3471
3502
  }
3472
3503
  const In = async (n) => {
3473
- const e = new FormData();
3474
- return e.append("file", n), (await (await fetch("https://tmpfiles.org/api/v1/upload", {
3504
+ const t = new FormData();
3505
+ return t.append("file", n), (await (await fetch("https://tmpfiles.org/api/v1/upload", {
3475
3506
  method: "POST",
3476
- body: e
3507
+ body: t
3477
3508
  })).json()).data.url.replace(
3478
3509
  "tmpfiles.org/",
3479
3510
  "tmpfiles.org/dl/"
@@ -3491,13 +3522,13 @@ export {
3491
3522
  jo as SideMenuView,
3492
3523
  Je as SlashMenuProsemirrorPlugin,
3493
3524
  Pe as UnreachableCaseError,
3494
- Bn as blockStyles,
3525
+ Mn as blockStyles,
3495
3526
  dt as camelToDataKebab,
3496
3527
  go as createBlockSpec,
3497
3528
  F as createTipTapBlock,
3498
3529
  jt as defaultBlockSchema,
3499
3530
  C as defaultProps,
3500
- Mn as formatKeyboardShortcut,
3531
+ Tn as formatKeyboardShortcut,
3501
3532
  Oo as formattingToolbarPluginKey,
3502
3533
  ro as getBlockNoteExtensions,
3503
3534
  Ko as getDefaultSlashMenuItems,