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