@blocknote/core 0.15.11 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/blocknote.js +888 -844
  2. package/dist/blocknote.js.map +1 -1
  3. package/dist/blocknote.umd.cjs +5 -5
  4. package/dist/blocknote.umd.cjs.map +1 -1
  5. package/dist/webpack-stats.json +1 -1
  6. package/package.json +2 -2
  7. package/src/api/clipboard/__snapshots__/childToParent.html +1 -0
  8. package/src/api/clipboard/__snapshots__/childrenToNextParent.html +1 -0
  9. package/src/api/clipboard/__snapshots__/childrenToNextParentsChildren.html +1 -0
  10. package/src/api/clipboard/__snapshots__/image.html +1 -0
  11. package/src/api/clipboard/__snapshots__/multipleStyledText.html +1 -0
  12. package/src/api/clipboard/__snapshots__/nestedImage.html +1 -0
  13. package/src/api/clipboard/__snapshots__/partialChildToParent.html +1 -0
  14. package/src/api/clipboard/__snapshots__/styledText.html +1 -0
  15. package/src/api/clipboard/__snapshots__/tableAllCells.html +1 -0
  16. package/src/api/clipboard/__snapshots__/tableCell.html +1 -0
  17. package/src/api/clipboard/__snapshots__/tableCellText.html +1 -0
  18. package/src/api/clipboard/__snapshots__/tableRow.html +1 -0
  19. package/src/api/clipboard/__snapshots__/unstyledText.html +1 -0
  20. package/src/api/clipboard/clipboard.test.ts +284 -0
  21. package/src/api/{parsers → clipboard/fromClipboard}/fileDropExtension.ts +2 -2
  22. package/src/api/{parsers → clipboard/fromClipboard}/handleFileInsertion.ts +4 -4
  23. package/src/api/{parsers → clipboard/fromClipboard}/pasteExtension.ts +14 -7
  24. package/src/api/{exporters → clipboard/toClipboard}/copyExtension.ts +70 -43
  25. package/src/api/exporters/html/externalHTMLExporter.ts +14 -7
  26. package/src/api/exporters/html/htmlConversion.test.ts +4 -147
  27. package/src/api/exporters/html/internalHTMLSerializer.ts +5 -2
  28. package/src/api/parsers/html/parseHTML.test.ts +3 -6
  29. package/src/api/parsers/markdown/__snapshots__/pasted/complex.json +319 -0
  30. package/src/api/parsers/markdown/__snapshots__/pasted/issue-226-1.json +81 -0
  31. package/src/api/parsers/{html/__snapshots__/paste/parse-deep-nested-content.json → markdown/__snapshots__/pasted/issue-226-2.json} +35 -110
  32. package/src/api/parsers/markdown/__snapshots__/pasted/nested.json +81 -0
  33. package/src/api/parsers/markdown/__snapshots__/pasted/non-nested.json +81 -0
  34. package/src/api/parsers/markdown/__snapshots__/pasted/styled.json +61 -0
  35. package/src/api/parsers/markdown/parseMarkdown.test.ts +15 -0
  36. package/src/api/testUtil/paste.ts +46 -0
  37. package/src/blocks/TableBlockContent/TableBlockContent.ts +0 -1
  38. package/src/editor/BlockNoteExtensions.ts +3 -3
  39. package/src/editor/transformPasted.ts +34 -2
  40. package/src/extensions/SideMenu/SideMenuPlugin.ts +6 -7
  41. package/src/schema/blocks/createSpec.ts +16 -7
  42. package/types/src/api/clipboard/clipboard.test.d.ts +1 -0
  43. package/types/src/api/clipboard/fromClipboard/fileDropExtension.d.ts +6 -0
  44. package/types/src/api/{parsers → clipboard/fromClipboard}/handleFileInsertion.d.ts +2 -2
  45. package/types/src/api/clipboard/fromClipboard/pasteExtension.d.ts +6 -0
  46. package/types/src/api/clipboard/toClipboard/copyExtension.d.ts +12 -0
  47. package/types/src/api/exporters/html/externalHTMLExporter.d.ts +1 -0
  48. package/types/src/api/testUtil/paste.d.ts +2 -0
  49. package/types/src/editor/transformPasted.d.ts +8 -1
  50. package/src/api/exporters/html/__snapshots_fragment_edge_cases__/selectionLeavesBlockChildren.html +0 -1
  51. package/src/api/exporters/html/__snapshots_fragment_edge_cases__/selectionSpansBlocksChildren.html +0 -1
  52. package/src/api/parsers/html/__snapshots__/paste/parse-google-docs-html.json +0 -476
  53. package/types/src/api/exporters/copyExtension.d.ts +0 -6
  54. package/types/src/api/parsers/fileDropExtension.d.ts +0 -6
  55. package/types/src/api/parsers/pasteExtension.d.ts +0 -6
  56. /package/src/api/{exporters/html/__snapshots_fragment_edge_cases__/selectionWithinBlockChildren.html → clipboard/__snapshots__/multipleChildren.html} +0 -0
  57. /package/src/api/{parsers → clipboard/fromClipboard}/acceptedMIMETypes.ts +0 -0
  58. /package/src/api/parsers/html/__snapshots__/{paste/list-test.json → list-test.json} +0 -0
  59. /package/src/api/parsers/html/__snapshots__/{paste/parse-basic-block-types.json → parse-basic-block-types.json} +0 -0
  60. /package/src/api/parsers/html/__snapshots__/{paste/parse-div-with-inline-content.json → parse-div-with-inline-content.json} +0 -0
  61. /package/src/api/parsers/html/__snapshots__/{paste/parse-divs.json → parse-divs.json} +0 -0
  62. /package/src/api/parsers/html/__snapshots__/{paste/parse-fake-image-caption.json → parse-fake-image-caption.json} +0 -0
  63. /package/src/api/parsers/html/__snapshots__/{paste/parse-image-in-paragraph.json → parse-image-in-paragraph.json} +0 -0
  64. /package/src/api/parsers/html/__snapshots__/{paste/parse-mixed-nested-lists.json → parse-mixed-nested-lists.json} +0 -0
  65. /package/src/api/parsers/html/__snapshots__/{paste/parse-nested-lists-with-paragraphs.json → parse-nested-lists-with-paragraphs.json} +0 -0
  66. /package/src/api/parsers/html/__snapshots__/{paste/parse-nested-lists.json → parse-nested-lists.json} +0 -0
  67. /package/src/api/parsers/html/__snapshots__/{paste/parse-notion-html.json → parse-notion-html.json} +0 -0
  68. /package/src/api/parsers/html/__snapshots__/{paste/parse-two-divs.json → parse-two-divs.json} +0 -0
  69. /package/types/src/api/{parsers → clipboard/fromClipboard}/acceptedMIMETypes.d.ts +0 -0
package/dist/blocknote.js CHANGED
@@ -1,9 +1,9 @@
1
1
  var Lt = Object.defineProperty;
2
2
  var It = (e, t, i) => t in e ? Lt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
3
3
  var c = (e, t, i) => It(e, typeof t != "symbol" ? t + "" : t, i);
4
- import { Slice as z, Fragment as N, DOMSerializer as Se, DOMParser as At, Node as Nt } from "prosemirror-model";
5
- import { Extension as I, combineTransactionSteps as Pt, getChangedRanges as Ht, findChildrenInRange as Ut, Node as q, Mark as Me, InputRule as ee, callOrReturn as Dt, getExtensionField as jt, mergeAttributes as zt, selectionToInsertionEnd as Rt, isTextSelection as Vt, isNodeSelection as Ot, posToDOMRect as xe, getMarkRange as ze, findParentNode as Ft, extensions as J, Editor as Gt, createDocument as Wt, findChildren as Re, getSchema as Kt } from "@tiptap/core";
6
- import { Plugin as x, PluginKey as L, Selection as be, NodeSelection as ce, TextSelection as Y, EditorState as $t } from "prosemirror-state";
4
+ import { Slice as z, Fragment as I, DOMSerializer as R, DOMParser as At, Node as Nt } from "prosemirror-model";
5
+ import { Extension as A, combineTransactionSteps as Pt, getChangedRanges as Ht, findChildrenInRange as Ut, Node as X, Mark as Me, InputRule as te, callOrReturn as Dt, getExtensionField as jt, mergeAttributes as zt, selectionToInsertionEnd as Rt, isTextSelection as Vt, isNodeSelection as Ot, posToDOMRect as Ee, getMarkRange as je, findParentNode as Ft, extensions as Y, Editor as Gt, createDocument as Wt, findChildren as ze, getSchema as Kt } from "@tiptap/core";
6
+ import { Plugin as v, PluginKey as B, Selection as ke, NodeSelection as pe, TextSelection as Q, EditorState as $t } from "prosemirror-state";
7
7
  import { v4 as qt } from "uuid";
8
8
  import Xt from "@tiptap/extension-bold";
9
9
  import Zt from "@tiptap/extension-code";
@@ -13,17 +13,18 @@ import Qt from "@tiptap/extension-underline";
13
13
  import { TableCell as ei } from "@tiptap/extension-table-cell";
14
14
  import { TableHeader as ti } from "@tiptap/extension-table-header";
15
15
  import { TableRow as ii } from "@tiptap/extension-table-row";
16
- import { columnResizing as oi, tableEditing as ni } from "prosemirror-tables";
17
- import { DecorationSet as K, Decoration as $, EditorView as ri } from "prosemirror-view";
18
- import ai from "@tiptap/extension-collaboration";
19
- import si from "@tiptap/extension-collaboration-cursor";
20
- import { Dropcursor as li } from "@tiptap/extension-dropcursor";
21
- import { Gapcursor as di } from "@tiptap/extension-gapcursor";
22
- import { HardBreak as ci } from "@tiptap/extension-hard-break";
23
- import { History as ui } from "@tiptap/extension-history";
24
- import { Link as pi } from "@tiptap/extension-link";
25
- import { Text as hi } from "@tiptap/extension-text";
26
- const mi = {
16
+ import { columnResizing as oi, tableEditing as ni, CellSelection as ri } from "prosemirror-tables";
17
+ import * as et from "prosemirror-view";
18
+ import { DecorationSet as $, Decoration as q, EditorView as ai } from "prosemirror-view";
19
+ import si from "@tiptap/extension-collaboration";
20
+ import li from "@tiptap/extension-collaboration-cursor";
21
+ import { Dropcursor as di } from "@tiptap/extension-dropcursor";
22
+ import { Gapcursor as ci } from "@tiptap/extension-gapcursor";
23
+ import { HardBreak as ui } from "@tiptap/extension-hard-break";
24
+ import { History as pi } from "@tiptap/extension-history";
25
+ import { Link as hi } from "@tiptap/extension-link";
26
+ import { Text as mi } from "@tiptap/extension-text";
27
+ const fi = {
27
28
  slash_menu: {
28
29
  heading: {
29
30
  title: "عنوان 1",
@@ -313,7 +314,7 @@ const mi = {
313
314
  generic: {
314
315
  ctrl_shortcut: "Ctrl"
315
316
  }
316
- }, fi = {
317
+ }, gi = {
317
318
  slash_menu: {
318
319
  heading: {
319
320
  title: "Überschrift 1",
@@ -924,7 +925,7 @@ const mi = {
924
925
  generic: {
925
926
  ctrl_shortcut: "Ctrl"
926
927
  }
927
- }, gi = {
928
+ }, bi = {
928
929
  slash_menu: {
929
930
  heading: {
930
931
  title: "Encabezado 1",
@@ -1197,7 +1198,7 @@ const mi = {
1197
1198
  generic: {
1198
1199
  ctrl_shortcut: "Ctrl"
1199
1200
  }
1200
- }, bi = {
1201
+ }, _i = {
1201
1202
  slash_menu: {
1202
1203
  heading: {
1203
1204
  title: "Titre 1",
@@ -1502,7 +1503,7 @@ const mi = {
1502
1503
  generic: {
1503
1504
  ctrl_shortcut: "Ctrl"
1504
1505
  }
1505
- }, _i = {
1506
+ }, ki = {
1506
1507
  slash_menu: {
1507
1508
  heading: {
1508
1509
  title: "Fyrirsögn 1",
@@ -1799,7 +1800,7 @@ const mi = {
1799
1800
  generic: {
1800
1801
  ctrl_shortcut: "Ctrl"
1801
1802
  }
1802
- }, ki = {
1803
+ }, yi = {
1803
1804
  slash_menu: {
1804
1805
  heading: {
1805
1806
  title: "見出し1",
@@ -2124,7 +2125,7 @@ const mi = {
2124
2125
  generic: {
2125
2126
  ctrl_shortcut: "Ctrl"
2126
2127
  }
2127
- }, yi = {
2128
+ }, wi = {
2128
2129
  slash_menu: {
2129
2130
  heading: {
2130
2131
  title: "제목1",
@@ -2442,7 +2443,7 @@ const mi = {
2442
2443
  generic: {
2443
2444
  ctrl_shortcut: "Ctrl"
2444
2445
  }
2445
- }, wi = {
2446
+ }, vi = {
2446
2447
  slash_menu: {
2447
2448
  heading: {
2448
2449
  title: "Kop 1",
@@ -2747,7 +2748,7 @@ const mi = {
2747
2748
  generic: {
2748
2749
  ctrl_shortcut: "Ctrl"
2749
2750
  }
2750
- }, vi = {
2751
+ }, xi = {
2751
2752
  slash_menu: {
2752
2753
  heading: {
2753
2754
  title: "Nagłówek 1",
@@ -3036,7 +3037,7 @@ const mi = {
3036
3037
  generic: {
3037
3038
  ctrl_shortcut: "Ctrl"
3038
3039
  }
3039
- }, xi = {
3040
+ }, Ei = {
3040
3041
  slash_menu: {
3041
3042
  heading: {
3042
3043
  title: "Título",
@@ -3333,7 +3334,7 @@ const mi = {
3333
3334
  generic: {
3334
3335
  ctrl_shortcut: "Ctrl"
3335
3336
  }
3336
- }, Ei = {
3337
+ }, Ci = {
3337
3338
  slash_menu: {
3338
3339
  heading: {
3339
3340
  title: "Заголовок 1 уровня",
@@ -3665,7 +3666,7 @@ const mi = {
3665
3666
  generic: {
3666
3667
  ctrl_shortcut: "Ctrl"
3667
3668
  }
3668
- }, Ci = {
3669
+ }, Si = {
3669
3670
  slash_menu: {
3670
3671
  heading: {
3671
3672
  title: "Tiêu đề H1",
@@ -3969,7 +3970,7 @@ const mi = {
3969
3970
  generic: {
3970
3971
  ctrl_shortcut: "Ctrl"
3971
3972
  }
3972
- }, Si = {
3973
+ }, Mi = {
3973
3974
  slash_menu: {
3974
3975
  heading: {
3975
3976
  title: "一级标题",
@@ -4307,25 +4308,25 @@ const mi = {
4307
4308
  generic: {
4308
4309
  ctrl_shortcut: "Ctrl"
4309
4310
  }
4310
- }, Tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4311
+ }, Ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4311
4312
  __proto__: null,
4312
- ar: mi,
4313
- de: fi,
4313
+ ar: fi,
4314
+ de: gi,
4314
4315
  en: tt,
4315
- es: gi,
4316
- fr: bi,
4317
- is: _i,
4318
- ja: ki,
4319
- ko: yi,
4320
- nl: wi,
4321
- pl: vi,
4322
- pt: xi,
4323
- ru: Ei,
4324
- vi: Ci,
4325
- zh: Si
4316
+ es: bi,
4317
+ fr: _i,
4318
+ is: ki,
4319
+ ja: yi,
4320
+ ko: wi,
4321
+ nl: vi,
4322
+ pl: xi,
4323
+ pt: Ei,
4324
+ ru: Ci,
4325
+ vi: Si,
4326
+ zh: Mi
4326
4327
  }, Symbol.toStringTag, { value: "Module" }));
4327
4328
  let H;
4328
- async function ie() {
4329
+ async function oe() {
4329
4330
  if (H)
4330
4331
  return H;
4331
4332
  const e = await Promise.all([
@@ -4353,20 +4354,20 @@ async function ie() {
4353
4354
  rehypeFormat: e[9]
4354
4355
  }, H;
4355
4356
  }
4356
- function Mi(e, t = JSON.stringify) {
4357
+ function Ti(e, t = JSON.stringify) {
4357
4358
  const i = {};
4358
4359
  return e.filter((o) => {
4359
4360
  const n = t(o);
4360
4361
  return Object.prototype.hasOwnProperty.call(i, n) ? !1 : i[n] = !0;
4361
4362
  });
4362
4363
  }
4363
- function Ti(e) {
4364
+ function Bi(e) {
4364
4365
  const t = e.filter(
4365
4366
  (o, n) => e.indexOf(o) !== n
4366
4367
  );
4367
- return Mi(t);
4368
+ return Ti(t);
4368
4369
  }
4369
- const oe = I.create({
4370
+ const ne = A.create({
4370
4371
  name: "uniqueID",
4371
4372
  // we’ll set a very high priority to make sure this runs first
4372
4373
  // and is compatible with `appendTransaction` hooks of other extensions
@@ -4441,12 +4442,12 @@ const oe = I.create({
4441
4442
  addProseMirrorPlugins() {
4442
4443
  let e = null, t = !1;
4443
4444
  return [
4444
- new x({
4445
- key: new L("uniqueID"),
4445
+ new v({
4446
+ key: new B("uniqueID"),
4446
4447
  appendTransaction: (i, o, n) => {
4447
4448
  const r = i.some((f) => f.docChanged) && !o.doc.eq(n.doc), a = this.options.filterTransaction && i.some((f) => {
4448
- let g, k;
4449
- return !(!((k = (g = this.options).filterTransaction) === null || k === void 0) && k.call(g, f));
4449
+ let g, _;
4450
+ return !(!((_ = (g = this.options).filterTransaction) === null || _ === void 0) && _.call(g, f));
4450
4451
  });
4451
4452
  if (!r || a)
4452
4453
  return;
@@ -4459,32 +4460,32 @@ const oe = I.create({
4459
4460
  n.doc,
4460
4461
  f,
4461
4462
  (b) => l.includes(b.type.name)
4462
- ), k = g.map(({ node: b }) => b.attrs[d]).filter((b) => b !== null), v = Ti(k);
4463
- g.forEach(({ node: b, pos: y }) => {
4464
- let S;
4465
- const Ue = (S = s.doc.nodeAt(y)) === null || S === void 0 ? void 0 : S.attrs[d];
4466
- if (Ue === null) {
4467
- const De = o.doc.type.createAndFill().content;
4468
- if (o.doc.content.findDiffStart(De) === null) {
4469
- const je = JSON.parse(
4463
+ ), _ = g.map(({ node: b }) => b.attrs[d]).filter((b) => b !== null), x = Bi(_);
4464
+ g.forEach(({ node: b, pos: w }) => {
4465
+ let L;
4466
+ const He = (L = s.doc.nodeAt(w)) === null || L === void 0 ? void 0 : L.attrs[d];
4467
+ if (He === null) {
4468
+ const Ue = o.doc.type.createAndFill().content;
4469
+ if (o.doc.content.findDiffStart(Ue) === null) {
4470
+ const De = JSON.parse(
4470
4471
  JSON.stringify(n.doc.toJSON())
4471
4472
  );
4472
- if (je.content[0].content[0].attrs.id = "initialBlockId", JSON.stringify(je.content) === JSON.stringify(De.toJSON())) {
4473
- s.setNodeMarkup(y, void 0, {
4473
+ if (De.content[0].content[0].attrs.id = "initialBlockId", JSON.stringify(De.content) === JSON.stringify(Ue.toJSON())) {
4474
+ s.setNodeMarkup(w, void 0, {
4474
4475
  ...b.attrs,
4475
4476
  [d]: "initialBlockId"
4476
4477
  });
4477
4478
  return;
4478
4479
  }
4479
4480
  }
4480
- s.setNodeMarkup(y, void 0, {
4481
+ s.setNodeMarkup(w, void 0, {
4481
4482
  ...b.attrs,
4482
4483
  [d]: u()
4483
4484
  });
4484
4485
  return;
4485
4486
  }
4486
- const { deleted: Bt } = h.invert().mapResult(y);
4487
- Bt && v.includes(Ue) && s.setNodeMarkup(y, void 0, {
4487
+ const { deleted: Bt } = h.invert().mapResult(w);
4488
+ Bt && x.includes(He) && s.setNodeMarkup(w, void 0, {
4488
4489
  ...b.attrs,
4489
4490
  [d]: u()
4490
4491
  });
@@ -4542,7 +4543,7 @@ const oe = I.create({
4542
4543
  l.marks
4543
4544
  );
4544
4545
  s.push(d);
4545
- }), N.from(s);
4546
+ }), I.from(s);
4546
4547
  };
4547
4548
  return t = !1, new z(
4548
4549
  r(i.content),
@@ -4565,7 +4566,7 @@ function it(e) {
4565
4566
  numChildBlocks: n
4566
4567
  };
4567
4568
  }
4568
- function _(e, t) {
4569
+ function k(e, t) {
4569
4570
  const o = e.nodeSize - 2;
4570
4571
  if (t <= 1)
4571
4572
  for (t = 2; e.resolve(t).parent.type.name !== "blockContainer" && t < o; )
@@ -4597,13 +4598,13 @@ function _(e, t) {
4597
4598
  depth: s
4598
4599
  };
4599
4600
  }
4600
- function Ve(e) {
4601
+ function Re(e) {
4601
4602
  return e.type === "link";
4602
4603
  }
4603
4604
  function ot(e) {
4604
4605
  return typeof e != "string" && e.type === "link";
4605
4606
  }
4606
- function te(e) {
4607
+ function ie(e) {
4607
4608
  return typeof e != "string" && e.type === "text";
4608
4609
  }
4609
4610
  class P extends Error {
@@ -4611,12 +4612,12 @@ class P extends Error {
4611
4612
  super(`Unreachable case: ${t}`);
4612
4613
  }
4613
4614
  }
4614
- function Br(e, t = !0) {
4615
+ function Ar(e, t = !0) {
4615
4616
  const { "data-test": i, ...o } = e;
4616
4617
  if (Object.keys(o).length > 0 && t)
4617
4618
  throw new Error("Object must be empty " + JSON.stringify(e));
4618
4619
  }
4619
- function Oe(e, t, i) {
4620
+ function Ve(e, t, i) {
4620
4621
  const o = [];
4621
4622
  for (const [n, r] of Object.entries(e.styles)) {
4622
4623
  const a = i[n];
@@ -4632,11 +4633,11 @@ function Oe(e, t, i) {
4632
4633
  return e.text.split(/(\n)/g).filter((n) => n.length > 0).map((n) => n === `
4633
4634
  ` ? t.nodes.hardBreak.create() : t.text(n, o));
4634
4635
  }
4635
- function Bi(e, t, i) {
4636
+ function Li(e, t, i) {
4636
4637
  const o = t.marks.link.create({
4637
4638
  href: e.href
4638
4639
  });
4639
- return Ee(e.content, t, i).map(
4640
+ return Ce(e.content, t, i).map(
4640
4641
  (n) => {
4641
4642
  if (n.type.name === "text")
4642
4643
  return n.mark([...n.marks, o]);
@@ -4646,24 +4647,24 @@ function Bi(e, t, i) {
4646
4647
  }
4647
4648
  );
4648
4649
  }
4649
- function Ee(e, t, i) {
4650
+ function Ce(e, t, i) {
4650
4651
  const o = [];
4651
4652
  if (typeof e == "string")
4652
4653
  return o.push(
4653
- ...Oe(
4654
+ ...Ve(
4654
4655
  { type: "text", text: e, styles: {} },
4655
4656
  t,
4656
4657
  i
4657
4658
  )
4658
4659
  ), o;
4659
4660
  for (const n of e)
4660
- o.push(...Oe(n, t, i));
4661
+ o.push(...Ve(n, t, i));
4661
4662
  return o;
4662
4663
  }
4663
- function R(e, t, i) {
4664
+ function V(e, t, i) {
4664
4665
  const o = [];
4665
4666
  for (const n of e)
4666
- typeof n == "string" ? o.push(...Ee(n, t, i)) : ot(n) ? o.push(...Bi(n, t, i)) : te(n) ? o.push(...Ee([n], t, i)) : o.push(
4667
+ typeof n == "string" ? o.push(...Ce(n, t, i)) : ot(n) ? o.push(...Li(n, t, i)) : ie(n) ? o.push(...Ce([n], t, i)) : o.push(
4667
4668
  rt(n, t, i)
4668
4669
  );
4669
4670
  return o;
@@ -4679,7 +4680,7 @@ function nt(e, t, i) {
4679
4680
  else if (typeof s == "string")
4680
4681
  l = t.nodes.tableParagraph.create({}, t.text(s));
4681
4682
  else {
4682
- const u = R(s, t, i);
4683
+ const u = V(s, t, i);
4683
4684
  l = t.nodes.tableParagraph.create({}, u);
4684
4685
  }
4685
4686
  const d = t.nodes.tableCell.create({}, l);
@@ -4697,10 +4698,10 @@ function rt(e, t, i) {
4697
4698
  if (!e.content)
4698
4699
  o = t.nodes[n].create(e.props);
4699
4700
  else if (typeof e.content == "string") {
4700
- const r = R([e.content], t, i);
4701
+ const r = V([e.content], t, i);
4701
4702
  o = t.nodes[n].create(e.props, r);
4702
4703
  } else if (Array.isArray(e.content)) {
4703
- const r = R(e.content, t, i);
4704
+ const r = V(e.content, t, i);
4704
4705
  o = t.nodes[n].create(e.props, r);
4705
4706
  } else if (e.content.type === "tableContent") {
4706
4707
  const r = nt(e.content, t, i);
@@ -4711,7 +4712,7 @@ function rt(e, t, i) {
4711
4712
  }
4712
4713
  function U(e, t, i) {
4713
4714
  let o = e.id;
4714
- o === void 0 && (o = oe.options.generateID());
4715
+ o === void 0 && (o = ne.options.generateID());
4715
4716
  const n = rt(
4716
4717
  e,
4717
4718
  t,
@@ -4729,7 +4730,7 @@ function U(e, t, i) {
4729
4730
  r.length > 0 ? [n, a] : n
4730
4731
  );
4731
4732
  }
4732
- function Li(e, t, i) {
4733
+ function Ii(e, t, i) {
4733
4734
  const o = {
4734
4735
  type: "tableContent",
4735
4736
  rows: []
@@ -4755,10 +4756,10 @@ function Te(e, t, i) {
4755
4756
  return e.content.forEach((r) => {
4756
4757
  if (r.type.name === "hardBreak") {
4757
4758
  if (n)
4758
- if (te(n))
4759
+ if (ie(n))
4759
4760
  n.text += `
4760
4761
  `;
4761
- else if (Ve(n))
4762
+ else if (Re(n))
4762
4763
  n.content[n.content.length - 1].text += `
4763
4764
  `;
4764
4765
  else
@@ -4774,7 +4775,7 @@ function Te(e, t, i) {
4774
4775
  }
4775
4776
  if (r.type.name !== "link" && r.type.name !== "text" && t[r.type.name]) {
4776
4777
  n && (o.push(n), n = void 0), o.push(
4777
- Ce(r, t, i)
4778
+ Se(r, t, i)
4778
4779
  );
4779
4780
  return;
4780
4781
  }
@@ -4794,7 +4795,7 @@ function Te(e, t, i) {
4794
4795
  else
4795
4796
  throw new P(d.propSchema);
4796
4797
  }
4797
- n ? te(n) ? s ? (o.push(n), n = {
4798
+ n ? ie(n) ? s ? (o.push(n), n = {
4798
4799
  type: "link",
4799
4800
  href: s.attrs.href,
4800
4801
  content: [
@@ -4808,7 +4809,7 @@ function Te(e, t, i) {
4808
4809
  type: "text",
4809
4810
  text: r.textContent,
4810
4811
  styles: a
4811
- }) : Ve(n) && (s ? n.href === s.attrs.href ? JSON.stringify(
4812
+ }) : Re(n) && (s ? n.href === s.attrs.href ? JSON.stringify(
4812
4813
  n.content[n.content.length - 1].styles
4813
4814
  ) === JSON.stringify(a) ? n.content[n.content.length - 1].text += r.textContent : n.content.push({
4814
4815
  type: "text",
@@ -4845,7 +4846,7 @@ function Te(e, t, i) {
4845
4846
  };
4846
4847
  }), n && o.push(n), o;
4847
4848
  }
4848
- function Ce(e, t, i) {
4849
+ function Se(e, t, i) {
4849
4850
  if (e.type.name === "text" || e.type.name === "link")
4850
4851
  throw new Error("unexpected");
4851
4852
  const o = {}, n = t[e.type.name];
@@ -4876,7 +4877,7 @@ function C(e, t, i, o, n) {
4876
4877
  return r;
4877
4878
  const a = it(e);
4878
4879
  let s = a.id;
4879
- s === null && (s = oe.options.generateID());
4880
+ s === null && (s = ne.options.generateID());
4880
4881
  const l = {};
4881
4882
  for (const [m, f] of Object.entries({
4882
4883
  ...e.attrs,
@@ -4887,8 +4888,8 @@ function C(e, t, i, o, n) {
4887
4888
  throw Error(
4888
4889
  "Block is of an unrecognized type: " + a.contentType.name
4889
4890
  );
4890
- const k = g.propSchema;
4891
- m in k && (l[m] = f);
4891
+ const _ = g.propSchema;
4892
+ m in _ && (l[m] = f);
4892
4893
  }
4893
4894
  const d = t[a.contentType.name], u = [];
4894
4895
  for (let m = 0; m < a.numChildBlocks; m++)
@@ -4909,7 +4910,7 @@ function C(e, t, i, o, n) {
4909
4910
  o
4910
4911
  );
4911
4912
  else if (d.content === "table")
4912
- p = Li(
4913
+ p = Ii(
4913
4914
  a.contentNode,
4914
4915
  i,
4915
4916
  o
@@ -4927,14 +4928,14 @@ function C(e, t, i, o, n) {
4927
4928
  };
4928
4929
  return n == null || n.set(e, h), h;
4929
4930
  }
4930
- function Ii(e) {
4931
+ function Ai(e) {
4931
4932
  return e.document || window.document;
4932
4933
  }
4933
4934
  const at = (e, t, i, o, n) => {
4934
4935
  if (!i.nodes[e.type.name])
4935
4936
  throw new Error("Serializer is missing a node type: " + e.type.name);
4936
- const { dom: r, contentDOM: a } = Se.renderSpec(
4937
- Ii(t),
4937
+ const { dom: r, contentDOM: a } = R.renderSpec(
4938
+ Ai(t),
4938
4939
  i.nodes[e.type.name](e)
4939
4940
  );
4940
4941
  if (a) {
@@ -4965,7 +4966,7 @@ const at = (e, t, i, o, n) => {
4965
4966
  a.appendChild(p.dom);
4966
4967
  }
4967
4968
  l !== void 0 && i.serializeFragment(
4968
- N.from(l),
4969
+ I.from(l),
4969
4970
  t,
4970
4971
  a
4971
4972
  );
@@ -4977,7 +4978,7 @@ const at = (e, t, i, o, n) => {
4977
4978
  const o = t.serializeFragment(e, i), n = document.createElement("div");
4978
4979
  return n.appendChild(o), n.innerHTML;
4979
4980
  };
4980
- function Fe(e, t) {
4981
+ function Oe(e, t) {
4981
4982
  var o;
4982
4983
  const i = (((o = e.properties) == null ? void 0 : o.className) || []).filter(
4983
4984
  (n) => !n.startsWith("bn-")
@@ -4988,7 +4989,7 @@ function Fe(e, t) {
4988
4989
  className: i.length > 0 ? i : void 0
4989
4990
  };
4990
4991
  }
4991
- function Ai(e) {
4992
+ function Ni(e) {
4992
4993
  const t = H;
4993
4994
  if (!t)
4994
4995
  throw new Error(
@@ -5006,11 +5007,11 @@ function Ai(e) {
5006
5007
  let r = n.children.length, a;
5007
5008
  for (let l = 0; l < r; l++) {
5008
5009
  const u = n.children[l].children[0], p = u.children.find((b) => {
5009
- const y = b.properties, S = y == null ? void 0 : y.className;
5010
- return S == null ? void 0 : S.includes("bn-block-content");
5010
+ const w = b.properties, L = w == null ? void 0 : w.className;
5011
+ return L == null ? void 0 : L.includes("bn-block-content");
5011
5012
  }), h = u.children.find((b) => {
5012
- const y = b.properties, S = y == null ? void 0 : y.className;
5013
- return S == null ? void 0 : S.includes("bn-block-group");
5013
+ const w = b.properties, L = w == null ? void 0 : w.className;
5014
+ return L == null ? void 0 : L.includes("bn-block-group");
5014
5015
  }), m = Object.fromEntries(
5015
5016
  Object.entries(u.properties || {}).filter(
5016
5017
  ([b]) => b.startsWith("data") && b !== "dataId" && b !== "dataNodeType"
@@ -5027,12 +5028,12 @@ function Ai(e) {
5027
5028
  n.children.splice(l, 1, ...h.children), o(n);
5028
5029
  return;
5029
5030
  }
5030
- const k = i.has(
5031
+ const _ = i.has(
5031
5032
  p.properties.dataContentType
5032
- ), v = k ? e.orderedListItemBlockTypes.has(
5033
+ ), x = _ ? e.orderedListItemBlockTypes.has(
5033
5034
  p.properties.dataContentType
5034
5035
  ) ? "ol" : "ul" : null;
5035
- if (h && o(h), a && a.tagName !== v) {
5036
+ if (h && o(h), a && a.tagName !== x) {
5036
5037
  n.children.splice(
5037
5038
  l - a.children.length,
5038
5039
  a.children.length,
@@ -5041,9 +5042,9 @@ function Ai(e) {
5041
5042
  const b = a.children.length - 1;
5042
5043
  l -= b, r -= b, a = void 0;
5043
5044
  }
5044
- if (k) {
5045
+ if (_) {
5045
5046
  a || (a = t.hastUtilFromDom.fromDom(
5046
- document.createElement(v)
5047
+ document.createElement(x)
5047
5048
  ));
5048
5049
  const b = t.hastUtilFromDom.fromDom(
5049
5050
  document.createElement("li")
@@ -5052,12 +5053,12 @@ function Ai(e) {
5052
5053
  } else if (h) {
5053
5054
  n.children.splice(l + 1, 0, ...h.children);
5054
5055
  const b = p.children[0];
5055
- Fe(b, g), n.children[l] = b;
5056
- const y = h.children.length;
5057
- l += y, r += y;
5056
+ Oe(b, g), n.children[l] = b;
5057
+ const w = h.children.length;
5058
+ l += w, r += w;
5058
5059
  } else {
5059
5060
  const b = p.children[0];
5060
- Fe(b, g), n.children[l] = b;
5061
+ Oe(b, g), n.children[l] = b;
5061
5062
  }
5062
5063
  }
5063
5064
  a && n.children.splice(
@@ -5068,63 +5069,72 @@ function Ai(e) {
5068
5069
  };
5069
5070
  return o;
5070
5071
  }
5071
- const ue = (e, t) => {
5072
+ const he = (e, t) => {
5072
5073
  const i = H;
5073
5074
  if (!i)
5074
5075
  throw new Error(
5075
5076
  "External HTML exporter requires ESM dependencies to be initialized"
5076
5077
  );
5077
- const o = Se.fromSchema(e);
5078
- return o.serializeNodeInner = (n, r) => at(n, r, o, t, !0), o.exportProseMirrorFragment = (n, r) => i.unified.unified().use(i.rehypeParse.default, { fragment: !0 }).use(Ai, {
5079
- orderedListItemBlockTypes: /* @__PURE__ */ new Set(["numberedListItem"]),
5080
- unorderedListItemBlockTypes: /* @__PURE__ */ new Set([
5081
- "bulletListItem",
5082
- "checkListItem"
5083
- ])
5084
- }).use(i.rehypeStringify.default).processSync(st(n, o, r)).value, o.exportBlocks = (n, r) => {
5078
+ const o = new R(
5079
+ R.nodesFromSchema(e),
5080
+ R.marksFromSchema(e)
5081
+ );
5082
+ return o.serializeNodeInner = (n, r) => at(n, r, o, t, !0), o.exportProseMirrorFragment = (n, r) => {
5083
+ let a = i.unified.unified().use(i.rehypeParse.default, { fragment: !0 });
5084
+ return r.simplifyBlocks !== !1 && (a = a.use(Ni, {
5085
+ orderedListItemBlockTypes: /* @__PURE__ */ new Set(["numberedListItem"]),
5086
+ unorderedListItemBlockTypes: /* @__PURE__ */ new Set([
5087
+ "bulletListItem",
5088
+ "checkListItem"
5089
+ ])
5090
+ })), a = a.use(i.rehypeStringify.default).processSync(st(n, o, r)), a.value;
5091
+ }, o.exportBlocks = (n, r) => {
5085
5092
  const a = n.map(
5086
5093
  (l) => U(l, e, t.schema.styleSchema)
5087
5094
  ), s = e.nodes.blockGroup.create(null, a);
5088
5095
  return o.exportProseMirrorFragment(
5089
- N.from(s),
5096
+ I.from(s),
5090
5097
  r
5091
5098
  );
5092
5099
  }, o;
5093
- }, Be = (e, t) => {
5094
- const i = Se.fromSchema(e);
5100
+ }, Pi = (e, t) => {
5101
+ const i = new R(
5102
+ R.nodesFromSchema(e),
5103
+ R.marksFromSchema(e)
5104
+ );
5095
5105
  return i.serializeNodeInner = (o, n) => at(o, n, i, t, !1), i.serializeProseMirrorFragment = (o, n) => st(o, i, n), i.serializeBlocks = (o, n) => {
5096
5106
  const r = o.map(
5097
5107
  (s) => U(s, e, t.schema.styleSchema)
5098
5108
  ), a = e.nodes.blockGroup.create(null, r);
5099
5109
  return i.serializeProseMirrorFragment(
5100
- N.from(a),
5110
+ I.from(a),
5101
5111
  n
5102
5112
  );
5103
5113
  }, i;
5104
- }, B = (e) => {
5105
- const { contentType: t } = _(
5114
+ }, T = (e) => {
5115
+ const { contentType: t } = k(
5106
5116
  e.state.doc,
5107
5117
  e.state.selection.from
5108
5118
  );
5109
5119
  return t.spec.content;
5110
- }, Ni = () => typeof navigator < "u" && (/Mac/.test(navigator.platform) || /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent));
5120
+ }, Hi = () => typeof navigator < "u" && (/Mac/.test(navigator.platform) || /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent));
5111
5121
  function D(e, t = "Ctrl") {
5112
- return Ni() ? e.replace("Mod", "⌘") : e.replace("Mod", t);
5122
+ return Hi() ? e.replace("Mod", "⌘") : e.replace("Mod", t);
5113
5123
  }
5114
- function V(...e) {
5124
+ function O(...e) {
5115
5125
  return e.filter((t) => t).join(" ");
5116
5126
  }
5117
- const Lr = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
5118
- function O(e, t, i, o) {
5127
+ const Nr = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
5128
+ function F(e, t, i, o) {
5119
5129
  const n = document.createElement("div");
5120
- n.className = V(
5130
+ n.className = O(
5121
5131
  "bn-block-content",
5122
5132
  i.class
5123
5133
  ), n.setAttribute("data-content-type", e);
5124
5134
  for (const [a, s] of Object.entries(i))
5125
5135
  a !== "class" && n.setAttribute(a, s);
5126
5136
  const r = document.createElement(t);
5127
- r.className = V(
5137
+ r.className = O(
5128
5138
  "bn-inline-content",
5129
5139
  o.class
5130
5140
  );
@@ -5137,7 +5147,7 @@ function O(e, t, i, o) {
5137
5147
  contentDOM: r
5138
5148
  };
5139
5149
  }
5140
- const Ge = (e, t) => {
5150
+ const Fe = (e, t) => {
5141
5151
  const i = U(e, t.pmSchema, t.schema.styleSchema).firstChild, o = t.pmSchema.nodes[i.type.name].spec.toDOM;
5142
5152
  if (o === void 0)
5143
5153
  throw new Error(
@@ -5149,7 +5159,7 @@ const Ge = (e, t) => {
5149
5159
  "Cannot use this block's default HTML serialization as its corresponding TipTap node's `renderHTML` function does not return an object with the `dom` property."
5150
5160
  );
5151
5161
  return n;
5152
- }, w = {
5162
+ }, y = {
5153
5163
  backgroundColor: {
5154
5164
  default: "default"
5155
5165
  },
@@ -5161,10 +5171,10 @@ const Ge = (e, t) => {
5161
5171
  values: ["left", "center", "right", "justify"]
5162
5172
  }
5163
5173
  }, lt = ["backgroundColor", "textColor"];
5164
- function se(e) {
5174
+ function de(e) {
5165
5175
  return "data-" + e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
5166
5176
  }
5167
- function Ir(e) {
5177
+ function Pr(e) {
5168
5178
  const t = e.split("/");
5169
5179
  return !t.length || // invalid?
5170
5180
  t[t.length - 1] === "" ? e : t[t.length - 1];
@@ -5179,7 +5189,7 @@ function dt(e) {
5179
5189
  // value is the same as its default, we don't display an HTML
5180
5190
  // attribute for it.
5181
5191
  parseHTML: (n) => {
5182
- const r = n.getAttribute(se(i));
5192
+ const r = n.getAttribute(de(i));
5183
5193
  if (r === null)
5184
5194
  return null;
5185
5195
  if (typeof o.default == "boolean")
@@ -5191,12 +5201,12 @@ function dt(e) {
5191
5201
  return r;
5192
5202
  },
5193
5203
  renderHTML: (n) => n[i] !== o.default ? {
5194
- [se(i)]: n[i]
5204
+ [de(i)]: n[i]
5195
5205
  } : {}
5196
5206
  };
5197
5207
  }), t;
5198
5208
  }
5199
- function Pi(e, t, i, o) {
5209
+ function Ui(e, t, i, o) {
5200
5210
  if (typeof e == "boolean")
5201
5211
  throw new Error(
5202
5212
  "Cannot find node position as getPos is a boolean, not a function."
@@ -5209,18 +5219,18 @@ function Pi(e, t, i, o) {
5209
5219
  throw new Error("Block type does not match");
5210
5220
  return s;
5211
5221
  }
5212
- function _e(e, t, i, o, n = !1, r) {
5222
+ function ae(e, t, i, o, n = !1, r) {
5213
5223
  const a = document.createElement("div");
5214
5224
  if (r !== void 0)
5215
5225
  for (const [s, l] of Object.entries(r))
5216
5226
  s !== "class" && a.setAttribute(s, l);
5217
- a.className = V(
5227
+ a.className = O(
5218
5228
  "bn-block-content",
5219
5229
  (r == null ? void 0 : r.class) || ""
5220
5230
  ), a.setAttribute("data-content-type", t);
5221
5231
  for (const [s, l] of Object.entries(i))
5222
- !lt.includes(s) && l !== o[s].default && a.setAttribute(se(s), l);
5223
- return n && a.setAttribute("data-file-block", ""), a.appendChild(e.dom), e.contentDOM !== void 0 && (e.contentDOM.className = V(
5232
+ !lt.includes(s) && l !== o[s].default && a.setAttribute(de(s), l);
5233
+ return n && a.setAttribute("data-file-block", ""), a.appendChild(e.dom), e.contentDOM !== void 0 && (e.contentDOM.className = O(
5224
5234
  "bn-inline-content",
5225
5235
  e.contentDOM.className
5226
5236
  ), e.contentDOM.setAttribute("data-editable", "")), {
@@ -5228,8 +5238,8 @@ function _e(e, t, i, o, n = !1, r) {
5228
5238
  dom: a
5229
5239
  };
5230
5240
  }
5231
- function F(e) {
5232
- return q.create(e);
5241
+ function G(e) {
5242
+ return X.create(e);
5233
5243
  }
5234
5244
  function ct(e, t) {
5235
5245
  return {
@@ -5237,7 +5247,7 @@ function ct(e, t) {
5237
5247
  implementation: t
5238
5248
  };
5239
5249
  }
5240
- function X(e, t, i) {
5250
+ function Z(e, t, i) {
5241
5251
  return ct(
5242
5252
  {
5243
5253
  type: e.name,
@@ -5247,8 +5257,8 @@ function X(e, t, i) {
5247
5257
  {
5248
5258
  node: e,
5249
5259
  requiredExtensions: i,
5250
- toInternalHTML: Ge,
5251
- toExternalHTML: Ge
5260
+ toInternalHTML: Fe,
5261
+ toExternalHTML: Fe
5252
5262
  // parse: () => undefined, // parse rules are in node already
5253
5263
  }
5254
5264
  );
@@ -5258,12 +5268,12 @@ function ut(e) {
5258
5268
  Object.entries(e).map(([t, i]) => [t, i.config])
5259
5269
  );
5260
5270
  }
5261
- function Hi(e, t) {
5271
+ function Di(e, t) {
5262
5272
  e.stopEvent = (i) => (i.type === "mousedown" && setTimeout(() => {
5263
5273
  t.view.dom.blur();
5264
5274
  }, 10), !0);
5265
5275
  }
5266
- function Ui(e, t) {
5276
+ function ji(e, t) {
5267
5277
  const i = [
5268
5278
  {
5269
5279
  tag: "[data-content-type=" + e.type + "]",
@@ -5280,8 +5290,8 @@ function Ui(e, t) {
5280
5290
  }
5281
5291
  }), i;
5282
5292
  }
5283
- function pe(e, t) {
5284
- const i = F({
5293
+ function me(e, t) {
5294
+ const i = G({
5285
5295
  name: e.type,
5286
5296
  content: e.content === "inline" ? "inline*" : "",
5287
5297
  group: "blockContent",
@@ -5290,30 +5300,37 @@ function pe(e, t) {
5290
5300
  return dt(e.propSchema);
5291
5301
  },
5292
5302
  parseHTML() {
5293
- return Ui(e, t.parse);
5303
+ return ji(e, t.parse);
5294
5304
  },
5295
- renderHTML() {
5296
- const o = document.createElement("div");
5297
- return o.setAttribute("data-tmp-placeholder", "true"), {
5298
- dom: o
5299
- };
5305
+ renderHTML({ HTMLAttributes: o }) {
5306
+ const n = document.createElement("div");
5307
+ return n.setAttribute("data-tmp-placeholder", "true"), ae(
5308
+ {
5309
+ dom: n
5310
+ },
5311
+ e.type,
5312
+ {},
5313
+ e.propSchema,
5314
+ e.isFileBlock,
5315
+ o
5316
+ );
5300
5317
  },
5301
5318
  addNodeView() {
5302
5319
  return ({ getPos: o }) => {
5303
5320
  var d;
5304
- const n = this.options.editor, r = Pi(
5321
+ const n = this.options.editor, r = Ui(
5305
5322
  o,
5306
5323
  n,
5307
5324
  this.editor,
5308
5325
  e.type
5309
- ), a = ((d = this.options.domAttributes) == null ? void 0 : d.blockContent) || {}, s = t.render(r, n), l = _e(
5326
+ ), a = ((d = this.options.domAttributes) == null ? void 0 : d.blockContent) || {}, s = t.render(r, n), l = ae(
5310
5327
  s,
5311
5328
  r.type,
5312
5329
  r.props,
5313
5330
  e.propSchema,
5314
5331
  a
5315
5332
  );
5316
- return e.isSelectable === !1 && Hi(l, this.editor), l;
5333
+ return e.isSelectable === !1 && Di(l, this.editor), l;
5317
5334
  };
5318
5335
  }
5319
5336
  });
@@ -5326,7 +5343,7 @@ function pe(e, t) {
5326
5343
  toInternalHTML: (o, n) => {
5327
5344
  var s;
5328
5345
  const r = ((s = i.options.domAttributes) == null ? void 0 : s.blockContent) || {}, a = t.render(o, n);
5329
- return _e(
5346
+ return ae(
5330
5347
  a,
5331
5348
  o.type,
5332
5349
  o.props,
@@ -5343,7 +5360,7 @@ function pe(e, t) {
5343
5360
  o,
5344
5361
  n
5345
5362
  );
5346
- return a === void 0 && (a = t.render(o, n)), _e(
5363
+ return a === void 0 && (a = t.render(o, n)), ae(
5347
5364
  a,
5348
5365
  o.type,
5349
5366
  o.props,
@@ -5353,10 +5370,10 @@ function pe(e, t) {
5353
5370
  }
5354
5371
  });
5355
5372
  }
5356
- function We(e, t, i, o) {
5357
- return e.dom.setAttribute("data-inline-content-type", t), Object.entries(i).filter(([n, r]) => r !== o[n].default).map(([n, r]) => [se(n), r]).forEach(([n, r]) => e.dom.setAttribute(n, r)), e.contentDOM !== void 0 && e.contentDOM.setAttribute("data-editable", ""), e;
5373
+ function Ge(e, t, i, o) {
5374
+ return e.dom.setAttribute("data-inline-content-type", t), Object.entries(i).filter(([n, r]) => r !== o[n].default).map(([n, r]) => [de(n), r]).forEach(([n, r]) => e.dom.setAttribute(n, r)), e.contentDOM !== void 0 && e.contentDOM.setAttribute("data-editable", ""), e;
5358
5375
  }
5359
- function Di(e) {
5376
+ function zi(e) {
5360
5377
  return {
5361
5378
  Backspace: ({ editor: t }) => {
5362
5379
  const i = t.state.selection.$from;
@@ -5364,14 +5381,14 @@ function Di(e) {
5364
5381
  }
5365
5382
  };
5366
5383
  }
5367
- function ji(e, t) {
5384
+ function Ri(e, t) {
5368
5385
  return {
5369
5386
  config: e,
5370
5387
  implementation: t
5371
5388
  };
5372
5389
  }
5373
- function zi(e, t) {
5374
- return ji(
5390
+ function Vi(e, t) {
5391
+ return Ri(
5375
5392
  {
5376
5393
  type: e.name,
5377
5394
  propSchema: t,
@@ -5387,7 +5404,7 @@ function pt(e) {
5387
5404
  Object.entries(e).map(([t, i]) => [t, i.config])
5388
5405
  );
5389
5406
  }
5390
- function Ri(e) {
5407
+ function Oi(e) {
5391
5408
  return [
5392
5409
  {
5393
5410
  tag: `[data-inline-content-type="${e.type}"]`,
@@ -5398,8 +5415,8 @@ function Ri(e) {
5398
5415
  }
5399
5416
  ];
5400
5417
  }
5401
- function Ar(e, t) {
5402
- const i = q.create({
5418
+ function Hr(e, t) {
5419
+ const i = X.create({
5403
5420
  name: e.type,
5404
5421
  inline: !0,
5405
5422
  group: "inline",
@@ -5410,14 +5427,14 @@ function Ar(e, t) {
5410
5427
  return dt(e.propSchema);
5411
5428
  },
5412
5429
  addKeyboardShortcuts() {
5413
- return Di(e);
5430
+ return zi(e);
5414
5431
  },
5415
5432
  parseHTML() {
5416
- return Ri(e);
5433
+ return Oi(e);
5417
5434
  },
5418
5435
  renderHTML({ node: o }) {
5419
5436
  const n = this.options.editor, r = t.render(
5420
- Ce(
5437
+ Se(
5421
5438
  o,
5422
5439
  n.schema.inlineContentSchema,
5423
5440
  n.schema.styleSchema
@@ -5427,7 +5444,7 @@ function Ar(e, t) {
5427
5444
  },
5428
5445
  n
5429
5446
  );
5430
- return We(
5447
+ return Ge(
5431
5448
  r,
5432
5449
  e.type,
5433
5450
  o.attrs,
@@ -5437,7 +5454,7 @@ function Ar(e, t) {
5437
5454
  addNodeView() {
5438
5455
  return ({ node: o, getPos: n }) => {
5439
5456
  const r = this.options.editor, a = t.render(
5440
- Ce(
5457
+ Se(
5441
5458
  o,
5442
5459
  r.schema.inlineContentSchema,
5443
5460
  r.schema.styleSchema
@@ -5446,7 +5463,7 @@ function Ar(e, t) {
5446
5463
  (s) => {
5447
5464
  if (typeof n == "boolean")
5448
5465
  return;
5449
- const l = R(
5466
+ const l = V(
5450
5467
  [s],
5451
5468
  r._tiptapEditor.schema,
5452
5469
  r.schema.styleSchema
@@ -5461,7 +5478,7 @@ function Ar(e, t) {
5461
5478
  },
5462
5479
  r
5463
5480
  );
5464
- return We(
5481
+ return Ge(
5465
5482
  a,
5466
5483
  e.type,
5467
5484
  o.attrs,
@@ -5470,12 +5487,12 @@ function Ar(e, t) {
5470
5487
  };
5471
5488
  }
5472
5489
  });
5473
- return zi(
5490
+ return Vi(
5474
5491
  i,
5475
5492
  e.propSchema
5476
5493
  );
5477
5494
  }
5478
- function Vi(e) {
5495
+ function Fi(e) {
5479
5496
  return e === "boolean" ? {} : {
5480
5497
  stringValue: {
5481
5498
  default: void 0,
@@ -5487,7 +5504,7 @@ function Vi(e) {
5487
5504
  }
5488
5505
  };
5489
5506
  }
5490
- function Oi(e, t, i, o) {
5507
+ function Gi(e, t, i, o) {
5491
5508
  return e.dom.setAttribute("data-style-type", t), o === "string" && e.dom.setAttribute("data-value", i), e.contentDOM !== void 0 && e.contentDOM.setAttribute("data-editable", ""), e;
5492
5509
  }
5493
5510
  function ht(e, t) {
@@ -5512,7 +5529,7 @@ function mt(e) {
5512
5529
  Object.entries(e).map(([t, i]) => [t, i.config])
5513
5530
  );
5514
5531
  }
5515
- function Fi(e) {
5532
+ function Wi(e) {
5516
5533
  return [
5517
5534
  {
5518
5535
  tag: `[data-style-type="${e.type}"]`,
@@ -5523,14 +5540,14 @@ function Fi(e) {
5523
5540
  }
5524
5541
  ];
5525
5542
  }
5526
- function Nr(e, t) {
5543
+ function Ur(e, t) {
5527
5544
  const i = Me.create({
5528
5545
  name: e.type,
5529
5546
  addAttributes() {
5530
- return Vi(e.propSchema);
5547
+ return Fi(e.propSchema);
5531
5548
  },
5532
5549
  parseHTML() {
5533
- return Fi(e);
5550
+ return Wi(e);
5534
5551
  },
5535
5552
  renderHTML({ mark: o }) {
5536
5553
  let n;
@@ -5540,7 +5557,7 @@ function Nr(e, t) {
5540
5557
  n = t.render(o.attrs.stringValue);
5541
5558
  else
5542
5559
  throw new P(e.propSchema);
5543
- return Oi(
5560
+ return Gi(
5544
5561
  n,
5545
5562
  e.type,
5546
5563
  o.attrs.stringValue,
@@ -5552,10 +5569,10 @@ function Nr(e, t) {
5552
5569
  mark: i
5553
5570
  });
5554
5571
  }
5555
- const he = (e, t, i, o, n) => {
5572
+ const fe = (e, t, i, o, n) => {
5556
5573
  const r = document.createElement("div");
5557
5574
  if (r.className = "bn-file-block-content-wrapper", e.props.url === "") {
5558
- const a = Gi(
5575
+ const a = Ki(
5559
5576
  e,
5560
5577
  t,
5561
5578
  o,
@@ -5579,7 +5596,7 @@ const he = (e, t, i, o, n) => {
5579
5596
  } else if (e.props.showPreview === !1) {
5580
5597
  const a = ft(e).dom;
5581
5598
  return {
5582
- dom: ne(e, a).dom
5599
+ dom: re(e, a).dom
5583
5600
  };
5584
5601
  } else
5585
5602
  return r.appendChild(i.dom), {
@@ -5595,14 +5612,14 @@ const he = (e, t, i, o, n) => {
5595
5612
  return o.className = "bn-file-default-preview-name", o.textContent = e.props.name || "", t.appendChild(i), t.appendChild(o), {
5596
5613
  dom: t
5597
5614
  };
5598
- }, ne = (e, t) => {
5615
+ }, re = (e, t) => {
5599
5616
  const i = document.createElement("div");
5600
5617
  i.className = "bn-file-and-caption-wrapper";
5601
5618
  const o = document.createElement("p");
5602
5619
  return o.className = "bn-file-caption", o.textContent = e.props.caption, i.appendChild(t), i.appendChild(o), {
5603
5620
  dom: i
5604
5621
  };
5605
- }, Gi = (e, t, i, o) => {
5622
+ }, Ki = (e, t, i, o) => {
5606
5623
  const n = document.createElement("div");
5607
5624
  n.className = "bn-add-file-button";
5608
5625
  const r = document.createElement("div");
@@ -5636,7 +5653,7 @@ const he = (e, t, i, o, n) => {
5636
5653
  );
5637
5654
  }
5638
5655
  };
5639
- }, Ke = (e) => ({ url: e.src || void 0 }), me = (e, t) => {
5656
+ }, We = (e) => ({ url: e.src || void 0 }), ge = (e, t) => {
5640
5657
  const i = e.querySelector(
5641
5658
  t
5642
5659
  );
@@ -5644,12 +5661,12 @@ const he = (e, t, i, o, n) => {
5644
5661
  return;
5645
5662
  const o = e.querySelector("figcaption"), n = (o == null ? void 0 : o.textContent) ?? void 0;
5646
5663
  return { targetElement: i, caption: n };
5647
- }, fe = (e, t) => {
5664
+ }, be = (e, t) => {
5648
5665
  const i = document.createElement("div"), o = document.createElement("p");
5649
5666
  return o.textContent = t, i.appendChild(e), i.appendChild(o), {
5650
5667
  dom: i
5651
5668
  };
5652
- }, Le = (e, t) => {
5669
+ }, Be = (e, t) => {
5653
5670
  const i = document.createElement("figure"), o = document.createElement("figcaption");
5654
5671
  return o.textContent = t, i.appendChild(e), i.appendChild(o), { dom: i };
5655
5672
  }, gt = (e, t, i, o, n) => {
@@ -5667,10 +5684,10 @@ const he = (e, t, i, o, n) => {
5667
5684
  !t.isEditable && r.contains(a) && r.contains(s) && (r.removeChild(a), r.removeChild(s));
5668
5685
  return;
5669
5686
  }
5670
- let k;
5671
- e.props.textAlignment === "center" ? l.handleUsed === "left" ? k = l.initialWidth + (l.initialClientX - g.clientX) * 2 : k = l.initialWidth + (g.clientX - l.initialClientX) * 2 : l.handleUsed === "left" ? k = l.initialWidth + l.initialClientX - g.clientX : k = l.initialWidth + g.clientX - l.initialClientX;
5672
- const v = 64;
5673
- k < v ? n(v) : k > t.domElement.firstElementChild.clientWidth ? n(t.domElement.firstElementChild.clientWidth) : n(k);
5687
+ let _;
5688
+ e.props.textAlignment === "center" ? l.handleUsed === "left" ? _ = l.initialWidth + (l.initialClientX - g.clientX) * 2 : _ = l.initialWidth + (g.clientX - l.initialClientX) * 2 : l.handleUsed === "left" ? _ = l.initialWidth + l.initialClientX - g.clientX : _ = l.initialWidth + g.clientX - l.initialClientX;
5689
+ const x = 64;
5690
+ _ < x ? n(x) : _ > t.domElement.firstElementChild.clientWidth ? n(t.domElement.firstElementChild.clientWidth) : n(_);
5674
5691
  }, u = (g) => {
5675
5692
  (!g.target || !r.contains(g.target) || !t.isEditable) && r.contains(a) && r.contains(s) && (r.removeChild(a), r.removeChild(s)), l && (l = void 0, t.updateBlock(e, {
5676
5693
  props: {
@@ -5712,8 +5729,8 @@ const he = (e, t, i, o, n) => {
5712
5729
  );
5713
5730
  }
5714
5731
  };
5715
- }, $e = (e) => ({ url: e.src || void 0 }), Wi = {
5716
- backgroundColor: w.backgroundColor,
5732
+ }, Ke = (e) => ({ url: e.src || void 0 }), $i = {
5733
+ backgroundColor: y.backgroundColor,
5717
5734
  // File name.
5718
5735
  name: {
5719
5736
  default: ""
@@ -5729,41 +5746,41 @@ const he = (e, t, i, o, n) => {
5729
5746
  showPreview: {
5730
5747
  default: !0
5731
5748
  }
5732
- }, Ki = {
5749
+ }, qi = {
5733
5750
  type: "audio",
5734
- propSchema: Wi,
5751
+ propSchema: $i,
5735
5752
  content: "none",
5736
5753
  isFileBlock: !0,
5737
5754
  fileBlockAccept: ["audio/*"]
5738
- }, $i = (e, t) => {
5755
+ }, Xi = (e, t) => {
5739
5756
  const i = document.createElement("div");
5740
5757
  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>';
5741
5758
  const o = document.createElement("audio");
5742
5759
  o.className = "bn-audio", t.resolveFileUrl(e.props.url).then((r) => {
5743
5760
  o.src = r;
5744
5761
  }), o.controls = !0, o.contentEditable = "false", o.draggable = !1;
5745
- const n = ne(e, o);
5746
- return he(
5762
+ const n = re(e, o);
5763
+ return fe(
5747
5764
  e,
5748
5765
  t,
5749
5766
  n,
5750
5767
  t.dictionary.file_blocks.audio.add_button_text,
5751
5768
  i.firstElementChild
5752
5769
  );
5753
- }, qi = (e) => {
5770
+ }, Zi = (e) => {
5754
5771
  if (e.tagName === "AUDIO")
5755
- return $e(e);
5772
+ return Ke(e);
5756
5773
  if (e.tagName === "FIGURE") {
5757
- const t = me(e, "audio");
5774
+ const t = ge(e, "audio");
5758
5775
  if (!t)
5759
5776
  return;
5760
5777
  const { targetElement: i, caption: o } = t;
5761
5778
  return {
5762
- ...$e(i),
5779
+ ...Ke(i),
5763
5780
  caption: o
5764
5781
  };
5765
5782
  }
5766
- }, Xi = (e) => {
5783
+ }, Ji = (e) => {
5767
5784
  if (!e.props.url) {
5768
5785
  const i = document.createElement("p");
5769
5786
  return i.textContent = "Add audio", {
@@ -5771,15 +5788,15 @@ const he = (e, t, i, o, n) => {
5771
5788
  };
5772
5789
  }
5773
5790
  let t;
5774
- 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 ? Le(t, e.props.caption) : fe(t, e.props.caption) : {
5791
+ 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 ? Be(t, e.props.caption) : be(t, e.props.caption) : {
5775
5792
  dom: t
5776
5793
  };
5777
- }, Zi = pe(Ki, {
5778
- render: $i,
5779
- parse: qi,
5780
- toExternalHTML: Xi
5781
- }), Ji = {
5782
- backgroundColor: w.backgroundColor,
5794
+ }, Yi = me(qi, {
5795
+ render: Xi,
5796
+ parse: Zi,
5797
+ toExternalHTML: Ji
5798
+ }), Qi = {
5799
+ backgroundColor: y.backgroundColor,
5783
5800
  // File name.
5784
5801
  name: {
5785
5802
  default: ""
@@ -5792,28 +5809,28 @@ const he = (e, t, i, o, n) => {
5792
5809
  caption: {
5793
5810
  default: ""
5794
5811
  }
5795
- }, Yi = {
5812
+ }, eo = {
5796
5813
  type: "file",
5797
- propSchema: Ji,
5814
+ propSchema: Qi,
5798
5815
  content: "none",
5799
5816
  isFileBlock: !0
5800
- }, Qi = (e, t) => {
5801
- const i = ft(e).dom, o = ne(e, i);
5802
- return he(e, t, o);
5803
- }, eo = (e) => {
5817
+ }, to = (e, t) => {
5818
+ const i = ft(e).dom, o = re(e, i);
5819
+ return fe(e, t, o);
5820
+ }, io = (e) => {
5804
5821
  if (e.tagName === "EMBED")
5805
- return Ke(e);
5822
+ return We(e);
5806
5823
  if (e.tagName === "FIGURE") {
5807
- const t = me(e, "embed");
5824
+ const t = ge(e, "embed");
5808
5825
  if (!t)
5809
5826
  return;
5810
5827
  const { targetElement: i, caption: o } = t;
5811
5828
  return {
5812
- ...Ke(i),
5829
+ ...We(i),
5813
5830
  caption: o
5814
5831
  };
5815
5832
  }
5816
- }, to = (e) => {
5833
+ }, oo = (e) => {
5817
5834
  if (!e.props.url) {
5818
5835
  const i = document.createElement("p");
5819
5836
  return i.textContent = "Add file", {
@@ -5821,14 +5838,14 @@ const he = (e, t, i, o, n) => {
5821
5838
  };
5822
5839
  }
5823
5840
  const t = document.createElement("a");
5824
- return t.href = e.props.url, t.textContent = e.props.name || e.props.url, e.props.caption ? fe(t, e.props.caption) : {
5841
+ return t.href = e.props.url, t.textContent = e.props.name || e.props.url, e.props.caption ? be(t, e.props.caption) : {
5825
5842
  dom: t
5826
5843
  };
5827
- }, io = pe(Yi, {
5828
- render: Qi,
5829
- parse: eo,
5830
- toExternalHTML: to
5831
- }), Pr = async (e) => {
5844
+ }, no = me(eo, {
5845
+ render: to,
5846
+ parse: io,
5847
+ toExternalHTML: oo
5848
+ }), Dr = async (e) => {
5832
5849
  const t = new FormData();
5833
5850
  return t.append("file", e), (await (await fetch("https://tmpfiles.org/api/v1/upload", {
5834
5851
  method: "POST",
@@ -5837,12 +5854,12 @@ const he = (e, t, i, o, n) => {
5837
5854
  "tmpfiles.org/",
5838
5855
  "tmpfiles.org/dl/"
5839
5856
  );
5840
- }, qe = (e) => {
5857
+ }, $e = (e) => {
5841
5858
  const t = e.src || void 0, i = e.width || void 0;
5842
5859
  return { url: t, previewWidth: i };
5843
- }, oo = {
5844
- textAlignment: w.textAlignment,
5845
- backgroundColor: w.backgroundColor,
5860
+ }, ro = {
5861
+ textAlignment: y.textAlignment,
5862
+ backgroundColor: y.backgroundColor,
5846
5863
  // File name.
5847
5864
  name: {
5848
5865
  default: ""
@@ -5862,13 +5879,13 @@ const he = (e, t, i, o, n) => {
5862
5879
  previewWidth: {
5863
5880
  default: 512
5864
5881
  }
5865
- }, no = {
5882
+ }, ao = {
5866
5883
  type: "image",
5867
- propSchema: oo,
5884
+ propSchema: ro,
5868
5885
  content: "none",
5869
5886
  isFileBlock: !0,
5870
5887
  fileBlockAccept: ["image/*"]
5871
- }, ro = (e, t) => {
5888
+ }, so = (e, t) => {
5872
5889
  const i = document.createElement("div");
5873
5890
  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>';
5874
5891
  const o = document.createElement("img");
@@ -5884,28 +5901,28 @@ const he = (e, t, i, o, n) => {
5884
5901
  o,
5885
5902
  () => o.width,
5886
5903
  (a) => o.width = a
5887
- ), r = ne(e, n.dom);
5888
- return he(
5904
+ ), r = re(e, n.dom);
5905
+ return fe(
5889
5906
  e,
5890
5907
  t,
5891
5908
  r,
5892
5909
  t.dictionary.file_blocks.image.add_button_text,
5893
5910
  i.firstElementChild
5894
5911
  );
5895
- }, ao = (e) => {
5912
+ }, lo = (e) => {
5896
5913
  if (e.tagName === "IMG")
5897
- return qe(e);
5914
+ return $e(e);
5898
5915
  if (e.tagName === "FIGURE") {
5899
- const t = me(e, "img");
5916
+ const t = ge(e, "img");
5900
5917
  if (!t)
5901
5918
  return;
5902
5919
  const { targetElement: i, caption: o } = t;
5903
5920
  return {
5904
- ...qe(i),
5921
+ ...$e(i),
5905
5922
  caption: o
5906
5923
  };
5907
5924
  }
5908
- }, so = (e) => {
5925
+ }, co = (e) => {
5909
5926
  if (!e.props.url) {
5910
5927
  const i = document.createElement("p");
5911
5928
  return i.textContent = "Add image", {
@@ -5913,19 +5930,19 @@ const he = (e, t, i, o, n) => {
5913
5930
  };
5914
5931
  }
5915
5932
  let t;
5916
- 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 ? Le(t, e.props.caption) : fe(t, e.props.caption) : {
5933
+ 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 ? Be(t, e.props.caption) : be(t, e.props.caption) : {
5917
5934
  dom: t
5918
5935
  };
5919
- }, lo = pe(no, {
5920
- render: ro,
5921
- parse: ao,
5922
- toExternalHTML: so
5923
- }), Xe = (e) => {
5936
+ }, uo = me(ao, {
5937
+ render: so,
5938
+ parse: lo,
5939
+ toExternalHTML: co
5940
+ }), qe = (e) => {
5924
5941
  const t = e.src || void 0, i = e.width || void 0;
5925
5942
  return { url: t, previewWidth: i };
5926
- }, co = {
5927
- textAlignment: w.textAlignment,
5928
- backgroundColor: w.backgroundColor,
5943
+ }, po = {
5944
+ textAlignment: y.textAlignment,
5945
+ backgroundColor: y.backgroundColor,
5929
5946
  // File name.
5930
5947
  name: {
5931
5948
  default: ""
@@ -5945,13 +5962,13 @@ const he = (e, t, i, o, n) => {
5945
5962
  previewWidth: {
5946
5963
  default: 512
5947
5964
  }
5948
- }, uo = {
5965
+ }, ho = {
5949
5966
  type: "video",
5950
- propSchema: co,
5967
+ propSchema: po,
5951
5968
  content: "none",
5952
5969
  isFileBlock: !0,
5953
5970
  fileBlockAccept: ["video/*"]
5954
- }, po = (e, t) => {
5971
+ }, mo = (e, t) => {
5955
5972
  const i = document.createElement("div");
5956
5973
  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>';
5957
5974
  const o = document.createElement("video");
@@ -5965,28 +5982,28 @@ const he = (e, t, i, o, n) => {
5965
5982
  o,
5966
5983
  () => o.width,
5967
5984
  (a) => o.width = a
5968
- ), r = ne(e, n.dom);
5969
- return he(
5985
+ ), r = re(e, n.dom);
5986
+ return fe(
5970
5987
  e,
5971
5988
  t,
5972
5989
  r,
5973
5990
  t.dictionary.file_blocks.video.add_button_text,
5974
5991
  i.firstElementChild
5975
5992
  );
5976
- }, ho = (e) => {
5993
+ }, fo = (e) => {
5977
5994
  if (e.tagName === "VIDEO")
5978
- return Xe(e);
5995
+ return qe(e);
5979
5996
  if (e.tagName === "FIGURE") {
5980
- const t = me(e, "video");
5997
+ const t = ge(e, "video");
5981
5998
  if (!t)
5982
5999
  return;
5983
6000
  const { targetElement: i, caption: o } = t;
5984
6001
  return {
5985
- ...Xe(i),
6002
+ ...qe(i),
5986
6003
  caption: o
5987
6004
  };
5988
6005
  }
5989
- }, mo = (e) => {
6006
+ }, go = (e) => {
5990
6007
  if (!e.props.url) {
5991
6008
  const i = document.createElement("p");
5992
6009
  return i.textContent = "Add video", {
@@ -5994,14 +6011,14 @@ const he = (e, t, i, o, n) => {
5994
6011
  };
5995
6012
  }
5996
6013
  let t;
5997
- 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 ? Le(t, e.props.caption) : fe(t, e.props.caption) : {
6014
+ 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 ? Be(t, e.props.caption) : be(t, e.props.caption) : {
5998
6015
  dom: t
5999
6016
  };
6000
- }, fo = pe(uo, {
6001
- render: po,
6002
- parse: ho,
6003
- toExternalHTML: mo
6004
- }), go = Me.create({
6017
+ }, bo = me(ho, {
6018
+ render: mo,
6019
+ parse: fo,
6020
+ toExternalHTML: go
6021
+ }), _o = Me.create({
6005
6022
  name: "backgroundColor",
6006
6023
  addAttributes() {
6007
6024
  return {
@@ -6027,10 +6044,10 @@ const he = (e, t, i, o, n) => {
6027
6044
  renderHTML({ HTMLAttributes: e }) {
6028
6045
  return ["span", e, 0];
6029
6046
  }
6030
- }), bo = j(
6031
- go,
6047
+ }), ko = j(
6048
+ _o,
6032
6049
  "string"
6033
- ), _o = Me.create({
6050
+ ), yo = Me.create({
6034
6051
  name: "textColor",
6035
6052
  addAttributes() {
6036
6053
  return {
@@ -6054,10 +6071,10 @@ const he = (e, t, i, o, n) => {
6054
6071
  renderHTML({ HTMLAttributes: e }) {
6055
6072
  return ["span", e, 0];
6056
6073
  }
6057
- }), ko = j(_o, "string"), yo = {
6058
- ...w,
6074
+ }), wo = j(yo, "string"), vo = {
6075
+ ...y,
6059
6076
  level: { default: 1, values: [1, 2, 3] }
6060
- }, wo = F({
6077
+ }, xo = G({
6061
6078
  name: "heading",
6062
6079
  content: "inline*",
6063
6080
  group: "blockContent",
@@ -6079,10 +6096,10 @@ const he = (e, t, i, o, n) => {
6079
6096
  },
6080
6097
  addInputRules() {
6081
6098
  return [
6082
- ...[1, 2, 3].map((e) => new ee({
6099
+ ...[1, 2, 3].map((e) => new te({
6083
6100
  find: new RegExp(`^(#{${e}})\\s$`),
6084
6101
  handler: ({ state: t, chain: i, range: o }) => {
6085
- B(this.editor) === "inline*" && i().BNUpdateBlock(t.selection.from, {
6102
+ T(this.editor) === "inline*" && i().BNUpdateBlock(t.selection.from, {
6086
6103
  type: "heading",
6087
6104
  props: {
6088
6105
  level: e
@@ -6094,7 +6111,7 @@ const he = (e, t, i, o, n) => {
6094
6111
  },
6095
6112
  addKeyboardShortcuts() {
6096
6113
  return {
6097
- "Mod-Alt-1": () => B(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6114
+ "Mod-Alt-1": () => T(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6098
6115
  this.editor.state.selection.anchor,
6099
6116
  {
6100
6117
  type: "heading",
@@ -6103,7 +6120,7 @@ const he = (e, t, i, o, n) => {
6103
6120
  }
6104
6121
  }
6105
6122
  ),
6106
- "Mod-Alt-2": () => B(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6123
+ "Mod-Alt-2": () => T(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6107
6124
  this.editor.state.selection.anchor,
6108
6125
  {
6109
6126
  type: "heading",
@@ -6112,7 +6129,7 @@ const he = (e, t, i, o, n) => {
6112
6129
  }
6113
6130
  }
6114
6131
  ),
6115
- "Mod-Alt-3": () => B(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6132
+ "Mod-Alt-3": () => T(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6116
6133
  this.editor.state.selection.anchor,
6117
6134
  {
6118
6135
  type: "heading",
@@ -6150,7 +6167,7 @@ const he = (e, t, i, o, n) => {
6150
6167
  },
6151
6168
  renderHTML({ node: e, HTMLAttributes: t }) {
6152
6169
  var i, o;
6153
- return O(
6170
+ return F(
6154
6171
  this.name,
6155
6172
  `h${e.attrs.level}`,
6156
6173
  {
@@ -6160,11 +6177,11 @@ const he = (e, t, i, o, n) => {
6160
6177
  ((o = this.options.domAttributes) == null ? void 0 : o.inlineContent) || {}
6161
6178
  );
6162
6179
  }
6163
- }), vo = X(
6164
- wo,
6165
- yo
6166
- ), Ie = (e) => {
6167
- const { contentNode: t, contentType: i } = _(
6180
+ }), Eo = Z(
6181
+ xo,
6182
+ vo
6183
+ ), Le = (e) => {
6184
+ const { contentNode: t, contentType: i } = k(
6168
6185
  e.state.doc,
6169
6186
  e.state.selection.from
6170
6187
  ), o = e.state.selection.anchor === e.state.selection.head;
@@ -6182,9 +6199,9 @@ const he = (e, t, i, o, n) => {
6182
6199
  a.command(() => t.childCount > 0 ? (r().deleteSelection().BNSplitBlock(n.selection.from, !0).run(), !0) : !1)
6183
6200
  )
6184
6201
  ]);
6185
- }, xo = {
6186
- ...w
6187
- }, Eo = F({
6202
+ }, Co = {
6203
+ ...y
6204
+ }, So = G({
6188
6205
  name: "bulletListItem",
6189
6206
  content: "inline*",
6190
6207
  group: "blockContent",
@@ -6194,10 +6211,10 @@ const he = (e, t, i, o, n) => {
6194
6211
  addInputRules() {
6195
6212
  return [
6196
6213
  // Creates an unordered list when starting with "-", "+", or "*".
6197
- new ee({
6214
+ new te({
6198
6215
  find: new RegExp("^[-+*]\\s$"),
6199
6216
  handler: ({ state: e, chain: t, range: i }) => {
6200
- B(this.editor) === "inline*" && t().BNUpdateBlock(e.selection.from, {
6217
+ T(this.editor) === "inline*" && t().BNUpdateBlock(e.selection.from, {
6201
6218
  type: "bulletListItem",
6202
6219
  props: {}
6203
6220
  }).deleteRange({ from: i.from, to: i.to });
@@ -6207,8 +6224,8 @@ const he = (e, t, i, o, n) => {
6207
6224
  },
6208
6225
  addKeyboardShortcuts() {
6209
6226
  return {
6210
- Enter: () => Ie(this.editor),
6211
- "Mod-Shift-8": () => B(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6227
+ Enter: () => Le(this.editor),
6228
+ "Mod-Shift-8": () => T(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6212
6229
  this.editor.state.selection.anchor,
6213
6230
  {
6214
6231
  type: "bulletListItem",
@@ -6250,7 +6267,7 @@ const he = (e, t, i, o, n) => {
6250
6267
  },
6251
6268
  renderHTML({ HTMLAttributes: e }) {
6252
6269
  var t, i;
6253
- return O(
6270
+ return F(
6254
6271
  this.name,
6255
6272
  // We use a <p> tag, because for <li> tags we'd need a <ul> element to put
6256
6273
  // them in to be semantically correct, which we can't have due to the
@@ -6263,11 +6280,11 @@ const he = (e, t, i, o, n) => {
6263
6280
  ((i = this.options.domAttributes) == null ? void 0 : i.inlineContent) || {}
6264
6281
  );
6265
6282
  }
6266
- }), Co = X(
6267
- Eo,
6268
- xo
6269
- ), So = new L("numbered-list-indexing"), Mo = () => new x({
6270
- key: So,
6283
+ }), Mo = Z(
6284
+ So,
6285
+ Co
6286
+ ), To = new B("numbered-list-indexing"), Bo = () => new v({
6287
+ key: To,
6271
6288
  appendTransaction: (e, t, i) => {
6272
6289
  const o = i.tr;
6273
6290
  o.setMeta("numberedListIndexing", !0);
@@ -6275,18 +6292,18 @@ const he = (e, t, i, o, n) => {
6275
6292
  return i.doc.descendants((r, a) => {
6276
6293
  if (r.type.name === "blockContainer" && r.firstChild.type.name === "numberedListItem") {
6277
6294
  let s = "1";
6278
- const l = a === 1, d = _(o.doc, a + 1);
6295
+ const l = a === 1, d = k(o.doc, a + 1);
6279
6296
  if (d === void 0)
6280
6297
  return;
6281
6298
  if (!l) {
6282
- const h = _(o.doc, a - 2);
6299
+ const h = k(o.doc, a - 2);
6283
6300
  if (h === void 0)
6284
6301
  return;
6285
6302
  if (!(d.depth !== h.depth)) {
6286
6303
  const f = h.contentNode;
6287
6304
  if (h.contentType.name === "numberedListItem") {
6288
- const v = f.attrs.index;
6289
- s = (parseInt(v) + 1).toString();
6305
+ const x = f.attrs.index;
6306
+ s = (parseInt(x) + 1).toString();
6290
6307
  }
6291
6308
  }
6292
6309
  }
@@ -6296,9 +6313,9 @@ const he = (e, t, i, o, n) => {
6296
6313
  }
6297
6314
  }), n ? o : null;
6298
6315
  }
6299
- }), To = {
6300
- ...w
6301
- }, Bo = F({
6316
+ }), Lo = {
6317
+ ...y
6318
+ }, Io = G({
6302
6319
  name: "numberedListItem",
6303
6320
  content: "inline*",
6304
6321
  group: "blockContent",
@@ -6317,10 +6334,10 @@ const he = (e, t, i, o, n) => {
6317
6334
  addInputRules() {
6318
6335
  return [
6319
6336
  // Creates an ordered list when starting with "1.".
6320
- new ee({
6337
+ new te({
6321
6338
  find: new RegExp("^1\\.\\s$"),
6322
6339
  handler: ({ state: e, chain: t, range: i }) => {
6323
- B(this.editor) === "inline*" && t().BNUpdateBlock(e.selection.from, {
6340
+ T(this.editor) === "inline*" && t().BNUpdateBlock(e.selection.from, {
6324
6341
  type: "numberedListItem",
6325
6342
  props: {}
6326
6343
  }).deleteRange({ from: i.from, to: i.to });
@@ -6330,8 +6347,8 @@ const he = (e, t, i, o, n) => {
6330
6347
  },
6331
6348
  addKeyboardShortcuts() {
6332
6349
  return {
6333
- Enter: () => Ie(this.editor),
6334
- "Mod-Shift-7": () => B(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6350
+ Enter: () => Le(this.editor),
6351
+ "Mod-Shift-7": () => T(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6335
6352
  this.editor.state.selection.anchor,
6336
6353
  {
6337
6354
  type: "numberedListItem",
@@ -6341,7 +6358,7 @@ const he = (e, t, i, o, n) => {
6341
6358
  };
6342
6359
  },
6343
6360
  addProseMirrorPlugins() {
6344
- return [Mo()];
6361
+ return [Bo()];
6345
6362
  },
6346
6363
  parseHTML() {
6347
6364
  return [
@@ -6378,7 +6395,7 @@ const he = (e, t, i, o, n) => {
6378
6395
  },
6379
6396
  renderHTML({ HTMLAttributes: e }) {
6380
6397
  var t, i;
6381
- return O(
6398
+ return F(
6382
6399
  this.name,
6383
6400
  // We use a <p> tag, because for <li> tags we'd need an <ol> element to
6384
6401
  // put them in to be semantically correct, which we can't have due to the
@@ -6391,15 +6408,15 @@ const he = (e, t, i, o, n) => {
6391
6408
  ((i = this.options.domAttributes) == null ? void 0 : i.inlineContent) || {}
6392
6409
  );
6393
6410
  }
6394
- }), Lo = X(
6395
- Bo,
6396
- To
6397
- ), Io = {
6398
- ...w,
6411
+ }), Ao = Z(
6412
+ Io,
6413
+ Lo
6414
+ ), No = {
6415
+ ...y,
6399
6416
  checked: {
6400
6417
  default: !1
6401
6418
  }
6402
- }, Ao = F({
6419
+ }, Po = G({
6403
6420
  name: "checkListItem",
6404
6421
  content: "inline*",
6405
6422
  group: "blockContent",
@@ -6418,10 +6435,10 @@ const he = (e, t, i, o, n) => {
6418
6435
  addInputRules() {
6419
6436
  return [
6420
6437
  // Creates a checklist when starting with "[]" or "[X]".
6421
- new ee({
6438
+ new te({
6422
6439
  find: new RegExp("\\[\\s*\\]\\s$"),
6423
6440
  handler: ({ state: e, chain: t, range: i }) => {
6424
- B(this.editor) === "inline*" && t().BNUpdateBlock(e.selection.from, {
6441
+ T(this.editor) === "inline*" && t().BNUpdateBlock(e.selection.from, {
6425
6442
  type: "checkListItem",
6426
6443
  props: {
6427
6444
  checked: !1
@@ -6429,10 +6446,10 @@ const he = (e, t, i, o, n) => {
6429
6446
  }).deleteRange({ from: i.from, to: i.to });
6430
6447
  }
6431
6448
  }),
6432
- new ee({
6449
+ new te({
6433
6450
  find: new RegExp("\\[[Xx]\\]\\s$"),
6434
6451
  handler: ({ state: e, chain: t, range: i }) => {
6435
- B(this.editor) === "inline*" && t().BNUpdateBlock(e.selection.from, {
6452
+ T(this.editor) === "inline*" && t().BNUpdateBlock(e.selection.from, {
6436
6453
  type: "checkListItem",
6437
6454
  props: {
6438
6455
  checked: !0
@@ -6444,8 +6461,8 @@ const he = (e, t, i, o, n) => {
6444
6461
  },
6445
6462
  addKeyboardShortcuts() {
6446
6463
  return {
6447
- Enter: () => Ie(this.editor),
6448
- "Mod-Shift-9": () => B(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6464
+ Enter: () => Le(this.editor),
6465
+ "Mod-Shift-9": () => T(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6449
6466
  this.editor.state.selection.anchor,
6450
6467
  {
6451
6468
  type: "checkListItem",
@@ -6496,7 +6513,7 @@ const he = (e, t, i, o, n) => {
6496
6513
  var r, a;
6497
6514
  const i = document.createElement("input");
6498
6515
  i.type = "checkbox", i.checked = e.attrs.checked, e.attrs.checked && i.setAttribute("checked", "");
6499
- const { dom: o, contentDOM: n } = O(
6516
+ const { dom: o, contentDOM: n } = F(
6500
6517
  this.name,
6501
6518
  "p",
6502
6519
  {
@@ -6529,7 +6546,7 @@ const he = (e, t, i, o, n) => {
6529
6546
  });
6530
6547
  };
6531
6548
  a.addEventListener("change", s);
6532
- const { dom: l, contentDOM: d } = O(
6549
+ const { dom: l, contentDOM: d } = F(
6533
6550
  this.name,
6534
6551
  "p",
6535
6552
  {
@@ -6551,18 +6568,18 @@ const he = (e, t, i, o, n) => {
6551
6568
  };
6552
6569
  };
6553
6570
  }
6554
- }), No = X(
6555
- Ao,
6556
- Io
6557
- ), Po = {
6558
- ...w
6559
- }, Ho = F({
6571
+ }), Ho = Z(
6572
+ Po,
6573
+ No
6574
+ ), Uo = {
6575
+ ...y
6576
+ }, Do = G({
6560
6577
  name: "paragraph",
6561
6578
  content: "inline*",
6562
6579
  group: "blockContent",
6563
6580
  addKeyboardShortcuts() {
6564
6581
  return {
6565
- "Mod-Alt-0": () => B(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6582
+ "Mod-Alt-0": () => T(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6566
6583
  this.editor.state.selection.anchor,
6567
6584
  {
6568
6585
  type: "paragraph",
@@ -6587,7 +6604,7 @@ const he = (e, t, i, o, n) => {
6587
6604
  },
6588
6605
  renderHTML({ HTMLAttributes: e }) {
6589
6606
  var t, i;
6590
- return O(
6607
+ return F(
6591
6608
  this.name,
6592
6609
  "p",
6593
6610
  {
@@ -6597,10 +6614,10 @@ const he = (e, t, i, o, n) => {
6597
6614
  ((i = this.options.domAttributes) == null ? void 0 : i.inlineContent) || {}
6598
6615
  );
6599
6616
  }
6600
- }), Uo = X(
6601
- Ho,
6602
- Po
6603
- ), Do = I.create({
6617
+ }), jo = Z(
6618
+ Do,
6619
+ Uo
6620
+ ), zo = A.create({
6604
6621
  name: "BlockNoteTableExtension",
6605
6622
  addProseMirrorPlugins: () => [
6606
6623
  oi({
@@ -6632,9 +6649,9 @@ const he = (e, t, i, o, n) => {
6632
6649
  )
6633
6650
  };
6634
6651
  }
6635
- }), jo = {
6636
- ...w
6637
- }, zo = F({
6652
+ }), Ro = {
6653
+ ...y
6654
+ }, Vo = G({
6638
6655
  name: "table",
6639
6656
  content: "tableRow+",
6640
6657
  group: "blockContent",
@@ -6645,7 +6662,7 @@ const he = (e, t, i, o, n) => {
6645
6662
  },
6646
6663
  renderHTML({ HTMLAttributes: e }) {
6647
6664
  var t, i;
6648
- return O(
6665
+ return F(
6649
6666
  this.name,
6650
6667
  "table",
6651
6668
  {
@@ -6655,13 +6672,12 @@ const he = (e, t, i, o, n) => {
6655
6672
  ((i = this.options.domAttributes) == null ? void 0 : i.inlineContent) || {}
6656
6673
  );
6657
6674
  }
6658
- }), Ro = q.create({
6675
+ }), Oo = X.create({
6659
6676
  name: "tableParagraph",
6660
6677
  group: "tableContent",
6661
6678
  content: "inline*",
6662
6679
  parseHTML() {
6663
6680
  return [
6664
- { tag: "td" },
6665
6681
  {
6666
6682
  tag: "p",
6667
6683
  getAttrs: (e) => {
@@ -6680,12 +6696,12 @@ const he = (e, t, i, o, n) => {
6680
6696
  0
6681
6697
  ];
6682
6698
  }
6683
- }), Vo = X(
6684
- zo,
6685
- jo,
6699
+ }), Fo = Z(
6700
+ Vo,
6701
+ Ro,
6686
6702
  [
6687
- Do,
6688
- Ro,
6703
+ zo,
6704
+ Oo,
6689
6705
  ti.extend({
6690
6706
  content: "tableContent"
6691
6707
  }),
@@ -6695,55 +6711,55 @@ const he = (e, t, i, o, n) => {
6695
6711
  ii
6696
6712
  ]
6697
6713
  ), bt = {
6698
- paragraph: Uo,
6699
- heading: vo,
6700
- bulletListItem: Co,
6701
- numberedListItem: Lo,
6702
- checkListItem: No,
6703
- table: Vo,
6704
- file: io,
6705
- image: lo,
6706
- video: fo,
6707
- audio: Zi
6708
- }, Oo = ut(bt), _t = {
6714
+ paragraph: jo,
6715
+ heading: Eo,
6716
+ bulletListItem: Mo,
6717
+ numberedListItem: Ao,
6718
+ checkListItem: Ho,
6719
+ table: Fo,
6720
+ file: no,
6721
+ image: uo,
6722
+ video: bo,
6723
+ audio: Yi
6724
+ }, Go = ut(bt), _t = {
6709
6725
  bold: j(Xt, "boolean"),
6710
6726
  italic: j(Jt, "boolean"),
6711
6727
  underline: j(Qt, "boolean"),
6712
6728
  strike: j(Yt, "boolean"),
6713
6729
  code: j(Zt, "boolean"),
6714
- textColor: ko,
6715
- backgroundColor: bo
6716
- }, Hr = mt(_t), kt = {
6730
+ textColor: wo,
6731
+ backgroundColor: ko
6732
+ }, jr = mt(_t), kt = {
6717
6733
  text: { config: "text", implementation: {} },
6718
6734
  link: { config: "link", implementation: {} }
6719
- }, Fo = pt(
6735
+ }, Wo = pt(
6720
6736
  kt
6721
6737
  );
6722
- function T(e, t) {
6723
- return e in t.schema.blockSchema && t.schema.blockSchema[e] === Oo[e];
6738
+ function M(e, t) {
6739
+ return e in t.schema.blockSchema && t.schema.blockSchema[e] === Go[e];
6724
6740
  }
6725
- function Go(e, t) {
6726
- return e in t.schema.inlineContentSchema && t.schema.inlineContentSchema[e] === Fo[e];
6741
+ function Ko(e, t) {
6742
+ return e in t.schema.inlineContentSchema && t.schema.inlineContentSchema[e] === Wo[e];
6727
6743
  }
6728
- function Wo(e, t, i) {
6729
- return t.type === e && t.type in i.schema.blockSchema && T(t.type, i);
6744
+ function $o(e, t, i) {
6745
+ return t.type === e && t.type in i.schema.blockSchema && M(t.type, i);
6730
6746
  }
6731
- function Ur(e, t) {
6747
+ function zr(e, t) {
6732
6748
  return e.type in t.schema.blockSchema && t.schema.blockSchema[e.type].isFileBlock || !1;
6733
6749
  }
6734
- function Dr(e, t) {
6750
+ function Rr(e, t) {
6735
6751
  return e.type in t.schema.blockSchema && t.schema.blockSchema[e.type].isFileBlock && "showPreview" in t.schema.blockSchema[e.type].propSchema || !1;
6736
6752
  }
6737
- function jr(e, t) {
6753
+ function Vr(e, t) {
6738
6754
  return t.schema.blockSchema[e.type].isFileBlock && !e.props.url;
6739
6755
  }
6740
- function Ko(e, t, i) {
6741
- return t in i.schema.blockSchema && e in i.schema.blockSchema[t].propSchema && i.schema.blockSchema[t].propSchema[e] === w[e];
6756
+ function qo(e, t, i) {
6757
+ return t in i.schema.blockSchema && e in i.schema.blockSchema[t].propSchema && i.schema.blockSchema[t].propSchema[e] === y[e];
6742
6758
  }
6743
- function zr(e, t, i) {
6744
- return Ko(e, t.type, i);
6759
+ function Or(e, t, i) {
6760
+ return qo(e, t.type, i);
6745
6761
  }
6746
- function Ae(e, t) {
6762
+ function Ie(e, t) {
6747
6763
  let i, o;
6748
6764
  if (t.firstChild.descendants((n, r) => i ? !1 : n.type.name !== "blockContainer" || n.attrs.id !== e ? !0 : (i = n, o = r + 1, !1)), i === void 0 || o === void 0)
6749
6765
  throw Error("Could not find block in the editor with matching ID.");
@@ -6752,13 +6768,13 @@ function Ae(e, t) {
6752
6768
  posBeforeNode: o
6753
6769
  };
6754
6770
  }
6755
- function $o(e, t, i = "before", o) {
6771
+ function Xo(e, t, i = "before", o) {
6756
6772
  const n = typeof t == "string" ? t : t.id, r = [];
6757
6773
  for (const d of e)
6758
6774
  r.push(
6759
6775
  U(d, o.pmSchema, o.schema.styleSchema)
6760
6776
  );
6761
- const { node: a, posBeforeNode: s } = Ae(
6777
+ const { node: a, posBeforeNode: s } = Ie(
6762
6778
  n,
6763
6779
  o._tiptapEditor.state.doc
6764
6780
  );
@@ -6791,8 +6807,8 @@ function $o(e, t, i = "before", o) {
6791
6807
  );
6792
6808
  return l;
6793
6809
  }
6794
- function qo(e, t, i) {
6795
- const o = i._tiptapEditor, n = typeof e == "string" ? e : e.id, { posBeforeNode: r } = Ae(n, o.state.doc);
6810
+ function Zo(e, t, i) {
6811
+ const o = i._tiptapEditor, n = typeof e == "string" ? e : e.id, { posBeforeNode: r } = Ie(n, o.state.doc);
6796
6812
  o.commands.BNUpdateBlock(r + 1, t);
6797
6813
  const a = o.state.doc.resolve(r + 1).node();
6798
6814
  return C(
@@ -6837,10 +6853,10 @@ function yt(e, t, i) {
6837
6853
  }
6838
6854
  return t.dispatch(n), a;
6839
6855
  }
6840
- function Xo(e, t) {
6856
+ function Jo(e, t) {
6841
6857
  return yt(e, t);
6842
6858
  }
6843
- function Zo(e, t, i) {
6859
+ function Yo(e, t, i) {
6844
6860
  const o = [];
6845
6861
  for (const s of t)
6846
6862
  o.push(
@@ -6871,7 +6887,7 @@ function Zo(e, t, i) {
6871
6887
  );
6872
6888
  return { insertedBlocks: a, removedBlocks: r };
6873
6889
  }
6874
- function Jo(e, t, i, o = { updateSelection: !0 }) {
6890
+ function Qo(e, t, i, o = { updateSelection: !0 }) {
6875
6891
  const n = i._tiptapEditor.state.tr;
6876
6892
  let { from: r, to: a } = typeof e == "number" ? { from: e, to: e } : { from: e.from, to: e.to }, s = !0, l = !0, d = "";
6877
6893
  if (t.forEach((u) => {
@@ -6882,7 +6898,7 @@ function Jo(e, t, i, o = { updateSelection: !0 }) {
6882
6898
  }
6883
6899
  return s ? n.insertText(d, r, a) : n.replaceWith(r, a, t), o.updateSelection && Rt(n, n.steps.length - 1, -1), i.dispatch(n), !0;
6884
6900
  }
6885
- function Yo() {
6901
+ function en() {
6886
6902
  const e = (t) => {
6887
6903
  let i = t.children.length;
6888
6904
  for (let o = 0; o < i; o++) {
@@ -6898,7 +6914,7 @@ function Yo() {
6898
6914
  };
6899
6915
  return e;
6900
6916
  }
6901
- function Qo() {
6917
+ function tn() {
6902
6918
  const e = H;
6903
6919
  if (!e)
6904
6920
  throw new Error(
@@ -6920,43 +6936,43 @@ function Qo() {
6920
6936
  };
6921
6937
  return t;
6922
6938
  }
6923
- function Ne(e) {
6939
+ function Ae(e) {
6924
6940
  const t = H;
6925
6941
  if (!t)
6926
6942
  throw new Error(
6927
6943
  "cleanHTMLToMarkdown requires ESM dependencies to be initialized"
6928
6944
  );
6929
- return t.unified.unified().use(t.rehypeParse.default, { fragment: !0 }).use(Yo).use(Qo).use(t.rehypeRemark.default).use(t.remarkGfm.default).use(t.remarkStringify.default, {
6945
+ return t.unified.unified().use(t.rehypeParse.default, { fragment: !0 }).use(en).use(tn).use(t.rehypeRemark.default).use(t.remarkGfm.default).use(t.remarkStringify.default, {
6930
6946
  handlers: { text: (o) => o.value }
6931
6947
  }).processSync(e).value;
6932
6948
  }
6933
- async function en(e, t, i, o) {
6934
- await ie();
6935
- const r = ue(t, i).exportBlocks(e, o);
6936
- return Ne(r);
6949
+ async function on(e, t, i, o) {
6950
+ await oe();
6951
+ const r = he(t, i).exportBlocks(e, o);
6952
+ return Ae(r);
6937
6953
  }
6938
- function tn(e) {
6954
+ function nn(e) {
6939
6955
  return Array.prototype.indexOf.call(e.parentElement.childNodes, e);
6940
6956
  }
6941
- function on(e) {
6957
+ function rn(e) {
6942
6958
  return e.nodeType === 3 && !/\S/.test(e.nodeValue || "");
6943
6959
  }
6944
- function nn(e) {
6960
+ function an(e) {
6945
6961
  e.querySelectorAll("li > ul, li > ol").forEach((t) => {
6946
- const i = tn(t), o = t.parentElement, n = Array.from(o.childNodes).slice(
6962
+ const i = nn(t), o = t.parentElement, n = Array.from(o.childNodes).slice(
6947
6963
  i + 1
6948
6964
  );
6949
6965
  t.remove(), n.forEach((r) => {
6950
6966
  r.remove();
6951
6967
  }), o.insertAdjacentElement("afterend", t), n.reverse().forEach((r) => {
6952
- if (on(r))
6968
+ if (rn(r))
6953
6969
  return;
6954
6970
  const a = document.createElement("li");
6955
6971
  a.append(r), t.insertAdjacentElement("afterend", a);
6956
6972
  }), o.childNodes.length === 0 && o.remove();
6957
6973
  });
6958
6974
  }
6959
- function rn(e) {
6975
+ function sn(e) {
6960
6976
  e.querySelectorAll("li + ul, li + ol").forEach((t) => {
6961
6977
  var r, a;
6962
6978
  const i = t.previousElementSibling, o = document.createElement("div");
@@ -6966,16 +6982,16 @@ function rn(e) {
6966
6982
  n.append(o.nextElementSibling);
6967
6983
  });
6968
6984
  }
6969
- let Ze = null;
6970
- function an() {
6971
- return Ze || (Ze = document.implementation.createHTMLDocument("title"));
6985
+ let Xe = null;
6986
+ function ln() {
6987
+ return Xe || (Xe = document.implementation.createHTMLDocument("title"));
6972
6988
  }
6973
6989
  function wt(e) {
6974
6990
  if (typeof e == "string") {
6975
- const t = an().createElement("div");
6991
+ const t = ln().createElement("div");
6976
6992
  t.innerHTML = e, e = t;
6977
6993
  }
6978
- return nn(e), rn(e), e;
6994
+ return an(e), sn(e), e;
6979
6995
  }
6980
6996
  async function vt(e, t, i, o, n) {
6981
6997
  const r = wt(e), s = At.fromSchema(n).parse(r, {
@@ -6987,7 +7003,7 @@ async function vt(e, t, i, o, n) {
6987
7003
  );
6988
7004
  return l;
6989
7005
  }
6990
- function sn(e, t) {
7006
+ function dn(e, t) {
6991
7007
  const i = t.value ? t.value + `
6992
7008
  ` : "", o = {};
6993
7009
  t.lang && (o["data-language"] = t.lang);
@@ -7004,11 +7020,11 @@ function sn(e, t) {
7004
7020
  children: [n]
7005
7021
  }, e.patch(t, n), n;
7006
7022
  }
7007
- async function ln(e, t, i, o, n) {
7008
- const r = await ie(), a = r.unified.unified().use(r.remarkParse.default).use(r.remarkGfm.default).use(r.remarkRehype.default, {
7023
+ async function cn(e, t, i, o, n) {
7024
+ const r = await oe(), a = r.unified.unified().use(r.remarkParse.default).use(r.remarkGfm.default).use(r.remarkRehype.default, {
7009
7025
  handlers: {
7010
7026
  ...r.remarkRehype.defaultHandlers,
7011
- code: sn
7027
+ code: dn
7012
7028
  }
7013
7029
  }).use(r.rehypeStringify.default).processSync(e);
7014
7030
  return vt(
@@ -7019,7 +7035,7 @@ async function ln(e, t, i, o, n) {
7019
7035
  n
7020
7036
  );
7021
7037
  }
7022
- class Z {
7038
+ class J {
7023
7039
  constructor() {
7024
7040
  // eslint-disable-next-line @typescript-eslint/ban-types
7025
7041
  c(this, "callbacks", {});
@@ -7039,7 +7055,7 @@ class Z {
7039
7055
  this.callbacks = {};
7040
7056
  }
7041
7057
  }
7042
- class dn {
7058
+ class un {
7043
7059
  constructor(t, i, o, n) {
7044
7060
  c(this, "state");
7045
7061
  c(this, "emitUpdate");
@@ -7095,8 +7111,8 @@ class dn {
7095
7111
  this.pmView.dom.removeEventListener("mousedown", this.mouseDownHandler), this.pmView.dom.removeEventListener("dragstart", this.dragstartHandler), this.pmView.root.removeEventListener("scroll", this.scrollHandler, !0);
7096
7112
  }
7097
7113
  }
7098
- const ke = new L("FilePanelPlugin");
7099
- class cn extends Z {
7114
+ const ye = new B("FilePanelPlugin");
7115
+ class pn extends J {
7100
7116
  constructor(i) {
7101
7117
  super();
7102
7118
  c(this, "view");
@@ -7105,11 +7121,11 @@ class cn extends Z {
7105
7121
  var i;
7106
7122
  return (i = this.view) == null ? void 0 : i.closeMenu();
7107
7123
  });
7108
- this.plugin = new x({
7109
- key: ke,
7110
- view: (o) => (this.view = new dn(
7124
+ this.plugin = new v({
7125
+ key: ye,
7126
+ view: (o) => (this.view = new un(
7111
7127
  i,
7112
- ke,
7128
+ ye,
7113
7129
  o,
7114
7130
  (n) => {
7115
7131
  this.emit("update", n);
@@ -7128,7 +7144,7 @@ class cn extends Z {
7128
7144
  apply: (o) => {
7129
7145
  var r;
7130
7146
  return {
7131
- block: (r = o.getMeta(ke)) == null ? void 0 : r.block
7147
+ block: (r = o.getMeta(ye)) == null ? void 0 : r.block
7132
7148
  };
7133
7149
  }
7134
7150
  }
@@ -7142,7 +7158,7 @@ class cn extends Z {
7142
7158
  return this.on("update", i);
7143
7159
  }
7144
7160
  }
7145
- class un {
7161
+ class hn {
7146
7162
  constructor(t, i, o) {
7147
7163
  c(this, "state");
7148
7164
  c(this, "emitUpdate");
@@ -7225,21 +7241,21 @@ class un {
7225
7241
  if (a)
7226
7242
  return a.getBoundingClientRect();
7227
7243
  }
7228
- return xe(this.pmView, n, r);
7244
+ return Ee(this.pmView, n, r);
7229
7245
  }
7230
7246
  }
7231
- const pn = new L(
7247
+ const mn = new B(
7232
7248
  "FormattingToolbarPlugin"
7233
7249
  );
7234
- class hn extends Z {
7250
+ class fn extends J {
7235
7251
  constructor(i) {
7236
7252
  super();
7237
7253
  c(this, "view");
7238
7254
  c(this, "plugin");
7239
7255
  c(this, "closeMenu", () => this.view.closeMenu());
7240
- this.plugin = new x({
7241
- key: pn,
7242
- view: (o) => (this.view = new un(i, o, (n) => {
7256
+ this.plugin = new v({
7257
+ key: mn,
7258
+ view: (o) => (this.view = new hn(i, o, (n) => {
7243
7259
  this.emit("update", n);
7244
7260
  }), this.view),
7245
7261
  props: {
@@ -7255,7 +7271,7 @@ class hn extends Z {
7255
7271
  return this.on("update", i);
7256
7272
  }
7257
7273
  }
7258
- class mn {
7274
+ class gn {
7259
7275
  constructor(t, i, o) {
7260
7276
  c(this, "state");
7261
7277
  c(this, "emitUpdate");
@@ -7273,7 +7289,7 @@ class mn {
7273
7289
  const i = t.target, o = this.pmView.posAtDOM(i, 0) + 1, n = this.pmView.state.doc.resolve(o), r = n.marks();
7274
7290
  for (const a of r)
7275
7291
  if (a.type.name === this.pmView.state.schema.mark("link").type.name) {
7276
- this.mouseHoveredLinkMark = a, this.mouseHoveredLinkMarkRange = ze(n, a.type, a.attrs) || void 0;
7292
+ this.mouseHoveredLinkMark = a, this.mouseHoveredLinkMarkRange = je(n, a.type, a.attrs) || void 0;
7277
7293
  break;
7278
7294
  }
7279
7295
  }
@@ -7289,7 +7305,7 @@ class mn {
7289
7305
  });
7290
7306
  c(this, "scrollHandler", () => {
7291
7307
  var t;
7292
- this.linkMark !== void 0 && (t = this.state) != null && t.show && (this.state.referencePos = xe(
7308
+ this.linkMark !== void 0 && (t = this.state) != null && t.show && (this.state.referencePos = Ee(
7293
7309
  this.pmView,
7294
7310
  this.linkMarkRange.from,
7295
7311
  this.linkMarkRange.to
@@ -7345,7 +7361,7 @@ class mn {
7345
7361
  const o = this.pmView.state.selection.$from.marks();
7346
7362
  for (const n of o)
7347
7363
  if (n.type.name === this.pmView.state.schema.mark("link").type.name) {
7348
- this.keyboardHoveredLinkMark = n, this.keyboardHoveredLinkMarkRange = ze(
7364
+ this.keyboardHoveredLinkMark = n, this.keyboardHoveredLinkMarkRange = je(
7349
7365
  this.pmView.state.selection.$from,
7350
7366
  n.type,
7351
7367
  n.attrs
@@ -7356,7 +7372,7 @@ class mn {
7356
7372
  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) {
7357
7373
  this.state = {
7358
7374
  show: !0,
7359
- referencePos: xe(
7375
+ referencePos: Ee(
7360
7376
  this.pmView,
7361
7377
  this.linkMarkRange.from,
7362
7378
  this.linkMarkRange.to
@@ -7382,8 +7398,8 @@ class mn {
7382
7398
  );
7383
7399
  }
7384
7400
  }
7385
- const fn = new L("LinkToolbarPlugin");
7386
- class gn extends Z {
7401
+ const bn = new B("LinkToolbarPlugin");
7402
+ class _n extends J {
7387
7403
  constructor(i) {
7388
7404
  super();
7389
7405
  c(this, "view");
@@ -7421,9 +7437,9 @@ class gn extends Z {
7421
7437
  this.view.stopMenuUpdateTimer();
7422
7438
  });
7423
7439
  c(this, "closeMenu", () => this.view.closeMenu());
7424
- this.plugin = new x({
7425
- key: fn,
7426
- view: (o) => (this.view = new mn(i, o, (n) => {
7440
+ this.plugin = new v({
7441
+ key: bn,
7442
+ view: (o) => (this.view = new gn(i, o, (n) => {
7427
7443
  this.emit("update", n);
7428
7444
  }), this.view),
7429
7445
  props: {
@@ -7439,7 +7455,7 @@ class gn extends Z {
7439
7455
  return ((o = (i = this.view) == null ? void 0 : i.state) == null ? void 0 : o.show) || !1;
7440
7456
  }
7441
7457
  }
7442
- class G extends be {
7458
+ class W extends ke {
7443
7459
  constructor(i, o) {
7444
7460
  super(i, o);
7445
7461
  c(this, "nodes");
@@ -7450,13 +7466,13 @@ class G extends be {
7450
7466
  });
7451
7467
  }
7452
7468
  static create(i, o, n = o) {
7453
- return new G(i.resolve(o), i.resolve(n));
7469
+ return new W(i.resolve(o), i.resolve(n));
7454
7470
  }
7455
7471
  content() {
7456
- return new z(N.from(this.nodes), 0, 0);
7472
+ return new z(I.from(this.nodes), 0, 0);
7457
7473
  }
7458
7474
  eq(i) {
7459
- if (!(i instanceof G) || this.nodes.length !== i.nodes.length || this.from !== i.from || this.to !== i.to)
7475
+ if (!(i instanceof W) || this.nodes.length !== i.nodes.length || this.from !== i.from || this.to !== i.to)
7460
7476
  return !1;
7461
7477
  for (let o = 0; o < this.nodes.length; o++)
7462
7478
  if (!this.nodes[o].eq(i.nodes[o]))
@@ -7465,7 +7481,7 @@ class G extends be {
7465
7481
  }
7466
7482
  map(i, o) {
7467
7483
  const n = o.mapResult(this.from), r = o.mapResult(this.to);
7468
- return r.deleted ? be.near(i.resolve(n.pos)) : n.deleted ? be.near(i.resolve(r.pos)) : new G(
7484
+ return r.deleted ? ke.near(i.resolve(n.pos)) : n.deleted ? ke.near(i.resolve(r.pos)) : new W(
7469
7485
  i.resolve(n.pos),
7470
7486
  i.resolve(r.pos)
7471
7487
  );
@@ -7474,23 +7490,23 @@ class G extends be {
7474
7490
  return { type: "node", anchor: this.anchor, head: this.head };
7475
7491
  }
7476
7492
  }
7477
- let A;
7478
- function ge(e, t) {
7493
+ let N;
7494
+ function _e(e, t) {
7479
7495
  var i, o;
7480
7496
  for (; e && e.parentElement && e.parentElement !== t.dom && ((i = e.getAttribute) == null ? void 0 : i.call(e, "data-node-type")) !== "blockContainer"; )
7481
7497
  e = e.parentElement;
7482
7498
  if (((o = e.getAttribute) == null ? void 0 : o.call(e, "data-node-type")) === "blockContainer")
7483
7499
  return { node: e, id: e.getAttribute("data-id") };
7484
7500
  }
7485
- function bn(e, t) {
7486
- const i = ge(e, t);
7501
+ function kn(e, t) {
7502
+ const i = _e(e, t);
7487
7503
  if (i && i.node.nodeType === 1) {
7488
7504
  const o = t.docView, n = o.nearestDesc(i.node, !0);
7489
7505
  return !n || n === o ? null : n.posBefore;
7490
7506
  }
7491
7507
  return null;
7492
7508
  }
7493
- function _n(e, t) {
7509
+ function yn(e, t) {
7494
7510
  let i, o;
7495
7511
  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);
7496
7512
  if (n && r) {
@@ -7500,7 +7516,7 @@ function _n(e, t) {
7500
7516
  i = e.from, o = e.to;
7501
7517
  return { from: i, to: o };
7502
7518
  }
7503
- function Je(e, t, i = t) {
7519
+ function Ze(e, t, i = t) {
7504
7520
  t === i && (i += e.state.doc.resolve(t + 1).node().nodeSize);
7505
7521
  const o = e.domAtPos(t).node.cloneNode(!0), n = e.domAtPos(t).node, r = (u, p) => Array.prototype.indexOf.call(u.children, p), a = r(
7506
7522
  n,
@@ -7513,16 +7529,16 @@ function Je(e, t, i = t) {
7513
7529
  );
7514
7530
  for (let u = n.childElementCount - 1; u >= 0; u--)
7515
7531
  (u > s || u < a) && o.removeChild(o.children[u]);
7516
- xt(e.root), A = o;
7532
+ xt(e.root), N = o;
7517
7533
  const d = e.dom.className.split(" ").filter(
7518
7534
  (u) => u !== "ProseMirror" && u !== "bn-root" && u !== "bn-editor"
7519
7535
  ).join(" ");
7520
- A.className = A.className + " bn-drag-preview " + d, e.root instanceof ShadowRoot ? e.root.appendChild(A) : e.root.body.appendChild(A);
7536
+ N.className = N.className + " bn-drag-preview " + d, e.root instanceof ShadowRoot ? e.root.appendChild(N) : e.root.body.appendChild(N);
7521
7537
  }
7522
7538
  function xt(e) {
7523
- A !== void 0 && (e instanceof ShadowRoot ? e.removeChild(A) : e.body.removeChild(A), A = void 0);
7539
+ N !== void 0 && (e instanceof ShadowRoot ? e.removeChild(N) : e.body.removeChild(N), N = void 0);
7524
7540
  }
7525
- function kn(e, t) {
7541
+ function wn(e, t) {
7526
7542
  if (!e.dataTransfer)
7527
7543
  return;
7528
7544
  const i = t.prosemirrorView, o = i.dom.getBoundingClientRect(), n = {
@@ -7533,30 +7549,30 @@ function kn(e, t) {
7533
7549
  let a;
7534
7550
  for (const l of r)
7535
7551
  if (i.dom.contains(l)) {
7536
- a = ge(l, i);
7552
+ a = _e(l, i);
7537
7553
  break;
7538
7554
  }
7539
7555
  if (!a)
7540
7556
  return;
7541
- const s = bn(a.node, i);
7557
+ const s = kn(a.node, i);
7542
7558
  if (s != null) {
7543
- const l = i.state.selection, d = i.state.doc, { from: u, to: p } = _n(l, d), h = u <= s && s < p, m = l.$anchor.node() !== l.$head.node() || l instanceof G;
7559
+ const l = i.state.selection, d = i.state.doc, { from: u, to: p } = yn(l, d), h = u <= s && s < p, m = l.$anchor.node() !== l.$head.node() || l instanceof W;
7544
7560
  h && m ? (i.dispatch(
7545
- i.state.tr.setSelection(G.create(d, u, p))
7546
- ), Je(i, u, p)) : (i.dispatch(
7547
- i.state.tr.setSelection(ce.create(i.state.doc, s))
7548
- ), Je(i, s));
7549
- const f = i.state.selection.content(), g = t.pmSchema, v = Be(g, t).serializeProseMirrorFragment(
7550
- f.content,
7551
- {}
7552
- ), y = ue(g, t).exportProseMirrorFragment(
7561
+ i.state.tr.setSelection(W.create(d, u, p))
7562
+ ), Ze(i, u, p)) : (i.dispatch(
7563
+ i.state.tr.setSelection(pe.create(i.state.doc, s))
7564
+ ), Ze(i, s));
7565
+ const f = i.state.selection.content(), g = t.pmSchema, _ = et.__serializeForClipboard(
7566
+ i,
7567
+ f
7568
+ ).dom.innerHTML, b = he(g, t).exportProseMirrorFragment(
7553
7569
  f.content,
7554
7570
  {}
7555
- ), S = Ne(y);
7556
- e.dataTransfer.clearData(), e.dataTransfer.setData("blocknote/html", v), e.dataTransfer.setData("text/html", y), e.dataTransfer.setData("text/plain", S), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setDragImage(A, 0, 0), i.dragging = { slice: f, move: !0 };
7571
+ ), w = Ae(b);
7572
+ e.dataTransfer.clearData(), e.dataTransfer.setData("blocknote/html", _), e.dataTransfer.setData("text/html", b), e.dataTransfer.setData("text/plain", w), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setDragImage(N, 0, 0), i.dragging = { slice: f, move: !0 };
7557
7573
  }
7558
7574
  }
7559
- class yn {
7575
+ class vn {
7560
7576
  constructor(t, i, o) {
7561
7577
  c(this, "state");
7562
7578
  c(this, "emitUpdate");
@@ -7588,7 +7604,7 @@ class yn {
7588
7604
  let n;
7589
7605
  for (const u of o)
7590
7606
  if (this.pmView.dom.contains(u)) {
7591
- n = ge(u, this.pmView);
7607
+ n = _e(u, this.pmView);
7592
7608
  break;
7593
7609
  }
7594
7610
  if (!n || !this.editor.isEditable) {
@@ -7705,7 +7721,7 @@ class yn {
7705
7721
  ), this.pmView.root.addEventListener(
7706
7722
  "dragover",
7707
7723
  this.onDragOver
7708
- ), ie(), this.pmView.dom.addEventListener("dragstart", this.onDragStart), this.pmView.root.addEventListener(
7724
+ ), oe(), this.pmView.dom.addEventListener("dragstart", this.onDragStart), this.pmView.root.addEventListener(
7709
7725
  "mousemove",
7710
7726
  this.onMouseMove,
7711
7727
  !0
@@ -7756,7 +7772,7 @@ class yn {
7756
7772
  });
7757
7773
  if (!o)
7758
7774
  return;
7759
- const n = _(
7775
+ const n = k(
7760
7776
  this.editor._tiptapEditor.state.doc,
7761
7777
  o.pos
7762
7778
  );
@@ -7771,8 +7787,8 @@ class yn {
7771
7787
  this.editor.openSuggestionMenu("/");
7772
7788
  }
7773
7789
  }
7774
- const wn = new L("SideMenuPlugin");
7775
- class vn extends Z {
7790
+ const xn = new B("SideMenuPlugin");
7791
+ class En extends J {
7776
7792
  constructor(i) {
7777
7793
  super();
7778
7794
  c(this, "view");
@@ -7786,7 +7802,7 @@ class vn extends Z {
7786
7802
  * Handles drag & drop events for blocks.
7787
7803
  */
7788
7804
  c(this, "blockDragStart", (i) => {
7789
- this.view.isDragging = !0, kn(i, this.editor);
7805
+ this.view.isDragging = !0, wn(i, this.editor);
7790
7806
  });
7791
7807
  /**
7792
7808
  * Handles drag & drop events for blocks.
@@ -7806,9 +7822,9 @@ class vn extends Z {
7806
7822
  c(this, "unfreezeMenu", () => {
7807
7823
  this.view.menuFrozen = !1, this.view.state.show = !1, this.view.emitUpdate(this.view.state);
7808
7824
  });
7809
- this.editor = i, this.plugin = new x({
7810
- key: wn,
7811
- view: (o) => (this.view = new yn(i, o, (n) => {
7825
+ this.editor = i, this.plugin = new v({
7826
+ key: xn,
7827
+ view: (o) => (this.view = new vn(i, o, (n) => {
7812
7828
  this.emit("update", n);
7813
7829
  }), this.view)
7814
7830
  });
@@ -7817,8 +7833,8 @@ class vn extends Z {
7817
7833
  return this.on("update", i);
7818
7834
  }
7819
7835
  }
7820
- const xn = Ft((e) => e.type.name === "blockContainer");
7821
- class En {
7836
+ const Cn = Ft((e) => e.type.name === "blockContainer");
7837
+ class Sn {
7822
7838
  constructor(t, i) {
7823
7839
  c(this, "state");
7824
7840
  c(this, "emitUpdate");
@@ -7838,7 +7854,7 @@ class En {
7838
7854
  c(this, "closeMenu", () => {
7839
7855
  this.editor.dispatch(
7840
7856
  this.editor._tiptapEditor.view.state.tr.setMeta(
7841
- W,
7857
+ K,
7842
7858
  null
7843
7859
  )
7844
7860
  );
@@ -7861,7 +7877,7 @@ class En {
7861
7877
  }
7862
7878
  update(t, i) {
7863
7879
  var d;
7864
- const o = W.getState(i), n = W.getState(
7880
+ const o = K.getState(i), n = K.getState(
7865
7881
  t.state
7866
7882
  ), r = o === void 0 && n !== void 0, a = o !== void 0 && n === void 0;
7867
7883
  if (!r && !(o !== void 0 && n !== void 0) && !a)
@@ -7884,8 +7900,8 @@ class En {
7884
7900
  (t = this.rootEl) == null || t.removeEventListener("scroll", this.handleScroll, !0);
7885
7901
  }
7886
7902
  }
7887
- const W = new L("SuggestionMenuPlugin");
7888
- class Cn extends Z {
7903
+ const K = new B("SuggestionMenuPlugin");
7904
+ class Mn extends J {
7889
7905
  constructor(i) {
7890
7906
  super();
7891
7907
  c(this, "view");
@@ -7903,9 +7919,9 @@ class Cn extends Z {
7903
7919
  c(this, "closeMenu", () => this.view.closeMenu());
7904
7920
  c(this, "clearQuery", () => this.view.clearQuery());
7905
7921
  const o = this.triggerCharacters;
7906
- this.plugin = new x({
7907
- key: W,
7908
- view: () => (this.view = new En(
7922
+ this.plugin = new v({
7923
+ key: K,
7924
+ view: () => (this.view = new Sn(
7909
7925
  i,
7910
7926
  (n, r) => {
7911
7927
  this.emit(`update ${n}`, r);
@@ -7919,7 +7935,7 @@ class Cn extends Z {
7919
7935
  apply(n, r, a, s) {
7920
7936
  if (n.getMeta("orderedListIndexing") !== void 0)
7921
7937
  return r;
7922
- const l = n.getMeta(W);
7938
+ const l = n.getMeta(K);
7923
7939
  if (typeof l == "object" && l !== null && r === void 0)
7924
7940
  return {
7925
7941
  triggerCharacter: l.triggerCharacter,
@@ -7951,7 +7967,7 @@ class Cn extends Z {
7951
7967
  handleTextInput(n, r, a, s) {
7952
7968
  const l = this.getState(n.state);
7953
7969
  return o.includes(s) && l === void 0 ? (n.dispatch(
7954
- n.state.tr.insertText(s).scrollIntoView().setMeta(W, {
7970
+ n.state.tr.insertText(s).scrollIntoView().setMeta(K, {
7955
7971
  triggerCharacter: s
7956
7972
  })
7957
7973
  ), !0) : !1;
@@ -7962,10 +7978,10 @@ class Cn extends Z {
7962
7978
  if (r === void 0)
7963
7979
  return null;
7964
7980
  if (!r.deleteTriggerCharacter) {
7965
- const a = xn(n.selection);
7981
+ const a = Cn(n.selection);
7966
7982
  if (a)
7967
- return K.create(n.doc, [
7968
- $.node(
7983
+ return $.create(n.doc, [
7984
+ q.node(
7969
7985
  a.pos,
7970
7986
  a.pos + a.node.nodeSize,
7971
7987
  {
@@ -7976,8 +7992,8 @@ class Cn extends Z {
7976
7992
  )
7977
7993
  ]);
7978
7994
  }
7979
- return K.create(n.doc, [
7980
- $.inline(
7995
+ return $.create(n.doc, [
7996
+ q.inline(
7981
7997
  r.queryStartPos - r.triggerCharacter.length,
7982
7998
  r.queryStartPos,
7983
7999
  {
@@ -7999,32 +8015,32 @@ class Cn extends Z {
7999
8015
  return ((o = (i = this.view) == null ? void 0 : i.state) == null ? void 0 : o.show) || !1;
8000
8016
  }
8001
8017
  }
8002
- function Rr(e, t) {
8018
+ function Fr(e, t) {
8003
8019
  e.suggestionMenus.addTriggerCharacter(t);
8004
8020
  }
8005
8021
  let E;
8006
- function Ye(e) {
8022
+ function Je(e) {
8007
8023
  E || (E = document.createElement("div"), E.innerHTML = "_", E.style.opacity = "0", E.style.height = "1px", E.style.width = "1px", e instanceof Document ? e.body.appendChild(E) : e.appendChild(E));
8008
8024
  }
8009
- function Sn(e) {
8025
+ function Tn(e) {
8010
8026
  E && (e instanceof Document ? e.body.removeChild(E) : e.removeChild(E), E = void 0);
8011
8027
  }
8012
- function re(e) {
8028
+ function se(e) {
8013
8029
  return Array.prototype.indexOf.call(e.parentElement.childNodes, e);
8014
8030
  }
8015
- function Mn(e) {
8031
+ function Bn(e) {
8016
8032
  for (; e && e.nodeName !== "TD" && e.nodeName !== "TH"; )
8017
8033
  e = e.classList && e.classList.contains("ProseMirror") ? null : e.parentNode;
8018
8034
  return e;
8019
8035
  }
8020
- function Tn(e, t) {
8036
+ function Ln(e, t) {
8021
8037
  e.forEach((i) => {
8022
8038
  const o = t.querySelectorAll(i);
8023
8039
  for (let n = 0; n < o.length; n++)
8024
8040
  o[n].style.visibility = "hidden";
8025
8041
  });
8026
8042
  }
8027
- class Bn {
8043
+ class In {
8028
8044
  constructor(t, i, o) {
8029
8045
  c(this, "state");
8030
8046
  c(this, "emitUpdate");
@@ -8043,15 +8059,15 @@ class Bn {
8043
8059
  var d, u, p, h;
8044
8060
  if (this.menuFrozen || (this.mouseState === "down" && (this.mouseState = "selecting", (d = this.state) != null && d.show && (this.state.show = !1, this.emitUpdate())), this.mouseState === "selecting"))
8045
8061
  return;
8046
- const i = Mn(t.target);
8062
+ const i = Bn(t.target);
8047
8063
  if (!i || !this.editor.isEditable) {
8048
8064
  (u = this.state) != null && u.show && (this.state.show = !1, this.emitUpdate());
8049
8065
  return;
8050
8066
  }
8051
- const o = re(i), n = re(i.parentElement), r = i.getBoundingClientRect(), a = (h = (p = i.parentElement) == null ? void 0 : p.parentElement) == null ? void 0 : h.getBoundingClientRect();
8067
+ const o = se(i), n = se(i.parentElement), r = i.getBoundingClientRect(), a = (h = (p = i.parentElement) == null ? void 0 : p.parentElement) == null ? void 0 : h.getBoundingClientRect();
8052
8068
  if (!a)
8053
8069
  return;
8054
- const s = ge(i, this.pmView);
8070
+ const s = _e(i, this.pmView);
8055
8071
  if (!s)
8056
8072
  return;
8057
8073
  let l;
@@ -8067,7 +8083,7 @@ class Bn {
8067
8083
  this.editor.schema.styleSchema,
8068
8084
  this.editor.blockCache
8069
8085
  );
8070
- return Wo("table", g, this.editor) && (this.tablePos = f + 1, l = g), !1;
8086
+ return $o("table", g, this.editor) && (this.tablePos = f + 1, l = g), !1;
8071
8087
  }), !!l && (this.tableId = s.id, !(this.state !== void 0 && this.state.show && this.tableId === s.id && this.state.rowIndex === n && this.state.colIndex === o)))
8072
8088
  return this.state = {
8073
8089
  show: !0,
@@ -8083,7 +8099,7 @@ class Bn {
8083
8099
  var h;
8084
8100
  if (((h = this.state) == null ? void 0 : h.draggingState) === void 0)
8085
8101
  return;
8086
- t.preventDefault(), t.dataTransfer.dropEffect = "move", Tn(
8102
+ t.preventDefault(), t.dataTransfer.dropEffect = "move", Ln(
8087
8103
  [
8088
8104
  "column-resize-handle",
8089
8105
  "prosemirror-dropcursor-block",
@@ -8109,11 +8125,11 @@ class Bn {
8109
8125
  );
8110
8126
  const n = o[0];
8111
8127
  let r = !1;
8112
- const a = re(n.parentElement), s = re(n), l = this.state.draggingState.draggedCellOrientation === "row" ? this.state.rowIndex : this.state.colIndex, u = (this.state.draggingState.draggedCellOrientation === "row" ? a : s) !== l;
8128
+ const a = se(n.parentElement), s = se(n), l = this.state.draggingState.draggedCellOrientation === "row" ? this.state.rowIndex : this.state.colIndex, u = (this.state.draggingState.draggedCellOrientation === "row" ? a : s) !== l;
8113
8129
  (this.state.rowIndex !== a || this.state.colIndex !== s) && (this.state.rowIndex = a, this.state.colIndex = s, this.state.referencePosCell = n.getBoundingClientRect(), r = !0);
8114
8130
  const p = this.state.draggingState.draggedCellOrientation === "row" ? i.top : i.left;
8115
8131
  this.state.draggingState.mousePos !== p && (this.state.draggingState.mousePos = p, r = !0), r && this.emitUpdate(), u && this.editor.dispatch(
8116
- this.pmView.state.tr.setMeta(Q, !0)
8132
+ this.pmView.state.tr.setMeta(ee, !0)
8117
8133
  );
8118
8134
  });
8119
8135
  c(this, "dropHandler", (t) => {
@@ -8170,8 +8186,8 @@ class Bn {
8170
8186
  ), this.pmView.root.removeEventListener("scroll", this.scrollHandler, !0);
8171
8187
  }
8172
8188
  }
8173
- const Q = new L("TableHandlesPlugin");
8174
- class Ln extends Z {
8189
+ const ee = new B("TableHandlesPlugin");
8190
+ class An extends J {
8175
8191
  constructor(i) {
8176
8192
  super();
8177
8193
  c(this, "view");
@@ -8190,13 +8206,13 @@ class Ln extends Z {
8190
8206
  originalIndex: this.view.state.colIndex,
8191
8207
  mousePos: i.clientX
8192
8208
  }, this.view.emitUpdate(), this.editor.dispatch(
8193
- this.editor._tiptapEditor.state.tr.setMeta(Q, {
8209
+ this.editor._tiptapEditor.state.tr.setMeta(ee, {
8194
8210
  draggedCellOrientation: this.view.state.draggingState.draggedCellOrientation,
8195
8211
  originalIndex: this.view.state.colIndex,
8196
8212
  newIndex: this.view.state.colIndex,
8197
8213
  tablePos: this.view.tablePos
8198
8214
  })
8199
- ), Ye(this.editor._tiptapEditor.view.root), i.dataTransfer.setDragImage(E, 0, 0), i.dataTransfer.effectAllowed = "move";
8215
+ ), Je(this.editor._tiptapEditor.view.root), i.dataTransfer.setDragImage(E, 0, 0), i.dataTransfer.effectAllowed = "move";
8200
8216
  });
8201
8217
  /**
8202
8218
  * Callback that should be set on the `dragStart` event for whichever element
@@ -8212,13 +8228,13 @@ class Ln extends Z {
8212
8228
  originalIndex: this.view.state.rowIndex,
8213
8229
  mousePos: i.clientY
8214
8230
  }, this.view.emitUpdate(), this.editor.dispatch(
8215
- this.editor._tiptapEditor.state.tr.setMeta(Q, {
8231
+ this.editor._tiptapEditor.state.tr.setMeta(ee, {
8216
8232
  draggedCellOrientation: this.view.state.draggingState.draggedCellOrientation,
8217
8233
  originalIndex: this.view.state.rowIndex,
8218
8234
  newIndex: this.view.state.rowIndex,
8219
8235
  tablePos: this.view.tablePos
8220
8236
  })
8221
- ), Ye(this.editor._tiptapEditor.view.root), i.dataTransfer.setDragImage(E, 0, 0), i.dataTransfer.effectAllowed = "copyMove";
8237
+ ), Je(this.editor._tiptapEditor.view.root), i.dataTransfer.setDragImage(E, 0, 0), i.dataTransfer.effectAllowed = "copyMove";
8222
8238
  });
8223
8239
  /**
8224
8240
  * Callback that should be set on the `dragEnd` event for both the element
@@ -8230,8 +8246,8 @@ class Ln extends Z {
8230
8246
  "Attempted to drag table row, but no table block was hovered prior."
8231
8247
  );
8232
8248
  this.view.state.draggingState = void 0, this.view.emitUpdate(), this.editor.dispatch(
8233
- this.editor._tiptapEditor.state.tr.setMeta(Q, null)
8234
- ), Sn(this.editor._tiptapEditor.view.root);
8249
+ this.editor._tiptapEditor.state.tr.setMeta(ee, null)
8250
+ ), Tn(this.editor._tiptapEditor.view.root);
8235
8251
  });
8236
8252
  /**
8237
8253
  * Freezes the drag handles. When frozen, they will stay attached to the same
@@ -8247,9 +8263,9 @@ class Ln extends Z {
8247
8263
  c(this, "unfreezeHandles", () => {
8248
8264
  this.view.menuFrozen = !1;
8249
8265
  });
8250
- this.editor = i, this.plugin = new x({
8251
- key: Q,
8252
- view: (o) => (this.view = new Bn(i, o, (n) => {
8266
+ this.editor = i, this.plugin = new v({
8267
+ key: ee,
8268
+ view: (o) => (this.view = new In(i, o, (n) => {
8253
8269
  this.emit("update", n);
8254
8270
  }), this.view),
8255
8271
  // We use decorations to render the drop cursor when dragging a table row
@@ -8260,7 +8276,7 @@ class Ln extends Z {
8260
8276
  return;
8261
8277
  const n = this.view.state.draggingState.draggedCellOrientation === "row" ? this.view.state.rowIndex : this.view.state.colIndex, r = [];
8262
8278
  if (n === this.view.state.draggingState.originalIndex)
8263
- return K.create(o.doc, r);
8279
+ return $.create(o.doc, r);
8264
8280
  const a = o.doc.resolve(this.view.tablePos + 1), s = a.node();
8265
8281
  if (this.view.state.draggingState.draggedCellOrientation === "row") {
8266
8282
  const l = o.doc.resolve(
@@ -8272,7 +8288,7 @@ class Ln extends Z {
8272
8288
  ), h = p.node(), m = p.pos + (n > this.view.state.draggingState.originalIndex ? h.nodeSize - 2 : 0);
8273
8289
  r.push(
8274
8290
  // The widget is a small bar which spans the width of the cell.
8275
- $.widget(m, () => {
8291
+ q.widget(m, () => {
8276
8292
  const f = document.createElement("div");
8277
8293
  return f.className = "bn-table-drop-cursor", f.style.left = "0", f.style.right = "0", n > this.view.state.draggingState.originalIndex ? f.style.bottom = "-2px" : f.style.top = "-3px", f.style.height = "4px", f;
8278
8294
  })
@@ -8287,13 +8303,13 @@ class Ln extends Z {
8287
8303
  ), p = u.node(), h = u.pos + (n > this.view.state.draggingState.originalIndex ? p.nodeSize - 2 : 0);
8288
8304
  r.push(
8289
8305
  // The widget is a small bar which spans the height of the cell.
8290
- $.widget(h, () => {
8306
+ q.widget(h, () => {
8291
8307
  const m = document.createElement("div");
8292
8308
  return m.className = "bn-table-drop-cursor", m.style.top = "0", m.style.bottom = "0", n > this.view.state.draggingState.originalIndex ? m.style.right = "-2px" : m.style.left = "-3px", m.style.width = "4px", m;
8293
8309
  })
8294
8310
  );
8295
8311
  }
8296
- return K.create(o.doc, r);
8312
+ return $.create(o.doc, r);
8297
8313
  }
8298
8314
  }
8299
8315
  });
@@ -8303,44 +8319,56 @@ class Ln extends Z {
8303
8319
  }
8304
8320
  }
8305
8321
  async function Et(e, t) {
8306
- const i = e.state.selection.content().content, n = Be(
8307
- e.state.schema,
8308
- t
8309
- ).serializeProseMirrorFragment(
8310
- i,
8311
- {}
8322
+ "node" in e.state.selection && e.state.selection.node.type.spec.group === "blockContent" && t.dispatch(
8323
+ t._tiptapEditor.state.tr.setSelection(
8324
+ new pe(e.state.doc.resolve(e.state.selection.from - 1))
8325
+ )
8312
8326
  );
8313
- await ie();
8314
- const a = ue(
8327
+ const i = et.__serializeForClipboard(
8328
+ e,
8329
+ e.state.selection.content()
8330
+ ).dom.innerHTML;
8331
+ let o = e.state.selection.content().content, n = !1;
8332
+ const r = e.state.selection instanceof ri;
8333
+ if (!r) {
8334
+ const d = e.state.doc.slice(
8335
+ e.state.selection.from,
8336
+ e.state.selection.to,
8337
+ !1
8338
+ ).content, u = [];
8339
+ for (let p = 0; p < d.childCount; p++)
8340
+ u.push(d.child(p));
8341
+ n = u.find(
8342
+ (p) => p.type.name === "blockContainer" || p.type.name === "blockGroup" || p.type.spec.group === "blockContent"
8343
+ ) === void 0, n && (o = d);
8344
+ }
8345
+ await oe();
8346
+ const s = he(
8315
8347
  e.state.schema,
8316
8348
  t
8317
8349
  ).exportProseMirrorFragment(
8318
- i,
8319
- {}
8320
- ), s = await Ne(a);
8321
- return { internalHTML: n, externalHTML: a, plainText: s };
8322
- }
8323
- const Qe = (e, t, i) => {
8324
- i.preventDefault(), i.clipboardData.clearData(), "node" in t.state.selection && t.state.selection.node.type.spec.group === "blockContent" && e.dispatch(
8325
- e._tiptapEditor.state.tr.setSelection(
8326
- new ce(t.state.doc.resolve(t.state.selection.from - 1))
8327
- )
8328
- ), (async () => {
8329
- const { internalHTML: o, externalHTML: n, plainText: r } = await Et(t, e);
8350
+ o,
8351
+ { simplifyBlocks: !n && !r }
8352
+ ), l = Ae(s);
8353
+ return { clipboardHTML: i, externalHTML: s, markdown: l };
8354
+ }
8355
+ const Ye = (e, t, i) => {
8356
+ i.preventDefault(), i.clipboardData.clearData(), (async () => {
8357
+ const { clipboardHTML: o, externalHTML: n, markdown: r } = await Et(t, e);
8330
8358
  i.clipboardData.setData("blocknote/html", o), i.clipboardData.setData("text/html", n), i.clipboardData.setData("text/plain", r);
8331
8359
  })();
8332
- }, In = (e) => I.create({
8360
+ }, Nn = (e) => A.create({
8333
8361
  name: "copyToClipboard",
8334
8362
  addProseMirrorPlugins() {
8335
8363
  return [
8336
- new x({
8364
+ new v({
8337
8365
  props: {
8338
8366
  handleDOMEvents: {
8339
8367
  copy(t, i) {
8340
- return Qe(e, t, i), !0;
8368
+ return Ye(e, t, i), !0;
8341
8369
  },
8342
8370
  cut(t, i) {
8343
- return Qe(e, t, i), t.dispatch(t.state.tr.deleteSelection()), !0;
8371
+ return Ye(e, t, i), t.dispatch(t.state.tr.deleteSelection()), !0;
8344
8372
  },
8345
8373
  // This is for the use-case in which only a block without content
8346
8374
  // is selected, e.g. an image block, and dragged (not using the
@@ -8349,12 +8377,12 @@ const Qe = (e, t, i) => {
8349
8377
  if ("node" in t.state.selection && t.state.selection.node.type.spec.group === "blockContent")
8350
8378
  return e.dispatch(
8351
8379
  e._tiptapEditor.state.tr.setSelection(
8352
- new ce(
8380
+ new pe(
8353
8381
  t.state.doc.resolve(t.state.selection.from - 1)
8354
8382
  )
8355
8383
  )
8356
8384
  ), i.preventDefault(), i.dataTransfer.clearData(), (async () => {
8357
- const { internalHTML: o, externalHTML: n, plainText: r } = await Et(t, e);
8385
+ const { clipboardHTML: o, externalHTML: n, markdown: r } = await Et(t, e);
8358
8386
  i.dataTransfer.setData("blocknote/html", o), i.dataTransfer.setData("text/html", n), i.dataTransfer.setData("text/plain", r);
8359
8387
  })(), !0;
8360
8388
  }
@@ -8363,18 +8391,18 @@ const Qe = (e, t, i) => {
8363
8391
  })
8364
8392
  ];
8365
8393
  }
8366
- }), Pe = [
8394
+ }), Ne = [
8367
8395
  "blocknote/html",
8368
8396
  "Files",
8369
8397
  "text/html",
8370
8398
  "text/plain"
8371
8399
  ];
8372
- function An(e, t) {
8400
+ function Pn(e, t) {
8373
8401
  if (!e.startsWith(".") || !t.startsWith("."))
8374
8402
  throw new Error("The strings provided are not valid file extensions.");
8375
8403
  return e === t;
8376
8404
  }
8377
- function Nn(e, t) {
8405
+ function Hn(e, t) {
8378
8406
  const i = e.split("/"), o = t.split("/");
8379
8407
  if (i.length !== 2)
8380
8408
  throw new Error(`The string ${e} is not a valid MIME type.`);
@@ -8389,7 +8417,7 @@ async function Ct(e, t) {
8389
8417
  if (i === null)
8390
8418
  return;
8391
8419
  let o = null;
8392
- for (const a of Pe)
8420
+ for (const a of Ne)
8393
8421
  if (i.types.includes(a)) {
8394
8422
  o = a;
8395
8423
  break;
@@ -8408,7 +8436,7 @@ async function Ct(e, t) {
8408
8436
  for (const d of r)
8409
8437
  for (const u of d.fileBlockAccept || []) {
8410
8438
  const p = u.startsWith("."), h = n[a].getAsFile();
8411
- if (h && (!p && h.type && Nn(n[a].type, u) || p && An(
8439
+ if (h && (!p && h.type && Hn(n[a].type, u) || p && Pn(
8412
8440
  "." + h.name.split(".").pop(),
8413
8441
  u
8414
8442
  ))) {
@@ -8438,7 +8466,7 @@ async function Ct(e, t) {
8438
8466
  }, f = t._tiptapEditor.view.posAtCoords(m);
8439
8467
  if (!f)
8440
8468
  return;
8441
- const g = _(
8469
+ const g = k(
8442
8470
  t._tiptapEditor.state.doc,
8443
8471
  f.pos
8444
8472
  );
@@ -8458,18 +8486,18 @@ async function Ct(e, t) {
8458
8486
  }
8459
8487
  }
8460
8488
  }
8461
- const Pn = (e) => I.create({
8489
+ const Un = (e) => A.create({
8462
8490
  name: "dropFile",
8463
8491
  addProseMirrorPlugins() {
8464
8492
  return [
8465
- new x({
8493
+ new v({
8466
8494
  props: {
8467
8495
  handleDOMEvents: {
8468
8496
  drop(t, i) {
8469
8497
  if (!e.isEditable)
8470
8498
  return;
8471
8499
  let o = null;
8472
- for (const n of Pe)
8500
+ for (const n of Ne)
8473
8501
  if (i.dataTransfer.types.includes(n)) {
8474
8502
  o = n;
8475
8503
  break;
@@ -8481,35 +8509,35 @@ const Pn = (e) => I.create({
8481
8509
  })
8482
8510
  ];
8483
8511
  }
8484
- }), Hn = (e) => I.create({
8512
+ }), Dn = (e) => A.create({
8485
8513
  name: "pasteFromClipboard",
8486
8514
  addProseMirrorPlugins() {
8487
8515
  return [
8488
- new x({
8516
+ new v({
8489
8517
  props: {
8490
8518
  handleDOMEvents: {
8491
8519
  paste(t, i) {
8492
8520
  if (i.preventDefault(), !e.isEditable)
8493
8521
  return;
8494
- let o = null;
8495
- for (const r of Pe)
8522
+ let o;
8523
+ for (const r of Ne)
8496
8524
  if (i.clipboardData.types.includes(r)) {
8497
8525
  o = r;
8498
8526
  break;
8499
8527
  }
8500
- if (o === null)
8528
+ if (!o)
8501
8529
  return !0;
8502
8530
  if (o === "Files")
8503
8531
  return Ct(i, e), !0;
8504
8532
  let n = i.clipboardData.getData(o);
8505
- return o === "text/html" && (n = wt(n.trim()).innerHTML), e._tiptapEditor.view.pasteHTML(n), !0;
8533
+ return o === "blocknote/html" ? (e._tiptapEditor.view.pasteHTML(n), !0) : o === "text/html" ? (n = wt(n.trim()).innerHTML, e._tiptapEditor.view.pasteHTML(n), !0) : (e._tiptapEditor.view.pasteText(n), !0);
8506
8534
  }
8507
8535
  }
8508
8536
  }
8509
8537
  })
8510
8538
  ];
8511
8539
  }
8512
- }), Un = I.create({
8540
+ }), jn = A.create({
8513
8541
  name: "blockBackgroundColor",
8514
8542
  addGlobalAttributes() {
8515
8543
  return [
@@ -8517,9 +8545,9 @@ const Pn = (e) => I.create({
8517
8545
  types: ["blockContainer"],
8518
8546
  attributes: {
8519
8547
  backgroundColor: {
8520
- default: w.backgroundColor.default,
8521
- parseHTML: (e) => e.hasAttribute("data-background-color") ? e.getAttribute("data-background-color") : w.backgroundColor.default,
8522
- renderHTML: (e) => e.backgroundColor === w.backgroundColor.default ? {} : {
8548
+ default: y.backgroundColor.default,
8549
+ parseHTML: (e) => e.hasAttribute("data-background-color") ? e.getAttribute("data-background-color") : y.backgroundColor.default,
8550
+ renderHTML: (e) => e.backgroundColor === y.backgroundColor.default ? {} : {
8523
8551
  "data-background-color": e.backgroundColor
8524
8552
  }
8525
8553
  }
@@ -8527,7 +8555,7 @@ const Pn = (e) => I.create({
8527
8555
  }
8528
8556
  ];
8529
8557
  }
8530
- }), Dn = I.create({
8558
+ }), zn = A.create({
8531
8559
  name: "textAlignment",
8532
8560
  addGlobalAttributes() {
8533
8561
  return [
@@ -8553,7 +8581,7 @@ const Pn = (e) => I.create({
8553
8581
  }
8554
8582
  ];
8555
8583
  }
8556
- }), jn = I.create({
8584
+ }), Rn = A.create({
8557
8585
  name: "blockTextColor",
8558
8586
  addGlobalAttributes() {
8559
8587
  return [
@@ -8561,9 +8589,9 @@ const Pn = (e) => I.create({
8561
8589
  types: ["blockContainer"],
8562
8590
  attributes: {
8563
8591
  textColor: {
8564
- default: w.textColor.default,
8565
- parseHTML: (e) => e.hasAttribute("data-text-color") ? e.getAttribute("data-text-color") : w.textColor.default,
8566
- renderHTML: (e) => e.textColor === w.textColor.default ? {} : {
8592
+ default: y.textColor.default,
8593
+ parseHTML: (e) => e.hasAttribute("data-text-color") ? e.getAttribute("data-text-color") : y.textColor.default,
8594
+ renderHTML: (e) => e.textColor === y.textColor.default ? {} : {
8567
8595
  "data-text-color": e.textColor
8568
8596
  }
8569
8597
  }
@@ -8571,12 +8599,12 @@ const Pn = (e) => I.create({
8571
8599
  }
8572
8600
  ];
8573
8601
  }
8574
- }), zn = I.create({
8602
+ }), Vn = A.create({
8575
8603
  name: "trailingNode",
8576
8604
  addProseMirrorPlugins() {
8577
- const e = new L(this.name);
8605
+ const e = new B(this.name);
8578
8606
  return [
8579
- new x({
8607
+ new v({
8580
8608
  key: e,
8581
8609
  appendTransaction: (t, i, o) => {
8582
8610
  const { doc: n, tr: r, schema: a } = o, s = e.getState(o), l = n.content.size - 2, d = a.nodes.blockContainer, u = a.nodes.paragraph;
@@ -8606,8 +8634,8 @@ const Pn = (e) => I.create({
8606
8634
  })
8607
8635
  ];
8608
8636
  }
8609
- }), Rn = new L("non-editable-block"), Vn = () => new x({
8610
- key: Rn,
8637
+ }), On = new B("non-editable-block"), Fn = () => new v({
8638
+ key: On,
8611
8639
  props: {
8612
8640
  handleKeyDown: (e, t) => {
8613
8641
  if ("node" in e.state.selection) {
@@ -8622,7 +8650,7 @@ const Pn = (e) => I.create({
8622
8650
  e.state.tr.selection.$to.after(),
8623
8651
  e.state.schema.nodes.paragraph.create()
8624
8652
  ).setSelection(
8625
- new Y(
8653
+ new Q(
8626
8654
  i.doc.resolve(e.state.tr.selection.$to.after() + 1)
8627
8655
  )
8628
8656
  )
@@ -8632,13 +8660,13 @@ const Pn = (e) => I.create({
8632
8660
  return !1;
8633
8661
  }
8634
8662
  }
8635
- }), On = {
8663
+ }), Gn = {
8636
8664
  blockColor: "data-block-color",
8637
8665
  blockStyle: "data-block-style",
8638
8666
  id: "data-id",
8639
8667
  depth: "data-depth",
8640
8668
  depthChange: "data-depth-change"
8641
- }, Fn = q.create({
8669
+ }, Wn = X.create({
8642
8670
  name: "blockContainer",
8643
8671
  group: "blockContainer",
8644
8672
  // A block always contains content, and optionally a blockGroup which contains nested blocks
@@ -8654,7 +8682,7 @@ const Pn = (e) => I.create({
8654
8682
  if (typeof e == "string")
8655
8683
  return !1;
8656
8684
  const t = {};
8657
- for (const [i, o] of Object.entries(On))
8685
+ for (const [i, o] of Object.entries(Gn))
8658
8686
  e.getAttribute(o) && (t[i] = e.getAttribute(o));
8659
8687
  return e.getAttribute("data-node-type") === "blockContainer" ? t : !1;
8660
8688
  }
@@ -8671,7 +8699,7 @@ const Pn = (e) => I.create({
8671
8699
  ...((n = this.options.domAttributes) == null ? void 0 : n.block) || {},
8672
8700
  ...e
8673
8701
  }, o = document.createElement("div");
8674
- o.className = V("bn-block", i.class), o.setAttribute("data-node-type", this.name);
8702
+ o.className = O("bn-block", i.class), o.setAttribute("data-node-type", this.name);
8675
8703
  for (const [r, a] of Object.entries(i))
8676
8704
  r !== "class" && o.setAttribute(r, a);
8677
8705
  return t.appendChild(o), {
@@ -8688,7 +8716,7 @@ const Pn = (e) => I.create({
8688
8716
  },
8689
8717
  // Deletes a block at a given position.
8690
8718
  BNDeleteBlock: (e) => ({ state: t, dispatch: i }) => {
8691
- const o = _(t.doc, e);
8719
+ const o = k(t.doc, e);
8692
8720
  if (o === void 0)
8693
8721
  return !1;
8694
8722
  const { startPos: n, endPos: r } = o;
@@ -8696,7 +8724,7 @@ const Pn = (e) => I.create({
8696
8724
  },
8697
8725
  // Updates a block at a given position.
8698
8726
  BNUpdateBlock: (e, t) => ({ state: i, dispatch: o }) => {
8699
- const n = _(i.doc, e);
8727
+ const n = k(i.doc, e);
8700
8728
  if (n === void 0)
8701
8729
  return !1;
8702
8730
  const { startPos: r, endPos: a, node: s, contentNode: l } = n;
@@ -8714,7 +8742,7 @@ const Pn = (e) => I.create({
8714
8742
  s.childCount === 2 ? i.tr.replace(
8715
8743
  r + l.nodeSize + 1,
8716
8744
  a - 1,
8717
- new z(N.from(h), 0, 0)
8745
+ new z(I.from(h), 0, 0)
8718
8746
  ) : i.tr.insert(
8719
8747
  r + l.nodeSize,
8720
8748
  i.schema.nodes.blockGroup.create({}, h)
@@ -8724,13 +8752,13 @@ const Pn = (e) => I.create({
8724
8752
  let p = "keep";
8725
8753
  if (t.content)
8726
8754
  if (typeof t.content == "string")
8727
- p = R(
8755
+ p = V(
8728
8756
  [t.content],
8729
8757
  i.schema,
8730
8758
  this.options.editor.schema.styleSchema
8731
8759
  );
8732
8760
  else if (Array.isArray(t.content))
8733
- p = R(
8761
+ p = V(
8734
8762
  t.content,
8735
8763
  i.schema,
8736
8764
  this.options.editor.schema.styleSchema
@@ -8765,11 +8793,11 @@ const Pn = (e) => I.create({
8765
8793
  p
8766
8794
  )
8767
8795
  ).setSelection(
8768
- i.schema.nodes[u].spec.content === "" ? new ce(i.tr.doc.resolve(r)) : i.schema.nodes[u].spec.content === "inline*" ? new Y(i.tr.doc.resolve(r)) : (
8796
+ i.schema.nodes[u].spec.content === "" ? new pe(i.tr.doc.resolve(r)) : i.schema.nodes[u].spec.content === "inline*" ? new Q(i.tr.doc.resolve(r)) : (
8769
8797
  // Need to offset the position as we have to get through the
8770
8798
  // `tableRow` and `tableCell` nodes to get to the
8771
8799
  // `tableParagraph` node we want to set the selection in.
8772
- new Y(i.tr.doc.resolve(r + 4))
8800
+ new Q(i.tr.doc.resolve(r + 4))
8773
8801
  )
8774
8802
  ), i.tr.setNodeMarkup(r - 1, void 0, {
8775
8803
  ...s.attrs,
@@ -8799,7 +8827,7 @@ const Pn = (e) => I.create({
8799
8827
  const o = t.doc.resolve(e + 1).node().type.name === "blockContainer", n = t.doc.resolve(e - 1).node().type.name === "blockContainer";
8800
8828
  if (!o || !n)
8801
8829
  return !1;
8802
- const r = _(
8830
+ const r = k(
8803
8831
  t.doc,
8804
8832
  e + 1
8805
8833
  ), { node: a, contentNode: s, startPos: l, endPos: d, depth: u } = r;
@@ -8809,9 +8837,9 @@ const Pn = (e) => I.create({
8809
8837
  ), f = t.doc.resolve(d - 1), g = m.blockRange(f);
8810
8838
  i && t.tr.lift(g, u - 1);
8811
8839
  }
8812
- let p = e - 1, h = _(t.doc, p);
8840
+ let p = e - 1, h = k(t.doc, p);
8813
8841
  for (; h.numChildBlocks > 0; )
8814
- if (p--, h = _(t.doc, p), h === void 0)
8842
+ if (p--, h = k(t.doc, p), h === void 0)
8815
8843
  return !1;
8816
8844
  return i && (i(
8817
8845
  t.tr.deleteRange(l, l + s.nodeSize).replace(
@@ -8820,7 +8848,7 @@ const Pn = (e) => I.create({
8820
8848
  new z(s.content, 0, 0)
8821
8849
  ).scrollIntoView()
8822
8850
  ), t.tr.setSelection(
8823
- new Y(t.doc.resolve(p - 1))
8851
+ new Q(t.doc.resolve(p - 1))
8824
8852
  )), !0;
8825
8853
  },
8826
8854
  // Splits a block at a given position. Content after the position is moved to a new block below, at the same
@@ -8830,7 +8858,7 @@ const Pn = (e) => I.create({
8830
8858
  // - `keepProps` is usually true when `keepType` is true, except for when
8831
8859
  // creating new list item blocks with Enter.
8832
8860
  BNSplitBlock: (e, t, i) => ({ state: o, dispatch: n }) => {
8833
- const r = _(o.doc, e);
8861
+ const r = k(o.doc, e);
8834
8862
  if (r === void 0)
8835
8863
  return !1;
8836
8864
  const { contentNode: a, contentType: s, startPos: l, endPos: d, depth: u } = r, p = o.doc.cut(l + 1, e), h = o.doc.cut(e, d - 1), m = o.schema.nodes.blockContainer.createAndFill(), f = d + 1, g = f + 2;
@@ -8838,7 +8866,7 @@ const Pn = (e) => I.create({
8838
8866
  g,
8839
8867
  g + 1,
8840
8868
  h.content.size > 0 ? new z(
8841
- N.from(h),
8869
+ I.from(h),
8842
8870
  u + 2,
8843
8871
  u + 2
8844
8872
  ) : void 0
@@ -8848,12 +8876,12 @@ const Pn = (e) => I.create({
8848
8876
  o.schema.node(s).type,
8849
8877
  i ? a.attrs : void 0
8850
8878
  ), o.tr.setSelection(
8851
- new Y(o.doc.resolve(g))
8879
+ new Q(o.doc.resolve(g))
8852
8880
  ), o.tr.replace(
8853
8881
  l + 1,
8854
8882
  d - 1,
8855
8883
  p.content.size > 0 ? new z(
8856
- N.from(p),
8884
+ I.from(p),
8857
8885
  u + 2,
8858
8886
  u + 2
8859
8887
  ) : void 0
@@ -8862,7 +8890,7 @@ const Pn = (e) => I.create({
8862
8890
  };
8863
8891
  },
8864
8892
  addProseMirrorPlugins() {
8865
- return [Vn()];
8893
+ return [Fn()];
8866
8894
  },
8867
8895
  addKeyboardShortcuts() {
8868
8896
  return {
@@ -8873,7 +8901,7 @@ const Pn = (e) => I.create({
8873
8901
  () => o.undoInputRule(),
8874
8902
  // Reverts block content type to a paragraph if the selection is at the start of the block.
8875
8903
  () => o.command(({ state: n }) => {
8876
- const { contentType: r, startPos: a } = _(
8904
+ const { contentType: r, startPos: a } = k(
8877
8905
  n.doc,
8878
8906
  n.selection.from
8879
8907
  ), s = n.selection.from === a + 1, l = r.name === "paragraph";
@@ -8884,7 +8912,7 @@ const Pn = (e) => I.create({
8884
8912
  }),
8885
8913
  // Removes a level of nesting if the block is indented if the selection is at the start of the block.
8886
8914
  () => o.command(({ state: n }) => {
8887
- const { startPos: r } = _(
8915
+ const { startPos: r } = k(
8888
8916
  n.doc,
8889
8917
  n.selection.from
8890
8918
  );
@@ -8893,7 +8921,7 @@ const Pn = (e) => I.create({
8893
8921
  // Merges block with the previous one if it isn't indented, isn't the first block in the doc, and the selection
8894
8922
  // is at the start of the block.
8895
8923
  () => o.command(({ state: n }) => {
8896
- const { depth: r, startPos: a } = _(
8924
+ const { depth: r, startPos: a } = k(
8897
8925
  n.doc,
8898
8926
  n.selection.from
8899
8927
  ), s = n.selection.from === a + 1, l = n.selection.empty, d = a === 2, u = a - 1;
@@ -8907,7 +8935,7 @@ const Pn = (e) => I.create({
8907
8935
  // if one exists, the block has no children, and the selection is at the
8908
8936
  // end of the block.
8909
8937
  () => o.command(({ state: n }) => {
8910
- const { node: r, depth: a, endPos: s } = _(
8938
+ const { node: r, depth: a, endPos: s } = k(
8911
8939
  n.doc,
8912
8940
  n.selection.from
8913
8941
  ), l = s === n.doc.nodeSize - 4, d = n.selection.from === s - 1, u = n.selection.empty, p = r.childCount === 2;
@@ -8924,7 +8952,7 @@ const Pn = (e) => I.create({
8924
8952
  // Removes a level of nesting if the block is empty & indented, while the selection is also empty & at the start
8925
8953
  // of the block.
8926
8954
  () => o.command(({ state: n }) => {
8927
- const { contentNode: r, depth: a } = _(
8955
+ const { contentNode: r, depth: a } = k(
8928
8956
  n.doc,
8929
8957
  n.selection.from
8930
8958
  ), s = n.selection.$anchor.parentOffset === 0, l = n.selection.anchor === n.selection.head, d = r.childCount === 0, u = a > 2;
@@ -8933,7 +8961,7 @@ const Pn = (e) => I.create({
8933
8961
  // Creates a new block and moves the selection to it if the current one is empty, while the selection is also
8934
8962
  // empty & at the start of the block.
8935
8963
  () => o.command(({ state: n, chain: r }) => {
8936
- const { contentNode: a, endPos: s } = _(
8964
+ const { contentNode: a, endPos: s } = k(
8937
8965
  n.doc,
8938
8966
  n.selection.from
8939
8967
  ), l = n.selection.$anchor.parentOffset === 0, d = n.selection.anchor === n.selection.head, u = a.childCount === 0;
@@ -8946,7 +8974,7 @@ const Pn = (e) => I.create({
8946
8974
  // Splits the current block, moving content inside that's after the cursor to a new text block below. Also
8947
8975
  // deletes the selection beforehand, if it's not empty.
8948
8976
  () => o.command(({ state: n, chain: r }) => {
8949
- const { contentNode: a } = _(
8977
+ const { contentNode: a } = k(
8950
8978
  n.doc,
8951
8979
  n.selection.from
8952
8980
  ), s = n.selection.$anchor.parentOffset === 0;
@@ -8969,7 +8997,7 @@ const Pn = (e) => I.create({
8969
8997
  }
8970
8998
  };
8971
8999
  }
8972
- }), Gn = q.create({
9000
+ }), Kn = X.create({
8973
9001
  name: "blockGroup",
8974
9002
  group: "blockGroup",
8975
9003
  content: "blockContainer+",
@@ -8987,7 +9015,7 @@ const Pn = (e) => I.create({
8987
9015
  ...((o = this.options.domAttributes) == null ? void 0 : o.blockGroup) || {},
8988
9016
  ...e
8989
9017
  }, i = document.createElement("div");
8990
- i.className = V(
9018
+ i.className = O(
8991
9019
  "bn-block-group",
8992
9020
  t.class
8993
9021
  ), i.setAttribute("data-node-type", "blockGroup");
@@ -8998,31 +9026,31 @@ const Pn = (e) => I.create({
8998
9026
  contentDOM: i
8999
9027
  };
9000
9028
  }
9001
- }), Wn = q.create({
9029
+ }), $n = X.create({
9002
9030
  name: "doc",
9003
9031
  topNode: !0,
9004
9032
  content: "blockGroup"
9005
- }), Kn = (e) => {
9033
+ }), qn = (e) => {
9006
9034
  var o;
9007
9035
  const t = [
9008
- J.ClipboardTextSerializer,
9009
- J.Commands,
9010
- J.Editable,
9011
- J.FocusEvents,
9012
- J.Tabindex,
9036
+ Y.ClipboardTextSerializer,
9037
+ Y.Commands,
9038
+ Y.Editable,
9039
+ Y.FocusEvents,
9040
+ Y.Tabindex,
9013
9041
  // DevTools,
9014
- di,
9042
+ ci,
9015
9043
  // DropCursor,
9016
- oe.configure({
9044
+ ne.configure({
9017
9045
  types: ["blockContainer"],
9018
9046
  setIdAttribute: e.setIdAttribute
9019
9047
  }),
9020
- ci.extend({ priority: 10 }),
9048
+ ui.extend({ priority: 10 }),
9021
9049
  // Comments,
9022
9050
  // basics:
9023
- hi,
9051
+ mi,
9024
9052
  // marks:
9025
- pi.extend({
9053
+ hi.extend({
9026
9054
  addKeyboardShortcuts() {
9027
9055
  return {
9028
9056
  "Mod-k": () => (this.editor.commands.toggleLink({ href: "" }), !0)
@@ -9030,11 +9058,11 @@ const Pn = (e) => I.create({
9030
9058
  }
9031
9059
  }),
9032
9060
  ...Object.values(e.styleSpecs).map((n) => n.implementation.mark),
9061
+ Rn,
9033
9062
  jn,
9034
- Un,
9035
- Dn,
9063
+ zn,
9036
9064
  // make sure escape blurs editor, so that we can tab to other elements in the host page (accessibility)
9037
- I.create({
9065
+ A.create({
9038
9066
  name: "OverrideEscape",
9039
9067
  addKeyboardShortcuts() {
9040
9068
  return {
@@ -9043,12 +9071,12 @@ const Pn = (e) => I.create({
9043
9071
  }
9044
9072
  }),
9045
9073
  // nodes
9046
- Wn,
9047
- Fn.configure({
9074
+ $n,
9075
+ Wn.configure({
9048
9076
  editor: e.editor,
9049
9077
  domAttributes: e.domAttributes
9050
9078
  }),
9051
- Gn.configure({
9079
+ Kn.configure({
9052
9080
  domAttributes: e.domAttributes
9053
9081
  }),
9054
9082
  ...Object.values(e.inlineContentSpecs).filter((n) => n.config !== "link" && n.config !== "text").map((n) => n.implementation.node.configure({
@@ -9068,17 +9096,17 @@ const Pn = (e) => I.create({
9068
9096
  domAttributes: e.domAttributes
9069
9097
  })
9070
9098
  ]),
9071
- In(e.editor),
9072
- Hn(e.editor),
9073
- Pn(e.editor),
9074
- li.configure({ width: 5, color: "#ddeeff" }),
9099
+ Nn(e.editor),
9100
+ Dn(e.editor),
9101
+ Un(e.editor),
9102
+ di.configure({ width: 5, color: "#ddeeff" }),
9075
9103
  // This needs to be at the bottom of this list, because Key events (such as enter, when selecting a /command),
9076
9104
  // should be handled before Enter handlers in other components like splitListItem
9077
- ...e.trailingBlock === void 0 || e.trailingBlock ? [zn] : []
9105
+ ...e.trailingBlock === void 0 || e.trailingBlock ? [Vn] : []
9078
9106
  ];
9079
9107
  if (e.collaboration) {
9080
9108
  if (t.push(
9081
- ai.configure({
9109
+ si.configure({
9082
9110
  fragment: e.collaboration.fragment
9083
9111
  })
9084
9112
  ), (o = e.collaboration.provider) != null && o.awareness) {
@@ -9091,7 +9119,7 @@ const Pn = (e) => I.create({
9091
9119
  return a.insertBefore(l, null), a.insertBefore(s, null), a.insertBefore(d, null), a;
9092
9120
  };
9093
9121
  t.push(
9094
- si.configure({
9122
+ li.configure({
9095
9123
  user: e.collaboration.user,
9096
9124
  render: e.collaboration.renderCursor || n,
9097
9125
  provider: e.collaboration.provider
@@ -9099,24 +9127,40 @@ const Pn = (e) => I.create({
9099
9127
  );
9100
9128
  }
9101
9129
  } else
9102
- t.push(ui);
9130
+ t.push(pi);
9103
9131
  const i = e.disableExtensions || [];
9104
9132
  return t.filter((n) => !i.includes(n.name));
9105
9133
  };
9106
- function $n(e, t) {
9134
+ function Xn(e, t) {
9107
9135
  const i = [];
9108
9136
  return e.forEach((o, n, r) => {
9109
9137
  r !== t && i.push(o);
9110
- }), N.from(i);
9138
+ }), I.from(i);
9139
+ }
9140
+ function Zn(e, t) {
9141
+ const i = [];
9142
+ for (let o = 0; o < e.childCount; o++)
9143
+ if (e.child(o).type.name === "tableRow")
9144
+ if (i.length > 0 && i[i.length - 1].type.name === "table") {
9145
+ const n = i[i.length - 1], r = n.copy(n.content.addToEnd(e.child(o)));
9146
+ i[i.length - 1] = r;
9147
+ } else {
9148
+ const n = t.nodes.table.create(void 0, e.child(o));
9149
+ i.push(n);
9150
+ }
9151
+ else
9152
+ i.push(e.child(o));
9153
+ return e = I.from(i), e;
9111
9154
  }
9112
- function qn(e, t) {
9113
- let i = N.from(e.content);
9155
+ function Jn(e, t) {
9156
+ let i = I.from(e.content);
9157
+ i = Zn(i, t.state.schema);
9114
9158
  for (let o = 0; o < i.childCount; o++)
9115
9159
  if (i.child(o).type.spec.group === "blockContent") {
9116
9160
  const n = [i.child(o)];
9117
9161
  if (o + 1 < i.childCount && i.child(o + 1).type.spec.group === "blockGroup") {
9118
9162
  const a = i.child(o + 1).child(0).child(0);
9119
- (a.type.name === "bulletListItem" || a.type.name === "numberedListItem" || a.type.name === "checkListItem") && (n.push(i.child(o + 1)), i = $n(i, o + 1));
9163
+ (a.type.name === "bulletListItem" || a.type.name === "numberedListItem" || a.type.name === "checkListItem") && (n.push(i.child(o + 1)), i = Xn(i, o + 1));
9120
9164
  }
9121
9165
  const r = t.state.schema.nodes.blockContainer.create(
9122
9166
  void 0,
@@ -9126,12 +9170,12 @@ function qn(e, t) {
9126
9170
  }
9127
9171
  return new z(i, e.openStart, e.openEnd);
9128
9172
  }
9129
- function ye(e) {
9173
+ function we(e) {
9130
9174
  return e && Object.fromEntries(
9131
9175
  Object.entries(e).filter(([, t]) => t !== void 0)
9132
9176
  );
9133
9177
  }
9134
- class He {
9178
+ class Pe {
9135
9179
  constructor(t) {
9136
9180
  c(this, "blockSpecs");
9137
9181
  c(this, "inlineContentSpecs");
@@ -9143,15 +9187,15 @@ class He {
9143
9187
  c(this, "BlockNoteEditor", "only for types");
9144
9188
  c(this, "Block", "only for types");
9145
9189
  c(this, "PartialBlock", "only for types");
9146
- this.blockSpecs = ye(t == null ? void 0 : t.blockSpecs) || bt, this.inlineContentSpecs = ye(t == null ? void 0 : t.inlineContentSpecs) || kt, this.styleSpecs = ye(t == null ? void 0 : t.styleSpecs) || _t, this.blockSchema = ut(this.blockSpecs), this.inlineContentSchema = pt(
9190
+ this.blockSpecs = we(t == null ? void 0 : t.blockSpecs) || bt, this.inlineContentSpecs = we(t == null ? void 0 : t.inlineContentSpecs) || kt, this.styleSpecs = we(t == null ? void 0 : t.styleSpecs) || _t, this.blockSchema = ut(this.blockSpecs), this.inlineContentSchema = pt(
9147
9191
  this.inlineContentSpecs
9148
9192
  ), this.styleSchema = mt(this.styleSpecs);
9149
9193
  }
9150
9194
  static create(t) {
9151
- return new He(t);
9195
+ return new Pe(t);
9152
9196
  }
9153
9197
  }
9154
- const de = class de extends Gt {
9198
+ const ue = class ue extends Gt {
9155
9199
  constructor(i, o) {
9156
9200
  super({ ...i, content: void 0 });
9157
9201
  c(this, "_state");
@@ -9215,7 +9259,7 @@ const de = class de extends Gt {
9215
9259
  */
9216
9260
  createViewAlternative() {
9217
9261
  queueMicrotask(() => {
9218
- this.view = new ri(
9262
+ this.view = new ai(
9219
9263
  { mount: this.options.element },
9220
9264
  // use mount option so that we reuse the existing element instead of creating a new one
9221
9265
  {
@@ -9232,22 +9276,22 @@ const de = class de extends Gt {
9232
9276
  });
9233
9277
  }
9234
9278
  };
9235
- c(de, "create", (i, o) => {
9279
+ c(ue, "create", (i, o) => {
9236
9280
  var r, a;
9237
9281
  const n = (r = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : r.setTimeout;
9238
9282
  typeof ((a = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : a.setTimeout) < "u" && (globalThis.window.setTimeout = () => 0);
9239
9283
  try {
9240
- return new de(i, o);
9284
+ return new ue(i, o);
9241
9285
  } finally {
9242
9286
  n && (globalThis.window.setTimeout = n);
9243
9287
  }
9244
9288
  });
9245
- let le = de;
9246
- le.prototype.createView = function() {
9289
+ let ce = ue;
9290
+ ce.prototype.createView = function() {
9247
9291
  this.options.onPaste = this.options.onDrop = void 0;
9248
9292
  };
9249
- const Xn = new L("blocknote-placeholder"), Zn = (e, t) => new x({
9250
- key: Xn,
9293
+ const Yn = new B("blocknote-placeholder"), Qn = (e, t) => new v({
9294
+ key: Yn,
9251
9295
  view: () => {
9252
9296
  const i = document.createElement("style"), o = e._tiptapEditor.options.injectNonce;
9253
9297
  o && i.setAttribute("nonce", o), e._tiptapEditor.view.root instanceof ShadowRoot ? e._tiptapEditor.view.root.append(i) : e._tiptapEditor.view.root.head.appendChild(i);
@@ -9285,13 +9329,13 @@ const Xn = new L("blocknote-placeholder"), Zn = (e, t) => new x({
9285
9329
  const r = n.$anchor, a = r.parent;
9286
9330
  if (a.content.size > 0)
9287
9331
  return null;
9288
- const s = r.before(), l = $.node(s, s + a.nodeSize, {
9332
+ const s = r.before(), l = q.node(s, s + a.nodeSize, {
9289
9333
  "data-is-empty-and-focused": "true"
9290
9334
  });
9291
- return K.create(o, [l]);
9335
+ return $.create(o, [l]);
9292
9336
  }
9293
9337
  }
9294
- }), et = new L("previous-blocks"), Jn = {
9338
+ }), Qe = new B("previous-blocks"), er = {
9295
9339
  // Numbered List Items
9296
9340
  index: "index",
9297
9341
  // Headings
@@ -9300,17 +9344,17 @@ const Xn = new L("blocknote-placeholder"), Zn = (e, t) => new x({
9300
9344
  type: "type",
9301
9345
  depth: "depth",
9302
9346
  "depth-change": "depth-change"
9303
- }, Yn = () => {
9347
+ }, tr = () => {
9304
9348
  let e;
9305
- return new x({
9306
- key: et,
9349
+ return new v({
9350
+ key: Qe,
9307
9351
  view(t) {
9308
9352
  return {
9309
9353
  update: async (i, o) => {
9310
9354
  var n;
9311
9355
  ((n = this.key) == null ? void 0 : n.getState(i.state).updatedBlocks.size) > 0 && (e = setTimeout(() => {
9312
9356
  i.dispatch(
9313
- i.state.tr.setMeta(et, { clearUpdate: !0 })
9357
+ i.state.tr.setMeta(Qe, { clearUpdate: !0 })
9314
9358
  );
9315
9359
  }, 0));
9316
9360
  },
@@ -9333,9 +9377,9 @@ const Xn = new L("blocknote-placeholder"), Zn = (e, t) => new x({
9333
9377
  apply(t, i, o, n) {
9334
9378
  if (i.currentTransactionOldBlockAttrs = {}, i.updatedBlocks.clear(), !t.docChanged || o.doc.eq(n.doc))
9335
9379
  return i;
9336
- const r = {}, a = Re(o.doc, (d) => d.attrs.id), s = new Map(
9380
+ const r = {}, a = ze(o.doc, (d) => d.attrs.id), s = new Map(
9337
9381
  a.map((d) => [d.node.attrs.id, d])
9338
- ), l = Re(n.doc, (d) => d.attrs.id);
9382
+ ), l = ze(n.doc, (d) => d.attrs.id);
9339
9383
  for (const d of l) {
9340
9384
  const u = s.get(d.node.attrs.id), p = u == null ? void 0 : u.node.firstChild, h = d.node.firstChild;
9341
9385
  if (u && p && h) {
@@ -9368,16 +9412,16 @@ const Xn = new L("blocknote-placeholder"), Zn = (e, t) => new x({
9368
9412
  return;
9369
9413
  const a = i.currentTransactionOldBlockAttrs[n.attrs.id], s = {};
9370
9414
  for (const [d, u] of Object.entries(a))
9371
- s["data-prev-" + Jn[d]] = u || "none";
9372
- const l = $.node(r, r + n.nodeSize, {
9415
+ s["data-prev-" + er[d]] = u || "none";
9416
+ const l = q.node(r, r + n.nodeSize, {
9373
9417
  ...s
9374
9418
  });
9375
9419
  o.push(l);
9376
- }), K.create(t.doc, o);
9420
+ }), $.create(t.doc, o);
9377
9421
  }
9378
9422
  }
9379
9423
  });
9380
- }, Qn = {
9424
+ }, ir = {
9381
9425
  enableInputRules: !0,
9382
9426
  enablePasteRules: !0,
9383
9427
  enableCoreExtensions: !1
@@ -9466,7 +9510,7 @@ class St {
9466
9510
  this.dictionary = t.dictionary || tt;
9467
9511
  const o = {
9468
9512
  defaultStyles: !0,
9469
- schema: t.schema || He.create(),
9513
+ schema: t.schema || Pe.create(),
9470
9514
  _headless: !1,
9471
9515
  ...t,
9472
9516
  placeholders: {
@@ -9474,8 +9518,8 @@ class St {
9474
9518
  ...t.placeholders
9475
9519
  }
9476
9520
  };
9477
- this.schema = o.schema, this.blockImplementations = o.schema.blockSpecs, this.inlineContentImplementations = o.schema.inlineContentSpecs, this.styleImplementations = o.schema.styleSpecs, this.formattingToolbar = new hn(this), this.linkToolbar = new gn(this), this.sideMenu = new vn(this), this.suggestionMenus = new Cn(this), this.filePanel = new cn(this), T("table", this) && (this.tableHandles = new Ln(this));
9478
- const n = Kn({
9521
+ this.schema = o.schema, this.blockImplementations = o.schema.blockSpecs, this.inlineContentImplementations = o.schema.inlineContentSpecs, this.styleImplementations = o.schema.styleSpecs, this.formattingToolbar = new fn(this), this.linkToolbar = new _n(this), this.sideMenu = new En(this), this.suggestionMenus = new Mn(this), this.filePanel = new pn(this), M("table", this) && (this.tableHandles = new An(this));
9522
+ const n = qn({
9479
9523
  editor: this,
9480
9524
  domAttributes: o.domAttributes || {},
9481
9525
  blockSpecs: this.schema.blockSpecs,
@@ -9485,7 +9529,7 @@ class St {
9485
9529
  trailingBlock: o.trailingBlock,
9486
9530
  disableExtensions: o.disableExtensions,
9487
9531
  setIdAttribute: o.setIdAttribute
9488
- }), r = I.create({
9532
+ }), r = A.create({
9489
9533
  name: "BlockNoteUIExtension",
9490
9534
  addProseMirrorPlugins: () => [
9491
9535
  this.formattingToolbar.plugin,
@@ -9494,21 +9538,21 @@ class St {
9494
9538
  this.suggestionMenus.plugin,
9495
9539
  ...this.filePanel ? [this.filePanel.plugin] : [],
9496
9540
  ...this.tableHandles ? [this.tableHandles.plugin] : [],
9497
- Zn(this, o.placeholders),
9498
- ...this.options.animations ?? !0 ? [Yn()] : []
9541
+ Qn(this, o.placeholders),
9542
+ ...this.options.animations ?? !0 ? [tr()] : []
9499
9543
  ]
9500
9544
  });
9501
9545
  if (n.push(r), o.uploadFile) {
9502
9546
  const g = o.uploadFile;
9503
- this.uploadFile = async (k, v) => {
9547
+ this.uploadFile = async (_, x) => {
9504
9548
  this.onUploadStartCallbacks.forEach(
9505
- (b) => b.apply(this, [v])
9549
+ (b) => b.apply(this, [x])
9506
9550
  );
9507
9551
  try {
9508
- return await g(k, v);
9552
+ return await g(_, x);
9509
9553
  } finally {
9510
9554
  this.onUploadEndCallbacks.forEach(
9511
- (b) => b.apply(this, [v])
9555
+ (b) => b.apply(this, [x])
9512
9556
  );
9513
9557
  }
9514
9558
  };
@@ -9524,7 +9568,7 @@ class St {
9524
9568
  ] : [
9525
9569
  {
9526
9570
  type: "paragraph",
9527
- id: oe.options.generateID()
9571
+ id: ne.options.generateID()
9528
9572
  }
9529
9573
  ]);
9530
9574
  if (!Array.isArray(a) || a.length === 0)
@@ -9532,7 +9576,7 @@ class St {
9532
9576
  "initialContent must be a non-empty array of blocks, received: " + a
9533
9577
  );
9534
9578
  const s = {
9535
- ...Qn,
9579
+ ...ir,
9536
9580
  ...o._tiptapOptions,
9537
9581
  content: a,
9538
9582
  extensions: [
@@ -9548,16 +9592,16 @@ class St {
9548
9592
  tabIndex: "0",
9549
9593
  ...(p = (u = o._tiptapOptions) == null ? void 0 : u.editorProps) == null ? void 0 : p.attributes,
9550
9594
  ...(h = o.domAttributes) == null ? void 0 : h.editor,
9551
- class: V(
9595
+ class: O(
9552
9596
  "bn-editor",
9553
9597
  o.defaultStyles ? "bn-default-styles" : "",
9554
9598
  ((f = (m = o.domAttributes) == null ? void 0 : m.editor) == null ? void 0 : f.class) || ""
9555
9599
  )
9556
9600
  },
9557
- transformPasted: qn
9601
+ transformPasted: Jn
9558
9602
  }
9559
9603
  };
9560
- this.headless ? this._pmSchema = Kt(s.extensions) : (this._tiptapEditor = le.create(
9604
+ this.headless ? this._pmSchema = Kt(s.extensions) : (this._tiptapEditor = ce.create(
9561
9605
  s,
9562
9606
  this.schema.styleSchema
9563
9607
  ), this._pmSchema = this._tiptapEditor.schema);
@@ -9672,7 +9716,7 @@ class St {
9672
9716
  * @returns A snapshot of the current text cursor position.
9673
9717
  */
9674
9718
  getTextCursorPosition() {
9675
- const { node: t, depth: i, startPos: o, endPos: n } = _(
9719
+ const { node: t, depth: i, startPos: o, endPos: n } = k(
9676
9720
  this._tiptapEditor.state.doc,
9677
9721
  this._tiptapEditor.state.selection.from
9678
9722
  ), r = this._tiptapEditor.state.doc.resolve(n).index(i - 1), a = this._tiptapEditor.state.doc.resolve(n + 1).node().childCount;
@@ -9710,7 +9754,7 @@ class St {
9710
9754
  * @param placement Whether the text cursor should be placed at the start or end of the block.
9711
9755
  */
9712
9756
  setTextCursorPosition(t, i = "start") {
9713
- const o = typeof t == "string" ? t : t.id, { posBeforeNode: n } = Ae(o, this._tiptapEditor.state.doc), { startPos: r, contentNode: a } = _(
9757
+ const o = typeof t == "string" ? t : t.id, { posBeforeNode: n } = Ie(o, this._tiptapEditor.state.doc), { startPos: r, contentNode: a } = k(
9714
9758
  this._tiptapEditor.state.doc,
9715
9759
  n + 2
9716
9760
  ), s = this.schema.blockSchema[a.type.name].content;
@@ -9784,7 +9828,7 @@ class St {
9784
9828
  * `referenceBlock`. Inserts the blocks at the start of the existing block's children if "nested" is used.
9785
9829
  */
9786
9830
  insertBlocks(t, i, o = "before") {
9787
- return $o(t, i, o, this);
9831
+ return Xo(t, i, o, this);
9788
9832
  }
9789
9833
  /**
9790
9834
  * Updates an existing block in the editor. Since updatedBlock is a PartialBlock object, some fields might not be
@@ -9794,14 +9838,14 @@ class St {
9794
9838
  * @param update A partial block which defines how the existing block should be changed.
9795
9839
  */
9796
9840
  updateBlock(t, i) {
9797
- return qo(t, i, this);
9841
+ return Zo(t, i, this);
9798
9842
  }
9799
9843
  /**
9800
9844
  * Removes existing blocks from the editor. Throws an error if any of the blocks could not be found.
9801
9845
  * @param blocksToRemove An array of identifiers for existing blocks that should be removed.
9802
9846
  */
9803
9847
  removeBlocks(t) {
9804
- return Xo(t, this);
9848
+ return Jo(t, this);
9805
9849
  }
9806
9850
  /**
9807
9851
  * Replaces existing blocks in the editor with new blocks. If the blocks that should be removed are not adjacent or
@@ -9811,7 +9855,7 @@ class St {
9811
9855
  * @param blocksToInsert An array of partial blocks to replace the old ones with.
9812
9856
  */
9813
9857
  replaceBlocks(t, i) {
9814
- return Zo(t, i, this);
9858
+ return Yo(t, i, this);
9815
9859
  }
9816
9860
  /**
9817
9861
  * Insert a piece of content at the current cursor position.
@@ -9819,12 +9863,12 @@ class St {
9819
9863
  * @param content can be a string, or array of partial inline content elements
9820
9864
  */
9821
9865
  insertInlineContent(t) {
9822
- const i = R(
9866
+ const i = V(
9823
9867
  t,
9824
9868
  this.pmSchema,
9825
9869
  this.schema.styleSchema
9826
9870
  );
9827
- Jo(
9871
+ Qo(
9828
9872
  {
9829
9873
  from: this._tiptapEditor.state.selection.from,
9830
9874
  to: this._tiptapEditor.state.selection.to
@@ -9924,7 +9968,7 @@ class St {
9924
9968
  * Checks if the block containing the text cursor can be nested.
9925
9969
  */
9926
9970
  canNestBlock() {
9927
- const { startPos: t, depth: i } = _(
9971
+ const { startPos: t, depth: i } = k(
9928
9972
  this._tiptapEditor.state.doc,
9929
9973
  this._tiptapEditor.state.selection.from
9930
9974
  );
@@ -9940,7 +9984,7 @@ class St {
9940
9984
  * Checks if the block containing the text cursor is nested.
9941
9985
  */
9942
9986
  canUnnestBlock() {
9943
- const { depth: t } = _(
9987
+ const { depth: t } = k(
9944
9988
  this._tiptapEditor.state.doc,
9945
9989
  this._tiptapEditor.state.selection.from
9946
9990
  );
@@ -9960,7 +10004,7 @@ class St {
9960
10004
  * @returns The blocks, serialized as an HTML string.
9961
10005
  */
9962
10006
  async blocksToHTMLLossy(t = this.document) {
9963
- return await ie(), ue(this.pmSchema, this).exportBlocks(t, {});
10007
+ return await oe(), he(this.pmSchema, this).exportBlocks(t, {});
9964
10008
  }
9965
10009
  /**
9966
10010
  * Serializes blocks into an HTML string in the format that would normally be rendered by the editor.
@@ -9972,7 +10016,7 @@ class St {
9972
10016
  * @returns The blocks, serialized as an HTML string.
9973
10017
  */
9974
10018
  async blocksToFullHTML(t) {
9975
- return Be(this.pmSchema, this).serializeBlocks(t, {});
10019
+ return Pi(this.pmSchema, this).serializeBlocks(t, {});
9976
10020
  }
9977
10021
  /**
9978
10022
  * Parses blocks from an HTML string. Tries to create `Block` objects out of any HTML block-level elements, and
@@ -9997,7 +10041,7 @@ class St {
9997
10041
  * @returns The blocks, serialized as a Markdown string.
9998
10042
  */
9999
10043
  async blocksToMarkdownLossy(t = this.document) {
10000
- return en(t, this.pmSchema, this, {});
10044
+ return on(t, this.pmSchema, this, {});
10001
10045
  }
10002
10046
  /**
10003
10047
  * Creates a list of blocks from a Markdown string. Tries to create `Block` and `InlineNode` objects based on
@@ -10007,7 +10051,7 @@ class St {
10007
10051
  * @returns The blocks parsed from the Markdown string.
10008
10052
  */
10009
10053
  async tryParseMarkdownToBlocks(t) {
10010
- return ln(
10054
+ return cn(
10011
10055
  t,
10012
10056
  this.schema.blockSchema,
10013
10057
  this.schema.inlineContentSchema,
@@ -10068,43 +10112,43 @@ class St {
10068
10112
  );
10069
10113
  }
10070
10114
  }
10071
- let ae, we;
10072
- async function Vr(e, t) {
10073
- if (!Go("text", e))
10115
+ let le, ve;
10116
+ async function Gr(e, t) {
10117
+ if (!Ko("text", e))
10074
10118
  return [];
10075
- if (!ae) {
10076
- ae = import("@emoji-mart/data"), we = await import("emoji-mart");
10077
- const n = (await ae).default;
10078
- await we.init({ data: n });
10119
+ if (!le) {
10120
+ le = import("@emoji-mart/data"), ve = await import("emoji-mart");
10121
+ const n = (await le).default;
10122
+ await ve.init({ data: n });
10079
10123
  }
10080
- const i = (await ae).default;
10081
- return (t.trim() === "" ? Object.values(i.emojis) : await we.SearchIndex.search(t)).map((n) => ({
10124
+ const i = (await le).default;
10125
+ return (t.trim() === "" ? Object.values(i.emojis) : await ve.SearchIndex.search(t)).map((n) => ({
10082
10126
  id: n.skins[0].native,
10083
10127
  onItemClick: () => e.insertInlineContent(n.skins[0].native + " ")
10084
10128
  }));
10085
10129
  }
10086
- function er(e) {
10130
+ function or(e) {
10087
10131
  let t = e.getTextCursorPosition().block, i = e.schema.blockSchema[t.type].content;
10088
10132
  for (; i === "none"; )
10089
10133
  t = e.getTextCursorPosition().nextBlock, i = e.schema.blockSchema[t.type].content, e.setTextCursorPosition(t, "end");
10090
10134
  }
10091
- function M(e, t) {
10135
+ function S(e, t) {
10092
10136
  const i = e.getTextCursorPosition().block;
10093
10137
  if (i.content === void 0)
10094
10138
  throw new Error("Slash Menu open in a block that doesn't contain content.");
10095
- Array.isArray(i.content) && (i.content.length === 1 && te(i.content[0]) && i.content[0].type === "text" && i.content[0].text === "/" || i.content.length === 0) ? e.updateBlock(i, t) : (e.insertBlocks([t], i, "after"), e.setTextCursorPosition(
10139
+ Array.isArray(i.content) && (i.content.length === 1 && ie(i.content[0]) && i.content[0].type === "text" && i.content[0].text === "/" || i.content.length === 0) ? e.updateBlock(i, t) : (e.insertBlocks([t], i, "after"), e.setTextCursorPosition(
10096
10140
  e.getTextCursorPosition().nextBlock,
10097
10141
  "end"
10098
10142
  ));
10099
10143
  const o = e.getTextCursorPosition().block;
10100
- return er(e), o;
10144
+ return or(e), o;
10101
10145
  }
10102
- function Or(e) {
10146
+ function Wr(e) {
10103
10147
  const t = [];
10104
- return T("heading", e) && t.push(
10148
+ return M("heading", e) && t.push(
10105
10149
  {
10106
10150
  onItemClick: () => {
10107
- M(e, {
10151
+ S(e, {
10108
10152
  type: "heading",
10109
10153
  props: { level: 1 }
10110
10154
  });
@@ -10115,7 +10159,7 @@ function Or(e) {
10115
10159
  },
10116
10160
  {
10117
10161
  onItemClick: () => {
10118
- M(e, {
10162
+ S(e, {
10119
10163
  type: "heading",
10120
10164
  props: { level: 2 }
10121
10165
  });
@@ -10126,7 +10170,7 @@ function Or(e) {
10126
10170
  },
10127
10171
  {
10128
10172
  onItemClick: () => {
10129
- M(e, {
10173
+ S(e, {
10130
10174
  type: "heading",
10131
10175
  props: { level: 3 }
10132
10176
  });
@@ -10135,45 +10179,45 @@ function Or(e) {
10135
10179
  key: "heading_3",
10136
10180
  ...e.dictionary.slash_menu.heading_3
10137
10181
  }
10138
- ), T("numberedListItem", e) && t.push({
10182
+ ), M("numberedListItem", e) && t.push({
10139
10183
  onItemClick: () => {
10140
- M(e, {
10184
+ S(e, {
10141
10185
  type: "numberedListItem"
10142
10186
  });
10143
10187
  },
10144
10188
  badge: D("Mod-Shift-7"),
10145
10189
  key: "numbered_list",
10146
10190
  ...e.dictionary.slash_menu.numbered_list
10147
- }), T("bulletListItem", e) && t.push({
10191
+ }), M("bulletListItem", e) && t.push({
10148
10192
  onItemClick: () => {
10149
- M(e, {
10193
+ S(e, {
10150
10194
  type: "bulletListItem"
10151
10195
  });
10152
10196
  },
10153
10197
  badge: D("Mod-Shift-8"),
10154
10198
  key: "bullet_list",
10155
10199
  ...e.dictionary.slash_menu.bullet_list
10156
- }), T("checkListItem", e) && t.push({
10200
+ }), M("checkListItem", e) && t.push({
10157
10201
  onItemClick: () => {
10158
- M(e, {
10202
+ S(e, {
10159
10203
  type: "checkListItem"
10160
10204
  });
10161
10205
  },
10162
10206
  badge: D("Mod-Shift-9"),
10163
10207
  key: "check_list",
10164
10208
  ...e.dictionary.slash_menu.check_list
10165
- }), T("paragraph", e) && t.push({
10209
+ }), M("paragraph", e) && t.push({
10166
10210
  onItemClick: () => {
10167
- M(e, {
10211
+ S(e, {
10168
10212
  type: "paragraph"
10169
10213
  });
10170
10214
  },
10171
10215
  badge: D("Mod-Alt-0"),
10172
10216
  key: "paragraph",
10173
10217
  ...e.dictionary.slash_menu.paragraph
10174
- }), T("table", e) && t.push({
10218
+ }), M("table", e) && t.push({
10175
10219
  onItemClick: () => {
10176
- M(e, {
10220
+ S(e, {
10177
10221
  type: "table",
10178
10222
  content: {
10179
10223
  type: "tableContent",
@@ -10191,9 +10235,9 @@ function Or(e) {
10191
10235
  badge: void 0,
10192
10236
  key: "table",
10193
10237
  ...e.dictionary.slash_menu.table
10194
- }), T("image", e) && t.push({
10238
+ }), M("image", e) && t.push({
10195
10239
  onItemClick: () => {
10196
- const i = M(e, {
10240
+ const i = S(e, {
10197
10241
  type: "image"
10198
10242
  });
10199
10243
  e.dispatch(
@@ -10204,9 +10248,9 @@ function Or(e) {
10204
10248
  },
10205
10249
  key: "image",
10206
10250
  ...e.dictionary.slash_menu.image
10207
- }), T("video", e) && t.push({
10251
+ }), M("video", e) && t.push({
10208
10252
  onItemClick: () => {
10209
- const i = M(e, {
10253
+ const i = S(e, {
10210
10254
  type: "video"
10211
10255
  });
10212
10256
  e.dispatch(
@@ -10217,9 +10261,9 @@ function Or(e) {
10217
10261
  },
10218
10262
  key: "video",
10219
10263
  ...e.dictionary.slash_menu.video
10220
- }), T("audio", e) && t.push({
10264
+ }), M("audio", e) && t.push({
10221
10265
  onItemClick: () => {
10222
- const i = M(e, {
10266
+ const i = S(e, {
10223
10267
  type: "audio"
10224
10268
  });
10225
10269
  e.dispatch(
@@ -10230,9 +10274,9 @@ function Or(e) {
10230
10274
  },
10231
10275
  key: "audio",
10232
10276
  ...e.dictionary.slash_menu.audio
10233
- }), T("file", e) && t.push({
10277
+ }), M("file", e) && t.push({
10234
10278
  onItemClick: () => {
10235
- const i = M(e, {
10279
+ const i = S(e, {
10236
10280
  type: "file"
10237
10281
  });
10238
10282
  e.dispatch(
@@ -10254,14 +10298,14 @@ function Or(e) {
10254
10298
  ...e.dictionary.slash_menu.emoji
10255
10299
  }), t;
10256
10300
  }
10257
- function Fr(e, t) {
10301
+ function Kr(e, t) {
10258
10302
  return e.filter(
10259
10303
  ({ title: i, aliases: o }) => i.toLowerCase().includes(t.toLowerCase()) || o && o.filter(
10260
10304
  (n) => n.toLowerCase().includes(t.toLowerCase())
10261
10305
  ).length !== 0
10262
10306
  );
10263
10307
  }
10264
- function ve(e = "") {
10308
+ function xe(e = "") {
10265
10309
  return typeof e == "string" ? [
10266
10310
  {
10267
10311
  type: "text",
@@ -10271,16 +10315,16 @@ function ve(e = "") {
10271
10315
  ] : e;
10272
10316
  }
10273
10317
  function Mt(e) {
10274
- return typeof e == "string" ? ve(e) : Array.isArray(e) ? e.flatMap((t) => typeof t == "string" ? ve(t) : ot(t) ? {
10318
+ return typeof e == "string" ? xe(e) : Array.isArray(e) ? e.flatMap((t) => typeof t == "string" ? xe(t) : ot(t) ? {
10275
10319
  ...t,
10276
- content: ve(t.content)
10277
- } : te(t) ? t : {
10320
+ content: xe(t.content)
10321
+ } : ie(t) ? t : {
10278
10322
  props: {},
10279
10323
  ...t,
10280
10324
  content: Mt(t.content)
10281
10325
  }) : e;
10282
10326
  }
10283
- function Gr(e, t) {
10327
+ function $r(e, t) {
10284
10328
  return t.map(
10285
10329
  (i) => Tt(e, i)
10286
10330
  );
@@ -10304,145 +10348,145 @@ function Tt(e, t) {
10304
10348
  children: i.children.map((o) => Tt(e, o))
10305
10349
  };
10306
10350
  }
10307
- function tr(e) {
10308
- e.id || (e.id = oe.options.generateID()), e.children && ir(e.children);
10351
+ function nr(e) {
10352
+ e.id || (e.id = ne.options.generateID()), e.children && rr(e.children);
10309
10353
  }
10310
- function ir(e) {
10354
+ function rr(e) {
10311
10355
  for (const t of e)
10312
- tr(t);
10356
+ nr(t);
10313
10357
  }
10314
10358
  export {
10315
- Zi as AudioBlock,
10359
+ Yi as AudioBlock,
10316
10360
  St as BlockNoteEditor,
10317
- He as BlockNoteSchema,
10318
- io as FileBlock,
10319
- cn as FilePanelProsemirrorPlugin,
10320
- dn as FilePanelView,
10321
- hn as FormattingToolbarProsemirrorPlugin,
10322
- un as FormattingToolbarView,
10361
+ Pe as BlockNoteSchema,
10362
+ no as FileBlock,
10363
+ pn as FilePanelProsemirrorPlugin,
10364
+ un as FilePanelView,
10365
+ fn as FormattingToolbarProsemirrorPlugin,
10366
+ hn as FormattingToolbarView,
10323
10367
  vt as HTMLToBlocks,
10324
- lo as ImageBlock,
10325
- gn as LinkToolbarProsemirrorPlugin,
10326
- vn as SideMenuProsemirrorPlugin,
10327
- yn as SideMenuView,
10328
- Cn as SuggestionMenuProseMirrorPlugin,
10329
- Ln as TableHandlesProsemirrorPlugin,
10330
- Bn as TableHandlesView,
10331
- oe as UniqueID,
10368
+ uo as ImageBlock,
10369
+ _n as LinkToolbarProsemirrorPlugin,
10370
+ En as SideMenuProsemirrorPlugin,
10371
+ vn as SideMenuView,
10372
+ Mn as SuggestionMenuProseMirrorPlugin,
10373
+ An as TableHandlesProsemirrorPlugin,
10374
+ In as TableHandlesView,
10375
+ ne as UniqueID,
10332
10376
  P as UnreachableCaseError,
10333
- fo as VideoBlock,
10334
- tr as addIdsToBlock,
10335
- ir as addIdsToBlocks,
10336
- We as addInlineContentAttributes,
10337
- Di as addInlineContentKeyboardShortcuts,
10338
- Oi as addStyleAttributes,
10339
- Hi as applyNonSelectableBlockFix,
10340
- Br as assertEmpty,
10341
- Ki as audioBlockConfig,
10342
- qi as audioParse,
10343
- Wi as audioPropSchema,
10344
- $i as audioRender,
10345
- Xi as audioToExternalHTML,
10377
+ bo as VideoBlock,
10378
+ nr as addIdsToBlock,
10379
+ rr as addIdsToBlocks,
10380
+ Ge as addInlineContentAttributes,
10381
+ zi as addInlineContentKeyboardShortcuts,
10382
+ Gi as addStyleAttributes,
10383
+ Di as applyNonSelectableBlockFix,
10384
+ Ar as assertEmpty,
10385
+ qi as audioBlockConfig,
10386
+ Zi as audioParse,
10387
+ $i as audioPropSchema,
10388
+ Xi as audioRender,
10389
+ Ji as audioToExternalHTML,
10346
10390
  U as blockToNode,
10347
- en as blocksToMarkdown,
10348
- se as camelToDataKebab,
10349
- zr as checkBlockHasDefaultProp,
10350
- Wo as checkBlockIsDefaultType,
10351
- Ur as checkBlockIsFileBlock,
10352
- jr as checkBlockIsFileBlockWithPlaceholder,
10353
- Dr as checkBlockIsFileBlockWithPreview,
10354
- Ko as checkBlockTypeHasDefaultProp,
10355
- T as checkDefaultBlockTypeInSchema,
10356
- Go as checkDefaultInlineContentTypeInSchema,
10357
- Ne as cleanHTMLToMarkdown,
10391
+ on as blocksToMarkdown,
10392
+ de as camelToDataKebab,
10393
+ Or as checkBlockHasDefaultProp,
10394
+ $o as checkBlockIsDefaultType,
10395
+ zr as checkBlockIsFileBlock,
10396
+ Vr as checkBlockIsFileBlockWithPlaceholder,
10397
+ Rr as checkBlockIsFileBlockWithPreview,
10398
+ qo as checkBlockTypeHasDefaultProp,
10399
+ M as checkDefaultBlockTypeInSchema,
10400
+ Ko as checkDefaultInlineContentTypeInSchema,
10401
+ Ae as cleanHTMLToMarkdown,
10358
10402
  Te as contentNodeToInlineContent,
10359
- Gi as createAddFileButton,
10360
- pe as createBlockSpec,
10361
- X as createBlockSpecFromStronglyTypedTiptapNode,
10362
- O as createDefaultBlockDOMOutputSpec,
10403
+ Ki as createAddFileButton,
10404
+ me as createBlockSpec,
10405
+ Z as createBlockSpecFromStronglyTypedTiptapNode,
10406
+ F as createDefaultBlockDOMOutputSpec,
10363
10407
  ft as createDefaultFilePreview,
10364
- ue as createExternalHTMLExporter,
10365
- Le as createFigureWithCaption,
10366
- ne as createFileAndCaptionWrapper,
10367
- he as createFileBlockWrapper,
10368
- Ar as createInlineContentSpec,
10369
- zi as createInlineContentSpecFromTipTapNode,
10408
+ he as createExternalHTMLExporter,
10409
+ Be as createFigureWithCaption,
10410
+ re as createFileAndCaptionWrapper,
10411
+ fe as createFileBlockWrapper,
10412
+ Hr as createInlineContentSpec,
10413
+ Vi as createInlineContentSpecFromTipTapNode,
10370
10414
  ct as createInternalBlockSpec,
10371
- Be as createInternalHTMLSerializer,
10372
- ji as createInternalInlineContentSpec,
10415
+ Pi as createInternalHTMLSerializer,
10416
+ Ri as createInternalInlineContentSpec,
10373
10417
  ht as createInternalStyleSpec,
10374
- fe as createLinkWithCaption,
10418
+ be as createLinkWithCaption,
10375
10419
  gt as createResizeHandlesWrapper,
10376
- F as createStronglyTypedTiptapNode,
10377
- Nr as createStyleSpec,
10420
+ G as createStronglyTypedTiptapNode,
10421
+ Ur as createStyleSpec,
10378
10422
  j as createStyleSpecFromTipTapMark,
10379
- Rr as createSuggestionMenu,
10380
- Oo as defaultBlockSchema,
10423
+ Fr as createSuggestionMenu,
10424
+ Go as defaultBlockSchema,
10381
10425
  bt as defaultBlockSpecs,
10382
- Ge as defaultBlockToHTML,
10383
- Fo as defaultInlineContentSchema,
10426
+ Fe as defaultBlockToHTML,
10427
+ Wo as defaultInlineContentSchema,
10384
10428
  kt as defaultInlineContentSpecs,
10385
- w as defaultProps,
10386
- Hr as defaultStyleSchema,
10429
+ y as defaultProps,
10430
+ jr as defaultStyleSchema,
10387
10431
  _t as defaultStyleSpecs,
10388
10432
  H as esmDependencies,
10389
- Yi as fileBlockConfig,
10390
- eo as fileParse,
10391
- Ji as filePropSchema,
10392
- Qi as fileRender,
10393
- to as fileToExternalHTML,
10394
- Ir as filenameFromURL,
10395
- Fr as filterSuggestionItems,
10433
+ eo as fileBlockConfig,
10434
+ io as fileParse,
10435
+ Qi as filePropSchema,
10436
+ to as fileRender,
10437
+ oo as fileToExternalHTML,
10438
+ Pr as filenameFromURL,
10439
+ Kr as filterSuggestionItems,
10396
10440
  D as formatKeyboardShortcut,
10397
- pn as formattingToolbarPluginKey,
10398
- Pi as getBlockFromPos,
10399
- Kn as getBlockNoteExtensions,
10441
+ mn as formattingToolbarPluginKey,
10442
+ Ui as getBlockFromPos,
10443
+ qn as getBlockNoteExtensions,
10400
10444
  ut as getBlockSchemaFromSpecs,
10401
- B as getCurrentBlockContentType,
10402
- Vr as getDefaultEmojiPickerItems,
10403
- Or as getDefaultSlashMenuItems,
10404
- ge as getDraggableBlockFromElement,
10405
- Ri as getInlineContentParseRules,
10445
+ T as getCurrentBlockContentType,
10446
+ Gr as getDefaultEmojiPickerItems,
10447
+ Wr as getDefaultSlashMenuItems,
10448
+ _e as getDraggableBlockFromElement,
10449
+ Oi as getInlineContentParseRules,
10406
10450
  pt as getInlineContentSchemaFromSpecs,
10407
- Ui as getParseRules,
10408
- Fi as getStyleParseRules,
10451
+ ji as getParseRules,
10452
+ Wi as getStyleParseRules,
10409
10453
  mt as getStyleSchemaFromSpecs,
10410
- no as imageBlockConfig,
10411
- ao as imageParse,
10412
- oo as imagePropSchema,
10413
- ro as imageRender,
10414
- so as imageToExternalHTML,
10454
+ ao as imageBlockConfig,
10455
+ lo as imageParse,
10456
+ ro as imagePropSchema,
10457
+ so as imageRender,
10458
+ co as imageToExternalHTML,
10415
10459
  lt as inheritedProps,
10416
- ie as initializeESMDependencies,
10417
- R as inlineContentToNodes,
10418
- M as insertOrUpdateBlock,
10419
- Ni as isAppleOS,
10420
- Ve as isLinkInlineContent,
10460
+ oe as initializeESMDependencies,
10461
+ V as inlineContentToNodes,
10462
+ S as insertOrUpdateBlock,
10463
+ Hi as isAppleOS,
10464
+ Re as isLinkInlineContent,
10421
10465
  ot as isPartialLinkInlineContent,
10422
- Lr as isSafari,
10423
- te as isStyledTextInlineContent,
10424
- fn as linkToolbarPluginKey,
10425
- Tr as locales,
10426
- ln as markdownToBlocks,
10427
- V as mergeCSSClasses,
10466
+ Nr as isSafari,
10467
+ ie as isStyledTextInlineContent,
10468
+ bn as linkToolbarPluginKey,
10469
+ Ir as locales,
10470
+ cn as markdownToBlocks,
10471
+ O as mergeCSSClasses,
10428
10472
  C as nodeToBlock,
10429
- Ce as nodeToCustomInlineContent,
10430
- Ke as parseEmbedElement,
10431
- me as parseFigureElement,
10432
- qe as parseImageElement,
10473
+ Se as nodeToCustomInlineContent,
10474
+ We as parseEmbedElement,
10475
+ ge as parseFigureElement,
10476
+ $e as parseImageElement,
10433
10477
  Tt as partialBlockToBlockForTesting,
10434
- Gr as partialBlocksToBlocksForTesting,
10478
+ $r as partialBlocksToBlocksForTesting,
10435
10479
  dt as propsToAttributes,
10436
- wn as sideMenuPluginKey,
10437
- Vi as stylePropsToAttributes,
10480
+ xn as sideMenuPluginKey,
10481
+ Fi as stylePropsToAttributes,
10438
10482
  nt as tableContentToNodes,
10439
- Q as tableHandlesPluginKey,
10440
- Pr as uploadToTmpFilesDotOrg_DEV_ONLY,
10441
- uo as videoBlockConfig,
10442
- ho as videoParse,
10443
- co as videoPropSchema,
10444
- po as videoRender,
10445
- mo as videoToExternalHTML,
10446
- _e as wrapInBlockStructure
10483
+ ee as tableHandlesPluginKey,
10484
+ Dr as uploadToTmpFilesDotOrg_DEV_ONLY,
10485
+ ho as videoBlockConfig,
10486
+ fo as videoParse,
10487
+ po as videoPropSchema,
10488
+ mo as videoRender,
10489
+ go as videoToExternalHTML,
10490
+ ae as wrapInBlockStructure
10447
10491
  };
10448
10492
  //# sourceMappingURL=blocknote.js.map