reactjs-tiptap-editor 1.0.18 → 1.0.19

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 (147) hide show
  1. package/lib/{ActionMenuButton-BOjCHFTA.js → ActionMenuButton-B1Nfn5Hm.js} +1 -1
  2. package/lib/{ActionMenuButton-Df077oOH.cjs → ActionMenuButton-D3b_bcin.cjs} +1 -1
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.js +23 -23
  5. package/lib/Blockquote.cjs +3 -3
  6. package/lib/Blockquote.js +33 -28
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +16 -10
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +2 -2
  11. package/lib/Callout.cjs +1 -1
  12. package/lib/Callout.js +21 -22
  13. package/lib/Clear.cjs +1 -1
  14. package/lib/Clear.js +2 -2
  15. package/lib/Code.cjs +1 -1
  16. package/lib/Code.js +2 -2
  17. package/lib/CodeBlock.cjs +37 -37
  18. package/lib/CodeBlock.js +15 -16
  19. package/lib/CodeView.cjs +1 -1
  20. package/lib/CodeView.js +2 -2
  21. package/lib/Color.cjs +1 -1
  22. package/lib/Color.js +3 -3
  23. package/lib/Column.cjs +1 -1
  24. package/lib/Column.js +2 -2
  25. package/lib/{Drawer-DxOoRiGQ.js → Drawer-B1-7Y4HB.js} +3 -3
  26. package/lib/{Drawer-DwrlY_lY.cjs → Drawer-kEO7KzzC.cjs} +1 -1
  27. package/lib/Drawer.cjs +1 -1
  28. package/lib/Drawer.js +4 -4
  29. package/lib/Emoji.cjs +1 -1
  30. package/lib/Emoji.js +12 -12
  31. package/lib/Excalidraw.cjs +1 -1
  32. package/lib/Excalidraw.js +17 -17
  33. package/lib/ExportPdf.cjs +1 -1
  34. package/lib/ExportPdf.js +2 -2
  35. package/lib/ExportWord.cjs +1 -1
  36. package/lib/ExportWord.js +2 -2
  37. package/lib/FontFamily.cjs +1 -1
  38. package/lib/FontFamily.js +4 -4
  39. package/lib/FontSize.cjs +1 -1
  40. package/lib/FontSize.js +4 -4
  41. package/lib/Heading.cjs +1 -1
  42. package/lib/Heading.js +9 -9
  43. package/lib/Highlight.cjs +1 -1
  44. package/lib/Highlight.js +3 -3
  45. package/lib/History.cjs +1 -1
  46. package/lib/History.js +5 -3
  47. package/lib/HorizontalRule.cjs +1 -1
  48. package/lib/HorizontalRule.js +2 -2
  49. package/lib/{Iframe-C6pBw-AF.cjs → Iframe-Bk5OIlvy.cjs} +1 -1
  50. package/lib/{Iframe-AhNV5WH5.js → Iframe-XlAb03_r.js} +7 -7
  51. package/lib/Iframe.cjs +1 -1
  52. package/lib/Iframe.js +3 -3
  53. package/lib/Image.cjs +1 -1
  54. package/lib/Image.js +6 -5
  55. package/lib/ImageGif.cjs +1 -1
  56. package/lib/ImageGif.js +36 -36
  57. package/lib/ImportWord.cjs +1 -1
  58. package/lib/ImportWord.js +13 -13
  59. package/lib/{Indent-Do-X0AsY.cjs → Indent-XaZNTsOk.cjs} +1 -1
  60. package/lib/{Indent-DZ5PcJA4.js → Indent-ruPuj5xn.js} +2 -2
  61. package/lib/Indent.cjs +1 -1
  62. package/lib/Indent.js +2 -2
  63. package/lib/Italic.cjs +1 -1
  64. package/lib/Italic.js +24 -18
  65. package/lib/Katex-BFIYLrwm.cjs +4 -0
  66. package/lib/{Katex-bIgoenn_.js → Katex-DKspCn-p.js} +5 -6
  67. package/lib/Katex.cjs +1 -1
  68. package/lib/Katex.js +3 -3
  69. package/lib/LineHeight.cjs +1 -1
  70. package/lib/LineHeight.js +3 -3
  71. package/lib/Link.cjs +1 -1
  72. package/lib/Link.js +2 -2
  73. package/lib/{LinkEditBlock-D_cF9fnc.js → LinkEditBlock-BWm2Ypt2.js} +26 -26
  74. package/lib/{LinkEditBlock-B0ZaACZO.cjs → LinkEditBlock-DhesHreq.cjs} +1 -1
  75. package/lib/MarkdownPaste.cjs +1 -1
  76. package/lib/MarkdownPaste.js +1 -1
  77. package/lib/Mention.cjs +1 -1
  78. package/lib/Mention.js +4 -4
  79. package/lib/Mermaid.cjs +2 -2
  80. package/lib/Mermaid.js +41 -42
  81. package/lib/MoreMark.cjs +1 -1
  82. package/lib/MoreMark.js +5 -5
  83. package/lib/OrderedList.cjs +1 -1
  84. package/lib/OrderedList.js +2 -2
  85. package/lib/SearchAndReplace.cjs +1 -1
  86. package/lib/SearchAndReplace.js +8 -8
  87. package/lib/SlashCommand.cjs +1 -1
  88. package/lib/SlashCommand.js +6 -6
  89. package/lib/{SlashCommandNodeView-Ba03hlVZ.cjs → SlashCommandNodeView-CojfS61Q.cjs} +1 -1
  90. package/lib/{SlashCommandNodeView-cg0x3NRF.js → SlashCommandNodeView-Hf2DX4km.js} +6 -6
  91. package/lib/Strike.cjs +1 -1
  92. package/lib/Strike.js +2 -2
  93. package/lib/{Table-KqLiT5wG.js → Table-BTkFUATL.js} +4 -4
  94. package/lib/{Table-ddU2LSc6.cjs → Table-C1_xLqV0.cjs} +1 -1
  95. package/lib/Table.cjs +1 -1
  96. package/lib/Table.js +1 -1
  97. package/lib/TaskList.cjs +1 -1
  98. package/lib/TaskList.js +2 -2
  99. package/lib/TextAlign.cjs +1 -1
  100. package/lib/TextAlign.js +3 -3
  101. package/lib/TextDirection.cjs +1 -1
  102. package/lib/TextDirection.js +3 -3
  103. package/lib/TextUnderline.cjs +1 -1
  104. package/lib/TextUnderline.js +2 -2
  105. package/lib/{Twitter-BIiR78Jh.cjs → Twitter-Cj-0yyQQ.cjs} +1 -1
  106. package/lib/{Twitter-C1Lzqc7u.js → Twitter-D5mUTILj.js} +9 -9
  107. package/lib/Twitter.cjs +1 -1
  108. package/lib/Twitter.js +3 -3
  109. package/lib/Video.cjs +1 -1
  110. package/lib/Video.js +4 -4
  111. package/lib/bubble.cjs +6 -6
  112. package/lib/bubble.js +1835 -1634
  113. package/lib/{clsx-BWE7vnna.cjs → clsx-BSBE1eoY.cjs} +1 -1
  114. package/lib/{clsx-eGVyq7ot.js → clsx-OumA9x-8.js} +1 -1
  115. package/lib/{dropdown-menu-CexIkt_V.js → dropdown-menu-Bragdu5m.js} +1 -1
  116. package/lib/{dropdown-menu-oSKIntXM.cjs → dropdown-menu-CUeq1boX.cjs} +1 -1
  117. package/lib/extensions/Image/Image.d.ts +1 -0
  118. package/lib/{index-D_8P0LE5.js → index-B-7eHzaO.js} +1 -1
  119. package/lib/{index-RIXs7STX.js → index-BKlbc8Qo.js} +1 -1
  120. package/lib/index-BLrMslr7.cjs +1 -0
  121. package/lib/{index-mfGK4pFo.js → index-BVRHx_ha.js} +94 -90
  122. package/lib/{index-DHUN85fV.js → index-CDFAs4RT.js} +1149 -1019
  123. package/lib/{index-CJ9pyCM4.cjs → index-CMLwKzI0.cjs} +1 -1
  124. package/lib/index-COCTP78Y.cjs +12 -0
  125. package/lib/{index-BnW6t8z6.js → index-CZ1_8JQQ.js} +1 -1
  126. package/lib/{index-D0lc95kr.cjs → index-CnePcUeF.cjs} +1 -1
  127. package/lib/{index-DUpSE1Gb.cjs → index-D7wfvzJg.cjs} +1 -1
  128. package/lib/{index-zig3Dj7A.cjs → index-DwSnESy-.cjs} +7 -5
  129. package/lib/{index-C6xmkxrQ.js → index-cPEuL4Zr.js} +140 -138
  130. package/lib/index.cjs +1 -1
  131. package/lib/index.js +12 -12
  132. package/lib/{popover-BYSZ3zBi.js → popover-C2BbhsXH.js} +1 -1
  133. package/lib/{popover-BcHDZqBt.cjs → popover-DCJpsZx0.cjs} +1 -1
  134. package/lib/{renderNodeView-BrM5kUj_.js → renderNodeView-CmnUEfby.js} +2 -2
  135. package/lib/{renderNodeView-D1zydtli.cjs → renderNodeView-DQjWzXDA.cjs} +1 -1
  136. package/lib/{separator-BmixLrnJ.cjs → separator-BuG1zwKa.cjs} +1 -1
  137. package/lib/{separator-CFKVxAea.js → separator-lkMWuUvf.js} +14 -14
  138. package/lib/{updatePosition-CfmY5Trk.cjs → updatePosition-D6AScA-1.cjs} +1 -1
  139. package/lib/{updatePosition-CBRjbQMH.js → updatePosition-DYuAiqx-.js} +2 -2
  140. package/package.json +1 -1
  141. package/lib/Katex-CIC9ygbL.cjs +0 -4
  142. package/lib/index-BUTn2LY6.cjs +0 -1
  143. package/lib/index-BtxvYLJ1.cjs +0 -12
  144. package/lib/select-C5SHDLFj.js +0 -120
  145. package/lib/select-DHjzKkcu.cjs +0 -1
  146. package/lib/textarea-CasDcv3u.cjs +0 -1
  147. package/lib/textarea-DNLrJoRl.js +0 -20
@@ -1318,10 +1318,10 @@ function kt(r) {
1318
1318
  function Be(r) {
1319
1319
  return r.document || window.document;
1320
1320
  }
1321
- const xt = /* @__PURE__ */ new WeakMap();
1321
+ const vt = /* @__PURE__ */ new WeakMap();
1322
1322
  function Xn(r) {
1323
- let e = xt.get(r);
1324
- return e === void 0 && xt.set(r, e = Yn(r)), e;
1323
+ let e = vt.get(r);
1324
+ return e === void 0 && vt.set(r, e = Yn(r)), e;
1325
1325
  }
1326
1326
  function Yn(r) {
1327
1327
  let e = null;
@@ -1383,7 +1383,7 @@ const Wt = 65535, Jt = Math.pow(2, 16);
1383
1383
  function Qn(r, e) {
1384
1384
  return r + e * Jt;
1385
1385
  }
1386
- function vt(r) {
1386
+ function xt(r) {
1387
1387
  return r & Wt;
1388
1388
  }
1389
1389
  function Zn(r) {
@@ -1440,7 +1440,7 @@ class $ {
1440
1440
  @internal
1441
1441
  */
1442
1442
  recover(e) {
1443
- let t = 0, n = vt(e);
1443
+ let t = 0, n = xt(e);
1444
1444
  if (!this.inverted)
1445
1445
  for (let i = 0; i < n; i++)
1446
1446
  t += this.ranges[i * 3 + 2] - this.ranges[i * 3 + 1];
@@ -1477,7 +1477,7 @@ class $ {
1477
1477
  @internal
1478
1478
  */
1479
1479
  touches(e, t) {
1480
- let n = 0, i = vt(t), s = this.inverted ? 2 : 1, o = this.inverted ? 1 : 2;
1480
+ let n = 0, i = xt(t), s = this.inverted ? 2 : 1, o = this.inverted ? 1 : 2;
1481
1481
  for (let l = 0; l < this.ranges.length; l += 3) {
1482
1482
  let a = this.ranges[l] - (this.inverted ? n : 0);
1483
1483
  if (a > e)
@@ -2514,8 +2514,8 @@ function gr(r, e, t, n) {
2514
2514
  for (let m = 0; m < o.length; m++) {
2515
2515
  let g = o[(m + a) % o.length], y = !0;
2516
2516
  g < 0 && (y = !1, g = -g);
2517
- let x = i.node(g - 1), v = i.index(g - 1);
2518
- if (x.canReplaceWith(v, v, p.type, p.marks))
2517
+ let v = i.node(g - 1), x = i.index(g - 1);
2518
+ if (v.canReplaceWith(x, x, p.type, p.marks))
2519
2519
  return r.replace(i.before(g), y ? s.after(g) : t, new k(Yt(n.content, 0, n.openStart, h), h, n.openEnd));
2520
2520
  }
2521
2521
  }
@@ -2897,7 +2897,7 @@ class E {
2897
2897
  `$head`.
2898
2898
  */
2899
2899
  constructor(e, t, n) {
2900
- this.$anchor = e, this.$head = t, this.ranges = n || [new xr(e.min(t), e.max(t))];
2900
+ this.$anchor = e, this.$head = t, this.ranges = n || [new vr(e.min(t), e.max(t))];
2901
2901
  }
2902
2902
  /**
2903
2903
  The selection's anchor, as an unresolved position.
@@ -3055,7 +3055,7 @@ class E {
3055
3055
  }
3056
3056
  }
3057
3057
  E.prototype.visible = !0;
3058
- class xr {
3058
+ class vr {
3059
3059
  /**
3060
3060
  Create a range.
3061
3061
  */
@@ -3243,11 +3243,11 @@ class F extends E {
3243
3243
  return e instanceof F;
3244
3244
  }
3245
3245
  getBookmark() {
3246
- return vr;
3246
+ return xr;
3247
3247
  }
3248
3248
  }
3249
3249
  E.jsonID("all", F);
3250
- const vr = {
3250
+ const xr = {
3251
3251
  map() {
3252
3252
  return this;
3253
3253
  },
@@ -3287,33 +3287,33 @@ function Et(r, e, t) {
3287
3287
  function Ct(r, e) {
3288
3288
  return !e || !r ? r : r.bind(e);
3289
3289
  }
3290
- class xe {
3290
+ class ve {
3291
3291
  constructor(e, t, n) {
3292
3292
  this.name = e, this.init = Ct(t.init, n), this.apply = Ct(t.apply, n);
3293
3293
  }
3294
3294
  }
3295
- new xe("doc", {
3295
+ new ve("doc", {
3296
3296
  init(r) {
3297
3297
  return r.doc || r.schema.topNodeType.createAndFill();
3298
3298
  },
3299
3299
  apply(r) {
3300
3300
  return r.doc;
3301
3301
  }
3302
- }), new xe("selection", {
3302
+ }), new ve("selection", {
3303
3303
  init(r, e) {
3304
3304
  return r.selection || E.atStart(e.doc);
3305
3305
  },
3306
3306
  apply(r) {
3307
3307
  return r.selection;
3308
3308
  }
3309
- }), new xe("storedMarks", {
3309
+ }), new ve("storedMarks", {
3310
3310
  init(r) {
3311
3311
  return r.storedMarks || null;
3312
3312
  },
3313
3313
  apply(r, e, t, n) {
3314
3314
  return n.selection.$cursor ? r.storedMarks : null;
3315
3315
  }
3316
- }), new xe("scrollToSelection", {
3316
+ }), new ve("scrollToSelection", {
3317
3317
  init() {
3318
3318
  return 0;
3319
3319
  },
@@ -3658,10 +3658,10 @@ function un(r, e, t, n) {
3658
3658
  if (h.canReplace(h.childCount, h.childCount, m.content)) {
3659
3659
  if (t) {
3660
3660
  let y = w.empty;
3661
- for (let v = p.length - 1; v >= 0; v--)
3662
- y = w.from(p[v].copy(y));
3663
- let x = r.tr.step(new I(e.pos - p.length, e.pos + s.nodeSize, e.pos + g, e.pos + s.nodeSize - g, new k(y, p.length, 0), 0, !0));
3664
- t(x.scrollIntoView());
3661
+ for (let x = p.length - 1; x >= 0; x--)
3662
+ y = w.from(p[x].copy(y));
3663
+ let v = r.tr.step(new I(e.pos - p.length, e.pos + s.nodeSize, e.pos + g, e.pos + s.nodeSize - g, new k(y, p.length, 0), 0, !0));
3664
+ t(v.scrollIntoView());
3665
3665
  }
3666
3666
  return !0;
3667
3667
  }
@@ -3930,7 +3930,7 @@ ct(pn, {
3930
3930
  joinItemBackward: () => yi,
3931
3931
  joinItemForward: () => wi,
3932
3932
  joinTextblockBackward: () => ki,
3933
- joinTextblockForward: () => xi,
3933
+ joinTextblockForward: () => vi,
3934
3934
  joinUp: () => hi,
3935
3935
  keyboardShortcut: () => bi,
3936
3936
  lift: () => Si,
@@ -4144,7 +4144,7 @@ var li = (r = null, e = {}) => ({ editor: t, view: n, tr: i, dispatch: s }) => {
4144
4144
  }
4145
4145
  return r;
4146
4146
  };
4147
- function ve(r) {
4147
+ function xe(r) {
4148
4148
  if (typeof window > "u")
4149
4149
  throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");
4150
4150
  const e = `<body>${r}</body>`, t = new window.DOMParser().parseFromString(e, "text/html").body;
@@ -4191,13 +4191,13 @@ function pe(r, e, t) {
4191
4191
  }
4192
4192
  })
4193
4193
  });
4194
- if (t.slice ? $e.fromSchema(a).parseSlice(ve(r), t.parseOptions) : $e.fromSchema(a).parse(ve(r), t.parseOptions), t.errorOnInvalidContent && o)
4194
+ if (t.slice ? $e.fromSchema(a).parseSlice(xe(r), t.parseOptions) : $e.fromSchema(a).parse(xe(r), t.parseOptions), t.errorOnInvalidContent && o)
4195
4195
  throw new Error("[tiptap error]: Invalid HTML content", {
4196
4196
  cause: new Error(`Invalid element found: ${l}`)
4197
4197
  });
4198
4198
  }
4199
4199
  const s = $e.fromSchema(e);
4200
- return t.slice ? s.parseSlice(ve(r), t.parseOptions).content : s.parse(ve(r), t.parseOptions);
4200
+ return t.slice ? s.parseSlice(xe(r), t.parseOptions).content : s.parse(xe(r), t.parseOptions);
4201
4201
  }
4202
4202
  return pe("", e, t);
4203
4203
  }
@@ -4274,8 +4274,8 @@ var ui = (r) => !("type" in r), di = (r, e, t) => ({ tr: n, dispatch: i, editor:
4274
4274
  n.insertText(m, f, u);
4275
4275
  } else {
4276
4276
  m = l;
4277
- const g = n.doc.resolve(f), y = g.node(), x = g.parentOffset === 0, v = y.isText || y.isTextblock, S = y.content.size > 0;
4278
- x && v && S && (f = Math.max(0, f - 1)), n.replaceWith(f, u, m);
4277
+ const g = n.doc.resolve(f), y = g.node(), v = g.parentOffset === 0, x = y.isText || y.isTextblock, S = y.content.size > 0;
4278
+ v && x && S && (f = Math.max(0, f - 1)), n.replaceWith(f, u, m);
4279
4279
  }
4280
4280
  t.updateSelection && fi(n, n.steps.length - 1, -1), t.applyInputRules && n.setMeta("applyInputRules", { from: f, text: m }), t.applyPasteRules && n.setMeta("applyPasteRules", { from: f, text: m });
4281
4281
  }
@@ -4294,11 +4294,11 @@ var ui = (r) => !("type" in r), di = (r, e, t) => ({ tr: n, dispatch: i, editor:
4294
4294
  } catch {
4295
4295
  return !1;
4296
4296
  }
4297
- }, ki = () => ({ state: r, dispatch: e }) => br(r, e), xi = () => ({ state: r, dispatch: e }) => Sr(r, e);
4297
+ }, ki = () => ({ state: r, dispatch: e }) => br(r, e), vi = () => ({ state: r, dispatch: e }) => Sr(r, e);
4298
4298
  function wn() {
4299
4299
  return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
4300
4300
  }
4301
- function vi(r) {
4301
+ function xi(r) {
4302
4302
  const e = r.split(/-(?!$)/);
4303
4303
  let t = e[e.length - 1];
4304
4304
  t === "Space" && (t = " ");
@@ -4321,7 +4321,7 @@ function vi(r) {
4321
4321
  return n && (t = `Alt-${t}`), i && (t = `Ctrl-${t}`), o && (t = `Meta-${t}`), s && (t = `Shift-${t}`), t;
4322
4322
  }
4323
4323
  var bi = (r) => ({ editor: e, view: t, tr: n, dispatch: i }) => {
4324
- const s = vi(r).split(/-(?!$)/), o = s.find((c) => !["Alt", "Ctrl", "Meta", "Shift"].includes(c)), l = new KeyboardEvent("keydown", {
4324
+ const s = xi(r).split(/-(?!$)/), o = s.find((c) => !["Alt", "Ctrl", "Meta", "Shift"].includes(c)), l = new KeyboardEvent("keydown", {
4325
4325
  key: o === "Space" ? " " : o,
4326
4326
  altKey: s.includes("Alt"),
4327
4327
  ctrlKey: s.includes("Ctrl"),
@@ -4470,7 +4470,7 @@ function Wi(r) {
4470
4470
  function W(r, e = void 0, ...t) {
4471
4471
  return Wi(r) ? e ? r.bind(e)(...t) : r(...t) : r;
4472
4472
  }
4473
- function xn(r) {
4473
+ function vn(r) {
4474
4474
  const e = r.filter((i) => i.type === "extension"), t = r.filter((i) => i.type === "node"), n = r.filter((i) => i.type === "mark");
4475
4475
  return {
4476
4476
  baseExtensions: e,
@@ -4545,7 +4545,7 @@ function Vs(r, e) {
4545
4545
  [t.name]: r.attrs[t.name]
4546
4546
  }).reduce((t, n) => ji(t, n), {});
4547
4547
  }
4548
- function vn(r, e, t) {
4548
+ function xn(r, e, t) {
4549
4549
  const { from: n, to: i } = e, { blockSeparator: s = `
4550
4550
 
4551
4551
  `, textSerializers: o = {} } = t || {};
@@ -4570,7 +4570,7 @@ function qs(r, e) {
4570
4570
  from: 0,
4571
4571
  to: r.content.size
4572
4572
  };
4573
- return vn(r, t, e);
4573
+ return xn(r, t, e);
4574
4574
  }
4575
4575
  function Hi(r) {
4576
4576
  return Object.fromEntries(
@@ -4680,12 +4680,12 @@ function Ze(r, e, t = {}) {
4680
4680
  return !1;
4681
4681
  if (!m.isText && !m.marks.length)
4682
4682
  return;
4683
- const y = Math.max(h, g), x = Math.min(p, g + m.nodeSize), v = x - y;
4684
- o += v, l.push(
4683
+ const y = Math.max(h, g), v = Math.min(p, g + m.nodeSize), x = v - y;
4684
+ o += x, l.push(
4685
4685
  ...m.marks.map((S) => ({
4686
4686
  mark: S,
4687
4687
  from: y,
4688
- to: x
4688
+ to: v
4689
4689
  }))
4690
4690
  );
4691
4691
  });
@@ -4715,7 +4715,7 @@ var Ys = (r, e) => {
4715
4715
  return !(e.parentOffset > 0 || e.pos !== t.pos);
4716
4716
  };
4717
4717
  function Nt(r, e) {
4718
- const { nodeExtensions: t } = xn(e), n = t.find((o) => o.name === r);
4718
+ const { nodeExtensions: t } = vn(e), n = t.find((o) => o.name === r);
4719
4719
  if (!n)
4720
4720
  return !1;
4721
4721
  const i = {
@@ -4734,7 +4734,7 @@ function Sn(r, {
4734
4734
  if (r.type.name === "hardBreak")
4735
4735
  return !0;
4736
4736
  if (r.isText)
4737
- return /^\s*$/m.test((n = r.text) != null ? n : "");
4737
+ return !/\S/.test((n = r.text) != null ? n : "");
4738
4738
  }
4739
4739
  if (r.isText)
4740
4740
  return !r.text;
@@ -4922,10 +4922,10 @@ var rs = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, editor
4922
4922
  return !1;
4923
4923
  if (i) {
4924
4924
  let y = ne.empty;
4925
- const x = a.index(-1) ? 1 : a.index(-2) ? 2 : 3;
4926
- for (let P = a.depth - x; P >= a.depth - 3; P -= 1)
4925
+ const v = a.index(-1) ? 1 : a.index(-2) ? 2 : 3;
4926
+ for (let P = a.depth - v; P >= a.depth - 3; P -= 1)
4927
4927
  y = ne.from(a.node(P).copy(y));
4928
- const v = (
4928
+ const x = (
4929
4929
  // eslint-disable-next-line no-nested-ternary
4930
4930
  a.indexAfter(-1) < a.node(-2).childCount ? 1 : a.indexAfter(-2) < a.node(-3).childCount ? 2 : 3
4931
4931
  ), S = {
@@ -4933,8 +4933,8 @@ var rs = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, editor
4933
4933
  ...e
4934
4934
  }, b = ((o = l.contentMatch.defaultType) == null ? void 0 : o.createAndFill(S)) || void 0;
4935
4935
  y = y.append(ne.from(l.createAndFill(null, b) || void 0));
4936
- const T = a.before(a.depth - (x - 1));
4937
- t.replace(T, a.after(-v), new $n(y, 4 - x, 0));
4936
+ const T = a.before(a.depth - (v - 1));
4937
+ t.replace(T, a.after(-x), new $n(y, 4 - v, 0));
4938
4938
  let N = -1;
4939
4939
  t.doc.nodesBetween(T, t.doc.content.size, (P, V) => {
4940
4940
  if (N > -1)
@@ -4959,10 +4959,10 @@ var rs = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, editor
4959
4959
  if (!_(t.doc, a.pos, 2))
4960
4960
  return !1;
4961
4961
  if (i) {
4962
- const { selection: y, storedMarks: x } = n, { splittableMarks: v } = s.extensionManager, S = x || y.$to.parentOffset && y.$from.marks();
4962
+ const { selection: y, storedMarks: v } = n, { splittableMarks: x } = s.extensionManager, S = v || y.$to.parentOffset && y.$from.marks();
4963
4963
  if (t.split(a.pos, 2, g).scrollIntoView(), !S || !i)
4964
4964
  return !0;
4965
- const b = S.filter((T) => v.includes(T.type.name));
4965
+ const b = S.filter((T) => x.includes(T.type.name));
4966
4966
  t.ensureMarks(b);
4967
4967
  }
4968
4968
  return !0;
@@ -4985,11 +4985,11 @@ var rs = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, editor
4985
4985
  const i = r.doc.nodeAt(n);
4986
4986
  return t.node.type === (i == null ? void 0 : i.type) && Q(r.doc, n) && r.join(n), !0;
4987
4987
  }, ss = (r, e, t, n = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain: a, commands: c, can: f }) => {
4988
- const { extensions: u, splittableMarks: d } = i.extensionManager, h = R(r, o.schema), p = R(e, o.schema), { selection: m, storedMarks: g } = o, { $from: y, $to: x } = m, v = y.blockRange(x), S = g || m.$to.parentOffset && m.$from.marks();
4989
- if (!v)
4988
+ const { extensions: u, splittableMarks: d } = i.extensionManager, h = R(r, o.schema), p = R(e, o.schema), { selection: m, storedMarks: g } = o, { $from: y, $to: v } = m, x = y.blockRange(v), S = g || m.$to.parentOffset && m.$from.marks();
4989
+ if (!x)
4990
4990
  return !1;
4991
4991
  const b = ze((T) => Nt(T.type.name, u))(m);
4992
- if (v.depth >= 1 && b && v.depth - b.depth <= 1) {
4992
+ if (x.depth >= 1 && b && x.depth - b.depth <= 1) {
4993
4993
  if (b.node.type === h)
4994
4994
  return c.liftListItem(p);
4995
4995
  if (Nt(b.node.type.name, u) && h.validContent(b.node.content) && l)
@@ -5076,14 +5076,14 @@ var rs = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, editor
5076
5076
  y < f && s && s === g.type && (a = !0, p = Math.max(y, f), m = Math.min(y + g.nodeSize, u), d = y, h = g), y >= f && y <= u && (s && s === g.type && (a = !0, i && t.setNodeMarkup(y, void 0, {
5077
5077
  ...g.attrs,
5078
5078
  ...e
5079
- })), o && g.marks.length && g.marks.forEach((x) => {
5080
- if (o === x.type && (a = !0, i)) {
5081
- const v = Math.max(y, f), S = Math.min(y + g.nodeSize, u);
5079
+ })), o && g.marks.length && g.marks.forEach((v) => {
5080
+ if (o === v.type && (a = !0, i)) {
5081
+ const x = Math.max(y, f), S = Math.min(y + g.nodeSize, u);
5082
5082
  t.addMark(
5083
- v,
5083
+ x,
5084
5084
  S,
5085
5085
  o.create({
5086
- ...x.attrs,
5086
+ ...v.attrs,
5087
5087
  ...e
5088
5088
  })
5089
5089
  );
@@ -5207,8 +5207,8 @@ var Tn = class {
5207
5207
  }, ws = {};
5208
5208
  ct(ws, {
5209
5209
  ClipboardTextSerializer: () => ks,
5210
- Commands: () => xs,
5211
- Delete: () => vs,
5210
+ Commands: () => vs,
5211
+ Delete: () => xs,
5212
5212
  Drop: () => bs,
5213
5213
  Editable: () => Ss,
5214
5214
  FocusEvents: () => Ms,
@@ -5251,7 +5251,7 @@ var J = class An extends ut {
5251
5251
  props: {
5252
5252
  clipboardTextSerializer: () => {
5253
5253
  const { editor: r } = this, { state: e, schema: t } = r, { doc: n, selection: i } = e, { ranges: s } = i, o = Math.min(...s.map((f) => f.$from.pos)), l = Math.max(...s.map((f) => f.$to.pos)), a = Hi(t);
5254
- return vn(n, { from: o, to: l }, {
5254
+ return xn(n, { from: o, to: l }, {
5255
5255
  ...this.options.blockSeparator !== void 0 ? { blockSeparator: this.options.blockSeparator } : {},
5256
5256
  textSerializers: a
5257
5257
  });
@@ -5260,14 +5260,14 @@ var J = class An extends ut {
5260
5260
  })
5261
5261
  ];
5262
5262
  }
5263
- }), xs = J.create({
5263
+ }), vs = J.create({
5264
5264
  name: "commands",
5265
5265
  addCommands() {
5266
5266
  return {
5267
5267
  ...pn
5268
5268
  };
5269
5269
  }
5270
- }), vs = J.create({
5270
+ }), xs = J.create({
5271
5271
  name: "delete",
5272
5272
  onUpdate({ transaction: r, appendedTransactions: e }) {
5273
5273
  var t, n, i;
@@ -5299,19 +5299,19 @@ var J = class An extends ut {
5299
5299
  f.steps.forEach((h, p) => {
5300
5300
  var m, g;
5301
5301
  if (h instanceof D) {
5302
- const y = d.slice(p).map(h.from, -1), x = d.slice(p).map(h.to), v = d.invert().map(y, -1), S = d.invert().map(x), b = (m = f.doc.nodeAt(y - 1)) == null ? void 0 : m.marks.some((N) => N.eq(h.mark)), T = (g = f.doc.nodeAt(x)) == null ? void 0 : g.marks.some((N) => N.eq(h.mark));
5302
+ const y = d.slice(p).map(h.from, -1), v = d.slice(p).map(h.to), x = d.invert().map(y, -1), S = d.invert().map(v), b = (m = f.doc.nodeAt(y - 1)) == null ? void 0 : m.marks.some((N) => N.eq(h.mark)), T = (g = f.doc.nodeAt(v)) == null ? void 0 : g.marks.some((N) => N.eq(h.mark));
5303
5303
  this.editor.emit("delete", {
5304
5304
  type: "mark",
5305
5305
  mark: h.mark,
5306
5306
  from: h.from,
5307
5307
  to: h.to,
5308
5308
  deletedRange: {
5309
- from: v,
5309
+ from: x,
5310
5310
  to: S
5311
5311
  },
5312
5312
  newRange: {
5313
5313
  from: y,
5314
- to: x
5314
+ to: v
5315
5315
  },
5316
5316
  partial: !!(T || b),
5317
5317
  editor: this.editor,
@@ -5496,7 +5496,7 @@ var J = class An extends ut {
5496
5496
  addGlobalAttributes() {
5497
5497
  if (!this.options.direction)
5498
5498
  return [];
5499
- const { nodeExtensions: r } = xn(this.extensions);
5499
+ const { nodeExtensions: r } = vn(this.extensions);
5500
5500
  return [
5501
5501
  {
5502
5502
  types: r.filter((e) => e.name !== "text").map((e) => e.name),
@@ -5972,7 +5972,7 @@ function Ns(r) {
5972
5972
  if (!p)
5973
5973
  return;
5974
5974
  const m = p[1] || "", g = n(m);
5975
- if (!o.find((x) => !(x in g)))
5975
+ if (!o.find((v) => !(v in g)))
5976
5976
  return {
5977
5977
  type: e,
5978
5978
  raw: p[0],
@@ -6027,7 +6027,7 @@ function zs(r) {
6027
6027
  const m = new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`), g = u.match(m);
6028
6028
  if (!g)
6029
6029
  return;
6030
- const [y, x = ""] = g, v = i(x);
6030
+ const [y, v = ""] = g, x = i(v);
6031
6031
  let S = 1;
6032
6032
  const b = y.length;
6033
6033
  let T = "";
@@ -6061,7 +6061,7 @@ function zs(r) {
6061
6061
  return {
6062
6062
  type: e,
6063
6063
  raw: zn,
6064
- attributes: v,
6064
+ attributes: x,
6065
6065
  content: T,
6066
6066
  tokens: q
6067
6067
  };
@@ -6139,20 +6139,20 @@ function Ps(r) {
6139
6139
  const m = l ? new RegExp(`^\\[${u}\\s*([^\\]]*)\\]`) : new RegExp(`^\\[${u}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${u}\\]`), g = d.match(m);
6140
6140
  if (!g)
6141
6141
  return;
6142
- let y = "", x = "";
6142
+ let y = "", v = "";
6143
6143
  if (l) {
6144
6144
  const [, S] = g;
6145
- x = S;
6145
+ v = S;
6146
6146
  } else {
6147
6147
  const [, S, b] = g;
6148
- x = S, y = b || "";
6148
+ v = S, y = b || "";
6149
6149
  }
6150
- const v = i(x.trim());
6150
+ const x = i(v.trim());
6151
6151
  return {
6152
6152
  type: e,
6153
6153
  raw: g[0],
6154
6154
  content: y.trim(),
6155
- attributes: v
6155
+ attributes: x
6156
6156
  };
6157
6157
  }
6158
6158
  },
@@ -6205,14 +6205,14 @@ function Bs(r, e, t) {
6205
6205
  else
6206
6206
  break;
6207
6207
  }
6208
- let x;
6209
- const v = y.slice(1);
6210
- if (v.length > 0) {
6211
- const b = v.map((T) => T.slice(m + u)).join(`
6208
+ let v;
6209
+ const x = y.slice(1);
6210
+ if (x.length > 0) {
6211
+ const b = x.map((T) => T.slice(m + u)).join(`
6212
6212
  `);
6213
- b.trim() && (e.customNestedParser ? x = e.customNestedParser(b) : x = t.blockTokens(b));
6213
+ b.trim() && (e.customNestedParser ? v = e.customNestedParser(b) : v = t.blockTokens(b));
6214
6214
  }
6215
- const S = e.createToken(p, x);
6215
+ const S = e.createToken(p, v);
6216
6216
  a.push(S);
6217
6217
  }
6218
6218
  if (a.length !== 0)
@@ -6224,17 +6224,21 @@ function Bs(r, e, t) {
6224
6224
  function Ds(r, e, t, n) {
6225
6225
  if (!r || !Array.isArray(r.content))
6226
6226
  return "";
6227
- const i = typeof t == "function" ? t(n) : t, [s, ...o] = r.content, l = e.renderChildren([s]), a = [`${i}${l}`];
6228
- return o && o.length > 0 && o.forEach((c) => {
6229
- const f = e.renderChildren([c]);
6230
- if (f) {
6231
- const u = f.split(`
6232
- `).map((d) => d ? e.indent(d) : "").join(`
6227
+ const i = typeof t == "function" ? t(n) : t, [s, ...o] = r.content, l = e.renderChildren([s]);
6228
+ let a = `${i}${l}`;
6229
+ return o && o.length > 0 && o.forEach((c, f) => {
6230
+ var u, d;
6231
+ const h = (d = (u = e.renderChild) == null ? void 0 : u.call(e, c, f + 1)) != null ? d : e.renderChildren([c]);
6232
+ if (h != null) {
6233
+ const p = h.split(`
6234
+ `).map((m) => m ? e.indent(m) : e.indent("")).join(`
6233
6235
  `);
6234
- a.push(u);
6236
+ a += c.type === "paragraph" ? `
6237
+
6238
+ ${p}` : `
6239
+ ${p}`;
6235
6240
  }
6236
- }), a.join(`
6237
- `);
6241
+ }), a;
6238
6242
  }
6239
6243
  var uo = class Rn extends ut {
6240
6244
  constructor() {
@@ -6278,13 +6282,13 @@ var uo = class Rn extends ut {
6278
6282
  return;
6279
6283
  let u = 0, d = 0;
6280
6284
  if (this.dom !== f) {
6281
- const x = this.dom.getBoundingClientRect(), v = f.getBoundingClientRect(), S = (i = r.offsetX) != null ? i : (n = r.nativeEvent) == null ? void 0 : n.offsetX, b = (o = r.offsetY) != null ? o : (s = r.nativeEvent) == null ? void 0 : s.offsetY;
6282
- u = v.x - x.x + S, d = v.y - x.y + b;
6285
+ const v = this.dom.getBoundingClientRect(), x = f.getBoundingClientRect(), S = (i = r.offsetX) != null ? i : (n = r.nativeEvent) == null ? void 0 : n.offsetX, b = (o = r.offsetY) != null ? o : (s = r.nativeEvent) == null ? void 0 : s.offsetY;
6286
+ u = x.x - v.x + S, d = x.y - v.y + b;
6283
6287
  }
6284
6288
  const h = this.dom.cloneNode(!0);
6285
6289
  try {
6286
- const x = this.dom.getBoundingClientRect();
6287
- h.style.width = `${Math.round(x.width)}px`, h.style.height = `${Math.round(x.height)}px`, h.style.boxSizing = "border-box", h.style.pointerEvents = "none";
6290
+ const v = this.dom.getBoundingClientRect();
6291
+ h.style.width = `${Math.round(v.width)}px`, h.style.height = `${Math.round(v.height)}px`, h.style.boxSizing = "border-box", h.style.pointerEvents = "none";
6288
6292
  } catch {
6289
6293
  }
6290
6294
  let p = null;
@@ -6427,7 +6431,7 @@ export {
6427
6431
  E as S,
6428
6432
  O as T,
6429
6433
  Sn as U,
6430
- xr as V,
6434
+ vr as V,
6431
6435
  kr as W,
6432
6436
  Li as X,
6433
6437
  ho as Y,