reactjs-tiptap-editor 1.0.17 → 1.0.18

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 (212) hide show
  1. package/lib/{ActionMenuButton-lsIBc9sU.js → ActionMenuButton-BOjCHFTA.js} +6 -6
  2. package/lib/ActionMenuButton-Df077oOH.cjs +1 -0
  3. package/lib/Attachment.cjs +2 -2
  4. package/lib/Attachment.js +40 -78
  5. package/lib/Blockquote.cjs +1 -1
  6. package/lib/Blockquote.js +2 -3
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +2 -3
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +2 -3
  11. package/lib/Callout.cjs +1 -1
  12. package/lib/Callout.js +105 -99
  13. package/lib/Clear.cjs +1 -1
  14. package/lib/Clear.js +2 -3
  15. package/lib/Code.cjs +1 -1
  16. package/lib/Code.js +2 -3
  17. package/lib/CodeBlock.cjs +38 -38
  18. package/lib/CodeBlock.js +1561 -1605
  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 +46 -63
  23. package/lib/Column.cjs +1 -1
  24. package/lib/Column.js +24 -10
  25. package/lib/Drawer-DwrlY_lY.cjs +1 -0
  26. package/lib/Drawer-DxOoRiGQ.js +1099 -0
  27. package/lib/Drawer.cjs +1 -1
  28. package/lib/Drawer.js +6 -5
  29. package/lib/Emoji.cjs +1 -1
  30. package/lib/Emoji.js +69 -93
  31. package/lib/Excalidraw.cjs +1 -1
  32. package/lib/Excalidraw.js +99 -110
  33. package/lib/ExportPdf.cjs +4 -4
  34. package/lib/ExportPdf.js +4 -13
  35. package/lib/ExportWord.cjs +1 -1
  36. package/lib/ExportWord.js +9 -7
  37. package/lib/FontFamily.cjs +1 -1
  38. package/lib/FontFamily.js +12 -34
  39. package/lib/FontSize.cjs +1 -1
  40. package/lib/FontSize.js +12 -27
  41. package/lib/Heading.cjs +1 -1
  42. package/lib/Heading.js +34 -47
  43. package/lib/Highlight.cjs +1 -1
  44. package/lib/Highlight.js +39 -52
  45. package/lib/History.cjs +1 -1
  46. package/lib/History.js +318 -313
  47. package/lib/HorizontalRule.cjs +1 -1
  48. package/lib/HorizontalRule.js +2 -3
  49. package/lib/{Iframe-CTajPyzs.js → Iframe-AhNV5WH5.js} +25 -34
  50. package/lib/Iframe-C6pBw-AF.cjs +1 -0
  51. package/lib/Iframe.cjs +1 -1
  52. package/lib/Iframe.js +5 -4
  53. package/lib/Image.cjs +1 -1
  54. package/lib/Image.js +5 -4
  55. package/lib/ImageGif.cjs +1 -1
  56. package/lib/ImageGif.js +63 -91
  57. package/lib/ImportWord.cjs +1 -1
  58. package/lib/ImportWord.js +7 -11
  59. package/lib/{Indent-BGEHlRx_.js → Indent-DZ5PcJA4.js} +3 -7
  60. package/lib/Indent-Do-X0AsY.cjs +1 -0
  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 +2 -3
  65. package/lib/Katex-CIC9ygbL.cjs +4 -0
  66. package/lib/{Katex-tMh4bfBb.js → Katex-bIgoenn_.js} +241 -255
  67. package/lib/Katex.cjs +1 -1
  68. package/lib/Katex.js +5 -4
  69. package/lib/LineHeight.cjs +1 -1
  70. package/lib/LineHeight.js +13 -21
  71. package/lib/Link.cjs +1 -1
  72. package/lib/Link.js +2 -2
  73. package/lib/LinkEditBlock-B0ZaACZO.cjs +5 -0
  74. package/lib/{LinkEditBlock-CA5NhP-m.js → LinkEditBlock-D_cF9fnc.js} +320 -370
  75. package/lib/MarkdownPaste.cjs +58 -0
  76. package/lib/MarkdownPaste.js +1656 -0
  77. package/lib/Mention.cjs +1 -1
  78. package/lib/Mention.js +22 -17
  79. package/lib/Mermaid.cjs +2 -2
  80. package/lib/Mermaid.js +118 -142
  81. package/lib/MoreMark.cjs +1 -1
  82. package/lib/MoreMark.js +10 -18
  83. package/lib/OrderedList.cjs +1 -1
  84. package/lib/OrderedList.js +2 -3
  85. package/lib/SearchAndReplace.cjs +1 -1
  86. package/lib/SearchAndReplace.js +68 -133
  87. package/lib/SlashCommand.cjs +1 -1
  88. package/lib/SlashCommand.js +15 -14
  89. package/lib/{SlashCommandNodeView-CZoM3ZlS.cjs → SlashCommandNodeView-Ba03hlVZ.cjs} +1 -1
  90. package/lib/{SlashCommandNodeView-DLuqbX2o.js → SlashCommandNodeView-cg0x3NRF.js} +15 -17
  91. package/lib/Strike.cjs +1 -1
  92. package/lib/Strike.js +2 -3
  93. package/lib/{Table-BC4Lbqzn.js → Table-KqLiT5wG.js} +95 -133
  94. package/lib/Table-ddU2LSc6.cjs +9 -0
  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 -3
  99. package/lib/TextAlign.cjs +1 -1
  100. package/lib/TextAlign.js +51 -60
  101. package/lib/TextDirection.cjs +1 -1
  102. package/lib/TextDirection.js +47 -69
  103. package/lib/TextUnderline.cjs +1 -1
  104. package/lib/TextUnderline.js +2 -3
  105. package/lib/Twitter-BIiR78Jh.cjs +1 -0
  106. package/lib/{Twitter-D8Cbgl7g.js → Twitter-C1Lzqc7u.js} +567 -593
  107. package/lib/Twitter.cjs +1 -1
  108. package/lib/Twitter.js +4 -3
  109. package/lib/Video.cjs +1 -1
  110. package/lib/Video.js +3 -3
  111. package/lib/bubble.cjs +6 -4
  112. package/lib/bubble.js +3712 -3023
  113. package/lib/clsx-BWE7vnna.cjs +33 -0
  114. package/lib/clsx-eGVyq7ot.js +1062 -0
  115. package/lib/components/ActionButton.d.ts +2 -2
  116. package/lib/components/ActionMenuButton.d.ts +1 -1
  117. package/lib/components/Bubble/formatBubble.d.ts +5 -5
  118. package/lib/components/ui/checkbox.d.ts +1 -1
  119. package/lib/components/ui/dialog.d.ts +1 -1
  120. package/lib/components/ui/dropdown-menu.d.ts +1 -1
  121. package/lib/components/ui/emoji-picker.d.ts +1 -1
  122. package/lib/components/ui/label.d.ts +1 -1
  123. package/lib/components/ui/popover.d.ts +1 -1
  124. package/lib/components/ui/select.d.ts +1 -1
  125. package/lib/components/ui/separator.d.ts +1 -1
  126. package/lib/components/ui/switch.d.ts +1 -1
  127. package/lib/components/ui/tabs.d.ts +1 -1
  128. package/lib/components/ui/toast.d.ts +1 -1
  129. package/lib/components/ui/toggle.d.ts +1 -1
  130. package/lib/components/ui/tooltip.d.ts +1 -1
  131. package/lib/{delete-node-IyVmiRbI.js → delete-node-eQHsyyhR.js} +3 -1
  132. package/lib/{dropdown-menu-q6RL_fkA.js → dropdown-menu-CexIkt_V.js} +8 -8
  133. package/lib/{dropdown-menu-C_F7LEy5.cjs → dropdown-menu-oSKIntXM.cjs} +1 -1
  134. package/lib/extensions/Blockquote/Blockquote.d.ts +1 -1
  135. package/lib/extensions/Bold/Bold.d.ts +1 -1
  136. package/lib/extensions/Code/Code.d.ts +1 -1
  137. package/lib/extensions/CodeView/CodeView.d.ts +2 -2
  138. package/lib/extensions/Heading/Heading.d.ts +1 -1
  139. package/lib/extensions/Highlight/Highlight.d.ts +1 -1
  140. package/lib/extensions/HorizontalRule/HorizontalRule.d.ts +1 -1
  141. package/lib/extensions/ImportWord/ImportWord.d.ts +2 -2
  142. package/lib/extensions/Italic/Italic.d.ts +1 -1
  143. package/lib/extensions/Link/Link.d.ts +1 -1
  144. package/lib/extensions/MarkdownPaste/MarkdownPaste.d.ts +5 -0
  145. package/lib/extensions/MarkdownPaste/index.d.ts +1 -0
  146. package/lib/extensions/Mermaid/Mermaid.d.ts +1 -1
  147. package/lib/extensions/MoreMark/MoreMark.d.ts +1 -1
  148. package/lib/extensions/Strike/Strike.d.ts +1 -1
  149. package/lib/extensions/Table/Table.d.ts +1 -1
  150. package/lib/extensions/TextAlign/TextAlign.d.ts +1 -1
  151. package/lib/extensions/TextUnderline/TextUnderline.d.ts +1 -1
  152. package/lib/index-BUTn2LY6.cjs +1 -0
  153. package/lib/{index-C07N8gA1.js → index-BlXGgvT-.js} +21 -18
  154. package/lib/{index-DqruLhsu.js → index-BnW6t8z6.js} +23 -23
  155. package/lib/{index-BsFvo9PG.cjs → index-BqL4vAWE.cjs} +1 -1
  156. package/lib/index-BtxvYLJ1.cjs +12 -0
  157. package/lib/{index-Do_dsOGB.js → index-C6xmkxrQ.js} +232 -217
  158. package/lib/index-CJ9pyCM4.cjs +1 -0
  159. package/lib/{index-neeeY2o7.cjs → index-D0lc95kr.cjs} +3 -3
  160. package/lib/{index-RcSPeQHn.js → index-DHUN85fV.js} +571 -657
  161. package/lib/index-DUpSE1Gb.cjs +1 -0
  162. package/lib/index-D_8P0LE5.js +1362 -0
  163. package/lib/{index-BDYJ8Ph2.js → index-RIXs7STX.js} +1 -1
  164. package/lib/index-mfGK4pFo.js +6469 -0
  165. package/lib/index-zig3Dj7A.cjs +22 -0
  166. package/lib/index.cjs +1 -1
  167. package/lib/index.js +26 -34
  168. package/lib/locale-bundle.cjs +1 -1
  169. package/lib/locale-bundle.js +1 -1
  170. package/lib/plugins/image-upload.d.ts +1 -1
  171. package/lib/popover-BYSZ3zBi.js +24 -0
  172. package/lib/popover-BcHDZqBt.cjs +1 -0
  173. package/lib/{renderNodeView-BEkECnnY.js → renderNodeView-BrM5kUj_.js} +2 -2
  174. package/lib/{renderNodeView-DfLmGrgA.cjs → renderNodeView-D1zydtli.cjs} +1 -1
  175. package/lib/{select-CmV5uTXr.js → select-C5SHDLFj.js} +8 -5
  176. package/lib/{select-CYyIeImH.cjs → select-DHjzKkcu.cjs} +1 -1
  177. package/lib/{separator-BLp6xpSY.cjs → separator-BmixLrnJ.cjs} +1 -1
  178. package/lib/separator-CFKVxAea.js +293 -0
  179. package/lib/store/editor.d.ts +1 -1
  180. package/lib/store/store.d.ts +1 -1
  181. package/lib/style.css +1 -1
  182. package/lib/{textarea-Cn75Cm2n.cjs → textarea-CasDcv3u.cjs} +1 -1
  183. package/lib/{textarea-CkVKMPqK.js → textarea-DNLrJoRl.js} +1 -1
  184. package/lib/theme.js +1 -1
  185. package/lib/types.d.ts +3 -3
  186. package/lib/updatePosition-CBRjbQMH.js +16 -0
  187. package/lib/updatePosition-CfmY5Trk.cjs +1 -0
  188. package/lib/utils/columns.d.ts +1 -1
  189. package/lib/utils/pdf.d.ts +1 -1
  190. package/lib/utils/utils.d.ts +1 -1
  191. package/package.json +262 -247
  192. package/lib/ActionMenuButton-B_E2mbAW.cjs +0 -1
  193. package/lib/Drawer-DQ4CxBwG.js +0 -1373
  194. package/lib/Drawer-FUeUKshi.cjs +0 -1
  195. package/lib/Iframe-EVWXCqe4.cjs +0 -1
  196. package/lib/Indent-q9cEWAa_.cjs +0 -1
  197. package/lib/Katex-ClqcEnN_.cjs +0 -4
  198. package/lib/LinkEditBlock-DZXk4ln_.cjs +0 -5
  199. package/lib/Table-BmDopO43.cjs +0 -9
  200. package/lib/Twitter-BbMD3Ybp.cjs +0 -1
  201. package/lib/clsx-CXbNJWDD.cjs +0 -54
  202. package/lib/clsx-DaPvp9ji.js +0 -7391
  203. package/lib/index-BCzvbrf5.cjs +0 -12
  204. package/lib/index-BnVcq33n.cjs +0 -1
  205. package/lib/index-CjhjjJsN.cjs +0 -1
  206. package/lib/index-Cs6cp0Y6.cjs +0 -1
  207. package/lib/index-Qcl3BG94.js +0 -1351
  208. package/lib/popover-CtinPbiy.js +0 -24
  209. package/lib/popover-DIMT3pae.cjs +0 -1
  210. package/lib/separator-C7luvaG8.js +0 -327
  211. package/lib/updatePosition-Cjuj2E26.cjs +0 -1
  212. package/lib/updatePosition-DRmKQBGm.js +0 -16
@@ -1,12 +1,12 @@
1
- import { U as de, S as E, Z as Ve, T as $, F as v, x as L, Q as ke, v as Ke, _ as Xe, N as Z, m as J, W as Ue, X as Ge, E as Ee, $ as qe } from "./clsx-DaPvp9ji.js";
2
- import { TextSelection as Ze } from "@tiptap/pm/state";
3
- import { k as Je, D as oe, a as ne } from "./index-DqruLhsu.js";
1
+ import { L as de, S as E, V as Ve, T as W, F as v, u as L, K as ke, s as Ke, W as Xe, N as J, m as Z, Q as Ge, R as Ue, E as Ee, X as qe } from "./index-mfGK4pFo.js";
2
+ import { TextSelection as Je } from "@tiptap/pm/state";
3
+ import { k as Ze, D as oe, a as ne } from "./index-BnW6t8z6.js";
4
4
  import { jsxs as ee, jsx as k, Fragment as Ye } from "react/jsx-runtime";
5
- import { h as Qe, u as et, d as tt, A as ot } from "./index-RcSPeQHn.js";
5
+ import { h as Qe, u as et, d as tt, A as ot } from "./index-DHUN85fV.js";
6
6
  import { useState as _ } from "react";
7
7
  import "./theme.js";
8
- import { T as O, k as F, m as j } from "./index-C07N8gA1.js";
9
- import { P as nt, a as lt, b as rt } from "./popover-CtinPbiy.js";
8
+ import { T as O, k as F, m as j } from "./index-BlXGgvT-.js";
9
+ import { P as nt, a as lt, b as rt } from "./popover-BYSZ3zBi.js";
10
10
  let le, re;
11
11
  if (typeof WeakMap < "u") {
12
12
  let t = /* @__PURE__ */ new WeakMap();
@@ -194,7 +194,7 @@ function y(t) {
194
194
  return e;
195
195
  }
196
196
  const H = new de("selectingCells");
197
- function D(t) {
197
+ function $(t) {
198
198
  for (let e = t.depth - 1; e > 0; e--) if (t.node(e).type.spec.tableRole == "row") return t.node(0).resolve(t.before(e + 1));
199
199
  return null;
200
200
  }
@@ -214,7 +214,7 @@ function Y(t) {
214
214
  const e = t.selection;
215
215
  if ("$anchorCell" in e && e.$anchorCell) return e.$anchorCell.pos > e.$headCell.pos ? e.$anchorCell : e.$headCell;
216
216
  if ("node" in e && e.node && e.node.type.spec.tableRole == "cell") return e.$anchor;
217
- const o = D(e.$head) || ut(e.$head);
217
+ const o = $(e.$head) || ut(e.$head);
218
218
  if (o) return o;
219
219
  throw new RangeError(`No cell found around position ${e.head}`);
220
220
  }
@@ -241,7 +241,7 @@ function ze(t, e, o) {
241
241
  const n = t.node(-1), l = C.get(n), r = t.start(-1), s = l.nextCell(t.pos - r, e, o);
242
242
  return s == null ? null : t.node(0).resolve(r + s);
243
243
  }
244
- function W(t, e, o = 1) {
244
+ function D(t, e, o = 1) {
245
245
  const n = {
246
246
  ...t,
247
247
  colspan: t.colspan - o
@@ -282,7 +282,7 @@ var w = class N extends E {
282
282
  const r = this.$anchorCell.node(-1) != n.node(-1);
283
283
  return r && this.isRowSelection() ? N.rowSelection(n, l) : r && this.isColSelection() ? N.colSelection(n, l) : new N(n, l);
284
284
  }
285
- return $.between(n, l);
285
+ return W.between(n, l);
286
286
  }
287
287
  content() {
288
288
  const e = this.$anchorCell.node(-1), o = C.get(e), n = this.$anchorCell.start(-1), l = o.rectBetween(this.$anchorCell.pos - n, this.$headCell.pos - n), r = {}, s = [];
@@ -298,7 +298,7 @@ var w = class N extends E {
298
298
  const m = l.left - h.left, g = h.right - l.right;
299
299
  if (m > 0 || g > 0) {
300
300
  let b = p.attrs;
301
- if (m > 0 && (b = W(b, 0, m)), g > 0 && (b = W(b, b.colspan - g, g)), h.left < l.left) {
301
+ if (m > 0 && (b = D(b, 0, m)), g > 0 && (b = D(b, b.colspan - g, g)), h.left < l.left) {
302
302
  if (p = p.type.createAndFill(b), !p) throw new RangeError(`Could not create cell with attrs ${JSON.stringify(b)}`);
303
303
  } else p = p.type.create(b, p.content);
304
304
  }
@@ -430,11 +430,11 @@ function wt(t, e, o) {
430
430
  const i = C.get(n.node), c = n.from + 1, a = c + i.map[i.width * i.height - 1];
431
431
  r = w.create(l, c + 1, a);
432
432
  }
433
- } else n instanceof $ && gt(n) ? r = $.create(l, n.from) : n instanceof $ && bt(n) && (r = $.create(l, n.$from.start(), n.$from.end()));
433
+ } else n instanceof W && gt(n) ? r = W.create(l, n.from) : n instanceof W && bt(n) && (r = W.create(l, n.$from.start(), n.$from.end()));
434
434
  return r && (e || (e = t.tr)).setSelection(r), e;
435
435
  }
436
436
  const Ct = new de("fix-tables");
437
- function $e(t, e, o, n) {
437
+ function We(t, e, o, n) {
438
438
  const l = t.childCount, r = e.childCount;
439
439
  e: for (let s = 0, i = 0; s < r; s++) {
440
440
  const c = e.child(s);
@@ -442,15 +442,15 @@ function $e(t, e, o, n) {
442
442
  i = a + 1, o += c.nodeSize;
443
443
  continue e;
444
444
  }
445
- n(c, o), i < l && t.child(i).sameMarkup(c) ? $e(t.child(i), c, o + 1, n) : c.nodesBetween(0, c.content.size, n, o + 1), o += c.nodeSize;
445
+ n(c, o), i < l && t.child(i).sameMarkup(c) ? We(t.child(i), c, o + 1, n) : c.nodesBetween(0, c.content.size, n, o + 1), o += c.nodeSize;
446
446
  }
447
447
  }
448
- function We(t, e) {
448
+ function $e(t, e) {
449
449
  let o;
450
450
  const n = (l, r) => {
451
451
  l.type.spec.tableRole == "table" && (o = yt(t, l, r, o));
452
452
  };
453
- return e ? e.doc != t.doc && $e(e.doc, t.doc, 0, n) : t.doc.descendants(n), o;
453
+ return e ? e.doc != t.doc && We(e.doc, t.doc, 0, n) : t.doc.descendants(n), o;
454
454
  }
455
455
  function yt(t, e, o, n) {
456
456
  const l = C.get(e);
@@ -465,7 +465,7 @@ function yt(t, e, o, n) {
465
465
  if (!d) continue;
466
466
  const u = d.attrs;
467
467
  for (let f = 0; f < u.rowspan; f++) r[a.row + f] += a.n;
468
- n.setNodeMarkup(n.mapping.map(o + 1 + a.pos), null, W(u, u.colspan - a.n, a.n));
468
+ n.setNodeMarkup(n.mapping.map(o + 1 + a.pos), null, D(u, u.colspan - a.n, a.n));
469
469
  } else if (a.type == "missing") r[a.row] += a.n;
470
470
  else if (a.type == "overlong_rowspan") {
471
471
  const d = e.nodeAt(a.pos);
@@ -549,7 +549,7 @@ function At(t, { map: e, table: o, tableStart: n }, l) {
549
549
  const r = t.mapping.maps.length;
550
550
  for (let s = 0; s < e.height; ) {
551
551
  const i = s * e.width + l, c = e.map[i], a = o.nodeAt(c), d = a.attrs;
552
- if (l > 0 && e.map[i - 1] == c || l < e.width - 1 && e.map[i + 1] == c) t.setNodeMarkup(t.mapping.slice(r).map(n + c), null, W(d, l - e.colCount(c)));
552
+ if (l > 0 && e.map[i - 1] == c || l < e.width - 1 && e.map[i + 1] == c) t.setNodeMarkup(t.mapping.slice(r).map(n + c), null, D(d, l - e.colCount(c)));
553
553
  else {
554
554
  const u = t.mapping.slice(r).map(n + c);
555
555
  t.delete(u, u + a.nodeSize);
@@ -712,7 +712,7 @@ function zt(t) {
712
712
  } else {
713
713
  var s;
714
714
  if (l = dt(n.$from), !l) return !1;
715
- r = (s = D(n.$from)) === null || s === void 0 ? void 0 : s.pos;
715
+ r = (s = $(n.$from)) === null || s === void 0 ? void 0 : s.pos;
716
716
  }
717
717
  if (l == null || r == null || l.attrs.colspan == 1 && l.attrs.rowspan == 1) return !1;
718
718
  if (o) {
@@ -830,8 +830,8 @@ function I(t, e) {
830
830
  }
831
831
  I("row", { useDeprecatedLogic: !0 });
832
832
  I("column", { useDeprecatedLogic: !0 });
833
- const $t = I("cell", { useDeprecatedLogic: !0 });
834
- function Wt(t, e) {
833
+ const Wt = I("cell", { useDeprecatedLogic: !0 });
834
+ function $t(t, e) {
835
835
  if (e < 0) {
836
836
  const o = t.nodeBefore;
837
837
  if (o) return t.pos - o.nodeSize;
@@ -854,11 +854,11 @@ function Wt(t, e) {
854
854
  function ge(t) {
855
855
  return function(e, o) {
856
856
  if (!R(e)) return !1;
857
- const n = Wt(Y(e), t);
857
+ const n = $t(Y(e), t);
858
858
  if (n == null) return !1;
859
859
  if (o) {
860
860
  const l = e.doc.resolve(n);
861
- o(e.tr.setSelection($.between(l, ft(l))).scrollIntoView());
861
+ o(e.tr.setSelection(W.between(l, ft(l))).scrollIntoView());
862
862
  }
863
863
  return !0;
864
864
  };
@@ -929,7 +929,7 @@ function Pt({ width: t, height: e, rows: o }, n, l) {
929
929
  const c = o[i], a = [];
930
930
  for (let d = r[i] || 0, u = 0; d < n; u++) {
931
931
  let f = c.child(u % c.childCount);
932
- d + f.attrs.colspan > n && (f = f.type.createChecked(W(f.attrs, f.attrs.colspan, d + f.attrs.colspan - n), f.content)), a.push(f), d += f.attrs.colspan;
932
+ d + f.attrs.colspan > n && (f = f.type.createChecked(D(f.attrs, f.attrs.colspan, d + f.attrs.colspan - n), f.content)), a.push(f), d += f.attrs.colspan;
933
933
  for (let h = 1; h < f.attrs.rowspan; h++) r[i + h] = (r[i + h] || 0) + f.attrs.colspan;
934
934
  }
935
935
  s.push(v.from(a));
@@ -1008,7 +1008,7 @@ function we(t, e, o, n, l, r, s, i) {
1008
1008
  if (e.map[d - 1] == u) {
1009
1009
  c = !0;
1010
1010
  const f = o.nodeAt(u), h = e.colCount(u), p = t.mapping.slice(i).map(u + n);
1011
- t.setNodeMarkup(p, null, W(f.attrs, s - h, f.attrs.colspan - (s - h))), t.insert(p + f.nodeSize, f.type.createAndFill(W(f.attrs, 0, s - h))), a += f.attrs.rowspan - 1;
1011
+ t.setNodeMarkup(p, null, D(f.attrs, s - h, f.attrs.colspan - (s - h))), t.insert(p + f.nodeSize, f.type.createAndFill(D(f.attrs, 0, s - h))), a += f.attrs.rowspan - 1;
1012
1012
  }
1013
1013
  }
1014
1014
  return c;
@@ -1030,7 +1030,7 @@ function Ce(t, e, o, n, l) {
1030
1030
  }
1031
1031
  h(), u.setSelection(new w(u.doc.resolve(o + s.positionAt(i, c, r)), u.doc.resolve(o + s.positionAt(d - 1, a - 1, r)))), e(u);
1032
1032
  }
1033
- const Ot = Je({
1033
+ const Ot = Ze({
1034
1034
  ArrowLeft: K("horiz", -1),
1035
1035
  ArrowRight: K("horiz", 1),
1036
1036
  ArrowUp: K("vert", -1),
@@ -1044,22 +1044,22 @@ const Ot = Je({
1044
1044
  Delete: V,
1045
1045
  "Mod-Delete": V
1046
1046
  });
1047
- function G(t, e, o) {
1047
+ function U(t, e, o) {
1048
1048
  return o.eq(t.selection) ? !1 : (e && e(t.tr.setSelection(o).scrollIntoView()), !0);
1049
1049
  }
1050
1050
  function K(t, e) {
1051
1051
  return (o, n, l) => {
1052
1052
  if (!l) return !1;
1053
1053
  const r = o.selection;
1054
- if (r instanceof w) return G(o, n, E.near(r.$headCell, e));
1054
+ if (r instanceof w) return U(o, n, E.near(r.$headCell, e));
1055
1055
  if (t != "horiz" && !r.empty) return !1;
1056
1056
  const s = Ie(l, t, e);
1057
1057
  if (s == null) return !1;
1058
- if (t == "horiz") return G(o, n, E.near(o.doc.resolve(r.head + e), e));
1058
+ if (t == "horiz") return U(o, n, E.near(o.doc.resolve(r.head + e), e));
1059
1059
  {
1060
1060
  const i = o.doc.resolve(s), c = ze(i, t, e);
1061
1061
  let a;
1062
- return c ? a = E.near(c, 1) : e < 0 ? a = E.near(o.doc.resolve(i.before(-1)), -1) : a = E.near(o.doc.resolve(i.after(-1)), 1), G(o, n, a);
1062
+ return c ? a = E.near(c, 1) : e < 0 ? a = E.near(o.doc.resolve(i.before(-1)), -1) : a = E.near(o.doc.resolve(i.after(-1)), 1), U(o, n, a);
1063
1063
  }
1064
1064
  };
1065
1065
  }
@@ -1075,11 +1075,11 @@ function X(t, e) {
1075
1075
  s = new w(o.doc.resolve(c));
1076
1076
  }
1077
1077
  const i = ze(s.$headCell, t, e);
1078
- return i ? G(o, n, new w(s.$anchorCell, i)) : !1;
1078
+ return i ? U(o, n, new w(s.$anchorCell, i)) : !1;
1079
1079
  };
1080
1080
  }
1081
1081
  function Ft(t, e) {
1082
- const o = t.state.doc, n = D(o.resolve(e));
1082
+ const o = t.state.doc, n = $(o.resolve(e));
1083
1083
  return n ? (t.dispatch(t.state.tr.setSelection(new w(n))), !0) : !1;
1084
1084
  }
1085
1085
  function jt(t, e, o) {
@@ -1101,12 +1101,12 @@ function jt(t, e, o) {
1101
1101
  }
1102
1102
  function Vt(t, e) {
1103
1103
  var o;
1104
- if (e.ctrlKey || e.metaKey) return;
1104
+ if (e.button != 0 || e.ctrlKey || e.metaKey) return;
1105
1105
  const n = ye(t, e.target);
1106
1106
  let l;
1107
1107
  if (e.shiftKey && t.state.selection instanceof w)
1108
1108
  r(t.state.selection.$anchorCell, e), e.preventDefault();
1109
- else if (e.shiftKey && n && (l = D(t.state.selection.$anchor)) != null && ((o = te(t, e)) === null || o === void 0 ? void 0 : o.pos) != l.pos)
1109
+ else if (e.shiftKey && n && (l = $(t.state.selection.$anchor)) != null && ((o = te(t, e)) === null || o === void 0 ? void 0 : o.pos) != l.pos)
1110
1110
  r(l, e), e.preventDefault();
1111
1111
  else if (!n) return;
1112
1112
  function r(c, a) {
@@ -1134,7 +1134,7 @@ function Vt(t, e) {
1134
1134
  t.root.addEventListener("mouseup", s), t.root.addEventListener("dragstart", s), t.root.addEventListener("mousemove", i);
1135
1135
  }
1136
1136
  function Ie(t, e, o) {
1137
- if (!(t.state.selection instanceof $)) return null;
1137
+ if (!(t.state.selection instanceof W)) return null;
1138
1138
  const { $head: n } = t.state.selection;
1139
1139
  for (let l = n.depth - 1; l >= 0; l--) {
1140
1140
  const r = n.node(l);
@@ -1156,8 +1156,8 @@ function te(t, e) {
1156
1156
  top: e.clientY
1157
1157
  });
1158
1158
  if (!o) return null;
1159
- const n = o.inside >= 0 ? o.inside : o.pos;
1160
- return D(t.state.doc.resolve(n));
1159
+ let { inside: n, pos: l } = o;
1160
+ return n >= 0 && $(t.state.doc.resolve(n)) || $(t.state.doc.resolve(l));
1161
1161
  }
1162
1162
  var Kt = class {
1163
1163
  constructor(e, o) {
@@ -1202,7 +1202,7 @@ function Xt({ handleWidth: t = 5, cellMinWidth: e = 25, defaultCellMinWidth: o =
1202
1202
  init(s, i) {
1203
1203
  var c;
1204
1204
  const a = (c = r.spec) === null || c === void 0 || (c = c.props) === null || c === void 0 ? void 0 : c.nodeViews, d = y(i.schema).table.name;
1205
- return n && a && (a[d] = (u, f) => new n(u, o, f)), new Ut(-1, !1);
1205
+ return n && a && (a[d] = (u, f) => new n(u, o, f)), new Gt(-1, !1);
1206
1206
  },
1207
1207
  apply(s, i) {
1208
1208
  return i.apply(s);
@@ -1215,13 +1215,13 @@ function Xt({ handleWidth: t = 5, cellMinWidth: e = 25, defaultCellMinWidth: o =
1215
1215
  },
1216
1216
  handleDOMEvents: {
1217
1217
  mousemove: (s, i) => {
1218
- Gt(s, i, t, l);
1218
+ Ut(s, i, t, l);
1219
1219
  },
1220
1220
  mouseleave: (s) => {
1221
1221
  qt(s);
1222
1222
  },
1223
1223
  mousedown: (s, i) => {
1224
- Zt(s, i, e, o);
1224
+ Jt(s, i, e, o);
1225
1225
  }
1226
1226
  },
1227
1227
  decorations: (s) => {
@@ -1233,7 +1233,7 @@ function Xt({ handleWidth: t = 5, cellMinWidth: e = 25, defaultCellMinWidth: o =
1233
1233
  });
1234
1234
  return r;
1235
1235
  }
1236
- var Ut = class q {
1236
+ var Gt = class q {
1237
1237
  constructor(e, o) {
1238
1238
  this.activeHandle = e, this.dragging = o;
1239
1239
  }
@@ -1248,7 +1248,7 @@ var Ut = class q {
1248
1248
  return o;
1249
1249
  }
1250
1250
  };
1251
- function Gt(t, e, o, n) {
1251
+ function Ut(t, e, o, n) {
1252
1252
  if (!t.editable) return;
1253
1253
  const l = x.getState(t.state);
1254
1254
  if (l && !l.dragging) {
@@ -1272,12 +1272,12 @@ function qt(t) {
1272
1272
  const e = x.getState(t.state);
1273
1273
  e && e.activeHandle > -1 && !e.dragging && Pe(t, -1);
1274
1274
  }
1275
- function Zt(t, e, o, n) {
1275
+ function Jt(t, e, o, n) {
1276
1276
  var l;
1277
1277
  if (!t.editable) return !1;
1278
1278
  const r = (l = t.dom.ownerDocument.defaultView) !== null && l !== void 0 ? l : window, s = x.getState(t.state);
1279
1279
  if (!s || s.activeHandle == -1 || s.dragging) return !1;
1280
- const i = t.state.doc.nodeAt(s.activeHandle), c = Jt(t, s.activeHandle, i.attrs);
1280
+ const i = t.state.doc.nodeAt(s.activeHandle), c = Zt(t, s.activeHandle, i.attrs);
1281
1281
  t.dispatch(t.state.tr.setMeta(x, { setDragging: {
1282
1282
  startX: e.clientX,
1283
1283
  startWidth: c
@@ -1297,7 +1297,7 @@ function Zt(t, e, o, n) {
1297
1297
  }
1298
1298
  return Ae(t, s.activeHandle, c, n), r.addEventListener("mouseup", a), r.addEventListener("mousemove", d), e.preventDefault(), !0;
1299
1299
  }
1300
- function Jt(t, e, { colspan: o, colwidth: n }) {
1300
+ function Zt(t, e, { colspan: o, colwidth: n }) {
1301
1301
  const l = n && n[n.length - 1];
1302
1302
  if (l) return l;
1303
1303
  const r = t.domAtPos(e);
@@ -1316,7 +1316,7 @@ function Se(t, e, o, n) {
1316
1316
  top: e.clientY
1317
1317
  });
1318
1318
  if (!r) return -1;
1319
- const { pos: s } = r, i = D(t.state.doc.resolve(s));
1319
+ const { pos: s } = r, i = $(t.state.doc.resolve(s));
1320
1320
  if (!i) return -1;
1321
1321
  if (o == "right") return i.pos;
1322
1322
  const c = C.get(i.node(-1)), a = i.start(-1), d = c.map.indexOf(i.pos - a);
@@ -1393,11 +1393,11 @@ function oo({ allowTableNodeSelection: t = !1 } = {}) {
1393
1393
  handlePaste: jt
1394
1394
  },
1395
1395
  appendTransaction(e, o, n) {
1396
- return wt(n, We(n, o), t);
1396
+ return wt(n, $e(n, o), t);
1397
1397
  }
1398
1398
  });
1399
1399
  }
1400
- var _e = Z.create({
1400
+ var _e = J.create({
1401
1401
  name: "tableCell",
1402
1402
  addOptions() {
1403
1403
  return {
@@ -1436,9 +1436,9 @@ var _e = Z.create({
1436
1436
  return [{ tag: "td" }];
1437
1437
  },
1438
1438
  renderHTML({ HTMLAttributes: t }) {
1439
- return ["td", J(this.options.HTMLAttributes, t), 0];
1439
+ return ["td", Z(this.options.HTMLAttributes, t), 0];
1440
1440
  }
1441
- }), Oe = Z.create({
1441
+ }), Oe = J.create({
1442
1442
  name: "tableHeader",
1443
1443
  addOptions() {
1444
1444
  return {
@@ -1469,9 +1469,9 @@ var _e = Z.create({
1469
1469
  return [{ tag: "th" }];
1470
1470
  },
1471
1471
  renderHTML({ HTMLAttributes: t }) {
1472
- return ["th", J(this.options.HTMLAttributes, t), 0];
1472
+ return ["th", Z(this.options.HTMLAttributes, t), 0];
1473
1473
  }
1474
- }), Fe = Z.create({
1474
+ }), Fe = J.create({
1475
1475
  name: "tableRow",
1476
1476
  addOptions() {
1477
1477
  return {
@@ -1484,7 +1484,7 @@ var _e = Z.create({
1484
1484
  return [{ tag: "tr" }];
1485
1485
  },
1486
1486
  renderHTML({ HTMLAttributes: t }) {
1487
- return ["tr", J(this.options.HTMLAttributes, t), 0];
1487
+ return ["tr", Z(this.options.HTMLAttributes, t), 0];
1488
1488
  }
1489
1489
  });
1490
1490
  function ae(t, e) {
@@ -1576,7 +1576,7 @@ function so(t, e, o, n, l) {
1576
1576
  function io(t) {
1577
1577
  return t instanceof w;
1578
1578
  }
1579
- var U = ({ editor: t }) => {
1579
+ var G = ({ editor: t }) => {
1580
1580
  const { selection: e } = t.state;
1581
1581
  if (!io(e))
1582
1582
  return !1;
@@ -1628,7 +1628,7 @@ function uo(t, e, o = {}) {
1628
1628
  `;
1629
1629
  }), u;
1630
1630
  }
1631
- var fo = uo, je = Z.create({
1631
+ var fo = uo, je = J.create({
1632
1632
  name: "table",
1633
1633
  // @ts-ignore
1634
1634
  addOptions() {
@@ -1658,7 +1658,7 @@ var fo = uo, je = Z.create({
1658
1658
  }
1659
1659
  const i = [
1660
1660
  "table",
1661
- J(this.options.HTMLAttributes, e, {
1661
+ Z(this.options.HTMLAttributes, e, {
1662
1662
  style: s()
1663
1663
  }),
1664
1664
  o,
@@ -1688,7 +1688,7 @@ var fo = uo, je = Z.create({
1688
1688
  const s = so(r.schema, t, e, o);
1689
1689
  if (l) {
1690
1690
  const i = n.selection.from + 1;
1691
- n.replaceSelectionWith(s).scrollIntoView().setSelection(Ze.near(n.doc.resolve(i)));
1691
+ n.replaceSelectionWith(s).scrollIntoView().setSelection(Je.near(n.doc.resolve(i)));
1692
1692
  }
1693
1693
  return !0;
1694
1694
  },
@@ -1703,12 +1703,12 @@ var fo = uo, je = Z.create({
1703
1703
  splitCell: () => ({ state: t, dispatch: e }) => pe(t, e),
1704
1704
  toggleHeaderColumn: () => ({ state: t, dispatch: e }) => I("column")(t, e),
1705
1705
  toggleHeaderRow: () => ({ state: t, dispatch: e }) => I("row")(t, e),
1706
- toggleHeaderCell: () => ({ state: t, dispatch: e }) => $t(t, e),
1706
+ toggleHeaderCell: () => ({ state: t, dispatch: e }) => Wt(t, e),
1707
1707
  mergeOrSplit: () => ({ state: t, dispatch: e }) => he(t, e) ? !0 : pe(t, e),
1708
1708
  setCellAttribute: (t, e) => ({ state: o, dispatch: n }) => Ht(t, e)(o, n),
1709
1709
  goToNextCell: () => ({ state: t, dispatch: e }) => ge(1)(t, e),
1710
1710
  goToPreviousCell: () => ({ state: t, dispatch: e }) => ge(-1)(t, e),
1711
- fixTables: () => ({ state: t, dispatch: e }) => (e && We(t), !0),
1711
+ fixTables: () => ({ state: t, dispatch: e }) => (e && $e(t), !0),
1712
1712
  setCellSelection: (t) => ({ tr: e, dispatch: o }) => {
1713
1713
  if (o) {
1714
1714
  const n = w.create(e.doc, t.anchorCell, t.headCell);
@@ -1722,10 +1722,10 @@ var fo = uo, je = Z.create({
1722
1722
  return {
1723
1723
  Tab: () => this.editor.commands.goToNextCell() ? !0 : this.editor.can().addRowAfter() ? this.editor.chain().addRowAfter().goToNextCell().run() : !1,
1724
1724
  "Shift-Tab": () => this.editor.commands.goToPreviousCell(),
1725
- Backspace: U,
1726
- "Mod-Backspace": U,
1727
- Delete: U,
1728
- "Mod-Delete": U
1725
+ Backspace: G,
1726
+ "Mod-Backspace": G,
1727
+ Delete: G,
1728
+ "Mod-Delete": G
1729
1729
  };
1730
1730
  },
1731
1731
  addProseMirrorPlugins() {
@@ -1751,7 +1751,7 @@ var fo = uo, je = Z.create({
1751
1751
  storage: t.storage
1752
1752
  };
1753
1753
  return {
1754
- tableRole: Ue(Ge(t, "tableRole", e))
1754
+ tableRole: Ge(Ue(t, "tableRole", e))
1755
1755
  };
1756
1756
  }
1757
1757
  });
@@ -1854,59 +1854,29 @@ function Co(t) {
1854
1854
  cols: j
1855
1855
  });
1856
1856
  }
1857
- return /* @__PURE__ */ ee(
1858
- nt,
1859
- {
1860
- modal: !0,
1861
- onOpenChange: o,
1862
- open: e,
1863
- children: [
1864
- /* @__PURE__ */ k(
1865
- lt,
1866
- {
1867
- asChild: !0,
1868
- "data-state": t != null && t.dataState ? "on" : "off",
1869
- children: t == null ? void 0 : t.children
1870
- }
1871
- ),
1872
- /* @__PURE__ */ k(
1873
- rt,
1857
+ return /* @__PURE__ */ ee(nt, { modal: !0, onOpenChange: o, open: e, children: [
1858
+ /* @__PURE__ */ k(lt, { asChild: !0, "data-state": t != null && t.dataState ? "on" : "off", children: t == null ? void 0 : t.children }),
1859
+ /* @__PURE__ */ k(rt, { align: "start", className: "richtext-w-full !richtext-p-2", side: "bottom", children: /* @__PURE__ */ ee("div", { className: "table-grid-size-editor richtext-p-0", children: [
1860
+ /* @__PURE__ */ k("div", { className: "richtext-flex richtext-flex-col richtext-flex-wrap richtext-justify-between richtext-gap-1", children: (f = Ne(r == null ? void 0 : r.rows)) == null ? void 0 : f.map((h) => {
1861
+ var p;
1862
+ return /* @__PURE__ */ k("div", { className: "richtext-flex richtext-gap-1", children: (p = Ne(r == null ? void 0 : r.cols)) == null ? void 0 : p.map((m) => /* @__PURE__ */ k(
1863
+ "div",
1874
1864
  {
1875
- align: "start",
1876
- className: "richtext-w-full !richtext-p-2",
1877
- side: "bottom",
1878
- children: /* @__PURE__ */ ee("div", { className: "table-grid-size-editor richtext-p-0", children: [
1879
- /* @__PURE__ */ k("div", { className: "richtext-flex richtext-flex-col richtext-flex-wrap richtext-justify-between richtext-gap-1", children: (f = Ne(r == null ? void 0 : r.rows)) == null ? void 0 : f.map((h) => {
1880
- var p;
1881
- return /* @__PURE__ */ k(
1882
- "div",
1883
- {
1884
- className: "richtext-flex richtext-gap-1",
1885
- children: (p = Ne(r == null ? void 0 : r.cols)) == null ? void 0 : p.map((m) => /* @__PURE__ */ k(
1886
- "div",
1887
- {
1888
- onMouseDown: () => d(h, m),
1889
- onMouseOver: () => a(h, m),
1890
- className: `richtext-cursor-pointer richtext-border-border ${m <= i.cols && h <= i.rows && "tableCellActive !richtext-bg-foreground"}`,
1891
- children: /* @__PURE__ */ k("div", { className: "richtext-box-border richtext-size-4 richtext-rounded-[2px] !richtext-border richtext-border-solid !richtext-border-border richtext-p-1" })
1892
- },
1893
- `richtext-table-col-${m}`
1894
- ))
1895
- },
1896
- `richtext-table-row-${h}`
1897
- );
1898
- }) }),
1899
- /* @__PURE__ */ ee("div", { className: "richtext-mt-2 richtext-text-center richtext-text-sm richtext-text-foreground", children: [
1900
- i.rows,
1901
- "x",
1902
- i.cols
1903
- ] })
1904
- ] })
1905
- }
1906
- )
1907
- ]
1908
- }
1909
- );
1865
+ onMouseDown: () => d(h, m),
1866
+ onMouseOver: () => a(h, m),
1867
+ className: `richtext-cursor-pointer richtext-border-border ${m <= i.cols && h <= i.rows && "tableCellActive !richtext-bg-foreground"}`,
1868
+ children: /* @__PURE__ */ k("div", { className: "richtext-box-border richtext-size-4 richtext-rounded-[2px] !richtext-border richtext-border-solid !richtext-border-border richtext-p-1" })
1869
+ },
1870
+ `richtext-table-col-${m}`
1871
+ )) }, `richtext-table-row-${h}`);
1872
+ }) }),
1873
+ /* @__PURE__ */ ee("div", { className: "richtext-mt-2 richtext-text-center richtext-text-sm richtext-text-foreground", children: [
1874
+ i.rows,
1875
+ "x",
1876
+ i.cols
1877
+ ] })
1878
+ ] }) })
1879
+ ] });
1910
1880
  }
1911
1881
  function zo() {
1912
1882
  const t = Qe(), e = et(yo.name), {
@@ -1921,28 +1891,20 @@ function zo() {
1921
1891
  function a(d) {
1922
1892
  t.chain().focus().insertTable({ ...d, withHeaderRow: !1 }).run();
1923
1893
  }
1924
- return /* @__PURE__ */ k(
1925
- Co,
1894
+ return /* @__PURE__ */ k(Co, { createTable: a, dataState: i, children: /* @__PURE__ */ k(
1895
+ ot,
1926
1896
  {
1927
- createTable: a,
1897
+ action: l,
1898
+ color: s,
1928
1899
  dataState: i,
1929
- children: /* @__PURE__ */ k(
1930
- ot,
1931
- {
1932
- action: l,
1933
- color: s,
1934
- dataState: i,
1935
- icon: o,
1936
- isActive: r,
1937
- tooltip: n,
1938
- disabled: c
1939
- }
1940
- )
1900
+ icon: o,
1901
+ isActive: r,
1902
+ tooltip: n,
1903
+ disabled: c
1941
1904
  }
1942
- );
1905
+ ) });
1943
1906
  }
1944
1907
  const yo = /* @__PURE__ */ je.extend({
1945
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1946
1908
  //@ts-expect-error
1947
1909
  addOptions() {
1948
1910
  var t;