@blocknote/core 0.44.2 → 0.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/dist/BlockNoteExtension-BWw0r8Gy.cjs.map +1 -1
  2. package/dist/BlockNoteExtension-C2X7LW-V.js.map +1 -1
  3. package/dist/{BlockNoteSchema-BsTi0fNS.js → BlockNoteSchema-DsMVJZv4.js} +2 -2
  4. package/dist/{BlockNoteSchema-BsTi0fNS.js.map → BlockNoteSchema-DsMVJZv4.js.map} +1 -1
  5. package/dist/{BlockNoteSchema-CBNkNhkw.cjs → BlockNoteSchema-qt4Czo0-.cjs} +2 -2
  6. package/dist/{BlockNoteSchema-CBNkNhkw.cjs.map → BlockNoteSchema-qt4Czo0-.cjs.map} +1 -1
  7. package/dist/ShowSelection-B0ch3unP.js +51 -0
  8. package/dist/ShowSelection-B0ch3unP.js.map +1 -0
  9. package/dist/ShowSelection-BxnbRvy4.cjs +2 -0
  10. package/dist/ShowSelection-BxnbRvy4.cjs.map +1 -0
  11. package/dist/{TrailingNode-CG2a-HDA.js → TrailingNode-C-Kyrtf1.js} +715 -709
  12. package/dist/TrailingNode-C-Kyrtf1.js.map +1 -0
  13. package/dist/TrailingNode-W7GJVng5.cjs +2 -0
  14. package/dist/TrailingNode-W7GJVng5.cjs.map +1 -0
  15. package/dist/{blockToNode-DBNbhwwC.js → blockToNode-BNoNIXU7.js} +2 -2
  16. package/dist/{blockToNode-DBNbhwwC.js.map → blockToNode-BNoNIXU7.js.map} +1 -1
  17. package/dist/{blockToNode-w7H99R6p.cjs → blockToNode-CumVjgem.cjs} +2 -2
  18. package/dist/{blockToNode-w7H99R6p.cjs.map → blockToNode-CumVjgem.cjs.map} +1 -1
  19. package/dist/blocknote.cjs +4 -4
  20. package/dist/blocknote.cjs.map +1 -1
  21. package/dist/blocknote.js +1118 -1077
  22. package/dist/blocknote.js.map +1 -1
  23. package/dist/blocks.cjs +1 -1
  24. package/dist/blocks.js +2 -2
  25. package/dist/comments.cjs +1 -1
  26. package/dist/comments.cjs.map +1 -1
  27. package/dist/comments.js +3 -3
  28. package/dist/comments.js.map +1 -1
  29. package/dist/{defaultBlocks-B63ufZ5N.js → defaultBlocks-CXOCngjC.js} +273 -312
  30. package/dist/defaultBlocks-CXOCngjC.js.map +1 -0
  31. package/dist/defaultBlocks-IsUGVZIq.cjs +6 -0
  32. package/dist/defaultBlocks-IsUGVZIq.cjs.map +1 -0
  33. package/dist/extensions.cjs +1 -1
  34. package/dist/extensions.js +4 -4
  35. package/dist/style.css +1 -1
  36. package/dist/tsconfig.tsbuildinfo +1 -1
  37. package/dist/webpack-stats.json +1 -1
  38. package/dist/yjs.cjs +1 -1
  39. package/dist/yjs.js +1 -1
  40. package/package.json +18 -18
  41. package/src/api/blockManipulation/selections/selection.ts +9 -4
  42. package/src/api/blockManipulation/tables/tables.test.ts +140 -0
  43. package/src/api/blockManipulation/tables/tables.ts +1 -1
  44. package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +17 -0
  45. package/src/api/parsers/markdown/parseMarkdown.ts +11 -0
  46. package/src/blocks/ListItem/BulletListItem/block.ts +1 -1
  47. package/src/blocks/ListItem/CheckListItem/block.ts +6 -4
  48. package/src/blocks/ListItem/NumberedListItem/block.ts +6 -2
  49. package/src/comments/extension.ts +6 -2
  50. package/src/editor/Block.css +1 -1
  51. package/src/editor/BlockNoteEditor.test.ts +0 -1
  52. package/src/editor/BlockNoteEditor.ts +9 -39
  53. package/src/editor/BlockNoteExtension.ts +5 -0
  54. package/src/editor/managers/EventManager.ts +1 -1
  55. package/src/editor/managers/ExtensionManager/extensions.ts +3 -13
  56. package/src/editor/managers/ExtensionManager/index.ts +7 -2
  57. package/src/editor/managers/SelectionManager.ts +10 -10
  58. package/src/extensions/BlockChange/BlockChange.ts +2 -2
  59. package/src/extensions/Collaboration/Collaboration.ts +55 -0
  60. package/src/extensions/Collaboration/ForkYDoc.ts +4 -9
  61. package/src/extensions/Collaboration/YCursorPlugin.ts +56 -60
  62. package/src/extensions/Collaboration/YSync.ts +2 -2
  63. package/src/extensions/Collaboration/YUndo.ts +2 -2
  64. package/src/extensions/LinkToolbar/LinkToolbar.ts +1 -1
  65. package/src/extensions/ShowSelection/ShowSelection.ts +14 -4
  66. package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +40 -68
  67. package/src/extensions/TableHandles/TableHandles.ts +9 -5
  68. package/src/index.ts +2 -1
  69. package/src/schema/blocks/createSpec.ts +3 -0
  70. package/src/util/expandToWords.ts +38 -0
  71. package/types/src/api/blockManipulation/selections/selection.d.ts +1 -1
  72. package/types/src/editor/BlockNoteEditor.d.ts +5 -34
  73. package/types/src/editor/BlockNoteExtension.d.ts +4 -0
  74. package/types/src/editor/managers/SelectionManager.d.ts +4 -4
  75. package/types/src/extensions/Collaboration/Collaboration.d.ts +76 -0
  76. package/types/src/extensions/Collaboration/ForkYDoc.d.ts +2 -11
  77. package/types/src/extensions/Collaboration/YCursorPlugin.d.ts +3 -11
  78. package/types/src/extensions/Collaboration/YSync.d.ts +2 -4
  79. package/types/src/extensions/Collaboration/YUndo.d.ts +1 -1
  80. package/types/src/extensions/ShowSelection/ShowSelection.d.ts +10 -4
  81. package/types/src/index.d.ts +2 -1
  82. package/types/src/util/expandToWords.d.ts +13 -0
  83. package/dist/ShowSelection-BW37oJ6h.cjs +0 -2
  84. package/dist/ShowSelection-BW37oJ6h.cjs.map +0 -1
  85. package/dist/ShowSelection-Dz-NEase.js +0 -43
  86. package/dist/ShowSelection-Dz-NEase.js.map +0 -1
  87. package/dist/TrailingNode-CG2a-HDA.js.map +0 -1
  88. package/dist/TrailingNode-Du4SNHun.cjs +0 -2
  89. package/dist/TrailingNode-Du4SNHun.cjs.map +0 -1
  90. package/dist/defaultBlocks-B63ufZ5N.js.map +0 -1
  91. package/dist/defaultBlocks-BX6UxQa8.cjs +0 -6
  92. package/dist/defaultBlocks-BX6UxQa8.cjs.map +0 -1
package/dist/blocknote.js CHANGED
@@ -1,208 +1,208 @@
1
1
  var Oe = Object.defineProperty;
2
- var Fe = (n, e, t) => e in n ? Oe(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var h = (n, e, t) => Fe(n, typeof e != "symbol" ? e + "" : e, t);
4
- import { Slice as N, Fragment as A, DOMSerializer as he, DOMParser as He, Node as $e } from "prosemirror-model";
2
+ var Fe = (o, e, t) => e in o ? Oe(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
+ var h = (o, e, t) => Fe(o, typeof e != "symbol" ? e + "" : e, t);
4
+ import { Slice as N, Fragment as A, DOMSerializer as he, DOMParser as $e, Node as He } from "prosemirror-model";
5
5
  import { ReplaceStep as Ve, ReplaceAroundStep as V } from "prosemirror-transform";
6
- import { n as U, i as O, g as C, b as Y, a as b, t as Ue, U as F, q as _, r as H, d as ze, s as Ge, u as Re, v as q, w as B, x as me, y as je, z as ke, A as z } from "./blockToNode-DBNbhwwC.js";
7
- import { B as es, G as ts, C as os, D as ns, N as ss, E as rs, O as is, F as as, H as cs, I as ls, L as ds, J as us, M as ps, K as fs } from "./blockToNode-DBNbhwwC.js";
8
- import { ak as $, al as We, am as Ke, an as Je, aj as E, ao as Ye, ap as qe, a5 as Qe, a8 as G, aq as Xe, ar as Ze, a6 as et, as as Q, a9 as ge, at as tt } from "./defaultBlocks-B63ufZ5N.js";
9
- import { aw as ms, av as ks, E as gs, a as bs, F as ys, r as Ss, N as Bs, a4 as Cs, ad as Es, aG as xs, ax as Ms, b as ws, d as Ts, e as Ps, a0 as vs, aM as Is, au as As, c as _s, f as Ds, ag as Ls, ah as Ns, aB as Os, x as Fs, y as Hs, A as $s, z as Vs, g as Us, h as zs, T as Gs, j as Rs, k as js, l as Ws, n as Ks, o as Js, q as Ys, s as qs, w as Qs, aC as Xs, aH as Zs, B as er, C as tr, H as or, I as nr, J as sr, K as rr, aE as ir, aI as ar, M as cr, D as lr, G as dr, S as ur, O as pr, Q as fr, W as hr, U as mr, _ as kr, Z as gr, a2 as br, Y as yr, X as Sr, R as Br, $ as Cr, m as Er, aN as xr, aK as Mr, az as wr, af as Tr, i as Pr, ay as vr, aD as Ir, ae as Ar, a7 as _r, t as Dr, u as Lr, v as Nr, aJ as Or, ai as Fr, aL as Hr, a1 as $r, V as Vr, p as Ur, a3 as zr, aF as Gr, L as Rr, aO as jr, P as Wr, aA as Kr } from "./defaultBlocks-B63ufZ5N.js";
10
- import { j as ot, k as be, l as nt, m as st, n as rt, c as R, B as ye, D as it, L as at, N as ct, P as lt, g as dt, i as ut, F as pt, Y as ft, a as ht, b as mt, S as kt, H as gt, h as bt, e as yt, V as St, d as Bt } from "./TrailingNode-CG2a-HDA.js";
11
- import { s as Ct, B as Et } from "./BlockNoteSchema-BsTi0fNS.js";
12
- import { C as Yr, b as qr, c as Qr, a as Xr, g as Zr, u as ei, w as ti } from "./BlockNoteSchema-BsTi0fNS.js";
13
- import { Node as D, Extension as x, mergeAttributes as xt, Mark as X, extensions as I, isNodeSelection as Mt, posToDOMRect as wt, selectionToInsertionEnd as Tt, getSchema as Pt, createDocument as vt, Editor as It } from "@tiptap/core";
6
+ import { n as U, i as O, g as C, b as q, a as b, t as Ue, U as F, q as _, r as $, d as ze, s as Ge, u as Re, v as Y, w as B, x as me, y as je, z as ke, A as z } from "./blockToNode-BNoNIXU7.js";
7
+ import { B as ns, G as ss, C as rs, D as is, N as as, E as cs, O as ls, F as ds, H as us, I as ps, L as fs, J as hs, M as ms, K as ks } from "./blockToNode-BNoNIXU7.js";
8
+ import { ak as H, al as We, am as Ke, an as Je, aj as x, ao as qe, ap as Ye, a5 as Qe, a8 as G, aq as Xe, ar as Ze, a6 as et, as as Q, a9 as ge, at as tt } from "./defaultBlocks-CXOCngjC.js";
9
+ import { aw as bs, av as ys, E as Ss, a as Bs, F as Cs, r as xs, N as Es, a4 as Ms, ad as ws, aG as Ts, ax as Ps, b as vs, d as Is, e as As, a0 as _s, aM as Ds, au as Ls, c as Ns, f as Os, ag as Fs, ah as $s, aB as Hs, x as Vs, y as Us, A as zs, z as Gs, g as Rs, h as js, T as Ws, j as Ks, k as Js, l as qs, n as Ys, o as Qs, q as Xs, s as Zs, w as er, aC as tr, aH as or, B as nr, C as sr, H as rr, I as ir, J as ar, K as cr, aE as lr, aI as dr, M as ur, D as pr, G as fr, S as hr, O as mr, Q as kr, W as gr, U as br, _ as yr, Z as Sr, a2 as Br, Y as Cr, X as xr, R as Er, $ as Mr, m as wr, aN as Tr, aK as Pr, az as vr, af as Ir, i as Ar, ay as _r, aD as Dr, ae as Lr, a7 as Nr, t as Or, u as Fr, v as $r, aJ as Hr, ai as Vr, aL as Ur, a1 as zr, V as Gr, p as Rr, a3 as jr, aF as Wr, L as Kr, aO as Jr, P as qr, aA as Yr } from "./defaultBlocks-CXOCngjC.js";
10
+ import { j as ot, k as be, l as nt, m as st, n as rt, c as R, F as it, Y as at, a as ct, b as lt, S as dt, B as ye, D as ut, L as pt, N as ft, P as ht, g as mt, i as kt, H as gt, h as bt, e as yt, V as St, d as Bt } from "./TrailingNode-C-Kyrtf1.js";
11
+ import { s as Ct, B as xt } from "./BlockNoteSchema-DsMVJZv4.js";
12
+ import { C as Xr, b as Zr, c as ei, a as ti, g as oi, u as ni, w as si } from "./BlockNoteSchema-DsMVJZv4.js";
13
+ import { Node as D, Extension as E, mergeAttributes as Et, Mark as X, extensions as I, isNodeSelection as Mt, posToDOMRect as wt, selectionToInsertionEnd as Tt, getSchema as Pt, createDocument as vt, Editor as It } from "@tiptap/core";
14
14
  import { E as Se } from "./EventEmitter-CjSwpTbz.js";
15
15
  import { Fragment as Z, Slice as ne } from "@tiptap/pm/model";
16
16
  import { e as At } from "./en-njEqD7AG.js";
17
17
  import { inputRules as _t, InputRule as Dt } from "@handlewithcare/prosemirror-inputrules";
18
18
  import { keymap as Lt } from "@tiptap/pm/keymap";
19
- import { o as Nt } from "./BlockNoteExtension-C2X7LW-V.js";
20
- import { c as ni, a as si } from "./BlockNoteExtension-C2X7LW-V.js";
21
- import { Gapcursor as Ot } from "@tiptap/extension-gapcursor";
22
- import { Link as Ft } from "@tiptap/extension-link";
19
+ import { c as Nt, o as Ot } from "./BlockNoteExtension-C2X7LW-V.js";
20
+ import { a as ii } from "./BlockNoteExtension-C2X7LW-V.js";
21
+ import { Gapcursor as Ft } from "@tiptap/extensions/gap-cursor";
22
+ import { Link as $t } from "@tiptap/extension-link";
23
23
  import { Text as Ht } from "@tiptap/extension-text";
24
24
  import { NodeSelection as L, TextSelection as M, Plugin as ee } from "prosemirror-state";
25
25
  import { CellSelection as te, TableMap as se } from "prosemirror-tables";
26
- import { S as $t } from "./ShowSelection-Dz-NEase.js";
27
- import Vt from "remark-gfm";
28
- import Ut from "remark-parse";
29
- import zt, { defaultHandlers as re } from "remark-rehype";
30
- import Gt from "rehype-stringify";
31
- import { unified as Rt } from "unified";
32
- import { TextSelection as jt } from "@tiptap/pm/state";
33
- function Wt(n, e) {
26
+ import { S as Vt } from "./ShowSelection-B0ch3unP.js";
27
+ import Ut from "remark-gfm";
28
+ import zt from "remark-parse";
29
+ import Gt, { defaultHandlers as re } from "remark-rehype";
30
+ import Rt from "rehype-stringify";
31
+ import { unified as jt } from "unified";
32
+ import { TextSelection as Wt } from "@tiptap/pm/state";
33
+ function Kt(o, e) {
34
34
  const t = [
35
35
  {
36
- tag: `[data-inline-content-type="${n.type}"]`,
37
- contentElement: (o) => {
38
- const s = o;
36
+ tag: `[data-inline-content-type="${o.type}"]`,
37
+ contentElement: (n) => {
38
+ const s = n;
39
39
  return s.matches("[data-editable]") ? s : s.querySelector("[data-editable]") || s;
40
40
  }
41
41
  }
42
42
  ];
43
43
  return e && t.push({
44
44
  tag: "*",
45
- getAttrs(o) {
46
- if (typeof o == "string")
45
+ getAttrs(n) {
46
+ if (typeof n == "string")
47
47
  return !1;
48
- const s = e == null ? void 0 : e(o);
48
+ const s = e == null ? void 0 : e(n);
49
49
  return s === void 0 ? !1 : s;
50
50
  }
51
51
  }), t;
52
52
  }
53
- function Jn(n, e) {
54
- var o;
53
+ function Qn(o, e) {
54
+ var n;
55
55
  const t = D.create({
56
- name: n.type,
56
+ name: o.type,
57
57
  inline: !0,
58
58
  group: "inline",
59
- draggable: (o = e.meta) == null ? void 0 : o.draggable,
60
- selectable: n.content === "styled",
61
- atom: n.content === "none",
62
- content: n.content === "styled" ? "inline*" : "",
59
+ draggable: (n = e.meta) == null ? void 0 : n.draggable,
60
+ selectable: o.content === "styled",
61
+ atom: o.content === "none",
62
+ content: o.content === "styled" ? "inline*" : "",
63
63
  addAttributes() {
64
- return Ke(n.propSchema);
64
+ return Ke(o.propSchema);
65
65
  },
66
66
  addKeyboardShortcuts() {
67
- return We(n);
67
+ return We(o);
68
68
  },
69
69
  parseHTML() {
70
- return Wt(
71
- n,
70
+ return Kt(
71
+ o,
72
72
  e.parse
73
73
  );
74
74
  },
75
75
  renderHTML({ node: s }) {
76
- const i = this.options.editor, r = e.render.call(
76
+ const r = this.options.editor, i = e.render.call(
77
77
  { renderType: "dom", props: void 0 },
78
78
  U(
79
79
  s,
80
- i.schema.inlineContentSchema,
81
- i.schema.styleSchema
80
+ r.schema.inlineContentSchema,
81
+ r.schema.styleSchema
82
82
  ),
83
83
  // TODO: fix cast
84
84
  () => {
85
85
  },
86
- i
86
+ r
87
87
  );
88
- return $(
89
- r,
90
- n.type,
88
+ return H(
89
+ i,
90
+ o.type,
91
91
  s.attrs,
92
- n.propSchema
92
+ o.propSchema
93
93
  );
94
94
  },
95
95
  addNodeView() {
96
96
  return (s) => {
97
- const { node: i, getPos: r } = s, c = this.options.editor, a = e.render.call(
97
+ const { node: r, getPos: i } = s, c = this.options.editor, a = e.render.call(
98
98
  { renderType: "nodeView", props: s },
99
99
  U(
100
- i,
100
+ r,
101
101
  c.schema.inlineContentSchema,
102
102
  c.schema.styleSchema
103
103
  ),
104
104
  // TODO: fix cast
105
105
  (l) => {
106
- const d = O([l], c.pmSchema), u = r();
106
+ const d = O([l], c.pmSchema), u = i();
107
107
  u && c.transact(
108
- (p) => p.replaceWith(u, u + i.nodeSize, d)
108
+ (p) => p.replaceWith(u, u + r.nodeSize, d)
109
109
  );
110
110
  },
111
111
  c
112
112
  );
113
- return $(
113
+ return H(
114
114
  a,
115
- n.type,
116
- i.attrs,
117
- n.propSchema
115
+ o.type,
116
+ r.attrs,
117
+ o.propSchema
118
118
  );
119
119
  };
120
120
  }
121
121
  });
122
122
  return Je(
123
123
  t,
124
- n.propSchema,
124
+ o.propSchema,
125
125
  {
126
126
  ...e,
127
127
  toExternalHTML: e.toExternalHTML,
128
- render(s, i, r) {
128
+ render(s, r, i) {
129
129
  const c = e.render(
130
130
  s,
131
- i,
132
- r
131
+ r,
132
+ i
133
133
  );
134
- return $(
134
+ return H(
135
135
  c,
136
- n.type,
136
+ o.type,
137
137
  s.props,
138
- n.propSchema
138
+ o.propSchema
139
139
  );
140
140
  }
141
141
  }
142
142
  );
143
143
  }
144
- function Kt(n, e, t, o = "before") {
145
- const s = typeof t == "string" ? t : t.id, i = C(n), r = e.map(
146
- (d) => Y(d, i)
147
- ), c = E(s, n.doc);
144
+ function Jt(o, e, t, n = "before") {
145
+ const s = typeof t == "string" ? t : t.id, r = C(o), i = e.map(
146
+ (d) => q(d, r)
147
+ ), c = x(s, o.doc);
148
148
  if (!c)
149
149
  throw new Error(`Block with ID ${s} not found`);
150
150
  let a = c.posBeforeNode;
151
- return o === "after" && (a += c.node.nodeSize), n.step(
152
- new Ve(a, a, new N(A.from(r), 0, 0))
153
- ), r.map(
154
- (d) => b(d, i)
151
+ return n === "after" && (a += c.node.nodeSize), o.step(
152
+ new Ve(a, a, new N(A.from(i), 0, 0))
153
+ ), i.map(
154
+ (d) => b(d, r)
155
155
  );
156
156
  }
157
- function j(n) {
158
- if (!n || n.type.name !== "column")
157
+ function j(o) {
158
+ if (!o || o.type.name !== "column")
159
159
  throw new Error("Invalid columnPos: does not point to column node.");
160
- const e = n.firstChild;
160
+ const e = o.firstChild;
161
161
  if (!e)
162
162
  throw new Error("Invalid column: does not have child node.");
163
163
  const t = e.firstChild;
164
164
  if (!t)
165
165
  throw new Error("Invalid blockContainer: does not have child node.");
166
- return n.childCount === 1 && e.childCount === 1 && t.type.name === "paragraph" && t.content.content.length === 0;
166
+ return o.childCount === 1 && e.childCount === 1 && t.type.name === "paragraph" && t.content.content.length === 0;
167
167
  }
168
- function Jt(n, e) {
169
- const t = n.doc.resolve(e), o = t.nodeAfter;
170
- if (!o || o.type.name !== "columnList")
168
+ function qt(o, e) {
169
+ const t = o.doc.resolve(e), n = t.nodeAfter;
170
+ if (!n || n.type.name !== "columnList")
171
171
  throw new Error(
172
172
  "Invalid columnListPos: does not point to columnList node."
173
173
  );
174
- for (let s = o.childCount - 1; s >= 0; s--) {
175
- const i = n.doc.resolve(t.pos + 1).posAtIndex(s), c = n.doc.resolve(i).nodeAfter;
174
+ for (let s = n.childCount - 1; s >= 0; s--) {
175
+ const r = o.doc.resolve(t.pos + 1).posAtIndex(s), c = o.doc.resolve(r).nodeAfter;
176
176
  if (!c || c.type.name !== "column")
177
177
  throw new Error("Invalid columnPos: does not point to column node.");
178
- j(c) && n.delete(i, i + c.nodeSize);
178
+ j(c) && o.delete(r, r + c.nodeSize);
179
179
  }
180
180
  }
181
- function W(n, e) {
182
- Jt(n, e);
183
- const o = n.doc.resolve(e).nodeAfter;
184
- if (!o || o.type.name !== "columnList")
181
+ function W(o, e) {
182
+ qt(o, e);
183
+ const n = o.doc.resolve(e).nodeAfter;
184
+ if (!n || n.type.name !== "columnList")
185
185
  throw new Error(
186
186
  "Invalid columnListPos: does not point to columnList node."
187
187
  );
188
- if (o.childCount > 2)
188
+ if (n.childCount > 2)
189
189
  return;
190
- if (o.childCount < 2)
190
+ if (n.childCount < 2)
191
191
  throw new Error("Invalid columnList: contains fewer than two children.");
192
- const s = e + 1, r = n.doc.resolve(s).nodeAfter, c = e + o.nodeSize - 1, l = n.doc.resolve(c).nodeBefore;
193
- if (!r || !l)
192
+ const s = e + 1, i = o.doc.resolve(s).nodeAfter, c = e + n.nodeSize - 1, l = o.doc.resolve(c).nodeBefore;
193
+ if (!i || !l)
194
194
  throw new Error("Invalid columnList: does not contain children.");
195
- const d = j(r), u = j(l);
195
+ const d = j(i), u = j(l);
196
196
  if (d && u) {
197
- n.delete(e, e + o.nodeSize);
197
+ o.delete(e, e + n.nodeSize);
198
198
  return;
199
199
  }
200
200
  if (d) {
201
- n.step(
201
+ o.step(
202
202
  new V(
203
203
  // Replaces `columnList`.
204
204
  e,
205
- e + o.nodeSize,
205
+ e + n.nodeSize,
206
206
  // Replaces with content of last `column`.
207
207
  c - l.nodeSize + 1,
208
208
  c - 1,
@@ -215,14 +215,14 @@ function W(n, e) {
215
215
  return;
216
216
  }
217
217
  if (u) {
218
- n.step(
218
+ o.step(
219
219
  new V(
220
220
  // Replaces `columnList`.
221
221
  e,
222
- e + o.nodeSize,
222
+ e + n.nodeSize,
223
223
  // Replaces with content of first `column`.
224
224
  s + 1,
225
- s + r.nodeSize - 1,
225
+ s + i.nodeSize - 1,
226
226
  // Doesn't append anything.
227
227
  N.empty,
228
228
  0,
@@ -232,62 +232,62 @@ function W(n, e) {
232
232
  return;
233
233
  }
234
234
  }
235
- function ie(n, e, t) {
236
- const o = C(n), s = t.map(
237
- (u) => Y(u, o)
238
- ), i = new Set(
235
+ function ie(o, e, t) {
236
+ const n = C(o), s = t.map(
237
+ (u) => q(u, n)
238
+ ), r = new Set(
239
239
  e.map(
240
240
  (u) => typeof u == "string" ? u : u.id
241
241
  )
242
- ), r = [], c = /* @__PURE__ */ new Set(), a = typeof e[0] == "string" ? e[0] : e[0].id;
242
+ ), i = [], c = /* @__PURE__ */ new Set(), a = typeof e[0] == "string" ? e[0] : e[0].id;
243
243
  let l = 0;
244
- if (n.doc.descendants((u, p) => {
245
- if (i.size === 0)
244
+ if (o.doc.descendants((u, p) => {
245
+ if (r.size === 0)
246
246
  return !1;
247
- if (!u.type.isInGroup("bnBlock") || !i.has(u.attrs.id))
247
+ if (!u.type.isInGroup("bnBlock") || !r.has(u.attrs.id))
248
248
  return !0;
249
- if (r.push(b(u, o)), i.delete(u.attrs.id), t.length > 0 && u.attrs.id === a) {
250
- const g = n.doc.nodeSize;
251
- n.insert(p, s);
252
- const y = n.doc.nodeSize;
249
+ if (i.push(b(u, n)), r.delete(u.attrs.id), t.length > 0 && u.attrs.id === a) {
250
+ const g = o.doc.nodeSize;
251
+ o.insert(p, s);
252
+ const y = o.doc.nodeSize;
253
253
  l += g - y;
254
254
  }
255
- const m = n.doc.nodeSize, f = n.doc.resolve(p - l);
256
- f.node().type.name === "column" ? c.add(f.before(-1)) : f.node().type.name === "columnList" && c.add(f.before()), f.node().type.name === "blockGroup" && f.node(f.depth - 1).type.name !== "doc" && f.node().childCount === 1 ? n.delete(f.before(), f.after()) : n.delete(p - l, p - l + u.nodeSize);
257
- const k = n.doc.nodeSize;
255
+ const m = o.doc.nodeSize, f = o.doc.resolve(p - l);
256
+ f.node().type.name === "column" ? c.add(f.before(-1)) : f.node().type.name === "columnList" && c.add(f.before()), f.node().type.name === "blockGroup" && f.node(f.depth - 1).type.name !== "doc" && f.node().childCount === 1 ? o.delete(f.before(), f.after()) : o.delete(p - l, p - l + u.nodeSize);
257
+ const k = o.doc.nodeSize;
258
258
  return l += m - k, !1;
259
- }), i.size > 0) {
260
- const u = [...i].join(`
259
+ }), r.size > 0) {
260
+ const u = [...r].join(`
261
261
  `);
262
262
  throw Error(
263
263
  "Blocks with the following IDs could not be found in the editor: " + u
264
264
  );
265
265
  }
266
- return c.forEach((u) => W(n, u)), { insertedBlocks: s.map(
267
- (u) => b(u, o)
268
- ), removedBlocks: r };
266
+ return c.forEach((u) => W(o, u)), { insertedBlocks: s.map(
267
+ (u) => b(u, n)
268
+ ), removedBlocks: i };
269
269
  }
270
- function Yt(n, e, t, o, s) {
271
- let i;
270
+ function Yt(o, e, t, n, s) {
271
+ let r;
272
272
  if (e)
273
273
  if (typeof e == "string")
274
- i = O([e], n.pmSchema, o);
274
+ r = O([e], o.pmSchema, n);
275
275
  else if (Array.isArray(e))
276
- i = O(e, n.pmSchema, o);
276
+ r = O(e, o.pmSchema, n);
277
277
  else if (e.type === "tableContent")
278
- i = Ue(e, n.pmSchema);
278
+ r = Ue(e, o.pmSchema);
279
279
  else
280
280
  throw new F(e.type);
281
281
  else throw new Error("blockContent is required");
282
282
  const c = ((s == null ? void 0 : s.document) ?? document).createDocumentFragment();
283
- for (const a of i)
284
- if (a.type.name !== "text" && n.schema.inlineContentSchema[a.type.name]) {
285
- const l = n.schema.inlineContentSpecs[a.type.name].implementation;
283
+ for (const a of r)
284
+ if (a.type.name !== "text" && o.schema.inlineContentSchema[a.type.name]) {
285
+ const l = o.schema.inlineContentSpecs[a.type.name].implementation;
286
286
  if (l) {
287
287
  const d = U(
288
288
  a,
289
- n.schema.inlineContentSchema,
290
- n.schema.styleSchema
289
+ o.schema.inlineContentSchema,
290
+ o.schema.styleSchema
291
291
  ), u = l.render.call(
292
292
  {
293
293
  renderType: "dom",
@@ -296,7 +296,7 @@ function Yt(n, e, t, o, s) {
296
296
  d,
297
297
  () => {
298
298
  },
299
- n
299
+ o
300
300
  );
301
301
  if (u) {
302
302
  if (c.appendChild(u.dom), u.contentDOM) {
@@ -314,8 +314,8 @@ function Yt(n, e, t, o, s) {
314
314
  a.textContent
315
315
  );
316
316
  for (const d of a.marks.toReversed())
317
- if (d.type.name in n.schema.styleSpecs) {
318
- const u = n.schema.styleSpecs[d.type.name].implementation.render(d.attrs.stringValue, n);
317
+ if (d.type.name in o.schema.styleSpecs) {
318
+ const u = o.schema.styleSpecs[d.type.name].implementation.render(d.attrs.stringValue, o);
319
319
  u.contentDOM.appendChild(l), l = u.dom;
320
320
  } else {
321
321
  const u = d.type.spec.toDOM(d, !0), p = he.renderSpec(document, u);
@@ -331,39 +331,39 @@ function Yt(n, e, t, o, s) {
331
331
  }
332
332
  return c;
333
333
  }
334
- function qt(n, e, t, o) {
334
+ function Qt(o, e, t, n) {
335
335
  var u, p, m, f, k;
336
- const s = n.pmSchema.nodes.blockContainer, i = e.props || {};
336
+ const s = o.pmSchema.nodes.blockContainer, r = e.props || {};
337
337
  for (const [g, y] of Object.entries(
338
- n.schema.blockSchema[e.type].propSchema
338
+ o.schema.blockSchema[e.type].propSchema
339
339
  ))
340
- !(g in i) && y.default !== void 0 && (i[g] = y.default);
341
- const r = e.children || [], a = n.blockImplementations[e.type].implementation.render.call(
340
+ !(g in r) && y.default !== void 0 && (r[g] = y.default);
341
+ const i = e.children || [], a = o.blockImplementations[e.type].implementation.render.call(
342
342
  {
343
343
  renderType: "dom",
344
344
  props: void 0
345
345
  },
346
- { ...e, props: i, children: r },
347
- n
346
+ { ...e, props: r, children: i },
347
+ o
348
348
  );
349
349
  if (a.contentDOM && e.content) {
350
350
  const g = Yt(
351
- n,
351
+ o,
352
352
  e.content,
353
353
  // TODO
354
354
  t,
355
355
  e.type,
356
- o
356
+ n
357
357
  );
358
358
  a.contentDOM.appendChild(g);
359
359
  }
360
- if (n.pmSchema.nodes[e.type].isInGroup("bnBlock")) {
360
+ if (o.pmSchema.nodes[e.type].isInGroup("bnBlock")) {
361
361
  if (e.children && e.children.length > 0) {
362
362
  const g = Be(
363
- n,
363
+ o,
364
364
  e.children,
365
365
  t,
366
- o
366
+ n
367
367
  );
368
368
  (u = a.contentDOM) == null || u.append(g);
369
369
  }
@@ -373,33 +373,33 @@ function qt(n, e, t, o) {
373
373
  p,
374
374
  s.create({
375
375
  id: e.id,
376
- ...i
376
+ ...r
377
377
  })
378
378
  );
379
379
  return (f = d.contentDOM) == null || f.appendChild(a.dom), e.children && e.children.length > 0 && ((k = d.contentDOM) == null || k.appendChild(
380
- Ce(n, e.children, t, o)
380
+ Ce(o, e.children, t, n)
381
381
  )), d.dom;
382
382
  }
383
- function Be(n, e, t, o) {
384
- const i = ((o == null ? void 0 : o.document) ?? document).createDocumentFragment();
385
- for (const r of e) {
386
- const c = qt(n, r, t, o);
387
- i.appendChild(c);
383
+ function Be(o, e, t, n) {
384
+ const r = ((n == null ? void 0 : n.document) ?? document).createDocumentFragment();
385
+ for (const i of e) {
386
+ const c = Qt(o, i, t, n);
387
+ r.appendChild(c);
388
388
  }
389
- return i;
389
+ return r;
390
390
  }
391
- const Ce = (n, e, t, o) => {
391
+ const Ce = (o, e, t, n) => {
392
392
  var c;
393
- const s = n.pmSchema.nodes.blockGroup, i = s.spec.toDOM(s.create({})), r = Be(n, e, t, o);
394
- return (c = i.contentDOM) == null || c.appendChild(r), i.dom;
395
- }, Qt = (n, e) => {
396
- const t = he.fromSchema(n);
393
+ const s = o.pmSchema.nodes.blockGroup, r = s.spec.toDOM(s.create({})), i = Be(o, e, t, n);
394
+ return (c = r.contentDOM) == null || c.appendChild(i), r.dom;
395
+ }, Xt = (o, e) => {
396
+ const t = he.fromSchema(o);
397
397
  return {
398
- serializeBlocks: (o, s) => Ce(e, o, t, s).outerHTML
398
+ serializeBlocks: (n, s) => Ce(e, n, t, s).outerHTML
399
399
  };
400
400
  };
401
- function Xt(n) {
402
- return n.transact((e) => {
401
+ function Zt(o) {
402
+ return o.transact((e) => {
403
403
  const t = _(e.doc, e.selection.anchor);
404
404
  if (e.selection instanceof te)
405
405
  return {
@@ -414,127 +414,127 @@ function Xt(n) {
414
414
  anchorBlockId: t.node.attrs.id
415
415
  };
416
416
  {
417
- const o = _(e.doc, e.selection.head);
417
+ const n = _(e.doc, e.selection.head);
418
418
  return {
419
419
  type: "text",
420
420
  anchorBlockId: t.node.attrs.id,
421
- headBlockId: o.node.attrs.id,
421
+ headBlockId: n.node.attrs.id,
422
422
  anchorOffset: e.selection.anchor - t.posBeforeNode,
423
- headOffset: e.selection.head - o.posBeforeNode
423
+ headOffset: e.selection.head - n.posBeforeNode
424
424
  };
425
425
  }
426
426
  });
427
427
  }
428
- function Zt(n, e) {
429
- var s, i;
430
- const t = (s = E(e.anchorBlockId, n.doc)) == null ? void 0 : s.posBeforeNode;
428
+ function eo(o, e) {
429
+ var s, r;
430
+ const t = (s = x(e.anchorBlockId, o.doc)) == null ? void 0 : s.posBeforeNode;
431
431
  if (t === void 0)
432
432
  throw new Error(
433
433
  `Could not find block with ID ${e.anchorBlockId} to update selection`
434
434
  );
435
- let o;
435
+ let n;
436
436
  if (e.type === "cell")
437
- o = te.create(
438
- n.doc,
437
+ n = te.create(
438
+ o.doc,
439
439
  t + e.anchorCellOffset,
440
440
  t + e.headCellOffset
441
441
  );
442
442
  else if (e.type === "node")
443
- o = L.create(n.doc, t + 1);
443
+ n = L.create(o.doc, t + 1);
444
444
  else {
445
- const r = (i = E(e.headBlockId, n.doc)) == null ? void 0 : i.posBeforeNode;
446
- if (r === void 0)
445
+ const i = (r = x(e.headBlockId, o.doc)) == null ? void 0 : r.posBeforeNode;
446
+ if (i === void 0)
447
447
  throw new Error(
448
448
  `Could not find block with ID ${e.headBlockId} to update selection`
449
449
  );
450
- o = M.create(
451
- n.doc,
450
+ n = M.create(
451
+ o.doc,
452
452
  t + e.anchorOffset,
453
- r + e.headOffset
453
+ i + e.headOffset
454
454
  );
455
455
  }
456
- n.setSelection(o);
456
+ o.setSelection(n);
457
457
  }
458
- function K(n) {
459
- return n.map((e) => e.type === "columnList" ? e.children.map((t) => K(t.children)).flat() : {
458
+ function K(o) {
459
+ return o.map((e) => e.type === "columnList" ? e.children.map((t) => K(t.children)).flat() : {
460
460
  ...e,
461
461
  children: K(e.children)
462
462
  }).flat();
463
463
  }
464
- function Ee(n, e, t) {
465
- n.transact((o) => {
466
- var r;
467
- const s = ((r = n.getSelection()) == null ? void 0 : r.blocks) || [
468
- n.getTextCursorPosition().block
469
- ], i = Xt(n);
470
- n.removeBlocks(s), n.insertBlocks(K(s), e, t), Zt(o, i);
464
+ function xe(o, e, t) {
465
+ o.transact((n) => {
466
+ var i;
467
+ const s = ((i = o.getSelection()) == null ? void 0 : i.blocks) || [
468
+ o.getTextCursorPosition().block
469
+ ], r = Zt(o);
470
+ o.removeBlocks(s), o.insertBlocks(K(s), e, t), eo(n, r);
471
471
  });
472
472
  }
473
- function xe(n) {
474
- return !n || n.type !== "columnList";
473
+ function Ee(o) {
474
+ return !o || o.type !== "columnList";
475
475
  }
476
- function Me(n, e, t) {
477
- let o, s;
478
- if (e ? e.children.length > 0 ? (o = e.children[e.children.length - 1], s = "after") : (o = e, s = "before") : t && (o = t, s = "before"), !o || !s)
476
+ function Me(o, e, t) {
477
+ let n, s;
478
+ if (e ? e.children.length > 0 ? (n = e.children[e.children.length - 1], s = "after") : (n = e, s = "before") : t && (n = t, s = "before"), !n || !s)
479
479
  return;
480
- const i = n.getParentBlock(o);
481
- return xe(i) ? { referenceBlock: o, placement: s } : Me(
482
- n,
483
- s === "after" ? o : n.getPrevBlock(o),
484
- i
480
+ const r = o.getParentBlock(n);
481
+ return Ee(r) ? { referenceBlock: n, placement: s } : Me(
482
+ o,
483
+ s === "after" ? n : o.getPrevBlock(n),
484
+ r
485
485
  );
486
486
  }
487
- function we(n, e, t) {
488
- let o, s;
489
- if (e ? e.children.length > 0 ? (o = e.children[0], s = "before") : (o = e, s = "after") : t && (o = t, s = "after"), !o || !s)
487
+ function we(o, e, t) {
488
+ let n, s;
489
+ if (e ? e.children.length > 0 ? (n = e.children[0], s = "before") : (n = e, s = "after") : t && (n = t, s = "after"), !n || !s)
490
490
  return;
491
- const i = n.getParentBlock(o);
492
- return xe(i) ? { referenceBlock: o, placement: s } : we(
493
- n,
494
- s === "before" ? o : n.getNextBlock(o),
495
- i
491
+ const r = o.getParentBlock(n);
492
+ return Ee(r) ? { referenceBlock: n, placement: s } : we(
493
+ o,
494
+ s === "before" ? n : o.getNextBlock(n),
495
+ r
496
496
  );
497
497
  }
498
- function eo(n) {
499
- n.transact(() => {
500
- const e = n.getSelection(), t = (e == null ? void 0 : e.blocks[0]) || n.getTextCursorPosition().block, o = Me(
501
- n,
502
- n.getPrevBlock(t),
503
- n.getParentBlock(t)
498
+ function to(o) {
499
+ o.transact(() => {
500
+ const e = o.getSelection(), t = (e == null ? void 0 : e.blocks[0]) || o.getTextCursorPosition().block, n = Me(
501
+ o,
502
+ o.getPrevBlock(t),
503
+ o.getParentBlock(t)
504
504
  );
505
- o && Ee(
506
- n,
507
- o.referenceBlock,
508
- o.placement
505
+ n && xe(
506
+ o,
507
+ n.referenceBlock,
508
+ n.placement
509
509
  );
510
510
  });
511
511
  }
512
- function to(n) {
513
- n.transact(() => {
514
- const e = n.getSelection(), t = (e == null ? void 0 : e.blocks[(e == null ? void 0 : e.blocks.length) - 1]) || n.getTextCursorPosition().block, o = we(
515
- n,
516
- n.getNextBlock(t),
517
- n.getParentBlock(t)
512
+ function oo(o) {
513
+ o.transact(() => {
514
+ const e = o.getSelection(), t = (e == null ? void 0 : e.blocks[(e == null ? void 0 : e.blocks.length) - 1]) || o.getTextCursorPosition().block, n = we(
515
+ o,
516
+ o.getNextBlock(t),
517
+ o.getParentBlock(t)
518
518
  );
519
- o && Ee(
520
- n,
521
- o.referenceBlock,
522
- o.placement
519
+ n && xe(
520
+ o,
521
+ n.referenceBlock,
522
+ n.placement
523
523
  );
524
524
  });
525
525
  }
526
- function oo(n, e, t) {
527
- const { $from: o, $to: s } = n.selection, i = o.blockRange(
526
+ function no(o, e, t) {
527
+ const { $from: n, $to: s } = o.selection, r = n.blockRange(
528
528
  s,
529
529
  (f) => f.childCount > 0 && (f.type.name === "blockGroup" || f.type.name === "column")
530
530
  // change necessary to not look at first item child type
531
531
  );
532
- if (!i)
532
+ if (!r)
533
533
  return !1;
534
- const r = i.startIndex;
535
- if (r === 0)
534
+ const i = r.startIndex;
535
+ if (i === 0)
536
536
  return !1;
537
- const a = i.parent.child(r - 1);
537
+ const a = r.parent.child(i - 1);
538
538
  if (a.type !== e)
539
539
  return !1;
540
540
  const l = a.lastChild && a.lastChild.type === t, d = A.from(l ? e.create() : null), u = new N(
@@ -544,8 +544,8 @@ function oo(n, e, t) {
544
544
  ),
545
545
  l ? 3 : 1,
546
546
  0
547
- ), p = i.start, m = i.end;
548
- return n.step(
547
+ ), p = r.start, m = r.end;
548
+ return o.step(
549
549
  new V(
550
550
  p - (l ? 3 : 1),
551
551
  m,
@@ -557,60 +557,60 @@ function oo(n, e, t) {
557
557
  )
558
558
  ).scrollIntoView(), !0;
559
559
  }
560
- function Te(n) {
561
- return n.transact((e) => oo(
560
+ function Te(o) {
561
+ return o.transact((e) => no(
562
562
  e,
563
- n.pmSchema.nodes.blockContainer,
564
- n.pmSchema.nodes.blockGroup
563
+ o.pmSchema.nodes.blockContainer,
564
+ o.pmSchema.nodes.blockGroup
565
565
  ));
566
566
  }
567
- function no(n) {
568
- n._tiptapEditor.commands.liftListItem("blockContainer");
567
+ function so(o) {
568
+ o._tiptapEditor.commands.liftListItem("blockContainer");
569
569
  }
570
- function so(n) {
571
- return n.transact((e) => {
572
- const { bnBlock: t } = H(e);
570
+ function ro(o) {
571
+ return o.transact((e) => {
572
+ const { bnBlock: t } = $(e);
573
573
  return e.doc.resolve(t.beforePos).nodeBefore !== null;
574
574
  });
575
575
  }
576
- function ro(n) {
577
- return n.transact((e) => {
578
- const { bnBlock: t } = H(e);
576
+ function io(o) {
577
+ return o.transact((e) => {
578
+ const { bnBlock: t } = $(e);
579
579
  return e.doc.resolve(t.beforePos).depth > 1;
580
580
  });
581
581
  }
582
- function io(n, e) {
583
- const t = typeof e == "string" ? e : e.id, o = C(n), s = E(t, n);
582
+ function ao(o, e) {
583
+ const t = typeof e == "string" ? e : e.id, n = C(o), s = x(t, o);
584
584
  if (s)
585
- return b(s.node, o);
585
+ return b(s.node, n);
586
586
  }
587
- function ao(n, e) {
588
- const t = typeof e == "string" ? e : e.id, o = E(t, n), s = C(n);
589
- if (!o)
587
+ function co(o, e) {
588
+ const t = typeof e == "string" ? e : e.id, n = x(t, o), s = C(o);
589
+ if (!n)
590
590
  return;
591
- const r = n.resolve(o.posBeforeNode).nodeBefore;
592
- if (r)
593
- return b(r, s);
591
+ const i = o.resolve(n.posBeforeNode).nodeBefore;
592
+ if (i)
593
+ return b(i, s);
594
594
  }
595
- function co(n, e) {
596
- const t = typeof e == "string" ? e : e.id, o = E(t, n), s = C(n);
597
- if (!o)
595
+ function lo(o, e) {
596
+ const t = typeof e == "string" ? e : e.id, n = x(t, o), s = C(o);
597
+ if (!n)
598
598
  return;
599
- const r = n.resolve(
600
- o.posBeforeNode + o.node.nodeSize
599
+ const i = o.resolve(
600
+ n.posBeforeNode + n.node.nodeSize
601
601
  ).nodeAfter;
602
- if (r)
603
- return b(r, s);
602
+ if (i)
603
+ return b(i, s);
604
604
  }
605
- function lo(n, e) {
606
- const t = typeof e == "string" ? e : e.id, o = C(n), s = E(t, n);
605
+ function uo(o, e) {
606
+ const t = typeof e == "string" ? e : e.id, n = C(o), s = x(t, o);
607
607
  if (!s)
608
608
  return;
609
- const i = n.resolve(s.posBeforeNode), r = i.node(), c = i.node(-1), a = c.type.name !== "doc" ? r.type.name === "blockGroup" ? c : r : void 0;
609
+ const r = o.resolve(s.posBeforeNode), i = r.node(), c = r.node(-1), a = c.type.name !== "doc" ? i.type.name === "blockGroup" ? c : i : void 0;
610
610
  if (a)
611
- return b(a, o);
611
+ return b(a, n);
612
612
  }
613
- class uo {
613
+ class po {
614
614
  constructor(e) {
615
615
  this.editor = e;
616
616
  }
@@ -629,7 +629,7 @@ class uo {
629
629
  * matching block was found.
630
630
  */
631
631
  getBlock(e) {
632
- return this.editor.transact((t) => io(t.doc, e));
632
+ return this.editor.transact((t) => ao(t.doc, e));
633
633
  }
634
634
  /**
635
635
  * Gets a snapshot of the previous sibling of an existing block from the
@@ -641,7 +641,7 @@ class uo {
641
641
  * in the document.
642
642
  */
643
643
  getPrevBlock(e) {
644
- return this.editor.transact((t) => ao(t.doc, e));
644
+ return this.editor.transact((t) => co(t.doc, e));
645
645
  }
646
646
  /**
647
647
  * Gets a snapshot of the next sibling of an existing block from the editor.
@@ -652,7 +652,7 @@ class uo {
652
652
  * the document.
653
653
  */
654
654
  getNextBlock(e) {
655
- return this.editor.transact((t) => co(t.doc, e));
655
+ return this.editor.transact((t) => lo(t.doc, e));
656
656
  }
657
657
  /**
658
658
  * Gets a snapshot of the parent of an existing block from the editor.
@@ -663,7 +663,7 @@ class uo {
663
663
  */
664
664
  getParentBlock(e) {
665
665
  return this.editor.transact(
666
- (t) => lo(t.doc, e)
666
+ (t) => uo(t.doc, e)
667
667
  );
668
668
  }
669
669
  /**
@@ -672,19 +672,19 @@ class uo {
672
672
  * @param reverse Whether the blocks should be traversed in reverse order.
673
673
  */
674
674
  forEachBlock(e, t = !1) {
675
- const o = this.document.slice();
676
- t && o.reverse();
677
- function s(i) {
678
- for (const r of i) {
679
- if (e(r) === !1)
675
+ const n = this.document.slice();
676
+ t && n.reverse();
677
+ function s(r) {
678
+ for (const i of r) {
679
+ if (e(i) === !1)
680
680
  return !1;
681
- const c = t ? r.children.slice().reverse() : r.children;
681
+ const c = t ? i.children.slice().reverse() : i.children;
682
682
  if (!s(c))
683
683
  return !1;
684
684
  }
685
685
  return !0;
686
686
  }
687
- s(o);
687
+ s(n);
688
688
  }
689
689
  /**
690
690
  * Inserts new blocks into the editor. If a block's `id` is undefined, BlockNote generates one automatically. Throws an
@@ -694,9 +694,9 @@ class uo {
694
694
  * @param placement Whether the blocks should be inserted just before, just after, or nested inside the
695
695
  * `referenceBlock`.
696
696
  */
697
- insertBlocks(e, t, o = "before") {
697
+ insertBlocks(e, t, n = "before") {
698
698
  return this.editor.transact(
699
- (s) => Kt(s, e, t, o)
699
+ (s) => Jt(s, e, t, n)
700
700
  );
701
701
  }
702
702
  /**
@@ -707,7 +707,7 @@ class uo {
707
707
  * @param update A partial block which defines how the existing block should be changed.
708
708
  */
709
709
  updateBlock(e, t) {
710
- return this.editor.transact((o) => Ye(o, e, t));
710
+ return this.editor.transact((n) => qe(n, e, t));
711
711
  }
712
712
  /**
713
713
  * Removes existing blocks from the editor. Throws an error if any of the blocks could not be found.
@@ -727,14 +727,14 @@ class uo {
727
727
  */
728
728
  replaceBlocks(e, t) {
729
729
  return this.editor.transact(
730
- (o) => ie(o, e, t)
730
+ (n) => ie(n, e, t)
731
731
  );
732
732
  }
733
733
  /**
734
734
  * Checks if the block containing the text cursor can be nested.
735
735
  */
736
736
  canNestBlock() {
737
- return so(this.editor);
737
+ return ro(this.editor);
738
738
  }
739
739
  /**
740
740
  * Nests the block containing the text cursor into the block above it.
@@ -746,13 +746,13 @@ class uo {
746
746
  * Checks if the block containing the text cursor is nested.
747
747
  */
748
748
  canUnnestBlock() {
749
- return ro(this.editor);
749
+ return io(this.editor);
750
750
  }
751
751
  /**
752
752
  * Lifts the block containing the text cursor out of its parent.
753
753
  */
754
754
  unnestBlock() {
755
- no(this.editor);
755
+ so(this.editor);
756
756
  }
757
757
  /**
758
758
  * Moves the selected blocks up. If the previous block has children, moves
@@ -760,7 +760,7 @@ class uo {
760
760
  * current blocks share a common parent, moves them out of & before it.
761
761
  */
762
762
  moveBlocksUp() {
763
- return eo(this.editor);
763
+ return to(this.editor);
764
764
  }
765
765
  /**
766
766
  * Moves the selected blocks down. If the next block has children, moves
@@ -768,16 +768,16 @@ class uo {
768
768
  * current blocks share a common parent, moves them out of & after it.
769
769
  */
770
770
  moveBlocksDown() {
771
- return to(this.editor);
771
+ return oo(this.editor);
772
772
  }
773
773
  }
774
- class po extends Se {
774
+ class fo extends Se {
775
775
  constructor(e) {
776
776
  super(), this.editor = e, e.on("create", () => {
777
777
  e._tiptapEditor.on(
778
778
  "update",
779
- ({ transaction: t, appendedTransactions: o }) => {
780
- this.emit("onChange", { editor: e, transaction: t, appendedTransactions: o });
779
+ ({ transaction: t, appendedTransactions: n }) => {
780
+ this.emit("onChange", { editor: e, transaction: t, appendedTransactions: n });
781
781
  }
782
782
  ), e._tiptapEditor.on("selectionUpdate", ({ transaction: t }) => {
783
783
  this.emit("onSelectionChange", { editor: e, transaction: t });
@@ -792,32 +792,32 @@ class po extends Se {
792
792
  * Register a callback that will be called when the editor changes.
793
793
  */
794
794
  onChange(e, t = !0) {
795
- const o = ({
795
+ const n = ({
796
796
  transaction: s,
797
- appendedTransactions: i
797
+ appendedTransactions: r
798
798
  }) => {
799
799
  !t && ae(s) || e(this.editor, {
800
800
  getChanges() {
801
801
  return ot(
802
802
  s,
803
- i
803
+ r
804
804
  );
805
805
  }
806
806
  });
807
807
  };
808
- return this.on("onChange", o), () => {
809
- this.off("onChange", o);
808
+ return this.on("onChange", n), () => {
809
+ this.off("onChange", n);
810
810
  };
811
811
  }
812
812
  /**
813
813
  * Register a callback that will be called when the selection changes.
814
814
  */
815
815
  onSelectionChange(e, t = !1) {
816
- const o = (s) => {
816
+ const n = (s) => {
817
817
  !t && ae(s.transaction) || e(this.editor);
818
818
  };
819
- return this.on("onSelectionChange", o), () => {
820
- this.off("onSelectionChange", o);
819
+ return this.on("onSelectionChange", n), () => {
820
+ this.off("onSelectionChange", n);
821
821
  };
822
822
  }
823
823
  /**
@@ -837,108 +837,118 @@ class po extends Se {
837
837
  };
838
838
  }
839
839
  }
840
- function ae(n) {
841
- return !!n.getMeta("y-sync$");
840
+ function ae(o) {
841
+ return !!o.getMeta("y-sync$");
842
842
  }
843
- function fo(n) {
844
- return Array.prototype.indexOf.call(n.parentElement.childNodes, n);
843
+ function ho(o) {
844
+ return Array.prototype.indexOf.call(o.parentElement.childNodes, o);
845
845
  }
846
- function ho(n) {
847
- return n.nodeType === 3 && !/\S/.test(n.nodeValue || "");
846
+ function mo(o) {
847
+ return o.nodeType === 3 && !/\S/.test(o.nodeValue || "");
848
848
  }
849
- function mo(n) {
850
- n.querySelectorAll("li > ul, li > ol").forEach((e) => {
851
- const t = fo(e), o = e.parentElement, s = Array.from(o.childNodes).slice(
849
+ function ko(o) {
850
+ o.querySelectorAll("li > ul, li > ol").forEach((e) => {
851
+ const t = ho(e), n = e.parentElement, s = Array.from(n.childNodes).slice(
852
852
  t + 1
853
853
  );
854
- e.remove(), s.forEach((i) => {
855
- i.remove();
856
- }), o.insertAdjacentElement("afterend", e), s.reverse().forEach((i) => {
857
- if (ho(i))
854
+ e.remove(), s.forEach((r) => {
855
+ r.remove();
856
+ }), n.insertAdjacentElement("afterend", e), s.reverse().forEach((r) => {
857
+ if (mo(r))
858
858
  return;
859
- const r = document.createElement("li");
860
- r.append(i), e.insertAdjacentElement("afterend", r);
861
- }), o.childNodes.length === 0 && o.remove();
859
+ const i = document.createElement("li");
860
+ i.append(r), e.insertAdjacentElement("afterend", i);
861
+ }), n.childNodes.length === 0 && n.remove();
862
862
  });
863
863
  }
864
- function ko(n) {
865
- n.querySelectorAll("li + ul, li + ol").forEach((e) => {
866
- var i, r;
867
- const t = e.previousElementSibling, o = document.createElement("div");
868
- t.insertAdjacentElement("afterend", o), o.append(t);
864
+ function go(o) {
865
+ o.querySelectorAll("li + ul, li + ol").forEach((e) => {
866
+ var r, i;
867
+ const t = e.previousElementSibling, n = document.createElement("div");
868
+ t.insertAdjacentElement("afterend", n), n.append(t);
869
869
  const s = document.createElement("div");
870
- for (s.setAttribute("data-node-type", "blockGroup"), o.append(s); ((i = o.nextElementSibling) == null ? void 0 : i.nodeName) === "UL" || ((r = o.nextElementSibling) == null ? void 0 : r.nodeName) === "OL"; )
871
- s.append(o.nextElementSibling);
870
+ for (s.setAttribute("data-node-type", "blockGroup"), n.append(s); ((r = n.nextElementSibling) == null ? void 0 : r.nodeName) === "UL" || ((i = n.nextElementSibling) == null ? void 0 : i.nodeName) === "OL"; )
871
+ s.append(n.nextElementSibling);
872
872
  });
873
873
  }
874
874
  let ce = null;
875
- function go() {
875
+ function bo() {
876
876
  return ce || (ce = document.implementation.createHTMLDocument("title"));
877
877
  }
878
- function bo(n) {
879
- if (typeof n == "string") {
880
- const e = go().createElement("div");
881
- e.innerHTML = n, n = e;
878
+ function yo(o) {
879
+ if (typeof o == "string") {
880
+ const e = bo().createElement("div");
881
+ e.innerHTML = o, o = e;
882
882
  }
883
- return mo(n), ko(n), n;
883
+ return ko(o), go(o), o;
884
884
  }
885
- function Pe(n, e) {
886
- const t = bo(n), s = He.fromSchema(e).parse(t, {
885
+ function Pe(o, e) {
886
+ const t = yo(o), s = $e.fromSchema(e).parse(t, {
887
887
  topNode: e.nodes.blockGroup.create()
888
- }), i = [];
889
- for (let r = 0; r < s.childCount; r++)
890
- i.push(b(s.child(r), e));
891
- return i;
892
- }
893
- function yo(n, e) {
894
- const t = e.value ? e.value : "", o = {};
895
- e.lang && (o["data-language"] = e.lang);
888
+ }), r = [];
889
+ for (let i = 0; i < s.childCount; i++)
890
+ r.push(b(s.child(i), e));
891
+ return r;
892
+ }
893
+ function So(o, e) {
894
+ const t = e.value ? e.value : "", n = {};
895
+ e.lang && (n["data-language"] = e.lang);
896
896
  let s = {
897
897
  type: "element",
898
898
  tagName: "code",
899
- properties: o,
899
+ properties: n,
900
900
  children: [{ type: "text", value: t }]
901
901
  };
902
- return e.meta && (s.data = { meta: e.meta }), n.patch(e, s), s = n.applyData(e, s), s = {
902
+ return e.meta && (s.data = { meta: e.meta }), o.patch(e, s), s = o.applyData(e, s), s = {
903
903
  type: "element",
904
904
  tagName: "pre",
905
905
  properties: {},
906
906
  children: [s]
907
- }, n.patch(e, s), s;
907
+ }, o.patch(e, s), s;
908
908
  }
909
- function So(n, e) {
910
- var i;
911
- const t = String((e == null ? void 0 : e.url) || ""), o = e != null && e.title ? String(e.title) : void 0;
909
+ function Bo(o, e) {
910
+ var r;
911
+ const t = String((e == null ? void 0 : e.url) || ""), n = e != null && e.title ? String(e.title) : void 0;
912
912
  let s = {
913
913
  type: "element",
914
914
  tagName: "video",
915
915
  properties: {
916
916
  src: t,
917
- "data-name": o,
917
+ "data-name": n,
918
918
  "data-url": t,
919
919
  controls: !0
920
920
  },
921
921
  children: []
922
922
  };
923
- return (i = n.patch) == null || i.call(n, e, s), s = n.applyData ? n.applyData(e, s) : s, s;
923
+ return (r = o.patch) == null || r.call(o, e, s), s = o.applyData ? o.applyData(e, s) : s, s;
924
924
  }
925
- function ve(n) {
926
- return Rt().use(Ut).use(Vt).use(zt, {
925
+ function ve(o) {
926
+ return jt().use(zt).use(Ut).use(Gt, {
927
927
  handlers: {
928
928
  ...re,
929
- image: (t, o) => {
930
- const s = String((o == null ? void 0 : o.url) || "");
931
- return qe(s) ? So(t, o) : re.image(t, o);
929
+ image: (t, n) => {
930
+ const s = String((n == null ? void 0 : n.url) || "");
931
+ return Ye(s) ? Bo(t, n) : re.image(t, n);
932
932
  },
933
- code: yo
933
+ code: So,
934
+ blockquote: (t, n) => {
935
+ const s = {
936
+ type: "element",
937
+ tagName: "blockquote",
938
+ properties: {},
939
+ // The only difference from the original is that we don't wrap the children with line endings
940
+ children: t.wrap(t.all(n), !1)
941
+ };
942
+ return t.patch(n, s), t.applyData(n, s);
943
+ }
934
944
  }
935
- }).use(Gt).processSync(n).value;
945
+ }).use(Rt).processSync(o).value;
936
946
  }
937
- function Bo(n, e) {
938
- const t = ve(n);
947
+ function Co(o, e) {
948
+ const t = ve(o);
939
949
  return Pe(t, e);
940
950
  }
941
- class Co {
951
+ class xo {
942
952
  constructor(e) {
943
953
  this.editor = e;
944
954
  }
@@ -965,7 +975,7 @@ class Co {
965
975
  * @returns The blocks, serialized as an HTML string.
966
976
  */
967
977
  blocksToFullHTML(e = this.editor.document) {
968
- return Qt(
978
+ return Xt(
969
979
  this.editor.pmSchema,
970
980
  this.editor
971
981
  ).serializeBlocks(e, {});
@@ -997,7 +1007,7 @@ class Co {
997
1007
  * @returns The blocks parsed from the Markdown string.
998
1008
  */
999
1009
  tryParseMarkdownToBlocks(e) {
1000
- return Bo(e, this.editor.pmSchema);
1010
+ return Co(e, this.editor.pmSchema);
1001
1011
  }
1002
1012
  /**
1003
1013
  * Paste HTML into the editor. Defaults to converting HTML to BlockNote HTML.
@@ -1006,12 +1016,12 @@ class Co {
1006
1016
  */
1007
1017
  pasteHTML(e, t = !1) {
1008
1018
  var s;
1009
- let o = e;
1019
+ let n = e;
1010
1020
  if (!t) {
1011
- const i = this.tryParseHTMLToBlocks(e);
1012
- o = this.blocksToFullHTML(i);
1021
+ const r = this.tryParseHTMLToBlocks(e);
1022
+ n = this.blocksToFullHTML(r);
1013
1023
  }
1014
- o && ((s = this.editor.prosemirrorView) == null || s.pasteHTML(o));
1024
+ n && ((s = this.editor.prosemirrorView) == null || s.pasteHTML(n));
1015
1025
  }
1016
1026
  /**
1017
1027
  * Paste text into the editor. Defaults to interpreting text as markdown.
@@ -1038,55 +1048,55 @@ const oe = [
1038
1048
  "text/plain",
1039
1049
  "Files"
1040
1050
  ];
1041
- function Eo(n, e) {
1042
- if (!n.startsWith(".") || !e.startsWith("."))
1051
+ function Eo(o, e) {
1052
+ if (!o.startsWith(".") || !e.startsWith("."))
1043
1053
  throw new Error("The strings provided are not valid file extensions.");
1044
- return n === e;
1054
+ return o === e;
1045
1055
  }
1046
- function xo(n, e) {
1047
- const t = n.split("/"), o = e.split("/");
1056
+ function Mo(o, e) {
1057
+ const t = o.split("/"), n = e.split("/");
1048
1058
  if (t.length !== 2)
1049
- throw new Error(`The string ${n} is not a valid MIME type.`);
1050
- if (o.length !== 2)
1059
+ throw new Error(`The string ${o} is not a valid MIME type.`);
1060
+ if (n.length !== 2)
1051
1061
  throw new Error(`The string ${e} is not a valid MIME type.`);
1052
- return t[1] === "*" || o[1] === "*" ? t[0] === o[0] : (t[0] === "*" || o[0] === "*" || t[0] === o[0]) && t[1] === o[1];
1062
+ return t[1] === "*" || n[1] === "*" ? t[0] === n[0] : (t[0] === "*" || n[0] === "*" || t[0] === n[0]) && t[1] === n[1];
1053
1063
  }
1054
- function le(n, e, t, o = "after") {
1064
+ function le(o, e, t, n = "after") {
1055
1065
  let s;
1056
- return Array.isArray(e.content) && e.content.length === 0 ? s = n.updateBlock(e, t).id : s = n.insertBlocks(
1066
+ return Array.isArray(e.content) && e.content.length === 0 ? s = o.updateBlock(e, t).id : s = o.insertBlocks(
1057
1067
  [t],
1058
1068
  e,
1059
- o
1069
+ n
1060
1070
  )[0].id, s;
1061
1071
  }
1062
- async function Ie(n, e) {
1063
- var i;
1072
+ async function Ie(o, e) {
1073
+ var r;
1064
1074
  if (!e.uploadFile) {
1065
1075
  console.warn(
1066
1076
  "Attempted ot insert file, but uploadFile is not set in the BlockNote editor options"
1067
1077
  );
1068
1078
  return;
1069
1079
  }
1070
- const t = "dataTransfer" in n ? n.dataTransfer : n.clipboardData;
1080
+ const t = "dataTransfer" in o ? o.dataTransfer : o.clipboardData;
1071
1081
  if (t === null)
1072
1082
  return;
1073
- let o = null;
1074
- for (const r of oe)
1075
- if (t.types.includes(r)) {
1076
- o = r;
1083
+ let n = null;
1084
+ for (const i of oe)
1085
+ if (t.types.includes(i)) {
1086
+ n = i;
1077
1087
  break;
1078
1088
  }
1079
- if (o !== "Files")
1089
+ if (n !== "Files")
1080
1090
  return;
1081
1091
  const s = t.items;
1082
1092
  if (s) {
1083
- n.preventDefault();
1084
- for (let r = 0; r < s.length; r++) {
1093
+ o.preventDefault();
1094
+ for (let i = 0; i < s.length; i++) {
1085
1095
  let c = "file";
1086
1096
  for (const l of Object.values(e.schema.blockSpecs))
1087
- for (const d of ((i = l.implementation.meta) == null ? void 0 : i.fileBlockAccept) || []) {
1088
- const u = d.startsWith("."), p = s[r].getAsFile();
1089
- if (p && (!u && p.type && xo(s[r].type, d) || u && Eo(
1097
+ for (const d of ((r = l.implementation.meta) == null ? void 0 : r.fileBlockAccept) || []) {
1098
+ const u = d.startsWith("."), p = s[i].getAsFile();
1099
+ if (p && (!u && p.type && Mo(s[i].type, d) || u && Eo(
1090
1100
  "." + p.name.split(".").pop(),
1091
1101
  d
1092
1102
  ))) {
@@ -1094,7 +1104,7 @@ async function Ie(n, e) {
1094
1104
  break;
1095
1105
  }
1096
1106
  }
1097
- const a = s[r].getAsFile();
1107
+ const a = s[i].getAsFile();
1098
1108
  if (a) {
1099
1109
  const l = {
1100
1110
  type: c,
@@ -1103,13 +1113,13 @@ async function Ie(n, e) {
1103
1113
  }
1104
1114
  };
1105
1115
  let d;
1106
- if (n.type === "paste") {
1116
+ if (o.type === "paste") {
1107
1117
  const m = e.getTextCursorPosition().block;
1108
1118
  d = le(e, m, l);
1109
- } else if (n.type === "drop") {
1119
+ } else if (o.type === "drop") {
1110
1120
  const m = {
1111
- left: n.clientX,
1112
- top: n.clientY
1121
+ left: o.clientX,
1122
+ top: o.clientY
1113
1123
  }, f = e.prosemirrorView.posAtCoords(m);
1114
1124
  if (!f)
1115
1125
  return;
@@ -1137,7 +1147,7 @@ async function Ie(n, e) {
1137
1147
  }
1138
1148
  }
1139
1149
  }
1140
- const Mo = (n) => x.create({
1150
+ const wo = (o) => E.create({
1141
1151
  name: "dropFile",
1142
1152
  addProseMirrorPlugins() {
1143
1153
  return [
@@ -1145,98 +1155,98 @@ const Mo = (n) => x.create({
1145
1155
  props: {
1146
1156
  handleDOMEvents: {
1147
1157
  drop(e, t) {
1148
- if (!n.isEditable)
1158
+ if (!o.isEditable)
1149
1159
  return;
1150
- let o = null;
1160
+ let n = null;
1151
1161
  for (const s of oe)
1152
1162
  if (t.dataTransfer.types.includes(s)) {
1153
- o = s;
1163
+ n = s;
1154
1164
  break;
1155
1165
  }
1156
- return o === null ? !0 : o === "Files" ? (Ie(t, n), !0) : !1;
1166
+ return n === null ? !0 : n === "Files" ? (Ie(t, o), !0) : !1;
1157
1167
  }
1158
1168
  }
1159
1169
  }
1160
1170
  })
1161
1171
  ];
1162
1172
  }
1163
- }), wo = /(^|\n) {0,3}#{1,6} {1,8}[^\n]{1,64}\r?\n\r?\n\s{0,32}\S/, To = /(_|__|\*|\*\*|~~|==|\+\+)(?!\s)(?:[^\s](?:.{0,62}[^\s])?|\S)(?=\1)/, Po = /\[[^\]]{1,128}\]\(https?:\/\/\S{1,999}\)/, vo = /(?:\s|^)`(?!\s)(?:[^\s`](?:[^`]{0,46}[^\s`])?|[^\s`])`([^\w]|$)/, Io = /(?:^|\n)\s{0,5}-\s{1}[^\n]+\n\s{0,15}-\s/, Ao = /(?:^|\n)\s{0,5}\d+\.\s{1}[^\n]+\n\s{0,15}\d+\.\s/, _o = /\n{2} {0,3}-{2,48}\n{2}/, Do = /(?:\n|^)(```|~~~|\$\$)(?!`|~)[^\s]{0,64} {0,64}[^\n]{0,64}\n[\s\S]{0,9999}?\s*\1 {0,64}(?:\n+|$)/, Lo = /(?:\n|^)(?!\s)\w[^\n]{0,64}\r?\n(-|=)\1{0,64}\n\n\s{0,64}(\w|$)/, No = /(?:^|(\r?\n\r?\n))( {0,3}>[^\n]{1,333}\n){1,999}($|(\r?\n))/, Oo = /^\s*\|(.+\|)+\s*$/m, Fo = /^\s*\|(\s*[-:]+[-:]\s*\|)+\s*$/m, Ho = /^\s*\|(.+\|)+\s*$/m, $o = (n) => wo.test(n) || To.test(n) || Po.test(n) || vo.test(n) || Io.test(n) || Ao.test(n) || _o.test(n) || Do.test(n) || Lo.test(n) || No.test(n) || Oo.test(n) || Fo.test(n) || Ho.test(n);
1164
- async function Vo(n, e) {
1173
+ }), To = /(^|\n) {0,3}#{1,6} {1,8}[^\n]{1,64}\r?\n\r?\n\s{0,32}\S/, Po = /(_|__|\*|\*\*|~~|==|\+\+)(?!\s)(?:[^\s](?:.{0,62}[^\s])?|\S)(?=\1)/, vo = /\[[^\]]{1,128}\]\(https?:\/\/\S{1,999}\)/, Io = /(?:\s|^)`(?!\s)(?:[^\s`](?:[^`]{0,46}[^\s`])?|[^\s`])`([^\w]|$)/, Ao = /(?:^|\n)\s{0,5}-\s{1}[^\n]+\n\s{0,15}-\s/, _o = /(?:^|\n)\s{0,5}\d+\.\s{1}[^\n]+\n\s{0,15}\d+\.\s/, Do = /\n{2} {0,3}-{2,48}\n{2}/, Lo = /(?:\n|^)(```|~~~|\$\$)(?!`|~)[^\s]{0,64} {0,64}[^\n]{0,64}\n[\s\S]{0,9999}?\s*\1 {0,64}(?:\n+|$)/, No = /(?:\n|^)(?!\s)\w[^\n]{0,64}\r?\n(-|=)\1{0,64}\n\n\s{0,64}(\w|$)/, Oo = /(?:^|(\r?\n\r?\n))( {0,3}>[^\n]{1,333}\n){1,999}($|(\r?\n))/, Fo = /^\s*\|(.+\|)+\s*$/m, $o = /^\s*\|(\s*[-:]+[-:]\s*\|)+\s*$/m, Ho = /^\s*\|(.+\|)+\s*$/m, Vo = (o) => To.test(o) || Po.test(o) || vo.test(o) || Io.test(o) || Ao.test(o) || _o.test(o) || Do.test(o) || Lo.test(o) || No.test(o) || Oo.test(o) || Fo.test(o) || $o.test(o) || Ho.test(o);
1174
+ async function Uo(o, e) {
1165
1175
  const { schema: t } = e.state;
1166
- if (!n.clipboardData)
1176
+ if (!o.clipboardData)
1167
1177
  return !1;
1168
- const o = n.clipboardData.getData("text/plain");
1169
- if (!o)
1178
+ const n = o.clipboardData.getData("text/plain");
1179
+ if (!n)
1170
1180
  return !1;
1171
1181
  if (!t.nodes.codeBlock)
1172
- return e.pasteText(o), !0;
1173
- const s = n.clipboardData.getData("vscode-editor-data"), i = s ? JSON.parse(s) : void 0, r = i == null ? void 0 : i.mode;
1174
- return r ? (e.pasteHTML(
1175
- `<pre><code class="language-${r}">${o.replace(
1182
+ return e.pasteText(n), !0;
1183
+ const s = o.clipboardData.getData("vscode-editor-data"), r = s ? JSON.parse(s) : void 0, i = r == null ? void 0 : r.mode;
1184
+ return i ? (e.pasteHTML(
1185
+ `<pre><code class="language-${i}">${n.replace(
1176
1186
  /\r\n?/g,
1177
1187
  `
1178
1188
  `
1179
1189
  )}</code></pre>`
1180
1190
  ), !0) : !1;
1181
1191
  }
1182
- function Uo({
1183
- event: n,
1192
+ function zo({
1193
+ event: o,
1184
1194
  editor: e,
1185
1195
  prioritizeMarkdownOverHTML: t,
1186
- plainTextAsMarkdown: o
1196
+ plainTextAsMarkdown: n
1187
1197
  }) {
1188
1198
  var c;
1189
1199
  if (e.transact(
1190
1200
  (a) => a.selection.$from.parent.type.spec.code && a.selection.$to.parent.type.spec.code
1191
1201
  )) {
1192
- const a = (c = n.clipboardData) == null ? void 0 : c.getData("text/plain");
1202
+ const a = (c = o.clipboardData) == null ? void 0 : c.getData("text/plain");
1193
1203
  if (a)
1194
1204
  return e.pasteText(a), !0;
1195
1205
  }
1196
- let i;
1206
+ let r;
1197
1207
  for (const a of oe)
1198
- if (n.clipboardData.types.includes(a)) {
1199
- i = a;
1208
+ if (o.clipboardData.types.includes(a)) {
1209
+ r = a;
1200
1210
  break;
1201
1211
  }
1202
- if (!i)
1212
+ if (!r)
1203
1213
  return !0;
1204
- if (i === "vscode-editor-data")
1205
- return Vo(n, e.prosemirrorView), !0;
1206
- if (i === "Files")
1207
- return Ie(n, e), !0;
1208
- const r = n.clipboardData.getData(i);
1209
- if (i === "blocknote/html")
1210
- return e.pasteHTML(r, !0), !0;
1211
- if (i === "text/markdown")
1212
- return e.pasteMarkdown(r), !0;
1214
+ if (r === "vscode-editor-data")
1215
+ return Uo(o, e.prosemirrorView), !0;
1216
+ if (r === "Files")
1217
+ return Ie(o, e), !0;
1218
+ const i = o.clipboardData.getData(r);
1219
+ if (r === "blocknote/html")
1220
+ return e.pasteHTML(i, !0), !0;
1221
+ if (r === "text/markdown")
1222
+ return e.pasteMarkdown(i), !0;
1213
1223
  if (t) {
1214
- const a = n.clipboardData.getData("text/plain");
1215
- if ($o(a))
1224
+ const a = o.clipboardData.getData("text/plain");
1225
+ if (Vo(a))
1216
1226
  return e.pasteMarkdown(a), !0;
1217
1227
  }
1218
- return i === "text/html" ? (e.pasteHTML(r), !0) : o ? (e.pasteMarkdown(r), !0) : (e.pasteText(r), !0);
1228
+ return r === "text/html" ? (e.pasteHTML(i), !0) : n ? (e.pasteMarkdown(i), !0) : (e.pasteText(i), !0);
1219
1229
  }
1220
- const zo = (n, e) => x.create({
1230
+ const Go = (o, e) => E.create({
1221
1231
  name: "pasteFromClipboard",
1222
1232
  addProseMirrorPlugins() {
1223
1233
  return [
1224
1234
  new ee({
1225
1235
  props: {
1226
1236
  handleDOMEvents: {
1227
- paste(t, o) {
1228
- if (o.preventDefault(), !!n.isEditable)
1237
+ paste(t, n) {
1238
+ if (n.preventDefault(), !!o.isEditable)
1229
1239
  return e({
1230
- event: o,
1231
- editor: n,
1240
+ event: n,
1241
+ editor: o,
1232
1242
  defaultPasteHandler: ({
1233
1243
  prioritizeMarkdownOverHTML: s = !0,
1234
- plainTextAsMarkdown: i = !0
1235
- } = {}) => Uo({
1236
- event: o,
1237
- editor: n,
1244
+ plainTextAsMarkdown: r = !0
1245
+ } = {}) => zo({
1246
+ event: n,
1247
+ editor: o,
1238
1248
  prioritizeMarkdownOverHTML: s,
1239
- plainTextAsMarkdown: i
1249
+ plainTextAsMarkdown: r
1240
1250
  })
1241
1251
  });
1242
1252
  }
@@ -1246,25 +1256,25 @@ const zo = (n, e) => x.create({
1246
1256
  ];
1247
1257
  }
1248
1258
  });
1249
- function Go(n, e, t) {
1259
+ function Ro(o, e, t) {
1250
1260
  var c;
1251
- let o = !1;
1252
- const s = n.state.selection instanceof te;
1261
+ let n = !1;
1262
+ const s = o.state.selection instanceof te;
1253
1263
  if (!s) {
1254
- const a = n.state.doc.slice(
1255
- n.state.selection.from,
1256
- n.state.selection.to,
1264
+ const a = o.state.doc.slice(
1265
+ o.state.selection.from,
1266
+ o.state.selection.to,
1257
1267
  !1
1258
1268
  ).content, l = [];
1259
1269
  for (let d = 0; d < a.childCount; d++)
1260
1270
  l.push(a.child(d));
1261
- o = l.find(
1271
+ n = l.find(
1262
1272
  (d) => d.type.isInGroup("bnBlock") || d.type.name === "blockGroup" || d.type.spec.group === "blockContent"
1263
- ) === void 0, o && (e = a);
1273
+ ) === void 0, n && (e = a);
1264
1274
  }
1265
- let i;
1266
- const r = be(
1267
- n.state.schema,
1275
+ let r;
1276
+ const i = be(
1277
+ o.state.schema,
1268
1278
  t
1269
1279
  );
1270
1280
  if (s) {
@@ -1274,57 +1284,57 @@ function Go(n, e, t) {
1274
1284
  t.schema.inlineContentSchema,
1275
1285
  t.schema.styleSchema
1276
1286
  );
1277
- i = `<table>${r.exportInlineContent(
1287
+ r = `<table>${i.exportInlineContent(
1278
1288
  a,
1279
1289
  {}
1280
1290
  )}</table>`;
1281
- } else if (o) {
1291
+ } else if (n) {
1282
1292
  const a = Re(
1283
1293
  e,
1284
1294
  t.schema.inlineContentSchema,
1285
1295
  t.schema.styleSchema
1286
1296
  );
1287
- i = r.exportInlineContent(a, {});
1297
+ r = i.exportInlineContent(a, {});
1288
1298
  } else {
1289
1299
  const a = rt(e);
1290
- i = r.exportBlocks(a, {});
1300
+ r = i.exportBlocks(a, {});
1291
1301
  }
1292
- return i;
1302
+ return r;
1293
1303
  }
1294
- function Ae(n, e) {
1295
- "node" in n.state.selection && n.state.selection.node.type.spec.group === "blockContent" && e.transact(
1296
- (r) => r.setSelection(
1297
- new L(r.doc.resolve(n.state.selection.from - 1))
1304
+ function Ae(o, e) {
1305
+ "node" in o.state.selection && o.state.selection.node.type.spec.group === "blockContent" && e.transact(
1306
+ (i) => i.setSelection(
1307
+ new L(i.doc.resolve(o.state.selection.from - 1))
1298
1308
  )
1299
1309
  );
1300
- const t = n.serializeForClipboard(
1301
- n.state.selection.content()
1302
- ).dom.innerHTML, o = n.state.selection.content().content, s = Go(
1303
- n,
1310
+ const t = o.serializeForClipboard(
1311
+ o.state.selection.content()
1312
+ ).dom.innerHTML, n = o.state.selection.content().content, s = Ro(
1304
1313
  o,
1314
+ n,
1305
1315
  e
1306
- ), i = st(s);
1307
- return { clipboardHTML: t, externalHTML: s, markdown: i };
1316
+ ), r = st(s);
1317
+ return { clipboardHTML: t, externalHTML: s, markdown: r };
1308
1318
  }
1309
1319
  const de = () => {
1310
- const n = window.getSelection();
1311
- if (!n || n.isCollapsed)
1320
+ const o = window.getSelection();
1321
+ if (!o || o.isCollapsed)
1312
1322
  return !0;
1313
- let e = n.focusNode;
1323
+ let e = o.focusNode;
1314
1324
  for (; e; ) {
1315
1325
  if (e instanceof HTMLElement && e.getAttribute("contenteditable") === "false")
1316
1326
  return !0;
1317
1327
  e = e.parentElement;
1318
1328
  }
1319
1329
  return !1;
1320
- }, ue = (n, e, t) => {
1330
+ }, ue = (o, e, t) => {
1321
1331
  t.preventDefault(), t.clipboardData.clearData();
1322
- const { clipboardHTML: o, externalHTML: s, markdown: i } = Ae(
1332
+ const { clipboardHTML: n, externalHTML: s, markdown: r } = Ae(
1323
1333
  e,
1324
- n
1334
+ o
1325
1335
  );
1326
- t.clipboardData.setData("blocknote/html", o), t.clipboardData.setData("text/html", s), t.clipboardData.setData("text/plain", i);
1327
- }, Ro = (n) => x.create({
1336
+ t.clipboardData.setData("blocknote/html", n), t.clipboardData.setData("text/html", s), t.clipboardData.setData("text/plain", r);
1337
+ }, jo = (o) => E.create({
1328
1338
  name: "copyToClipboard",
1329
1339
  addProseMirrorPlugins() {
1330
1340
  return [
@@ -1332,10 +1342,10 @@ const de = () => {
1332
1342
  props: {
1333
1343
  handleDOMEvents: {
1334
1344
  copy(e, t) {
1335
- return de() || ue(n, e, t), !0;
1345
+ return de() || ue(o, e, t), !0;
1336
1346
  },
1337
1347
  cut(e, t) {
1338
- return de() || (ue(n, e, t), e.editable && e.dispatch(e.state.tr.deleteSelection())), !0;
1348
+ return de() || (ue(o, e, t), e.editable && e.dispatch(e.state.tr.deleteSelection())), !0;
1339
1349
  },
1340
1350
  // This is for the use-case in which only a block without content
1341
1351
  // is selected, e.g. an image block, and dragged (not using the
@@ -1343,22 +1353,22 @@ const de = () => {
1343
1353
  dragstart(e, t) {
1344
1354
  if (!("node" in e.state.selection) || e.state.selection.node.type.spec.group !== "blockContent")
1345
1355
  return;
1346
- n.transact(
1347
- (r) => r.setSelection(
1356
+ o.transact(
1357
+ (i) => i.setSelection(
1348
1358
  new L(
1349
- r.doc.resolve(e.state.selection.from - 1)
1359
+ i.doc.resolve(e.state.selection.from - 1)
1350
1360
  )
1351
1361
  )
1352
1362
  ), t.preventDefault(), t.dataTransfer.clearData();
1353
- const { clipboardHTML: o, externalHTML: s, markdown: i } = Ae(e, n);
1354
- return t.dataTransfer.setData("blocknote/html", o), t.dataTransfer.setData("text/html", s), t.dataTransfer.setData("text/plain", i), !0;
1363
+ const { clipboardHTML: n, externalHTML: s, markdown: r } = Ae(e, o);
1364
+ return t.dataTransfer.setData("blocknote/html", n), t.dataTransfer.setData("text/html", s), t.dataTransfer.setData("text/plain", r), !0;
1355
1365
  }
1356
1366
  }
1357
1367
  }
1358
1368
  })
1359
1369
  ];
1360
1370
  }
1361
- }), jo = x.create({
1371
+ }), Wo = E.create({
1362
1372
  name: "blockBackgroundColor",
1363
1373
  addGlobalAttributes() {
1364
1374
  return [
@@ -1370,7 +1380,7 @@ const de = () => {
1370
1380
  }
1371
1381
  ];
1372
1382
  }
1373
- }), Wo = D.create({
1383
+ }), Ko = D.create({
1374
1384
  name: "hardBreak",
1375
1385
  inline: !0,
1376
1386
  group: "inline",
@@ -1380,151 +1390,151 @@ const de = () => {
1380
1390
  parseHTML() {
1381
1391
  return [{ tag: "br" }];
1382
1392
  },
1383
- renderHTML({ HTMLAttributes: n }) {
1384
- return ["br", xt(this.options.HTMLAttributes, n)];
1393
+ renderHTML({ HTMLAttributes: o }) {
1394
+ return ["br", Et(this.options.HTMLAttributes, o)];
1385
1395
  },
1386
1396
  renderText() {
1387
1397
  return `
1388
1398
  `;
1389
1399
  }
1390
- }), J = (n, e) => {
1391
- const t = n.resolve(e), o = t.index();
1392
- if (o === 0)
1400
+ }), J = (o, e) => {
1401
+ const t = o.resolve(e), n = t.index();
1402
+ if (n === 0)
1393
1403
  return;
1394
- const s = t.posAtIndex(o - 1);
1395
- return q(
1396
- n.resolve(s)
1404
+ const s = t.posAtIndex(n - 1);
1405
+ return Y(
1406
+ o.resolve(s)
1397
1407
  );
1398
- }, _e = (n, e) => {
1408
+ }, _e = (o, e) => {
1399
1409
  for (; e.childContainer; ) {
1400
- const t = e.childContainer.node, o = n.resolve(e.childContainer.beforePos + 1).posAtIndex(t.childCount - 1);
1401
- e = q(n.resolve(o));
1410
+ const t = e.childContainer.node, n = o.resolve(e.childContainer.beforePos + 1).posAtIndex(t.childCount - 1);
1411
+ e = Y(o.resolve(n));
1402
1412
  }
1403
1413
  return e;
1404
- }, Ko = (n, e) => n.isBlockContainer && n.blockContent.node.type.spec.content === "inline*" && n.blockContent.node.childCount > 0 && e.isBlockContainer && e.blockContent.node.type.spec.content === "inline*", Jo = (n, e, t, o) => {
1405
- if (!o.isBlockContainer)
1414
+ }, Jo = (o, e) => o.isBlockContainer && o.blockContent.node.type.spec.content === "inline*" && o.blockContent.node.childCount > 0 && e.isBlockContainer && e.blockContent.node.type.spec.content === "inline*", qo = (o, e, t, n) => {
1415
+ if (!n.isBlockContainer)
1406
1416
  throw new Error(
1407
- `Attempted to merge block at position ${o.bnBlock.beforePos} into previous block at position ${t.bnBlock.beforePos}, but next block is not a block container`
1417
+ `Attempted to merge block at position ${n.bnBlock.beforePos} into previous block at position ${t.bnBlock.beforePos}, but next block is not a block container`
1408
1418
  );
1409
- if (o.childContainer) {
1410
- const s = n.doc.resolve(
1411
- o.childContainer.beforePos + 1
1412
- ), i = n.doc.resolve(
1413
- o.childContainer.afterPos - 1
1414
- ), r = s.blockRange(i);
1419
+ if (n.childContainer) {
1420
+ const s = o.doc.resolve(
1421
+ n.childContainer.beforePos + 1
1422
+ ), r = o.doc.resolve(
1423
+ n.childContainer.afterPos - 1
1424
+ ), i = s.blockRange(r);
1415
1425
  if (e) {
1416
- const c = n.doc.resolve(o.bnBlock.beforePos);
1417
- n.tr.lift(r, c.depth);
1426
+ const c = o.doc.resolve(n.bnBlock.beforePos);
1427
+ o.tr.lift(i, c.depth);
1418
1428
  }
1419
1429
  }
1420
1430
  if (e) {
1421
1431
  if (!t.isBlockContainer)
1422
1432
  throw new Error(
1423
- `Attempted to merge block at position ${o.bnBlock.beforePos} into previous block at position ${t.bnBlock.beforePos}, but previous block is not a block container`
1433
+ `Attempted to merge block at position ${n.bnBlock.beforePos} into previous block at position ${t.bnBlock.beforePos}, but previous block is not a block container`
1424
1434
  );
1425
1435
  e(
1426
- n.tr.delete(
1436
+ o.tr.delete(
1427
1437
  t.blockContent.afterPos - 1,
1428
- o.blockContent.beforePos + 1
1438
+ n.blockContent.beforePos + 1
1429
1439
  )
1430
1440
  );
1431
1441
  }
1432
1442
  return !0;
1433
- }, pe = (n) => ({
1443
+ }, pe = (o) => ({
1434
1444
  state: e,
1435
1445
  dispatch: t
1436
1446
  }) => {
1437
- const o = e.doc.resolve(n), s = q(o), i = J(
1447
+ const n = e.doc.resolve(o), s = Y(n), r = J(
1438
1448
  e.doc,
1439
1449
  s.bnBlock.beforePos
1440
1450
  );
1441
- if (!i)
1451
+ if (!r)
1442
1452
  return !1;
1443
- const r = _e(
1453
+ const i = _e(
1444
1454
  e.doc,
1445
- i
1455
+ r
1446
1456
  );
1447
- return Ko(r, s) ? Jo(e, t, r, s) : !1;
1448
- }, Yo = x.create({
1457
+ return Jo(i, s) ? qo(e, t, i, s) : !1;
1458
+ }, Yo = E.create({
1449
1459
  priority: 50,
1450
1460
  // TODO: The shortcuts need a refactor. Do we want to use a command priority
1451
1461
  // design as there is now, or clump the logic into a single function?
1452
1462
  addKeyboardShortcuts() {
1453
- const n = () => this.editor.commands.first(({ chain: o, commands: s }) => [
1463
+ const o = () => this.editor.commands.first(({ chain: n, commands: s }) => [
1454
1464
  // Deletes the selection if it's not empty.
1455
1465
  () => s.deleteSelection(),
1456
1466
  // Undoes an input rule if one was triggered in the last editor state change.
1457
1467
  () => s.undoInputRule(),
1458
1468
  // Reverts block content type to a paragraph if the selection is at the start of the block.
1459
- () => s.command(({ state: i }) => {
1460
- const r = B(i);
1461
- if (!r.isBlockContainer)
1469
+ () => s.command(({ state: r }) => {
1470
+ const i = B(r);
1471
+ if (!i.isBlockContainer)
1462
1472
  return !1;
1463
- const c = i.selection.from === r.blockContent.beforePos + 1, a = r.blockContent.node.type.name === "paragraph";
1473
+ const c = r.selection.from === i.blockContent.beforePos + 1, a = i.blockContent.node.type.name === "paragraph";
1464
1474
  return c && !a ? s.command(
1465
- Ze(r.bnBlock.beforePos, {
1475
+ Ze(i.bnBlock.beforePos, {
1466
1476
  type: "paragraph",
1467
1477
  props: {}
1468
1478
  })
1469
1479
  ) : !1;
1470
1480
  }),
1471
1481
  // Removes a level of nesting if the block is indented if the selection is at the start of the block.
1472
- () => s.command(({ state: i }) => {
1473
- const r = B(i);
1474
- if (!r.isBlockContainer)
1482
+ () => s.command(({ state: r }) => {
1483
+ const i = B(r);
1484
+ if (!i.isBlockContainer)
1475
1485
  return !1;
1476
- const { blockContent: c } = r;
1477
- return i.selection.from === c.beforePos + 1 ? s.liftListItem("blockContainer") : !1;
1486
+ const { blockContent: c } = i;
1487
+ return r.selection.from === c.beforePos + 1 ? s.liftListItem("blockContainer") : !1;
1478
1488
  }),
1479
1489
  // Merges block with the previous one if it isn't indented, and the selection is at the start of the
1480
1490
  // block. The target block for merging must contain inline content.
1481
- () => s.command(({ state: i }) => {
1482
- const r = B(i);
1483
- if (!r.isBlockContainer)
1491
+ () => s.command(({ state: r }) => {
1492
+ const i = B(r);
1493
+ if (!i.isBlockContainer)
1484
1494
  return !1;
1485
- const { bnBlock: c, blockContent: a } = r, l = i.selection.from === a.beforePos + 1, d = i.selection.empty, u = c.beforePos;
1486
- return l && d ? o().command(pe(u)).scrollIntoView().run() : !1;
1495
+ const { bnBlock: c, blockContent: a } = i, l = r.selection.from === a.beforePos + 1, d = r.selection.empty, u = c.beforePos;
1496
+ return l && d ? n().command(pe(u)).scrollIntoView().run() : !1;
1487
1497
  }),
1488
- () => s.command(({ state: i, tr: r, dispatch: c }) => {
1489
- const a = B(i);
1490
- if (!a.isBlockContainer || !(r.selection.from === a.blockContent.beforePos + 1))
1498
+ () => s.command(({ state: r, tr: i, dispatch: c }) => {
1499
+ const a = B(r);
1500
+ if (!a.isBlockContainer || !(i.selection.from === a.blockContent.beforePos + 1))
1491
1501
  return !1;
1492
- const d = r.doc.resolve(a.bnBlock.beforePos);
1502
+ const d = i.doc.resolve(a.bnBlock.beforePos);
1493
1503
  if (d.nodeBefore || d.node().type.name !== "column")
1494
1504
  return !1;
1495
- const m = r.doc.resolve(a.bnBlock.beforePos), f = r.doc.resolve(m.before()), k = f.before();
1505
+ const m = i.doc.resolve(a.bnBlock.beforePos), f = i.doc.resolve(m.before()), k = f.before();
1496
1506
  if (c) {
1497
- const g = r.doc.slice(
1507
+ const g = i.doc.slice(
1498
1508
  a.bnBlock.beforePos,
1499
1509
  a.bnBlock.afterPos
1500
1510
  ).content;
1501
- r.delete(
1511
+ i.delete(
1502
1512
  a.bnBlock.beforePos,
1503
1513
  a.bnBlock.afterPos
1504
- ), f.index() === 0 ? (W(r, k), r.insert(k, g), r.setSelection(
1505
- M.near(r.doc.resolve(k))
1506
- )) : (r.insert(f.pos - 1, g), r.setSelection(
1507
- M.near(r.doc.resolve(f.pos - 1))
1508
- ), W(r, k));
1514
+ ), f.index() === 0 ? (W(i, k), i.insert(k, g), i.setSelection(
1515
+ M.near(i.doc.resolve(k))
1516
+ )) : (i.insert(f.pos - 1, g), i.setSelection(
1517
+ M.near(i.doc.resolve(f.pos - 1))
1518
+ ), W(i, k));
1509
1519
  }
1510
1520
  return !0;
1511
1521
  }),
1512
1522
  // Deletes the current block if it's an empty block with inline content,
1513
1523
  // and moves the selection to the previous block.
1514
- () => s.command(({ state: i }) => {
1515
- const r = B(i);
1516
- if (!r.isBlockContainer)
1524
+ () => s.command(({ state: r }) => {
1525
+ const i = B(r);
1526
+ if (!i.isBlockContainer)
1517
1527
  return !1;
1518
- if (r.blockContent.node.childCount === 0 && r.blockContent.node.type.spec.content === "inline*") {
1528
+ if (i.blockContent.node.childCount === 0 && i.blockContent.node.type.spec.content === "inline*") {
1519
1529
  const a = J(
1520
- i.doc,
1521
- r.bnBlock.beforePos
1530
+ r.doc,
1531
+ i.bnBlock.beforePos
1522
1532
  );
1523
1533
  if (!a || !a.isBlockContainer)
1524
1534
  return !1;
1525
- let l = o();
1535
+ let l = n();
1526
1536
  if (a.blockContent.node.type.spec.content === "tableRow+") {
1527
- const f = r.bnBlock.beforePos - 1 - 1 - 1 - 1 - 1;
1537
+ const f = i.bnBlock.beforePos - 1 - 1 - 1 - 1 - 1;
1528
1538
  l = l.setTextSelection(
1529
1539
  f
1530
1540
  );
@@ -1538,8 +1548,8 @@ const de = () => {
1538
1548
  l = l.setTextSelection(d);
1539
1549
  }
1540
1550
  return l.deleteRange({
1541
- from: r.bnBlock.beforePos,
1542
- to: r.bnBlock.afterPos
1551
+ from: i.bnBlock.beforePos,
1552
+ to: i.bnBlock.afterPos
1543
1553
  }).scrollIntoView().run();
1544
1554
  }
1545
1555
  return !1;
@@ -1547,26 +1557,26 @@ const de = () => {
1547
1557
  // Deletes previous block if it contains no content and isn't a table,
1548
1558
  // when the selection is empty and at the start of the block. Moves the
1549
1559
  // current block into the deleted block's place.
1550
- () => s.command(({ state: i }) => {
1551
- const r = B(i);
1552
- if (!r.isBlockContainer)
1560
+ () => s.command(({ state: r }) => {
1561
+ const i = B(r);
1562
+ if (!i.isBlockContainer)
1553
1563
  throw new Error("todo");
1554
- const c = i.selection.from === r.blockContent.beforePos + 1, a = i.selection.empty, l = J(
1555
- i.doc,
1556
- r.bnBlock.beforePos
1564
+ const c = r.selection.from === i.blockContent.beforePos + 1, a = r.selection.empty, l = J(
1565
+ r.doc,
1566
+ i.bnBlock.beforePos
1557
1567
  );
1558
1568
  if (l && c && a) {
1559
1569
  const d = _e(
1560
- i.doc,
1570
+ r.doc,
1561
1571
  l
1562
1572
  );
1563
1573
  if (!d.isBlockContainer)
1564
1574
  throw new Error("todo");
1565
1575
  if (d.blockContent.node.type.spec.content === "" || d.blockContent.node.type.spec.content === "inline*" && d.blockContent.node.childCount === 0)
1566
- return o().cut(
1576
+ return n().cut(
1567
1577
  {
1568
- from: r.bnBlock.beforePos,
1569
- to: r.bnBlock.afterPos
1578
+ from: i.bnBlock.beforePos,
1579
+ to: i.bnBlock.afterPos
1570
1580
  },
1571
1581
  d.bnBlock.afterPos
1572
1582
  ).deleteRange({
@@ -1576,77 +1586,77 @@ const de = () => {
1576
1586
  }
1577
1587
  return !1;
1578
1588
  })
1579
- ]), e = () => this.editor.commands.first(({ commands: o }) => [
1589
+ ]), e = () => this.editor.commands.first(({ commands: n }) => [
1580
1590
  // Deletes the selection if it's not empty.
1581
- () => o.deleteSelection(),
1591
+ () => n.deleteSelection(),
1582
1592
  // Merges block with the next one (at the same nesting level or lower),
1583
1593
  // if one exists, the block has no children, and the selection is at the
1584
1594
  // end of the block.
1585
- () => o.command(({ state: s }) => {
1586
- const i = B(s);
1587
- if (!i.isBlockContainer)
1595
+ () => n.command(({ state: s }) => {
1596
+ const r = B(s);
1597
+ if (!r.isBlockContainer)
1588
1598
  return !1;
1589
1599
  const {
1590
- bnBlock: r,
1600
+ bnBlock: i,
1591
1601
  blockContent: c,
1592
1602
  childContainer: a
1593
- } = i, { depth: l } = s.doc.resolve(r.beforePos), d = r.afterPos === s.doc.nodeSize - 3, u = s.selection.from === c.afterPos - 1, p = s.selection.empty;
1603
+ } = r, { depth: l } = s.doc.resolve(i.beforePos), d = i.afterPos === s.doc.nodeSize - 3, u = s.selection.from === c.afterPos - 1, p = s.selection.empty;
1594
1604
  if (!d && u && p && !(a !== void 0)) {
1595
- let f = l, k = r.afterPos + 1, g = s.doc.resolve(k).depth;
1605
+ let f = l, k = i.afterPos + 1, g = s.doc.resolve(k).depth;
1596
1606
  for (; g < f; )
1597
1607
  f = g, k += 2, g = s.doc.resolve(k).depth;
1598
- return o.command(pe(k - 1));
1608
+ return n.command(pe(k - 1));
1599
1609
  }
1600
1610
  return !1;
1601
1611
  })
1602
- ]), t = (o = !1) => this.editor.commands.first(({ commands: s, tr: i }) => [
1612
+ ]), t = (n = !1) => this.editor.commands.first(({ commands: s, tr: r }) => [
1603
1613
  // Removes a level of nesting if the block is empty & indented, while the selection is also empty & at the start
1604
1614
  // of the block.
1605
- () => s.command(({ state: r }) => {
1606
- const c = B(r);
1615
+ () => s.command(({ state: i }) => {
1616
+ const c = B(i);
1607
1617
  if (!c.isBlockContainer)
1608
1618
  return !1;
1609
- const { bnBlock: a, blockContent: l } = c, { depth: d } = r.doc.resolve(a.beforePos), u = r.selection.$anchor.parentOffset === 0, p = r.selection.anchor === r.selection.head, m = l.node.childCount === 0, f = d > 1;
1619
+ const { bnBlock: a, blockContent: l } = c, { depth: d } = i.doc.resolve(a.beforePos), u = i.selection.$anchor.parentOffset === 0, p = i.selection.anchor === i.selection.head, m = l.node.childCount === 0, f = d > 1;
1610
1620
  return u && p && m && f ? s.liftListItem("blockContainer") : !1;
1611
1621
  }),
1612
1622
  // Creates a hard break if block is configured to do so.
1613
- () => s.command(({ state: r }) => {
1623
+ () => s.command(({ state: i }) => {
1614
1624
  var l;
1615
- const c = B(r), a = ((l = this.options.editor.schema.blockSchema[c.blockNoteType].meta) == null ? void 0 : l.hardBreakShortcut) ?? "shift+enter";
1625
+ const c = B(i), a = ((l = this.options.editor.schema.blockSchema[c.blockNoteType].meta) == null ? void 0 : l.hardBreakShortcut) ?? "shift+enter";
1616
1626
  if (a === "none")
1617
1627
  return !1;
1618
1628
  if (
1619
1629
  // If shortcut is not configured, or is configured as "shift+enter",
1620
1630
  // create a hard break for shift+enter, but not for enter.
1621
- a === "shift+enter" && o || // If shortcut is configured as "enter", create a hard break for
1631
+ a === "shift+enter" && n || // If shortcut is configured as "enter", create a hard break for
1622
1632
  // both enter and shift+enter.
1623
1633
  a === "enter"
1624
1634
  ) {
1625
- const d = i.storedMarks || i.selection.$head.marks().filter(
1635
+ const d = r.storedMarks || r.selection.$head.marks().filter(
1626
1636
  (u) => this.editor.extensionManager.splittableMarks.includes(
1627
1637
  u.type.name
1628
1638
  )
1629
1639
  );
1630
- return i.insert(
1631
- i.selection.head,
1632
- i.doc.type.schema.nodes.hardBreak.create()
1640
+ return r.insert(
1641
+ r.selection.head,
1642
+ r.doc.type.schema.nodes.hardBreak.create()
1633
1643
  ).ensureMarks(d), !0;
1634
1644
  }
1635
1645
  return !1;
1636
1646
  }),
1637
1647
  // Creates a new block and moves the selection to it if the current one is empty, while the selection is also
1638
1648
  // empty & at the start of the block.
1639
- () => s.command(({ state: r, dispatch: c }) => {
1640
- const a = B(r);
1649
+ () => s.command(({ state: i, dispatch: c }) => {
1650
+ const a = B(i);
1641
1651
  if (!a.isBlockContainer)
1642
1652
  return !1;
1643
- const { bnBlock: l, blockContent: d } = a, u = r.selection.$anchor.parentOffset === 0, p = r.selection.anchor === r.selection.head, m = d.node.childCount === 0;
1653
+ const { bnBlock: l, blockContent: d } = a, u = i.selection.$anchor.parentOffset === 0, p = i.selection.anchor === i.selection.head, m = d.node.childCount === 0;
1644
1654
  if (u && p && m) {
1645
1655
  const f = l.afterPos, k = f + 2;
1646
1656
  if (c) {
1647
- const g = r.schema.nodes.blockContainer.createAndFill();
1648
- r.tr.insert(f, g).scrollIntoView(), r.tr.setSelection(
1649
- new M(r.doc.resolve(k))
1657
+ const g = i.schema.nodes.blockContainer.createAndFill();
1658
+ i.tr.insert(f, g).scrollIntoView(), i.tr.setSelection(
1659
+ new M(i.doc.resolve(k))
1650
1660
  );
1651
1661
  }
1652
1662
  return !0;
@@ -1655,14 +1665,14 @@ const de = () => {
1655
1665
  }),
1656
1666
  // Splits the current block, moving content inside that's after the cursor to a new text block below. Also
1657
1667
  // deletes the selection beforehand, if it's not empty.
1658
- () => s.command(({ state: r, chain: c }) => {
1659
- const a = B(r);
1668
+ () => s.command(({ state: i, chain: c }) => {
1669
+ const a = B(i);
1660
1670
  if (!a.isBlockContainer)
1661
1671
  return !1;
1662
- const { blockContent: l } = a, d = r.selection.$anchor.parentOffset === 0;
1672
+ const { blockContent: l } = a, d = i.selection.$anchor.parentOffset === 0;
1663
1673
  return l.node.childCount === 0 ? !1 : (c().deleteSelection().command(
1664
1674
  Xe(
1665
- r.selection.from,
1675
+ i.selection.from,
1666
1676
  d,
1667
1677
  d
1668
1678
  )
@@ -1670,19 +1680,19 @@ const de = () => {
1670
1680
  })
1671
1681
  ]);
1672
1682
  return {
1673
- Backspace: n,
1683
+ Backspace: o,
1674
1684
  Delete: e,
1675
1685
  Enter: () => t(),
1676
1686
  "Shift-Enter": () => t(!0),
1677
1687
  // Always returning true for tab key presses ensures they're not captured by the browser. Otherwise, they blur the
1678
1688
  // editor since the browser will try to use tab for keyboard navigation.
1679
1689
  Tab: () => {
1680
- var o, s;
1681
- return this.options.tabBehavior !== "prefer-indent" && ((o = this.options.editor.getExtension(R)) != null && o.store.state || ((s = this.options.editor.getExtension(G)) == null ? void 0 : s.store.state) !== void 0) ? !1 : Te(this.options.editor);
1690
+ var n, s;
1691
+ return this.options.tabBehavior !== "prefer-indent" && ((n = this.options.editor.getExtension(R)) != null && n.store.state || ((s = this.options.editor.getExtension(G)) == null ? void 0 : s.store.state) !== void 0) ? !1 : Te(this.options.editor);
1682
1692
  },
1683
1693
  "Shift-Tab": () => {
1684
- var o, s;
1685
- return this.options.tabBehavior !== "prefer-indent" && ((o = this.options.editor.getExtension(R)) != null && o.store.state || ((s = this.options.editor.getExtension(G)) == null ? void 0 : s.store.state) !== void 0) ? !1 : this.editor.commands.liftListItem("blockContainer");
1694
+ var n, s;
1695
+ return this.options.tabBehavior !== "prefer-indent" && ((n = this.options.editor.getExtension(R)) != null && n.store.state || ((s = this.options.editor.getExtension(G)) == null ? void 0 : s.store.state) !== void 0) ? !1 : this.editor.commands.liftListItem("blockContainer");
1686
1696
  },
1687
1697
  "Shift-Mod-ArrowUp": () => (this.options.editor.moveBlocksUp(), !0),
1688
1698
  "Shift-Mod-ArrowDown": () => (this.options.editor.moveBlocksDown(), !0),
@@ -1691,7 +1701,7 @@ const de = () => {
1691
1701
  "Shift-Mod-z": () => this.options.editor.redo()
1692
1702
  };
1693
1703
  }
1694
- }), qo = X.create({
1704
+ }), Qo = X.create({
1695
1705
  name: "insertion",
1696
1706
  inclusive: !1,
1697
1707
  excludes: "deletion modification insertion",
@@ -1701,8 +1711,8 @@ const de = () => {
1701
1711
  // note: validate is supported in prosemirror but not in tiptap, so this doesn't actually work (considered not critical)
1702
1712
  };
1703
1713
  },
1704
- extendMarkSchema(n) {
1705
- return n.name !== "insertion" ? {} : {
1714
+ extendMarkSchema(o) {
1715
+ return o.name !== "insertion" ? {} : {
1706
1716
  blocknoteIgnore: !0,
1707
1717
  inclusive: !1,
1708
1718
  toDOM(e, t) {
@@ -1729,7 +1739,7 @@ const de = () => {
1729
1739
  ]
1730
1740
  };
1731
1741
  }
1732
- }), Qo = X.create({
1742
+ }), Xo = X.create({
1733
1743
  name: "deletion",
1734
1744
  inclusive: !1,
1735
1745
  excludes: "insertion modification deletion",
@@ -1739,8 +1749,8 @@ const de = () => {
1739
1749
  // note: validate is supported in prosemirror but not in tiptap
1740
1750
  };
1741
1751
  },
1742
- extendMarkSchema(n) {
1743
- return n.name !== "deletion" ? {} : {
1752
+ extendMarkSchema(o) {
1753
+ return o.name !== "deletion" ? {} : {
1744
1754
  blocknoteIgnore: !0,
1745
1755
  inclusive: !1,
1746
1756
  // attrs: {
@@ -1770,7 +1780,7 @@ const de = () => {
1770
1780
  ]
1771
1781
  };
1772
1782
  }
1773
- }), Xo = X.create({
1783
+ }), Zo = X.create({
1774
1784
  name: "modification",
1775
1785
  inclusive: !1,
1776
1786
  excludes: "deletion insertion",
@@ -1783,8 +1793,8 @@ const de = () => {
1783
1793
  newValue: { default: null }
1784
1794
  };
1785
1795
  },
1786
- extendMarkSchema(n) {
1787
- return n.name !== "modification" ? {} : {
1796
+ extendMarkSchema(o) {
1797
+ return o.name !== "modification" ? {} : {
1788
1798
  blocknoteIgnore: !0,
1789
1799
  inclusive: !1,
1790
1800
  // attrs: {
@@ -1833,7 +1843,7 @@ const de = () => {
1833
1843
  ]
1834
1844
  };
1835
1845
  }
1836
- }), Zo = x.create({
1846
+ }), en = E.create({
1837
1847
  name: "textAlignment",
1838
1848
  addGlobalAttributes() {
1839
1849
  return [
@@ -1846,16 +1856,16 @@ const de = () => {
1846
1856
  attributes: {
1847
1857
  textAlignment: {
1848
1858
  default: "left",
1849
- parseHTML: (n) => n.getAttribute("data-text-alignment"),
1850
- renderHTML: (n) => n.textAlignment === "left" ? {} : {
1851
- "data-text-alignment": n.textAlignment
1859
+ parseHTML: (o) => o.getAttribute("data-text-alignment"),
1860
+ renderHTML: (o) => o.textAlignment === "left" ? {} : {
1861
+ "data-text-alignment": o.textAlignment
1852
1862
  }
1853
1863
  }
1854
1864
  }
1855
1865
  }
1856
1866
  ];
1857
1867
  }
1858
- }), en = x.create({
1868
+ }), tn = E.create({
1859
1869
  name: "blockTextColor",
1860
1870
  addGlobalAttributes() {
1861
1871
  return [
@@ -1867,13 +1877,13 @@ const de = () => {
1867
1877
  }
1868
1878
  ];
1869
1879
  }
1870
- }), tn = {
1880
+ }), on = {
1871
1881
  blockColor: "data-block-color",
1872
1882
  blockStyle: "data-block-style",
1873
1883
  id: "data-id",
1874
1884
  depth: "data-depth",
1875
1885
  depthChange: "data-depth-change"
1876
- }, on = D.create({
1886
+ }, nn = D.create({
1877
1887
  name: "blockContainer",
1878
1888
  group: "blockGroupChild bnBlock",
1879
1889
  // A block always contains content, and optionally a blockGroup which contains nested blocks
@@ -1886,12 +1896,12 @@ const de = () => {
1886
1896
  return [
1887
1897
  {
1888
1898
  tag: "div[data-node-type=" + this.name + "]",
1889
- getAttrs: (n) => {
1890
- if (typeof n == "string")
1899
+ getAttrs: (o) => {
1900
+ if (typeof o == "string")
1891
1901
  return !1;
1892
1902
  const e = {};
1893
- for (const [t, o] of Object.entries(tn))
1894
- n.getAttribute(o) && (e[t] = n.getAttribute(o));
1903
+ for (const [t, n] of Object.entries(on))
1904
+ o.getAttribute(n) && (e[t] = o.getAttribute(n));
1895
1905
  return e;
1896
1906
  }
1897
1907
  },
@@ -1902,25 +1912,25 @@ const de = () => {
1902
1912
  }
1903
1913
  ];
1904
1914
  },
1905
- renderHTML({ HTMLAttributes: n }) {
1915
+ renderHTML({ HTMLAttributes: o }) {
1906
1916
  var s;
1907
1917
  const e = document.createElement("div");
1908
1918
  e.className = "bn-block-outer", e.setAttribute("data-node-type", "blockOuter");
1909
- for (const [i, r] of Object.entries(n))
1910
- i !== "class" && e.setAttribute(i, r);
1919
+ for (const [r, i] of Object.entries(o))
1920
+ r !== "class" && e.setAttribute(r, i);
1911
1921
  const t = {
1912
1922
  ...((s = this.options.domAttributes) == null ? void 0 : s.block) || {},
1913
- ...n
1914
- }, o = document.createElement("div");
1915
- o.className = Q("bn-block", t.class), o.setAttribute("data-node-type", this.name);
1916
- for (const [i, r] of Object.entries(t))
1917
- i !== "class" && o.setAttribute(i, r);
1918
- return e.appendChild(o), {
1923
+ ...o
1924
+ }, n = document.createElement("div");
1925
+ n.className = Q("bn-block", t.class), n.setAttribute("data-node-type", this.name);
1926
+ for (const [r, i] of Object.entries(t))
1927
+ r !== "class" && n.setAttribute(r, i);
1928
+ return e.appendChild(n), {
1919
1929
  dom: e,
1920
- contentDOM: o
1930
+ contentDOM: n
1921
1931
  };
1922
1932
  }
1923
- }), nn = D.create({
1933
+ }), sn = D.create({
1924
1934
  name: "blockGroup",
1925
1935
  group: "childContainer",
1926
1936
  content: "blockGroupChild+",
@@ -1929,128 +1939,138 @@ const de = () => {
1929
1939
  return [
1930
1940
  {
1931
1941
  tag: "div",
1932
- getAttrs: (n) => typeof n == "string" ? !1 : n.getAttribute("data-node-type") === "blockGroup" ? null : !1
1942
+ getAttrs: (o) => typeof o == "string" ? !1 : o.getAttribute("data-node-type") === "blockGroup" ? null : !1
1933
1943
  }
1934
1944
  ];
1935
1945
  },
1936
- renderHTML({ HTMLAttributes: n }) {
1937
- var o;
1946
+ renderHTML({ HTMLAttributes: o }) {
1947
+ var n;
1938
1948
  const e = {
1939
- ...((o = this.options.domAttributes) == null ? void 0 : o.blockGroup) || {},
1940
- ...n
1949
+ ...((n = this.options.domAttributes) == null ? void 0 : n.blockGroup) || {},
1950
+ ...o
1941
1951
  }, t = document.createElement("div");
1942
1952
  t.className = Q(
1943
1953
  "bn-block-group",
1944
1954
  e.class
1945
1955
  ), t.setAttribute("data-node-type", "blockGroup");
1946
- for (const [s, i] of Object.entries(e))
1947
- s !== "class" && t.setAttribute(s, i);
1956
+ for (const [s, r] of Object.entries(e))
1957
+ s !== "class" && t.setAttribute(s, r);
1948
1958
  return {
1949
1959
  dom: t,
1950
1960
  contentDOM: t
1951
1961
  };
1952
1962
  }
1953
- }), sn = D.create({
1963
+ }), rn = D.create({
1954
1964
  name: "doc",
1955
1965
  topNode: !0,
1956
1966
  content: "blockGroup",
1957
1967
  marks: "insertion modification deletion"
1958
- });
1968
+ }), an = Nt(
1969
+ ({ options: o }) => ({
1970
+ key: "collaboration",
1971
+ blockNoteExtensions: [
1972
+ it(o),
1973
+ at(o),
1974
+ ct(o),
1975
+ lt(),
1976
+ dt(o)
1977
+ ]
1978
+ })
1979
+ );
1959
1980
  let fe = !1;
1960
- function rn(n, e) {
1981
+ function cn(o, e) {
1961
1982
  const t = [
1962
1983
  I.ClipboardTextSerializer,
1963
1984
  I.Commands,
1964
1985
  I.Editable,
1965
1986
  I.FocusEvents,
1966
1987
  I.Tabindex,
1967
- Ot,
1988
+ Ft,
1968
1989
  me.configure({
1969
1990
  // everything from bnBlock group (nodes that represent a BlockNote block should have an id)
1970
1991
  types: ["blockContainer", "columnList", "column"],
1971
1992
  setIdAttribute: e.setIdAttribute
1972
1993
  }),
1973
- Wo,
1994
+ Ko,
1974
1995
  Ht,
1975
1996
  // marks:
1976
- qo,
1977
1997
  Qo,
1978
1998
  Xo,
1979
- Ft.extend({
1999
+ Zo,
2000
+ $t.extend({
1980
2001
  inclusive: !1
1981
2002
  }).configure({
1982
2003
  defaultProtocol: Bt,
1983
2004
  // only call this once if we have multiple editors installed. Or fix https://github.com/ueberdosis/tiptap/issues/5450
1984
2005
  protocols: fe ? [] : St
1985
2006
  }),
1986
- ...Object.values(n.schema.styleSpecs).map((o) => o.implementation.mark.configure({
1987
- editor: n
2007
+ ...Object.values(o.schema.styleSpecs).map((n) => n.implementation.mark.configure({
2008
+ editor: o
1988
2009
  })),
2010
+ tn,
2011
+ Wo,
1989
2012
  en,
1990
- jo,
1991
- Zo,
1992
2013
  // make sure escape blurs editor, so that we can tab to other elements in the host page (accessibility)
1993
- x.create({
2014
+ E.create({
1994
2015
  name: "OverrideEscape",
1995
2016
  addKeyboardShortcuts: () => ({
1996
2017
  Escape: () => {
1997
- var o;
1998
- return (o = n.getExtension(ge)) != null && o.shown() ? !1 : (n.blur(), !0);
2018
+ var n;
2019
+ return (n = o.getExtension(ge)) != null && n.shown() ? !1 : (o.blur(), !0);
1999
2020
  }
2000
2021
  })
2001
2022
  }),
2002
2023
  // nodes
2003
- sn,
2004
- on.configure({
2005
- editor: n,
2024
+ rn,
2025
+ nn.configure({
2026
+ editor: o,
2006
2027
  domAttributes: e.domAttributes
2007
2028
  }),
2008
2029
  Yo.configure({
2009
- editor: n,
2030
+ editor: o,
2010
2031
  tabBehavior: e.tabBehavior
2011
2032
  }),
2012
- nn.configure({
2033
+ sn.configure({
2013
2034
  domAttributes: e.domAttributes
2014
2035
  }),
2015
- ...Object.values(n.schema.inlineContentSpecs).filter((o) => o.config !== "link" && o.config !== "text").map((o) => o.implementation.node.configure({
2016
- editor: n
2036
+ ...Object.values(o.schema.inlineContentSpecs).filter((n) => n.config !== "link" && n.config !== "text").map((n) => n.implementation.node.configure({
2037
+ editor: o
2017
2038
  })),
2018
- ...Object.values(n.schema.blockSpecs).flatMap((o) => [
2039
+ ...Object.values(o.schema.blockSpecs).flatMap((n) => [
2019
2040
  // the node extension implementations
2020
- ..."node" in o.implementation ? [
2021
- o.implementation.node.configure({
2022
- editor: n,
2041
+ ..."node" in n.implementation ? [
2042
+ n.implementation.node.configure({
2043
+ editor: o,
2023
2044
  domAttributes: e.domAttributes
2024
2045
  })
2025
2046
  ] : []
2026
2047
  ]),
2027
- Ro(n),
2028
- zo(
2029
- n,
2030
- e.pasteHandler || ((o) => o.defaultPasteHandler())
2048
+ jo(o),
2049
+ Go(
2050
+ o,
2051
+ e.pasteHandler || ((n) => n.defaultPasteHandler())
2031
2052
  ),
2032
- Mo(n)
2053
+ wo(o)
2033
2054
  ];
2034
2055
  return fe = !0, t;
2035
2056
  }
2036
- function an(n, e) {
2037
- var o;
2057
+ function ln(o, e) {
2038
2058
  const t = [
2039
2059
  ye(),
2040
- it(e),
2060
+ ut(e),
2041
2061
  G(e),
2042
2062
  R(e),
2043
- at(e),
2044
- ct(),
2045
- lt(e),
2046
- $t(e),
2047
- dt(e),
2063
+ pt(e),
2064
+ ft(),
2065
+ ht(e),
2066
+ Vt(e),
2067
+ mt(e),
2048
2068
  ge(e),
2049
- ...e.trailingBlock !== !1 ? [ut()] : []
2069
+ ...e.trailingBlock !== !1 ? [kt()] : []
2050
2070
  ];
2051
- return e.collaboration ? (t.push(pt(e.collaboration)), (o = e.collaboration.provider) != null && o.awareness && t.push(ft(e.collaboration)), t.push(ht(e.collaboration)), t.push(mt(e.collaboration)), t.push(kt(e.collaboration))) : t.push(gt()), "table" in n.schema.blockSpecs && t.push(bt(e)), e.animations !== !1 && t.push(yt()), t;
2071
+ return e.collaboration ? t.push(an(e.collaboration)) : t.push(gt()), "table" in o.schema.blockSpecs && t.push(bt(e)), e.animations !== !1 && t.push(yt()), t;
2052
2072
  }
2053
- class cn {
2073
+ class dn {
2054
2074
  constructor(e, t) {
2055
2075
  /**
2056
2076
  * A set of extension keys which are disabled by the options
@@ -2074,27 +2094,27 @@ class cn {
2074
2094
  */
2075
2095
  h(this, "extensionPlugins", /* @__PURE__ */ new Map());
2076
2096
  this.editor = e, this.options = t, e.onMount(() => {
2077
- for (const o of this.extensions)
2078
- if (o.mount) {
2079
- const s = new window.AbortController(), i = o.mount({
2097
+ for (const n of this.extensions)
2098
+ if (n.mount) {
2099
+ const s = new window.AbortController(), r = n.mount({
2080
2100
  dom: e.prosemirrorView.dom,
2081
2101
  root: e.prosemirrorView.root,
2082
2102
  signal: s.signal
2083
2103
  });
2084
- i && s.signal.addEventListener("abort", () => {
2085
- i();
2086
- }), this.abortMap.set(o, s);
2104
+ r && s.signal.addEventListener("abort", () => {
2105
+ r();
2106
+ }), this.abortMap.set(n, s);
2087
2107
  }
2088
2108
  }), e.onUnmount(() => {
2089
- for (const [o, s] of this.abortMap.entries())
2090
- this.abortMap.delete(o), s.abort();
2109
+ for (const [n, s] of this.abortMap.entries())
2110
+ this.abortMap.delete(n), s.abort();
2091
2111
  }), this.disabledExtensions = new Set(t.disableExtensions || []);
2092
- for (const o of an(this.editor, this.options))
2093
- this.addExtension(o);
2094
- for (const o of this.options.extensions ?? [])
2095
- this.addExtension(o);
2096
- for (const o of Object.values(this.editor.schema.blockSpecs))
2097
- for (const s of o.extensions ?? [])
2112
+ for (const n of ln(this.editor, this.options))
2113
+ this.addExtension(n);
2114
+ for (const n of this.options.extensions ?? [])
2115
+ this.addExtension(n);
2116
+ for (const n of Object.values(this.editor.schema.blockSpecs))
2117
+ for (const s of n.extensions ?? [])
2098
2118
  this.addExtension(s);
2099
2119
  }
2100
2120
  /**
@@ -2103,26 +2123,26 @@ class cn {
2103
2123
  * This allows users to switch on & off extensions "at runtime".
2104
2124
  */
2105
2125
  registerExtension(e) {
2106
- var i;
2126
+ var r;
2107
2127
  const t = [].concat(e).filter(Boolean);
2108
2128
  if (!t.length) {
2109
2129
  console.warn("No extensions found to register", e);
2110
2130
  return;
2111
2131
  }
2112
- const o = t.map((r) => this.addExtension(r)).filter(Boolean), s = /* @__PURE__ */ new Set();
2113
- for (const r of o)
2114
- r != null && r.tiptapExtensions && console.warn(
2115
- `Extension ${r.key} has tiptap extensions, but these cannot be changed after initializing the editor. Please separate the extension into multiple extensions if you want to add them, or re-initialize the editor.`,
2116
- r
2117
- ), (i = r == null ? void 0 : r.inputRules) != null && i.length && console.warn(
2118
- `Extension ${r.key} has input rules, but these cannot be changed after initializing the editor. Please separate the extension into multiple extensions if you want to add them, or re-initialize the editor.`,
2119
- r
2120
- ), this.getProsemirrorPluginsFromExtension(r).plugins.forEach(
2132
+ const n = t.map((i) => this.addExtension(i)).filter(Boolean), s = /* @__PURE__ */ new Set();
2133
+ for (const i of n)
2134
+ i != null && i.tiptapExtensions && console.warn(
2135
+ `Extension ${i.key} has tiptap extensions, but these cannot be changed after initializing the editor. Please separate the extension into multiple extensions if you want to add them, or re-initialize the editor.`,
2136
+ i
2137
+ ), (r = i == null ? void 0 : i.inputRules) != null && r.length && console.warn(
2138
+ `Extension ${i.key} has input rules, but these cannot be changed after initializing the editor. Please separate the extension into multiple extensions if you want to add them, or re-initialize the editor.`,
2139
+ i
2140
+ ), this.getProsemirrorPluginsFromExtension(i).plugins.forEach(
2121
2141
  (c) => {
2122
2142
  s.add(c);
2123
2143
  }
2124
2144
  );
2125
- this.updatePlugins((r) => [...r, ...s]);
2145
+ this.updatePlugins((i) => [...i, ...s]);
2126
2146
  }
2127
2147
  /**
2128
2148
  * Register an extension to the editor
@@ -2133,10 +2153,13 @@ class cn {
2133
2153
  let t;
2134
2154
  if (typeof e == "function" ? t = e({ editor: this.editor }) : t = e, !(!t || this.disabledExtensions.has(t.key))) {
2135
2155
  if (typeof e == "function") {
2136
- const o = t[Nt];
2137
- typeof o == "function" && this.extensionFactories.set(o, t);
2156
+ const n = t[Ot];
2157
+ typeof n == "function" && this.extensionFactories.set(n, t);
2138
2158
  }
2139
- return this.extensions.push(t), t;
2159
+ if (this.extensions.push(t), t.blockNoteExtensions)
2160
+ for (const n of t.blockNoteExtensions)
2161
+ this.addExtension(n);
2162
+ return t;
2140
2163
  }
2141
2164
  }
2142
2165
  /**
@@ -2147,16 +2170,16 @@ class cn {
2147
2170
  resolveExtensions(e) {
2148
2171
  const t = [];
2149
2172
  if (typeof e == "function") {
2150
- const o = this.extensionFactories.get(e);
2151
- o && t.push(o);
2173
+ const n = this.extensionFactories.get(e);
2174
+ n && t.push(n);
2152
2175
  } else if (Array.isArray(e))
2153
- for (const o of e)
2154
- t.push(...this.resolveExtensions(o));
2176
+ for (const n of e)
2177
+ t.push(...this.resolveExtensions(n));
2155
2178
  else if (typeof e == "object" && "key" in e)
2156
2179
  t.push(e);
2157
2180
  else if (typeof e == "string") {
2158
- const o = this.extensions.find((s) => s.key === e);
2159
- o && t.push(o);
2181
+ const n = this.extensions.find((s) => s.key === e);
2182
+ n && t.push(n);
2160
2183
  }
2161
2184
  return t;
2162
2185
  }
@@ -2166,28 +2189,28 @@ class cn {
2166
2189
  * @returns void
2167
2190
  */
2168
2191
  unregisterExtension(e) {
2169
- var i;
2192
+ var r;
2170
2193
  const t = this.resolveExtensions(e);
2171
2194
  if (!t.length) {
2172
2195
  console.warn("No extensions found to unregister", e);
2173
2196
  return;
2174
2197
  }
2175
- let o = !1;
2198
+ let n = !1;
2176
2199
  const s = /* @__PURE__ */ new Set();
2177
- for (const r of t) {
2178
- this.extensions = this.extensions.filter((a) => a !== r), this.extensionFactories.forEach((a, l) => {
2179
- a === r && this.extensionFactories.delete(l);
2180
- }), (i = this.abortMap.get(r)) == null || i.abort(), this.abortMap.delete(r);
2181
- const c = this.extensionPlugins.get(r);
2200
+ for (const i of t) {
2201
+ this.extensions = this.extensions.filter((a) => a !== i), this.extensionFactories.forEach((a, l) => {
2202
+ a === i && this.extensionFactories.delete(l);
2203
+ }), (r = this.abortMap.get(i)) == null || r.abort(), this.abortMap.delete(i);
2204
+ const c = this.extensionPlugins.get(i);
2182
2205
  c == null || c.forEach((a) => {
2183
2206
  s.add(a);
2184
- }), this.extensionPlugins.delete(r), r.tiptapExtensions && !o && (o = !0, console.warn(
2185
- `Extension ${r.key} has tiptap extensions, but they will not be removed. Please separate the extension into multiple extensions if you want to remove them, or re-initialize the editor.`,
2207
+ }), this.extensionPlugins.delete(i), i.tiptapExtensions && !n && (n = !0, console.warn(
2208
+ `Extension ${i.key} has tiptap extensions, but they will not be removed. Please separate the extension into multiple extensions if you want to remove them, or re-initialize the editor.`,
2186
2209
  e
2187
2210
  ));
2188
2211
  }
2189
2212
  this.updatePlugins(
2190
- (r) => r.filter((c) => !s.has(c))
2213
+ (i) => i.filter((c) => !s.has(c))
2191
2214
  );
2192
2215
  }
2193
2216
  /**
@@ -2196,44 +2219,44 @@ class cn {
2196
2219
  * @returns void
2197
2220
  */
2198
2221
  updatePlugins(e) {
2199
- const t = this.editor.prosemirrorState, o = t.reconfigure({
2222
+ const t = this.editor.prosemirrorState, n = t.reconfigure({
2200
2223
  plugins: e(t.plugins.slice())
2201
2224
  });
2202
- this.editor.prosemirrorView.updateState(o);
2225
+ this.editor.prosemirrorView.updateState(n);
2203
2226
  }
2204
2227
  /**
2205
2228
  * Get all the extensions that are registered to the editor
2206
2229
  */
2207
2230
  getTiptapExtensions() {
2208
2231
  var s;
2209
- const e = rn(
2232
+ const e = cn(
2210
2233
  this.editor,
2211
2234
  this.options
2212
- ), t = Ct(this.extensions), o = /* @__PURE__ */ new Map();
2213
- for (const i of this.extensions) {
2214
- i.tiptapExtensions && e.push(...i.tiptapExtensions);
2215
- const r = t(i.key), { plugins: c, inputRules: a } = this.getProsemirrorPluginsFromExtension(i);
2235
+ ).filter((r) => !this.disabledExtensions.has(r.name)), t = Ct(this.extensions), n = /* @__PURE__ */ new Map();
2236
+ for (const r of this.extensions) {
2237
+ r.tiptapExtensions && e.push(...r.tiptapExtensions);
2238
+ const i = t(r.key), { plugins: c, inputRules: a } = this.getProsemirrorPluginsFromExtension(r);
2216
2239
  c.length && e.push(
2217
- x.create({
2218
- name: i.key,
2219
- priority: r,
2240
+ E.create({
2241
+ name: r.key,
2242
+ priority: i,
2220
2243
  addProseMirrorPlugins: () => c
2221
2244
  })
2222
- ), a.length && (o.has(r) || o.set(r, []), o.get(r).push(...a));
2245
+ ), a.length && (n.has(i) || n.set(i, []), n.get(i).push(...a));
2223
2246
  }
2224
2247
  e.push(
2225
- x.create({
2248
+ E.create({
2226
2249
  name: "blocknote-input-rules",
2227
2250
  addProseMirrorPlugins() {
2228
- const i = [];
2229
- return Array.from(o.keys()).sort().reverse().forEach((r) => {
2230
- i.push(...o.get(r));
2231
- }), [_t({ rules: i })];
2251
+ const r = [];
2252
+ return Array.from(n.keys()).sort().reverse().forEach((i) => {
2253
+ r.push(...n.get(i));
2254
+ }), [_t({ rules: r })];
2232
2255
  }
2233
2256
  })
2234
2257
  );
2235
- for (const i of ((s = this.options._tiptapOptions) == null ? void 0 : s.extensions) ?? [])
2236
- e.push(i);
2258
+ for (const r of ((s = this.options._tiptapOptions) == null ? void 0 : s.extensions) ?? [])
2259
+ e.push(r);
2237
2260
  return e;
2238
2261
  }
2239
2262
  /**
@@ -2243,9 +2266,9 @@ class cn {
2243
2266
  * - input rules
2244
2267
  */
2245
2268
  getProsemirrorPluginsFromExtension(e) {
2246
- var s, i, r;
2247
- const t = [...e.prosemirrorPlugins ?? []], o = [];
2248
- return !((s = e.prosemirrorPlugins) != null && s.length) && !Object.keys(e.keyboardShortcuts || {}).length && !((i = e.inputRules) != null && i.length) ? { plugins: t, inputRules: o } : (this.extensionPlugins.set(e, t), (r = e.inputRules) != null && r.length && o.push(
2269
+ var s, r, i;
2270
+ const t = [...e.prosemirrorPlugins ?? []], n = [];
2271
+ return !((s = e.prosemirrorPlugins) != null && s.length) && !Object.keys(e.keyboardShortcuts || {}).length && !((r = e.inputRules) != null && r.length) ? { plugins: t, inputRules: n } : (this.extensionPlugins.set(e, t), (i = e.inputRules) != null && i.length && n.push(
2249
2272
  ...e.inputRules.map((c) => new Dt(c.find, (a, l, d, u) => {
2250
2273
  const p = c.replace({
2251
2274
  match: l,
@@ -2256,7 +2279,7 @@ class cn {
2256
2279
  const m = this.editor.getTextCursorPosition();
2257
2280
  if (this.editor.schema.blockSchema[m.block.type].content !== "inline")
2258
2281
  return null;
2259
- const f = H(a.tr), k = a.tr.deleteRange(d, u);
2282
+ const f = $(a.tr), k = a.tr.deleteRange(d, u);
2260
2283
  return tt(k, f.bnBlock.beforePos, p), k;
2261
2284
  }
2262
2285
  return null;
@@ -2270,7 +2293,7 @@ class cn {
2270
2293
  ])
2271
2294
  )
2272
2295
  )
2273
- ), { plugins: t, inputRules: o });
2296
+ ), { plugins: t, inputRules: n });
2274
2297
  }
2275
2298
  /**
2276
2299
  * Get all extensions
@@ -2282,7 +2305,7 @@ class cn {
2282
2305
  }
2283
2306
  getExtension(e) {
2284
2307
  if (typeof e == "string") {
2285
- const t = this.extensions.find((o) => o.key === e);
2308
+ const t = this.extensions.find((n) => n.key === e);
2286
2309
  return t || void 0;
2287
2310
  } else if (typeof e == "function") {
2288
2311
  const t = this.extensionFactories.get(e);
@@ -2297,58 +2320,76 @@ class cn {
2297
2320
  return typeof e == "string" ? this.extensions.some((t) => t.key === e) : typeof e == "object" && "key" in e ? this.extensions.some((t) => t.key === e.key) : typeof e == "function" ? this.extensionFactories.has(e) : !1;
2298
2321
  }
2299
2322
  }
2300
- function ln(n) {
2301
- const e = C(n);
2302
- if (n.selection.empty || "node" in n.selection)
2323
+ function un(o, e) {
2324
+ let { $from: t, $to: n } = e;
2325
+ if (t.pos > t.start() && t.pos < o.content.size) {
2326
+ const s = o.textBetween(t.pos, t.pos + 1);
2327
+ if (/^[\w\p{P}]$/u.test(s)) {
2328
+ const i = o.textBetween(t.start(), t.pos).match(/[\w\p{P}]+$/u);
2329
+ i && (t = o.resolve(t.pos - i[0].length));
2330
+ }
2331
+ }
2332
+ if (n.pos < n.end() && n.pos > 0) {
2333
+ const s = o.textBetween(n.pos - 1, n.pos);
2334
+ if (/^[\w\p{P}]$/u.test(s)) {
2335
+ const i = o.textBetween(n.pos, n.end()).match(/^[\w\p{P}]+/u);
2336
+ i && (n = o.resolve(n.pos + i[0].length));
2337
+ }
2338
+ }
2339
+ return { $from: t, $to: n, from: t.pos, to: n.pos };
2340
+ }
2341
+ function pn(o) {
2342
+ const e = C(o);
2343
+ if (o.selection.empty || "node" in o.selection)
2303
2344
  return;
2304
- const t = n.doc.resolve(
2305
- _(n.doc, n.selection.from).posBeforeNode
2306
- ), o = n.doc.resolve(
2307
- _(n.doc, n.selection.to).posBeforeNode
2345
+ const t = o.doc.resolve(
2346
+ _(o.doc, o.selection.from).posBeforeNode
2347
+ ), n = o.doc.resolve(
2348
+ _(o.doc, o.selection.to).posBeforeNode
2308
2349
  ), s = (l, d) => {
2309
- const u = t.posAtIndex(l, d), p = n.doc.resolve(u).nodeAfter;
2350
+ const u = t.posAtIndex(l, d), p = o.doc.resolve(u).nodeAfter;
2310
2351
  if (!p)
2311
2352
  throw new Error(
2312
2353
  `Error getting selection - node not found at position ${u}`
2313
2354
  );
2314
2355
  return b(p, e);
2315
- }, i = [], r = t.sharedDepth(o.pos), c = t.index(r), a = o.index(r);
2316
- if (t.depth > r) {
2317
- i.push(b(t.nodeAfter, e));
2318
- for (let l = t.depth; l > r; l--)
2356
+ }, r = [], i = t.sharedDepth(n.pos), c = t.index(i), a = n.index(i);
2357
+ if (t.depth > i) {
2358
+ r.push(b(t.nodeAfter, e));
2359
+ for (let l = t.depth; l > i; l--)
2319
2360
  if (t.node(l).type.isInGroup("childContainer")) {
2320
2361
  const u = t.index(l) + 1, p = t.node(l).childCount;
2321
2362
  for (let m = u; m < p; m++)
2322
- i.push(s(m, l));
2363
+ r.push(s(m, l));
2323
2364
  }
2324
2365
  } else
2325
- i.push(s(c, r));
2366
+ r.push(s(c, i));
2326
2367
  for (let l = c + 1; l <= a; l++)
2327
- i.push(s(l, r));
2328
- if (i.length === 0)
2368
+ r.push(s(l, i));
2369
+ if (r.length === 0)
2329
2370
  throw new Error(
2330
- `Error getting selection - selection doesn't span any blocks (${n.selection})`
2371
+ `Error getting selection - selection doesn't span any blocks (${o.selection})`
2331
2372
  );
2332
2373
  return {
2333
- blocks: i
2374
+ blocks: r
2334
2375
  };
2335
2376
  }
2336
- function dn(n, e, t) {
2337
- const o = typeof e == "string" ? e : e.id, s = typeof t == "string" ? t : t.id, i = C(n), r = ke(i);
2338
- if (o === s)
2377
+ function fn(o, e, t) {
2378
+ const n = typeof e == "string" ? e : e.id, s = typeof t == "string" ? t : t.id, r = C(o), i = ke(r);
2379
+ if (n === s)
2339
2380
  throw new Error(
2340
- `Attempting to set selection with the same anchor and head blocks (id ${o})`
2381
+ `Attempting to set selection with the same anchor and head blocks (id ${n})`
2341
2382
  );
2342
- const c = E(o, n.doc);
2383
+ const c = x(n, o.doc);
2343
2384
  if (!c)
2344
- throw new Error(`Block with ID ${o} not found`);
2345
- const a = E(s, n.doc);
2385
+ throw new Error(`Block with ID ${n} not found`);
2386
+ const a = x(s, o.doc);
2346
2387
  if (!a)
2347
2388
  throw new Error(`Block with ID ${s} not found`);
2348
- const l = z(c), d = z(a), u = r.blockSchema[l.blockNoteType], p = r.blockSchema[d.blockNoteType];
2389
+ const l = z(c), d = z(a), u = i.blockSchema[l.blockNoteType], p = i.blockSchema[d.blockNoteType];
2349
2390
  if (!l.isBlockContainer || u.content === "none")
2350
2391
  throw new Error(
2351
- `Attempting to set selection anchor in block without content (id ${o})`
2392
+ `Attempting to set selection anchor in block without content (id ${n})`
2352
2393
  );
2353
2394
  if (!d.isBlockContainer || p.content === "none")
2354
2395
  throw new Error(
@@ -2365,76 +2406,76 @@ function dn(n, e, t) {
2365
2406
  k.height - 1,
2366
2407
  k.width - 1,
2367
2408
  d.blockContent.node
2368
- ) + 1, y = n.doc.resolve(g).nodeAfter.nodeSize;
2409
+ ) + 1, y = o.doc.resolve(g).nodeAfter.nodeSize;
2369
2410
  f = g + y - 2;
2370
2411
  } else
2371
2412
  f = d.blockContent.afterPos - 1;
2372
- n.setSelection(M.create(n.doc, m, f));
2373
- }
2374
- function un(n) {
2375
- const e = C(n);
2376
- let t = n.selection.$from, o = n.selection.$to;
2377
- for (; o.parentOffset >= o.parent.nodeSize - 2 && o.depth > 0; )
2378
- o = n.doc.resolve(o.pos + 1);
2379
- for (; o.parentOffset === 0 && o.depth > 0; )
2380
- o = n.doc.resolve(o.pos - 1);
2381
- for (; t.parentOffset === 0 && t.depth > 0; )
2382
- t = n.doc.resolve(t.pos - 1);
2383
- for (; t.parentOffset >= t.parent.nodeSize - 2 && t.depth > 0; )
2384
- t = n.doc.resolve(t.pos + 1);
2385
- const s = je(
2386
- n.doc.slice(t.pos, o.pos, !0),
2387
- e
2413
+ o.setSelection(M.create(o.doc, m, f));
2414
+ }
2415
+ function hn(o, e = !1) {
2416
+ const t = C(o), n = e ? un(o.doc, o.selection) : o.selection;
2417
+ let s = n.$from, r = n.$to;
2418
+ for (; r.parentOffset >= r.parent.nodeSize - 2 && r.depth > 0; )
2419
+ r = o.doc.resolve(r.pos + 1);
2420
+ for (; r.parentOffset === 0 && r.depth > 0; )
2421
+ r = o.doc.resolve(r.pos - 1);
2422
+ for (; s.parentOffset === 0 && s.depth > 0; )
2423
+ s = o.doc.resolve(s.pos - 1);
2424
+ for (; s.parentOffset >= s.parent.nodeSize - 2 && s.depth > 0; )
2425
+ s = o.doc.resolve(s.pos + 1);
2426
+ const i = je(
2427
+ o.doc.slice(s.pos, r.pos, !0),
2428
+ t
2388
2429
  );
2389
2430
  return {
2390
2431
  _meta: {
2391
- startPos: t.pos,
2392
- endPos: o.pos
2432
+ startPos: s.pos,
2433
+ endPos: r.pos
2393
2434
  },
2394
- ...s
2435
+ ...i
2395
2436
  };
2396
2437
  }
2397
- function pn(n) {
2398
- const { bnBlock: e } = H(n), t = C(n.doc), o = n.doc.resolve(e.beforePos), s = o.nodeBefore, i = n.doc.resolve(e.afterPos).nodeAfter;
2399
- let r;
2400
- return o.depth > 1 && (r = o.node(), r.type.isInGroup("bnBlock") || (r = o.node(o.depth - 1))), {
2438
+ function mn(o) {
2439
+ const { bnBlock: e } = $(o), t = C(o.doc), n = o.doc.resolve(e.beforePos), s = n.nodeBefore, r = o.doc.resolve(e.afterPos).nodeAfter;
2440
+ let i;
2441
+ return n.depth > 1 && (i = n.node(), i.type.isInGroup("bnBlock") || (i = n.node(n.depth - 1))), {
2401
2442
  block: b(e.node, t),
2402
2443
  prevBlock: s === null ? void 0 : b(s, t),
2403
- nextBlock: i === null ? void 0 : b(i, t),
2404
- parentBlock: r === void 0 ? void 0 : b(r, t)
2444
+ nextBlock: r === null ? void 0 : b(r, t),
2445
+ parentBlock: i === void 0 ? void 0 : b(i, t)
2405
2446
  };
2406
2447
  }
2407
- function De(n, e, t = "start") {
2408
- const o = typeof e == "string" ? e : e.id, s = C(n.doc), i = ke(s), r = E(o, n.doc);
2409
- if (!r)
2410
- throw new Error(`Block with ID ${o} not found`);
2411
- const c = z(r), a = i.blockSchema[c.blockNoteType].content;
2448
+ function De(o, e, t = "start") {
2449
+ const n = typeof e == "string" ? e : e.id, s = C(o.doc), r = ke(s), i = x(n, o.doc);
2450
+ if (!i)
2451
+ throw new Error(`Block with ID ${n} not found`);
2452
+ const c = z(i), a = r.blockSchema[c.blockNoteType].content;
2412
2453
  if (c.isBlockContainer) {
2413
2454
  const l = c.blockContent;
2414
2455
  if (a === "none") {
2415
- n.setSelection(L.create(n.doc, l.beforePos));
2456
+ o.setSelection(L.create(o.doc, l.beforePos));
2416
2457
  return;
2417
2458
  }
2418
2459
  if (a === "inline")
2419
- t === "start" ? n.setSelection(
2420
- M.create(n.doc, l.beforePos + 1)
2421
- ) : n.setSelection(
2422
- M.create(n.doc, l.afterPos - 1)
2460
+ t === "start" ? o.setSelection(
2461
+ M.create(o.doc, l.beforePos + 1)
2462
+ ) : o.setSelection(
2463
+ M.create(o.doc, l.afterPos - 1)
2423
2464
  );
2424
2465
  else if (a === "table")
2425
- t === "start" ? n.setSelection(
2426
- M.create(n.doc, l.beforePos + 4)
2427
- ) : n.setSelection(
2428
- M.create(n.doc, l.afterPos - 4)
2466
+ t === "start" ? o.setSelection(
2467
+ M.create(o.doc, l.beforePos + 4)
2468
+ ) : o.setSelection(
2469
+ M.create(o.doc, l.afterPos - 4)
2429
2470
  );
2430
2471
  else
2431
2472
  throw new F(a);
2432
2473
  } else {
2433
2474
  const l = t === "start" ? c.childContainer.node.firstChild : c.childContainer.node.lastChild;
2434
- De(n, l.attrs.id, t);
2475
+ De(o, l.attrs.id, t);
2435
2476
  }
2436
2477
  }
2437
- class fn {
2478
+ class kn {
2438
2479
  constructor(e) {
2439
2480
  this.editor = e;
2440
2481
  }
@@ -2445,7 +2486,7 @@ class fn {
2445
2486
  * If the selection starts / ends halfway through a block, the returned data will contain the entire block.
2446
2487
  */
2447
2488
  getSelection() {
2448
- return this.editor.transact((e) => ln(e));
2489
+ return this.editor.transact((e) => pn(e));
2449
2490
  }
2450
2491
  /**
2451
2492
  * Gets a snapshot of the current selection. This contains all blocks (included nested blocks)
@@ -2454,8 +2495,8 @@ class fn {
2454
2495
  * If the selection starts / ends halfway through a block, the returned block will be
2455
2496
  * only the part of the block that is included in the selection.
2456
2497
  */
2457
- getSelectionCutBlocks() {
2458
- return this.editor.transact((e) => un(e));
2498
+ getSelectionCutBlocks(e = !1) {
2499
+ return this.editor.transact((t) => hn(t, e));
2459
2500
  }
2460
2501
  /**
2461
2502
  * Sets the selection to a range of blocks.
@@ -2463,14 +2504,14 @@ class fn {
2463
2504
  * @param endBlock The identifier of the block that should be the end of the selection.
2464
2505
  */
2465
2506
  setSelection(e, t) {
2466
- return this.editor.transact((o) => dn(o, e, t));
2507
+ return this.editor.transact((n) => fn(n, e, t));
2467
2508
  }
2468
2509
  /**
2469
2510
  * Gets a snapshot of the current text cursor position.
2470
2511
  * @returns A snapshot of the current text cursor position.
2471
2512
  */
2472
2513
  getTextCursorPosition() {
2473
- return this.editor.transact((e) => pn(e));
2514
+ return this.editor.transact((e) => mn(e));
2474
2515
  }
2475
2516
  /**
2476
2517
  * Sets the text cursor position to the start or end of an existing block. Throws an error if the target block could
@@ -2480,7 +2521,7 @@ class fn {
2480
2521
  */
2481
2522
  setTextCursorPosition(e, t = "start") {
2482
2523
  return this.editor.transact(
2483
- (o) => De(o, e, t)
2524
+ (n) => De(n, e, t)
2484
2525
  );
2485
2526
  }
2486
2527
  /**
@@ -2489,20 +2530,20 @@ class fn {
2489
2530
  getSelectionBoundingBox() {
2490
2531
  if (!this.editor.prosemirrorView)
2491
2532
  return;
2492
- const { selection: e } = this.editor.prosemirrorState, { ranges: t } = e, o = Math.min(...t.map((i) => i.$from.pos)), s = Math.max(...t.map((i) => i.$to.pos));
2533
+ const { selection: e } = this.editor.prosemirrorState, { ranges: t } = e, n = Math.min(...t.map((r) => r.$from.pos)), s = Math.max(...t.map((r) => r.$to.pos));
2493
2534
  if (Mt(e)) {
2494
- const i = this.editor.prosemirrorView.nodeDOM(o);
2495
- if (i)
2496
- return i.getBoundingClientRect();
2535
+ const r = this.editor.prosemirrorView.nodeDOM(n);
2536
+ if (r)
2537
+ return r.getBoundingClientRect();
2497
2538
  }
2498
2539
  return wt(
2499
2540
  this.editor.prosemirrorView,
2500
- o,
2541
+ n,
2501
2542
  s
2502
2543
  ).toJSON();
2503
2544
  }
2504
2545
  }
2505
- class hn {
2546
+ class gn {
2506
2547
  constructor(e) {
2507
2548
  /**
2508
2549
  * Stores the currently active transaction, which is the accumulated transaction from all {@link dispatch} calls during a {@link transact} calls
@@ -2548,8 +2589,8 @@ class hn {
2548
2589
  );
2549
2590
  if (this.isInCan)
2550
2591
  return this.canExec(e);
2551
- const t = this.prosemirrorState, o = this.prosemirrorView;
2552
- return e(t, (i) => this.prosemirrorView.dispatch(i), o);
2592
+ const t = this.prosemirrorState, n = this.prosemirrorView;
2593
+ return e(t, (r) => this.prosemirrorView.dispatch(r), n);
2553
2594
  }
2554
2595
  /**
2555
2596
  * Check if a command can be executed. A command should return `false` if it is not valid in the current state.
@@ -2568,8 +2609,8 @@ class hn {
2568
2609
  throw new Error(
2569
2610
  "`canExec` should not be called within a `transact` call, move the `canExec` call outside of the `transact` call"
2570
2611
  );
2571
- const t = this.prosemirrorState, o = this.prosemirrorView;
2572
- return e(t, void 0, o);
2612
+ const t = this.prosemirrorState, n = this.prosemirrorView;
2613
+ return e(t, void 0, n);
2573
2614
  }
2574
2615
  /**
2575
2616
  * Execute a function within a "blocknote transaction".
@@ -2595,9 +2636,9 @@ class hn {
2595
2636
  return e(this.activeTransaction);
2596
2637
  try {
2597
2638
  this.activeTransaction = this.editor._tiptapEditor.state.tr;
2598
- const t = e(this.activeTransaction), o = this.activeTransaction;
2599
- return this.activeTransaction = null, o && // Only dispatch if the transaction was actually modified in some way
2600
- (o.docChanged || o.selectionSet || o.scrolledIntoView || o.storedMarksSet || !o.isGeneric) && this.prosemirrorView.dispatch(o), t;
2639
+ const t = e(this.activeTransaction), n = this.activeTransaction;
2640
+ return this.activeTransaction = null, n && // Only dispatch if the transaction was actually modified in some way
2641
+ (n.docChanged || n.selectionSet || n.scrolledIntoView || n.storedMarksSet || !n.isGeneric) && this.prosemirrorView.dispatch(n), t;
2601
2642
  } finally {
2602
2643
  this.activeTransaction = null;
2603
2644
  }
@@ -2678,17 +2719,17 @@ class hn {
2678
2719
  throw new Error("No redo plugin found");
2679
2720
  }
2680
2721
  }
2681
- function mn(n, e, t, o = { updateSelection: !0 }) {
2682
- let { from: s, to: i } = typeof e == "number" ? { from: e, to: e } : { from: e.from, to: e.to }, r = !0, c = !0, a = "";
2722
+ function bn(o, e, t, n = { updateSelection: !0 }) {
2723
+ let { from: s, to: r } = typeof e == "number" ? { from: e, to: e } : { from: e.from, to: e.to }, i = !0, c = !0, a = "";
2683
2724
  if (t.forEach((l) => {
2684
- l.check(), r && l.isText && l.marks.length === 0 ? a += l.text : r = !1, c = c ? l.isBlock : !1;
2685
- }), s === i && c) {
2686
- const { parent: l } = n.doc.resolve(s);
2687
- l.isTextblock && !l.type.spec.code && !l.childCount && (s -= 1, i += 1);
2725
+ l.check(), i && l.isText && l.marks.length === 0 ? a += l.text : i = !1, c = c ? l.isBlock : !1;
2726
+ }), s === r && c) {
2727
+ const { parent: l } = o.doc.resolve(s);
2728
+ l.isTextblock && !l.type.spec.code && !l.childCount && (s -= 1, r += 1);
2688
2729
  }
2689
- return r ? n.insertText(a, s, i) : n.replaceWith(s, i, t), o.updateSelection && Tt(n, n.steps.length - 1, -1), !0;
2730
+ return i ? o.insertText(a, s, r) : o.replaceWith(s, r, t), n.updateSelection && Tt(o, o.steps.length - 1, -1), !0;
2690
2731
  }
2691
- class kn {
2732
+ class yn {
2692
2733
  constructor(e) {
2693
2734
  this.editor = e;
2694
2735
  }
@@ -2698,15 +2739,15 @@ class kn {
2698
2739
  * @param content can be a string, or array of partial inline content elements
2699
2740
  */
2700
2741
  insertInlineContent(e, { updateSelection: t = !1 } = {}) {
2701
- const o = O(e, this.editor.pmSchema);
2742
+ const n = O(e, this.editor.pmSchema);
2702
2743
  this.editor.transact((s) => {
2703
- mn(
2744
+ bn(
2704
2745
  s,
2705
2746
  {
2706
2747
  from: s.selection.from,
2707
2748
  to: s.selection.to
2708
2749
  },
2709
- o,
2750
+ n,
2710
2751
  {
2711
2752
  updateSelection: t
2712
2753
  }
@@ -2718,16 +2759,16 @@ class kn {
2718
2759
  */
2719
2760
  getActiveStyles() {
2720
2761
  return this.editor.transact((e) => {
2721
- const t = {}, o = e.selection.$to.marks();
2722
- for (const s of o) {
2723
- const i = this.editor.schema.styleSchema[s.type.name];
2724
- if (!i) {
2762
+ const t = {}, n = e.selection.$to.marks();
2763
+ for (const s of n) {
2764
+ const r = this.editor.schema.styleSchema[s.type.name];
2765
+ if (!r) {
2725
2766
  // Links are not considered styles in blocknote
2726
2767
  s.type.name !== "link" && // "blocknoteIgnore" tagged marks (such as comments) are also not considered BlockNote "styles"
2727
2768
  !s.type.spec.blocknoteIgnore && console.warn("mark not found in styleschema", s.type.name);
2728
2769
  continue;
2729
2770
  }
2730
- i.propSchema === "boolean" ? t[i.type] = !0 : t[i.type] = s.attrs.stringValue;
2771
+ r.propSchema === "boolean" ? t[r.type] = !0 : t[r.type] = s.attrs.stringValue;
2731
2772
  }
2732
2773
  return t;
2733
2774
  });
@@ -2737,7 +2778,7 @@ class kn {
2737
2778
  * @param styles The styles to add.
2738
2779
  */
2739
2780
  addStyles(e) {
2740
- for (const [t, o] of Object.entries(e)) {
2781
+ for (const [t, n] of Object.entries(e)) {
2741
2782
  const s = this.editor.schema.styleSchema[t];
2742
2783
  if (!s)
2743
2784
  throw new Error(`style ${t} not found in styleSchema`);
@@ -2745,7 +2786,7 @@ class kn {
2745
2786
  this.editor._tiptapEditor.commands.setMark(t);
2746
2787
  else if (s.propSchema === "string")
2747
2788
  this.editor._tiptapEditor.commands.setMark(t, {
2748
- stringValue: o
2789
+ stringValue: n
2749
2790
  });
2750
2791
  else
2751
2792
  throw new F(s.propSchema);
@@ -2764,7 +2805,7 @@ class kn {
2764
2805
  * @param styles The styles to toggle.
2765
2806
  */
2766
2807
  toggleStyles(e) {
2767
- for (const [t, o] of Object.entries(e)) {
2808
+ for (const [t, n] of Object.entries(e)) {
2768
2809
  const s = this.editor.schema.styleSchema[t];
2769
2810
  if (!s)
2770
2811
  throw new Error(`style ${t} not found in styleSchema`);
@@ -2772,7 +2813,7 @@ class kn {
2772
2813
  this.editor._tiptapEditor.commands.toggleMark(t);
2773
2814
  else if (s.propSchema === "string")
2774
2815
  this.editor._tiptapEditor.commands.toggleMark(t, {
2775
- stringValue: o
2816
+ stringValue: n
2776
2817
  });
2777
2818
  else
2778
2819
  throw new F(s.propSchema);
@@ -2798,65 +2839,65 @@ class kn {
2798
2839
  createLink(e, t) {
2799
2840
  if (e === "")
2800
2841
  return;
2801
- const o = this.editor.pmSchema.mark("link", { href: e });
2842
+ const n = this.editor.pmSchema.mark("link", { href: e });
2802
2843
  this.editor.transact((s) => {
2803
- const { from: i, to: r } = s.selection;
2804
- t ? s.insertText(t, i, r).addMark(i, i + t.length, o) : s.setSelection(jt.create(s.doc, r)).addMark(
2805
- i,
2844
+ const { from: r, to: i } = s.selection;
2845
+ t ? s.insertText(t, r, i).addMark(r, r + t.length, n) : s.setSelection(Wt.create(s.doc, i)).addMark(
2806
2846
  r,
2807
- o
2847
+ i,
2848
+ n
2808
2849
  );
2809
2850
  });
2810
2851
  }
2811
2852
  }
2812
- function gn(n, e) {
2853
+ function Sn(o, e) {
2813
2854
  const t = [];
2814
- return n.forEach((o, s, i) => {
2815
- i !== e && t.push(o);
2855
+ return o.forEach((n, s, r) => {
2856
+ r !== e && t.push(n);
2816
2857
  }), Z.from(t);
2817
2858
  }
2818
- function bn(n, e) {
2859
+ function Bn(o, e) {
2819
2860
  const t = [];
2820
- for (let o = 0; o < n.childCount; o++)
2821
- if (n.child(o).type.name === "tableRow")
2861
+ for (let n = 0; n < o.childCount; n++)
2862
+ if (o.child(n).type.name === "tableRow")
2822
2863
  if (t.length > 0 && t[t.length - 1].type.name === "table") {
2823
- const s = t[t.length - 1], i = s.copy(s.content.addToEnd(n.child(o)));
2824
- t[t.length - 1] = i;
2864
+ const s = t[t.length - 1], r = s.copy(s.content.addToEnd(o.child(n)));
2865
+ t[t.length - 1] = r;
2825
2866
  } else {
2826
2867
  const s = e.nodes.table.createChecked(
2827
2868
  void 0,
2828
- n.child(o)
2869
+ o.child(n)
2829
2870
  );
2830
2871
  t.push(s);
2831
2872
  }
2832
2873
  else
2833
- t.push(n.child(o));
2834
- return n = Z.from(t), n;
2835
- }
2836
- function yn(n, e) {
2837
- let t = Z.from(n.content);
2838
- if (t = bn(t, e.state.schema), !Sn(t, e))
2839
- return new ne(t, n.openStart, n.openEnd);
2840
- for (let o = 0; o < t.childCount; o++)
2841
- if (t.child(o).type.spec.group === "blockContent") {
2842
- const s = [t.child(o)];
2843
- if (o + 1 < t.childCount && t.child(o + 1).type.name === "blockGroup") {
2844
- const r = t.child(o + 1).child(0).child(0);
2845
- (r.type.name === "bulletListItem" || r.type.name === "numberedListItem" || r.type.name === "checkListItem") && (s.push(t.child(o + 1)), t = gn(t, o + 1));
2874
+ t.push(o.child(n));
2875
+ return o = Z.from(t), o;
2876
+ }
2877
+ function Cn(o, e) {
2878
+ let t = Z.from(o.content);
2879
+ if (t = Bn(t, e.state.schema), !xn(t, e))
2880
+ return new ne(t, o.openStart, o.openEnd);
2881
+ for (let n = 0; n < t.childCount; n++)
2882
+ if (t.child(n).type.spec.group === "blockContent") {
2883
+ const s = [t.child(n)];
2884
+ if (n + 1 < t.childCount && t.child(n + 1).type.name === "blockGroup") {
2885
+ const i = t.child(n + 1).child(0).child(0);
2886
+ (i.type.name === "bulletListItem" || i.type.name === "numberedListItem" || i.type.name === "checkListItem") && (s.push(t.child(n + 1)), t = Sn(t, n + 1));
2846
2887
  }
2847
- const i = e.state.schema.nodes.blockContainer.createChecked(
2888
+ const r = e.state.schema.nodes.blockContainer.createChecked(
2848
2889
  void 0,
2849
2890
  s
2850
2891
  );
2851
- t = t.replaceChild(o, i);
2892
+ t = t.replaceChild(n, r);
2852
2893
  }
2853
- return new ne(t, n.openStart, n.openEnd);
2894
+ return new ne(t, o.openStart, o.openEnd);
2854
2895
  }
2855
- function Sn(n, e) {
2856
- var i, r;
2857
- const t = n.childCount === 1, o = ((i = n.firstChild) == null ? void 0 : i.type.spec.content) === "inline*", s = ((r = n.firstChild) == null ? void 0 : r.type.spec.content) === "tableRow+";
2896
+ function xn(o, e) {
2897
+ var r, i;
2898
+ const t = o.childCount === 1, n = ((r = o.firstChild) == null ? void 0 : r.type.spec.content) === "inline*", s = ((i = o.firstChild) == null ? void 0 : i.type.spec.content) === "tableRow+";
2858
2899
  if (t) {
2859
- if (o)
2900
+ if (n)
2860
2901
  return !1;
2861
2902
  if (s) {
2862
2903
  const c = B(e.state);
@@ -2866,7 +2907,7 @@ function Sn(n, e) {
2866
2907
  }
2867
2908
  return !0;
2868
2909
  }
2869
- const Bn = {
2910
+ const En = {
2870
2911
  enableInputRules: !0,
2871
2912
  enablePasteRules: !0,
2872
2913
  enableCoreExtensions: !1
@@ -2961,17 +3002,17 @@ class Le extends Se {
2961
3002
  headers: ((p = t == null ? void 0 : t.tables) == null ? void 0 : p.headers) ?? !1
2962
3003
  }
2963
3004
  };
2964
- const o = {
3005
+ const n = {
2965
3006
  defaultStyles: !0,
2966
- schema: t.schema || Et.create(),
3007
+ schema: t.schema || xt.create(),
2967
3008
  ...t,
2968
3009
  placeholders: {
2969
3010
  ...this.dictionary.placeholders,
2970
3011
  ...t.placeholders
2971
3012
  }
2972
3013
  };
2973
- if (this.schema = o.schema, this.blockImplementations = o.schema.blockSpecs, this.inlineContentImplementations = o.schema.inlineContentSpecs, this.styleImplementations = o.schema.styleSpecs, o.uploadFile) {
2974
- const S = o.uploadFile;
3014
+ if (this.schema = n.schema, this.blockImplementations = n.schema.blockSpecs, this.inlineContentImplementations = n.schema.inlineContentSpecs, this.styleImplementations = n.schema.styleSpecs, n.uploadFile) {
3015
+ const S = n.uploadFile;
2975
3016
  this.uploadFile = async (P, w) => {
2976
3017
  this.onUploadStartCallbacks.forEach(
2977
3018
  (v) => v.apply(this, [w])
@@ -2985,37 +3026,37 @@ class Le extends Se {
2985
3026
  }
2986
3027
  };
2987
3028
  }
2988
- this.resolveFileUrl = o.resolveFileUrl, this._eventManager = new po(this), this._extensionManager = new cn(this, o);
2989
- const s = this._extensionManager.getTiptapExtensions(), i = this._extensionManager.hasExtension("ySync") || this._extensionManager.hasExtension("liveblocksExtension");
2990
- i && o.initialContent && console.warn(
3029
+ this.resolveFileUrl = n.resolveFileUrl, this._eventManager = new fo(this), this._extensionManager = new dn(this, n);
3030
+ const s = this._extensionManager.getTiptapExtensions(), r = this._extensionManager.hasExtension("ySync") || this._extensionManager.hasExtension("liveblocksExtension");
3031
+ r && n.initialContent && console.warn(
2991
3032
  "When using Collaboration, initialContent might cause conflicts, because changes should come from the collaboration provider"
2992
3033
  );
2993
- const r = {
2994
- ...Bn,
2995
- ...o._tiptapOptions,
3034
+ const i = {
3035
+ ...En,
3036
+ ...n._tiptapOptions,
2996
3037
  element: null,
2997
- autofocus: o.autofocus ?? !1,
3038
+ autofocus: n.autofocus ?? !1,
2998
3039
  extensions: s,
2999
3040
  editorProps: {
3000
- ...(m = o._tiptapOptions) == null ? void 0 : m.editorProps,
3041
+ ...(m = n._tiptapOptions) == null ? void 0 : m.editorProps,
3001
3042
  attributes: {
3002
3043
  // As of TipTap v2.5.0 the tabIndex is removed when the editor is not
3003
3044
  // editable, so you can't focus it. We want to revert this as we have
3004
3045
  // UI behaviour that relies on it.
3005
3046
  tabIndex: "0",
3006
- ...(k = (f = o._tiptapOptions) == null ? void 0 : f.editorProps) == null ? void 0 : k.attributes,
3007
- ...(g = o.domAttributes) == null ? void 0 : g.editor,
3047
+ ...(k = (f = n._tiptapOptions) == null ? void 0 : f.editorProps) == null ? void 0 : k.attributes,
3048
+ ...(g = n.domAttributes) == null ? void 0 : g.editor,
3008
3049
  class: Q(
3009
3050
  "bn-editor",
3010
- o.defaultStyles ? "bn-default-styles" : "",
3011
- ((T = (y = o.domAttributes) == null ? void 0 : y.editor) == null ? void 0 : T.class) || ""
3051
+ n.defaultStyles ? "bn-default-styles" : "",
3052
+ ((T = (y = n.domAttributes) == null ? void 0 : y.editor) == null ? void 0 : T.class) || ""
3012
3053
  )
3013
3054
  },
3014
- transformPasted: yn
3055
+ transformPasted: Cn
3015
3056
  }
3016
3057
  };
3017
3058
  try {
3018
- const S = o.initialContent || (i ? [
3059
+ const S = n.initialContent || (r ? [
3019
3060
  {
3020
3061
  type: "paragraph",
3021
3062
  id: "initialBlockId"
@@ -3030,8 +3071,8 @@ class Le extends Se {
3030
3071
  throw new Error(
3031
3072
  "initialContent must be a non-empty array of blocks, received: " + S
3032
3073
  );
3033
- const P = Pt(r.extensions), w = S.map(
3034
- (Ne) => Y(Ne, P, this.schema.styleSchema).toJSON()
3074
+ const P = Pt(i.extensions), w = S.map(
3075
+ (Ne) => q(Ne, P, this.schema.styleSchema).toJSON()
3035
3076
  ), v = vt(
3036
3077
  {
3037
3078
  type: "doc",
@@ -3043,10 +3084,10 @@ class Le extends Se {
3043
3084
  ]
3044
3085
  },
3045
3086
  P,
3046
- r.parseOptions
3087
+ i.parseOptions
3047
3088
  );
3048
3089
  this._tiptapEditor = new It({
3049
- ...r,
3090
+ ...i,
3050
3091
  content: v.toJSON()
3051
3092
  }), this.pmSchema = this._tiptapEditor.schema;
3052
3093
  } catch (S) {
@@ -3061,8 +3102,8 @@ class Le extends Se {
3061
3102
  if (c)
3062
3103
  return c;
3063
3104
  const P = a.apply(this.pmSchema.nodes.doc, S), w = JSON.parse(JSON.stringify(P.toJSON()));
3064
- return w.content[0].content[0].attrs.id = "initialBlockId", c = $e.fromJSON(this.pmSchema, w), c;
3065
- }, this.pmSchema.cached.blockNoteEditor = this, this._blockManager = new uo(this), this._exportManager = new Co(this), this._selectionManager = new fn(this), this._stateManager = new hn(this), this._styleManager = new kn(this), this.emit("create");
3105
+ return w.content[0].content[0].attrs.id = "initialBlockId", c = He.fromJSON(this.pmSchema, w), c;
3106
+ }, this.pmSchema.cached.blockNoteEditor = this, this._blockManager = new po(this), this._exportManager = new xo(this), this._selectionManager = new kn(this), this._stateManager = new gn(this), this._styleManager = new yn(this), this.emit("create");
3066
3107
  }
3067
3108
  static create(t) {
3068
3109
  return new Le(t ?? {});
@@ -3168,14 +3209,14 @@ class Le extends Se {
3168
3209
  // TODO move to extension
3169
3210
  onUploadStart(t) {
3170
3211
  return this.onUploadStartCallbacks.push(t), () => {
3171
- const o = this.onUploadStartCallbacks.indexOf(t);
3172
- o > -1 && this.onUploadStartCallbacks.splice(o, 1);
3212
+ const n = this.onUploadStartCallbacks.indexOf(t);
3213
+ n > -1 && this.onUploadStartCallbacks.splice(n, 1);
3173
3214
  };
3174
3215
  }
3175
3216
  onUploadEnd(t) {
3176
3217
  return this.onUploadEndCallbacks.push(t), () => {
3177
- const o = this.onUploadEndCallbacks.indexOf(t);
3178
- o > -1 && this.onUploadEndCallbacks.splice(o, 1);
3218
+ const n = this.onUploadEndCallbacks.indexOf(t);
3219
+ n > -1 && this.onUploadEndCallbacks.splice(n, 1);
3179
3220
  };
3180
3221
  }
3181
3222
  /**
@@ -3239,8 +3280,8 @@ class Le extends Se {
3239
3280
  * @param callback The callback to execute for each block. Returning `false` stops the traversal.
3240
3281
  * @param reverse Whether the blocks should be traversed in reverse order.
3241
3282
  */
3242
- forEachBlock(t, o = !1) {
3243
- this._blockManager.forEachBlock(t, o);
3283
+ forEachBlock(t, n = !1) {
3284
+ this._blockManager.forEachBlock(t, n);
3244
3285
  }
3245
3286
  /**
3246
3287
  * Executes a callback whenever the editor's contents change.
@@ -3266,8 +3307,7 @@ class Le extends Se {
3266
3307
  * @returns A function to remove the callback.
3267
3308
  */
3268
3309
  onBeforeChange(t) {
3269
- var o;
3270
- return (o = this._extensionManager.getExtension(ye)) == null ? void 0 : o.subscribe(t);
3310
+ return this._extensionManager.getExtension(ye).subscribe(t);
3271
3311
  }
3272
3312
  /**
3273
3313
  * Gets a snapshot of the current text cursor position.
@@ -3282,8 +3322,8 @@ class Le extends Se {
3282
3322
  * @param targetBlock The identifier of an existing block that the text cursor should be moved to.
3283
3323
  * @param placement Whether the text cursor should be placed at the start or end of the block.
3284
3324
  */
3285
- setTextCursorPosition(t, o = "start") {
3286
- return this._selectionManager.setTextCursorPosition(t, o);
3325
+ setTextCursorPosition(t, n = "start") {
3326
+ return this._selectionManager.setTextCursorPosition(t, n);
3287
3327
  }
3288
3328
  /**
3289
3329
  * Gets a snapshot of the current selection. This contains all blocks (included nested blocks)
@@ -3301,16 +3341,16 @@ class Le extends Se {
3301
3341
  * If the selection starts / ends halfway through a block, the returned block will be
3302
3342
  * only the part of the block that is included in the selection.
3303
3343
  */
3304
- getSelectionCutBlocks() {
3305
- return this._selectionManager.getSelectionCutBlocks();
3344
+ getSelectionCutBlocks(t = !1) {
3345
+ return this._selectionManager.getSelectionCutBlocks(t);
3306
3346
  }
3307
3347
  /**
3308
3348
  * Sets the selection to a range of blocks.
3309
3349
  * @param startBlock The identifier of the block that should be the start of the selection.
3310
3350
  * @param endBlock The identifier of the block that should be the end of the selection.
3311
3351
  */
3312
- setSelection(t, o) {
3313
- return this._selectionManager.setSelection(t, o);
3352
+ setSelection(t, n) {
3353
+ return this._selectionManager.setSelection(t, n);
3314
3354
  }
3315
3355
  /**
3316
3356
  * Checks if the editor is currently editable, or if it's locked.
@@ -3334,10 +3374,10 @@ class Le extends Se {
3334
3374
  * @param placement Whether the blocks should be inserted just before, just after, or nested inside the
3335
3375
  * `referenceBlock`.
3336
3376
  */
3337
- insertBlocks(t, o, s = "before") {
3377
+ insertBlocks(t, n, s = "before") {
3338
3378
  return this._blockManager.insertBlocks(
3339
3379
  t,
3340
- o,
3380
+ n,
3341
3381
  s
3342
3382
  );
3343
3383
  }
@@ -3348,8 +3388,8 @@ class Le extends Se {
3348
3388
  * @param blockToUpdate The block that should be updated.
3349
3389
  * @param update A partial block which defines how the existing block should be changed.
3350
3390
  */
3351
- updateBlock(t, o) {
3352
- return this._blockManager.updateBlock(t, o);
3391
+ updateBlock(t, n) {
3392
+ return this._blockManager.updateBlock(t, n);
3353
3393
  }
3354
3394
  /**
3355
3395
  * Removes existing blocks from the editor. Throws an error if any of the blocks could not be found.
@@ -3365,8 +3405,8 @@ class Le extends Se {
3365
3405
  * @param blocksToRemove An array of blocks that should be replaced.
3366
3406
  * @param blocksToInsert An array of partial blocks to replace the old ones with.
3367
3407
  */
3368
- replaceBlocks(t, o) {
3369
- return this._blockManager.replaceBlocks(t, o);
3408
+ replaceBlocks(t, n) {
3409
+ return this._blockManager.replaceBlocks(t, n);
3370
3410
  }
3371
3411
  /**
3372
3412
  * Undo the last action.
@@ -3385,8 +3425,8 @@ class Le extends Se {
3385
3425
  *
3386
3426
  * @param content can be a string, or array of partial inline content elements
3387
3427
  */
3388
- insertInlineContent(t, { updateSelection: o = !1 } = {}) {
3389
- this._styleManager.insertInlineContent(t, { updateSelection: o });
3428
+ insertInlineContent(t, { updateSelection: n = !1 } = {}) {
3429
+ this._styleManager.insertInlineContent(t, { updateSelection: n });
3390
3430
  }
3391
3431
  /**
3392
3432
  * Gets the active text styles at the text cursor position or at the end of the current selection if it's active.
@@ -3432,8 +3472,8 @@ class Le extends Se {
3432
3472
  * @param url The link URL.
3433
3473
  * @param text The text to display the link with.
3434
3474
  */
3435
- createLink(t, o) {
3436
- this._styleManager.createLink(t, o);
3475
+ createLink(t, n) {
3476
+ this._styleManager.createLink(t, n);
3437
3477
  }
3438
3478
  /**
3439
3479
  * Checks if the block containing the text cursor can be nested.
@@ -3532,8 +3572,8 @@ class Le extends Se {
3532
3572
  * @param callback The callback to execute.
3533
3573
  * @returns A function to remove the callback.
3534
3574
  */
3535
- onChange(t, o) {
3536
- return this._eventManager.onChange(t, o);
3575
+ onChange(t, n) {
3576
+ return this._eventManager.onChange(t, n);
3537
3577
  }
3538
3578
  /**
3539
3579
  * A callback function that runs whenever the text cursor position or selection changes.
@@ -3541,10 +3581,10 @@ class Le extends Se {
3541
3581
  * @param callback The callback to execute.
3542
3582
  * @returns A function to remove the callback.
3543
3583
  */
3544
- onSelectionChange(t, o) {
3584
+ onSelectionChange(t, n) {
3545
3585
  return this._eventManager.onSelectionChange(
3546
3586
  t,
3547
- o
3587
+ n
3548
3588
  );
3549
3589
  }
3550
3590
  /**
@@ -3585,8 +3625,8 @@ class Le extends Se {
3585
3625
  * @param html The HTML to paste.
3586
3626
  * @param raw Whether to paste the HTML as is, or to convert it to BlockNote HTML.
3587
3627
  */
3588
- pasteHTML(t, o = !1) {
3589
- this._exportManager.pasteHTML(t, o);
3628
+ pasteHTML(t, n = !1) {
3629
+ this._exportManager.pasteHTML(t, n);
3590
3630
  }
3591
3631
  /**
3592
3632
  * Paste text into the editor. Defaults to interpreting text as markdown.
@@ -3603,19 +3643,19 @@ class Le extends Se {
3603
3643
  return this._exportManager.pasteMarkdown(t);
3604
3644
  }
3605
3645
  }
3606
- class Yn {
3607
- constructor(e, t, o) {
3608
- this.mappings = t, this.options = o;
3646
+ class Xn {
3647
+ constructor(e, t, n) {
3648
+ this.mappings = t, this.options = n;
3609
3649
  }
3610
3650
  async resolveFile(e) {
3611
- var o;
3612
- if (!((o = this.options) != null && o.resolveFileUrl))
3651
+ var n;
3652
+ if (!((n = this.options) != null && n.resolveFileUrl))
3613
3653
  return (await fetch(e)).blob();
3614
3654
  const t = await this.options.resolveFileUrl(e);
3615
3655
  return t instanceof Blob ? t : (await fetch(t)).blob();
3616
3656
  }
3617
3657
  mapStyles(e) {
3618
- return Object.entries(e).map(([o, s]) => this.mappings.styleMapping[o](s, this));
3658
+ return Object.entries(e).map(([n, s]) => this.mappings.styleMapping[n](s, this));
3619
3659
  }
3620
3660
  mapInlineContent(e) {
3621
3661
  return this.mappings.inlineContentMapping[e.type](
@@ -3626,200 +3666,201 @@ class Yn {
3626
3666
  transformInlineContent(e) {
3627
3667
  return e.map((t) => this.mapInlineContent(t));
3628
3668
  }
3629
- async mapBlock(e, t, o, s) {
3669
+ async mapBlock(e, t, n, s) {
3630
3670
  return this.mappings.blockMapping[e.type](
3631
3671
  e,
3632
3672
  this,
3633
3673
  t,
3634
- o,
3674
+ n,
3635
3675
  s
3636
3676
  );
3637
3677
  }
3638
3678
  }
3639
- function qn(n) {
3679
+ function Zn(o) {
3640
3680
  return {
3641
3681
  createBlockMapping: (e) => e,
3642
3682
  createInlineContentMapping: (e) => e,
3643
3683
  createStyleMapping: (e) => e
3644
3684
  };
3645
3685
  }
3646
- function Qn(n, ...e) {
3647
- const t = [...n];
3648
- for (const o of e)
3649
- for (const s of o) {
3650
- const i = t.findLastIndex(
3651
- (r) => r.group === s.group
3686
+ function es(o, ...e) {
3687
+ const t = [...o];
3688
+ for (const n of e)
3689
+ for (const s of n) {
3690
+ const r = t.findLastIndex(
3691
+ (i) => i.group === s.group
3652
3692
  );
3653
- i === -1 ? t.push(s) : t.splice(i + 1, 0, s);
3693
+ r === -1 ? t.push(s) : t.splice(r + 1, 0, s);
3654
3694
  }
3655
3695
  return t;
3656
3696
  }
3657
3697
  export {
3658
3698
  Le as BlockNoteEditor,
3659
- Et as BlockNoteSchema,
3660
- ms as COLORS_DARK_MODE_DEFAULT,
3661
- ks as COLORS_DEFAULT,
3662
- Yr as CustomBlockNoteSchema,
3663
- gs as EMPTY_CELL_HEIGHT,
3664
- bs as EMPTY_CELL_WIDTH,
3699
+ xt as BlockNoteSchema,
3700
+ bs as COLORS_DARK_MODE_DEFAULT,
3701
+ ys as COLORS_DEFAULT,
3702
+ Xr as CustomBlockNoteSchema,
3703
+ Ss as EMPTY_CELL_HEIGHT,
3704
+ Bs as EMPTY_CELL_WIDTH,
3665
3705
  Se as EventEmitter,
3666
- Yn as Exporter,
3667
- ys as FILE_AUDIO_ICON_SVG,
3668
- Ss as FILE_IMAGE_ICON_SVG,
3669
- Bs as FILE_VIDEO_ICON_SVG,
3706
+ Xn as Exporter,
3707
+ Cs as FILE_AUDIO_ICON_SVG,
3708
+ xs as FILE_IMAGE_ICON_SVG,
3709
+ Es as FILE_VIDEO_ICON_SVG,
3670
3710
  Pe as HTMLToBlocks,
3671
3711
  me as UniqueID,
3672
3712
  F as UnreachableCaseError,
3673
- Cs as addDefaultPropsExternalHTML,
3674
- $ as addInlineContentAttributes,
3713
+ Ms as addDefaultPropsExternalHTML,
3714
+ H as addInlineContentAttributes,
3675
3715
  We as addInlineContentKeyboardShortcuts,
3676
- Es as addNodeAndExtensionsToSpec,
3677
- xs as addStyleAttributes,
3678
- Ms as applyNonSelectableBlockFix,
3679
- es as assertEmpty,
3680
- ws as audioParse,
3681
- Ts as audioRender,
3682
- Ps as audioToExternalHTML,
3683
- vs as blockHasType,
3684
- Y as blockToNode,
3716
+ ws as addNodeAndExtensionsToSpec,
3717
+ Ts as addStyleAttributes,
3718
+ Ps as applyNonSelectableBlockFix,
3719
+ ns as assertEmpty,
3720
+ vs as audioParse,
3721
+ Is as audioRender,
3722
+ As as audioToExternalHTML,
3723
+ _s as blockHasType,
3724
+ q as blockToNode,
3685
3725
  nt as blocksToMarkdown,
3686
- Is as camelToDataKebab,
3687
- As as captureCellAnchor,
3688
- qr as checkPageBreakBlocksInSchema,
3726
+ Ds as camelToDataKebab,
3727
+ Ls as captureCellAnchor,
3728
+ Zr as checkPageBreakBlocksInSchema,
3689
3729
  st as cleanHTMLToMarkdown,
3690
- Qn as combineByGroup,
3730
+ es as combineByGroup,
3691
3731
  Re as contentNodeToInlineContent,
3692
3732
  Ge as contentNodeToTableContent,
3693
- _s as createAudioBlockConfig,
3694
- Ds as createAudioBlockSpec,
3695
- Ls as createBlockConfig,
3696
- Ns as createBlockSpec,
3697
- Os as createBlockSpecFromTiptapNode,
3698
- Fs as createBulletListItemBlockConfig,
3699
- Hs as createBulletListItemBlockSpec,
3700
- $s as createCheckListItemBlockSpec,
3701
- Vs as createCheckListItemConfig,
3702
- Us as createCodeBlockConfig,
3703
- zs as createCodeBlockSpec,
3704
- Gs as createDefaultBlockDOMOutputSpec,
3705
- Rs as createDividerBlockConfig,
3706
- js as createDividerBlockSpec,
3707
- ni as createExtension,
3733
+ Ns as createAudioBlockConfig,
3734
+ Os as createAudioBlockSpec,
3735
+ Fs as createBlockConfig,
3736
+ $s as createBlockSpec,
3737
+ Hs as createBlockSpecFromTiptapNode,
3738
+ Vs as createBulletListItemBlockConfig,
3739
+ Us as createBulletListItemBlockSpec,
3740
+ zs as createCheckListItemBlockSpec,
3741
+ Gs as createCheckListItemConfig,
3742
+ Rs as createCodeBlockConfig,
3743
+ js as createCodeBlockSpec,
3744
+ Ws as createDefaultBlockDOMOutputSpec,
3745
+ Ks as createDividerBlockConfig,
3746
+ Js as createDividerBlockSpec,
3747
+ Nt as createExtension,
3708
3748
  be as createExternalHTMLExporter,
3709
- Ws as createFileBlockConfig,
3710
- Ks as createFileBlockSpec,
3711
- Js as createHeadingBlockConfig,
3712
- Ys as createHeadingBlockSpec,
3713
- qs as createImageBlockConfig,
3714
- Qs as createImageBlockSpec,
3715
- Jn as createInlineContentSpec,
3749
+ qs as createFileBlockConfig,
3750
+ Ys as createFileBlockSpec,
3751
+ Qs as createHeadingBlockConfig,
3752
+ Xs as createHeadingBlockSpec,
3753
+ Zs as createImageBlockConfig,
3754
+ er as createImageBlockSpec,
3755
+ Qn as createInlineContentSpec,
3716
3756
  Je as createInlineContentSpecFromTipTapNode,
3717
- Qt as createInternalHTMLSerializer,
3718
- Xs as createInternalInlineContentSpec,
3719
- Zs as createInternalStyleSpec,
3720
- er as createNumberedListItemBlockConfig,
3721
- tr as createNumberedListItemBlockSpec,
3722
- Qr as createPageBreakBlockConfig,
3723
- Xr as createPageBreakBlockSpec,
3724
- or as createParagraphBlockConfig,
3725
- nr as createParagraphBlockSpec,
3726
- sr as createQuoteBlockConfig,
3727
- rr as createQuoteBlockSpec,
3728
- si as createStore,
3729
- ir as createStyleSpec,
3730
- ar as createStyleSpecFromTipTapMark,
3731
- cr as createTableBlockSpec,
3732
- lr as createToggleListItemBlockConfig,
3733
- dr as createToggleListItemBlockSpec,
3734
- ur as createToggleWrapper,
3735
- pr as createVideoBlockConfig,
3736
- fr as createVideoBlockSpec,
3737
- hr as defaultBlockSpecs,
3738
- mr as defaultBlockToHTML,
3739
- kr as defaultInlineContentSchema,
3740
- gr as defaultInlineContentSpecs,
3741
- br as defaultProps,
3742
- yr as defaultStyleSchema,
3743
- Sr as defaultStyleSpecs,
3744
- Br as defaultToggledState,
3757
+ Xt as createInternalHTMLSerializer,
3758
+ tr as createInternalInlineContentSpec,
3759
+ or as createInternalStyleSpec,
3760
+ nr as createNumberedListItemBlockConfig,
3761
+ sr as createNumberedListItemBlockSpec,
3762
+ ei as createPageBreakBlockConfig,
3763
+ ti as createPageBreakBlockSpec,
3764
+ rr as createParagraphBlockConfig,
3765
+ ir as createParagraphBlockSpec,
3766
+ ar as createQuoteBlockConfig,
3767
+ cr as createQuoteBlockSpec,
3768
+ ii as createStore,
3769
+ lr as createStyleSpec,
3770
+ dr as createStyleSpecFromTipTapMark,
3771
+ ur as createTableBlockSpec,
3772
+ pr as createToggleListItemBlockConfig,
3773
+ fr as createToggleListItemBlockSpec,
3774
+ hr as createToggleWrapper,
3775
+ mr as createVideoBlockConfig,
3776
+ kr as createVideoBlockSpec,
3777
+ gr as defaultBlockSpecs,
3778
+ br as defaultBlockToHTML,
3779
+ yr as defaultInlineContentSchema,
3780
+ Sr as defaultInlineContentSpecs,
3781
+ Br as defaultProps,
3782
+ Cr as defaultStyleSchema,
3783
+ xr as defaultStyleSpecs,
3784
+ Er as defaultToggledState,
3745
3785
  ze as docToBlocks,
3746
- Cr as editorHasBlockWithType,
3747
- Er as fileParse,
3748
- xr as filenameFromURL,
3786
+ Mr as editorHasBlockWithType,
3787
+ un as expandPMRangeToWords,
3788
+ wr as fileParse,
3789
+ Tr as filenameFromURL,
3749
3790
  W as fixColumnList,
3750
- Mr as formatKeyboardShortcut,
3791
+ Pr as formatKeyboardShortcut,
3751
3792
  Qe as getBackgroundColorAttribute,
3752
- io as getBlock,
3753
- ts as getBlockCache,
3754
- wr as getBlockFromPos,
3793
+ ao as getBlock,
3794
+ ss as getBlockCache,
3795
+ vr as getBlockFromPos,
3755
3796
  z as getBlockInfo,
3756
- q as getBlockInfoFromResolvedPos,
3797
+ Y as getBlockInfoFromResolvedPos,
3757
3798
  B as getBlockInfoFromSelection,
3758
- H as getBlockInfoFromTransaction,
3759
- os as getBlockInfoWithManualOffset,
3799
+ $ as getBlockInfoFromTransaction,
3800
+ rs as getBlockInfoWithManualOffset,
3760
3801
  ke as getBlockNoteSchema,
3761
- ns as getBlockSchema,
3802
+ is as getBlockSchema,
3762
3803
  ot as getBlocksChangedByTransaction,
3763
- ss as getColspan,
3764
- Wt as getInlineContentParseRules,
3765
- rs as getInlineContentSchema,
3766
- Tr as getInlineContentSchemaFromSpecs,
3767
- Pr as getLanguageId,
3804
+ as as getColspan,
3805
+ Kt as getInlineContentParseRules,
3806
+ cs as getInlineContentSchema,
3807
+ Ir as getInlineContentSchemaFromSpecs,
3808
+ Ar as getLanguageId,
3768
3809
  _ as getNearestBlockPos,
3769
- co as getNextBlock,
3770
- E as getNodeById,
3771
- Zr as getPageBreakSlashMenuItems,
3772
- lo as getParentBlock,
3773
- vr as getParseRules,
3810
+ lo as getNextBlock,
3811
+ x as getNodeById,
3812
+ oi as getPageBreakSlashMenuItems,
3813
+ uo as getParentBlock,
3814
+ _r as getParseRules,
3774
3815
  C as getPmSchema,
3775
- ao as getPrevBlock,
3776
- is as getRowspan,
3777
- Ir as getStyleParseRules,
3778
- as as getStyleSchema,
3779
- Ar as getStyleSchemaFromSpecs,
3780
- _r as getTextAlignmentAttribute,
3816
+ co as getPrevBlock,
3817
+ ls as getRowspan,
3818
+ Dr as getStyleParseRules,
3819
+ ds as getStyleSchema,
3820
+ Lr as getStyleSchemaFromSpecs,
3821
+ Nr as getTextAlignmentAttribute,
3781
3822
  et as getTextColorAttribute,
3782
- Dr as imageParse,
3783
- Lr as imageRender,
3784
- Nr as imageToExternalHTML,
3823
+ Or as imageParse,
3824
+ Fr as imageRender,
3825
+ $r as imageToExternalHTML,
3785
3826
  O as inlineContentToNodes,
3786
- Kt as insertBlocks,
3787
- Or as isAppleOS,
3827
+ Jt as insertBlocks,
3828
+ Hr as isAppleOS,
3788
3829
  j as isEmptyColumn,
3789
- cs as isLinkInlineContent,
3790
- Fr as isNodeBlock,
3791
- ls as isPartialLinkInlineContent,
3792
- ds as isPartialTableCell,
3793
- Hr as isSafari,
3794
- us as isStyledTextInlineContent,
3795
- ps as isTableCell,
3796
- $r as isTableCellSelection,
3797
- qe as isVideoUrl,
3798
- fs as mapTableCell,
3799
- qn as mappingFactory,
3800
- Bo as markdownToBlocks,
3830
+ us as isLinkInlineContent,
3831
+ Vr as isNodeBlock,
3832
+ ps as isPartialLinkInlineContent,
3833
+ fs as isPartialTableCell,
3834
+ Ur as isSafari,
3835
+ hs as isStyledTextInlineContent,
3836
+ ms as isTableCell,
3837
+ zr as isTableCellSelection,
3838
+ Ye as isVideoUrl,
3839
+ ks as mapTableCell,
3840
+ Zn as mappingFactory,
3841
+ Co as markdownToBlocks,
3801
3842
  ve as markdownToHTML,
3802
3843
  Q as mergeCSSClasses,
3803
- Vr as mergeParagraphs,
3844
+ Gr as mergeParagraphs,
3804
3845
  b as nodeToBlock,
3805
3846
  U as nodeToCustomInlineContent,
3806
- Ur as parseAudioElement,
3807
- zr as parseDefaultProps,
3847
+ Rr as parseAudioElement,
3848
+ jr as parseDefaultProps,
3808
3849
  Ke as propsToAttributes,
3809
3850
  je as prosemirrorSliceToSlicedBlocks,
3810
3851
  ie as removeAndInsertBlocks,
3811
- Jt as removeEmptyColumns,
3852
+ qt as removeEmptyColumns,
3812
3853
  Ae as selectedFragmentToHTML,
3813
- Gr as stylePropsToAttributes,
3854
+ Wr as stylePropsToAttributes,
3814
3855
  Ue as tableContentToNodes,
3815
- Rr as tablePropSchema,
3816
- jr as trackPosition,
3817
- Ye as updateBlock,
3856
+ Kr as tablePropSchema,
3857
+ Jr as trackPosition,
3858
+ qe as updateBlock,
3818
3859
  Ze as updateBlockCommand,
3819
3860
  tt as updateBlockTr,
3820
- ei as uploadToTmpFilesDotOrg_DEV_ONLY,
3821
- Wr as videoParse,
3822
- ti as withPageBreak,
3823
- Kr as wrapInBlockStructure
3861
+ ni as uploadToTmpFilesDotOrg_DEV_ONLY,
3862
+ qr as videoParse,
3863
+ si as withPageBreak,
3864
+ Yr as wrapInBlockStructure
3824
3865
  };
3825
3866
  //# sourceMappingURL=blocknote.js.map