@blocknote/core 0.45.0 → 0.46.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/{BlockNoteSchema-BOW16JHv.js → BlockNoteSchema-DsMVJZv4.js} +2 -2
  2. package/dist/{BlockNoteSchema-BOW16JHv.js.map → BlockNoteSchema-DsMVJZv4.js.map} +1 -1
  3. package/dist/{BlockNoteSchema-CzZbr4Ed.cjs → BlockNoteSchema-qt4Czo0-.cjs} +2 -2
  4. package/dist/{BlockNoteSchema-CzZbr4Ed.cjs.map → BlockNoteSchema-qt4Czo0-.cjs.map} +1 -1
  5. package/dist/ShowSelection-B0ch3unP.js +51 -0
  6. package/dist/ShowSelection-B0ch3unP.js.map +1 -0
  7. package/dist/ShowSelection-BxnbRvy4.cjs +2 -0
  8. package/dist/ShowSelection-BxnbRvy4.cjs.map +1 -0
  9. package/dist/{TrailingNode-8cXFaQUm.js → TrailingNode-C-Kyrtf1.js} +378 -369
  10. package/dist/TrailingNode-C-Kyrtf1.js.map +1 -0
  11. package/dist/TrailingNode-W7GJVng5.cjs +2 -0
  12. package/dist/TrailingNode-W7GJVng5.cjs.map +1 -0
  13. package/dist/blocknote.cjs +1 -1
  14. package/dist/blocknote.cjs.map +1 -1
  15. package/dist/blocknote.js +7 -7
  16. package/dist/blocknote.js.map +1 -1
  17. package/dist/blocks.cjs +1 -1
  18. package/dist/blocks.js +2 -2
  19. package/dist/comments.cjs +1 -1
  20. package/dist/comments.cjs.map +1 -1
  21. package/dist/comments.js +3 -3
  22. package/dist/comments.js.map +1 -1
  23. package/dist/{defaultBlocks-DvCGYzqu.js → defaultBlocks-CXOCngjC.js} +118 -119
  24. package/dist/defaultBlocks-CXOCngjC.js.map +1 -0
  25. package/dist/defaultBlocks-IsUGVZIq.cjs +6 -0
  26. package/dist/defaultBlocks-IsUGVZIq.cjs.map +1 -0
  27. package/dist/extensions.cjs +1 -1
  28. package/dist/extensions.js +4 -4
  29. package/dist/style.css +1 -1
  30. package/dist/tsconfig.tsbuildinfo +1 -1
  31. package/dist/webpack-stats.json +1 -1
  32. package/package.json +5 -5
  33. package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +17 -0
  34. package/src/blocks/ListItem/BulletListItem/block.ts +1 -1
  35. package/src/blocks/ListItem/CheckListItem/block.ts +6 -4
  36. package/src/blocks/ListItem/NumberedListItem/block.ts +1 -1
  37. package/src/comments/extension.ts +6 -2
  38. package/src/editor/Block.css +1 -1
  39. package/src/editor/managers/ExtensionManager/extensions.ts +1 -1
  40. package/src/extensions/LinkToolbar/LinkToolbar.ts +1 -1
  41. package/src/extensions/ShowSelection/ShowSelection.ts +14 -4
  42. package/types/src/extensions/ShowSelection/ShowSelection.d.ts +10 -4
  43. package/dist/ShowSelection-BW37oJ6h.cjs +0 -2
  44. package/dist/ShowSelection-BW37oJ6h.cjs.map +0 -1
  45. package/dist/ShowSelection-Dz-NEase.js +0 -43
  46. package/dist/ShowSelection-Dz-NEase.js.map +0 -1
  47. package/dist/TrailingNode-8cXFaQUm.js.map +0 -1
  48. package/dist/TrailingNode-DPu6X9ym.cjs +0 -2
  49. package/dist/TrailingNode-DPu6X9ym.cjs.map +0 -1
  50. package/dist/defaultBlocks-D1cc0lV9.cjs +0 -6
  51. package/dist/defaultBlocks-D1cc0lV9.cjs.map +0 -1
  52. package/dist/defaultBlocks-DvCGYzqu.js.map +0 -1
@@ -1,14 +1,14 @@
1
1
  var Oe = Object.defineProperty;
2
2
  var _e = (e, t, n) => t in e ? Oe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var M = (e, t, n) => _e(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { TableMap as be, goToNextCell as ne, columnResizing as Ve, tableEditing as Re, CellSelection as Ce, TableView as We } from "prosemirror-tables";
4
+ import { TableMap as be, goToNextCell as ne, columnResizing as Ve, tableEditing as We, CellSelection as Ce, TableView as Re } from "prosemirror-tables";
5
5
  import { Node as N, Mark as Fe, Extension as $e, callOrReturn as Ue, getExtensionField as qe, mergeAttributes as z, findParentNode as je } from "@tiptap/core";
6
6
  import { TextSelection as ke, Plugin as Ge, PluginKey as Ze } from "prosemirror-state";
7
7
  import { DecorationSet as oe, Decoration as re } from "prosemirror-view";
8
8
  import { ReplaceStep as ze, Mapping as Xe } from "prosemirror-transform";
9
9
  import { ySyncPluginKey as ae, absolutePositionToRelativePosition as Ke, relativePositionToAbsolutePosition as Qe } from "y-prosemirror";
10
- import { c as k, a as ye } from "./BlockNoteExtension-C2X7LW-V.js";
11
- import { b as X, v as Je, g as O, a as ve, i as se, t as Ye, U as et, q as tt, A as G, r as nt, w as Ee, J as ot } from "./blockToNode-BNoNIXU7.js";
10
+ import { c as k, a as ve } from "./BlockNoteExtension-C2X7LW-V.js";
11
+ import { b as X, v as Je, g as O, a as ye, i as se, t as Ye, U as et, q as tt, A as G, r as nt, w as Ee, J as ot } from "./blockToNode-BNoNIXU7.js";
12
12
  import rt from "@tiptap/extension-bold";
13
13
  import at from "@tiptap/extension-code";
14
14
  import st from "@tiptap/extension-italic";
@@ -17,7 +17,7 @@ import ct from "@tiptap/extension-underline";
17
17
  import { DOMParser as xe, Fragment as lt, DOMSerializer as ie } from "@tiptap/pm/model";
18
18
  import { createHighlightPlugin as dt } from "prosemirror-highlight";
19
19
  import { createParser as ut } from "prosemirror-highlight/shiki";
20
- import { Slice as we, Fragment as F, DOMParser as Se } from "prosemirror-model";
20
+ import { Slice as Se, Fragment as F, DOMParser as we } from "prosemirror-model";
21
21
  import { Plugin as pt, PluginKey as ft } from "@tiptap/pm/state";
22
22
  import { DecorationSet as ce, Decoration as ht } from "@tiptap/pm/view";
23
23
  const mt = () => typeof navigator < "u" && (/Mac/.test(navigator.platform) || /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent));
@@ -80,7 +80,7 @@ function bt(e, t = "<br>") {
80
80
  }
81
81
  }
82
82
  }
83
- function W(e) {
83
+ function R(e) {
84
84
  return "data-" + e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
85
85
  }
86
86
  function po(e) {
@@ -118,7 +118,7 @@ function Ct(e) {
118
118
  // value is the same as its default, we don't display an HTML
119
119
  // attribute for it.
120
120
  parseHTML: (r) => {
121
- const a = r.getAttribute(W(n));
121
+ const a = r.getAttribute(R(n));
122
122
  if (a === null)
123
123
  return null;
124
124
  if (o.default === void 0 && o.type === "boolean" || o.default !== void 0 && typeof o.default == "boolean")
@@ -130,7 +130,7 @@ function Ct(e) {
130
130
  return a;
131
131
  },
132
132
  renderHTML: (r) => r[n] !== o.default ? {
133
- [W(n)]: r[n]
133
+ [R(n)]: r[n]
134
134
  } : {}
135
135
  };
136
136
  }), t;
@@ -158,7 +158,7 @@ function Z(e, t, n, o, r = !1, a) {
158
158
  ), s.setAttribute("data-content-type", t);
159
159
  for (const [i, c] of Object.entries(n)) {
160
160
  const u = o[i].default;
161
- c !== u && s.setAttribute(W(i), c);
161
+ c !== u && s.setAttribute(R(i), c);
162
162
  }
163
163
  return r && s.setAttribute("data-file-block", ""), s.appendChild(e.dom), e.contentDOM && (e.contentDOM.className = D(
164
164
  "bn-inline-content",
@@ -168,7 +168,7 @@ function Z(e, t, n, o, r = !1, a) {
168
168
  dom: s
169
169
  };
170
170
  }
171
- function yt(e, t, n) {
171
+ function vt(e, t, n) {
172
172
  return {
173
173
  config: {
174
174
  type: e.type,
@@ -183,7 +183,7 @@ function yt(e, t, n) {
183
183
  extensions: n
184
184
  };
185
185
  }
186
- function vt(e, t) {
186
+ function yt(e, t) {
187
187
  e.stopEvent = (n) => (n.type === "mousedown" && setTimeout(() => {
188
188
  t.view.dom.blur();
189
189
  }, 10), !0);
@@ -273,7 +273,7 @@ function ho(e, t, n, o) {
273
273
  d,
274
274
  u
275
275
  );
276
- return ((E = t.meta) == null ? void 0 : E.selectable) === !1 && vt(m, this.editor), m;
276
+ return ((E = t.meta) == null ? void 0 : E.selectable) === !1 && yt(m, this.editor), m;
277
277
  };
278
278
  }
279
279
  });
@@ -321,7 +321,7 @@ function ho(e, t, n, o) {
321
321
  function mo(e) {
322
322
  return e;
323
323
  }
324
- function v(e, t, n) {
324
+ function y(e, t, n) {
325
325
  return (o = {}) => {
326
326
  const r = typeof e == "function" ? e(o) : e, a = typeof t == "function" ? t(o) : t, s = n ? typeof n == "function" ? n(o) : n : void 0;
327
327
  return {
@@ -375,7 +375,7 @@ function go(e, t, n, o) {
375
375
  return e.dom.setAttribute("data-inline-content-type", t), Object.entries(n).filter(([r, a]) => {
376
376
  const s = o[r];
377
377
  return a !== s.default;
378
- }).map(([r, a]) => [W(r), a]).forEach(([r, a]) => e.dom.setAttribute(r, a)), e.contentDOM && e.contentDOM.setAttribute("data-editable", ""), e;
378
+ }).map(([r, a]) => [R(r), a]).forEach(([r, a]) => e.dom.setAttribute(r, a)), e.contentDOM && e.contentDOM.setAttribute("data-editable", ""), e;
379
379
  }
380
380
  function bo(e) {
381
381
  return {
@@ -404,12 +404,12 @@ function Co(e, t, n) {
404
404
  }
405
405
  );
406
406
  }
407
- function wt(e) {
407
+ function St(e) {
408
408
  return Object.fromEntries(
409
409
  Object.entries(e).map(([t, n]) => [t, n.config])
410
410
  );
411
411
  }
412
- function St(e) {
412
+ function wt(e) {
413
413
  return e === "boolean" ? {} : {
414
414
  stringValue: {
415
415
  default: void 0,
@@ -510,7 +510,7 @@ function Le(e, t) {
510
510
  const n = Fe.create({
511
511
  name: e.type,
512
512
  addAttributes() {
513
- return St(e.propSchema);
513
+ return wt(e.propSchema);
514
514
  },
515
515
  parseHTML() {
516
516
  return Lt(e, t.parse);
@@ -596,7 +596,7 @@ function K(e, t, n, o, r) {
596
596
  } else if (!a.isBlockContainer && l.isInGroup("bnBlock"))
597
597
  de(n, e, a);
598
598
  else {
599
- const d = ve(a.bnBlock.node, i);
599
+ const d = ye(a.bnBlock.node, i);
600
600
  e.replaceWith(
601
601
  a.bnBlock.beforePos,
602
602
  a.bnBlock.afterPos,
@@ -648,7 +648,7 @@ function At(e, t, n, o, r, a, s) {
648
648
  t.replace(
649
649
  l,
650
650
  u,
651
- new we(
651
+ new Se(
652
652
  F.from(c),
653
653
  p - d - 1,
654
654
  m - d - 1
@@ -676,7 +676,7 @@ function de(e, t, n) {
676
676
  new ze(
677
677
  n.childContainer.beforePos + 1,
678
678
  n.childContainer.afterPos - 1,
679
- new we(F.from(r), 0, 0)
679
+ new Se(F.from(r), 0, 0)
680
680
  )
681
681
  );
682
682
  else {
@@ -689,7 +689,7 @@ function de(e, t, n) {
689
689
  }
690
690
  }
691
691
  }
692
- function yo(e, t, n, o, r) {
692
+ function vo(e, t, n, o, r) {
693
693
  const a = typeof t == "string" ? t : t.id, s = Tt(a, e.doc);
694
694
  if (!s)
695
695
  throw new Error(`Block with ID ${a} not found`);
@@ -701,7 +701,7 @@ function yo(e, t, n, o, r) {
701
701
  r
702
702
  );
703
703
  const i = e.doc.resolve(s.posBeforeNode + 1).node(), c = O(e);
704
- return ve(i, c);
704
+ return ye(i, c);
705
705
  }
706
706
  function Pt(e) {
707
707
  const t = "selection" in e ? e.selection : null;
@@ -709,10 +709,10 @@ function Pt(e) {
709
709
  return null;
710
710
  const n = e.doc.resolve(t.head);
711
711
  let o = -1, r = -1;
712
- for (let w = n.depth; w >= 0; w--) {
713
- const x = n.node(w).type.name;
714
- if (o < 0 && (x === "tableCell" || x === "tableHeader") && (o = w), x === "table") {
715
- r = w;
712
+ for (let S = n.depth; S >= 0; S--) {
713
+ const x = n.node(S).type.name;
714
+ if (o < 0 && (x === "tableCell" || x === "tableHeader") && (o = S), x === "table") {
715
+ r = S;
716
716
  break;
717
717
  }
718
718
  }
@@ -728,15 +728,15 @@ function Pt(e) {
728
728
  return { row: d, col: p, offset: E };
729
729
  }
730
730
  function Nt(e, t, n) {
731
- var w;
731
+ var S;
732
732
  if (t.blockNoteType !== "table")
733
733
  return !1;
734
734
  let o = -1;
735
735
  if (t.isBlockContainer)
736
736
  o = e.mapping.map(t.blockContent.beforePos);
737
737
  else {
738
- const x = e.mapping.map(t.bnBlock.beforePos), P = x + (((w = e.doc.nodeAt(x)) == null ? void 0 : w.nodeSize) || 0);
739
- e.doc.nodesBetween(x, P, (g, S) => g.type.name === "table" ? (o = S, !1) : !0);
738
+ const x = e.mapping.map(t.bnBlock.beforePos), P = x + (((S = e.doc.nodeAt(x)) == null ? void 0 : S.nodeSize) || 0);
739
+ e.doc.nodesBetween(x, P, (g, w) => g.type.name === "table" ? (o = w, !1) : !0);
740
740
  }
741
741
  const r = o >= 0 ? e.doc.nodeAt(o) : null;
742
742
  if (!r || r.type.name !== "table")
@@ -784,7 +784,7 @@ const T = {
784
784
  text: "#ad1a72",
785
785
  background: "#f4dfeb"
786
786
  }
787
- }, vo = {
787
+ }, yo = {
788
788
  gray: {
789
789
  text: "#bebdb8",
790
790
  background: "#9b9a97"
@@ -832,7 +832,7 @@ const T = {
832
832
  default: "left",
833
833
  values: ["left", "center", "right", "justify"]
834
834
  }
835
- }, y = (e) => {
835
+ }, v = (e) => {
836
836
  const t = {};
837
837
  return e.hasAttribute("data-background-color") ? t.backgroundColor = e.getAttribute("data-background-color") : e.style.backgroundColor && (t.backgroundColor = e.style.backgroundColor), e.hasAttribute("data-text-color") ? t.textColor = e.getAttribute("data-text-color") : e.style.color && (t.textColor = e.style.color), t.textAlignment = h.textAlignment.values.includes(
838
838
  e.style.textAlign
@@ -851,7 +851,7 @@ const T = {
851
851
  renderHTML: (t) => t[e] === h.textColor.default ? {} : {
852
852
  "data-text-color": t[e]
853
853
  }
854
- }), wo = (e = "textAlignment") => ({
854
+ }), So = (e = "textAlignment") => ({
855
855
  default: h.textAlignment.default,
856
856
  parseHTML: (t) => t.hasAttribute("data-text-alignment") ? t.getAttribute("data-text-alignment") : t.style.textAlign ? t.style.textAlign : h.textAlignment.default,
857
857
  renderHTML: (t) => t[e] === h.textAlignment.default ? {} : {
@@ -866,7 +866,7 @@ const T = {
866
866
  const o = e.querySelector("figcaption"), r = (o == null ? void 0 : o.textContent) ?? void 0;
867
867
  return { targetElement: n, caption: r };
868
868
  }, I = k(({ editor: e }) => {
869
- const t = ye(void 0);
869
+ const t = ve(void 0);
870
870
  function n() {
871
871
  t.setState(void 0);
872
872
  }
@@ -998,7 +998,7 @@ const T = {
998
998
  if (t.tagName === "AUDIO") {
999
999
  if (t.closest("figure"))
1000
1000
  return;
1001
- const { backgroundColor: n } = y(t);
1001
+ const { backgroundColor: n } = v(t);
1002
1002
  return {
1003
1003
  ...ue(t),
1004
1004
  backgroundColor: n
@@ -1008,14 +1008,14 @@ const T = {
1008
1008
  const n = $(t, "audio");
1009
1009
  if (!n)
1010
1010
  return;
1011
- const { targetElement: o, caption: r } = n, { backgroundColor: a } = y(t);
1011
+ const { targetElement: o, caption: r } = n, { backgroundColor: a } = v(t);
1012
1012
  return {
1013
1013
  ...ue(o),
1014
1014
  backgroundColor: a,
1015
1015
  caption: r
1016
1016
  };
1017
1017
  }
1018
- }, Rt = (e = {}) => (t, n) => {
1018
+ }, Wt = (e = {}) => (t, n) => {
1019
1019
  const o = document.createElement("div");
1020
1020
  o.innerHTML = e.icon ?? Ot;
1021
1021
  const r = document.createElement("audio");
@@ -1027,7 +1027,7 @@ const T = {
1027
1027
  { dom: r },
1028
1028
  o.firstElementChild
1029
1029
  );
1030
- }, Wt = (e = {}) => (t, n) => {
1030
+ }, Rt = (e = {}) => (t, n) => {
1031
1031
  if (!t.props.url) {
1032
1032
  const r = document.createElement("p");
1033
1033
  return r.textContent = "Add audio", {
@@ -1038,15 +1038,15 @@ const T = {
1038
1038
  return t.props.showPreview ? (o = document.createElement("audio"), o.src = t.props.url) : (o = document.createElement("a"), o.href = t.props.url, o.textContent = t.props.name || t.props.url), t.props.caption ? t.props.showPreview ? J(o, t.props.caption) : U(o, t.props.caption) : {
1039
1039
  dom: o
1040
1040
  };
1041
- }, Ft = v(
1041
+ }, Ft = y(
1042
1042
  _t,
1043
1043
  (e) => ({
1044
1044
  meta: {
1045
1045
  fileBlockAccept: ["audio/*"]
1046
1046
  },
1047
1047
  parse: Vt(e),
1048
- render: Rt(e),
1049
- toExternalHTML: Wt(e),
1048
+ render: Wt(e),
1049
+ toExternalHTML: Rt(e),
1050
1050
  runsBefore: ["file"]
1051
1051
  })
1052
1052
  ), pe = Symbol.for("blocknote.shikiParser"), j = Symbol.for(
@@ -1082,7 +1082,7 @@ const Ut = ({ defaultLanguage: e = "text" }) => ({
1082
1082
  }
1083
1083
  },
1084
1084
  content: "inline"
1085
- }), qt = v(
1085
+ }), qt = y(
1086
1086
  Ut,
1087
1087
  (e) => ({
1088
1088
  meta: {
@@ -1222,7 +1222,7 @@ const jt = () => ({
1222
1222
  type: "divider",
1223
1223
  propSchema: {},
1224
1224
  content: "none"
1225
- }), Gt = v(
1225
+ }), Gt = y(
1226
1226
  jt,
1227
1227
  {
1228
1228
  meta: {
@@ -1273,7 +1273,7 @@ const jt = () => ({
1273
1273
  if (e.tagName === "EMBED") {
1274
1274
  if (e.closest("figure"))
1275
1275
  return;
1276
- const { backgroundColor: t } = y(e);
1276
+ const { backgroundColor: t } = v(e);
1277
1277
  return {
1278
1278
  ...fe(e),
1279
1279
  backgroundColor: t
@@ -1283,14 +1283,14 @@ const jt = () => ({
1283
1283
  const t = $(e, "embed");
1284
1284
  if (!t)
1285
1285
  return;
1286
- const { targetElement: n, caption: o } = t, { backgroundColor: r } = y(e);
1286
+ const { targetElement: n, caption: o } = t, { backgroundColor: r } = v(e);
1287
1287
  return {
1288
1288
  ...fe(n),
1289
1289
  backgroundColor: r,
1290
1290
  caption: o
1291
1291
  };
1292
1292
  }
1293
- }, Xt = v(Zt, {
1293
+ }, Xt = y(Zt, {
1294
1294
  meta: {
1295
1295
  fileBlockAccept: ["*/*"]
1296
1296
  },
@@ -1391,7 +1391,7 @@ const jt = () => ({
1391
1391
  ...n ? { isToggleable: { default: !1, optional: !0 } } : {}
1392
1392
  },
1393
1393
  content: "inline"
1394
- }), Yt = v(
1394
+ }), Yt = y(
1395
1395
  Jt,
1396
1396
  ({ allowToggleHeadings: e = !0 } = {}) => ({
1397
1397
  meta: {
@@ -1422,7 +1422,7 @@ const jt = () => ({
1422
1422
  return;
1423
1423
  }
1424
1424
  return {
1425
- ...y(t),
1425
+ ...v(t),
1426
1426
  level: n
1427
1427
  };
1428
1428
  },
@@ -1484,10 +1484,10 @@ const jt = () => ({
1484
1484
  !t.isEditable && o.contains(c) && o.contains(l) && (o.removeChild(c), o.removeChild(l));
1485
1485
  return;
1486
1486
  }
1487
- let S;
1487
+ let w;
1488
1488
  const _ = "touches" in g ? g.touches[0].clientX : g.clientX;
1489
- e.props.textAlignment === "center" ? d.handleUsed === "left" ? S = d.initialWidth + (d.initialClientX - _) * 2 : S = d.initialWidth + (_ - d.initialClientX) * 2 : d.handleUsed === "left" ? S = d.initialWidth + d.initialClientX - _ : S = d.initialWidth + _ - d.initialClientX, p = Math.min(
1490
- Math.max(S, 64),
1489
+ e.props.textAlignment === "center" ? d.handleUsed === "left" ? w = d.initialWidth + (d.initialClientX - _) * 2 : w = d.initialWidth + (_ - d.initialClientX) * 2 : d.handleUsed === "left" ? w = d.initialWidth + d.initialClientX - _ : w = d.initialWidth + _ - d.initialClientX, p = Math.min(
1490
+ Math.max(w, 64),
1491
1491
  ((te = (ee = t.domElement) == null ? void 0 : ee.firstElementChild) == null ? void 0 : te.clientWidth) || Number.MAX_VALUE
1492
1492
  ), i.style.width = `${p}px`;
1493
1493
  }, f = (g) => {
@@ -1498,26 +1498,26 @@ const jt = () => ({
1498
1498
  }));
1499
1499
  }, E = () => {
1500
1500
  t.isEditable && (o.appendChild(c), o.appendChild(l));
1501
- }, w = (g) => {
1501
+ }, S = (g) => {
1502
1502
  g.relatedTarget === c || g.relatedTarget === l || d || t.isEditable && o.contains(c) && o.contains(l) && (o.removeChild(c), o.removeChild(l));
1503
1503
  }, x = (g) => {
1504
1504
  g.preventDefault(), i.contains(u) || i.appendChild(u);
1505
- const S = "touches" in g ? g.touches[0].clientX : g.clientX;
1505
+ const w = "touches" in g ? g.touches[0].clientX : g.clientX;
1506
1506
  d = {
1507
1507
  handleUsed: "left",
1508
1508
  initialWidth: i.clientWidth,
1509
- initialClientX: S
1509
+ initialClientX: w
1510
1510
  };
1511
1511
  }, P = (g) => {
1512
1512
  g.preventDefault(), i.contains(u) || i.appendChild(u);
1513
- const S = "touches" in g ? g.touches[0].clientX : g.clientX;
1513
+ const w = "touches" in g ? g.touches[0].clientX : g.clientX;
1514
1514
  d = {
1515
1515
  handleUsed: "right",
1516
1516
  initialWidth: i.clientWidth,
1517
- initialClientX: S
1517
+ initialClientX: w
1518
1518
  };
1519
1519
  };
1520
- return window.addEventListener("mousemove", m), window.addEventListener("touchmove", m), window.addEventListener("mouseup", f), window.addEventListener("touchend", f), i.addEventListener("mouseenter", E), i.addEventListener("mouseleave", w), c.addEventListener(
1520
+ return window.addEventListener("mousemove", m), window.addEventListener("touchmove", m), window.addEventListener("mouseup", f), window.addEventListener("touchend", f), i.addEventListener("mouseenter", E), i.addEventListener("mouseleave", S), c.addEventListener(
1521
1521
  "mousedown",
1522
1522
  x
1523
1523
  ), c.addEventListener(
@@ -1532,7 +1532,7 @@ const jt = () => ({
1532
1532
  ), {
1533
1533
  dom: i,
1534
1534
  destroy: () => {
1535
- s == null || s(), window.removeEventListener("mousemove", m), window.removeEventListener("touchmove", m), window.removeEventListener("mouseup", f), window.removeEventListener("touchend", f), i.removeEventListener("mouseenter", E), i.removeEventListener("mouseleave", w), c.removeEventListener(
1535
+ s == null || s(), window.removeEventListener("mousemove", m), window.removeEventListener("touchmove", m), window.removeEventListener("mouseup", f), window.removeEventListener("touchend", f), i.removeEventListener("mouseenter", E), i.removeEventListener("mouseleave", S), c.removeEventListener(
1536
1536
  "mousedown",
1537
1537
  x
1538
1538
  ), c.removeEventListener(
@@ -1581,7 +1581,7 @@ const jt = () => ({
1581
1581
  if (t.tagName === "IMG") {
1582
1582
  if (t.closest("figure"))
1583
1583
  return;
1584
- const { backgroundColor: n } = y(t);
1584
+ const { backgroundColor: n } = v(t);
1585
1585
  return {
1586
1586
  ...he(t),
1587
1587
  backgroundColor: n
@@ -1591,7 +1591,7 @@ const jt = () => ({
1591
1591
  const n = $(t, "img");
1592
1592
  if (!n)
1593
1593
  return;
1594
- const { targetElement: o, caption: r } = n, { backgroundColor: a } = y(t);
1594
+ const { targetElement: o, caption: r } = n, { backgroundColor: a } = v(t);
1595
1595
  return {
1596
1596
  ...he(o),
1597
1597
  backgroundColor: a,
@@ -1624,7 +1624,7 @@ const jt = () => ({
1624
1624
  return t.props.showPreview ? (o = document.createElement("img"), o.src = t.props.url, o.alt = t.props.name || t.props.caption || "BlockNote image", t.props.previewWidth && (o.width = t.props.previewWidth)) : (o = document.createElement("a"), o.href = t.props.url, o.textContent = t.props.name || t.props.url), t.props.caption ? t.props.showPreview ? J(o, t.props.caption) : U(o, t.props.caption) : {
1625
1625
  dom: o
1626
1626
  };
1627
- }, an = v(
1627
+ }, an = y(
1628
1628
  tn,
1629
1629
  (e) => ({
1630
1630
  meta: {
@@ -1635,7 +1635,7 @@ const jt = () => ({
1635
1635
  toExternalHTML: rn(e),
1636
1636
  runsBefore: ["file"]
1637
1637
  })
1638
- ), So = (e, t, n) => ({
1638
+ ), wo = (e, t, n) => ({
1639
1639
  state: o,
1640
1640
  dispatch: r
1641
1641
  }) => r ? Ne(o.tr, e, t, n) : !0, Ne = (e, t, n, o) => {
@@ -1671,7 +1671,7 @@ const jt = () => ({
1671
1671
  };
1672
1672
  function Y(e, t, n) {
1673
1673
  var d, p, m;
1674
- const o = Se.fromSchema(t), r = e, a = document.createElement("div");
1674
+ const o = we.fromSchema(t), r = e, a = document.createElement("div");
1675
1675
  a.setAttribute("data-node-type", "blockGroup");
1676
1676
  for (const f of Array.from(r.childNodes))
1677
1677
  a.appendChild(f.cloneNode(!0));
@@ -1705,7 +1705,7 @@ const sn = () => ({
1705
1705
  ...h
1706
1706
  },
1707
1707
  content: "inline"
1708
- }), cn = v(
1708
+ }), cn = y(
1709
1709
  sn,
1710
1710
  {
1711
1711
  meta: {
@@ -1717,7 +1717,7 @@ const sn = () => ({
1717
1717
  return;
1718
1718
  const t = e.parentElement;
1719
1719
  if (t !== null && (t.tagName === "UL" || t.tagName === "DIV" && ((n = t.parentElement) == null ? void 0 : n.tagName) === "UL"))
1720
- return y(e);
1720
+ return v(e);
1721
1721
  },
1722
1722
  // As `li` elements can contain multiple paragraphs, we need to merge their contents
1723
1723
  // into a single one so that ProseMirror can parse everything correctly.
@@ -1752,7 +1752,7 @@ const sn = () => ({
1752
1752
  },
1753
1753
  inputRules: [
1754
1754
  {
1755
- find: new RegExp("^[-+*]\\s$"),
1755
+ find: /^\s?[-+*]\s$/,
1756
1756
  replace({ editor: e }) {
1757
1757
  if (Ee(
1758
1758
  e.prosemirrorState
@@ -1773,7 +1773,7 @@ const sn = () => ({
1773
1773
  checked: { default: !1, type: "boolean" }
1774
1774
  },
1775
1775
  content: "inline"
1776
- }), dn = v(
1776
+ }), dn = y(
1777
1777
  ln,
1778
1778
  {
1779
1779
  meta: {
@@ -1788,7 +1788,7 @@ const sn = () => ({
1788
1788
  const t = e.parentElement;
1789
1789
  if (t !== null && (t.tagName === "UL" || t.tagName === "DIV" && ((n = t.parentElement) == null ? void 0 : n.tagName) === "UL")) {
1790
1790
  const o = e.querySelector("input[type=checkbox]") || null;
1791
- return o === null ? void 0 : { ...y(e), checked: o.checked };
1791
+ return o === null ? void 0 : { ...v(e), checked: o.checked };
1792
1792
  }
1793
1793
  },
1794
1794
  // As `li` elements can contain multiple paragraphs, we need to merge their contents
@@ -1799,8 +1799,8 @@ const sn = () => ({
1799
1799
  o.type = "checkbox", o.checked = e.props.checked, e.props.checked && o.setAttribute("checked", ""), o.addEventListener("change", () => {
1800
1800
  t.updateBlock(e, { props: { checked: !e.props.checked } });
1801
1801
  });
1802
- const r = document.createElement("p");
1803
- return n.appendChild(o), n.appendChild(r), {
1802
+ const r = document.createElement("p"), a = document.createElement("div");
1803
+ return a.contentEditable = "false", a.appendChild(o), n.appendChild(a), n.appendChild(r), {
1804
1804
  dom: n,
1805
1805
  contentDOM: r
1806
1806
  };
@@ -1831,19 +1831,18 @@ const sn = () => ({
1831
1831
  },
1832
1832
  inputRules: [
1833
1833
  {
1834
- find: new RegExp("^\\[\\s*\\]\\s$"),
1834
+ find: /^\s?\[\s*\]\s$/,
1835
1835
  replace() {
1836
1836
  return {
1837
1837
  type: "checkListItem",
1838
1838
  props: {
1839
1839
  checked: !1
1840
- },
1841
- content: []
1840
+ }
1842
1841
  };
1843
1842
  }
1844
1843
  },
1845
1844
  {
1846
- find: new RegExp("^\\[[Xx]\\]\\s$"),
1845
+ find: /^\s?\[[Xx]\]\s$/,
1847
1846
  replace() {
1848
1847
  return {
1849
1848
  type: "checkListItem",
@@ -1936,7 +1935,7 @@ const un = () => new pt({
1936
1935
  start: { default: void 0, type: "number" }
1937
1936
  },
1938
1937
  content: "inline"
1939
- }), fn = v(
1938
+ }), fn = y(
1940
1939
  pn,
1941
1940
  {
1942
1941
  meta: {
@@ -1948,7 +1947,7 @@ const un = () => new pt({
1948
1947
  return;
1949
1948
  const t = e.parentElement;
1950
1949
  if (t !== null && (t.tagName === "OL" || t.tagName === "DIV" && ((n = t.parentElement) == null ? void 0 : n.tagName) === "OL")) {
1951
- const o = parseInt(t.getAttribute("start") || "1"), r = y(e);
1950
+ const o = parseInt(t.getAttribute("start") || "1"), r = v(e);
1952
1951
  return e.previousElementSibling || o === 1 ? r : {
1953
1952
  ...r,
1954
1953
  start: o
@@ -1978,7 +1977,7 @@ const un = () => new pt({
1978
1977
  key: "numbered-list-item-shortcuts",
1979
1978
  inputRules: [
1980
1979
  {
1981
- find: new RegExp("^(\\d+)\\.\\s$"),
1980
+ find: /^\s?(\d+)\.\s$/,
1982
1981
  replace({ match: e, editor: t }) {
1983
1982
  if (Ee(
1984
1983
  t.prosemirrorState
@@ -2013,7 +2012,7 @@ const un = () => new pt({
2013
2012
  ...h
2014
2013
  },
2015
2014
  content: "inline"
2016
- }), mn = v(
2015
+ }), mn = y(
2017
2016
  hn,
2018
2017
  {
2019
2018
  meta: {
@@ -2054,7 +2053,7 @@ const un = () => new pt({
2054
2053
  type: "paragraph",
2055
2054
  propSchema: h,
2056
2055
  content: "inline"
2057
- }), bn = v(
2056
+ }), bn = y(
2058
2057
  gn,
2059
2058
  {
2060
2059
  meta: {
@@ -2063,7 +2062,7 @@ const un = () => new pt({
2063
2062
  parse: (e) => {
2064
2063
  var t;
2065
2064
  if (e.tagName === "P" && (t = e.textContent) != null && t.trim())
2066
- return y(e);
2065
+ return v(e);
2067
2066
  },
2068
2067
  render: () => {
2069
2068
  const e = document.createElement("p");
@@ -2102,7 +2101,7 @@ const un = () => new pt({
2102
2101
  textColor: h.textColor
2103
2102
  },
2104
2103
  content: "inline"
2105
- }), kn = v(
2104
+ }), kn = y(
2106
2105
  Cn,
2107
2106
  {
2108
2107
  meta: {
@@ -2110,7 +2109,7 @@ const un = () => new pt({
2110
2109
  },
2111
2110
  parse(e) {
2112
2111
  if (e.tagName === "BLOCKQUOTE") {
2113
- const { backgroundColor: t, textColor: n } = y(e);
2112
+ const { backgroundColor: t, textColor: n } = v(e);
2114
2113
  return { backgroundColor: t, textColor: n };
2115
2114
  }
2116
2115
  },
@@ -2154,18 +2153,18 @@ const un = () => new pt({
2154
2153
  ]
2155
2154
  })
2156
2155
  ]
2157
- ), yn = 35, Ie = 120, Mo = 31, vn = $e.create({
2156
+ ), vn = 35, Ie = 120, Mo = 31, yn = $e.create({
2158
2157
  name: "BlockNoteTableExtension",
2159
2158
  addProseMirrorPlugins: () => [
2160
2159
  Ve({
2161
- cellMinWidth: yn,
2160
+ cellMinWidth: vn,
2162
2161
  defaultCellMinWidth: Ie,
2163
2162
  // We set this to null as we implement our own node view in the table
2164
2163
  // block content. This node view is the same as what's used by default,
2165
2164
  // but is wrapped in a `blockContent` HTML element.
2166
2165
  View: null
2167
2166
  }),
2168
- Re()
2167
+ We()
2169
2168
  ],
2170
2169
  addKeyboardShortcuts() {
2171
2170
  return {
@@ -2251,7 +2250,7 @@ const un = () => new pt({
2251
2250
  0
2252
2251
  ];
2253
2252
  }
2254
- }), wn = N.create({
2253
+ }), Sn = N.create({
2255
2254
  name: "tableCell",
2256
2255
  addOptions() {
2257
2256
  return {
@@ -2295,7 +2294,7 @@ const un = () => new pt({
2295
2294
  0
2296
2295
  ];
2297
2296
  }
2298
- }), Sn = N.create({
2297
+ }), wn = N.create({
2299
2298
  name: "table",
2300
2299
  content: "tableRow+",
2301
2300
  group: "blockContent",
@@ -2340,7 +2339,7 @@ const un = () => new pt({
2340
2339
  addNodeView() {
2341
2340
  return ({ node: e, HTMLAttributes: t }) => {
2342
2341
  var o;
2343
- class n extends We {
2342
+ class n extends Re {
2344
2343
  constructor(a, s, i) {
2345
2344
  super(a, s), this.node = a, this.cellMinWidth = s, this.blockContentHTMLAttributes = i;
2346
2345
  const c = document.createElement("div");
@@ -2410,7 +2409,7 @@ const un = () => new pt({
2410
2409
  }
2411
2410
  });
2412
2411
  function De(e, t) {
2413
- const o = Se.fromSchema(t).parse(e, {
2412
+ const o = we.fromSchema(t).parse(e, {
2414
2413
  topNode: t.nodes.blockGroup.create()
2415
2414
  }), r = [];
2416
2415
  return o.content.descendants((a) => {
@@ -2418,17 +2417,17 @@ function De(e, t) {
2418
2417
  return r.push(a), !1;
2419
2418
  }), F.fromArray(r);
2420
2419
  }
2421
- const Tn = () => yt(
2422
- { node: Sn, type: "table", content: "table" },
2420
+ const Tn = () => vt(
2421
+ { node: wn, type: "table", content: "table" },
2423
2422
  En,
2424
2423
  [
2425
2424
  k({
2426
2425
  key: "table-extensions",
2427
2426
  tiptapExtensions: [
2428
- vn,
2427
+ yn,
2429
2428
  Mn,
2430
2429
  xn,
2431
- wn,
2430
+ Sn,
2432
2431
  Ln
2433
2432
  ]
2434
2433
  }),
@@ -2479,7 +2478,7 @@ const Tn = () => yt(
2479
2478
  if (t.tagName === "VIDEO") {
2480
2479
  if (t.closest("figure"))
2481
2480
  return;
2482
- const { backgroundColor: n } = y(t);
2481
+ const { backgroundColor: n } = v(t);
2483
2482
  return {
2484
2483
  ...ge(t),
2485
2484
  backgroundColor: n
@@ -2489,14 +2488,14 @@ const Tn = () => yt(
2489
2488
  const n = $(t, "video");
2490
2489
  if (!n)
2491
2490
  return;
2492
- const { targetElement: o, caption: r } = n, { backgroundColor: a } = y(t);
2491
+ const { targetElement: o, caption: r } = n, { backgroundColor: a } = v(t);
2493
2492
  return {
2494
2493
  ...ge(o),
2495
2494
  backgroundColor: a,
2496
2495
  caption: r
2497
2496
  };
2498
2497
  }
2499
- }, Nn = v(
2498
+ }, Nn = y(
2500
2499
  An,
2501
2500
  (e) => ({
2502
2501
  meta: {
@@ -2563,16 +2562,16 @@ function Lo(e, t, n, o) {
2563
2562
  function To(e) {
2564
2563
  return e instanceof Ce;
2565
2564
  }
2566
- const R = /* @__PURE__ */ new Map();
2565
+ const W = /* @__PURE__ */ new Map();
2567
2566
  function Hn(e) {
2568
- if (R.has(e))
2569
- return R.get(e);
2567
+ if (W.has(e))
2568
+ return W.get(e);
2570
2569
  const t = new Xe();
2571
2570
  return e._tiptapEditor.on("transaction", ({ transaction: n }) => {
2572
2571
  t.appendMapping(n.mapping);
2573
2572
  }), e._tiptapEditor.on("destroy", () => {
2574
- R.delete(e);
2575
- }), R.set(e, t), t;
2573
+ W.delete(e);
2574
+ }), W.set(e, t), t;
2576
2575
  }
2577
2576
  function In(e, t, n = "left") {
2578
2577
  const o = ae.getState(e.prosemirrorState);
@@ -2666,7 +2665,7 @@ class On {
2666
2665
  const B = new Ze("SuggestionMenuPlugin"), _n = k(({ editor: e }) => {
2667
2666
  const t = [];
2668
2667
  let n;
2669
- const o = ye(void 0);
2668
+ const o = ve(void 0);
2670
2669
  return {
2671
2670
  key: "suggestionMenu",
2672
2671
  store: o,
@@ -3023,7 +3022,7 @@ const Po = {
3023
3022
  table: Tn(),
3024
3023
  toggleListItem: mn(),
3025
3024
  video: Nn()
3026
- }, Rn = Le(
3025
+ }, Wn = Le(
3027
3026
  {
3028
3027
  type: "textColor",
3029
3028
  propSchema: "string"
@@ -3048,7 +3047,7 @@ const Po = {
3048
3047
  return e.style.color;
3049
3048
  }
3050
3049
  }
3051
- ), Wn = Le(
3050
+ ), Rn = Le(
3052
3051
  {
3053
3052
  type: "backgroundColor",
3054
3053
  propSchema: "string"
@@ -3079,12 +3078,12 @@ const Po = {
3079
3078
  underline: H(ct, "boolean"),
3080
3079
  strike: H(it, "boolean"),
3081
3080
  code: H(at, "boolean"),
3082
- textColor: Rn,
3083
- backgroundColor: Wn
3081
+ textColor: Wn,
3082
+ backgroundColor: Rn
3084
3083
  }, No = Mt(Fn), $n = {
3085
3084
  text: { config: "text", implementation: {} },
3086
3085
  link: { config: "link", implementation: {} }
3087
- }, Ho = wt(
3086
+ }, Ho = St(
3088
3087
  $n
3089
3088
  );
3090
3089
  export {
@@ -3120,26 +3119,26 @@ export {
3120
3119
  Lo as a0,
3121
3120
  To as a1,
3122
3121
  h as a2,
3123
- y as a3,
3122
+ v as a3,
3124
3123
  A as a4,
3125
3124
  Eo as a5,
3126
3125
  xo as a6,
3127
- wo as a7,
3126
+ So as a7,
3128
3127
  I as a8,
3129
3128
  _n as a9,
3130
3129
  Z as aA,
3131
- yt as aB,
3130
+ vt as aB,
3132
3131
  xt as aC,
3133
3132
  Lt as aD,
3134
3133
  Le as aE,
3135
- St as aF,
3134
+ wt as aF,
3136
3135
  V as aG,
3137
3136
  Me as aH,
3138
3137
  H as aI,
3139
3138
  mt as aJ,
3140
3139
  L as aK,
3141
3140
  uo as aL,
3142
- W as aM,
3141
+ R as aM,
3143
3142
  po as aN,
3144
3143
  In as aO,
3145
3144
  C as aa,
@@ -3147,31 +3146,31 @@ export {
3147
3146
  Ao as ac,
3148
3147
  ho as ad,
3149
3148
  Mt as ae,
3150
- wt as af,
3149
+ St as af,
3151
3150
  mo as ag,
3152
- v as ah,
3151
+ y as ah,
3153
3152
  Bt as ai,
3154
3153
  Tt as aj,
3155
3154
  go as ak,
3156
3155
  bo as al,
3157
3156
  Ct as am,
3158
3157
  Co as an,
3159
- yo as ao,
3158
+ vo as ao,
3160
3159
  fo as ap,
3161
- So as aq,
3160
+ wo as aq,
3162
3161
  ko as ar,
3163
3162
  D as as,
3164
3163
  K as at,
3165
3164
  Pt as au,
3166
3165
  T as av,
3167
- vo as aw,
3168
- vt as ax,
3166
+ yo as aw,
3167
+ yt as ax,
3169
3168
  Et as ay,
3170
3169
  kt as az,
3171
3170
  Vt as b,
3172
3171
  _t as c,
3173
- Rt as d,
3174
- Wt as e,
3172
+ Wt as d,
3173
+ Rt as e,
3175
3174
  Ft as f,
3176
3175
  Ut as g,
3177
3176
  qt as h,
@@ -3194,4 +3193,4 @@ export {
3194
3193
  cn as y,
3195
3194
  ln as z
3196
3195
  };
3197
- //# sourceMappingURL=defaultBlocks-DvCGYzqu.js.map
3196
+ //# sourceMappingURL=defaultBlocks-CXOCngjC.js.map