@clevertask/scribe 0.1.19 → 0.1.21

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 (46) hide show
  1. package/README.md +2 -2
  2. package/dist/{BarMenu-C9tCdvyV.js → BarMenu-tPZoiOba.js} +1 -1
  3. package/dist/assets/index.css +1 -1
  4. package/dist/components/Menu/BarMenu.js +1 -1
  5. package/dist/components/Menu/BubbleMenu.js +2 -2
  6. package/dist/components/Menu/CalloutBubbleMenu.js +2 -2
  7. package/dist/components/Menu/LinkBubbleMenu.js +6 -6
  8. package/dist/components/Menu/Mobile/ListOptionBar.js +1 -1
  9. package/dist/components/Menu/TableBubbleMenu.js +2 -2
  10. package/dist/components/Menu/linkBubbleMenuPlugin.js +1 -1
  11. package/dist/components/Scribe/extension/callout.js +1 -1
  12. package/dist/components/Scribe/extension/emoji/suggest.js +3 -3
  13. package/dist/components/Scribe/extension/extension-link.js +1 -1
  14. package/dist/components/Scribe/extension/extension-markdown-paste.js +2 -2
  15. package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
  16. package/dist/components/Scribe/extension/external-link-preview/commands.js +1 -1
  17. package/dist/components/Scribe/extension/external-link-preview/index.js +1 -1
  18. package/dist/components/Scribe/extension/external-link-preview/node-view.js +1 -1
  19. package/dist/components/Scribe/extension/external-link-preview/render-html.js +1 -1
  20. package/dist/components/Scribe/extension/external-link-preview/resolver.js +1 -1
  21. package/dist/components/Scribe/extension/external-link-preview/schema.js +1 -1
  22. package/dist/components/Scribe/extension/index.js +1 -1
  23. package/dist/components/Scribe/extension/resizable-table.js +1 -1
  24. package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +2 -2
  25. package/dist/components/Scribe/extension/slashCommand/index.js +2 -2
  26. package/dist/components/Scribe/extension/slashCommand/renderItems.js +2 -2
  27. package/dist/components/Scribe/extension/tableOfContents.js +3 -3
  28. package/dist/components/Scribe/index.js +4 -4
  29. package/dist/{dist-CzXFZHMF.js → dist-Cer8ra_P.js} +55 -39
  30. package/dist/{dist-CkWsQ5Lj.js → dist-ClNucvAM.js} +612 -819
  31. package/dist/{dist-DRPH9MfF.js → dist-D31OwZrM.js} +231 -168
  32. package/dist/{extension-CKcvyrIW.js → extension-B-7qHi2u.js} +2 -2
  33. package/dist/{extension-link-yMrg9JOz.js → extension-link-BQrkQZHi.js} +23 -23
  34. package/dist/{html-to-markdown-pY8ngCXa.js → html-to-markdown-D7PT8MhP.js} +1 -1
  35. package/dist/main.js +2 -2
  36. package/dist/{markdown-to-html-COv0iaxr.js → markdown-to-html-ChfR7P_Y.js} +39 -11
  37. package/dist/{menus-D1cst_3I.js → menus-DLKcWlVX.js} +56 -54
  38. package/dist/{resizable-table-D0mls3aB.js → resizable-table-DgMCiXeO.js} +28 -31
  39. package/dist/{schema-extensions-ChhE6XCo.js → schema-extensions-BMJIwh-u.js} +309 -314
  40. package/dist/schema-extensions.js +1 -1
  41. package/dist/schema.js +1 -1
  42. package/dist/{tippy.esm-DOXqN1Qm.js → tippy.esm-8vSV0zL7.js} +6 -6
  43. package/dist/utils/html-to-markdown.js +1 -1
  44. package/dist/utils/index.js +4 -4
  45. package/dist/utils/markdown-to-html.js +1 -1
  46. package/package.json +59 -56
@@ -1,4 +1,4 @@
1
- import { n as e, r as t, t as n } from "./schema-extensions-ChhE6XCo.js";
1
+ import { n as e, r as t, t as n } from "./schema-extensions-BMJIwh-u.js";
2
2
  import r from "./components/Scribe/extension/extension-markdown-paste.js";
3
3
  import { SlashCommand as i } from "./components/Scribe/extension/slashCommand/index.js";
4
4
  import a from "./components/Scribe/extension/extension-selectedText.js";
@@ -7,7 +7,7 @@ import { getSlashCommandContext as s, getSuggestionItems as c } from "./componen
7
7
  import l from "./components/Scribe/extension/emoji/suggest.js";
8
8
  import { ScribeTableOfContents as u } from "./components/Scribe/extension/tableOfContents.js";
9
9
  import { ExternalLinkPreview as d } from "./components/Scribe/extension/external-link-preview/index.js";
10
- //#region node_modules/.pnpm/@tiptap+extension-focus@3.30.2_@tiptap+extensions@3.30.2_@tiptap+core@3.30.2_@tiptap+pm@3.30.2__@tiptap+pm@3.30.2_/node_modules/@tiptap/extension-focus/dist/index.js
10
+ //#region node_modules/.pnpm/@tiptap+extension-focus@3.31.3_@tiptap+extensions@3.31.3_@tiptap+core@3.31.3_@tiptap+pm@3.31.3__@tiptap+pm@3.31.3_/node_modules/@tiptap/extension-focus/dist/index.js
11
11
  var f = e, p = t, m = (e) => {
12
12
  let { items: t, render: m, ...h } = e.slashCommand ?? {}, g = n({ enableUndoRedo: e.enableUndoRedo });
13
13
  return [
@@ -1,4 +1,4 @@
1
- import { F as e, I as t, L as n, d as r, g as i, h as a, i as o, p as s, r as c, s as l, y as u } from "./dist-CkWsQ5Lj.js";
1
+ import { F as e, I as t, P as n, d as r, g as i, h as a, i as o, p as s, r as c, s as l, y as u } from "./dist-ClNucvAM.js";
2
2
  import { Plugin as d, PluginKey as f } from "@tiptap/pm/state";
3
3
  //#region node_modules/.pnpm/linkifyjs@4.3.3/node_modules/linkifyjs/dist/linkify.mjs
4
4
  var p = "aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2", m = "ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2", h = "numeric", g = "ascii", _ = "alpha", v = "asciinumeric", y = "alphanumeric", b = "domain", x = "emoji", ee = "scheme", S = "slashscheme", C = "whitespace";
@@ -511,7 +511,7 @@ function yt(e, t = null, n = null) {
511
511
  return a;
512
512
  }
513
513
  //#endregion
514
- //#region node_modules/.pnpm/@tiptap+extension-link@3.30.2_@tiptap+core@3.30.2_@tiptap+pm@3.30.2__@tiptap+pm@3.30.2/node_modules/@tiptap/extension-link/dist/index.js
514
+ //#region node_modules/.pnpm/@tiptap+extension-link@3.31.3_@tiptap+core@3.31.3_@tiptap+pm@3.31.3__@tiptap+pm@3.31.3/node_modules/@tiptap/extension-link/dist/index.js
515
515
  var bt = "[\0- \xA0 ᠎ -\u2029  ]", xt = new RegExp(bt), St = RegExp(`${bt}$`), Ct = new RegExp(bt, "g");
516
516
  function wt(e) {
517
517
  return e.length === 1 ? e[0].isLink : e.length === 3 && e[1].isLink ? ["()", "[]"].includes(e[0].value + e[2].value) : !1;
@@ -622,32 +622,32 @@ function Pt(e) {
622
622
  title: e.data?.title ?? null
623
623
  };
624
624
  }
625
- function Ft(t) {
626
- let n = e({
627
- find: (e) => {
628
- let n = Dt.exec(e);
629
- return !n || !jt(e, n, t.isAllowedHref) ? null : Mt(n);
625
+ function Ft(e) {
626
+ let t = n({
627
+ find: (t) => {
628
+ let n = Dt.exec(t);
629
+ return !n || !jt(t, n, e.isAllowedHref) ? null : Mt(n);
630
630
  },
631
- type: t.type,
631
+ type: e.type,
632
632
  getAttributes: Pt
633
633
  });
634
634
  return new c({
635
- find: n.find,
635
+ find: t.find,
636
636
  handler: (e) => {
637
- let t = n.handler(e);
638
- return t !== null && e.state.tr.steps.length && e.state.tr.setMeta("preventAutolink", !0), t;
637
+ let n = t.handler(e);
638
+ return n !== null && e.state.tr.steps.length && e.state.tr.setMeta("preventAutolink", !0), n;
639
639
  }
640
640
  });
641
641
  }
642
- function It(e) {
643
- let n = t({
644
- find: (t) => {
642
+ function It(t) {
643
+ let n = e({
644
+ find: (e) => {
645
645
  let n = [];
646
- for (let r of t.matchAll(Ot)) jt(t, r, e.isAllowedHref) && n.push(Mt(r));
647
- let r = (e.findPlainUrls?.call(e, t) ?? []).filter((e) => !n.some((t) => Nt(t, e)));
646
+ for (let r of e.matchAll(Ot)) jt(e, r, t.isAllowedHref) && n.push(Mt(r));
647
+ let r = (t.findPlainUrls?.call(t, e) ?? []).filter((e) => !n.some((t) => Nt(t, e)));
648
648
  return [...n, ...r];
649
649
  },
650
- type: e.type,
650
+ type: t.type,
651
651
  getAttributes: Pt
652
652
  });
653
653
  return new l({
@@ -769,11 +769,11 @@ var Rt = o.create({
769
769
  defaultProtocol: this.options.defaultProtocol
770
770
  }) ? [
771
771
  "a",
772
- n(this.options.HTMLAttributes, e),
772
+ t(this.options.HTMLAttributes, e),
773
773
  0
774
774
  ] : [
775
775
  "a",
776
- n(this.options.HTMLAttributes, {
776
+ t(this.options.HTMLAttributes, {
777
777
  ...e,
778
778
  href: ""
779
779
  }),
@@ -821,7 +821,7 @@ var Rt = o.create({
821
821
  })] : [];
822
822
  },
823
823
  addPasteRules() {
824
- let e = (e) => {
824
+ let t = (e) => {
825
825
  let t = [];
826
826
  if (e) {
827
827
  let { protocols: n, defaultProtocol: r } = this.options;
@@ -846,9 +846,9 @@ var Rt = o.create({
846
846
  protocols: this.options.protocols,
847
847
  defaultProtocol: this.options.defaultProtocol
848
848
  }),
849
- findPlainUrls: e
850
- })] : [t({
851
- find: e,
849
+ findPlainUrls: t
850
+ })] : [e({
851
+ find: t,
852
852
  type: this.type,
853
853
  getAttributes: (e) => ({ href: e.data?.href })
854
854
  })];
@@ -289,7 +289,7 @@ function E(e) {
289
289
  var t = e.element, n = e.isBlock, r = e.isVoid, i = e.isPre || function(e) {
290
290
  return e.nodeName === "PRE";
291
291
  };
292
- if (!(!t.firstChild || i(t))) {
292
+ if (t.firstChild && !i(t)) {
293
293
  for (var a = null, o = !1, s = null, c = O(s, t, i); c !== t;) {
294
294
  if (c.nodeType === 3 || c.nodeType === 4) {
295
295
  var l = c.data.replace(/[ \r\n\t]+/g, " ");
package/dist/main.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { CALLOUT_VARIANTS as e, CALLOUT_VARIANT_LABELS as t, Callout as n, DEFAULT_CALLOUT_VARIANT as r, isCalloutVariant as i } from "./components/Scribe/extension/callout.js";
2
2
  import { EXTERNAL_LINK_PREVIEW_DISPLAYS as a } from "./components/Scribe/extension/external-link-preview/types.js";
3
3
  import { EXTERNAL_LINK_PREVIEW_NODE_NAME as o } from "./components/Scribe/extension/external-link-preview/attributes.js";
4
- import { t as s } from "./html-to-markdown-pY8ngCXa.js";
5
- import { t as c } from "./markdown-to-html-COv0iaxr.js";
4
+ import { t as s } from "./html-to-markdown-D7PT8MhP.js";
5
+ import { t as c } from "./markdown-to-html-ChfR7P_Y.js";
6
6
  import { isInViewport as l } from "./utils/is-in-viewport.js";
7
7
  import { convertLegacyMathDelimiters as u } from "./utils/convert-legacy-math-delimiters.js";
8
8
  import { SuggestionItemType as d } from "./components/Scribe/extension/slashCommand/items.js";
@@ -1,6 +1,6 @@
1
1
  import { normalizeExternalLinkPreviewsInTree as e } from "./components/Scribe/extension/external-link-preview/serialization.js";
2
2
  import { t } from "./purify.es-DGv0-Lid.js";
3
- //#region node_modules/.pnpm/marked@18.0.10/node_modules/marked/lib/marked.esm.js
3
+ //#region node_modules/.pnpm/marked@18.0.11/node_modules/marked/lib/marked.esm.js
4
4
  function n() {
5
5
  return {
6
6
  async: !1,
@@ -247,17 +247,26 @@ function Re(e, t = 0) {
247
247
  return r;
248
248
  }
249
249
  function G(e, t, n, r, i) {
250
- let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1");
250
+ let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1"), c = e[0].charAt(0) === "!";
251
251
  r.state.inLink = !0;
252
- let c = {
253
- type: e[0].charAt(0) === "!" ? "image" : "link",
252
+ let l = r.state.linkEmitted, u = r.state.inRawBlock;
253
+ r.state.linkEmitted = !1;
254
+ let d = r.inlineTokens(s), f = r.state.linkEmitted;
255
+ if (r.state.linkEmitted = l, r.state.inLink = !1, !c) {
256
+ if (f) {
257
+ r.state.inRawBlock = u;
258
+ return;
259
+ }
260
+ r.state.linkEmitted = !0;
261
+ }
262
+ return {
263
+ type: c ? "image" : "link",
254
264
  raw: n,
255
265
  href: a,
256
266
  title: o,
257
267
  text: s,
258
- tokens: r.inlineTokens(s)
268
+ tokens: d
259
269
  };
260
- return r.state.inLink = !1, c;
261
270
  }
262
271
  function ze(e, t, n) {
263
272
  let r = e.match(n.other.indentCodeCompensation);
@@ -337,8 +346,8 @@ var K = class {
337
346
  if (t) {
338
347
  let e = U(t[0], "\n").split("\n"), n = "", r = "", i = [];
339
348
  for (; e.length > 0;) {
340
- let t = !1, a = [], o;
341
- for (o = 0; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
349
+ let t = !1, a = [], o = 0;
350
+ for (; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
342
351
  else if (!t) a.push(e[o]);
343
352
  else break;
344
353
  e = e.slice(o);
@@ -740,6 +749,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
740
749
  this.tokens = [], this.tokens.links = Object.create(null), this.options = e || r, this.options.tokenizer = this.options.tokenizer || new K(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
741
750
  inLink: !1,
742
751
  inRawBlock: !1,
752
+ linkEmitted: !1,
743
753
  top: !0
744
754
  };
745
755
  let t = {
@@ -864,12 +874,30 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
864
874
  tokens: t
865
875
  }), t;
866
876
  }
877
+ linkInText(e) {
878
+ if (!e.includes("[")) return !1;
879
+ let t = this.tokenizer.rules.inline.link;
880
+ for (let n of e.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t.test(n[0]) && e.charAt(n.index - 1) !== "!") return !0;
881
+ for (let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
882
+ let e = t[0], n = e.lastIndexOf("[");
883
+ if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links, e.slice(n + 1, -1)) && !(n > 1 && this.linkInText(e.slice(1, n - 1)))) return !0;
884
+ }
885
+ return !1;
886
+ }
867
887
  inlineTokens(e, t = []) {
868
888
  this.tokenizer.lexer = this;
869
889
  let n = e;
870
- if (this.tokens.links) {
871
- let e = Object.keys(this.tokens.links);
872
- e.length > 0 && (n = n.replace(this.tokenizer.rules.inline.reflinkSearch, (t) => e.includes(t.slice(t.lastIndexOf("[") + 1, -1)) ? "[" + "a".repeat(t.length - 2) + "]" : t));
890
+ if (this.tokens.links && e.includes("[")) {
891
+ let e = this.tokenizer.rules.inline.reflinkSearch, t = (n) => {
892
+ let r = n.lastIndexOf("[");
893
+ if (!Object.hasOwn(this.tokens.links, n.slice(r + 1, -1))) return n;
894
+ if (r > 1 && n.charAt(0) !== "!") {
895
+ let i = n.slice(1, r - 1);
896
+ if (this.linkInText(i)) return "[" + i.replace(e, t) + "][" + "a".repeat(n.length - r - 2) + "]";
897
+ }
898
+ return "[" + "a".repeat(n.length - 2) + "]";
899
+ };
900
+ n = n.replace(e, t);
873
901
  }
874
902
  n = n.replace(this.tokenizer.rules.inline.anyPunctuation, (e) => "+".repeat(e.length)), n = n.replace(this.tokenizer.rules.inline.blockSkip, (e, t, n) => {
875
903
  let r = n ? n.length : 0;
@@ -1,17 +1,48 @@
1
- import { B as e, E as t, P as n, T as r, n as i } from "./dist-CkWsQ5Lj.js";
1
+ import { E as e, N as t, T as n, n as r, z as i } from "./dist-ClNucvAM.js";
2
2
  import { a, c as o, i as s, l as c, n as l, o as u, s as d, t as f, u as p } from "./floating-ui.dom-CmJ6iBdh.js";
3
- import { a as m } from "./dist-DRPH9MfF.js";
3
+ import { a as m } from "./dist-D31OwZrM.js";
4
4
  import { NodeSelection as h, Plugin as g, PluginKey as _ } from "@tiptap/pm/state";
5
5
  import { CellSelection as v } from "@tiptap/pm/tables";
6
6
  import y, { useEffect as b, useLayoutEffect as x, useRef as S, useState as C } from "react";
7
7
  import { createPortal as w } from "react-dom";
8
- //#region node_modules/.pnpm/@tiptap+extension-bubble-menu@3.30.2_@tiptap+core@3.30.2_@tiptap+pm@3.30.2__@tiptap+pm@3.30.2/node_modules/@tiptap/extension-bubble-menu/dist/index.js
8
+ //#region node_modules/.pnpm/@tiptap+extension-bubble-menu@3.31.3_@tiptap+core@3.31.3_@tiptap+pm@3.31.3__@tiptap+pm@3.31.3/node_modules/@tiptap/extension-bubble-menu/dist/index.js
9
9
  function T(e, t) {
10
10
  let n = Math.min(e.top, t.top), r = Math.max(e.bottom, t.bottom), i = Math.min(e.left, t.left), a = Math.max(e.right, t.right) - i, o = r - n;
11
11
  return new DOMRect(i, n, a, o);
12
12
  }
13
13
  var E = class {
14
- constructor({ editor: e, element: t, view: r, pluginKey: i = "bubbleMenu", updateDelay: a = 250, resizeDelay: o = 60, shouldShow: s, appendTo: c, getReferencedVirtualElement: l, options: u }) {
14
+ get middlewares() {
15
+ let e = [];
16
+ return this.floatingUIOptions.flip && e.push(a(typeof this.floatingUIOptions.flip == "boolean" ? void 0 : this.floatingUIOptions.flip)), this.floatingUIOptions.shift && e.push(c(typeof this.floatingUIOptions.shift == "boolean" ? void 0 : this.floatingUIOptions.shift)), this.floatingUIOptions.offset && e.push(o(typeof this.floatingUIOptions.offset == "boolean" ? void 0 : this.floatingUIOptions.offset)), this.floatingUIOptions.arrow && e.push(f(this.floatingUIOptions.arrow)), this.floatingUIOptions.size && e.push(p(typeof this.floatingUIOptions.size == "boolean" ? void 0 : this.floatingUIOptions.size)), this.floatingUIOptions.autoPlacement && e.push(l(typeof this.floatingUIOptions.autoPlacement == "boolean" ? void 0 : this.floatingUIOptions.autoPlacement)), this.floatingUIOptions.hide && e.push(u(typeof this.floatingUIOptions.hide == "boolean" ? void 0 : this.floatingUIOptions.hide)), this.floatingUIOptions.inline && e.push(d(typeof this.floatingUIOptions.inline == "boolean" ? void 0 : this.floatingUIOptions.inline)), e;
17
+ }
18
+ get virtualElement() {
19
+ var e;
20
+ let { selection: t } = this.editor.state, n = this.getReferencedVirtualElement?.call(this);
21
+ if (n) return n;
22
+ if (!((e = this.view) != null && (e = e.dom) != null && e.parentNode)) return;
23
+ let r = i(this.view, t.from, t.to), a = {
24
+ getBoundingClientRect: () => r,
25
+ getClientRects: () => [r]
26
+ };
27
+ if (t instanceof h) {
28
+ let e = this.view.nodeDOM(t.from), n = e.dataset.nodeViewWrapper ? e : e.querySelector("[data-node-view-wrapper]");
29
+ n && (e = n), e && (a = {
30
+ getBoundingClientRect: () => e.getBoundingClientRect(),
31
+ getClientRects: () => [e.getBoundingClientRect()]
32
+ });
33
+ }
34
+ if (t instanceof v) {
35
+ let { $anchorCell: e, $headCell: n } = t, r = e ? e.pos : n.pos, i = n ? n.pos : e.pos, o = this.view.nodeDOM(r), s = this.view.nodeDOM(i);
36
+ if (!o || !s) return;
37
+ let c = o === s ? o.getBoundingClientRect() : T(o.getBoundingClientRect(), s.getBoundingClientRect());
38
+ a = {
39
+ getBoundingClientRect: () => c,
40
+ getClientRects: () => [c]
41
+ };
42
+ }
43
+ return a;
44
+ }
45
+ constructor({ editor: e, element: n, view: r, pluginKey: i = "bubbleMenu", updateDelay: a = 250, resizeDelay: o = 60, shouldShow: s, appendTo: c, getReferencedVirtualElement: l, options: u }) {
15
46
  this.preventHide = !1, this.isVisible = !1, this.scrollTarget = window, this.floatingUIOptions = {
16
47
  strategy: "absolute",
17
48
  placement: "top",
@@ -27,8 +58,8 @@ var E = class {
27
58
  onHide: void 0,
28
59
  onUpdate: void 0,
29
60
  onDestroy: void 0
30
- }, this.shouldShow = ({ view: e, state: t, from: r, to: i }) => {
31
- let { doc: a, selection: o } = t, { empty: s } = o, c = !a.textBetween(r, i).length && n(t.selection), l = this.element.contains(document.activeElement);
61
+ }, this.shouldShow = ({ view: e, state: n, from: r, to: i }) => {
62
+ let { doc: a, selection: o } = n, { empty: s } = o, c = !a.textBetween(r, i).length && t(n.selection), l = this.element.contains(document.activeElement);
32
63
  return !(!(e.hasFocus() || l) || s || c || !this.editor.isEditable);
33
64
  }, this.mousedownHandler = () => {
34
65
  this.preventHide = !0;
@@ -52,7 +83,7 @@ var E = class {
52
83
  e?.relatedTarget && this.element.parentNode?.contains(e.relatedTarget) || e?.relatedTarget !== this.editor.view.dom && this.hide();
53
84
  }, this.handleDebouncedUpdate = (e, t) => {
54
85
  let n = !t?.selection.eq(e.state.selection), r = !t?.doc.eq(e.state.doc);
55
- !n && !r || (this.updateDebounceTimer && clearTimeout(this.updateDebounceTimer), this.updateDebounceTimer = window.setTimeout(() => {
86
+ (n || r) && (this.updateDebounceTimer && clearTimeout(this.updateDebounceTimer), this.updateDebounceTimer = window.setTimeout(() => {
56
87
  this.updateHandler(e, n, r, t);
57
88
  }, this.updateDelay));
58
89
  }, this.updateHandler = (e, t, n, r) => {
@@ -67,41 +98,11 @@ var E = class {
67
98
  }, this.transactionHandler = ({ transaction: e }) => {
68
99
  let t = e.getMeta(this.pluginKey);
69
100
  t === "updatePosition" ? this.updatePosition() : t && typeof t == "object" && t.type === "updateOptions" ? this.updateOptions(t.options) : t === "hide" ? this.hide() : t === "show" && (this.updatePosition(), this.show());
70
- }, this.editor = e, this.element = t, this.view = r, this.pluginKey = i, this.updateDelay = a, this.resizeDelay = o, this.appendTo = c, this.scrollTarget = u?.scrollTarget ?? window, this.getReferencedVirtualElement = l, this.floatingUIOptions = {
101
+ }, this.editor = e, this.element = n, this.view = r, this.pluginKey = i, this.updateDelay = a, this.resizeDelay = o, this.appendTo = c, this.scrollTarget = u?.scrollTarget ?? window, this.getReferencedVirtualElement = l, this.floatingUIOptions = {
71
102
  ...this.floatingUIOptions,
72
103
  ...u
73
104
  }, this.element.tabIndex = 0, s && (this.shouldShow = s), this.element.addEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.view.dom.addEventListener("dragstart", this.dragstartHandler), this.editor.on("focus", this.focusHandler), this.editor.on("blur", this.blurHandler), this.editor.on("transaction", this.transactionHandler), window.addEventListener("resize", this.resizeHandler), this.scrollTarget.addEventListener("scroll", this.resizeHandler), this.update(r, r.state), this.getShouldShow() && (this.show(), this.updatePosition());
74
105
  }
75
- get middlewares() {
76
- let e = [];
77
- return this.floatingUIOptions.flip && e.push(a(typeof this.floatingUIOptions.flip == "boolean" ? void 0 : this.floatingUIOptions.flip)), this.floatingUIOptions.shift && e.push(c(typeof this.floatingUIOptions.shift == "boolean" ? void 0 : this.floatingUIOptions.shift)), this.floatingUIOptions.offset && e.push(o(typeof this.floatingUIOptions.offset == "boolean" ? void 0 : this.floatingUIOptions.offset)), this.floatingUIOptions.arrow && e.push(f(this.floatingUIOptions.arrow)), this.floatingUIOptions.size && e.push(p(typeof this.floatingUIOptions.size == "boolean" ? void 0 : this.floatingUIOptions.size)), this.floatingUIOptions.autoPlacement && e.push(l(typeof this.floatingUIOptions.autoPlacement == "boolean" ? void 0 : this.floatingUIOptions.autoPlacement)), this.floatingUIOptions.hide && e.push(u(typeof this.floatingUIOptions.hide == "boolean" ? void 0 : this.floatingUIOptions.hide)), this.floatingUIOptions.inline && e.push(d(typeof this.floatingUIOptions.inline == "boolean" ? void 0 : this.floatingUIOptions.inline)), e;
78
- }
79
- get virtualElement() {
80
- let { selection: t } = this.editor.state, n = this.getReferencedVirtualElement?.call(this);
81
- if (n) return n;
82
- if (!this.view?.dom?.parentNode) return;
83
- let r = e(this.view, t.from, t.to), i = {
84
- getBoundingClientRect: () => r,
85
- getClientRects: () => [r]
86
- };
87
- if (t instanceof h) {
88
- let e = this.view.nodeDOM(t.from), n = e.dataset.nodeViewWrapper ? e : e.querySelector("[data-node-view-wrapper]");
89
- n && (e = n), e && (i = {
90
- getBoundingClientRect: () => e.getBoundingClientRect(),
91
- getClientRects: () => [e.getBoundingClientRect()]
92
- });
93
- }
94
- if (t instanceof v) {
95
- let { $anchorCell: e, $headCell: n } = t, r = e ? e.pos : n.pos, a = n ? n.pos : e.pos, o = this.view.nodeDOM(r), s = this.view.nodeDOM(a);
96
- if (!o || !s) return;
97
- let c = o === s ? o.getBoundingClientRect() : T(o.getBoundingClientRect(), s.getBoundingClientRect());
98
- i = {
99
- getBoundingClientRect: () => c,
100
- getClientRects: () => [c]
101
- };
102
- }
103
- return i;
104
- }
105
106
  updatePosition() {
106
107
  if (!this.isVisible) return;
107
108
  let e = this.virtualElement;
@@ -110,7 +111,7 @@ var E = class {
110
111
  strategy: this.floatingUIOptions.strategy,
111
112
  middleware: this.middlewares
112
113
  }).then(({ x: e, y: t, strategy: n, middlewareData: r }) => {
113
- if (!(!this.isVisible || this.editor.isDestroyed || !this.element.isConnected)) {
114
+ if (this.isVisible && !this.editor.isDestroyed && this.element.isConnected) {
114
115
  if (r.hide?.referenceHidden || r.hide?.escaped) {
115
116
  this.element.style.visibility = "hidden";
116
117
  return;
@@ -166,7 +167,7 @@ var E = class {
166
167
  ...e
167
168
  })
168
169
  });
169
- i.create({
170
+ r.create({
170
171
  name: "bubbleMenu",
171
172
  addOptions() {
172
173
  return {
@@ -191,8 +192,15 @@ i.create({
191
192
  }
192
193
  });
193
194
  //#endregion
194
- //#region node_modules/.pnpm/@tiptap+extension-floating-menu@3.30.2_@floating-ui+dom@1.8.0_@tiptap+core@3.30.2_@tiptap+pm@3.30.2__@tiptap+pm@3.30.2/node_modules/@tiptap/extension-floating-menu/dist/index.js
195
+ //#region node_modules/.pnpm/@tiptap+extension-floating-menu@3.31.3_@floating-ui+dom@1.8.0_@tiptap+core@3.31.3_@tiptap+pm@3.31.3__@tiptap+pm@3.31.3/node_modules/@tiptap/extension-floating-menu/dist/index.js
195
196
  var O = class {
197
+ getTextContent(t) {
198
+ return n(t, { textSerializers: e(this.editor.schema) });
199
+ }
200
+ get middlewares() {
201
+ let e = [];
202
+ return this.floatingUIOptions.flip && e.push(a(typeof this.floatingUIOptions.flip == "boolean" ? void 0 : this.floatingUIOptions.flip)), this.floatingUIOptions.shift && e.push(c(typeof this.floatingUIOptions.shift == "boolean" ? void 0 : this.floatingUIOptions.shift)), this.floatingUIOptions.offset && e.push(o(typeof this.floatingUIOptions.offset == "boolean" ? void 0 : this.floatingUIOptions.offset)), this.floatingUIOptions.arrow && e.push(f(this.floatingUIOptions.arrow)), this.floatingUIOptions.size && e.push(p(typeof this.floatingUIOptions.size == "boolean" ? void 0 : this.floatingUIOptions.size)), this.floatingUIOptions.autoPlacement && e.push(l(typeof this.floatingUIOptions.autoPlacement == "boolean" ? void 0 : this.floatingUIOptions.autoPlacement)), this.floatingUIOptions.hide && e.push(u(typeof this.floatingUIOptions.hide == "boolean" ? void 0 : this.floatingUIOptions.hide)), this.floatingUIOptions.inline && e.push(d(typeof this.floatingUIOptions.inline == "boolean" ? void 0 : this.floatingUIOptions.inline)), e;
203
+ }
196
204
  constructor({ editor: e, element: t, view: n, pluginKey: r = "floatingMenu", updateDelay: i = 250, resizeDelay: a = 60, options: o, appendTo: s, shouldShow: c }) {
197
205
  this.preventHide = !1, this.isVisible = !1, this.scrollTarget = window, this.shouldShow = ({ view: e, state: t }) => {
198
206
  let { selection: n } = t, { $anchor: r, empty: i } = n, a = r.depth === 1, o = r.parent.isTextblock && !r.parent.type.spec.code && !r.parent.textContent && r.parent.childCount === 0 && !this.getTextContent(r.parent);
@@ -239,13 +247,6 @@ var O = class {
239
247
  ...o
240
248
  }, this.element.tabIndex = 0, c && (this.shouldShow = c), this.element.addEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.editor.on("focus", this.focusHandler), this.editor.on("blur", this.blurHandler), this.editor.on("transaction", this.transactionHandler), window.addEventListener("resize", this.resizeHandler), this.scrollTarget.addEventListener("scroll", this.resizeHandler), this.update(n, n.state), this.getShouldShow() && (this.show(), this.updatePosition());
241
249
  }
242
- getTextContent(e) {
243
- return r(e, { textSerializers: t(this.editor.schema) });
244
- }
245
- get middlewares() {
246
- let e = [];
247
- return this.floatingUIOptions.flip && e.push(a(typeof this.floatingUIOptions.flip == "boolean" ? void 0 : this.floatingUIOptions.flip)), this.floatingUIOptions.shift && e.push(c(typeof this.floatingUIOptions.shift == "boolean" ? void 0 : this.floatingUIOptions.shift)), this.floatingUIOptions.offset && e.push(o(typeof this.floatingUIOptions.offset == "boolean" ? void 0 : this.floatingUIOptions.offset)), this.floatingUIOptions.arrow && e.push(f(this.floatingUIOptions.arrow)), this.floatingUIOptions.size && e.push(p(typeof this.floatingUIOptions.size == "boolean" ? void 0 : this.floatingUIOptions.size)), this.floatingUIOptions.autoPlacement && e.push(l(typeof this.floatingUIOptions.autoPlacement == "boolean" ? void 0 : this.floatingUIOptions.autoPlacement)), this.floatingUIOptions.hide && e.push(u(typeof this.floatingUIOptions.hide == "boolean" ? void 0 : this.floatingUIOptions.hide)), this.floatingUIOptions.inline && e.push(d(typeof this.floatingUIOptions.inline == "boolean" ? void 0 : this.floatingUIOptions.inline)), e;
248
- }
249
250
  getShouldShow(e) {
250
251
  let { state: t } = this.view, { selection: n } = t, { ranges: r } = n, i = Math.min(...r.map((e) => e.$from.pos)), a = Math.max(...r.map((e) => e.$to.pos));
251
252
  return this.shouldShow?.call(this, {
@@ -267,8 +268,9 @@ var O = class {
267
268
  }
268
269
  }
269
270
  updatePosition() {
270
- if (!this.view?.dom?.parentNode) return;
271
- let { selection: t } = this.editor.state, n = e(this.view, t.from, t.to);
271
+ var e;
272
+ if (!((e = this.view) != null && (e = e.dom) != null && e.parentNode)) return;
273
+ let { selection: t } = this.editor.state, n = i(this.view, t.from, t.to);
272
274
  s({
273
275
  getBoundingClientRect: () => n,
274
276
  getClientRects: () => [n]
@@ -305,7 +307,7 @@ var O = class {
305
307
  ...e
306
308
  })
307
309
  });
308
- i.create({
310
+ r.create({
309
311
  name: "floatingMenu",
310
312
  addOptions() {
311
313
  return {
@@ -335,7 +337,7 @@ i.create({
335
337
  }
336
338
  });
337
339
  //#endregion
338
- //#region node_modules/.pnpm/@tiptap+react@3.30.2_@floating-ui+dom@1.8.0_@tiptap+core@3.30.2_@tiptap+pm@3.30.2__@tip_864597464ea99af6963241e56e6f20f3/node_modules/@tiptap/react/dist/menus/index.js
340
+ //#region node_modules/.pnpm/@tiptap+react@3.31.3_@floating-ui+dom@1.8.0_@tiptap+core@3.31.3_@tiptap+pm@3.31.3__@tip_5c371688038a5c02261e2fdcd2fd7eb6/node_modules/@tiptap/react/dist/menus/index.js
339
341
  function A(e, t) {
340
342
  return e ?? new _(t);
341
343
  }
@@ -552,7 +554,7 @@ var te = y.forwardRef(({ pluginKey: e, editor: t, updateDelay: n, resizeDelay: r
552
554
  });
553
555
  };
554
556
  }, [h]), b(() => {
555
- if (!(!v || !h || h.isDestroyed)) {
557
+ if (v && h && !h.isDestroyed) {
556
558
  if (x.current) {
557
559
  x.current = !1;
558
560
  return;
@@ -608,7 +610,7 @@ y.forwardRef(({ pluginKey: e, editor: t, updateDelay: n, resizeDelay: r, appendT
608
610
  });
609
611
  };
610
612
  }, [p]), b(() => {
611
- if (!(!_ || !p || p.isDestroyed)) {
613
+ if (_ && p && !p.isDestroyed) {
612
614
  if (y.current) {
613
615
  y.current = !1;
614
616
  return;
@@ -1,7 +1,7 @@
1
- import { L as e, _ as t, a as n, l as r, m as i, n as a } from "./dist-CkWsQ5Lj.js";
1
+ import { I as e, _ as t, a as n, l as r, m as i, n as a } from "./dist-ClNucvAM.js";
2
2
  import { TextSelection as o } from "@tiptap/pm/state";
3
3
  import { CellSelection as s, addColumnAfter as c, addColumnBefore as l, addRowAfter as u, addRowBefore as d, columnResizing as f, columnResizingPluginKey as p, deleteColumn as m, deleteRow as h, deleteTable as g, fixTables as _, goToNextCell as v, mergeCells as y, setCellAttr as b, splitCell as x, tableEditing as S, toggleHeader as C, toggleHeaderCell as w } from "@tiptap/pm/tables";
4
- //#region node_modules/.pnpm/@tiptap+extension-table@3.30.2_@tiptap+core@3.30.2_@tiptap+pm@3.30.2__@tiptap+pm@3.30.2/node_modules/@tiptap/extension-table/dist/index.js
4
+ //#region node_modules/.pnpm/@tiptap+extension-table@3.31.3_@tiptap+core@3.31.3_@tiptap+pm@3.31.3__@tiptap+pm@3.31.3/node_modules/@tiptap/extension-table/dist/index.js
5
5
  function T(e) {
6
6
  return e === "left" || e === "right" || e === "center" ? e : null;
7
7
  }
@@ -126,30 +126,30 @@ function L(e, t) {
126
126
  return t ? ["width", `${Math.max(t, e)}px`] : ["min-width", `${e}px`];
127
127
  }
128
128
  function R(e, t, n, r, i, a) {
129
- var o;
130
- let s = 0, c = !0, l = t.firstChild, u = e.firstChild;
131
- if (u !== null) for (let e = 0, n = 0; e < u.childCount; e += 1) {
132
- let { colspan: o, colwidth: d } = u.child(e).attrs;
133
- for (let e = 0; e < o; e += 1, n += 1) {
134
- let o = i === n ? a : d && d[e], u = o ? `${o}px` : "";
135
- if (s += o || r, o || (c = !1), l) {
136
- if (l.style.width !== u) {
137
- let [e, t] = L(r, o);
138
- l.style.setProperty(e, t);
129
+ let o = 0, s = !0, c = t.firstChild, l = e.firstChild;
130
+ if (l !== null) for (let e = 0, n = 0; e < l.childCount; e += 1) {
131
+ let { colspan: u, colwidth: d } = l.child(e).attrs;
132
+ for (let e = 0; e < u; e += 1, n += 1) {
133
+ let l = i === n ? a : d && d[e], u = l ? `${l}px` : "";
134
+ if (o += l || r, l || (s = !1), c) {
135
+ if (c.style.width !== u) {
136
+ let [e, t] = L(r, l);
137
+ c.style.setProperty(e, t);
139
138
  }
140
- l = l.nextSibling;
139
+ c = c.nextSibling;
141
140
  } else {
142
- let e = document.createElement("col"), [n, i] = L(r, o);
141
+ let e = document.createElement("col"), [n, i] = L(r, l);
143
142
  e.style.setProperty(n, i), t.appendChild(e);
144
143
  }
145
144
  }
146
145
  }
147
- for (; l;) {
148
- let e = l.nextSibling;
149
- (o = l.parentNode) == null || o.removeChild(l), l = e;
146
+ for (; c;) {
147
+ var u;
148
+ let e = c.nextSibling;
149
+ (u = c.parentNode) == null || u.removeChild(c), c = e;
150
150
  }
151
151
  let d = e.attrs.style && typeof e.attrs.style == "string" && /\bwidth\s*:/i.test(e.attrs.style);
152
- c && !d ? (n.style.width = `${s}px`, n.style.minWidth = "") : (n.style.width = "", n.style.minWidth = `${s}px`);
152
+ s && !d ? (n.style.width = `${o}px`, n.style.minWidth = "") : (n.style.width = "", n.style.minWidth = `${o}px`);
153
153
  }
154
154
  var z = class {
155
155
  constructor(e, t, n, r = {}) {
@@ -162,7 +162,7 @@ var z = class {
162
162
  }
163
163
  ignoreMutation(e) {
164
164
  let t = e.target, n = this.dom.contains(t), r = this.contentDOM.contains(t);
165
- return !!(n && !r && (e.type === "attributes" || e.type === "childList" || e.type === "characterData"));
165
+ return !(!n || r || e.type !== "attributes" && e.type !== "childList" && e.type !== "characterData");
166
166
  }
167
167
  };
168
168
  function B(e, t, n, r) {
@@ -301,17 +301,14 @@ function X(e, t, n = {}) {
301
301
  for (let t = 0; t < a; t += 1) !u[t] && e[t]?.align && (u[t] = e[t].align);
302
302
  });
303
303
  let d = "\n", f = Array.from({ length: a }).map((e, t) => l && c[t] && c[t].text || "");
304
- return d += `| ${f.map((e, t) => s(e, o[t])).join(" | ")} |
305
- `, d += `| ${o.map((e, t) => {
304
+ return d += `| ${f.map((e, t) => s(e, o[t])).join(" | ")} |\n`, d += `| ${o.map((e, t) => {
306
305
  let n = Math.max(3, e), r = u[t];
307
306
  return r === "left" ? `:${"-".repeat(n)}` : r === "right" ? `${"-".repeat(n)}:` : r === "center" ? `:${"-".repeat(n)}:` : "-".repeat(n);
308
- }).join(" | ")} |
309
- `, (l ? i.slice(1) : i).forEach((e) => {
310
- d += `| ${Array.from({ length: a }).fill(0).map((t, n) => s(e[n] && e[n].text || "", o[n])).join(" | ")} |
311
- `;
307
+ }).join(" | ")} |\n`, (l ? i.slice(1) : i).forEach((e) => {
308
+ d += `| ${Array.from({ length: a }).fill(0).map((t, n) => s(e[n] && e[n].text || "", o[n])).join(" | ")} |\n`;
312
309
  }), d;
313
310
  }
314
- var Z = X, Q = n.create({
311
+ var Z = n.create({
315
312
  name: "table",
316
313
  addOptions() {
317
314
  return {
@@ -372,7 +369,7 @@ var Z = X, Q = n.create({
372
369
  }), n.push(t.createNode("tableRow", {}, i));
373
370
  }), t.createNode("table", void 0, n);
374
371
  },
375
- renderMarkdown: (e, t) => Z(e, t),
372
+ renderMarkdown: (e, t) => X(e, t),
376
373
  markdownTokenizer: {
377
374
  name: "table",
378
375
  level: "block",
@@ -478,13 +475,13 @@ var Z = X, Q = n.create({
478
475
  };
479
476
  return { tableRole: r(t(e, "tableRole", n)) };
480
477
  }
481
- }), $ = a.create({
478
+ }), Q = a.create({
482
479
  name: "tableKit",
483
480
  addExtensions() {
484
481
  let e = [];
485
- return this.options.table !== !1 && e.push(Q.configure(this.options.table)), this.options.tableCell !== !1 && e.push(P.configure(this.options.tableCell)), this.options.tableHeader !== !1 && e.push(F.configure(this.options.tableHeader)), this.options.tableRow !== !1 && e.push(I.configure(this.options.tableRow)), e;
482
+ return this.options.table !== !1 && e.push(Z.configure(this.options.table)), this.options.tableCell !== !1 && e.push(P.configure(this.options.tableCell)), this.options.tableHeader !== !1 && e.push(F.configure(this.options.tableHeader)), this.options.tableRow !== !1 && e.push(I.configure(this.options.tableRow)), e;
486
483
  }
487
- }), ee = Q.extend({
484
+ }), $ = Z.extend({
488
485
  onUpdate() {
489
486
  if (this.editor.isEditable) return;
490
487
  let e = p.getState(this.editor.state);
@@ -504,4 +501,4 @@ var Z = X, Q = n.create({
504
501
  }
505
502
  }).configure({ resizable: !0 });
506
503
  //#endregion
507
- export { $ as n, ee as t };
504
+ export { Q as n, $ as t };