@blocknote/core 0.15.0 → 0.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/blocknote.js CHANGED
@@ -1,40 +1,39 @@
1
- var Bt = Object.defineProperty;
2
- var Lt = (e, t, o) => t in e ? Bt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
- var c = (e, t, o) => (Lt(e, typeof t != "symbol" ? t + "" : t, o), o);
4
- import { Slice as D, Fragment as L, DOMSerializer as we, DOMParser as It, Node as At } from "prosemirror-model";
5
- import Je from "rehype-parse";
6
- import Ye from "rehype-stringify";
7
- import { unified as ve } from "unified";
8
- import { Extension as M, combineTransactionSteps as Nt, getChangedRanges as Pt, findChildrenInRange as Ht, Node as $, Mark as xe, InputRule as ee, callOrReturn as Ut, getExtensionField as Dt, mergeAttributes as jt, selectionToInsertionEnd as Rt, isTextSelection as Vt, isNodeSelection as Ot, posToDOMRect as ke, getMarkRange as He, findParentNode as zt, findChildren as Ue, extensions as J, Editor as Ft, createDocument as Gt, getSchema as Kt } from "@tiptap/core";
9
- import { Plugin as y, PluginKey as S, Selection as he, NodeSelection as ne, TextSelection as Y, EditorState as Wt } from "prosemirror-state";
10
- import { v4 as $t } from "uuid";
11
- import { fromDom as _e } from "hast-util-from-dom";
12
- import qt from "@tiptap/extension-bold";
13
- import Xt from "@tiptap/extension-code";
14
- import Zt from "@tiptap/extension-italic";
15
- import Jt from "@tiptap/extension-strike";
16
- import Yt from "@tiptap/extension-underline";
17
- import { TableCell as Qt } from "@tiptap/extension-table-cell";
18
- import { TableHeader as eo } from "@tiptap/extension-table-header";
19
- import { TableRow as to } from "@tiptap/extension-table-row";
20
- import { columnResizing as oo, tableEditing as io } from "prosemirror-tables";
21
- import no from "rehype-remark";
22
- import Qe from "remark-gfm";
23
- import ro from "remark-stringify";
24
- import ao from "remark-parse";
25
- import so, { defaultHandlers as lo } from "remark-rehype";
26
- import { DecorationSet as G, Decoration as K, EditorView as co } from "prosemirror-view";
27
- import uo from "@tiptap/extension-collaboration";
28
- import po from "@tiptap/extension-collaboration-cursor";
29
- import { Dropcursor as ho } from "@tiptap/extension-dropcursor";
30
- import { Gapcursor as mo } from "@tiptap/extension-gapcursor";
31
- import { HardBreak as fo } from "@tiptap/extension-hard-break";
32
- import { History as go } from "@tiptap/extension-history";
33
- import { Link as bo } from "@tiptap/extension-link";
34
- import { Text as ko } from "@tiptap/extension-text";
35
- import _o from "@emoji-mart/data";
36
- import { init as yo, SearchIndex as wo } from "emoji-mart";
37
- const vo = {
1
+ var Tt = Object.defineProperty;
2
+ var Bt = (e, t, o) => t in e ? Tt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
+ var c = (e, t, o) => Bt(e, typeof t != "symbol" ? t + "" : t, o);
4
+ import { Slice as D, Fragment as L, DOMSerializer as ve, DOMParser as Lt, Node as It } from "prosemirror-model";
5
+ import Ze from "rehype-parse";
6
+ import Je from "rehype-stringify";
7
+ import { unified as xe } from "unified";
8
+ import { Extension as M, combineTransactionSteps as At, getChangedRanges as Nt, findChildrenInRange as Pt, Node as $, Mark as Ee, InputRule as ee, callOrReturn as Ht, getExtensionField as Ut, mergeAttributes as Dt, selectionToInsertionEnd as jt, isTextSelection as Vt, isNodeSelection as Rt, posToDOMRect as _e, getMarkRange as Ue, findParentNode as Ot, findChildren as De, extensions as J, Editor as zt, createDocument as Ft, getSchema as Gt } from "@tiptap/core";
9
+ import { Plugin as y, PluginKey as S, Selection as me, NodeSelection as re, TextSelection as Y, EditorState as Kt } from "prosemirror-state";
10
+ import { v4 as Wt } from "uuid";
11
+ import { fromDom as ye } from "hast-util-from-dom";
12
+ import $t from "@tiptap/extension-bold";
13
+ import qt from "@tiptap/extension-code";
14
+ import Xt from "@tiptap/extension-italic";
15
+ import Zt from "@tiptap/extension-strike";
16
+ import Jt from "@tiptap/extension-underline";
17
+ import { TableCell as Yt } from "@tiptap/extension-table-cell";
18
+ import { TableHeader as Qt } from "@tiptap/extension-table-header";
19
+ import { TableRow as eo } from "@tiptap/extension-table-row";
20
+ import { columnResizing as to, tableEditing as oo } from "prosemirror-tables";
21
+ import io from "rehype-remark";
22
+ import Ye from "remark-gfm";
23
+ import no from "remark-stringify";
24
+ import ro from "remark-parse";
25
+ import ao, { defaultHandlers as so } from "remark-rehype";
26
+ import { DecorationSet as G, Decoration as K, EditorView as lo } from "prosemirror-view";
27
+ import co from "@tiptap/extension-collaboration";
28
+ import uo from "@tiptap/extension-collaboration-cursor";
29
+ import { Dropcursor as po } from "@tiptap/extension-dropcursor";
30
+ import { Gapcursor as ho } from "@tiptap/extension-gapcursor";
31
+ import { HardBreak as mo } from "@tiptap/extension-hard-break";
32
+ import { History as fo } from "@tiptap/extension-history";
33
+ import { Link as go } from "@tiptap/extension-link";
34
+ import { Text as bo } from "@tiptap/extension-text";
35
+ import { init as ko, SearchIndex as _o } from "emoji-mart";
36
+ const yo = {
38
37
  slash_menu: {
39
38
  heading: {
40
39
  title: "عنوان 1",
@@ -324,7 +323,7 @@ const vo = {
324
323
  generic: {
325
324
  ctrl_shortcut: "Ctrl"
326
325
  }
327
- }, et = {
326
+ }, Qe = {
328
327
  slash_menu: {
329
328
  heading: {
330
329
  title: "Heading 1",
@@ -510,7 +509,7 @@ const vo = {
510
509
  },
511
510
  strike: {
512
511
  tooltip: "Strike",
513
- secondary_tooltip: "Mod+Shift+X"
512
+ secondary_tooltip: "Mod+Shift+S"
514
513
  },
515
514
  code: {
516
515
  tooltip: "Code",
@@ -630,7 +629,7 @@ const vo = {
630
629
  generic: {
631
630
  ctrl_shortcut: "Ctrl"
632
631
  }
633
- }, xo = {
632
+ }, wo = {
634
633
  slash_menu: {
635
634
  heading: {
636
635
  title: "Titre 1",
@@ -935,7 +934,7 @@ const vo = {
935
934
  generic: {
936
935
  ctrl_shortcut: "Ctrl"
937
936
  }
938
- }, Eo = {
937
+ }, vo = {
939
938
  slash_menu: {
940
939
  heading: {
941
940
  title: "Fyrirsögn 1",
@@ -1232,7 +1231,7 @@ const vo = {
1232
1231
  generic: {
1233
1232
  ctrl_shortcut: "Ctrl"
1234
1233
  }
1235
- }, Co = {
1234
+ }, xo = {
1236
1235
  slash_menu: {
1237
1236
  heading: {
1238
1237
  title: "見出し1",
@@ -1557,7 +1556,7 @@ const vo = {
1557
1556
  generic: {
1558
1557
  ctrl_shortcut: "Ctrl"
1559
1558
  }
1560
- }, So = {
1559
+ }, Eo = {
1561
1560
  slash_menu: {
1562
1561
  heading: {
1563
1562
  title: "제목1",
@@ -1875,7 +1874,7 @@ const vo = {
1875
1874
  generic: {
1876
1875
  ctrl_shortcut: "Ctrl"
1877
1876
  }
1878
- }, Mo = {
1877
+ }, Co = {
1879
1878
  slash_menu: {
1880
1879
  heading: {
1881
1880
  title: "Kop 1",
@@ -2180,7 +2179,7 @@ const vo = {
2180
2179
  generic: {
2181
2180
  ctrl_shortcut: "Ctrl"
2182
2181
  }
2183
- }, To = {
2182
+ }, So = {
2184
2183
  slash_menu: {
2185
2184
  heading: {
2186
2185
  title: "Nagłówek 1",
@@ -2469,7 +2468,7 @@ const vo = {
2469
2468
  generic: {
2470
2469
  ctrl_shortcut: "Ctrl"
2471
2470
  }
2472
- }, Bo = {
2471
+ }, Mo = {
2473
2472
  slash_menu: {
2474
2473
  heading: {
2475
2474
  title: "Título",
@@ -2766,7 +2765,7 @@ const vo = {
2766
2765
  generic: {
2767
2766
  ctrl_shortcut: "Ctrl"
2768
2767
  }
2769
- }, Lo = {
2768
+ }, To = {
2770
2769
  slash_menu: {
2771
2770
  heading: {
2772
2771
  title: "Tiêu đề H1",
@@ -3070,7 +3069,7 @@ const vo = {
3070
3069
  generic: {
3071
3070
  ctrl_shortcut: "Ctrl"
3072
3071
  }
3073
- }, Io = {
3072
+ }, Bo = {
3074
3073
  slash_menu: {
3075
3074
  heading: {
3076
3075
  title: "一级标题",
@@ -3408,7 +3407,7 @@ const vo = {
3408
3407
  generic: {
3409
3408
  ctrl_shortcut: "Ctrl"
3410
3409
  }
3411
- }, Ao = {
3410
+ }, Lo = {
3412
3411
  slash_menu: {
3413
3412
  heading: {
3414
3413
  title: "Заголовок 1 уровня",
@@ -3740,33 +3739,33 @@ const vo = {
3740
3739
  generic: {
3741
3740
  ctrl_shortcut: "Ctrl"
3742
3741
  }
3743
- }, zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3742
+ }, Vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3744
3743
  __proto__: null,
3745
- ar: vo,
3746
- en: et,
3747
- fr: xo,
3748
- is: Eo,
3749
- ja: Co,
3750
- ko: So,
3751
- nl: Mo,
3752
- pl: To,
3753
- pt: Bo,
3754
- ru: Ao,
3755
- vi: Lo,
3756
- zh: Io
3744
+ ar: yo,
3745
+ en: Qe,
3746
+ fr: wo,
3747
+ is: vo,
3748
+ ja: xo,
3749
+ ko: Eo,
3750
+ nl: Co,
3751
+ pl: So,
3752
+ pt: Mo,
3753
+ ru: Lo,
3754
+ vi: To,
3755
+ zh: Bo
3757
3756
  }, Symbol.toStringTag, { value: "Module" }));
3758
- function No(e, t = JSON.stringify) {
3757
+ function Io(e, t = JSON.stringify) {
3759
3758
  const o = {};
3760
3759
  return e.filter((i) => {
3761
3760
  const n = t(i);
3762
3761
  return Object.prototype.hasOwnProperty.call(o, n) ? !1 : o[n] = !0;
3763
3762
  });
3764
3763
  }
3765
- function Po(e) {
3764
+ function Ao(e) {
3766
3765
  const t = e.filter(
3767
3766
  (i, n) => e.indexOf(i) !== n
3768
3767
  );
3769
- return No(t);
3768
+ return Io(t);
3770
3769
  }
3771
3770
  const oe = M.create({
3772
3771
  name: "uniqueID",
@@ -3782,7 +3781,7 @@ const oe = M.create({
3782
3781
  const e = window.__TEST_OPTIONS;
3783
3782
  return e.mockID === void 0 ? e.mockID = 0 : e.mockID++, e.mockID.toString();
3784
3783
  }
3785
- return $t();
3784
+ return Wt();
3786
3785
  },
3787
3786
  filterTransaction: null
3788
3787
  };
@@ -3845,26 +3844,26 @@ const oe = M.create({
3845
3844
  });
3846
3845
  if (!r || a)
3847
3846
  return;
3848
- const { tr: s } = n, { types: l, attributeName: d, generateID: u } = this.options, p = Nt(
3847
+ const { tr: s } = n, { types: l, attributeName: d, generateID: u } = this.options, p = At(
3849
3848
  i.doc,
3850
3849
  o
3851
3850
  ), { mapping: h } = p;
3852
- if (Pt(p).forEach(({ newRange: m }) => {
3853
- const g = Ht(
3851
+ if (Nt(p).forEach(({ newRange: m }) => {
3852
+ const g = Pt(
3854
3853
  n.doc,
3855
3854
  m,
3856
3855
  (T) => l.includes(T.type.name)
3857
- ), b = g.map(({ node: T }) => T.attrs[d]).filter((T) => T !== null), A = Po(b);
3856
+ ), b = g.map(({ node: T }) => T.attrs[d]).filter((T) => T !== null), A = Ao(b);
3858
3857
  g.forEach(({ node: T, pos: N }) => {
3859
3858
  let Z;
3860
- const Ae = (Z = s.doc.nodeAt(N)) === null || Z === void 0 ? void 0 : Z.attrs[d];
3861
- if (Ae === null) {
3862
- const Ne = i.doc.type.createAndFill().content;
3863
- if (i.doc.content.findDiffStart(Ne) === null) {
3864
- const Pe = JSON.parse(
3859
+ const Ne = (Z = s.doc.nodeAt(N)) === null || Z === void 0 ? void 0 : Z.attrs[d];
3860
+ if (Ne === null) {
3861
+ const Pe = i.doc.type.createAndFill().content;
3862
+ if (i.doc.content.findDiffStart(Pe) === null) {
3863
+ const He = JSON.parse(
3865
3864
  JSON.stringify(n.doc.toJSON())
3866
3865
  );
3867
- if (Pe.content[0].content[0].attrs.id = "initialBlockId", JSON.stringify(Pe.content) === JSON.stringify(Ne.toJSON())) {
3866
+ if (He.content[0].content[0].attrs.id = "initialBlockId", JSON.stringify(He.content) === JSON.stringify(Pe.toJSON())) {
3868
3867
  s.setNodeMarkup(N, void 0, {
3869
3868
  ...T.attrs,
3870
3869
  [d]: "initialBlockId"
@@ -3878,8 +3877,8 @@ const oe = M.create({
3878
3877
  });
3879
3878
  return;
3880
3879
  }
3881
- const { deleted: Tt } = h.invert().mapResult(N);
3882
- Tt && A.includes(Ae) && s.setNodeMarkup(N, void 0, {
3880
+ const { deleted: Mt } = h.invert().mapResult(N);
3881
+ Mt && A.includes(Ne) && s.setNodeMarkup(N, void 0, {
3883
3882
  ...T.attrs,
3884
3883
  [d]: u()
3885
3884
  });
@@ -3950,7 +3949,7 @@ const oe = M.create({
3950
3949
  ];
3951
3950
  }
3952
3951
  });
3953
- function tt(e) {
3952
+ function et(e) {
3954
3953
  const t = e.attrs.id, o = e.firstChild, i = o.type, n = e.childCount === 2 ? e.lastChild.childCount : 0;
3955
3954
  return {
3956
3955
  id: t,
@@ -3963,7 +3962,7 @@ function tt(e) {
3963
3962
  function k(e, t) {
3964
3963
  const i = e.nodeSize - 2;
3965
3964
  if (t <= 1)
3966
- for (t = 1 + 1; e.resolve(t).parent.type.name !== "blockContainer" && t < i; )
3965
+ for (t = 2; e.resolve(t).parent.type.name !== "blockContainer" && t < i; )
3967
3966
  t++;
3968
3967
  else if (t >= i)
3969
3968
  for (t = i - 1; e.resolve(t).parent.type.name !== "blockContainer" && t > 1; )
@@ -3980,7 +3979,7 @@ function k(e, t) {
3980
3979
  break;
3981
3980
  s -= 1, a = n.node(s);
3982
3981
  }
3983
- const { id: l, contentNode: d, contentType: u, numChildBlocks: p } = tt(a), h = n.start(s), f = n.end(s);
3982
+ const { id: l, contentNode: d, contentType: u, numChildBlocks: p } = et(a), h = n.start(s), f = n.end(s);
3984
3983
  return {
3985
3984
  id: l,
3986
3985
  node: a,
@@ -3992,10 +3991,10 @@ function k(e, t) {
3992
3991
  depth: s
3993
3992
  };
3994
3993
  }
3995
- function De(e) {
3994
+ function je(e) {
3996
3995
  return e.type === "link";
3997
3996
  }
3998
- function ot(e) {
3997
+ function tt(e) {
3999
3998
  return typeof e != "string" && e.type === "link";
4000
3999
  }
4001
4000
  function te(e) {
@@ -4006,12 +4005,12 @@ class I extends Error {
4006
4005
  super(`Unreachable case: ${t}`);
4007
4006
  }
4008
4007
  }
4009
- function Fr(e, t = !0) {
4008
+ function Rr(e, t = !0) {
4010
4009
  const { "data-test": o, ...i } = e;
4011
4010
  if (Object.keys(i).length > 0 && t)
4012
4011
  throw new Error("Object must be empty " + JSON.stringify(e));
4013
4012
  }
4014
- function je(e, t, o) {
4013
+ function Ve(e, t, o) {
4015
4014
  const i = [];
4016
4015
  for (const [n, r] of Object.entries(e.styles)) {
4017
4016
  const a = o[n];
@@ -4027,11 +4026,11 @@ function je(e, t, o) {
4027
4026
  return e.text.split(/(\n)/g).filter((n) => n.length > 0).map((n) => n === `
4028
4027
  ` ? t.nodes.hardBreak.create() : t.text(n, i));
4029
4028
  }
4030
- function Ho(e, t, o) {
4029
+ function No(e, t, o) {
4031
4030
  const i = t.marks.link.create({
4032
4031
  href: e.href
4033
4032
  });
4034
- return ye(e.content, t, o).map(
4033
+ return we(e.content, t, o).map(
4035
4034
  (n) => {
4036
4035
  if (n.type.name === "text")
4037
4036
  return n.mark([...n.marks, i]);
@@ -4041,29 +4040,29 @@ function Ho(e, t, o) {
4041
4040
  }
4042
4041
  );
4043
4042
  }
4044
- function ye(e, t, o) {
4043
+ function we(e, t, o) {
4045
4044
  const i = [];
4046
4045
  if (typeof e == "string")
4047
4046
  return i.push(
4048
- ...je(
4047
+ ...Ve(
4049
4048
  { type: "text", text: e, styles: {} },
4050
4049
  t,
4051
4050
  o
4052
4051
  )
4053
4052
  ), i;
4054
4053
  for (const n of e)
4055
- i.push(...je(n, t, o));
4054
+ i.push(...Ve(n, t, o));
4056
4055
  return i;
4057
4056
  }
4058
4057
  function W(e, t, o) {
4059
4058
  const i = [];
4060
4059
  for (const n of e)
4061
- typeof n == "string" ? i.push(...ye(n, t, o)) : ot(n) ? i.push(...Ho(n, t, o)) : te(n) ? i.push(...ye([n], t, o)) : i.push(
4062
- nt(n, t, o)
4060
+ typeof n == "string" ? i.push(...we(n, t, o)) : tt(n) ? i.push(...No(n, t, o)) : te(n) ? i.push(...we([n], t, o)) : i.push(
4061
+ it(n, t, o)
4063
4062
  );
4064
4063
  return i;
4065
4064
  }
4066
- function it(e, t, o) {
4065
+ function ot(e, t, o) {
4067
4066
  const i = [];
4068
4067
  for (const n of e.rows) {
4069
4068
  const r = [];
@@ -4085,7 +4084,7 @@ function it(e, t, o) {
4085
4084
  }
4086
4085
  return i;
4087
4086
  }
4088
- function nt(e, t, o) {
4087
+ function it(e, t, o) {
4089
4088
  let i, n = e.type;
4090
4089
  if (n === void 0 && (n = "paragraph"), !t.nodes[n])
4091
4090
  throw new Error(`node type ${n} not found in schema`);
@@ -4098,7 +4097,7 @@ function nt(e, t, o) {
4098
4097
  const r = W(e.content, t, o);
4099
4098
  i = t.nodes[n].create(e.props, r);
4100
4099
  } else if (e.content.type === "tableContent") {
4101
- const r = it(e.content, t, o);
4100
+ const r = ot(e.content, t, o);
4102
4101
  i = t.nodes[n].create(e.props, r);
4103
4102
  } else
4104
4103
  throw new I(e.content.type);
@@ -4107,7 +4106,7 @@ function nt(e, t, o) {
4107
4106
  function P(e, t, o) {
4108
4107
  let i = e.id;
4109
4108
  i === void 0 && (i = oe.options.generateID());
4110
- const n = nt(
4109
+ const n = it(
4111
4110
  e,
4112
4111
  t,
4113
4112
  o
@@ -4124,7 +4123,7 @@ function P(e, t, o) {
4124
4123
  r.length > 0 ? [n, a] : n
4125
4124
  );
4126
4125
  }
4127
- function Uo(e, t, o) {
4126
+ function Po(e, t, o) {
4128
4127
  const i = {
4129
4128
  type: "tableContent",
4130
4129
  rows: []
@@ -4135,7 +4134,7 @@ function Uo(e, t, o) {
4135
4134
  };
4136
4135
  n.content.forEach((a) => {
4137
4136
  r.cells.push(
4138
- Ee(
4137
+ Ce(
4139
4138
  a.firstChild,
4140
4139
  t,
4141
4140
  o
@@ -4144,7 +4143,7 @@ function Uo(e, t, o) {
4144
4143
  }), i.rows.push(r);
4145
4144
  }), i;
4146
4145
  }
4147
- function Ee(e, t, o) {
4146
+ function Ce(e, t, o) {
4148
4147
  const i = [];
4149
4148
  let n;
4150
4149
  return e.content.forEach((r) => {
@@ -4153,7 +4152,7 @@ function Ee(e, t, o) {
4153
4152
  if (te(n))
4154
4153
  n.text += `
4155
4154
  `;
4156
- else if (De(n))
4155
+ else if (je(n))
4157
4156
  n.content[n.content.length - 1].text += `
4158
4157
  `;
4159
4158
  else
@@ -4169,7 +4168,7 @@ function Ee(e, t, o) {
4169
4168
  }
4170
4169
  if (r.type.name !== "link" && r.type.name !== "text" && t[r.type.name]) {
4171
4170
  n && (i.push(n), n = void 0), i.push(
4172
- rt(r, t, o)
4171
+ nt(r, t, o)
4173
4172
  );
4174
4173
  return;
4175
4174
  }
@@ -4203,7 +4202,7 @@ function Ee(e, t, o) {
4203
4202
  type: "text",
4204
4203
  text: r.textContent,
4205
4204
  styles: a
4206
- }) : De(n) && (s ? n.href === s.attrs.href ? JSON.stringify(
4205
+ }) : je(n) && (s ? n.href === s.attrs.href ? JSON.stringify(
4207
4206
  n.content[n.content.length - 1].styles
4208
4207
  ) === JSON.stringify(a) ? n.content[n.content.length - 1].text += r.textContent : n.content.push({
4209
4208
  type: "text",
@@ -4240,7 +4239,7 @@ function Ee(e, t, o) {
4240
4239
  };
4241
4240
  }), n && i.push(n), i;
4242
4241
  }
4243
- function rt(e, t, o) {
4242
+ function nt(e, t, o) {
4244
4243
  if (e.type.name === "text" || e.type.name === "link")
4245
4244
  throw new Error("unexpected");
4246
4245
  const i = {}, n = t[e.type.name];
@@ -4251,7 +4250,7 @@ function rt(e, t, o) {
4251
4250
  s in d && (i[s] = l);
4252
4251
  }
4253
4252
  let r;
4254
- return n.content === "styled" ? r = Ee(
4253
+ return n.content === "styled" ? r = Ce(
4255
4254
  e,
4256
4255
  t,
4257
4256
  o
@@ -4269,7 +4268,7 @@ function v(e, t, o, i, n) {
4269
4268
  const r = n == null ? void 0 : n.get(e);
4270
4269
  if (r)
4271
4270
  return r;
4272
- const a = tt(e);
4271
+ const a = et(e);
4273
4272
  let s = a.id;
4274
4273
  s === null && (s = oe.options.generateID());
4275
4274
  const l = {};
@@ -4298,13 +4297,13 @@ function v(e, t, o, i, n) {
4298
4297
  );
4299
4298
  let p;
4300
4299
  if (d.content === "inline")
4301
- p = Ee(
4300
+ p = Ce(
4302
4301
  a.contentNode,
4303
4302
  o,
4304
4303
  i
4305
4304
  );
4306
4305
  else if (d.content === "table")
4307
- p = Uo(
4306
+ p = Po(
4308
4307
  a.contentNode,
4309
4308
  o,
4310
4309
  i
@@ -4322,14 +4321,14 @@ function v(e, t, o, i, n) {
4322
4321
  };
4323
4322
  return n == null || n.set(e, h), h;
4324
4323
  }
4325
- function Do(e) {
4324
+ function Ho(e) {
4326
4325
  return e.document || window.document;
4327
4326
  }
4328
- const at = (e, t, o, i, n) => {
4327
+ const rt = (e, t, o, i, n) => {
4329
4328
  if (!o.nodes[e.type.name])
4330
4329
  throw new Error("Serializer is missing a node type: " + e.type.name);
4331
- const { dom: r, contentDOM: a } = we.renderSpec(
4332
- Do(t),
4330
+ const { dom: r, contentDOM: a } = ve.renderSpec(
4331
+ Ho(t),
4333
4332
  o.nodes[e.type.name](e)
4334
4333
  );
4335
4334
  if (a) {
@@ -4368,11 +4367,11 @@ const at = (e, t, o, i, n) => {
4368
4367
  o.serializeFragment(e.content, t, a);
4369
4368
  }
4370
4369
  return r;
4371
- }, st = (e, t, o) => {
4370
+ }, at = (e, t, o) => {
4372
4371
  const i = t.serializeFragment(e, o), n = document.createElement("div");
4373
4372
  return n.appendChild(i), n.innerHTML;
4374
4373
  };
4375
- function jo(e) {
4374
+ function Uo(e) {
4376
4375
  const t = /* @__PURE__ */ new Set([
4377
4376
  ...e.orderedListItemBlockTypes,
4378
4377
  ...e.unorderedListItemBlockTypes
@@ -4410,10 +4409,10 @@ function jo(e) {
4410
4409
  s -= m, n -= m, r = void 0;
4411
4410
  }
4412
4411
  if (h) {
4413
- r || (r = _e(
4412
+ r || (r = ye(
4414
4413
  document.createElement(f)
4415
4414
  ));
4416
- const m = _e(
4415
+ const m = ye(
4417
4416
  document.createElement("li")
4418
4417
  );
4419
4418
  m.children.push(...u.children), p && m.children.push(...p.children), r.children.push(m);
@@ -4432,15 +4431,15 @@ function jo(e) {
4432
4431
  };
4433
4432
  return o;
4434
4433
  }
4435
- const ae = (e, t) => {
4436
- const o = we.fromSchema(e);
4437
- return o.serializeNodeInner = (i, n) => at(i, n, o, t, !0), o.exportProseMirrorFragment = (i, n) => ve().use(Je, { fragment: !0 }).use(jo, {
4434
+ const se = (e, t) => {
4435
+ const o = ve.fromSchema(e);
4436
+ return o.serializeNodeInner = (i, n) => rt(i, n, o, t, !0), o.exportProseMirrorFragment = (i, n) => xe().use(Ze, { fragment: !0 }).use(Uo, {
4438
4437
  orderedListItemBlockTypes: /* @__PURE__ */ new Set(["numberedListItem"]),
4439
4438
  unorderedListItemBlockTypes: /* @__PURE__ */ new Set([
4440
4439
  "bulletListItem",
4441
4440
  "checkListItem"
4442
4441
  ])
4443
- }).use(Ye).processSync(st(i, o, n)).value, o.exportBlocks = (i, n) => {
4442
+ }).use(Je).processSync(at(i, o, n)).value, o.exportBlocks = (i, n) => {
4444
4443
  const r = i.map(
4445
4444
  (s) => P(s, e, t.schema.styleSchema)
4446
4445
  ), a = e.nodes.blockGroup.create(null, r);
@@ -4449,9 +4448,9 @@ const ae = (e, t) => {
4449
4448
  n
4450
4449
  );
4451
4450
  }, o;
4452
- }, Ce = (e, t) => {
4453
- const o = we.fromSchema(e);
4454
- return o.serializeNodeInner = (i, n) => at(i, n, o, t, !1), o.serializeProseMirrorFragment = (i, n) => st(i, o, n), o.serializeBlocks = (i, n) => {
4451
+ }, Se = (e, t) => {
4452
+ const o = ve.fromSchema(e);
4453
+ return o.serializeNodeInner = (i, n) => rt(i, n, o, t, !1), o.serializeProseMirrorFragment = (i, n) => at(i, o, n), o.serializeBlocks = (i, n) => {
4455
4454
  const r = i.map(
4456
4455
  (s) => P(s, e, t.schema.styleSchema)
4457
4456
  ), a = e.nodes.blockGroup.create(null, r);
@@ -4460,15 +4459,15 @@ const ae = (e, t) => {
4460
4459
  n
4461
4460
  );
4462
4461
  }, o;
4463
- }, Ro = () => typeof navigator < "u" && (/Mac/.test(navigator.platform) || /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent));
4462
+ }, Do = () => typeof navigator < "u" && (/Mac/.test(navigator.platform) || /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent));
4464
4463
  function H(e, t = "Ctrl") {
4465
- return Ro() ? e.replace("Mod", "⌘") : e.replace("Mod", t);
4464
+ return Do() ? e.replace("Mod", "⌘") : e.replace("Mod", t);
4466
4465
  }
4467
4466
  function j(...e) {
4468
4467
  return e.filter((t) => t).join(" ");
4469
4468
  }
4470
- const Gr = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
4471
- function R(e, t, o, i) {
4469
+ const Or = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
4470
+ function V(e, t, o, i) {
4472
4471
  const n = document.createElement("div");
4473
4472
  n.className = j(
4474
4473
  "bn-block-content",
@@ -4513,18 +4512,18 @@ const Re = (e, t) => {
4513
4512
  default: "left",
4514
4513
  values: ["left", "center", "right", "justify"]
4515
4514
  }
4516
- }, lt = ["backgroundColor", "textColor"];
4517
- function re(e) {
4515
+ }, st = ["backgroundColor", "textColor"];
4516
+ function ae(e) {
4518
4517
  return "data-" + e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
4519
4518
  }
4520
- function Kr(e) {
4519
+ function zr(e) {
4521
4520
  const t = e.split("/");
4522
4521
  return !t.length || // invalid?
4523
4522
  t[t.length - 1] === "" ? e : t[t.length - 1];
4524
4523
  }
4525
- function dt(e) {
4524
+ function lt(e) {
4526
4525
  const t = {};
4527
- return Object.entries(e).filter(([o, i]) => !lt.includes(o)).forEach(([o, i]) => {
4526
+ return Object.entries(e).filter(([o, i]) => !st.includes(o)).forEach(([o, i]) => {
4528
4527
  t[o] = {
4529
4528
  default: i.default,
4530
4529
  keepOnSplit: !0,
@@ -4532,7 +4531,7 @@ function dt(e) {
4532
4531
  // value is the same as its default, we don't display an HTML
4533
4532
  // attribute for it.
4534
4533
  parseHTML: (n) => {
4535
- const r = n.getAttribute(re(o));
4534
+ const r = n.getAttribute(ae(o));
4536
4535
  if (r === null)
4537
4536
  return null;
4538
4537
  if (typeof i.default == "boolean")
@@ -4544,12 +4543,12 @@ function dt(e) {
4544
4543
  return r;
4545
4544
  },
4546
4545
  renderHTML: (n) => n[o] !== i.default ? {
4547
- [re(o)]: n[o]
4546
+ [ae(o)]: n[o]
4548
4547
  } : {}
4549
4548
  };
4550
4549
  }), t;
4551
4550
  }
4552
- function Vo(e, t, o, i) {
4551
+ function jo(e, t, o, i) {
4553
4552
  if (typeof e == "boolean")
4554
4553
  throw new Error(
4555
4554
  "Cannot find node position as getPos is a boolean, not a function."
@@ -4562,7 +4561,7 @@ function Vo(e, t, o, i) {
4562
4561
  throw new Error("Block type does not match");
4563
4562
  return s;
4564
4563
  }
4565
- function me(e, t, o, i, n = !1, r) {
4564
+ function fe(e, t, o, i, n = !1, r) {
4566
4565
  const a = document.createElement("div");
4567
4566
  if (r !== void 0)
4568
4567
  for (const [s, l] of Object.entries(r))
@@ -4572,7 +4571,7 @@ function me(e, t, o, i, n = !1, r) {
4572
4571
  (r == null ? void 0 : r.class) || ""
4573
4572
  ), a.setAttribute("data-content-type", t);
4574
4573
  for (const [s, l] of Object.entries(o))
4575
- !lt.includes(s) && l !== i[s].default && a.setAttribute(re(s), l);
4574
+ !st.includes(s) && l !== i[s].default && a.setAttribute(ae(s), l);
4576
4575
  return n && a.setAttribute("data-file-block", ""), a.appendChild(e.dom), e.contentDOM !== void 0 && (e.contentDOM.className = j(
4577
4576
  "bn-inline-content",
4578
4577
  e.contentDOM.className
@@ -4584,14 +4583,14 @@ function me(e, t, o, i, n = !1, r) {
4584
4583
  function O(e) {
4585
4584
  return $.create(e);
4586
4585
  }
4587
- function ct(e, t) {
4586
+ function dt(e, t) {
4588
4587
  return {
4589
4588
  config: e,
4590
4589
  implementation: t
4591
4590
  };
4592
4591
  }
4593
4592
  function q(e, t, o) {
4594
- return ct(
4593
+ return dt(
4595
4594
  {
4596
4595
  type: e.name,
4597
4596
  content: e.config.content === "inline*" ? "inline" : e.config.content === "tableRow+" ? "table" : "none",
@@ -4606,12 +4605,12 @@ function q(e, t, o) {
4606
4605
  }
4607
4606
  );
4608
4607
  }
4609
- function ut(e) {
4608
+ function ct(e) {
4610
4609
  return Object.fromEntries(
4611
4610
  Object.entries(e).map(([t, o]) => [t, o.config])
4612
4611
  );
4613
4612
  }
4614
- function Oo(e, t) {
4613
+ function Vo(e, t) {
4615
4614
  const o = [
4616
4615
  {
4617
4616
  tag: "[data-content-type=" + e.type + "]",
@@ -4628,17 +4627,17 @@ function Oo(e, t) {
4628
4627
  }
4629
4628
  }), o;
4630
4629
  }
4631
- function se(e, t) {
4630
+ function le(e, t) {
4632
4631
  const o = O({
4633
4632
  name: e.type,
4634
4633
  content: e.content === "inline" ? "inline*" : "",
4635
4634
  group: "blockContent",
4636
4635
  selectable: !0,
4637
4636
  addAttributes() {
4638
- return dt(e.propSchema);
4637
+ return lt(e.propSchema);
4639
4638
  },
4640
4639
  parseHTML() {
4641
- return Oo(e, t.parse);
4640
+ return Vo(e, t.parse);
4642
4641
  },
4643
4642
  renderHTML() {
4644
4643
  const i = document.createElement("div");
@@ -4649,13 +4648,13 @@ function se(e, t) {
4649
4648
  addNodeView() {
4650
4649
  return ({ getPos: i }) => {
4651
4650
  var l;
4652
- const n = this.options.editor, r = Vo(
4651
+ const n = this.options.editor, r = jo(
4653
4652
  i,
4654
4653
  n,
4655
4654
  this.editor,
4656
4655
  e.type
4657
4656
  ), a = ((l = this.options.domAttributes) == null ? void 0 : l.blockContent) || {}, s = t.render(r, n);
4658
- return me(
4657
+ return fe(
4659
4658
  s,
4660
4659
  r.type,
4661
4660
  r.props,
@@ -4669,12 +4668,12 @@ function se(e, t) {
4669
4668
  throw new Error(
4670
4669
  "Node name does not match block type. This is a bug in BlockNote."
4671
4670
  );
4672
- return ct(e, {
4671
+ return dt(e, {
4673
4672
  node: o,
4674
4673
  toInternalHTML: (i, n) => {
4675
4674
  var s;
4676
4675
  const r = ((s = o.options.domAttributes) == null ? void 0 : s.blockContent) || {}, a = t.render(i, n);
4677
- return me(
4676
+ return fe(
4678
4677
  a,
4679
4678
  i.type,
4680
4679
  i.props,
@@ -4691,7 +4690,7 @@ function se(e, t) {
4691
4690
  i,
4692
4691
  n
4693
4692
  );
4694
- return a === void 0 && (a = t.render(i, n)), me(
4693
+ return a === void 0 && (a = t.render(i, n)), fe(
4695
4694
  a,
4696
4695
  i.type,
4697
4696
  i.props,
@@ -4701,10 +4700,10 @@ function se(e, t) {
4701
4700
  }
4702
4701
  });
4703
4702
  }
4704
- function zo(e, t, o, i) {
4705
- return e.dom.setAttribute("data-inline-content-type", t), Object.entries(o).filter(([n, r]) => r !== i[n].default).map(([n, r]) => [re(n), r]).forEach(([n, r]) => e.dom.setAttribute(n, r)), e.contentDOM !== void 0 && e.contentDOM.setAttribute("data-editable", ""), e;
4703
+ function Ro(e, t, o, i) {
4704
+ return e.dom.setAttribute("data-inline-content-type", t), Object.entries(o).filter(([n, r]) => r !== i[n].default).map(([n, r]) => [ae(n), r]).forEach(([n, r]) => e.dom.setAttribute(n, r)), e.contentDOM !== void 0 && e.contentDOM.setAttribute("data-editable", ""), e;
4706
4705
  }
4707
- function Fo(e) {
4706
+ function Oo(e) {
4708
4707
  return {
4709
4708
  Backspace: ({ editor: t }) => {
4710
4709
  const o = t.state.selection.$from;
@@ -4712,14 +4711,14 @@ function Fo(e) {
4712
4711
  }
4713
4712
  };
4714
4713
  }
4715
- function Go(e, t) {
4714
+ function zo(e, t) {
4716
4715
  return {
4717
4716
  config: e,
4718
4717
  implementation: t
4719
4718
  };
4720
4719
  }
4721
- function Ko(e, t) {
4722
- return Go(
4720
+ function Fo(e, t) {
4721
+ return zo(
4723
4722
  {
4724
4723
  type: e.name,
4725
4724
  propSchema: t,
@@ -4730,12 +4729,12 @@ function Ko(e, t) {
4730
4729
  }
4731
4730
  );
4732
4731
  }
4733
- function pt(e) {
4732
+ function ut(e) {
4734
4733
  return Object.fromEntries(
4735
4734
  Object.entries(e).map(([t, o]) => [t, o.config])
4736
4735
  );
4737
4736
  }
4738
- function Wo(e) {
4737
+ function Go(e) {
4739
4738
  return [
4740
4739
  {
4741
4740
  tag: `[data-inline-content-type="${e.type}"]`,
@@ -4746,7 +4745,7 @@ function Wo(e) {
4746
4745
  }
4747
4746
  ];
4748
4747
  }
4749
- function Wr(e, t) {
4748
+ function Fr(e, t) {
4750
4749
  const o = $.create({
4751
4750
  name: e.type,
4752
4751
  inline: !0,
@@ -4755,24 +4754,24 @@ function Wr(e, t) {
4755
4754
  atom: e.content === "none",
4756
4755
  content: e.content === "styled" ? "inline*" : "",
4757
4756
  addAttributes() {
4758
- return dt(e.propSchema);
4757
+ return lt(e.propSchema);
4759
4758
  },
4760
4759
  addKeyboardShortcuts() {
4761
- return Fo(e);
4760
+ return Oo(e);
4762
4761
  },
4763
4762
  parseHTML() {
4764
- return Wo(e);
4763
+ return Go(e);
4765
4764
  },
4766
4765
  renderHTML({ node: i }) {
4767
4766
  const n = this.options.editor, r = t.render(
4768
- rt(
4767
+ nt(
4769
4768
  i,
4770
4769
  n.schema.inlineContentSchema,
4771
4770
  n.schema.styleSchema
4772
4771
  )
4773
4772
  // TODO: fix cast
4774
4773
  );
4775
- return zo(
4774
+ return Ro(
4776
4775
  r,
4777
4776
  e.type,
4778
4777
  i.attrs,
@@ -4780,12 +4779,12 @@ function Wr(e, t) {
4780
4779
  );
4781
4780
  }
4782
4781
  });
4783
- return Ko(
4782
+ return Fo(
4784
4783
  o,
4785
4784
  e.propSchema
4786
4785
  );
4787
4786
  }
4788
- function $o(e) {
4787
+ function Ko(e) {
4789
4788
  return e === "boolean" ? {} : {
4790
4789
  stringValue: {
4791
4790
  default: void 0,
@@ -4797,17 +4796,17 @@ function $o(e) {
4797
4796
  }
4798
4797
  };
4799
4798
  }
4800
- function qo(e, t, o, i) {
4799
+ function Wo(e, t, o, i) {
4801
4800
  return e.dom.setAttribute("data-style-type", t), i === "string" && e.dom.setAttribute("data-value", o), e.contentDOM !== void 0 && e.contentDOM.setAttribute("data-editable", ""), e;
4802
4801
  }
4803
- function ht(e, t) {
4802
+ function pt(e, t) {
4804
4803
  return {
4805
4804
  config: e,
4806
4805
  implementation: t
4807
4806
  };
4808
4807
  }
4809
4808
  function U(e, t) {
4810
- return ht(
4809
+ return pt(
4811
4810
  {
4812
4811
  type: e.name,
4813
4812
  propSchema: t
@@ -4817,12 +4816,12 @@ function U(e, t) {
4817
4816
  }
4818
4817
  );
4819
4818
  }
4820
- function mt(e) {
4819
+ function ht(e) {
4821
4820
  return Object.fromEntries(
4822
4821
  Object.entries(e).map(([t, o]) => [t, o.config])
4823
4822
  );
4824
4823
  }
4825
- function Xo(e) {
4824
+ function $o(e) {
4826
4825
  return [
4827
4826
  {
4828
4827
  tag: `[data-style-type="${e.type}"]`,
@@ -4833,14 +4832,14 @@ function Xo(e) {
4833
4832
  }
4834
4833
  ];
4835
4834
  }
4836
- function $r(e, t) {
4837
- const o = xe.create({
4835
+ function Gr(e, t) {
4836
+ const o = Ee.create({
4838
4837
  name: e.type,
4839
4838
  addAttributes() {
4840
- return $o(e.propSchema);
4839
+ return Ko(e.propSchema);
4841
4840
  },
4842
4841
  parseHTML() {
4843
- return Xo(e);
4842
+ return $o(e);
4844
4843
  },
4845
4844
  renderHTML({ mark: i }) {
4846
4845
  let n;
@@ -4850,7 +4849,7 @@ function $r(e, t) {
4850
4849
  n = t.render(i.attrs.stringValue);
4851
4850
  else
4852
4851
  throw new I(e.propSchema);
4853
- return qo(
4852
+ return Wo(
4854
4853
  n,
4855
4854
  e.type,
4856
4855
  i.attrs.stringValue,
@@ -4858,11 +4857,11 @@ function $r(e, t) {
4858
4857
  );
4859
4858
  }
4860
4859
  });
4861
- return ht(e, {
4860
+ return pt(e, {
4862
4861
  mark: o
4863
4862
  });
4864
4863
  }
4865
- const le = (e) => {
4864
+ const de = (e) => {
4866
4865
  const t = document.createElement("div");
4867
4866
  t.className = "bn-file-default-preview";
4868
4867
  const o = document.createElement("div");
@@ -4871,14 +4870,14 @@ const le = (e) => {
4871
4870
  return i.className = "bn-file-default-preview-name", i.textContent = e.props.name || "", t.appendChild(o), t.appendChild(i), {
4872
4871
  dom: t
4873
4872
  };
4874
- }, V = (e, t) => {
4873
+ }, R = (e, t) => {
4875
4874
  const o = document.createElement("div");
4876
4875
  o.className = "bn-file-and-caption-wrapper";
4877
4876
  const i = document.createElement("p");
4878
4877
  return i.className = "bn-file-caption", i.textContent = e.props.caption, o.appendChild(t), o.appendChild(i), {
4879
4878
  dom: o
4880
4879
  };
4881
- }, de = (e, t, o, i) => {
4880
+ }, ce = (e, t, o, i) => {
4882
4881
  const n = document.createElement("div");
4883
4882
  n.className = "bn-add-file-button";
4884
4883
  const r = document.createElement("div");
@@ -4912,7 +4911,7 @@ const le = (e) => {
4912
4911
  );
4913
4912
  }
4914
4913
  };
4915
- }, Ve = (e) => ({ url: e.src || void 0 }), ce = (e, t) => {
4914
+ }, Oe = (e) => ({ url: e.src || void 0 }), ue = (e, t) => {
4916
4915
  const o = e.querySelector(
4917
4916
  t
4918
4917
  );
@@ -4920,15 +4919,15 @@ const le = (e) => {
4920
4919
  return;
4921
4920
  const i = e.querySelector("figcaption"), n = (i == null ? void 0 : i.textContent) ?? void 0;
4922
4921
  return { targetElement: o, caption: n };
4923
- }, ue = (e, t) => {
4922
+ }, pe = (e, t) => {
4924
4923
  const o = document.createElement("div"), i = document.createElement("p");
4925
4924
  return i.textContent = t, o.appendChild(e), o.appendChild(i), {
4926
4925
  dom: o
4927
4926
  };
4928
- }, Se = (e, t) => {
4927
+ }, Me = (e, t) => {
4929
4928
  const o = document.createElement("figure"), i = document.createElement("figcaption");
4930
4929
  return i.textContent = t, o.appendChild(e), o.appendChild(i), { dom: o };
4931
- }, ft = (e, t, o, i, n) => {
4930
+ }, mt = (e, t, o, i, n) => {
4932
4931
  if (!e.props.previewWidth)
4933
4932
  throw new Error("Block must have a `previewWidth` prop.");
4934
4933
  const r = document.createElement("div");
@@ -4988,7 +4987,7 @@ const le = (e) => {
4988
4987
  );
4989
4988
  }
4990
4989
  };
4991
- }, Oe = (e) => ({ url: e.src || void 0 }), Zo = {
4990
+ }, ze = (e) => ({ url: e.src || void 0 }), qo = {
4992
4991
  backgroundColor: _.backgroundColor,
4993
4992
  // File name.
4994
4993
  name: {
@@ -5005,18 +5004,18 @@ const le = (e) => {
5005
5004
  showPreview: {
5006
5005
  default: !0
5007
5006
  }
5008
- }, Jo = {
5007
+ }, Xo = {
5009
5008
  type: "audio",
5010
- propSchema: Zo,
5009
+ propSchema: qo,
5011
5010
  content: "none",
5012
5011
  isFileBlock: !0,
5013
5012
  fileBlockAcceptMimeTypes: ["audio/*"]
5014
- }, Yo = (e, t) => {
5013
+ }, Zo = (e, t) => {
5015
5014
  const o = document.createElement("div");
5016
5015
  if (o.className = "bn-file-block-content-wrapper", e.props.url === "") {
5017
5016
  const i = document.createElement("div");
5018
5017
  i.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"></path></svg>';
5019
- const n = de(
5018
+ const n = ce(
5020
5019
  e,
5021
5020
  t,
5022
5021
  t.dictionary.file_blocks.audio.add_button_text,
@@ -5034,30 +5033,30 @@ const le = (e) => {
5034
5033
  i.className = "bn-audio", t.resolveFileUrl(e.props.url).then((r) => {
5035
5034
  i.src = r;
5036
5035
  }), i.controls = !0, i.contentEditable = "false", i.draggable = !1;
5037
- const n = V(e, i);
5036
+ const n = R(e, i);
5038
5037
  return o.appendChild(n.dom), {
5039
5038
  dom: o
5040
5039
  };
5041
5040
  } else {
5042
- const i = le(e).dom;
5041
+ const i = de(e).dom;
5043
5042
  return {
5044
- dom: V(e, i).dom
5043
+ dom: R(e, i).dom
5045
5044
  };
5046
5045
  }
5047
- }, Qo = (e) => {
5046
+ }, Jo = (e) => {
5048
5047
  if (e.tagName === "AUDIO")
5049
- return Oe(e);
5048
+ return ze(e);
5050
5049
  if (e.tagName === "FIGURE") {
5051
- const t = ce(e, "audio");
5050
+ const t = ue(e, "audio");
5052
5051
  if (!t)
5053
5052
  return;
5054
5053
  const { targetElement: o, caption: i } = t;
5055
5054
  return {
5056
- ...Oe(o),
5055
+ ...ze(o),
5057
5056
  caption: i
5058
5057
  };
5059
5058
  }
5060
- }, ei = (e) => {
5059
+ }, Yo = (e) => {
5061
5060
  if (!e.props.url) {
5062
5061
  const o = document.createElement("p");
5063
5062
  return o.textContent = "Add audio", {
@@ -5065,14 +5064,14 @@ const le = (e) => {
5065
5064
  };
5066
5065
  }
5067
5066
  let t;
5068
- return e.props.showPreview ? (t = document.createElement("audio"), t.src = e.props.url) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? Se(t, e.props.caption) : ue(t, e.props.caption) : {
5067
+ return e.props.showPreview ? (t = document.createElement("audio"), t.src = e.props.url) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? Me(t, e.props.caption) : pe(t, e.props.caption) : {
5069
5068
  dom: t
5070
5069
  };
5071
- }, ti = se(Jo, {
5072
- render: Yo,
5073
- parse: Qo,
5074
- toExternalHTML: ei
5075
- }), oi = {
5070
+ }, Qo = le(Xo, {
5071
+ render: Zo,
5072
+ parse: Jo,
5073
+ toExternalHTML: Yo
5074
+ }), ei = {
5076
5075
  backgroundColor: _.backgroundColor,
5077
5076
  // File name.
5078
5077
  name: {
@@ -5086,39 +5085,39 @@ const le = (e) => {
5086
5085
  caption: {
5087
5086
  default: ""
5088
5087
  }
5089
- }, ii = {
5088
+ }, ti = {
5090
5089
  type: "file",
5091
- propSchema: oi,
5090
+ propSchema: ei,
5092
5091
  content: "none",
5093
5092
  isFileBlock: !0
5094
- }, ni = (e, t) => {
5093
+ }, oi = (e, t) => {
5095
5094
  const o = document.createElement("div");
5096
5095
  if (o.className = "bn-file-block-content-wrapper", e.props.url === "") {
5097
- const i = de(e, t);
5096
+ const i = ce(e, t);
5098
5097
  return o.appendChild(i.dom), {
5099
5098
  dom: o,
5100
5099
  destroy: i.destroy
5101
5100
  };
5102
5101
  } else {
5103
- const i = le(e).dom, n = V(e, i);
5102
+ const i = de(e).dom, n = R(e, i);
5104
5103
  return o.appendChild(n.dom), {
5105
5104
  dom: o
5106
5105
  };
5107
5106
  }
5108
- }, ri = (e) => {
5107
+ }, ii = (e) => {
5109
5108
  if (e.tagName === "EMBED")
5110
- return Ve(e);
5109
+ return Oe(e);
5111
5110
  if (e.tagName === "FIGURE") {
5112
- const t = ce(e, "embed");
5111
+ const t = ue(e, "embed");
5113
5112
  if (!t)
5114
5113
  return;
5115
5114
  const { targetElement: o, caption: i } = t;
5116
5115
  return {
5117
- ...Ve(o),
5116
+ ...Oe(o),
5118
5117
  caption: i
5119
5118
  };
5120
5119
  }
5121
- }, ai = (e) => {
5120
+ }, ni = (e) => {
5122
5121
  if (!e.props.url) {
5123
5122
  const o = document.createElement("p");
5124
5123
  return o.textContent = "Add file", {
@@ -5126,17 +5125,17 @@ const le = (e) => {
5126
5125
  };
5127
5126
  }
5128
5127
  const t = document.createElement("a");
5129
- return t.href = e.props.url, t.textContent = e.props.name || e.props.url, e.props.caption ? ue(t, e.props.caption) : {
5128
+ return t.href = e.props.url, t.textContent = e.props.name || e.props.url, e.props.caption ? pe(t, e.props.caption) : {
5130
5129
  dom: t
5131
5130
  };
5132
- }, si = se(ii, {
5133
- render: ni,
5134
- parse: ri,
5135
- toExternalHTML: ai
5136
- }), ze = (e) => {
5131
+ }, ri = le(ti, {
5132
+ render: oi,
5133
+ parse: ii,
5134
+ toExternalHTML: ni
5135
+ }), Fe = (e) => {
5137
5136
  const t = e.src || void 0, o = e.width || void 0;
5138
5137
  return { url: t, previewWidth: o };
5139
- }, li = {
5138
+ }, ai = {
5140
5139
  textAlignment: _.textAlignment,
5141
5140
  backgroundColor: _.backgroundColor,
5142
5141
  // File name.
@@ -5158,18 +5157,18 @@ const le = (e) => {
5158
5157
  previewWidth: {
5159
5158
  default: 512
5160
5159
  }
5161
- }, di = {
5160
+ }, si = {
5162
5161
  type: "image",
5163
- propSchema: li,
5162
+ propSchema: ai,
5164
5163
  content: "none",
5165
5164
  isFileBlock: !0,
5166
5165
  fileBlockAcceptMimeTypes: ["image/*"]
5167
- }, ci = (e, t) => {
5166
+ }, li = (e, t) => {
5168
5167
  const o = document.createElement("div");
5169
5168
  if (o.className = "bn-file-block-content-wrapper", e.props.url === "") {
5170
5169
  const i = document.createElement("div");
5171
5170
  i.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z"></path></svg>';
5172
- const n = de(
5171
+ const n = ce(
5173
5172
  e,
5174
5173
  t,
5175
5174
  t.dictionary.file_blocks.image.add_button_text,
@@ -5190,37 +5189,37 @@ const le = (e) => {
5190
5189
  e.props.previewWidth,
5191
5190
  t.domElement.firstElementChild.clientWidth
5192
5191
  );
5193
- const n = ft(
5192
+ const n = mt(
5194
5193
  e,
5195
5194
  t,
5196
5195
  i,
5197
5196
  () => i.width,
5198
5197
  (a) => i.width = a
5199
- ), r = V(e, n.dom);
5198
+ ), r = R(e, n.dom);
5200
5199
  return o.appendChild(r.dom), {
5201
5200
  dom: o,
5202
5201
  destroy: n.destroy
5203
5202
  };
5204
5203
  } else {
5205
- const i = le(e).dom;
5204
+ const i = de(e).dom;
5206
5205
  return {
5207
- dom: V(e, i).dom
5206
+ dom: R(e, i).dom
5208
5207
  };
5209
5208
  }
5210
- }, ui = (e) => {
5209
+ }, di = (e) => {
5211
5210
  if (e.tagName === "IMG")
5212
- return ze(e);
5211
+ return Fe(e);
5213
5212
  if (e.tagName === "FIGURE") {
5214
- const t = ce(e, "img");
5213
+ const t = ue(e, "img");
5215
5214
  if (!t)
5216
5215
  return;
5217
5216
  const { targetElement: o, caption: i } = t;
5218
5217
  return {
5219
- ...ze(o),
5218
+ ...Fe(o),
5220
5219
  caption: i
5221
5220
  };
5222
5221
  }
5223
- }, pi = (e) => {
5222
+ }, ci = (e) => {
5224
5223
  if (!e.props.url) {
5225
5224
  const o = document.createElement("p");
5226
5225
  return o.textContent = "Add image", {
@@ -5228,17 +5227,17 @@ const le = (e) => {
5228
5227
  };
5229
5228
  }
5230
5229
  let t;
5231
- return e.props.showPreview ? (t = document.createElement("img"), t.src = e.props.url, t.alt = e.props.name || e.props.caption || "BlockNote image", t.width = e.props.previewWidth) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? Se(t, e.props.caption) : ue(t, e.props.caption) : {
5230
+ return e.props.showPreview ? (t = document.createElement("img"), t.src = e.props.url, t.alt = e.props.name || e.props.caption || "BlockNote image", t.width = e.props.previewWidth) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? Me(t, e.props.caption) : pe(t, e.props.caption) : {
5232
5231
  dom: t
5233
5232
  };
5234
- }, hi = se(di, {
5235
- render: ci,
5236
- parse: ui,
5237
- toExternalHTML: pi
5238
- }), Fe = (e) => {
5233
+ }, ui = le(si, {
5234
+ render: li,
5235
+ parse: di,
5236
+ toExternalHTML: ci
5237
+ }), Ge = (e) => {
5239
5238
  const t = e.src || void 0, o = e.width || void 0;
5240
5239
  return { url: t, previewWidth: o };
5241
- }, mi = {
5240
+ }, pi = {
5242
5241
  textAlignment: _.textAlignment,
5243
5242
  backgroundColor: _.backgroundColor,
5244
5243
  // File name.
@@ -5260,18 +5259,18 @@ const le = (e) => {
5260
5259
  previewWidth: {
5261
5260
  default: 512
5262
5261
  }
5263
- }, fi = {
5262
+ }, hi = {
5264
5263
  type: "video",
5265
- propSchema: mi,
5264
+ propSchema: pi,
5266
5265
  content: "none",
5267
5266
  isFileBlock: !0,
5268
5267
  fileBlockAcceptMimeTypes: ["video/*"]
5269
- }, gi = (e, t) => {
5268
+ }, mi = (e, t) => {
5270
5269
  const o = document.createElement("div");
5271
5270
  if (o.className = "bn-file-block-content-wrapper", e.props.url === "") {
5272
5271
  const i = document.createElement("div");
5273
5272
  i.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z"></path></svg>';
5274
- const n = de(
5273
+ const n = ce(
5275
5274
  e,
5276
5275
  t,
5277
5276
  t.dictionary.file_blocks.video.add_button_text,
@@ -5290,37 +5289,37 @@ const le = (e) => {
5290
5289
  e.props.previewWidth,
5291
5290
  t.domElement.firstElementChild.clientWidth
5292
5291
  );
5293
- const n = ft(
5292
+ const n = mt(
5294
5293
  e,
5295
5294
  t,
5296
5295
  i,
5297
5296
  () => i.width,
5298
5297
  (a) => i.width = a
5299
- ), r = V(e, n.dom);
5298
+ ), r = R(e, n.dom);
5300
5299
  return o.appendChild(r.dom), {
5301
5300
  dom: o,
5302
5301
  destroy: n.destroy
5303
5302
  };
5304
5303
  } else {
5305
- const i = le(e).dom;
5304
+ const i = de(e).dom;
5306
5305
  return {
5307
- dom: V(e, i).dom
5306
+ dom: R(e, i).dom
5308
5307
  };
5309
5308
  }
5310
- }, bi = (e) => {
5309
+ }, fi = (e) => {
5311
5310
  if (e.tagName === "VIDEO")
5312
- return Fe(e);
5311
+ return Ge(e);
5313
5312
  if (e.tagName === "FIGURE") {
5314
- const t = ce(e, "video");
5313
+ const t = ue(e, "video");
5315
5314
  if (!t)
5316
5315
  return;
5317
5316
  const { targetElement: o, caption: i } = t;
5318
5317
  return {
5319
- ...Fe(o),
5318
+ ...Ge(o),
5320
5319
  caption: i
5321
5320
  };
5322
5321
  }
5323
- }, ki = (e) => {
5322
+ }, gi = (e) => {
5324
5323
  if (!e.props.url) {
5325
5324
  const o = document.createElement("p");
5326
5325
  return o.textContent = "Add video", {
@@ -5328,14 +5327,14 @@ const le = (e) => {
5328
5327
  };
5329
5328
  }
5330
5329
  let t;
5331
- return e.props.showPreview ? (t = document.createElement("video"), t.src = e.props.url, t.width = e.props.previewWidth) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? Se(t, e.props.caption) : ue(t, e.props.caption) : {
5330
+ return e.props.showPreview ? (t = document.createElement("video"), t.src = e.props.url, t.width = e.props.previewWidth) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? Me(t, e.props.caption) : pe(t, e.props.caption) : {
5332
5331
  dom: t
5333
5332
  };
5334
- }, _i = se(fi, {
5335
- render: gi,
5336
- parse: bi,
5337
- toExternalHTML: ki
5338
- }), qr = async (e) => {
5333
+ }, bi = le(hi, {
5334
+ render: mi,
5335
+ parse: fi,
5336
+ toExternalHTML: gi
5337
+ }), Kr = async (e) => {
5339
5338
  const t = new FormData();
5340
5339
  return t.append("file", e), (await (await fetch("https://tmpfiles.org/api/v1/upload", {
5341
5340
  method: "POST",
@@ -5344,7 +5343,7 @@ const le = (e) => {
5344
5343
  "tmpfiles.org/",
5345
5344
  "tmpfiles.org/dl/"
5346
5345
  );
5347
- }, yi = xe.create({
5346
+ }, ki = Ee.create({
5348
5347
  name: "backgroundColor",
5349
5348
  addAttributes() {
5350
5349
  return {
@@ -5370,10 +5369,10 @@ const le = (e) => {
5370
5369
  renderHTML({ HTMLAttributes: e }) {
5371
5370
  return ["span", e, 0];
5372
5371
  }
5373
- }), wi = U(
5374
- yi,
5372
+ }), _i = U(
5373
+ ki,
5375
5374
  "string"
5376
- ), vi = xe.create({
5375
+ ), yi = Ee.create({
5377
5376
  name: "textColor",
5378
5377
  addAttributes() {
5379
5378
  return {
@@ -5397,16 +5396,16 @@ const le = (e) => {
5397
5396
  renderHTML({ HTMLAttributes: e }) {
5398
5397
  return ["span", e, 0];
5399
5398
  }
5400
- }), xi = U(vi, "string"), C = (e) => {
5399
+ }), wi = U(yi, "string"), C = (e) => {
5401
5400
  const { contentType: t } = k(
5402
5401
  e.state.doc,
5403
5402
  e.state.selection.from
5404
5403
  );
5405
5404
  return t.spec.content;
5406
- }, Ei = {
5405
+ }, vi = {
5407
5406
  ..._,
5408
5407
  level: { default: 1, values: [1, 2, 3] }
5409
- }, Ci = O({
5408
+ }, xi = O({
5410
5409
  name: "heading",
5411
5410
  content: "inline*",
5412
5411
  group: "blockContent",
@@ -5499,7 +5498,7 @@ const le = (e) => {
5499
5498
  },
5500
5499
  renderHTML({ node: e, HTMLAttributes: t }) {
5501
5500
  var o, i;
5502
- return R(
5501
+ return V(
5503
5502
  this.name,
5504
5503
  `h${e.attrs.level}`,
5505
5504
  {
@@ -5509,10 +5508,10 @@ const le = (e) => {
5509
5508
  ((i = this.options.domAttributes) == null ? void 0 : i.inlineContent) || {}
5510
5509
  );
5511
5510
  }
5512
- }), Si = q(
5513
- Ci,
5514
- Ei
5515
- ), Me = (e) => {
5511
+ }), Ei = q(
5512
+ xi,
5513
+ vi
5514
+ ), Te = (e) => {
5516
5515
  const { contentNode: t, contentType: o } = k(
5517
5516
  e.state.doc,
5518
5517
  e.state.selection.from
@@ -5531,9 +5530,9 @@ const le = (e) => {
5531
5530
  a.command(() => t.childCount > 0 ? (r().deleteSelection().BNSplitBlock(n.selection.from, !0).run(), !0) : !1)
5532
5531
  )
5533
5532
  ]);
5534
- }, Mi = {
5533
+ }, Ci = {
5535
5534
  ..._
5536
- }, Ti = O({
5535
+ }, Si = O({
5537
5536
  name: "bulletListItem",
5538
5537
  content: "inline*",
5539
5538
  group: "blockContent",
@@ -5556,7 +5555,7 @@ const le = (e) => {
5556
5555
  },
5557
5556
  addKeyboardShortcuts() {
5558
5557
  return {
5559
- Enter: () => Me(this.editor),
5558
+ Enter: () => Te(this.editor),
5560
5559
  "Mod-Shift-8": () => C(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
5561
5560
  this.editor.state.selection.anchor,
5562
5561
  {
@@ -5599,7 +5598,7 @@ const le = (e) => {
5599
5598
  },
5600
5599
  renderHTML({ HTMLAttributes: e }) {
5601
5600
  var t, o;
5602
- return R(
5601
+ return V(
5603
5602
  this.name,
5604
5603
  // We use a <p> tag, because for <li> tags we'd need a <ul> element to put
5605
5604
  // them in to be semantically correct, which we can't have due to the
@@ -5612,11 +5611,11 @@ const le = (e) => {
5612
5611
  ((o = this.options.domAttributes) == null ? void 0 : o.inlineContent) || {}
5613
5612
  );
5614
5613
  }
5615
- }), Bi = q(
5616
- Ti,
5617
- Mi
5618
- ), Li = new S("numbered-list-indexing"), Ii = () => new y({
5619
- key: Li,
5614
+ }), Mi = q(
5615
+ Si,
5616
+ Ci
5617
+ ), Ti = new S("numbered-list-indexing"), Bi = () => new y({
5618
+ key: Ti,
5620
5619
  appendTransaction: (e, t, o) => {
5621
5620
  const i = o.tr;
5622
5621
  i.setMeta("numberedListIndexing", !0);
@@ -5645,9 +5644,9 @@ const le = (e) => {
5645
5644
  }
5646
5645
  }), n ? i : null;
5647
5646
  }
5648
- }), Ai = {
5647
+ }), Li = {
5649
5648
  ..._
5650
- }, Ni = O({
5649
+ }, Ii = O({
5651
5650
  name: "numberedListItem",
5652
5651
  content: "inline*",
5653
5652
  group: "blockContent",
@@ -5679,7 +5678,7 @@ const le = (e) => {
5679
5678
  },
5680
5679
  addKeyboardShortcuts() {
5681
5680
  return {
5682
- Enter: () => Me(this.editor),
5681
+ Enter: () => Te(this.editor),
5683
5682
  "Mod-Shift-7": () => C(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
5684
5683
  this.editor.state.selection.anchor,
5685
5684
  {
@@ -5690,7 +5689,7 @@ const le = (e) => {
5690
5689
  };
5691
5690
  },
5692
5691
  addProseMirrorPlugins() {
5693
- return [Ii()];
5692
+ return [Bi()];
5694
5693
  },
5695
5694
  parseHTML() {
5696
5695
  return [
@@ -5727,7 +5726,7 @@ const le = (e) => {
5727
5726
  },
5728
5727
  renderHTML({ HTMLAttributes: e }) {
5729
5728
  var t, o;
5730
- return R(
5729
+ return V(
5731
5730
  this.name,
5732
5731
  // We use a <p> tag, because for <li> tags we'd need an <ol> element to
5733
5732
  // put them in to be semantically correct, which we can't have due to the
@@ -5740,15 +5739,15 @@ const le = (e) => {
5740
5739
  ((o = this.options.domAttributes) == null ? void 0 : o.inlineContent) || {}
5741
5740
  );
5742
5741
  }
5743
- }), Pi = q(
5744
- Ni,
5745
- Ai
5746
- ), Hi = {
5742
+ }), Ai = q(
5743
+ Ii,
5744
+ Li
5745
+ ), Ni = {
5747
5746
  ..._,
5748
5747
  checked: {
5749
5748
  default: !1
5750
5749
  }
5751
- }, Ui = O({
5750
+ }, Pi = O({
5752
5751
  name: "checkListItem",
5753
5752
  content: "inline*",
5754
5753
  group: "blockContent",
@@ -5793,7 +5792,7 @@ const le = (e) => {
5793
5792
  },
5794
5793
  addKeyboardShortcuts() {
5795
5794
  return {
5796
- Enter: () => Me(this.editor),
5795
+ Enter: () => Te(this.editor),
5797
5796
  "Mod-Shift-9": () => C(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
5798
5797
  this.editor.state.selection.anchor,
5799
5798
  {
@@ -5845,7 +5844,7 @@ const le = (e) => {
5845
5844
  var r, a;
5846
5845
  const o = document.createElement("input");
5847
5846
  o.type = "checkbox", o.checked = e.attrs.checked, e.attrs.checked && o.setAttribute("checked", "");
5848
- const { dom: i, contentDOM: n } = R(
5847
+ const { dom: i, contentDOM: n } = V(
5849
5848
  this.name,
5850
5849
  "p",
5851
5850
  {
@@ -5878,7 +5877,7 @@ const le = (e) => {
5878
5877
  });
5879
5878
  };
5880
5879
  a.addEventListener("change", s);
5881
- const { dom: l, contentDOM: d } = R(
5880
+ const { dom: l, contentDOM: d } = V(
5882
5881
  this.name,
5883
5882
  "p",
5884
5883
  {
@@ -5900,12 +5899,12 @@ const le = (e) => {
5900
5899
  };
5901
5900
  };
5902
5901
  }
5903
- }), Di = q(
5904
- Ui,
5905
- Hi
5906
- ), ji = {
5902
+ }), Hi = q(
5903
+ Pi,
5904
+ Ni
5905
+ ), Ui = {
5907
5906
  ..._
5908
- }, Ri = O({
5907
+ }, Di = O({
5909
5908
  name: "paragraph",
5910
5909
  content: "inline*",
5911
5910
  group: "blockContent",
@@ -5936,7 +5935,7 @@ const le = (e) => {
5936
5935
  },
5937
5936
  renderHTML({ HTMLAttributes: e }) {
5938
5937
  var t, o;
5939
- return R(
5938
+ return V(
5940
5939
  this.name,
5941
5940
  "p",
5942
5941
  {
@@ -5946,16 +5945,16 @@ const le = (e) => {
5946
5945
  ((o = this.options.domAttributes) == null ? void 0 : o.inlineContent) || {}
5947
5946
  );
5948
5947
  }
5949
- }), Vi = q(
5950
- Ri,
5951
- ji
5952
- ), Oi = M.create({
5948
+ }), ji = q(
5949
+ Di,
5950
+ Ui
5951
+ ), Vi = M.create({
5953
5952
  name: "BlockNoteTableExtension",
5954
5953
  addProseMirrorPlugins: () => [
5955
- oo({
5954
+ to({
5956
5955
  cellMinWidth: 100
5957
5956
  }),
5958
- io()
5957
+ oo()
5959
5958
  ],
5960
5959
  addKeyboardShortcuts() {
5961
5960
  return {
@@ -5976,14 +5975,14 @@ const le = (e) => {
5976
5975
  storage: e.storage
5977
5976
  };
5978
5977
  return {
5979
- tableRole: Ut(
5980
- Dt(e, "tableRole", t)
5978
+ tableRole: Ht(
5979
+ Ut(e, "tableRole", t)
5981
5980
  )
5982
5981
  };
5983
5982
  }
5984
- }), zi = {
5983
+ }), Ri = {
5985
5984
  ..._
5986
- }, Fi = O({
5985
+ }, Oi = O({
5987
5986
  name: "table",
5988
5987
  content: "tableRow+",
5989
5988
  group: "blockContent",
@@ -5994,7 +5993,7 @@ const le = (e) => {
5994
5993
  },
5995
5994
  renderHTML({ HTMLAttributes: e }) {
5996
5995
  var t, o;
5997
- return R(
5996
+ return V(
5998
5997
  this.name,
5999
5998
  "table",
6000
5999
  {
@@ -6004,7 +6003,7 @@ const le = (e) => {
6004
6003
  ((o = this.options.domAttributes) == null ? void 0 : o.inlineContent) || {}
6005
6004
  );
6006
6005
  }
6007
- }), Gi = $.create({
6006
+ }), zi = $.create({
6008
6007
  name: "tableParagraph",
6009
6008
  group: "tableContent",
6010
6009
  content: "inline*",
@@ -6025,74 +6024,74 @@ const le = (e) => {
6025
6024
  renderHTML({ HTMLAttributes: e }) {
6026
6025
  return [
6027
6026
  "p",
6028
- jt(this.options.HTMLAttributes, e),
6027
+ Dt(this.options.HTMLAttributes, e),
6029
6028
  0
6030
6029
  ];
6031
6030
  }
6032
- }), Ki = q(
6033
- Fi,
6034
- zi,
6031
+ }), Fi = q(
6032
+ Oi,
6033
+ Ri,
6035
6034
  [
6036
- Oi,
6037
- Gi,
6038
- eo.extend({
6035
+ Vi,
6036
+ zi,
6037
+ Qt.extend({
6039
6038
  content: "tableContent"
6040
6039
  }),
6041
- Qt.extend({
6040
+ Yt.extend({
6042
6041
  content: "tableContent"
6043
6042
  }),
6044
- to
6043
+ eo
6045
6044
  ]
6046
- ), gt = {
6047
- paragraph: Vi,
6048
- heading: Si,
6049
- bulletListItem: Bi,
6050
- numberedListItem: Pi,
6051
- checkListItem: Di,
6052
- table: Ki,
6053
- file: si,
6054
- image: hi,
6055
- video: _i,
6056
- audio: ti
6057
- }, Wi = ut(gt), bt = {
6058
- bold: U(qt, "boolean"),
6059
- italic: U(Zt, "boolean"),
6060
- underline: U(Yt, "boolean"),
6061
- strike: U(Jt, "boolean"),
6062
- code: U(Xt, "boolean"),
6063
- textColor: xi,
6064
- backgroundColor: wi
6065
- }, Xr = mt(bt), kt = {
6045
+ ), ft = {
6046
+ paragraph: ji,
6047
+ heading: Ei,
6048
+ bulletListItem: Mi,
6049
+ numberedListItem: Ai,
6050
+ checkListItem: Hi,
6051
+ table: Fi,
6052
+ file: ri,
6053
+ image: ui,
6054
+ video: bi,
6055
+ audio: Qo
6056
+ }, Gi = ct(ft), gt = {
6057
+ bold: U($t, "boolean"),
6058
+ italic: U(Xt, "boolean"),
6059
+ underline: U(Jt, "boolean"),
6060
+ strike: U(Zt, "boolean"),
6061
+ code: U(qt, "boolean"),
6062
+ textColor: wi,
6063
+ backgroundColor: _i
6064
+ }, Wr = ht(gt), bt = {
6066
6065
  text: { config: "text", implementation: {} },
6067
6066
  link: { config: "link", implementation: {} }
6068
- }, $i = pt(
6069
- kt
6067
+ }, Ki = ut(
6068
+ bt
6070
6069
  );
6071
6070
  function E(e, t) {
6072
- return e in t.schema.blockSchema && t.schema.blockSchema[e] === Wi[e];
6071
+ return e in t.schema.blockSchema && t.schema.blockSchema[e] === Gi[e];
6073
6072
  }
6074
- function qi(e, t) {
6075
- return e in t.schema.inlineContentSchema && t.schema.inlineContentSchema[e] === $i[e];
6073
+ function Wi(e, t) {
6074
+ return e in t.schema.inlineContentSchema && t.schema.inlineContentSchema[e] === Ki[e];
6076
6075
  }
6077
- function Xi(e, t, o) {
6076
+ function $i(e, t, o) {
6078
6077
  return t.type === e && t.type in o.schema.blockSchema && E(t.type, o);
6079
6078
  }
6080
- function Zr(e, t) {
6079
+ function $r(e, t) {
6081
6080
  return e.type in t.schema.blockSchema && t.schema.blockSchema[e.type].isFileBlock || !1;
6082
6081
  }
6083
- function Jr(e, t) {
6082
+ function qr(e, t) {
6084
6083
  return e.type in t.schema.blockSchema && t.schema.blockSchema[e.type].isFileBlock && "showPreview" in t.schema.blockSchema[e.type].propSchema || !1;
6085
6084
  }
6086
- function Yr(e, t) {
6085
+ function Xr(e, t) {
6087
6086
  return t.schema.blockSchema[e.type].isFileBlock && !e.props.url;
6088
6087
  }
6089
- function Zi(e, t, o) {
6088
+ function qi(e, t, o) {
6090
6089
  return t in o.schema.blockSchema && e in o.schema.blockSchema[t].propSchema && o.schema.blockSchema[t].propSchema[e] === _[e];
6091
6090
  }
6092
- function Qr(e, t, o) {
6093
- return Zi(e, t.type, o);
6091
+ function Zr(e, t, o) {
6092
+ return qi(e, t.type, o);
6094
6093
  }
6095
- function Te(e, t) {
6094
+ function Be(e, t) {
6096
6095
  let o, i;
6097
6096
  if (t.firstChild.descendants((n, r) => o ? !1 : n.type.name !== "blockContainer" || n.attrs.id !== e ? !0 : (o = n, i = r + 1, !1)), o === void 0 || i === void 0)
6098
6097
  throw Error("Could not find block in the editor with matching ID.");
@@ -6101,13 +6100,13 @@ function Te(e, t) {
6101
6100
  posBeforeNode: i
6102
6101
  };
6103
6102
  }
6104
- function Ji(e, t, o = "before", i) {
6103
+ function Xi(e, t, o = "before", i) {
6105
6104
  const n = typeof t == "string" ? t : t.id, r = [];
6106
6105
  for (const d of e)
6107
6106
  r.push(
6108
6107
  P(d, i.pmSchema, i.schema.styleSchema)
6109
6108
  );
6110
- const { node: a, posBeforeNode: s } = Te(
6109
+ const { node: a, posBeforeNode: s } = Be(
6111
6110
  n,
6112
6111
  i._tiptapEditor.state.doc
6113
6112
  );
@@ -6140,8 +6139,8 @@ function Ji(e, t, o = "before", i) {
6140
6139
  );
6141
6140
  return l;
6142
6141
  }
6143
- function Yi(e, t, o) {
6144
- const i = o._tiptapEditor, n = typeof e == "string" ? e : e.id, { posBeforeNode: r } = Te(n, i.state.doc);
6142
+ function Zi(e, t, o) {
6143
+ const i = o._tiptapEditor, n = typeof e == "string" ? e : e.id, { posBeforeNode: r } = Be(n, i.state.doc);
6145
6144
  i.commands.BNUpdateBlock(r + 1, t);
6146
6145
  const a = i.state.doc.resolve(r + 1).node();
6147
6146
  return v(
@@ -6152,7 +6151,7 @@ function Yi(e, t, o) {
6152
6151
  o.blockCache
6153
6152
  );
6154
6153
  }
6155
- function _t(e, t, o) {
6154
+ function kt(e, t, o) {
6156
6155
  const i = t._tiptapEditor, n = i.state.tr, r = new Set(
6157
6156
  e.map(
6158
6157
  (l) => typeof l == "string" ? l : l.id
@@ -6186,16 +6185,16 @@ function _t(e, t, o) {
6186
6185
  }
6187
6186
  return t.dispatch(n), a;
6188
6187
  }
6189
- function Qi(e, t) {
6190
- return _t(e, t);
6188
+ function Ji(e, t) {
6189
+ return kt(e, t);
6191
6190
  }
6192
- function en(e, t, o) {
6191
+ function Yi(e, t, o) {
6193
6192
  const i = [];
6194
6193
  for (const s of t)
6195
6194
  i.push(
6196
6195
  P(s, o.pmSchema, o.schema.styleSchema)
6197
6196
  );
6198
- const n = typeof e[0] == "string" ? e[0] : e[0].id, r = _t(
6197
+ const n = typeof e[0] == "string" ? e[0] : e[0].id, r = kt(
6199
6198
  e,
6200
6199
  o,
6201
6200
  (s, l, d, u) => {
@@ -6220,7 +6219,7 @@ function en(e, t, o) {
6220
6219
  );
6221
6220
  return { insertedBlocks: a, removedBlocks: r };
6222
6221
  }
6223
- function tn(e, t, o, i = { updateSelection: !0 }) {
6222
+ function Qi(e, t, o, i = { updateSelection: !0 }) {
6224
6223
  const n = o._tiptapEditor.state.tr;
6225
6224
  let { from: r, to: a } = typeof e == "number" ? { from: e, to: e } : { from: e.from, to: e.to }, s = !0, l = !0, d = "";
6226
6225
  if (t.forEach((u) => {
@@ -6229,9 +6228,9 @@ function tn(e, t, o, i = { updateSelection: !0 }) {
6229
6228
  const { parent: u } = n.doc.resolve(r);
6230
6229
  u.isTextblock && !u.type.spec.code && !u.childCount && (r -= 1, a += 1);
6231
6230
  }
6232
- return s ? n.insertText(d, r, a) : n.replaceWith(r, a, t), i.updateSelection && Rt(n, n.steps.length - 1, -1), o.dispatch(n), !0;
6231
+ return s ? n.insertText(d, r, a) : n.replaceWith(r, a, t), i.updateSelection && jt(n, n.steps.length - 1, -1), o.dispatch(n), !0;
6233
6232
  }
6234
- function on() {
6233
+ function en() {
6235
6234
  const e = (t) => {
6236
6235
  let o = t.children.length;
6237
6236
  for (let i = 0; i < o; i++) {
@@ -6247,7 +6246,7 @@ function on() {
6247
6246
  };
6248
6247
  return e;
6249
6248
  }
6250
- function nn() {
6249
+ function tn() {
6251
6250
  const e = (t) => {
6252
6251
  var o;
6253
6252
  if (t.children && "length" in t.children && t.children.length)
@@ -6256,41 +6255,41 @@ function nn() {
6256
6255
  n.type === "element" && n.tagName === "input" && ((o = n.properties) == null ? void 0 : o.type) === "checkbox" && (r == null ? void 0 : r.type) === "element" && r.tagName === "p" ? (r.tagName = "span", r.children.splice(
6257
6256
  0,
6258
6257
  0,
6259
- _e(document.createTextNode(" "))
6258
+ ye(document.createTextNode(" "))
6260
6259
  )) : e(n);
6261
6260
  }
6262
6261
  };
6263
6262
  return e;
6264
6263
  }
6265
- function Be(e) {
6266
- return ve().use(Je, { fragment: !0 }).use(on).use(nn).use(no).use(Qe).use(ro, { handlers: { text: (o) => o.value } }).processSync(e).value;
6264
+ function Le(e) {
6265
+ return xe().use(Ze, { fragment: !0 }).use(en).use(tn).use(io).use(Ye).use(no, { handlers: { text: (o) => o.value } }).processSync(e).value;
6267
6266
  }
6268
- function rn(e, t, o, i) {
6269
- const r = ae(t, o).exportBlocks(e, i);
6270
- return Be(r);
6267
+ function on(e, t, o, i) {
6268
+ const r = se(t, o).exportBlocks(e, i);
6269
+ return Le(r);
6271
6270
  }
6272
- function an(e) {
6271
+ function nn(e) {
6273
6272
  return Array.prototype.indexOf.call(e.parentElement.childNodes, e);
6274
6273
  }
6275
- function sn(e) {
6274
+ function rn(e) {
6276
6275
  return e.nodeType === 3 && !/\S/.test(e.nodeValue || "");
6277
6276
  }
6278
- function ln(e) {
6277
+ function an(e) {
6279
6278
  e.querySelectorAll("li > ul, li > ol").forEach((t) => {
6280
- const o = an(t), i = t.parentElement, n = Array.from(i.childNodes).slice(
6279
+ const o = nn(t), i = t.parentElement, n = Array.from(i.childNodes).slice(
6281
6280
  o + 1
6282
6281
  );
6283
6282
  t.remove(), n.forEach((r) => {
6284
6283
  r.remove();
6285
6284
  }), i.insertAdjacentElement("afterend", t), n.reverse().forEach((r) => {
6286
- if (sn(r))
6285
+ if (rn(r))
6287
6286
  return;
6288
6287
  const a = document.createElement("li");
6289
6288
  a.append(r), t.insertAdjacentElement("afterend", a);
6290
6289
  }), i.childNodes.length === 0 && i.remove();
6291
6290
  });
6292
6291
  }
6293
- function dn(e) {
6292
+ function sn(e) {
6294
6293
  e.querySelectorAll("li + ul, li + ol").forEach((t) => {
6295
6294
  var r, a;
6296
6295
  const o = t.previousElementSibling, i = document.createElement("div");
@@ -6300,19 +6299,19 @@ function dn(e) {
6300
6299
  n.append(i.nextElementSibling);
6301
6300
  });
6302
6301
  }
6303
- let Ge = null;
6304
- function cn() {
6305
- return Ge || (Ge = document.implementation.createHTMLDocument("title"));
6302
+ let Ke = null;
6303
+ function ln() {
6304
+ return Ke || (Ke = document.implementation.createHTMLDocument("title"));
6306
6305
  }
6307
- function yt(e) {
6306
+ function _t(e) {
6308
6307
  if (typeof e == "string") {
6309
- const t = cn().createElement("div");
6308
+ const t = ln().createElement("div");
6310
6309
  t.innerHTML = e, e = t;
6311
6310
  }
6312
- return ln(e), dn(e), e;
6311
+ return an(e), sn(e), e;
6313
6312
  }
6314
- async function wt(e, t, o, i, n) {
6315
- const r = yt(e), s = It.fromSchema(n).parse(r, {
6313
+ async function yt(e, t, o, i, n) {
6314
+ const r = _t(e), s = Lt.fromSchema(n).parse(r, {
6316
6315
  topNode: n.nodes.blockGroup.create()
6317
6316
  }), l = [];
6318
6317
  for (let d = 0; d < s.childCount; d++)
@@ -6321,7 +6320,7 @@ async function wt(e, t, o, i, n) {
6321
6320
  );
6322
6321
  return l;
6323
6322
  }
6324
- function un(e, t) {
6323
+ function dn(e, t) {
6325
6324
  const o = t.value ? t.value + `
6326
6325
  ` : "", i = {};
6327
6326
  t.lang && (i["data-language"] = t.lang);
@@ -6338,14 +6337,14 @@ function un(e, t) {
6338
6337
  children: [n]
6339
6338
  }, e.patch(t, n), n;
6340
6339
  }
6341
- function pn(e, t, o, i, n) {
6342
- const r = ve().use(ao).use(Qe).use(so, {
6340
+ function cn(e, t, o, i, n) {
6341
+ const r = xe().use(ro).use(Ye).use(ao, {
6343
6342
  handlers: {
6344
- ...lo,
6345
- code: un
6343
+ ...so,
6344
+ code: dn
6346
6345
  }
6347
- }).use(Ye).processSync(e);
6348
- return wt(
6346
+ }).use(Je).processSync(e);
6347
+ return yt(
6349
6348
  r.value,
6350
6349
  t,
6351
6350
  o,
@@ -6373,7 +6372,7 @@ class X {
6373
6372
  this.callbacks = {};
6374
6373
  }
6375
6374
  }
6376
- class hn {
6375
+ class un {
6377
6376
  constructor(t, o, i, n) {
6378
6377
  c(this, "state");
6379
6378
  c(this, "emitUpdate");
@@ -6425,18 +6424,18 @@ class hn {
6425
6424
  this.pmView.dom.removeEventListener("mousedown", this.mouseDownHandler), this.pmView.dom.removeEventListener("dragstart", this.dragstartHandler), this.pmView.root.removeEventListener("scroll", this.scrollHandler, !0);
6426
6425
  }
6427
6426
  }
6428
- const fe = new S("FilePanelPlugin");
6429
- class mn extends X {
6427
+ const ge = new S("FilePanelPlugin");
6428
+ class pn extends X {
6430
6429
  constructor(o) {
6431
6430
  super();
6432
6431
  c(this, "view");
6433
6432
  c(this, "plugin");
6434
6433
  c(this, "closeMenu", () => this.view.closeMenu());
6435
6434
  this.plugin = new y({
6436
- key: fe,
6437
- view: (i) => (this.view = new hn(
6435
+ key: ge,
6436
+ view: (i) => (this.view = new un(
6438
6437
  o,
6439
- fe,
6438
+ ge,
6440
6439
  i,
6441
6440
  (n) => {
6442
6441
  this.emit("update", n);
@@ -6452,7 +6451,7 @@ class mn extends X {
6452
6451
  apply: (i) => {
6453
6452
  var r;
6454
6453
  return {
6455
- block: (r = i.getMeta(fe)) == null ? void 0 : r.block
6454
+ block: (r = i.getMeta(ge)) == null ? void 0 : r.block
6456
6455
  };
6457
6456
  }
6458
6457
  }
@@ -6466,7 +6465,7 @@ class mn extends X {
6466
6465
  return this.on("update", o);
6467
6466
  }
6468
6467
  }
6469
- class fn {
6468
+ class hn {
6470
6469
  constructor(t, o, i) {
6471
6470
  c(this, "state");
6472
6471
  c(this, "emitUpdate");
@@ -6476,6 +6475,19 @@ class fn {
6476
6475
  const { doc: r, selection: a } = t, { empty: s } = a, l = !r.textBetween(o, i).length && Vt(t.selection);
6477
6476
  return !(!n.hasFocus() || s || l);
6478
6477
  });
6478
+ c(this, "blurHandler", (t) => {
6479
+ var i;
6480
+ if (this.preventHide) {
6481
+ this.preventHide = !1;
6482
+ return;
6483
+ }
6484
+ const o = this.pmView.dom.parentElement;
6485
+ // An element is clicked.
6486
+ t && t.relatedTarget && // Element is inside the editor.
6487
+ (o === t.relatedTarget || o.contains(t.relatedTarget) || t.relatedTarget.matches(
6488
+ ".bn-ui-container, .bn-ui-container *"
6489
+ )) || (i = this.state) != null && i.show && (this.state.show = !1, this.emitUpdate());
6490
+ });
6479
6491
  c(this, "viewMousedownHandler", () => {
6480
6492
  this.preventShow = !0;
6481
6493
  });
@@ -6501,7 +6513,7 @@ class fn {
6501
6513
  "Attempting to update uninitialized formatting toolbar"
6502
6514
  );
6503
6515
  i(this.state);
6504
- }, o.dom.addEventListener("mousedown", this.viewMousedownHandler), o.dom.addEventListener("mouseup", this.viewMouseupHandler), o.dom.addEventListener("dragstart", this.dragHandler), o.dom.addEventListener("dragover", this.dragHandler), o.root.addEventListener("scroll", this.scrollHandler, !0);
6516
+ }, o.dom.addEventListener("mousedown", this.viewMousedownHandler), o.dom.addEventListener("mouseup", this.viewMouseupHandler), o.dom.addEventListener("dragstart", this.dragHandler), o.dom.addEventListener("dragover", this.dragHandler), o.dom.addEventListener("blur", this.blurHandler), o.root.addEventListener("scroll", this.scrollHandler, !0);
6505
6517
  }
6506
6518
  update(t, o) {
6507
6519
  var h, f;
@@ -6527,30 +6539,30 @@ class fn {
6527
6539
  }
6528
6540
  }
6529
6541
  destroy() {
6530
- this.pmView.dom.removeEventListener("mousedown", this.viewMousedownHandler), this.pmView.dom.removeEventListener("mouseup", this.viewMouseupHandler), this.pmView.dom.removeEventListener("dragstart", this.dragHandler), this.pmView.dom.removeEventListener("dragover", this.dragHandler), this.pmView.root.removeEventListener("scroll", this.scrollHandler, !0);
6542
+ this.pmView.dom.removeEventListener("mousedown", this.viewMousedownHandler), this.pmView.dom.removeEventListener("mouseup", this.viewMouseupHandler), this.pmView.dom.removeEventListener("dragstart", this.dragHandler), this.pmView.dom.removeEventListener("dragover", this.dragHandler), this.pmView.dom.removeEventListener("blur", this.blurHandler), this.pmView.root.removeEventListener("scroll", this.scrollHandler, !0);
6531
6543
  }
6532
6544
  getSelectionBoundingBox() {
6533
6545
  const { state: t } = this.pmView, { selection: o } = t, { ranges: i } = o, n = Math.min(...i.map((a) => a.$from.pos)), r = Math.max(...i.map((a) => a.$to.pos));
6534
- if (Ot(o)) {
6546
+ if (Rt(o)) {
6535
6547
  const a = this.pmView.nodeDOM(n);
6536
6548
  if (a)
6537
6549
  return a.getBoundingClientRect();
6538
6550
  }
6539
- return ke(this.pmView, n, r);
6551
+ return _e(this.pmView, n, r);
6540
6552
  }
6541
6553
  }
6542
- const gn = new S(
6554
+ const mn = new S(
6543
6555
  "FormattingToolbarPlugin"
6544
6556
  );
6545
- class bn extends X {
6557
+ class fn extends X {
6546
6558
  constructor(o) {
6547
6559
  super();
6548
6560
  c(this, "view");
6549
6561
  c(this, "plugin");
6550
6562
  c(this, "closeMenu", () => this.view.closeMenu());
6551
6563
  this.plugin = new y({
6552
- key: gn,
6553
- view: (i) => (this.view = new fn(o, i, (n) => {
6564
+ key: mn,
6565
+ view: (i) => (this.view = new hn(o, i, (n) => {
6554
6566
  this.emit("update", n);
6555
6567
  }), this.view),
6556
6568
  props: {
@@ -6566,7 +6578,7 @@ class bn extends X {
6566
6578
  return this.on("update", o);
6567
6579
  }
6568
6580
  }
6569
- class kn {
6581
+ class gn {
6570
6582
  constructor(t, o, i) {
6571
6583
  c(this, "state");
6572
6584
  c(this, "emitUpdate");
@@ -6584,7 +6596,7 @@ class kn {
6584
6596
  const o = t.target, i = this.pmView.posAtDOM(o, 0) + 1, n = this.pmView.state.doc.resolve(i), r = n.marks();
6585
6597
  for (const a of r)
6586
6598
  if (a.type.name === this.pmView.state.schema.mark("link").type.name) {
6587
- this.mouseHoveredLinkMark = a, this.mouseHoveredLinkMarkRange = He(n, a.type, a.attrs) || void 0;
6599
+ this.mouseHoveredLinkMark = a, this.mouseHoveredLinkMarkRange = Ue(n, a.type, a.attrs) || void 0;
6588
6600
  break;
6589
6601
  }
6590
6602
  }
@@ -6600,7 +6612,7 @@ class kn {
6600
6612
  });
6601
6613
  c(this, "scrollHandler", () => {
6602
6614
  var t;
6603
- this.linkMark !== void 0 && (t = this.state) != null && t.show && (this.state.referencePos = ke(
6615
+ this.linkMark !== void 0 && (t = this.state) != null && t.show && (this.state.referencePos = _e(
6604
6616
  this.pmView,
6605
6617
  this.linkMarkRange.from,
6606
6618
  this.linkMarkRange.to
@@ -6656,7 +6668,7 @@ class kn {
6656
6668
  const i = this.pmView.state.selection.$from.marks();
6657
6669
  for (const n of i)
6658
6670
  if (n.type.name === this.pmView.state.schema.mark("link").type.name) {
6659
- this.keyboardHoveredLinkMark = n, this.keyboardHoveredLinkMarkRange = He(
6671
+ this.keyboardHoveredLinkMark = n, this.keyboardHoveredLinkMarkRange = Ue(
6660
6672
  this.pmView.state.selection.$from,
6661
6673
  n.type,
6662
6674
  n.attrs
@@ -6667,7 +6679,7 @@ class kn {
6667
6679
  if (this.mouseHoveredLinkMark && (this.linkMark = this.mouseHoveredLinkMark, this.linkMarkRange = this.mouseHoveredLinkMarkRange), this.keyboardHoveredLinkMark && (this.linkMark = this.keyboardHoveredLinkMark, this.linkMarkRange = this.keyboardHoveredLinkMarkRange), this.linkMark && this.editor.isEditable) {
6668
6680
  this.state = {
6669
6681
  show: !0,
6670
- referencePos: ke(
6682
+ referencePos: _e(
6671
6683
  this.pmView,
6672
6684
  this.linkMarkRange.from,
6673
6685
  this.linkMarkRange.to
@@ -6693,8 +6705,8 @@ class kn {
6693
6705
  );
6694
6706
  }
6695
6707
  }
6696
- const _n = new S("LinkToolbarPlugin");
6697
- class yn extends X {
6708
+ const bn = new S("LinkToolbarPlugin");
6709
+ class kn extends X {
6698
6710
  constructor(o) {
6699
6711
  super();
6700
6712
  c(this, "view");
@@ -6733,8 +6745,8 @@ class yn extends X {
6733
6745
  });
6734
6746
  c(this, "closeMenu", () => this.view.closeMenu());
6735
6747
  this.plugin = new y({
6736
- key: _n,
6737
- view: (i) => (this.view = new kn(o, i, (n) => {
6748
+ key: bn,
6749
+ view: (i) => (this.view = new gn(o, i, (n) => {
6738
6750
  this.emit("update", n);
6739
6751
  }), this.view),
6740
6752
  props: {
@@ -6750,7 +6762,7 @@ class yn extends X {
6750
6762
  return ((i = (o = this.view) == null ? void 0 : o.state) == null ? void 0 : i.show) || !1;
6751
6763
  }
6752
6764
  }
6753
- class z extends he {
6765
+ class z extends me {
6754
6766
  constructor(o, i) {
6755
6767
  super(o, i);
6756
6768
  c(this, "nodes");
@@ -6776,7 +6788,7 @@ class z extends he {
6776
6788
  }
6777
6789
  map(o, i) {
6778
6790
  const n = i.mapResult(this.from), r = i.mapResult(this.to);
6779
- return r.deleted ? he.near(o.resolve(n.pos)) : n.deleted ? he.near(o.resolve(r.pos)) : new z(
6791
+ return r.deleted ? me.near(o.resolve(n.pos)) : n.deleted ? me.near(o.resolve(r.pos)) : new z(
6780
6792
  o.resolve(n.pos),
6781
6793
  o.resolve(r.pos)
6782
6794
  );
@@ -6786,22 +6798,22 @@ class z extends he {
6786
6798
  }
6787
6799
  }
6788
6800
  let B;
6789
- function pe(e, t) {
6801
+ function he(e, t) {
6790
6802
  var o;
6791
6803
  for (; e && e.parentElement && e.parentElement !== t.dom && !((o = e.hasAttribute) != null && o.call(e, "data-id")); )
6792
6804
  e = e.parentElement;
6793
6805
  if (e.hasAttribute("data-id"))
6794
6806
  return { node: e, id: e.getAttribute("data-id") };
6795
6807
  }
6796
- function wn(e, t) {
6797
- const o = pe(e, t);
6808
+ function _n(e, t) {
6809
+ const o = he(e, t);
6798
6810
  if (o && o.node.nodeType === 1) {
6799
6811
  const i = t.docView, n = i.nearestDesc(o.node, !0);
6800
6812
  return !n || n === i ? null : n.posBefore;
6801
6813
  }
6802
6814
  return null;
6803
6815
  }
6804
- function vn(e, t) {
6816
+ function yn(e, t) {
6805
6817
  let o, i;
6806
6818
  const n = t.resolve(e.from).node().type.spec.group === "blockContent", r = t.resolve(e.to).node().type.spec.group === "blockContent", a = Math.min(e.$anchor.depth, e.$head.depth);
6807
6819
  if (n && r) {
@@ -6811,7 +6823,7 @@ function vn(e, t) {
6811
6823
  o = e.from, i = e.to;
6812
6824
  return { from: o, to: i };
6813
6825
  }
6814
- function Ke(e, t, o = t) {
6826
+ function We(e, t, o = t) {
6815
6827
  t === o && (o += e.state.doc.resolve(t + 1).node().nodeSize);
6816
6828
  const i = e.domAtPos(t).node.cloneNode(!0), n = e.domAtPos(t).node, r = (u, p) => Array.prototype.indexOf.call(u.children, p), a = r(
6817
6829
  n,
@@ -6824,16 +6836,16 @@ function Ke(e, t, o = t) {
6824
6836
  );
6825
6837
  for (let u = n.childElementCount - 1; u >= 0; u--)
6826
6838
  (u > s || u < a) && i.removeChild(i.children[u]);
6827
- vt(e.root), B = i;
6839
+ wt(e.root), B = i;
6828
6840
  const d = e.dom.className.split(" ").filter(
6829
6841
  (u) => u !== "ProseMirror" && u !== "bn-root" && u !== "bn-editor"
6830
6842
  ).join(" ");
6831
6843
  B.className = B.className + " bn-drag-preview " + d, e.root instanceof ShadowRoot ? e.root.appendChild(B) : e.root.body.appendChild(B);
6832
6844
  }
6833
- function vt(e) {
6845
+ function wt(e) {
6834
6846
  B !== void 0 && (e instanceof ShadowRoot ? e.removeChild(B) : e.body.removeChild(B), B = void 0);
6835
6847
  }
6836
- function xn(e, t) {
6848
+ function wn(e, t) {
6837
6849
  if (!e.dataTransfer)
6838
6850
  return;
6839
6851
  const o = t.prosemirrorView, i = o.dom.getBoundingClientRect(), n = {
@@ -6844,30 +6856,30 @@ function xn(e, t) {
6844
6856
  let a;
6845
6857
  for (const l of r)
6846
6858
  if (o.dom.contains(l)) {
6847
- a = pe(l, o);
6859
+ a = he(l, o);
6848
6860
  break;
6849
6861
  }
6850
6862
  if (!a)
6851
6863
  return;
6852
- const s = wn(a.node, o);
6864
+ const s = _n(a.node, o);
6853
6865
  if (s != null) {
6854
- const l = o.state.selection, d = o.state.doc, { from: u, to: p } = vn(l, d), h = u <= s && s < p, f = l.$anchor.node() !== l.$head.node() || l instanceof z;
6866
+ const l = o.state.selection, d = o.state.doc, { from: u, to: p } = yn(l, d), h = u <= s && s < p, f = l.$anchor.node() !== l.$head.node() || l instanceof z;
6855
6867
  h && f ? (o.dispatch(
6856
6868
  o.state.tr.setSelection(z.create(d, u, p))
6857
- ), Ke(o, u, p)) : (o.dispatch(
6858
- o.state.tr.setSelection(ne.create(o.state.doc, s))
6859
- ), Ke(o, s));
6860
- const m = o.state.selection.content(), g = t.pmSchema, A = Ce(g, t).serializeProseMirrorFragment(
6869
+ ), We(o, u, p)) : (o.dispatch(
6870
+ o.state.tr.setSelection(re.create(o.state.doc, s))
6871
+ ), We(o, s));
6872
+ const m = o.state.selection.content(), g = t.pmSchema, A = Se(g, t).serializeProseMirrorFragment(
6861
6873
  m.content,
6862
6874
  {}
6863
- ), N = ae(g, t).exportProseMirrorFragment(
6875
+ ), N = se(g, t).exportProseMirrorFragment(
6864
6876
  m.content,
6865
6877
  {}
6866
- ), Z = Be(N);
6878
+ ), Z = Le(N);
6867
6879
  e.dataTransfer.clearData(), e.dataTransfer.setData("blocknote/html", A), e.dataTransfer.setData("text/html", N), e.dataTransfer.setData("text/plain", Z), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setDragImage(B, 0, 0), o.dragging = { slice: m, move: !0 };
6868
6880
  }
6869
6881
  }
6870
- class En {
6882
+ class vn {
6871
6883
  constructor(t, o, i) {
6872
6884
  c(this, "state");
6873
6885
  c(this, "emitUpdate");
@@ -6899,7 +6911,7 @@ class En {
6899
6911
  let n;
6900
6912
  for (const u of i)
6901
6913
  if (this.pmView.dom.contains(u)) {
6902
- n = pe(u, this.pmView);
6914
+ n = he(u, this.pmView);
6903
6915
  break;
6904
6916
  }
6905
6917
  if (!n || !this.editor.isEditable) {
@@ -6946,7 +6958,10 @@ class En {
6946
6958
  });
6947
6959
  if (this.isDragging = !1, !o || o.inside === -1) {
6948
6960
  const i = new Event("drop", t), n = this.pmView.dom.firstChild.getBoundingClientRect();
6949
- i.clientX = n.left + n.width / 2, i.clientY = t.clientY, i.dataTransfer = t.dataTransfer, i.preventDefault = () => t.preventDefault(), i.synthetic = !0, this.pmView.dom.dispatchEvent(i);
6961
+ i.clientX = t.clientX < n.left || t.clientX > n.left + n.width ? n.left + n.width / 2 : t.clientX, i.clientY = Math.min(
6962
+ Math.max(t.clientY, n.top),
6963
+ n.top + n.height
6964
+ ), i.dataTransfer = t.dataTransfer, i.preventDefault = () => t.preventDefault(), i.synthetic = !0, this.pmView.dom.dispatchEvent(i);
6950
6965
  }
6951
6966
  });
6952
6967
  /**
@@ -6975,6 +6990,8 @@ class En {
6975
6990
  });
6976
6991
  c(this, "onMouseMove", (t) => {
6977
6992
  var r;
6993
+ if (this.menuFrozen)
6994
+ return;
6978
6995
  this.mousePos = { x: t.clientX, y: t.clientY };
6979
6996
  const o = this.pmView.dom.getBoundingClientRect(), i = this.mousePos.x > o.left && this.mousePos.x < o.right && this.mousePos.y > o.top && this.mousePos.y < o.bottom, n = this.pmView.dom.parentElement;
6980
6997
  if (
@@ -7076,8 +7093,8 @@ class En {
7076
7093
  this.editor.openSelectionMenu("/");
7077
7094
  }
7078
7095
  }
7079
- const Cn = new S("SideMenuPlugin");
7080
- class Sn extends X {
7096
+ const xn = new S("SideMenuPlugin");
7097
+ class En extends X {
7081
7098
  constructor(o) {
7082
7099
  super();
7083
7100
  c(this, "view");
@@ -7091,12 +7108,12 @@ class Sn extends X {
7091
7108
  * Handles drag & drop events for blocks.
7092
7109
  */
7093
7110
  c(this, "blockDragStart", (o) => {
7094
- this.view.isDragging = !0, xn(o, this.editor);
7111
+ this.view.isDragging = !0, wn(o, this.editor);
7095
7112
  });
7096
7113
  /**
7097
7114
  * Handles drag & drop events for blocks.
7098
7115
  */
7099
- c(this, "blockDragEnd", () => vt(this.editor.prosemirrorView.root));
7116
+ c(this, "blockDragEnd", () => wt(this.editor.prosemirrorView.root));
7100
7117
  /**
7101
7118
  * Freezes the side menu. When frozen, the side menu will stay
7102
7119
  * attached to the same block regardless of which block is hovered by the
@@ -7112,8 +7129,8 @@ class Sn extends X {
7112
7129
  this.view.menuFrozen = !1, this.view.state.show = !1, this.view.emitUpdate(this.view.state);
7113
7130
  });
7114
7131
  this.editor = o, this.plugin = new y({
7115
- key: Cn,
7116
- view: (i) => (this.view = new En(o, i, (n) => {
7132
+ key: xn,
7133
+ view: (i) => (this.view = new vn(o, i, (n) => {
7117
7134
  this.emit("update", n);
7118
7135
  }), this.view)
7119
7136
  });
@@ -7122,8 +7139,8 @@ class Sn extends X {
7122
7139
  return this.on("update", o);
7123
7140
  }
7124
7141
  }
7125
- const Mn = zt((e) => e.type.name === "blockContainer");
7126
- class Tn {
7142
+ const Cn = Ot((e) => e.type.name === "blockContainer");
7143
+ class Sn {
7127
7144
  constructor(t, o) {
7128
7145
  c(this, "state");
7129
7146
  c(this, "emitUpdate");
@@ -7184,7 +7201,7 @@ class Tn {
7184
7201
  }
7185
7202
  }
7186
7203
  const F = new S("SuggestionMenuPlugin");
7187
- class Bn extends X {
7204
+ class Mn extends X {
7188
7205
  constructor(o) {
7189
7206
  super();
7190
7207
  c(this, "view");
@@ -7204,7 +7221,7 @@ class Bn extends X {
7204
7221
  const i = this.triggerCharacters;
7205
7222
  this.plugin = new y({
7206
7223
  key: F,
7207
- view: () => (this.view = new Tn(
7224
+ view: () => (this.view = new Sn(
7208
7225
  o,
7209
7226
  (n, r) => {
7210
7227
  this.emit(`update ${n}`, r);
@@ -7260,7 +7277,7 @@ class Bn extends X {
7260
7277
  if (r === void 0)
7261
7278
  return null;
7262
7279
  if (!r.fromUserInput) {
7263
- const a = Mn(n.selection);
7280
+ const a = Cn(n.selection);
7264
7281
  if (a)
7265
7282
  return G.create(n.doc, [
7266
7283
  K.node(
@@ -7297,32 +7314,32 @@ class Bn extends X {
7297
7314
  return ((i = (o = this.view) == null ? void 0 : o.state) == null ? void 0 : i.show) || !1;
7298
7315
  }
7299
7316
  }
7300
- function ea(e, t) {
7317
+ function Jr(e, t) {
7301
7318
  e.suggestionMenus.addTriggerCharacter(t);
7302
7319
  }
7303
7320
  let w;
7304
- function We(e) {
7321
+ function $e(e) {
7305
7322
  w || (w = document.createElement("div"), w.innerHTML = "_", w.style.opacity = "0", w.style.height = "1px", w.style.width = "1px", e instanceof Document ? e.body.appendChild(w) : e.appendChild(w));
7306
7323
  }
7307
- function Ln(e) {
7324
+ function Tn(e) {
7308
7325
  w && (e instanceof Document ? e.body.removeChild(w) : e.removeChild(w), w = void 0);
7309
7326
  }
7310
7327
  function ie(e) {
7311
7328
  return Array.prototype.indexOf.call(e.parentElement.childNodes, e);
7312
7329
  }
7313
- function In(e) {
7330
+ function Bn(e) {
7314
7331
  for (; e && e.nodeName !== "TD" && e.nodeName !== "TH"; )
7315
7332
  e = e.classList && e.classList.contains("ProseMirror") ? null : e.parentNode;
7316
7333
  return e;
7317
7334
  }
7318
- function An(e, t) {
7335
+ function Ln(e, t) {
7319
7336
  e.forEach((o) => {
7320
7337
  const i = t.querySelectorAll(o);
7321
7338
  for (let n = 0; n < i.length; n++)
7322
7339
  i[n].style.visibility = "hidden";
7323
7340
  });
7324
7341
  }
7325
- class Nn {
7342
+ class In {
7326
7343
  constructor(t, o, i) {
7327
7344
  c(this, "state");
7328
7345
  c(this, "emitUpdate");
@@ -7334,12 +7351,12 @@ class Nn {
7334
7351
  var d;
7335
7352
  if (this.menuFrozen)
7336
7353
  return;
7337
- const o = In(t.target);
7354
+ const o = Bn(t.target);
7338
7355
  if (!o || !this.editor.isEditable) {
7339
7356
  (d = this.state) != null && d.show && (this.state.show = !1, this.emitUpdate());
7340
7357
  return;
7341
7358
  }
7342
- const i = ie(o), n = ie(o.parentElement), r = o.getBoundingClientRect(), a = o.parentElement.parentElement.getBoundingClientRect(), s = pe(o, this.pmView);
7359
+ const i = ie(o), n = ie(o.parentElement), r = o.getBoundingClientRect(), a = o.parentElement.parentElement.getBoundingClientRect(), s = he(o, this.pmView);
7343
7360
  if (!s)
7344
7361
  return;
7345
7362
  let l;
@@ -7355,7 +7372,7 @@ class Nn {
7355
7372
  this.editor.schema.styleSchema,
7356
7373
  this.editor.blockCache
7357
7374
  );
7358
- return Xi("table", h, this.editor) && (this.tablePos = p + 1, l = h), !1;
7375
+ return $i("table", h, this.editor) && (this.tablePos = p + 1, l = h), !1;
7359
7376
  }), !!l && (this.tableId = s.id, !(this.state !== void 0 && this.state.show && this.tableId === s.id && this.state.rowIndex === n && this.state.colIndex === i)))
7360
7377
  return this.state = {
7361
7378
  show: !0,
@@ -7371,7 +7388,7 @@ class Nn {
7371
7388
  var h;
7372
7389
  if (((h = this.state) == null ? void 0 : h.draggingState) === void 0)
7373
7390
  return;
7374
- t.preventDefault(), t.dataTransfer.dropEffect = "move", An(
7391
+ t.preventDefault(), t.dataTransfer.dropEffect = "move", Ln(
7375
7392
  [
7376
7393
  "column-resize-handle",
7377
7394
  "prosemirror-dropcursor-block",
@@ -7459,7 +7476,7 @@ class Nn {
7459
7476
  }
7460
7477
  }
7461
7478
  const Q = new S("TableHandlesPlugin");
7462
- class Pn extends X {
7479
+ class An extends X {
7463
7480
  constructor(o) {
7464
7481
  super();
7465
7482
  c(this, "view");
@@ -7484,7 +7501,7 @@ class Pn extends X {
7484
7501
  newIndex: this.view.state.colIndex,
7485
7502
  tablePos: this.view.tablePos
7486
7503
  })
7487
- ), We(this.editor._tiptapEditor.view.root), o.dataTransfer.setDragImage(w, 0, 0), o.dataTransfer.effectAllowed = "move";
7504
+ ), $e(this.editor._tiptapEditor.view.root), o.dataTransfer.setDragImage(w, 0, 0), o.dataTransfer.effectAllowed = "move";
7488
7505
  });
7489
7506
  /**
7490
7507
  * Callback that should be set on the `dragStart` event for whichever element
@@ -7506,7 +7523,7 @@ class Pn extends X {
7506
7523
  newIndex: this.view.state.rowIndex,
7507
7524
  tablePos: this.view.tablePos
7508
7525
  })
7509
- ), We(this.editor._tiptapEditor.view.root), o.dataTransfer.setDragImage(w, 0, 0), o.dataTransfer.effectAllowed = "copyMove";
7526
+ ), $e(this.editor._tiptapEditor.view.root), o.dataTransfer.setDragImage(w, 0, 0), o.dataTransfer.effectAllowed = "copyMove";
7510
7527
  });
7511
7528
  /**
7512
7529
  * Callback that should be set on the `dragEnd` event for both the element
@@ -7519,7 +7536,7 @@ class Pn extends X {
7519
7536
  );
7520
7537
  this.view.state.draggingState = void 0, this.view.emitUpdate(), this.editor.dispatch(
7521
7538
  this.editor._tiptapEditor.state.tr.setMeta(Q, null)
7522
- ), Ln(this.editor._tiptapEditor.view.root);
7539
+ ), Tn(this.editor._tiptapEditor.view.root);
7523
7540
  });
7524
7541
  /**
7525
7542
  * Freezes the drag handles. When frozen, they will stay attached to the same
@@ -7537,7 +7554,7 @@ class Pn extends X {
7537
7554
  });
7538
7555
  this.editor = o, this.plugin = new y({
7539
7556
  key: Q,
7540
- view: (i) => (this.view = new Nn(o, i, (n) => {
7557
+ view: (i) => (this.view = new In(o, i, (n) => {
7541
7558
  this.emit("update", n);
7542
7559
  }), this.view),
7543
7560
  // We use decorations to render the drop cursor when dragging a table row
@@ -7590,23 +7607,23 @@ class Pn extends X {
7590
7607
  return this.on("update", o);
7591
7608
  }
7592
7609
  }
7593
- function $e(e, t) {
7594
- const o = e.state.selection.content().content, n = Ce(
7610
+ function qe(e, t) {
7611
+ const o = e.state.selection.content().content, n = Se(
7595
7612
  e.state.schema,
7596
7613
  t
7597
7614
  ).serializeProseMirrorFragment(
7598
7615
  o,
7599
7616
  {}
7600
- ), a = ae(
7617
+ ), a = se(
7601
7618
  e.state.schema,
7602
7619
  t
7603
7620
  ).exportProseMirrorFragment(
7604
7621
  o,
7605
7622
  {}
7606
- ), s = Be(a);
7623
+ ), s = Le(a);
7607
7624
  return { internalHTML: n, externalHTML: a, plainText: s };
7608
7625
  }
7609
- const Hn = (e) => M.create({
7626
+ const Nn = (e) => M.create({
7610
7627
  name: "copyToClipboard",
7611
7628
  addProseMirrorPlugins() {
7612
7629
  return [
@@ -7616,12 +7633,12 @@ const Hn = (e) => M.create({
7616
7633
  copy(t, o) {
7617
7634
  o.preventDefault(), o.clipboardData.clearData(), "node" in t.state.selection && t.state.selection.node.type.spec.group === "blockContent" && e.dispatch(
7618
7635
  e._tiptapEditor.state.tr.setSelection(
7619
- new ne(
7636
+ new re(
7620
7637
  t.state.doc.resolve(t.state.selection.from - 1)
7621
7638
  )
7622
7639
  )
7623
7640
  );
7624
- const { internalHTML: i, externalHTML: n, plainText: r } = $e(t, e);
7641
+ const { internalHTML: i, externalHTML: n, plainText: r } = qe(t, e);
7625
7642
  return o.clipboardData.setData("blocknote/html", i), o.clipboardData.setData("text/html", n), o.clipboardData.setData("text/plain", r), !0;
7626
7643
  },
7627
7644
  // This is for the use-case in which only a block without content
@@ -7632,12 +7649,12 @@ const Hn = (e) => M.create({
7632
7649
  return;
7633
7650
  e.dispatch(
7634
7651
  e._tiptapEditor.state.tr.setSelection(
7635
- new ne(
7652
+ new re(
7636
7653
  t.state.doc.resolve(t.state.selection.from - 1)
7637
7654
  )
7638
7655
  )
7639
7656
  ), o.preventDefault(), o.dataTransfer.clearData();
7640
- const { internalHTML: i, externalHTML: n, plainText: r } = $e(t, e);
7657
+ const { internalHTML: i, externalHTML: n, plainText: r } = qe(t, e);
7641
7658
  return o.dataTransfer.setData("blocknote/html", i), o.dataTransfer.setData("text/html", n), o.dataTransfer.setData("text/plain", r), !0;
7642
7659
  }
7643
7660
  }
@@ -7646,7 +7663,7 @@ const Hn = (e) => M.create({
7646
7663
  ];
7647
7664
  }
7648
7665
  });
7649
- function Un(e) {
7666
+ function Pn(e) {
7650
7667
  let t = e.getTextCursorPosition().block, o = e.schema.blockSchema[t.type].content;
7651
7668
  for (; o === "none"; )
7652
7669
  t = e.getTextCursorPosition().nextBlock, o = e.schema.blockSchema[t.type].content, e.setTextCursorPosition(t, "end");
@@ -7660,9 +7677,9 @@ function x(e, t) {
7660
7677
  "end"
7661
7678
  ));
7662
7679
  const i = e.getTextCursorPosition().block;
7663
- return Un(e), i;
7680
+ return Pn(e), i;
7664
7681
  }
7665
- function ta(e) {
7682
+ function Yr(e) {
7666
7683
  const t = [];
7667
7684
  return E("heading", e) && t.push(
7668
7685
  {
@@ -7812,20 +7829,20 @@ function ta(e) {
7812
7829
  ...e.dictionary.slash_menu.emoji
7813
7830
  }), t;
7814
7831
  }
7815
- function oa(e, t) {
7832
+ function Qr(e, t) {
7816
7833
  return e.filter(
7817
7834
  ({ title: o, aliases: i }) => o.toLowerCase().includes(t.toLowerCase()) || i && i.filter(
7818
7835
  (n) => n.toLowerCase().includes(t.toLowerCase())
7819
7836
  ).length !== 0
7820
7837
  );
7821
7838
  }
7822
- const Le = [
7839
+ const Ie = [
7823
7840
  "blocknote/html",
7824
7841
  "Files",
7825
7842
  "text/html",
7826
7843
  "text/plain"
7827
7844
  ];
7828
- function Dn(e, t) {
7845
+ function Hn(e, t) {
7829
7846
  const o = e.split("/"), i = t.split("/");
7830
7847
  if (o.length !== 2)
7831
7848
  throw new Error(`The string ${e} is not a valid MIME type.`);
@@ -7833,14 +7850,14 @@ function Dn(e, t) {
7833
7850
  throw new Error(`The string ${t} is not a valid MIME type.`);
7834
7851
  return o[1] === "*" || i[1] === "*" ? o[0] === i[0] : (o[0] === "*" || i[0] === "*" || o[0] === i[0]) && o[1] === i[1];
7835
7852
  }
7836
- async function xt(e, t) {
7853
+ async function vt(e, t) {
7837
7854
  if (!t.uploadFile)
7838
7855
  return;
7839
7856
  const o = "dataTransfer" in e ? e.dataTransfer : e.clipboardData;
7840
7857
  if (o === null)
7841
7858
  return;
7842
7859
  let i = null;
7843
- for (const a of Le)
7860
+ for (const a of Ie)
7844
7861
  if (o.types.includes(a)) {
7845
7862
  i = a;
7846
7863
  break;
@@ -7858,7 +7875,7 @@ async function xt(e, t) {
7858
7875
  let s = "file";
7859
7876
  for (const d of r)
7860
7877
  for (const u of d.fileBlockAcceptMimeTypes || [])
7861
- if (Dn(n[a].type, u)) {
7878
+ if (Hn(n[a].type, u)) {
7862
7879
  s = d.type;
7863
7880
  break;
7864
7881
  }
@@ -7878,7 +7895,7 @@ async function xt(e, t) {
7878
7895
  }
7879
7896
  }
7880
7897
  }
7881
- const jn = (e) => M.create({
7898
+ const Un = (e) => M.create({
7882
7899
  name: "pasteFromClipboard",
7883
7900
  addProseMirrorPlugins() {
7884
7901
  return [
@@ -7889,7 +7906,7 @@ const jn = (e) => M.create({
7889
7906
  if (o.preventDefault(), !e.isEditable)
7890
7907
  return;
7891
7908
  let i = null;
7892
- for (const r of Le)
7909
+ for (const r of Ie)
7893
7910
  if (o.clipboardData.types.includes(r)) {
7894
7911
  i = r;
7895
7912
  break;
@@ -7897,16 +7914,16 @@ const jn = (e) => M.create({
7897
7914
  if (i === null)
7898
7915
  return !0;
7899
7916
  if (i === "Files")
7900
- return xt(o, e), !0;
7917
+ return vt(o, e), !0;
7901
7918
  let n = o.clipboardData.getData(i);
7902
- return i === "text/html" && (n = yt(n.trim()).innerHTML), e._tiptapEditor.view.pasteHTML(n), !0;
7919
+ return i === "text/html" && (n = _t(n.trim()).innerHTML), e._tiptapEditor.view.pasteHTML(n), !0;
7903
7920
  }
7904
7921
  }
7905
7922
  }
7906
7923
  })
7907
7924
  ];
7908
7925
  }
7909
- }), Rn = (e) => M.create({
7926
+ }), Dn = (e) => M.create({
7910
7927
  name: "dropFile",
7911
7928
  addProseMirrorPlugins() {
7912
7929
  return [
@@ -7917,19 +7934,19 @@ const jn = (e) => M.create({
7917
7934
  if (!e.isEditable)
7918
7935
  return;
7919
7936
  let i = null;
7920
- for (const n of Le)
7937
+ for (const n of Ie)
7921
7938
  if (o.dataTransfer.types.includes(n)) {
7922
7939
  i = n;
7923
7940
  break;
7924
7941
  }
7925
- return i === null ? !0 : i === "Files" ? (xt(o, e), !0) : !1;
7942
+ return i === null ? !0 : i === "Files" ? (vt(o, e), !0) : !1;
7926
7943
  }
7927
7944
  }
7928
7945
  }
7929
7946
  })
7930
7947
  ];
7931
7948
  }
7932
- }), Vn = M.create({
7949
+ }), jn = M.create({
7933
7950
  name: "blockBackgroundColor",
7934
7951
  addGlobalAttributes() {
7935
7952
  return [
@@ -7947,7 +7964,7 @@ const jn = (e) => M.create({
7947
7964
  }
7948
7965
  ];
7949
7966
  }
7950
- }), On = M.create({
7967
+ }), Vn = M.create({
7951
7968
  name: "textAlignment",
7952
7969
  addGlobalAttributes() {
7953
7970
  return [
@@ -7973,7 +7990,7 @@ const jn = (e) => M.create({
7973
7990
  }
7974
7991
  ];
7975
7992
  }
7976
- }), zn = M.create({
7993
+ }), Rn = M.create({
7977
7994
  name: "blockTextColor",
7978
7995
  addGlobalAttributes() {
7979
7996
  return [
@@ -7991,7 +8008,7 @@ const jn = (e) => M.create({
7991
8008
  }
7992
8009
  ];
7993
8010
  }
7994
- }), Fn = M.create({
8011
+ }), On = M.create({
7995
8012
  name: "trailingNode",
7996
8013
  addProseMirrorPlugins() {
7997
8014
  const e = new S(this.name);
@@ -8026,8 +8043,8 @@ const jn = (e) => M.create({
8026
8043
  })
8027
8044
  ];
8028
8045
  }
8029
- }), Gn = new S("non-editable-block"), Kn = () => new y({
8030
- key: Gn,
8046
+ }), zn = new S("non-editable-block"), Fn = () => new y({
8047
+ key: zn,
8031
8048
  props: {
8032
8049
  handleKeyDown: (e, t) => {
8033
8050
  if ("node" in e.state.selection) {
@@ -8052,7 +8069,7 @@ const jn = (e) => M.create({
8052
8069
  return !1;
8053
8070
  }
8054
8071
  }
8055
- }), qe = new S("previous-blocks"), Wn = {
8072
+ }), Xe = new S("previous-blocks"), Gn = {
8056
8073
  // Numbered List Items
8057
8074
  index: "index",
8058
8075
  // Headings
@@ -8061,17 +8078,17 @@ const jn = (e) => M.create({
8061
8078
  type: "type",
8062
8079
  depth: "depth",
8063
8080
  "depth-change": "depth-change"
8064
- }, $n = () => {
8081
+ }, Kn = () => {
8065
8082
  let e;
8066
8083
  return new y({
8067
- key: qe,
8084
+ key: Xe,
8068
8085
  view(t) {
8069
8086
  return {
8070
8087
  update: async (o, i) => {
8071
8088
  var n;
8072
8089
  ((n = this.key) == null ? void 0 : n.getState(o.state).updatedBlocks.size) > 0 && (e = setTimeout(() => {
8073
8090
  o.dispatch(
8074
- o.state.tr.setMeta(qe, { clearUpdate: !0 })
8091
+ o.state.tr.setMeta(Xe, { clearUpdate: !0 })
8075
8092
  );
8076
8093
  }, 0));
8077
8094
  },
@@ -8094,9 +8111,9 @@ const jn = (e) => M.create({
8094
8111
  apply(t, o, i, n) {
8095
8112
  if (o.currentTransactionOldBlockAttrs = {}, o.updatedBlocks.clear(), !t.docChanged || i.doc.eq(n.doc))
8096
8113
  return o;
8097
- const r = {}, a = Ue(i.doc, (d) => d.attrs.id), s = new Map(
8114
+ const r = {}, a = De(i.doc, (d) => d.attrs.id), s = new Map(
8098
8115
  a.map((d) => [d.node.attrs.id, d])
8099
- ), l = Ue(n.doc, (d) => d.attrs.id);
8116
+ ), l = De(n.doc, (d) => d.attrs.id);
8100
8117
  for (const d of l) {
8101
8118
  const u = s.get(d.node.attrs.id), p = u == null ? void 0 : u.node.firstChild, h = d.node.firstChild;
8102
8119
  if (u && p && h) {
@@ -8129,7 +8146,7 @@ const jn = (e) => M.create({
8129
8146
  return;
8130
8147
  const a = o.currentTransactionOldBlockAttrs[n.attrs.id], s = {};
8131
8148
  for (const [d, u] of Object.entries(a))
8132
- s["data-prev-" + Wn[d]] = u || "none";
8149
+ s["data-prev-" + Gn[d]] = u || "none";
8133
8150
  const l = K.node(r, r + n.nodeSize, {
8134
8151
  ...s
8135
8152
  });
@@ -8138,13 +8155,13 @@ const jn = (e) => M.create({
8138
8155
  }
8139
8156
  }
8140
8157
  });
8141
- }, qn = {
8158
+ }, Wn = {
8142
8159
  blockColor: "data-block-color",
8143
8160
  blockStyle: "data-block-style",
8144
8161
  id: "data-id",
8145
8162
  depth: "data-depth",
8146
8163
  depthChange: "data-depth-change"
8147
- }, Xn = $.create({
8164
+ }, $n = $.create({
8148
8165
  name: "blockContainer",
8149
8166
  group: "blockContainer",
8150
8167
  // A block always contains content, and optionally a blockGroup which contains nested blocks
@@ -8160,7 +8177,7 @@ const jn = (e) => M.create({
8160
8177
  if (typeof e == "string")
8161
8178
  return !1;
8162
8179
  const t = {};
8163
- for (const [o, i] of Object.entries(qn))
8180
+ for (const [o, i] of Object.entries(Wn))
8164
8181
  e.getAttribute(i) && (t[o] = e.getAttribute(i));
8165
8182
  return e.getAttribute("data-node-type") === "blockContainer" ? t : !1;
8166
8183
  }
@@ -8242,7 +8259,7 @@ const jn = (e) => M.create({
8242
8259
  this.options.editor.schema.styleSchema
8243
8260
  );
8244
8261
  else if (t.content.type === "tableContent")
8245
- p = it(
8262
+ p = ot(
8246
8263
  t.content,
8247
8264
  o.schema,
8248
8265
  this.options.editor.schema.styleSchema
@@ -8271,7 +8288,7 @@ const jn = (e) => M.create({
8271
8288
  p
8272
8289
  )
8273
8290
  ).setSelection(
8274
- o.schema.nodes[u].spec.content === "" ? new ne(o.tr.doc.resolve(r)) : o.schema.nodes[u].spec.content === "inline*" ? new Y(o.tr.doc.resolve(r)) : (
8291
+ o.schema.nodes[u].spec.content === "" ? new re(o.tr.doc.resolve(r)) : o.schema.nodes[u].spec.content === "inline*" ? new Y(o.tr.doc.resolve(r)) : (
8275
8292
  // Need to offset the position as we have to get through the
8276
8293
  // `tableRow` and `tableCell` nodes to get to the
8277
8294
  // `tableParagraph` node we want to set the selection in.
@@ -8368,7 +8385,7 @@ const jn = (e) => M.create({
8368
8385
  };
8369
8386
  },
8370
8387
  addProseMirrorPlugins() {
8371
- return [$n(), Kn()];
8388
+ return [Kn(), Fn()];
8372
8389
  },
8373
8390
  addKeyboardShortcuts() {
8374
8391
  return {
@@ -8475,7 +8492,7 @@ const jn = (e) => M.create({
8475
8492
  }
8476
8493
  };
8477
8494
  }
8478
- }), Zn = $.create({
8495
+ }), qn = $.create({
8479
8496
  name: "blockGroup",
8480
8497
  group: "blockGroup",
8481
8498
  content: "blockContainer+",
@@ -8504,11 +8521,11 @@ const jn = (e) => M.create({
8504
8521
  contentDOM: o
8505
8522
  };
8506
8523
  }
8507
- }), Jn = $.create({
8524
+ }), Xn = $.create({
8508
8525
  name: "doc",
8509
8526
  topNode: !0,
8510
8527
  content: "blockGroup"
8511
- }), Yn = (e) => {
8528
+ }), Zn = (e) => {
8512
8529
  var i;
8513
8530
  const t = [
8514
8531
  J.ClipboardTextSerializer,
@@ -8517,17 +8534,17 @@ const jn = (e) => M.create({
8517
8534
  J.FocusEvents,
8518
8535
  J.Tabindex,
8519
8536
  // DevTools,
8520
- mo,
8537
+ ho,
8521
8538
  // DropCursor,
8522
8539
  oe.configure({
8523
8540
  types: ["blockContainer"]
8524
8541
  }),
8525
- fo.extend({ priority: 10 }),
8542
+ mo.extend({ priority: 10 }),
8526
8543
  // Comments,
8527
8544
  // basics:
8528
- ko,
8545
+ bo,
8529
8546
  // marks:
8530
- bo.extend({
8547
+ go.extend({
8531
8548
  addKeyboardShortcuts() {
8532
8549
  return {
8533
8550
  "Mod-k": () => (this.editor.commands.toggleLink({ href: "" }), !0)
@@ -8535,9 +8552,9 @@ const jn = (e) => M.create({
8535
8552
  }
8536
8553
  }),
8537
8554
  ...Object.values(e.styleSpecs).map((n) => n.implementation.mark),
8538
- zn,
8555
+ Rn,
8556
+ jn,
8539
8557
  Vn,
8540
- On,
8541
8558
  // make sure escape blurs editor, so that we can tab to other elements in the host page (accessibility)
8542
8559
  M.create({
8543
8560
  name: "OverrideEscape",
@@ -8548,12 +8565,12 @@ const jn = (e) => M.create({
8548
8565
  }
8549
8566
  }),
8550
8567
  // nodes
8551
- Jn,
8552
- Xn.configure({
8568
+ Xn,
8569
+ $n.configure({
8553
8570
  editor: e.editor,
8554
8571
  domAttributes: e.domAttributes
8555
8572
  }),
8556
- Zn.configure({
8573
+ qn.configure({
8557
8574
  domAttributes: e.domAttributes
8558
8575
  }),
8559
8576
  ...Object.values(e.inlineContentSpecs).filter((n) => n.config !== "link" && n.config !== "text").map((n) => n.implementation.node.configure({
@@ -8573,17 +8590,17 @@ const jn = (e) => M.create({
8573
8590
  domAttributes: e.domAttributes
8574
8591
  })
8575
8592
  ]),
8576
- Hn(e.editor),
8577
- jn(e.editor),
8578
- Rn(e.editor),
8579
- ho.configure({ width: 5, color: "#ddeeff" }),
8593
+ Nn(e.editor),
8594
+ Un(e.editor),
8595
+ Dn(e.editor),
8596
+ po.configure({ width: 5, color: "#ddeeff" }),
8580
8597
  // This needs to be at the bottom of this list, because Key events (such as enter, when selecting a /command),
8581
8598
  // should be handled before Enter handlers in other components like splitListItem
8582
- ...e.trailingBlock === void 0 || e.trailingBlock ? [Fn] : []
8599
+ ...e.trailingBlock === void 0 || e.trailingBlock ? [On] : []
8583
8600
  ];
8584
8601
  if (e.collaboration) {
8585
8602
  if (t.push(
8586
- uo.configure({
8603
+ co.configure({
8587
8604
  fragment: e.collaboration.fragment
8588
8605
  })
8589
8606
  ), (i = e.collaboration.provider) != null && i.awareness) {
@@ -8596,7 +8613,7 @@ const jn = (e) => M.create({
8596
8613
  return a.insertBefore(l, null), a.insertBefore(s, null), a.insertBefore(d, null), a;
8597
8614
  };
8598
8615
  t.push(
8599
- po.configure({
8616
+ uo.configure({
8600
8617
  user: e.collaboration.user,
8601
8618
  render: e.collaboration.renderCursor || n,
8602
8619
  provider: e.collaboration.provider
@@ -8604,24 +8621,24 @@ const jn = (e) => M.create({
8604
8621
  );
8605
8622
  }
8606
8623
  } else
8607
- t.push(go);
8624
+ t.push(fo);
8608
8625
  const o = e.disableExtensions || [];
8609
8626
  return t.filter((n) => !o.includes(n.name));
8610
8627
  };
8611
- function Qn(e, t) {
8628
+ function Jn(e, t) {
8612
8629
  const o = [];
8613
8630
  return e.forEach((i, n, r) => {
8614
8631
  r !== t && o.push(i);
8615
8632
  }), L.from(o);
8616
8633
  }
8617
- function er(e, t) {
8634
+ function Yn(e, t) {
8618
8635
  let o = L.from(e.content);
8619
8636
  for (let i = 0; i < o.childCount; i++)
8620
8637
  if (o.child(i).type.spec.group === "blockContent") {
8621
8638
  const n = [o.child(i)];
8622
8639
  if (i + 1 < o.childCount && o.child(i + 1).type.spec.group === "blockGroup") {
8623
8640
  const a = o.child(i + 1).child(0).child(0);
8624
- (a.type.name === "bulletListItem" || a.type.name === "numberedListItem" || a.type.name === "checkListItem") && (n.push(o.child(i + 1)), o = Qn(o, i + 1));
8641
+ (a.type.name === "bulletListItem" || a.type.name === "numberedListItem" || a.type.name === "checkListItem") && (n.push(o.child(i + 1)), o = Jn(o, i + 1));
8625
8642
  }
8626
8643
  const r = t.state.schema.nodes.blockContainer.create(
8627
8644
  void 0,
@@ -8631,12 +8648,12 @@ function er(e, t) {
8631
8648
  }
8632
8649
  return new D(o, e.openStart, e.openEnd);
8633
8650
  }
8634
- function ge(e) {
8651
+ function be(e) {
8635
8652
  return e && Object.fromEntries(
8636
8653
  Object.entries(e).filter(([, t]) => t !== void 0)
8637
8654
  );
8638
8655
  }
8639
- class Ie {
8656
+ class Ae {
8640
8657
  constructor(t) {
8641
8658
  c(this, "blockSpecs");
8642
8659
  c(this, "inlineContentSpecs");
@@ -8648,15 +8665,15 @@ class Ie {
8648
8665
  c(this, "BlockNoteEditor", "only for types");
8649
8666
  c(this, "Block", "only for types");
8650
8667
  c(this, "PartialBlock", "only for types");
8651
- this.blockSpecs = ge(t == null ? void 0 : t.blockSpecs) || gt, this.inlineContentSpecs = ge(t == null ? void 0 : t.inlineContentSpecs) || kt, this.styleSpecs = ge(t == null ? void 0 : t.styleSpecs) || bt, this.blockSchema = ut(this.blockSpecs), this.inlineContentSchema = pt(
8668
+ this.blockSpecs = be(t == null ? void 0 : t.blockSpecs) || ft, this.inlineContentSpecs = be(t == null ? void 0 : t.inlineContentSpecs) || bt, this.styleSpecs = be(t == null ? void 0 : t.styleSpecs) || gt, this.blockSchema = ct(this.blockSpecs), this.inlineContentSchema = ut(
8652
8669
  this.inlineContentSpecs
8653
- ), this.styleSchema = mt(this.styleSpecs);
8670
+ ), this.styleSchema = ht(this.styleSpecs);
8654
8671
  }
8655
8672
  static create(t) {
8656
- return new Ie(t);
8673
+ return new Ae(t);
8657
8674
  }
8658
8675
  }
8659
- class Et extends Ft {
8676
+ class xt extends zt {
8660
8677
  constructor(o, i) {
8661
8678
  super({ ...o, content: void 0 });
8662
8679
  c(this, "_state");
@@ -8675,14 +8692,14 @@ class Et extends Ft {
8675
8692
  if (r)
8676
8693
  return r;
8677
8694
  const d = a.apply(n.nodes.doc, l), u = JSON.parse(JSON.stringify(d.toJSON()));
8678
- return u.content[0].content[0].attrs.id = "initialBlockId", r = At.fromJSON(n, u), r;
8695
+ return u.content[0].content[0].attrs.id = "initialBlockId", r = It.fromJSON(n, u), r;
8679
8696
  };
8680
8697
  let s;
8681
8698
  try {
8682
8699
  const l = o == null ? void 0 : o.content.map(
8683
8700
  (d) => P(d, this.schema, i).toJSON()
8684
8701
  );
8685
- s = Gt(
8702
+ s = Ft(
8686
8703
  {
8687
8704
  type: "doc",
8688
8705
  content: [
@@ -8703,7 +8720,7 @@ class Et extends Ft {
8703
8720
  "Error creating document from blocks passed as `initialContent`:\n" + +JSON.stringify(o.content)
8704
8721
  );
8705
8722
  }
8706
- this._state = Wt.create({
8723
+ this._state = Kt.create({
8707
8724
  doc: s,
8708
8725
  schema: this.schema
8709
8726
  // selection: selection || undefined,
@@ -8720,7 +8737,7 @@ class Et extends Ft {
8720
8737
  */
8721
8738
  createViewAlternative() {
8722
8739
  queueMicrotask(() => {
8723
- this.view = new co(
8740
+ this.view = new lo(
8724
8741
  { mount: this.options.element },
8725
8742
  // use mount option so that we reuse the existing element instead of creating a new one
8726
8743
  {
@@ -8737,10 +8754,10 @@ class Et extends Ft {
8737
8754
  });
8738
8755
  }
8739
8756
  }
8740
- Et.prototype.createView = () => {
8757
+ xt.prototype.createView = () => {
8741
8758
  };
8742
- const tr = new S("blocknote-placeholder"), or = (e, t) => new y({
8743
- key: tr,
8759
+ const Qn = new S("blocknote-placeholder"), er = (e, t) => new y({
8760
+ key: Qn,
8744
8761
  view: () => {
8745
8762
  const o = document.createElement("style"), i = e._tiptapEditor.options.injectNonce;
8746
8763
  i && o.setAttribute("nonce", i), e._tiptapEditor.view.root instanceof ShadowRoot ? e._tiptapEditor.view.root.append(o) : e._tiptapEditor.view.root.head.appendChild(o);
@@ -8784,13 +8801,12 @@ const tr = new S("blocknote-placeholder"), or = (e, t) => new y({
8784
8801
  return G.create(i, [l]);
8785
8802
  }
8786
8803
  }
8787
- });
8788
- const ir = {
8804
+ }), tr = {
8789
8805
  enableInputRules: !0,
8790
8806
  enablePasteRules: !0,
8791
8807
  enableCoreExtensions: !1
8792
8808
  };
8793
- class Ct {
8809
+ class Et {
8794
8810
  constructor(t) {
8795
8811
  c(this, "_pmSchema");
8796
8812
  /**
@@ -8869,10 +8885,10 @@ class Ct {
8869
8885
  throw new Error(
8870
8886
  "editable initialization option is deprecated, use <BlockNoteView editable={true/false} />, or alternatively editor.isEditable = true/false"
8871
8887
  );
8872
- this.dictionary = t.dictionary || et;
8888
+ this.dictionary = t.dictionary || Qe;
8873
8889
  const i = {
8874
8890
  defaultStyles: !0,
8875
- schema: t.schema || Ie.create(),
8891
+ schema: t.schema || Ae.create(),
8876
8892
  _headless: !1,
8877
8893
  ...t,
8878
8894
  placeholders: {
@@ -8880,8 +8896,8 @@ class Ct {
8880
8896
  ...t.placeholders
8881
8897
  }
8882
8898
  };
8883
- this.schema = i.schema, this.blockImplementations = i.schema.blockSpecs, this.inlineContentImplementations = i.schema.inlineContentSpecs, this.styleImplementations = i.schema.styleSpecs, this.formattingToolbar = new bn(this), this.linkToolbar = new yn(this), this.sideMenu = new Sn(this), this.suggestionMenus = new Bn(this), this.filePanel = new mn(this), E("table", this) && (this.tableHandles = new Pn(this));
8884
- const n = Yn({
8899
+ this.schema = i.schema, this.blockImplementations = i.schema.blockSpecs, this.inlineContentImplementations = i.schema.inlineContentSpecs, this.styleImplementations = i.schema.styleSpecs, this.formattingToolbar = new fn(this), this.linkToolbar = new kn(this), this.sideMenu = new En(this), this.suggestionMenus = new Mn(this), this.filePanel = new pn(this), E("table", this) && (this.tableHandles = new An(this));
8900
+ const n = Zn({
8885
8901
  editor: this,
8886
8902
  domAttributes: i.domAttributes || {},
8887
8903
  blockSpecs: this.schema.blockSpecs,
@@ -8899,7 +8915,7 @@ class Ct {
8899
8915
  this.suggestionMenus.plugin,
8900
8916
  ...this.filePanel ? [this.filePanel.plugin] : [],
8901
8917
  ...this.tableHandles ? [this.tableHandles.plugin] : [],
8902
- or(this, i.placeholders)
8918
+ er(this, i.placeholders)
8903
8919
  ]
8904
8920
  });
8905
8921
  n.push(r), this.uploadFile = i.uploadFile, this.resolveFileUrl = i.resolveFileUrl || (async (g) => g), this.headless = i._headless, i.collaboration && i.initialContent && console.warn(
@@ -8921,7 +8937,7 @@ class Ct {
8921
8937
  "initialContent must be a non-empty array of blocks, received: " + a
8922
8938
  );
8923
8939
  const s = {
8924
- ...ir,
8940
+ ...tr,
8925
8941
  ...i._tiptapOptions,
8926
8942
  content: a,
8927
8943
  extensions: [
@@ -8939,10 +8955,10 @@ class Ct {
8939
8955
  ((m = (f = i.domAttributes) == null ? void 0 : f.editor) == null ? void 0 : m.class) || ""
8940
8956
  )
8941
8957
  },
8942
- transformPasted: er
8958
+ transformPasted: Yn
8943
8959
  }
8944
8960
  };
8945
- this.headless ? this._pmSchema = Kt(s.extensions) : (this._tiptapEditor = new Et(
8961
+ this.headless ? this._pmSchema = Gt(s.extensions) : (this._tiptapEditor = new xt(
8946
8962
  s,
8947
8963
  this.schema.styleSchema
8948
8964
  ), this._pmSchema = this._tiptapEditor.schema);
@@ -8951,7 +8967,7 @@ class Ct {
8951
8967
  return this._pmSchema;
8952
8968
  }
8953
8969
  static create(t = {}) {
8954
- return new Ct(t);
8970
+ return new Et(t);
8955
8971
  }
8956
8972
  dispatch(t) {
8957
8973
  this._tiptapEditor.dispatch(t);
@@ -9083,7 +9099,7 @@ class Ct {
9083
9099
  * @param placement Whether the text cursor should be placed at the start or end of the block.
9084
9100
  */
9085
9101
  setTextCursorPosition(t, o = "start") {
9086
- const i = typeof t == "string" ? t : t.id, { posBeforeNode: n } = Te(i, this._tiptapEditor.state.doc), { startPos: r, contentNode: a } = k(
9102
+ const i = typeof t == "string" ? t : t.id, { posBeforeNode: n } = Be(i, this._tiptapEditor.state.doc), { startPos: r, contentNode: a } = k(
9087
9103
  this._tiptapEditor.state.doc,
9088
9104
  n + 2
9089
9105
  ), s = this.schema.blockSchema[a.type.name].content;
@@ -9152,7 +9168,7 @@ class Ct {
9152
9168
  * `referenceBlock`. Inserts the blocks at the start of the existing block's children if "nested" is used.
9153
9169
  */
9154
9170
  insertBlocks(t, o, i = "before") {
9155
- return Ji(t, o, i, this);
9171
+ return Xi(t, o, i, this);
9156
9172
  }
9157
9173
  /**
9158
9174
  * Updates an existing block in the editor. Since updatedBlock is a PartialBlock object, some fields might not be
@@ -9162,14 +9178,14 @@ class Ct {
9162
9178
  * @param update A partial block which defines how the existing block should be changed.
9163
9179
  */
9164
9180
  updateBlock(t, o) {
9165
- return Yi(t, o, this);
9181
+ return Zi(t, o, this);
9166
9182
  }
9167
9183
  /**
9168
9184
  * Removes existing blocks from the editor. Throws an error if any of the blocks could not be found.
9169
9185
  * @param blocksToRemove An array of identifiers for existing blocks that should be removed.
9170
9186
  */
9171
9187
  removeBlocks(t) {
9172
- return Qi(t, this);
9188
+ return Ji(t, this);
9173
9189
  }
9174
9190
  /**
9175
9191
  * Replaces existing blocks in the editor with new blocks. If the blocks that should be removed are not adjacent or
@@ -9179,7 +9195,7 @@ class Ct {
9179
9195
  * @param blocksToInsert An array of partial blocks to replace the old ones with.
9180
9196
  */
9181
9197
  replaceBlocks(t, o) {
9182
- return en(t, o, this);
9198
+ return Yi(t, o, this);
9183
9199
  }
9184
9200
  /**
9185
9201
  * Insert a piece of content at the current cursor position.
@@ -9192,7 +9208,7 @@ class Ct {
9192
9208
  this.pmSchema,
9193
9209
  this.schema.styleSchema
9194
9210
  );
9195
- tn(
9211
+ Qi(
9196
9212
  {
9197
9213
  from: this._tiptapEditor.state.selection.from,
9198
9214
  to: this._tiptapEditor.state.selection.to
@@ -9328,7 +9344,7 @@ class Ct {
9328
9344
  * @returns The blocks, serialized as an HTML string.
9329
9345
  */
9330
9346
  async blocksToHTMLLossy(t = this.document) {
9331
- return ae(this.pmSchema, this).exportBlocks(t, {});
9347
+ return se(this.pmSchema, this).exportBlocks(t, {});
9332
9348
  }
9333
9349
  /**
9334
9350
  * Serializes blocks into an HTML string in the format that would normally be rendered by the editor.
@@ -9340,7 +9356,7 @@ class Ct {
9340
9356
  * @returns The blocks, serialized as an HTML string.
9341
9357
  */
9342
9358
  async blocksToFullHTML(t) {
9343
- return Ce(this.pmSchema, this).serializeBlocks(t, {});
9359
+ return Se(this.pmSchema, this).serializeBlocks(t, {});
9344
9360
  }
9345
9361
  /**
9346
9362
  * Parses blocks from an HTML string. Tries to create `Block` objects out of any HTML block-level elements, and
@@ -9350,7 +9366,7 @@ class Ct {
9350
9366
  * @returns The blocks parsed from the HTML string.
9351
9367
  */
9352
9368
  async tryParseHTMLToBlocks(t) {
9353
- return wt(
9369
+ return yt(
9354
9370
  t,
9355
9371
  this.schema.blockSchema,
9356
9372
  this.schema.inlineContentSchema,
@@ -9365,7 +9381,7 @@ class Ct {
9365
9381
  * @returns The blocks, serialized as a Markdown string.
9366
9382
  */
9367
9383
  async blocksToMarkdownLossy(t = this.document) {
9368
- return rn(t, this.pmSchema, this, {});
9384
+ return on(t, this.pmSchema, this, {});
9369
9385
  }
9370
9386
  /**
9371
9387
  * Creates a list of blocks from a Markdown string. Tries to create `Block` and `InlineNode` objects based on
@@ -9375,7 +9391,7 @@ class Ct {
9375
9391
  * @returns The blocks parsed from the Markdown string.
9376
9392
  */
9377
9393
  async tryParseMarkdownToBlocks(t) {
9378
- return pn(
9394
+ return cn(
9379
9395
  t,
9380
9396
  this.schema.blockSchema,
9381
9397
  this.schema.inlineContentSchema,
@@ -9434,15 +9450,22 @@ class Ct {
9434
9450
  );
9435
9451
  }
9436
9452
  }
9437
- let Xe = !1;
9438
- const Ze = _o;
9439
- async function ia(e, t) {
9440
- return qi("text", e) ? (Xe || (Xe = !0, await yo({ emojiMartData: Ze })), (t.trim() === "" ? Object.values(Ze.emojis) : await wo.search(t)).map((i) => ({
9441
- id: i.skins[0].native,
9442
- onItemClick: () => e.insertInlineContent(i.skins[0].native + " ")
9443
- }))) : [];
9453
+ let ne;
9454
+ async function ea(e, t) {
9455
+ if (!Wi("text", e))
9456
+ return [];
9457
+ if (!ne) {
9458
+ ne = import("@emoji-mart/data");
9459
+ const n = (await ne).default;
9460
+ await ko({ data: n });
9461
+ }
9462
+ const o = (await ne).default;
9463
+ return (t.trim() === "" ? Object.values(o.emojis) : await _o.search(t)).map((n) => ({
9464
+ id: n.skins[0].native,
9465
+ onItemClick: () => e.insertInlineContent(n.skins[0].native + " ")
9466
+ }));
9444
9467
  }
9445
- function be(e = "") {
9468
+ function ke(e = "") {
9446
9469
  return typeof e == "string" ? [
9447
9470
  {
9448
9471
  type: "text",
@@ -9451,22 +9474,22 @@ function be(e = "") {
9451
9474
  }
9452
9475
  ] : e;
9453
9476
  }
9454
- function St(e) {
9455
- return typeof e == "string" ? be(e) : Array.isArray(e) ? e.flatMap((t) => typeof t == "string" ? be(t) : ot(t) ? {
9477
+ function Ct(e) {
9478
+ return typeof e == "string" ? ke(e) : Array.isArray(e) ? e.flatMap((t) => typeof t == "string" ? ke(t) : tt(t) ? {
9456
9479
  ...t,
9457
- content: be(t.content)
9480
+ content: ke(t.content)
9458
9481
  } : te(t) ? t : {
9459
9482
  props: {},
9460
9483
  ...t,
9461
- content: St(t.content)
9484
+ content: Ct(t.content)
9462
9485
  }) : e;
9463
9486
  }
9464
- function na(e, t) {
9487
+ function ta(e, t) {
9465
9488
  return t.map(
9466
- (o) => Mt(e, o)
9489
+ (o) => St(e, o)
9467
9490
  );
9468
9491
  }
9469
- function Mt(e, t) {
9492
+ function St(e, t) {
9470
9493
  const o = {
9471
9494
  id: "",
9472
9495
  type: t.type,
@@ -9481,142 +9504,142 @@ function Mt(e, t) {
9481
9504
  }
9482
9505
  ), {
9483
9506
  ...o,
9484
- content: St(o.content),
9485
- children: o.children.map((i) => Mt(e, i))
9507
+ content: Ct(o.content),
9508
+ children: o.children.map((i) => St(e, i))
9486
9509
  };
9487
9510
  }
9488
- function nr(e) {
9489
- e.id || (e.id = oe.options.generateID()), e.children && rr(e.children);
9511
+ function or(e) {
9512
+ e.id || (e.id = oe.options.generateID()), e.children && ir(e.children);
9490
9513
  }
9491
- function rr(e) {
9514
+ function ir(e) {
9492
9515
  for (const t of e)
9493
- nr(t);
9516
+ or(t);
9494
9517
  }
9495
9518
  export {
9496
- ti as AudioBlock,
9497
- Ct as BlockNoteEditor,
9498
- Ie as BlockNoteSchema,
9499
- si as FileBlock,
9500
- mn as FilePanelProsemirrorPlugin,
9501
- hn as FilePanelView,
9502
- bn as FormattingToolbarProsemirrorPlugin,
9503
- fn as FormattingToolbarView,
9504
- wt as HTMLToBlocks,
9505
- hi as ImageBlock,
9506
- yn as LinkToolbarProsemirrorPlugin,
9507
- Sn as SideMenuProsemirrorPlugin,
9508
- En as SideMenuView,
9509
- Bn as SuggestionMenuProseMirrorPlugin,
9510
- Pn as TableHandlesProsemirrorPlugin,
9511
- Nn as TableHandlesView,
9519
+ Qo as AudioBlock,
9520
+ Et as BlockNoteEditor,
9521
+ Ae as BlockNoteSchema,
9522
+ ri as FileBlock,
9523
+ pn as FilePanelProsemirrorPlugin,
9524
+ un as FilePanelView,
9525
+ fn as FormattingToolbarProsemirrorPlugin,
9526
+ hn as FormattingToolbarView,
9527
+ yt as HTMLToBlocks,
9528
+ ui as ImageBlock,
9529
+ kn as LinkToolbarProsemirrorPlugin,
9530
+ En as SideMenuProsemirrorPlugin,
9531
+ vn as SideMenuView,
9532
+ Mn as SuggestionMenuProseMirrorPlugin,
9533
+ An as TableHandlesProsemirrorPlugin,
9534
+ In as TableHandlesView,
9512
9535
  oe as UniqueID,
9513
9536
  I as UnreachableCaseError,
9514
- _i as VideoBlock,
9515
- nr as addIdsToBlock,
9516
- rr as addIdsToBlocks,
9517
- zo as addInlineContentAttributes,
9518
- Fo as addInlineContentKeyboardShortcuts,
9519
- qo as addStyleAttributes,
9520
- Fr as assertEmpty,
9521
- Jo as audioBlockConfig,
9522
- Qo as audioParse,
9523
- Zo as audioPropSchema,
9524
- Yo as audioRender,
9525
- ei as audioToExternalHTML,
9537
+ bi as VideoBlock,
9538
+ or as addIdsToBlock,
9539
+ ir as addIdsToBlocks,
9540
+ Ro as addInlineContentAttributes,
9541
+ Oo as addInlineContentKeyboardShortcuts,
9542
+ Wo as addStyleAttributes,
9543
+ Rr as assertEmpty,
9544
+ Xo as audioBlockConfig,
9545
+ Jo as audioParse,
9546
+ qo as audioPropSchema,
9547
+ Zo as audioRender,
9548
+ Yo as audioToExternalHTML,
9526
9549
  P as blockToNode,
9527
- rn as blocksToMarkdown,
9528
- re as camelToDataKebab,
9529
- Qr as checkBlockHasDefaultProp,
9530
- Xi as checkBlockIsDefaultType,
9531
- Zr as checkBlockIsFileBlock,
9532
- Yr as checkBlockIsFileBlockWithPlaceholder,
9533
- Jr as checkBlockIsFileBlockWithPreview,
9534
- Zi as checkBlockTypeHasDefaultProp,
9550
+ on as blocksToMarkdown,
9551
+ ae as camelToDataKebab,
9552
+ Zr as checkBlockHasDefaultProp,
9553
+ $i as checkBlockIsDefaultType,
9554
+ $r as checkBlockIsFileBlock,
9555
+ Xr as checkBlockIsFileBlockWithPlaceholder,
9556
+ qr as checkBlockIsFileBlockWithPreview,
9557
+ qi as checkBlockTypeHasDefaultProp,
9535
9558
  E as checkDefaultBlockTypeInSchema,
9536
- qi as checkDefaultInlineContentTypeInSchema,
9537
- Be as cleanHTMLToMarkdown,
9538
- Ee as contentNodeToInlineContent,
9539
- de as createAddFileButton,
9540
- se as createBlockSpec,
9559
+ Wi as checkDefaultInlineContentTypeInSchema,
9560
+ Le as cleanHTMLToMarkdown,
9561
+ Ce as contentNodeToInlineContent,
9562
+ ce as createAddFileButton,
9563
+ le as createBlockSpec,
9541
9564
  q as createBlockSpecFromStronglyTypedTiptapNode,
9542
- le as createDefaultFilePreview,
9543
- ae as createExternalHTMLExporter,
9544
- Se as createFigureWithCaption,
9545
- V as createFileAndCaptionWrapper,
9546
- Wr as createInlineContentSpec,
9547
- Ko as createInlineContentSpecFromTipTapNode,
9548
- ct as createInternalBlockSpec,
9549
- Ce as createInternalHTMLSerializer,
9550
- Go as createInternalInlineContentSpec,
9551
- ht as createInternalStyleSpec,
9552
- ue as createLinkWithCaption,
9553
- ft as createResizeHandlesWrapper,
9565
+ de as createDefaultFilePreview,
9566
+ se as createExternalHTMLExporter,
9567
+ Me as createFigureWithCaption,
9568
+ R as createFileAndCaptionWrapper,
9569
+ Fr as createInlineContentSpec,
9570
+ Fo as createInlineContentSpecFromTipTapNode,
9571
+ dt as createInternalBlockSpec,
9572
+ Se as createInternalHTMLSerializer,
9573
+ zo as createInternalInlineContentSpec,
9574
+ pt as createInternalStyleSpec,
9575
+ pe as createLinkWithCaption,
9576
+ mt as createResizeHandlesWrapper,
9554
9577
  O as createStronglyTypedTiptapNode,
9555
- $r as createStyleSpec,
9578
+ Gr as createStyleSpec,
9556
9579
  U as createStyleSpecFromTipTapMark,
9557
- ea as createSuggestionMenu,
9558
- Wi as defaultBlockSchema,
9559
- gt as defaultBlockSpecs,
9560
- $i as defaultInlineContentSchema,
9561
- kt as defaultInlineContentSpecs,
9580
+ Jr as createSuggestionMenu,
9581
+ Gi as defaultBlockSchema,
9582
+ ft as defaultBlockSpecs,
9583
+ Ki as defaultInlineContentSchema,
9584
+ bt as defaultInlineContentSpecs,
9562
9585
  _ as defaultProps,
9563
- Xr as defaultStyleSchema,
9564
- bt as defaultStyleSpecs,
9565
- ii as fileBlockConfig,
9566
- ri as fileParse,
9567
- oi as filePropSchema,
9568
- ni as fileRender,
9569
- ai as fileToExternalHTML,
9570
- Kr as filenameFromURL,
9571
- oa as filterSuggestionItems,
9586
+ Wr as defaultStyleSchema,
9587
+ gt as defaultStyleSpecs,
9588
+ ti as fileBlockConfig,
9589
+ ii as fileParse,
9590
+ ei as filePropSchema,
9591
+ oi as fileRender,
9592
+ ni as fileToExternalHTML,
9593
+ zr as filenameFromURL,
9594
+ Qr as filterSuggestionItems,
9572
9595
  H as formatKeyboardShortcut,
9573
- gn as formattingToolbarPluginKey,
9574
- Vo as getBlockFromPos,
9575
- Yn as getBlockNoteExtensions,
9576
- ut as getBlockSchemaFromSpecs,
9577
- ia as getDefaultEmojiPickerItems,
9578
- ta as getDefaultSlashMenuItems,
9579
- pe as getDraggableBlockFromElement,
9580
- Wo as getInlineContentParseRules,
9581
- pt as getInlineContentSchemaFromSpecs,
9582
- Oo as getParseRules,
9583
- Xo as getStyleParseRules,
9584
- mt as getStyleSchemaFromSpecs,
9585
- di as imageBlockConfig,
9586
- ui as imageParse,
9587
- li as imagePropSchema,
9588
- ci as imageRender,
9589
- pi as imageToExternalHTML,
9590
- lt as inheritedProps,
9596
+ mn as formattingToolbarPluginKey,
9597
+ jo as getBlockFromPos,
9598
+ Zn as getBlockNoteExtensions,
9599
+ ct as getBlockSchemaFromSpecs,
9600
+ ea as getDefaultEmojiPickerItems,
9601
+ Yr as getDefaultSlashMenuItems,
9602
+ he as getDraggableBlockFromElement,
9603
+ Go as getInlineContentParseRules,
9604
+ ut as getInlineContentSchemaFromSpecs,
9605
+ Vo as getParseRules,
9606
+ $o as getStyleParseRules,
9607
+ ht as getStyleSchemaFromSpecs,
9608
+ si as imageBlockConfig,
9609
+ di as imageParse,
9610
+ ai as imagePropSchema,
9611
+ li as imageRender,
9612
+ ci as imageToExternalHTML,
9613
+ st as inheritedProps,
9591
9614
  W as inlineContentToNodes,
9592
9615
  x as insertOrUpdateBlock,
9593
- Ro as isAppleOS,
9594
- De as isLinkInlineContent,
9595
- ot as isPartialLinkInlineContent,
9596
- Gr as isSafari,
9616
+ Do as isAppleOS,
9617
+ je as isLinkInlineContent,
9618
+ tt as isPartialLinkInlineContent,
9619
+ Or as isSafari,
9597
9620
  te as isStyledTextInlineContent,
9598
- _n as linkToolbarPluginKey,
9599
- zr as locales,
9600
- pn as markdownToBlocks,
9621
+ bn as linkToolbarPluginKey,
9622
+ Vr as locales,
9623
+ cn as markdownToBlocks,
9601
9624
  j as mergeCSSClasses,
9602
9625
  v as nodeToBlock,
9603
- rt as nodeToCustomInlineContent,
9604
- Ve as parseEmbedElement,
9605
- ce as parseFigureElement,
9606
- ze as parseImageElement,
9607
- Mt as partialBlockToBlockForTesting,
9608
- na as partialBlocksToBlocksForTesting,
9609
- dt as propsToAttributes,
9610
- Cn as sideMenuPluginKey,
9611
- $o as stylePropsToAttributes,
9612
- it as tableContentToNodes,
9626
+ nt as nodeToCustomInlineContent,
9627
+ Oe as parseEmbedElement,
9628
+ ue as parseFigureElement,
9629
+ Fe as parseImageElement,
9630
+ St as partialBlockToBlockForTesting,
9631
+ ta as partialBlocksToBlocksForTesting,
9632
+ lt as propsToAttributes,
9633
+ xn as sideMenuPluginKey,
9634
+ Ko as stylePropsToAttributes,
9635
+ ot as tableContentToNodes,
9613
9636
  Q as tableHandlesPluginKey,
9614
- qr as uploadToTmpFilesDotOrg_DEV_ONLY,
9615
- fi as videoBlockConfig,
9616
- bi as videoParse,
9617
- mi as videoPropSchema,
9618
- gi as videoRender,
9619
- ki as videoToExternalHTML,
9620
- me as wrapInBlockStructure
9637
+ Kr as uploadToTmpFilesDotOrg_DEV_ONLY,
9638
+ hi as videoBlockConfig,
9639
+ fi as videoParse,
9640
+ pi as videoPropSchema,
9641
+ mi as videoRender,
9642
+ gi as videoToExternalHTML,
9643
+ fe as wrapInBlockStructure
9621
9644
  };
9622
9645
  //# sourceMappingURL=blocknote.js.map