@clevertask/scribe 0.1.29 → 0.1.31

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 (94) hide show
  1. package/README.md +39 -53
  2. package/dist/BarMenu-Bm5IfWVV.js +302 -0
  3. package/dist/components/Menu/BarMenu.d.ts.map +1 -1
  4. package/dist/components/Menu/BarMenu.js +1 -2
  5. package/dist/components/Menu/BubbleMenu.js +2 -2
  6. package/dist/components/Menu/CalloutBubbleMenu.js +2 -2
  7. package/dist/components/Menu/LinkBubbleMenu.d.ts.map +1 -1
  8. package/dist/components/Menu/LinkBubbleMenu.js +113 -103
  9. package/dist/components/Menu/LinkEditor.d.ts +0 -7
  10. package/dist/components/Menu/LinkEditor.d.ts.map +1 -1
  11. package/dist/components/Menu/LinkEditor.js +148 -157
  12. package/dist/components/Menu/Mobile/ListOptionBar.js +1 -1
  13. package/dist/components/Menu/TableBubbleMenu.js +3 -3
  14. package/dist/components/Menu/TableHeightSettings.js +3 -11
  15. package/dist/components/Menu/TableLayoutOptions.js +1 -5
  16. package/dist/components/Menu/linkBubbleMenuPlugin.d.ts.map +1 -1
  17. package/dist/components/Menu/linkBubbleMenuPlugin.js +9 -5
  18. package/dist/components/Scribe/extension/callout.js +7 -7
  19. package/dist/components/Scribe/extension/emoji/suggest.js +2 -2
  20. package/dist/components/Scribe/extension/extension-link.js +1 -2
  21. package/dist/components/Scribe/extension/extension-markdown-paste.js +2 -2
  22. package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
  23. package/dist/components/Scribe/extension/external-link-preview/attributes.d.ts +0 -7
  24. package/dist/components/Scribe/extension/external-link-preview/attributes.d.ts.map +1 -1
  25. package/dist/components/Scribe/extension/external-link-preview/attributes.js +26 -51
  26. package/dist/components/Scribe/extension/external-link-preview/commands.d.ts +5 -12
  27. package/dist/components/Scribe/extension/external-link-preview/commands.d.ts.map +1 -1
  28. package/dist/components/Scribe/extension/external-link-preview/commands.js +56 -121
  29. package/dist/components/Scribe/extension/external-link-preview/index.d.ts +4 -6
  30. package/dist/components/Scribe/extension/external-link-preview/index.d.ts.map +1 -1
  31. package/dist/components/Scribe/extension/external-link-preview/index.js +5 -41
  32. package/dist/components/Scribe/extension/external-link-preview/render-html.d.ts +1 -0
  33. package/dist/components/Scribe/extension/external-link-preview/render-html.d.ts.map +1 -1
  34. package/dist/components/Scribe/extension/external-link-preview/render-html.js +17 -60
  35. package/dist/components/Scribe/extension/external-link-preview/schema.d.ts +2 -2
  36. package/dist/components/Scribe/extension/external-link-preview/schema.js +1 -1
  37. package/dist/components/Scribe/extension/external-link-preview/serialization.d.ts.map +1 -1
  38. package/dist/components/Scribe/extension/external-link-preview/serialization.js +29 -51
  39. package/dist/components/Scribe/extension/external-link-preview/types.d.ts +14 -17
  40. package/dist/components/Scribe/extension/external-link-preview/types.d.ts.map +1 -1
  41. package/dist/components/Scribe/extension/index.js +1 -2
  42. package/dist/components/Scribe/extension/resizable-table.js +2 -2
  43. package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +10 -14
  44. package/dist/components/Scribe/extension/slashCommand/index.js +2 -2
  45. package/dist/components/Scribe/extension/slashCommand/renderItems.js +2 -2
  46. package/dist/components/Scribe/extension/table-layout.js +1 -2
  47. package/dist/components/Scribe/extension/tableOfContents.js +1 -1
  48. package/dist/components/Scribe/index.d.ts +3 -9
  49. package/dist/components/Scribe/index.d.ts.map +1 -1
  50. package/dist/components/Scribe/index.js +7 -21
  51. package/dist/{dist-DnVcys79.js → dist-BoAzo5MN.js} +491 -598
  52. package/dist/{dist-CDJRm4fL.js → dist-BqlzKS-_.js} +9 -17
  53. package/dist/{dist-B0xwy1Q5.js → dist-SM4NoN4h.js} +174 -385
  54. package/dist/document-node-capabilities.js +1 -1
  55. package/dist/{extension-BPeoqfHR.js → extension-dz0CIf3r.js} +1 -1
  56. package/dist/extension-link-DxIXGCtV.js +931 -0
  57. package/dist/{html-to-markdown-DF93it73.js → html-to-markdown-DeRG9OPm.js} +1 -1
  58. package/dist/main.css +1 -141
  59. package/dist/main.js +2 -2
  60. package/dist/{markdown-to-html-BoK5O_j-.js → markdown-to-html-tCPjQ5u6.js} +23 -70
  61. package/dist/{menus-scgppp2C.js → menus-BKxcTUsl.js} +36 -118
  62. package/dist/{purify.es-q6CUdJQi.js → purify.es-CSWcs7f1.js} +1 -23
  63. package/dist/{schema-extensions-ITR9LEgX.js → schema-extensions-B9hR1VrD.js} +1335 -1360
  64. package/dist/schema-extensions.js +1 -2
  65. package/dist/schema.js +1 -1
  66. package/dist/{table-layout-iVolql5p.js → table-layout-ClqaGg1E.js} +36 -36
  67. package/dist/{tippy.esm-MjWnmeEn.js → tippy.esm-C8V6GlaF.js} +5 -17
  68. package/dist/utils/create-scribe-editor.d.ts +1 -1
  69. package/dist/utils/create-scribe-editor.d.ts.map +1 -1
  70. package/dist/utils/create-scribe-editor.js +1 -2
  71. package/dist/utils/html-to-markdown.js +1 -2
  72. package/dist/utils/index.js +4 -4
  73. package/dist/utils/markdown-to-html.js +1 -2
  74. package/package.json +10 -10
  75. package/dist/BarMenu-BC8XoC6e.js +0 -302
  76. package/dist/components/Menu/ExternalLinkDisplayOptions.d.ts +0 -13
  77. package/dist/components/Menu/ExternalLinkDisplayOptions.d.ts.map +0 -1
  78. package/dist/components/Menu/ExternalLinkDisplayOptions.js +0 -90
  79. package/dist/components/Scribe/extension/external-link-preview/node-view.d.ts +0 -3
  80. package/dist/components/Scribe/extension/external-link-preview/node-view.d.ts.map +0 -1
  81. package/dist/components/Scribe/extension/external-link-preview/node-view.js +0 -97
  82. package/dist/components/Scribe/extension/external-link-preview/normalization.d.ts +0 -7
  83. package/dist/components/Scribe/extension/external-link-preview/normalization.d.ts.map +0 -1
  84. package/dist/components/Scribe/extension/external-link-preview/normalization.js +0 -21
  85. package/dist/components/Scribe/extension/external-link-preview/paste.d.ts +0 -8
  86. package/dist/components/Scribe/extension/external-link-preview/paste.d.ts.map +0 -1
  87. package/dist/components/Scribe/extension/external-link-preview/paste.js +0 -53
  88. package/dist/components/Scribe/extension/external-link-preview/policy.d.ts +0 -7
  89. package/dist/components/Scribe/extension/external-link-preview/policy.d.ts.map +0 -1
  90. package/dist/components/Scribe/extension/external-link-preview/policy.js +0 -38
  91. package/dist/components/Scribe/extension/external-link-preview/resolver.d.ts +0 -23
  92. package/dist/components/Scribe/extension/external-link-preview/resolver.d.ts.map +0 -1
  93. package/dist/components/Scribe/extension/external-link-preview/resolver.js +0 -118
  94. package/dist/extension-link-RvaqaDqr.js +0 -934
@@ -1,934 +0,0 @@
1
- import { L as e, R as t, d as n, g as r, h as i, i as a, p as o, r as s, s as c, y as l, z as u } from "./dist-DnVcys79.js";
2
- import { Plugin as d, PluginKey as f } from "@tiptap/pm/state";
3
- import { ReplaceStep as p } from "@tiptap/pm/transform";
4
- import { isHistoryTransaction as m } from "@tiptap/pm/history";
5
- //#region node_modules/.pnpm/linkifyjs@4.3.3/node_modules/linkifyjs/dist/linkify.mjs
6
- var h = "aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2", g = "ελ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", _ = "numeric", ee = "ascii", v = "alpha", y = "asciinumeric", b = "alphanumeric", x = "domain", S = "emoji", te = "scheme", ne = "slashscheme", re = "whitespace";
7
- function ie(e, t) {
8
- return e in t || (t[e] = []), t[e];
9
- }
10
- function C(e, t, n) {
11
- t[_] && (t[y] = !0, t[b] = !0), t[ee] && (t[y] = !0, t[v] = !0), t[y] && (t[b] = !0), t[v] && (t[b] = !0), t[b] && (t[x] = !0), t[S] && (t[x] = !0);
12
- for (let r in t) {
13
- let t = ie(r, n);
14
- t.indexOf(e) < 0 && t.push(e);
15
- }
16
- }
17
- function ae(e, t) {
18
- let n = {};
19
- for (let r in t) t[r].indexOf(e) >= 0 && (n[r] = !0);
20
- return n;
21
- }
22
- function w(e = null) {
23
- this.j = {}, this.jr = [], this.jd = null, this.t = e;
24
- }
25
- w.groups = {}, w.prototype = {
26
- accepts() {
27
- return !!this.t;
28
- },
29
- go(e) {
30
- let t = this, n = t.j[e];
31
- if (n) return n;
32
- for (let n = 0; n < t.jr.length; n++) {
33
- let r = t.jr[n][0], i = t.jr[n][1];
34
- if (i && r.test(e)) return i;
35
- }
36
- return t.jd;
37
- },
38
- has(e, t = !1) {
39
- return t ? e in this.j : !!this.go(e);
40
- },
41
- ta(e, t, n, r) {
42
- for (let i = 0; i < e.length; i++) this.tt(e[i], t, n, r);
43
- },
44
- tr(e, t, n, r) {
45
- r ||= w.groups;
46
- let i;
47
- return t && t.j ? i = t : (i = new w(t), n && r && C(t, n, r)), this.jr.push([e, i]), i;
48
- },
49
- ts(e, t, n, r) {
50
- let i = this, a = e.length;
51
- if (!a) return i;
52
- for (let t = 0; t < a - 1; t++) i = i.tt(e[t]);
53
- return i.tt(e[a - 1], t, n, r);
54
- },
55
- tt(e, t, n, r) {
56
- r ||= w.groups;
57
- let i = this;
58
- if (t && t.j) return i.j[e] = t, t;
59
- let a = t, o, s = i.go(e);
60
- return s ? (o = new w(), Object.assign(o.j, s.j), o.jr.push.apply(o.jr, s.jr), o.jd = s.jd, o.t = s.t) : o = new w(), a && (r && (o.t && typeof o.t == "string" ? C(a, Object.assign(ae(o.t, r), n), r) : n && C(a, n, r)), o.t = a), i.j[e] = o, o;
61
- }
62
- };
63
- var T = (e, t, n, r, i) => e.ta(t, n, r, i), E = (e, t, n, r, i) => e.tr(t, n, r, i), oe = (e, t, n, r, i) => e.ts(t, n, r, i), D = (e, t, n, r, i) => e.tt(t, n, r, i), O = "WORD", se = "UWORD", ce = "ASCIINUMERICAL", le = "ALPHANUMERICAL", k = "LOCALHOST", ue = "TLD", de = "UTLD", fe = "SCHEME", A = "SLASH_SCHEME", pe = "NUM", me = "WS", he = "NL", j = "OPENBRACE", M = "CLOSEBRACE", ge = "OPENBRACKET", N = "CLOSEBRACKET", P = "OPENPAREN", _e = "CLOSEPAREN", ve = "OPENANGLEBRACKET", ye = "CLOSEANGLEBRACKET", be = "FULLWIDTHLEFTPAREN", xe = "FULLWIDTHRIGHTPAREN", Se = "LEFTCORNERBRACKET", Ce = "RIGHTCORNERBRACKET", we = "LEFTWHITECORNERBRACKET", Te = "RIGHTWHITECORNERBRACKET", Ee = "FULLWIDTHLESSTHAN", De = "FULLWIDTHGREATERTHAN", Oe = "AMPERSAND", ke = "APOSTROPHE", Ae = "ASTERISK", F = "AT", I = "BACKSLASH", L = "BACKTICK", R = "CARET", z = "COLON", je = "COMMA", Me = "DOLLAR", B = "DOT", Ne = "EQUALS", Pe = "EXCLAMATION", V = "HYPHEN", H = "PERCENT", Fe = "PIPE", Ie = "PLUS", Le = "POUND", U = "QUERY", Re = "QUOTE", ze = "FULLWIDTHMIDDLEDOT", Be = "SEMI", W = "SLASH", G = "TILDE", Ve = "UNDERSCORE", He = "EMOJI", Ue = "SYM", We = /*#__PURE__*/ Object.freeze({
64
- __proto__: null,
65
- ALPHANUMERICAL: le,
66
- AMPERSAND: Oe,
67
- APOSTROPHE: ke,
68
- ASCIINUMERICAL: ce,
69
- ASTERISK: Ae,
70
- AT: F,
71
- BACKSLASH: I,
72
- BACKTICK: L,
73
- CARET: R,
74
- CLOSEANGLEBRACKET: ye,
75
- CLOSEBRACE: M,
76
- CLOSEBRACKET: N,
77
- CLOSEPAREN: _e,
78
- COLON: z,
79
- COMMA: je,
80
- DOLLAR: Me,
81
- DOT: B,
82
- EMOJI: He,
83
- EQUALS: Ne,
84
- EXCLAMATION: Pe,
85
- FULLWIDTHGREATERTHAN: De,
86
- FULLWIDTHLEFTPAREN: be,
87
- FULLWIDTHLESSTHAN: Ee,
88
- FULLWIDTHMIDDLEDOT: ze,
89
- FULLWIDTHRIGHTPAREN: xe,
90
- HYPHEN: V,
91
- LEFTCORNERBRACKET: Se,
92
- LEFTWHITECORNERBRACKET: we,
93
- LOCALHOST: k,
94
- NL: he,
95
- NUM: pe,
96
- OPENANGLEBRACKET: ve,
97
- OPENBRACE: j,
98
- OPENBRACKET: ge,
99
- OPENPAREN: P,
100
- PERCENT: H,
101
- PIPE: Fe,
102
- PLUS: Ie,
103
- POUND: Le,
104
- QUERY: U,
105
- QUOTE: Re,
106
- RIGHTCORNERBRACKET: Ce,
107
- RIGHTWHITECORNERBRACKET: Te,
108
- SCHEME: fe,
109
- SEMI: Be,
110
- SLASH: W,
111
- SLASH_SCHEME: A,
112
- SYM: Ue,
113
- TILDE: G,
114
- TLD: ue,
115
- UNDERSCORE: Ve,
116
- UTLD: de,
117
- UWORD: se,
118
- WORD: O,
119
- WS: me
120
- }), K = /[a-z]/, q = /\p{L}/u, Ge = /\p{Emoji}/u, J = /\d/, Ke = /\s/, qe = "\r", Je = "\n", Ye = "️", Xe = "‍", Ze = "", Qe = null, $e = null;
121
- function et(e = []) {
122
- let t = {};
123
- w.groups = t;
124
- let n = new w();
125
- Qe ??= rt(h), $e ??= rt(g), D(n, "'", ke), D(n, "{", j), D(n, "}", M), D(n, "[", ge), D(n, "]", N), D(n, "(", P), D(n, ")", _e), D(n, "<", ve), D(n, ">", ye), D(n, "(", be), D(n, ")", xe), D(n, "「", Se), D(n, "」", Ce), D(n, "『", we), D(n, "』", Te), D(n, "<", Ee), D(n, ">", De), D(n, "&", Oe), D(n, "*", Ae), D(n, "@", F), D(n, "`", L), D(n, "^", R), D(n, ":", z), D(n, ",", je), D(n, "$", Me), D(n, ".", B), D(n, "=", Ne), D(n, "!", Pe), D(n, "-", V), D(n, "%", H), D(n, "|", Fe), D(n, "+", Ie), D(n, "#", Le), D(n, "?", U), D(n, "\"", Re), D(n, "/", W), D(n, ";", Be), D(n, "~", G), D(n, "_", Ve), D(n, "\\", I), D(n, "・", ze);
126
- let r = E(n, J, pe, { [_]: !0 });
127
- E(r, J, r);
128
- let i = E(r, K, ce, { [y]: !0 }), a = E(r, q, le, { [b]: !0 }), o = E(n, K, O, { [ee]: !0 });
129
- E(o, J, i), E(o, K, o), E(i, J, i), E(i, K, i);
130
- let s = E(n, q, se, { [v]: !0 });
131
- E(s, K), E(s, J, a), E(s, q, s), E(a, J, a), E(a, K), E(a, q, a);
132
- let c = D(n, Je, he, { [re]: !0 }), l = D(n, qe, me, { [re]: !0 }), u = E(n, Ke, me, { [re]: !0 });
133
- D(n, Ze, u), D(l, Je, c), D(l, Ze, u), E(l, Ke, u), D(u, qe), D(u, Je), E(u, Ke, u), D(u, Ze, u);
134
- let d = E(n, Ge, He, { [S]: !0 });
135
- D(d, "#"), E(d, Ge, d), D(d, Ye, d);
136
- let f = D(d, Xe);
137
- D(f, "#"), E(f, Ge, d);
138
- let p = [[K, o], [J, i]], m = [
139
- [K, null],
140
- [q, s],
141
- [J, a]
142
- ];
143
- for (let e = 0; e < Qe.length; e++) Y(n, Qe[e], ue, O, p);
144
- for (let e = 0; e < $e.length; e++) Y(n, $e[e], de, se, m);
145
- C(ue, {
146
- tld: !0,
147
- ascii: !0
148
- }, t), C(de, {
149
- utld: !0,
150
- alpha: !0
151
- }, t), Y(n, "file", fe, O, p), Y(n, "mailto", fe, O, p), Y(n, "http", A, O, p), Y(n, "https", A, O, p), Y(n, "ftp", A, O, p), Y(n, "ftps", A, O, p), C(fe, {
152
- scheme: !0,
153
- ascii: !0
154
- }, t), C(A, {
155
- slashscheme: !0,
156
- ascii: !0
157
- }, t), e = e.sort((e, t) => e[0] > t[0] ? 1 : -1);
158
- for (let t = 0; t < e.length; t++) {
159
- let r = e[t][0], i = e[t][1] ? { [te]: !0 } : { [ne]: !0 };
160
- r.indexOf("-") >= 0 ? i[x] = !0 : K.test(r) ? J.test(r) ? i[y] = !0 : i[ee] = !0 : i[_] = !0, oe(n, r, r, i);
161
- }
162
- return oe(n, "localhost", k, { ascii: !0 }), n.jd = new w(Ue), {
163
- start: n,
164
- tokens: Object.assign({ groups: t }, We)
165
- };
166
- }
167
- function tt(e, t) {
168
- let n = nt(t.replace(/[A-Z]/g, (e) => e.toLowerCase())), r = n.length, i = [], a = 0, o = 0;
169
- for (; o < r;) {
170
- let s = e, c = null, l = 0, u = null, d = -1, f = -1;
171
- for (; o < r && (c = s.go(n[o]));) s = c, s.accepts() ? (d = 0, f = 0, u = s) : d >= 0 && (d += n[o].length, f++), l += n[o].length, a += n[o].length, o++;
172
- a -= d, o -= f, l -= d, i.push({
173
- t: u.t,
174
- v: t.slice(a - l, a),
175
- s: a - l,
176
- e: a
177
- });
178
- }
179
- return i;
180
- }
181
- function nt(e) {
182
- let t = [], n = e.length, r = 0;
183
- for (; r < n;) {
184
- let i = e.charCodeAt(r), a, o = i < 55296 || i > 56319 || r + 1 === n || (a = e.charCodeAt(r + 1)) < 56320 || a > 57343 ? e[r] : e.slice(r, r + 2);
185
- t.push(o), r += o.length;
186
- }
187
- return t;
188
- }
189
- function Y(e, t, n, r, i) {
190
- let a, o = t.length;
191
- for (let n = 0; n < o - 1; n++) {
192
- let o = t[n];
193
- e.j[o] ? a = e.j[o] : (a = new w(r), a.jr = i.slice(), e.j[o] = a), e = a;
194
- }
195
- return a = new w(n), a.jr = i.slice(), e.j[t[o - 1]] = a, a;
196
- }
197
- function rt(e) {
198
- let t = [], n = [], r = 0;
199
- for (; r < e.length;) {
200
- let i = 0;
201
- for (; "0123456789".indexOf(e[r + i]) >= 0;) i++;
202
- if (i > 0) {
203
- t.push(n.join(""));
204
- for (let t = parseInt(e.substring(r, r + i), 10); t > 0; t--) n.pop();
205
- r += i;
206
- } else n.push(e[r]), r++;
207
- }
208
- return t;
209
- }
210
- var X = {
211
- defaultProtocol: "http",
212
- events: null,
213
- format: at,
214
- formatHref: at,
215
- nl2br: !1,
216
- tagName: "a",
217
- target: null,
218
- rel: null,
219
- validate: !0,
220
- truncate: Infinity,
221
- className: null,
222
- attributes: null,
223
- ignoreTags: [],
224
- render: null
225
- };
226
- function it(e, t = null) {
227
- let n = Object.assign({}, X);
228
- e && (n = Object.assign(n, e instanceof it ? e.o : e));
229
- let r = n.ignoreTags, i = [];
230
- for (let e = 0; e < r.length; e++) i.push(r[e].toUpperCase());
231
- this.o = n, t && (this.defaultRender = t), this.ignoreTags = i;
232
- }
233
- it.prototype = {
234
- o: X,
235
- ignoreTags: [],
236
- defaultRender(e) {
237
- return e;
238
- },
239
- check(e) {
240
- return this.get("validate", e.toString(), e);
241
- },
242
- get(e, t, n) {
243
- let r = t != null, i = this.o[e];
244
- return i && (typeof i == "object" ? (i = n.t in i ? i[n.t] : X[e], typeof i == "function" && r && (i = i(t, n))) : typeof i == "function" && r && (i = i(t, n.t, n)), i);
245
- },
246
- getObj(e, t, n) {
247
- let r = this.o[e];
248
- return typeof r == "function" && t != null && (r = r(t, n.t, n)), r;
249
- },
250
- render(e) {
251
- let t = e.render(this);
252
- return (this.get("render", null, e) || this.defaultRender)(t, e.t, e);
253
- }
254
- };
255
- function at(e) {
256
- return e;
257
- }
258
- function ot(e, t) {
259
- this.t = "token", this.v = e, this.tk = t;
260
- }
261
- ot.prototype = {
262
- isLink: !1,
263
- toString() {
264
- return this.v;
265
- },
266
- toHref(e) {
267
- return this.toString();
268
- },
269
- toFormattedString(e) {
270
- let t = this.toString(), n = e.get("truncate", t, this), r = e.get("format", t, this);
271
- return n && r.length > n ? r.substring(0, n) + "…" : r;
272
- },
273
- toFormattedHref(e) {
274
- return e.get("formatHref", this.toHref(e.get("defaultProtocol")), this);
275
- },
276
- startIndex() {
277
- return this.tk[0].s;
278
- },
279
- endIndex() {
280
- return this.tk[this.tk.length - 1].e;
281
- },
282
- toObject(e = X.defaultProtocol) {
283
- return {
284
- type: this.t,
285
- value: this.toString(),
286
- isLink: this.isLink,
287
- href: this.toHref(e),
288
- start: this.startIndex(),
289
- end: this.endIndex()
290
- };
291
- },
292
- toFormattedObject(e) {
293
- return {
294
- type: this.t,
295
- value: this.toFormattedString(e),
296
- isLink: this.isLink,
297
- href: this.toFormattedHref(e),
298
- start: this.startIndex(),
299
- end: this.endIndex()
300
- };
301
- },
302
- validate(e) {
303
- return e.get("validate", this.toString(), this);
304
- },
305
- render(e) {
306
- let t = this, n = this.toHref(e.get("defaultProtocol")), r = e.get("formatHref", n, this), i = e.get("tagName", n, t), a = this.toFormattedString(e), o = {}, s = e.get("className", n, t), c = e.get("target", n, t), l = e.get("rel", n, t), u = e.getObj("attributes", n, t), d = e.getObj("events", n, t);
307
- return o.href = r, s && (o.class = s), c && (o.target = c), l && (o.rel = l), u && Object.assign(o, u), {
308
- tagName: i,
309
- attributes: o,
310
- content: a,
311
- eventListeners: d
312
- };
313
- }
314
- };
315
- function st(e, t) {
316
- class n extends ot {
317
- constructor(t, n) {
318
- super(t, n), this.t = e;
319
- }
320
- }
321
- for (let e in t) n.prototype[e] = t[e];
322
- return n.t = e, n;
323
- }
324
- var ct = st("email", {
325
- isLink: !0,
326
- toHref() {
327
- return "mailto:" + this.toString();
328
- }
329
- }), lt = st("text"), ut = st("nl"), dt = st("url", {
330
- isLink: !0,
331
- toHref(e = X.defaultProtocol) {
332
- return this.hasProtocol() ? this.v : `${e}://${this.v}`;
333
- },
334
- hasProtocol() {
335
- let e = this.tk;
336
- return e.length >= 2 && e[0].t !== k && e[1].t === z;
337
- }
338
- }), Z = (e) => new w(e);
339
- function ft({ groups: e }) {
340
- let t = e.domain.concat([
341
- Oe,
342
- Ae,
343
- F,
344
- I,
345
- L,
346
- R,
347
- Me,
348
- Ne,
349
- V,
350
- pe,
351
- H,
352
- Fe,
353
- Ie,
354
- Le,
355
- W,
356
- Ue,
357
- G,
358
- Ve
359
- ]), n = [
360
- ke,
361
- z,
362
- je,
363
- B,
364
- Pe,
365
- H,
366
- U,
367
- Re,
368
- Be,
369
- ve,
370
- ye,
371
- j,
372
- M,
373
- N,
374
- ge,
375
- P,
376
- _e,
377
- be,
378
- xe,
379
- Se,
380
- Ce,
381
- we,
382
- Te,
383
- Ee,
384
- De
385
- ], r = [
386
- Oe,
387
- ke,
388
- Ae,
389
- I,
390
- L,
391
- R,
392
- Me,
393
- Ne,
394
- V,
395
- j,
396
- M,
397
- H,
398
- Fe,
399
- Ie,
400
- Le,
401
- U,
402
- W,
403
- Ue,
404
- G,
405
- Ve
406
- ], i = Z(), a = D(i, G);
407
- T(a, r, a), T(a, e.domain, a);
408
- let o = Z(), s = Z(), c = Z();
409
- T(i, e.domain, o), T(i, e.scheme, s), T(i, e.slashscheme, c), T(o, r, a), T(o, e.domain, o);
410
- let l = D(o, F);
411
- D(a, F, l), D(s, F, l), D(c, F, l);
412
- let u = D(a, B);
413
- T(u, r, a), T(u, e.domain, a);
414
- let d = Z();
415
- T(l, e.domain, d), T(d, e.domain, d);
416
- let f = D(d, B);
417
- T(f, e.domain, d);
418
- let p = Z(ct);
419
- T(f, e.tld, p), T(f, e.utld, p), D(l, k, p);
420
- let m = D(d, V);
421
- D(m, V, m), T(m, e.domain, d), T(p, e.domain, d), D(p, B, f), D(p, V, m);
422
- let h = D(o, V), g = D(o, B);
423
- D(h, V, h), T(h, e.domain, o), T(g, r, a), T(g, e.domain, o);
424
- let _ = Z(dt);
425
- T(g, e.tld, _), T(g, e.utld, _), T(_, e.domain, o), T(_, r, a), D(_, B, g), D(_, V, h), D(_, F, l);
426
- let ee = D(_, z), v = Z(dt);
427
- T(ee, e.numeric, v);
428
- let y = Z(dt), b = Z();
429
- T(y, t, y), T(y, n, b), T(b, t, y), T(b, n, b), D(_, W, y), D(v, W, y);
430
- let x = D(s, z), S = D(D(D(c, z), W), W);
431
- T(s, e.domain, o), D(s, B, g), D(s, V, h), T(c, e.domain, o), D(c, B, g), D(c, V, h), T(x, e.domain, y), D(x, W, y), D(x, U, y), T(S, e.domain, y), T(S, t, y), D(S, W, y);
432
- let te = [
433
- [j, M],
434
- [ge, N],
435
- [P, _e],
436
- [ve, ye],
437
- [be, xe],
438
- [Se, Ce],
439
- [we, Te],
440
- [Ee, De]
441
- ];
442
- for (let e = 0; e < te.length; e++) {
443
- let [r, i] = te[e], a = D(y, r);
444
- D(b, r, a);
445
- let o = Z(dt);
446
- T(a, t, o);
447
- let s = Z();
448
- T(a, n, s), D(a, i, y), T(o, t, o), T(o, n, s), T(s, t, o), T(s, n, s), D(o, i, y), D(s, i, y);
449
- }
450
- return D(i, k, _), D(i, he, ut), {
451
- start: i,
452
- tokens: We
453
- };
454
- }
455
- function pt(e, t, n) {
456
- let r = n.length, i = 0, a = [], o = [];
457
- for (; i < r;) {
458
- let s = e, c = null, l = null, u = 0, d = null, f = -1;
459
- for (; i < r && !(c = s.go(n[i].t));) o.push(n[i++]);
460
- for (; i < r && (l = c || s.go(n[i].t));) c = null, s = l, s.accepts() ? (f = 0, d = s) : f >= 0 && f++, i++, u++;
461
- if (f < 0) i -= u, i < r && (o.push(n[i]), i++);
462
- else {
463
- o.length > 0 && (a.push(mt(lt, t, o)), o = []), i -= f, u -= f;
464
- let e = d.t, r = n.slice(i - u, i);
465
- a.push(mt(e, t, r));
466
- }
467
- }
468
- return o.length > 0 && a.push(mt(lt, t, o)), a;
469
- }
470
- function mt(e, t, n) {
471
- let r = n[0].s, i = n[n.length - 1].e;
472
- return new e(t.slice(r, i), n);
473
- }
474
- var ht = typeof console < "u" && console && console.warn || (() => {}), gt = "until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.", Q = {
475
- scanner: null,
476
- parser: null,
477
- tokenQueue: [],
478
- pluginQueue: [],
479
- customSchemes: [],
480
- initialized: !1
481
- };
482
- function _t() {
483
- return w.groups = {}, Q.scanner = null, Q.parser = null, Q.tokenQueue = [], Q.pluginQueue = [], Q.customSchemes = [], Q.initialized = !1, Q;
484
- }
485
- function vt(e, t = !1) {
486
- if (Q.initialized && ht(`linkifyjs: already initialized - will not register custom scheme "${e}" ${gt}`), !/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e)) throw Error("linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or \"-\"\n2. Cannot start or end with \"-\"\n3. \"-\" cannot repeat");
487
- Q.customSchemes.push([e, t]);
488
- }
489
- function yt() {
490
- Q.scanner = et(Q.customSchemes);
491
- for (let e = 0; e < Q.tokenQueue.length; e++) Q.tokenQueue[e][1]({ scanner: Q.scanner });
492
- Q.parser = ft(Q.scanner.tokens);
493
- for (let e = 0; e < Q.pluginQueue.length; e++) Q.pluginQueue[e][1]({
494
- scanner: Q.scanner,
495
- parser: Q.parser
496
- });
497
- return Q.initialized = !0, Q;
498
- }
499
- function bt(e) {
500
- return Q.initialized || yt(), pt(Q.parser.start, e, tt(Q.scanner.start, e));
501
- }
502
- bt.scan = tt;
503
- function xt(e, t = null, n = null) {
504
- if (t && typeof t == "object") {
505
- if (n) throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);
506
- n = t, t = null;
507
- }
508
- let r = new it(n), i = bt(e), a = [];
509
- for (let e = 0; e < i.length; e++) {
510
- let n = i[e];
511
- n.isLink && (!t || n.t === t) && r.check(n) && a.push(n.toFormattedObject(r));
512
- }
513
- return a;
514
- }
515
- //#endregion
516
- //#region node_modules/.pnpm/@tiptap+extension-link@3.31.4_@tiptap+core@3.31.4_@tiptap+pm@3.31.4__@tiptap+pm@3.31.4/node_modules/@tiptap/extension-link/dist/index.js
517
- var St = "[\0- \xA0 ᠎ -\u2029  ]", Ct = new RegExp(St), wt = RegExp(`${St}$`), Tt = RegExp(`${St}+$`), Et = new RegExp(St, "g");
518
- function Dt(e, t, n) {
519
- let r = e.doc.resolve(t.to);
520
- if (!r.nodeBefore?.isText) return;
521
- let i = e.doc.textBetween(t.from, t.to, "", "").match(Tt)?.[0];
522
- if (!i) return;
523
- let a = t.to - i.length, o = l(a, t.to, e.doc).filter((e) => e.mark.type === n);
524
- if (!o.length) return;
525
- let { nodeAfter: s } = r;
526
- if (s && o.some((e) => e.mark.isInSet(s.marks))) return;
527
- let c = e.storedMarks;
528
- e.removeMark(a, t.to, n), e.setStoredMarks(c), e.selection.empty && e.selection.from === t.to && e.removeStoredMark(n);
529
- }
530
- function Ot(e) {
531
- return e.length === 1 ? e[0].isLink : e.length === 3 && e[1].isLink ? ["()", "[]"].includes(e[0].value + e[2].value) : !1;
532
- }
533
- function kt(e) {
534
- return new d({
535
- key: new f("autolink"),
536
- appendTransaction: (t, i, a) => {
537
- let s = t.some((e) => e.docChanged) && !i.doc.eq(a.doc), c = t.some((e) => e.getMeta("preventAutolink"));
538
- if (!s || c) return;
539
- let { tr: u } = a, d = n(i.doc, [...t]);
540
- if (!t.some(m)) {
541
- let t = [];
542
- d.steps.forEach((e, n) => {
543
- if (!(e instanceof p) || !e.slice.size) return;
544
- let r = d.mapping.slice(n + 1), i = r.map(e.from, 1), a = r.map(e.from + e.slice.size, -1);
545
- i < a && t.push({
546
- from: i,
547
- to: a
548
- });
549
- }), t.sort((e, t) => t.to - e.to), t.forEach((t) => Dt(u, t, e.type));
550
- }
551
- if (r(d).forEach(({ newRange: t }) => {
552
- let n = o(a.doc, t, (e) => e.isTextblock), r, i;
553
- if (n.length > 1) r = n[0], i = a.doc.textBetween(r.pos, r.pos + r.node.nodeSize, void 0, " ");
554
- else if (n.length) {
555
- let e = a.doc.textBetween(t.from, t.to, " ", " ");
556
- if (!wt.test(e)) return;
557
- r = n[0], i = a.doc.textBetween(r.pos, t.to, void 0, " ");
558
- }
559
- if (r && i) {
560
- let t = i.split(Ct).filter(Boolean);
561
- if (t.length <= 0) return !1;
562
- let n = t[t.length - 1], o = r.pos + i.lastIndexOf(n);
563
- if (!n) return !1;
564
- let s = bt(n).map((t) => t.toObject(e.defaultProtocol));
565
- if (!Ot(s)) return !1;
566
- s.filter((e) => e.isLink).map((e) => ({
567
- ...e,
568
- from: o + e.start + 1,
569
- to: o + e.end + 1
570
- })).filter((e) => !a.schema.marks.code || !a.doc.rangeHasMark(e.from, e.to, a.schema.marks.code)).filter((t) => e.validate(t.value)).filter((t) => e.shouldAutoLink(t.value)).forEach((t) => {
571
- l(t.from, t.to, a.doc).some((t) => t.mark.type === e.type) || u.addMark(t.from, t.to, e.type.create({ href: t.href }));
572
- });
573
- }
574
- }), u.steps.length) return u;
575
- }
576
- });
577
- }
578
- function At(e) {
579
- return new d({
580
- key: new f("handleClickLink"),
581
- props: { handleClick: (t, n, r) => {
582
- if (r.button !== 0 || !t.editable) return !1;
583
- let a = null;
584
- if (r.target instanceof HTMLAnchorElement) a = r.target;
585
- else {
586
- let t = r.target;
587
- if (!t) return !1;
588
- let n = e.editor.view.dom;
589
- a = t.closest("a"), a && !n.contains(a) && (a = null);
590
- }
591
- if (!a) return !1;
592
- let o = !1;
593
- if (e.enableClickSelection && (o = e.editor.commands.extendMarkRange(e.type.name)), e.openOnClick) {
594
- let n = i(t.state, e.type.name), r = a.href ?? n.href, s = a.target ?? n.target;
595
- r && (window.open(r, s), o = !0);
596
- }
597
- return o;
598
- } }
599
- });
600
- }
601
- var jt = /\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/, Mt = /\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;
602
- function Nt(e, t) {
603
- let n = 0;
604
- for (let r = t - 1; r >= 0 && e[r] === "\\"; --r) n += 1;
605
- return n % 2 == 1;
606
- }
607
- function Pt(e, t) {
608
- let n = 0, r = 0;
609
- for (; r < t;) {
610
- if (e[r] !== "`") {
611
- r += 1;
612
- continue;
613
- }
614
- if (n === 0 && Nt(e, r)) {
615
- r += 1;
616
- continue;
617
- }
618
- let i = 0;
619
- for (; r < t && e[r] === "`";) i += 1, r += 1;
620
- n === 0 ? n = i : i === n && (n = 0);
621
- }
622
- return n > 0;
623
- }
624
- function Ft(e, t, n) {
625
- let [, r, i] = t;
626
- return (t.index ? e[t.index - 1] : void 0) === "!" || Nt(e, t.index ?? 0) || Pt(e, t.index ?? 0) ? !1 : !!r.trim() && n(i);
627
- }
628
- function It(e) {
629
- let [t, n, r, , i, a, o] = e, s = i ?? a ?? o;
630
- return {
631
- index: e.index ?? 0,
632
- text: t,
633
- replaceWith: n,
634
- data: {
635
- href: r,
636
- title: s || null,
637
- markdown: !0
638
- }
639
- };
640
- }
641
- function Lt(e, t) {
642
- return e.index < t.index + t.text.length && t.index < e.index + e.text.length;
643
- }
644
- function Rt(e) {
645
- return {
646
- href: e.data?.href,
647
- title: e.data?.title ?? null
648
- };
649
- }
650
- function zt(t) {
651
- let n = e({
652
- find: (e) => {
653
- let n = jt.exec(e);
654
- return !n || !Ft(e, n, t.isAllowedHref) ? null : It(n);
655
- },
656
- type: t.type,
657
- getAttributes: Rt
658
- });
659
- return new s({
660
- find: n.find,
661
- handler: (e) => {
662
- let t = n.handler(e);
663
- return t !== null && e.state.tr.steps.length && e.state.tr.setMeta("preventAutolink", !0), t;
664
- }
665
- });
666
- }
667
- function Bt(e) {
668
- let n = t({
669
- find: (t) => {
670
- let n = [];
671
- for (let r of t.matchAll(Mt)) Ft(t, r, e.isAllowedHref) && n.push(It(r));
672
- let r = (e.findPlainUrls?.call(e, t) ?? []).filter((e) => !n.some((t) => Lt(t, e)));
673
- return [...n, ...r];
674
- },
675
- type: e.type,
676
- getAttributes: Rt
677
- });
678
- return new c({
679
- find: n.find,
680
- handler: (e) => {
681
- let t = n.handler(e);
682
- return t !== null && e.state.tr.steps.length && e.match.data?.markdown && e.state.tr.setMeta("preventAutolink", !0), t;
683
- }
684
- });
685
- }
686
- function Vt(e) {
687
- return new d({
688
- key: new f("handlePasteLink"),
689
- props: { handlePaste: (t, n, r) => {
690
- let { shouldAutoLink: i } = e, { state: a } = t, { selection: o } = a, { empty: s } = o;
691
- if (s) return !1;
692
- let c = "";
693
- r.content.forEach((e) => {
694
- c += e.textContent;
695
- });
696
- let l = xt(c, { defaultProtocol: e.defaultProtocol }).find((e) => e.isLink && e.value === c);
697
- return !c || !l || i !== void 0 && !i(l.value) ? !1 : e.editor.commands.setMark(e.type, { href: l.href });
698
- } }
699
- });
700
- }
701
- function $(e, t) {
702
- let n = [
703
- "http",
704
- "https",
705
- "ftp",
706
- "ftps",
707
- "mailto",
708
- "tel",
709
- "callto",
710
- "sms",
711
- "cid",
712
- "xmpp"
713
- ];
714
- return t && t.forEach((e) => {
715
- let t = typeof e == "string" ? e : e.scheme;
716
- t && n.push(t);
717
- }), !e || e.replace(Et, "").match(RegExp(`^(?:(?:${n.map((e) => e.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`, "i"));
718
- }
719
- var Ht = a.create({
720
- name: "link",
721
- priority: 1e3,
722
- keepOnSplit: !1,
723
- exitable: !0,
724
- onCreate() {
725
- this.options.validate && !this.options.shouldAutoLink && (this.options.shouldAutoLink = this.options.validate, console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")), this.options.protocols.forEach((e) => {
726
- if (typeof e == "string") {
727
- vt(e);
728
- return;
729
- }
730
- vt(e.scheme, e.optionalSlashes);
731
- });
732
- },
733
- onDestroy() {
734
- _t();
735
- },
736
- inclusive() {
737
- return this.options.autolink;
738
- },
739
- addOptions() {
740
- return {
741
- openOnClick: !0,
742
- enableClickSelection: !1,
743
- linkOnPaste: !0,
744
- markdownLinks: !1,
745
- autolink: !0,
746
- protocols: [],
747
- defaultProtocol: "http",
748
- HTMLAttributes: {
749
- target: "_blank",
750
- rel: "noopener noreferrer nofollow",
751
- class: null
752
- },
753
- isAllowedUri: (e, t) => !!$(e, t.protocols),
754
- validate: (e) => !!e,
755
- shouldAutoLink: (e) => {
756
- let t = /^[a-z][a-z0-9+.-]*:\/\//i.test(e), n = /^[a-z][a-z0-9+.-]*:/i.test(e);
757
- if (t || n && !e.includes("@")) return !0;
758
- let r = (e.includes("@") ? e.split("@").pop() : e).split(/[/?#:]/)[0];
759
- return !(/^\d{1,3}(\.\d{1,3}){3}$/.test(r) || !/\./.test(r));
760
- }
761
- };
762
- },
763
- addAttributes() {
764
- return {
765
- href: {
766
- default: null,
767
- parseHTML(e) {
768
- return e.getAttribute("href");
769
- }
770
- },
771
- target: { default: this.options.HTMLAttributes.target ?? null },
772
- rel: { default: this.options.HTMLAttributes.rel ?? null },
773
- class: { default: this.options.HTMLAttributes.class ?? null },
774
- title: { default: null }
775
- };
776
- },
777
- parseHTML() {
778
- return [{
779
- tag: "a[href]",
780
- getAttrs: (e) => {
781
- let t = e.getAttribute("href");
782
- return !t || !this.options.isAllowedUri(t, {
783
- defaultValidate: (e) => !!$(e, this.options.protocols),
784
- protocols: this.options.protocols,
785
- defaultProtocol: this.options.defaultProtocol
786
- }) ? !1 : null;
787
- }
788
- }];
789
- },
790
- renderHTML({ HTMLAttributes: e }) {
791
- return this.options.isAllowedUri(e.href, {
792
- defaultValidate: (e) => !!$(e, this.options.protocols),
793
- protocols: this.options.protocols,
794
- defaultProtocol: this.options.defaultProtocol
795
- }) ? [
796
- "a",
797
- u(this.options.HTMLAttributes, e),
798
- 0
799
- ] : [
800
- "a",
801
- u(this.options.HTMLAttributes, {
802
- ...e,
803
- href: ""
804
- }),
805
- 0
806
- ];
807
- },
808
- markdownTokenName: "link",
809
- parseMarkdown: (e, t) => t.applyMark("link", t.parseInline(e.tokens || []), {
810
- href: e.href,
811
- title: e.title || null
812
- }),
813
- renderMarkdown: (e, t) => {
814
- let n = e.attrs?.href ?? "", r = e.attrs?.title ?? "", i = t.renderChildren(e);
815
- return r ? `[${i}](${n} "${r}")` : `[${i}](${n})`;
816
- },
817
- addCommands() {
818
- return {
819
- setLink: (e) => ({ chain: t }) => {
820
- let { href: n } = e;
821
- return this.options.isAllowedUri(n, {
822
- defaultValidate: (e) => !!$(e, this.options.protocols),
823
- protocols: this.options.protocols,
824
- defaultProtocol: this.options.defaultProtocol
825
- }) ? t().setMark(this.name, e).setMeta("preventAutolink", !0).run() : !1;
826
- },
827
- toggleLink: (e) => ({ chain: t }) => {
828
- let { href: n } = e || {};
829
- return n && !this.options.isAllowedUri(n, {
830
- defaultValidate: (e) => !!$(e, this.options.protocols),
831
- protocols: this.options.protocols,
832
- defaultProtocol: this.options.defaultProtocol
833
- }) ? !1 : t().toggleMark(this.name, e, { extendEmptyMarkRange: !0 }).setMeta("preventAutolink", !0).run();
834
- },
835
- unsetLink: () => ({ chain: e }) => e().unsetMark(this.name, { extendEmptyMarkRange: !0 }).setMeta("preventAutolink", !0).run()
836
- };
837
- },
838
- addInputRules() {
839
- return this.options.markdownLinks ? [zt({
840
- type: this.type,
841
- isAllowedHref: (e) => this.options.isAllowedUri(e, {
842
- defaultValidate: (e) => !!$(e, this.options.protocols),
843
- protocols: this.options.protocols,
844
- defaultProtocol: this.options.defaultProtocol
845
- })
846
- })] : [];
847
- },
848
- addPasteRules() {
849
- let e = (e) => {
850
- let t = [];
851
- if (e) {
852
- let { protocols: n, defaultProtocol: r } = this.options;
853
- xt(e).filter((e) => e.isLink && this.options.isAllowedUri(e.value, {
854
- defaultValidate: (e) => !!$(e, n),
855
- protocols: n,
856
- defaultProtocol: r
857
- })).forEach((e) => {
858
- this.options.shouldAutoLink(e.value) && t.push({
859
- text: e.value,
860
- data: { href: e.href },
861
- index: e.start
862
- });
863
- });
864
- }
865
- return t;
866
- };
867
- return this.options.markdownLinks ? [Bt({
868
- type: this.type,
869
- isAllowedHref: (e) => this.options.isAllowedUri(e, {
870
- defaultValidate: (e) => !!$(e, this.options.protocols),
871
- protocols: this.options.protocols,
872
- defaultProtocol: this.options.defaultProtocol
873
- }),
874
- findPlainUrls: e
875
- })] : [t({
876
- find: e,
877
- type: this.type,
878
- getAttributes: (e) => ({ href: e.data?.href })
879
- })];
880
- },
881
- addProseMirrorPlugins() {
882
- let e = [], { protocols: t, defaultProtocol: n } = this.options;
883
- return this.options.autolink && e.push(kt({
884
- type: this.type,
885
- defaultProtocol: this.options.defaultProtocol,
886
- validate: (e) => this.options.isAllowedUri(e, {
887
- defaultValidate: (e) => !!$(e, t),
888
- protocols: t,
889
- defaultProtocol: n
890
- }),
891
- shouldAutoLink: this.options.shouldAutoLink
892
- })), e.push(At({
893
- type: this.type,
894
- editor: this.editor,
895
- openOnClick: this.options.openOnClick === "whenNotEditable" || this.options.openOnClick,
896
- enableClickSelection: this.options.enableClickSelection
897
- })), this.options.linkOnPaste && e.push(Vt({
898
- editor: this.editor,
899
- defaultProtocol: this.options.defaultProtocol,
900
- type: this.type,
901
- shouldAutoLink: this.options.shouldAutoLink
902
- })), e;
903
- }
904
- }), Ut = Ht.configure({
905
- openOnClick: !1,
906
- enableClickSelection: !0,
907
- autolink: !0,
908
- linkOnPaste: !1,
909
- defaultProtocol: "https",
910
- protocols: ["http", "https"],
911
- isAllowedUri: (e, t) => {
912
- try {
913
- let n = e.includes(":") ? new URL(e) : new URL(`${t.defaultProtocol}://${e}`);
914
- if (!t.defaultValidate(n.href)) return !1;
915
- let r = [
916
- "ftp",
917
- "file",
918
- "mailto"
919
- ], i = n.protocol.replace(":", "");
920
- return !(r.includes(i) || !t.protocols.map((e) => typeof e == "string" ? e : e.scheme).includes(i));
921
- } catch {
922
- return !1;
923
- }
924
- },
925
- shouldAutoLink: (e) => {
926
- try {
927
- return !!(e.includes(":") ? new URL(e) : new URL(`https://${e}`));
928
- } catch {
929
- return !1;
930
- }
931
- }
932
- });
933
- //#endregion
934
- export { Ht as n, Ut as t };