@clevertask/scribe 0.0.10 → 0.0.11
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.
- package/dist/browser-BJWkU9cc.js +2106 -0
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/components/Menu/BarMenu.js +119 -4
- package/dist/components/Menu/BubbleMenu.js +1 -1
- package/dist/components/Scribe/extension/emoji/EmojiList.d.ts +1 -0
- package/dist/components/Scribe/extension/emoji/EmojiList.js +35 -0
- package/dist/components/Scribe/extension/emoji/suggest.d.ts +16 -0
- package/dist/components/Scribe/extension/emoji/suggest.js +40 -0
- package/dist/components/Scribe/extension/extension-link.js +208 -200
- package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
- package/dist/components/Scribe/extension/index.js +30 -24
- package/dist/components/Scribe/extension/math-extension.js +1 -1
- package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +7 -5
- package/dist/components/Scribe/extension/slashCommand/index.js +4 -153
- package/dist/components/Scribe/extension/slashCommand/renderItems.d.ts +1 -1
- package/dist/components/Scribe/extension/slashCommand/renderItems.js +14 -14
- package/dist/components/Scribe/index.js +18 -17
- package/dist/index-BqFHWqw6.js +156 -0
- package/dist/{index-C3_lI_rP.js → index-C_aWB8qt.js} +449 -427
- package/dist/index-CasgquAq.js +39381 -0
- package/dist/{index-Gm-3o3nq.js → index-DeZ8laak.js} +1124 -1083
- package/dist/main.css +60 -2
- package/dist/{turndown.browser.es-BSoGafvq.js → turndown.browser.es-C1wFFc_i.js} +342 -334
- package/dist/utils/create-scribe-editor.js +2 -2
- package/dist/utils/html-to-markdown.js +1 -1
- package/dist/utils/markdown-to-html.js +1 -1
- package/package.json +33 -31
- package/dist/BarMenu-SiPgB2ow.js +0 -134
- package/dist/browser-DEobZXxB.js +0 -2099
- package/dist/index-NRgJVTH-.js +0 -7576
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { M as
|
|
2
|
-
const xe = "
|
|
1
|
+
import { M as Ne, d as Ie, m as ce, P as Vt, b as Jt, f as we, g as He, h as ve, i as De, j as Ue } from "../../../index-DeZ8laak.js";
|
|
2
|
+
const xe = "aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2", Me = "ελ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", B = (t, n) => {
|
|
3
3
|
for (const e in n)
|
|
4
4
|
t[e] = n[e];
|
|
5
5
|
return t;
|
|
6
|
-
},
|
|
7
|
-
function
|
|
6
|
+
}, Wt = "numeric", Ft = "ascii", Kt = "alpha", _ = "asciinumeric", K = "alphanumeric", _t = "domain", ge = "emoji", je = "scheme", Be = "slashscheme", Ut = "whitespace";
|
|
7
|
+
function ze(t, n) {
|
|
8
8
|
return t in n || (n[t] = []), n[t];
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
n[
|
|
10
|
+
function x(t, n, e) {
|
|
11
|
+
n[Wt] && (n[_] = !0, n[K] = !0), n[Ft] && (n[_] = !0, n[Kt] = !0), n[_] && (n[K] = !0), n[Kt] && (n[K] = !0), n[K] && (n[_t] = !0), n[ge] && (n[_t] = !0);
|
|
12
12
|
for (const o in n) {
|
|
13
|
-
const s =
|
|
13
|
+
const s = ze(o, e);
|
|
14
14
|
s.indexOf(t) < 0 && s.push(t);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function We(t, n) {
|
|
18
18
|
const e = {};
|
|
19
19
|
for (const o in n)
|
|
20
20
|
n[o].indexOf(t) >= 0 && (e[o] = !0);
|
|
21
21
|
return e;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function R(t = null) {
|
|
24
24
|
this.j = {}, this.jr = [], this.jd = null, this.t = t;
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
R.groups = {};
|
|
27
|
+
R.prototype = {
|
|
28
28
|
accepts() {
|
|
29
29
|
return !!this.t;
|
|
30
30
|
},
|
|
@@ -77,9 +77,9 @@ C.prototype = {
|
|
|
77
77
|
* @returns {State<T>} taken after the given input
|
|
78
78
|
*/
|
|
79
79
|
tr(t, n, e, o) {
|
|
80
|
-
o = o ||
|
|
80
|
+
o = o || R.groups;
|
|
81
81
|
let s;
|
|
82
|
-
return n && n.j ? s = n : (s = new
|
|
82
|
+
return n && n.j ? s = n : (s = new R(n), e && o && x(n, e, o)), this.jr.push([t, s]), s;
|
|
83
83
|
},
|
|
84
84
|
/**
|
|
85
85
|
* Short for "take transitions", will take as many sequential transitions as
|
|
@@ -127,156 +127,156 @@ C.prototype = {
|
|
|
127
127
|
* @returns {State<T>} taken after the given input
|
|
128
128
|
*/
|
|
129
129
|
tt(t, n, e, o) {
|
|
130
|
-
o = o ||
|
|
130
|
+
o = o || R.groups;
|
|
131
131
|
const s = this;
|
|
132
132
|
if (n && n.j)
|
|
133
133
|
return s.j[t] = n, n;
|
|
134
134
|
const i = n;
|
|
135
135
|
let a, l = s.go(t);
|
|
136
|
-
if (l ? (a = new
|
|
136
|
+
if (l ? (a = new R(), B(a.j, l.j), a.jr.push.apply(a.jr, l.jr), a.jd = l.jd, a.t = l.t) : a = new R(), i) {
|
|
137
137
|
if (o)
|
|
138
138
|
if (a.t && typeof a.t == "string") {
|
|
139
|
-
const h = B(
|
|
140
|
-
|
|
141
|
-
} else e &&
|
|
139
|
+
const h = B(We(a.t, o), e);
|
|
140
|
+
x(i, h, o);
|
|
141
|
+
} else e && x(i, e, o);
|
|
142
142
|
a.t = i;
|
|
143
143
|
}
|
|
144
144
|
return s.j[t] = a, a;
|
|
145
145
|
}
|
|
146
146
|
};
|
|
147
|
-
const u = (t, n, e, o, s) => t.ta(n, e, o, s), A = (t, n, e, o, s) => t.tr(n, e, o, s),
|
|
148
|
-
var
|
|
147
|
+
const u = (t, n, e, o, s) => t.ta(n, e, o, s), A = (t, n, e, o, s) => t.tr(n, e, o, s), ue = (t, n, e, o, s) => t.ts(n, e, o, s), r = (t, n, e, o, s) => t.tt(n, e, o, s), w = "WORD", Gt = "UWORD", Ae = "ASCIINUMERICAL", Le = "ALPHANUMERICAL", J = "LOCALHOST", $t = "TLD", Qt = "UTLD", nt = "SCHEME", j = "SLASH_SCHEME", Yt = "NUM", qt = "WS", Xt = "NL", G = "OPENBRACE", $ = "CLOSEBRACE", ot = "OPENBRACKET", st = "CLOSEBRACKET", rt = "OPENPAREN", it = "CLOSEPAREN", at = "OPENANGLEBRACKET", lt = "CLOSEANGLEBRACKET", ct = "FULLWIDTHLEFTPAREN", ut = "FULLWIDTHRIGHTPAREN", dt = "LEFTCORNERBRACKET", ht = "RIGHTCORNERBRACKET", ft = "LEFTWHITECORNERBRACKET", pt = "RIGHTWHITECORNERBRACKET", mt = "FULLWIDTHLESSTHAN", Et = "FULLWIDTHGREATERTHAN", gt = "AMPERSAND", At = "APOSTROPHE", Lt = "ASTERISK", v = "AT", kt = "BACKSLASH", Tt = "BACKTICK", Ct = "CARET", D = "COLON", Zt = "COMMA", Rt = "DOLLAR", b = "DOT", yt = "EQUALS", te = "EXCLAMATION", S = "HYPHEN", Q = "PERCENT", Ot = "PIPE", St = "PLUS", bt = "POUND", q = "QUERY", ee = "QUOTE", ke = "FULLWIDTHMIDDLEDOT", ne = "SEMI", P = "SLASH", V = "TILDE", Pt = "UNDERSCORE", Te = "EMOJI", Nt = "SYM";
|
|
148
|
+
var Ce = /* @__PURE__ */ Object.freeze({
|
|
149
149
|
__proto__: null,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
NL: Yt,
|
|
162
|
-
OPENBRACE: $,
|
|
163
|
-
CLOSEBRACE: Q,
|
|
164
|
-
OPENBRACKET: ot,
|
|
150
|
+
ALPHANUMERICAL: Le,
|
|
151
|
+
AMPERSAND: gt,
|
|
152
|
+
APOSTROPHE: At,
|
|
153
|
+
ASCIINUMERICAL: Ae,
|
|
154
|
+
ASTERISK: Lt,
|
|
155
|
+
AT: v,
|
|
156
|
+
BACKSLASH: kt,
|
|
157
|
+
BACKTICK: Tt,
|
|
158
|
+
CARET: Ct,
|
|
159
|
+
CLOSEANGLEBRACKET: lt,
|
|
160
|
+
CLOSEBRACE: $,
|
|
165
161
|
CLOSEBRACKET: st,
|
|
166
|
-
OPENPAREN: rt,
|
|
167
162
|
CLOSEPAREN: it,
|
|
168
|
-
|
|
169
|
-
|
|
163
|
+
COLON: D,
|
|
164
|
+
COMMA: Zt,
|
|
165
|
+
DOLLAR: Rt,
|
|
166
|
+
DOT: b,
|
|
167
|
+
EMOJI: Te,
|
|
168
|
+
EQUALS: yt,
|
|
169
|
+
EXCLAMATION: te,
|
|
170
|
+
FULLWIDTHGREATERTHAN: Et,
|
|
170
171
|
FULLWIDTHLEFTPAREN: ct,
|
|
172
|
+
FULLWIDTHLESSTHAN: mt,
|
|
173
|
+
FULLWIDTHMIDDLEDOT: ke,
|
|
171
174
|
FULLWIDTHRIGHTPAREN: ut,
|
|
175
|
+
HYPHEN: S,
|
|
172
176
|
LEFTCORNERBRACKET: dt,
|
|
173
|
-
RIGHTCORNERBRACKET: ht,
|
|
174
177
|
LEFTWHITECORNERBRACKET: ft,
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
COLON: U,
|
|
186
|
-
COMMA: Zt,
|
|
187
|
-
DOLLAR: yt,
|
|
188
|
-
DOT: S,
|
|
189
|
-
EQUALS: Ct,
|
|
190
|
-
EXCLAMATION: te,
|
|
191
|
-
HYPHEN: b,
|
|
192
|
-
PERCENT: _,
|
|
193
|
-
PIPE: Rt,
|
|
194
|
-
PLUS: Ot,
|
|
178
|
+
LOCALHOST: J,
|
|
179
|
+
NL: Xt,
|
|
180
|
+
NUM: Yt,
|
|
181
|
+
OPENANGLEBRACKET: at,
|
|
182
|
+
OPENBRACE: G,
|
|
183
|
+
OPENBRACKET: ot,
|
|
184
|
+
OPENPAREN: rt,
|
|
185
|
+
PERCENT: Q,
|
|
186
|
+
PIPE: Ot,
|
|
187
|
+
PLUS: St,
|
|
195
188
|
POUND: bt,
|
|
196
189
|
QUERY: q,
|
|
197
190
|
QUOTE: ee,
|
|
198
|
-
|
|
191
|
+
RIGHTCORNERBRACKET: ht,
|
|
192
|
+
RIGHTWHITECORNERBRACKET: pt,
|
|
193
|
+
SCHEME: nt,
|
|
199
194
|
SEMI: ne,
|
|
200
195
|
SLASH: P,
|
|
196
|
+
SLASH_SCHEME: j,
|
|
197
|
+
SYM: Nt,
|
|
201
198
|
TILDE: V,
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
199
|
+
TLD: $t,
|
|
200
|
+
UNDERSCORE: Pt,
|
|
201
|
+
UTLD: Qt,
|
|
202
|
+
UWORD: Gt,
|
|
203
|
+
WORD: w,
|
|
204
|
+
WS: qt
|
|
205
205
|
});
|
|
206
|
-
const N = /[a-z]/, F = new RegExp("\\p{L}", "u"), xt = new RegExp("\\p{Emoji}", "u"), I = /\d/,
|
|
207
|
-
`,
|
|
206
|
+
const N = /[a-z]/, F = new RegExp("\\p{L}", "u"), xt = new RegExp("\\p{Emoji}", "u"), I = /\d/, Mt = /\s/, de = "\r", jt = `
|
|
207
|
+
`, Fe = "️", Ke = "", Bt = "";
|
|
208
208
|
let Z = null, tt = null;
|
|
209
|
-
function
|
|
209
|
+
function _e(t = []) {
|
|
210
210
|
const n = {};
|
|
211
|
-
|
|
212
|
-
const e = new
|
|
213
|
-
Z == null && (Z =
|
|
214
|
-
const o = A(e, I,
|
|
215
|
-
[
|
|
211
|
+
R.groups = n;
|
|
212
|
+
const e = new R();
|
|
213
|
+
Z == null && (Z = he(xe)), tt == null && (tt = he(Me)), r(e, "'", At), r(e, "{", G), r(e, "}", $), r(e, "[", ot), r(e, "]", st), r(e, "(", rt), r(e, ")", it), r(e, "<", at), r(e, ">", lt), r(e, "(", ct), r(e, ")", ut), r(e, "「", dt), r(e, "」", ht), r(e, "『", ft), r(e, "』", pt), r(e, "<", mt), r(e, ">", Et), r(e, "&", gt), r(e, "*", Lt), r(e, "@", v), r(e, "`", Tt), r(e, "^", Ct), r(e, ":", D), r(e, ",", Zt), r(e, "$", Rt), r(e, ".", b), r(e, "=", yt), r(e, "!", te), r(e, "-", S), r(e, "%", Q), r(e, "|", Ot), r(e, "+", St), r(e, "#", bt), r(e, "?", q), r(e, '"', ee), r(e, "/", P), r(e, ";", ne), r(e, "~", V), r(e, "_", Pt), r(e, "\\", kt), r(e, "・", ke);
|
|
214
|
+
const o = A(e, I, Yt, {
|
|
215
|
+
[Wt]: !0
|
|
216
216
|
});
|
|
217
217
|
A(o, I, o);
|
|
218
|
-
const s = A(o, N,
|
|
219
|
-
[
|
|
220
|
-
}), i = A(o, F,
|
|
218
|
+
const s = A(o, N, Ae, {
|
|
219
|
+
[_]: !0
|
|
220
|
+
}), i = A(o, F, Le, {
|
|
221
221
|
[K]: !0
|
|
222
222
|
}), a = A(e, N, w, {
|
|
223
|
-
[
|
|
223
|
+
[Ft]: !0
|
|
224
224
|
});
|
|
225
225
|
A(a, I, s), A(a, N, a), A(s, I, s), A(s, N, s);
|
|
226
226
|
const l = A(e, F, Gt, {
|
|
227
|
-
[
|
|
227
|
+
[Kt]: !0
|
|
228
228
|
});
|
|
229
229
|
A(l, N), A(l, I, i), A(l, F, l), A(i, I, i), A(i, N), A(i, F, i);
|
|
230
|
-
const h = r(e,
|
|
230
|
+
const h = r(e, jt, Xt, {
|
|
231
231
|
[Ut]: !0
|
|
232
|
-
}), c = r(e,
|
|
232
|
+
}), c = r(e, de, qt, {
|
|
233
233
|
[Ut]: !0
|
|
234
|
-
}), f = A(e,
|
|
234
|
+
}), f = A(e, Mt, qt, {
|
|
235
235
|
[Ut]: !0
|
|
236
236
|
});
|
|
237
|
-
r(e,
|
|
238
|
-
const d = A(e, xt,
|
|
237
|
+
r(e, Bt, f), r(c, jt, h), r(c, Bt, f), A(c, Mt, f), r(f, de), r(f, jt), A(f, Mt, f), r(f, Bt, f);
|
|
238
|
+
const d = A(e, xt, Te, {
|
|
239
239
|
[ge]: !0
|
|
240
240
|
});
|
|
241
|
-
r(d, "#"), A(d, xt, d), r(d,
|
|
242
|
-
const m = r(d,
|
|
241
|
+
r(d, "#"), A(d, xt, d), r(d, Fe, d);
|
|
242
|
+
const m = r(d, Ke);
|
|
243
243
|
r(m, "#"), A(m, xt, d);
|
|
244
|
-
const E = [[N, a], [I, s]],
|
|
244
|
+
const E = [[N, a], [I, s]], y = [[N, null], [F, l], [I, i]];
|
|
245
245
|
for (let L = 0; L < Z.length; L++)
|
|
246
|
-
|
|
246
|
+
H(e, Z[L], $t, w, E);
|
|
247
247
|
for (let L = 0; L < tt.length; L++)
|
|
248
|
-
|
|
249
|
-
|
|
248
|
+
H(e, tt[L], Qt, Gt, y);
|
|
249
|
+
x($t, {
|
|
250
250
|
tld: !0,
|
|
251
251
|
ascii: !0
|
|
252
|
-
}, n),
|
|
252
|
+
}, n), x(Qt, {
|
|
253
253
|
utld: !0,
|
|
254
254
|
alpha: !0
|
|
255
|
-
}, n),
|
|
255
|
+
}, n), H(e, "file", nt, w, E), H(e, "mailto", nt, w, E), H(e, "http", j, w, E), H(e, "https", j, w, E), H(e, "ftp", j, w, E), H(e, "ftps", j, w, E), x(nt, {
|
|
256
256
|
scheme: !0,
|
|
257
257
|
ascii: !0
|
|
258
|
-
}, n),
|
|
258
|
+
}, n), x(j, {
|
|
259
259
|
slashscheme: !0,
|
|
260
260
|
ascii: !0
|
|
261
261
|
}, n), t = t.sort((L, T) => L[0] > T[0] ? 1 : -1);
|
|
262
262
|
for (let L = 0; L < t.length; L++) {
|
|
263
263
|
const T = t[L][0], k = t[L][1] ? {
|
|
264
|
-
[Me]: !0
|
|
265
|
-
} : {
|
|
266
264
|
[je]: !0
|
|
265
|
+
} : {
|
|
266
|
+
[Be]: !0
|
|
267
267
|
};
|
|
268
|
-
T.indexOf("-") >= 0 ? k[
|
|
268
|
+
T.indexOf("-") >= 0 ? k[_t] = !0 : N.test(T) ? I.test(T) ? k[_] = !0 : k[Ft] = !0 : k[Wt] = !0, ue(e, T, T, k);
|
|
269
269
|
}
|
|
270
|
-
return
|
|
270
|
+
return ue(e, "localhost", J, {
|
|
271
271
|
ascii: !0
|
|
272
|
-
}), e.jd = new
|
|
272
|
+
}), e.jd = new R(Nt), {
|
|
273
273
|
start: e,
|
|
274
274
|
tokens: B({
|
|
275
275
|
groups: n
|
|
276
|
-
},
|
|
276
|
+
}, Ce)
|
|
277
277
|
};
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function Re(t, n) {
|
|
280
280
|
const e = Ge(n.replace(/[A-Z]/g, (l) => l.toLowerCase())), o = e.length, s = [];
|
|
281
281
|
let i = 0, a = 0;
|
|
282
282
|
for (; a < o; ) {
|
|
@@ -305,16 +305,16 @@ function Ge(t) {
|
|
|
305
305
|
}
|
|
306
306
|
return n;
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function H(t, n, e, o, s) {
|
|
309
309
|
let i;
|
|
310
310
|
const a = n.length;
|
|
311
311
|
for (let l = 0; l < a - 1; l++) {
|
|
312
312
|
const h = n[l];
|
|
313
|
-
t.j[h] ? i = t.j[h] : (i = new
|
|
313
|
+
t.j[h] ? i = t.j[h] : (i = new R(o), i.jr = s.slice(), t.j[h] = i), t = i;
|
|
314
314
|
}
|
|
315
|
-
return i = new
|
|
315
|
+
return i = new R(e), i.jr = s.slice(), t.j[n[a - 1]] = i, i;
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function he(t) {
|
|
318
318
|
const n = [], e = [];
|
|
319
319
|
let o = 0, s = "0123456789";
|
|
320
320
|
for (; o < t.length; ) {
|
|
@@ -334,8 +334,8 @@ function de(t) {
|
|
|
334
334
|
const Y = {
|
|
335
335
|
defaultProtocol: "http",
|
|
336
336
|
events: null,
|
|
337
|
-
format:
|
|
338
|
-
formatHref:
|
|
337
|
+
format: fe,
|
|
338
|
+
formatHref: fe,
|
|
339
339
|
nl2br: !1,
|
|
340
340
|
tagName: "a",
|
|
341
341
|
target: null,
|
|
@@ -417,13 +417,13 @@ oe.prototype = {
|
|
|
417
417
|
return (this.get("render", null, t) || this.defaultRender)(n, t.t, t);
|
|
418
418
|
}
|
|
419
419
|
};
|
|
420
|
-
function
|
|
420
|
+
function fe(t) {
|
|
421
421
|
return t;
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function ye(t, n) {
|
|
424
424
|
this.t = "token", this.v = t, this.tk = n;
|
|
425
425
|
}
|
|
426
|
-
|
|
426
|
+
ye.prototype = {
|
|
427
427
|
isLink: !1,
|
|
428
428
|
/**
|
|
429
429
|
* Return the string this token represents.
|
|
@@ -527,8 +527,8 @@ Ce.prototype = {
|
|
|
527
527
|
};
|
|
528
528
|
}
|
|
529
529
|
};
|
|
530
|
-
function
|
|
531
|
-
class e extends
|
|
530
|
+
function It(t, n) {
|
|
531
|
+
class e extends ye {
|
|
532
532
|
constructor(s, i) {
|
|
533
533
|
super(s, i), this.t = t;
|
|
534
534
|
}
|
|
@@ -537,12 +537,12 @@ function Nt(t, n) {
|
|
|
537
537
|
e.prototype[o] = n[o];
|
|
538
538
|
return e.t = t, e;
|
|
539
539
|
}
|
|
540
|
-
const
|
|
540
|
+
const pe = It("email", {
|
|
541
541
|
isLink: !0,
|
|
542
542
|
toHref() {
|
|
543
543
|
return "mailto:" + this.toString();
|
|
544
544
|
}
|
|
545
|
-
}),
|
|
545
|
+
}), me = It("text"), $e = It("nl"), et = It("url", {
|
|
546
546
|
isLink: !0,
|
|
547
547
|
/**
|
|
548
548
|
Lowercases relevant parts of the domain and adds the protocol if
|
|
@@ -560,42 +560,42 @@ const fe = Nt("email", {
|
|
|
560
560
|
*/
|
|
561
561
|
hasProtocol() {
|
|
562
562
|
const t = this.tk;
|
|
563
|
-
return t.length >= 2 && t[0].t !== J && t[1].t ===
|
|
563
|
+
return t.length >= 2 && t[0].t !== J && t[1].t === D;
|
|
564
564
|
}
|
|
565
|
-
}), O = (t) => new
|
|
565
|
+
}), O = (t) => new R(t);
|
|
566
566
|
function Qe({
|
|
567
567
|
groups: t
|
|
568
568
|
}) {
|
|
569
|
-
const n = t.domain.concat([
|
|
569
|
+
const n = t.domain.concat([gt, Lt, v, kt, Tt, Ct, Rt, yt, S, Yt, Q, Ot, St, bt, P, Nt, V, Pt]), e = [At, D, Zt, b, te, Q, q, ee, ne, at, lt, G, $, st, ot, rt, it, ct, ut, dt, ht, ft, pt, mt, Et], o = [gt, At, Lt, kt, Tt, Ct, Rt, yt, S, G, $, Q, Ot, St, bt, q, P, Nt, V, Pt], s = O(), i = r(s, V);
|
|
570
570
|
u(i, o, i), u(i, t.domain, i);
|
|
571
571
|
const a = O(), l = O(), h = O();
|
|
572
572
|
u(s, t.domain, a), u(s, t.scheme, l), u(s, t.slashscheme, h), u(a, o, i), u(a, t.domain, a);
|
|
573
|
-
const c = r(a,
|
|
574
|
-
r(i,
|
|
575
|
-
const f = r(i,
|
|
573
|
+
const c = r(a, v);
|
|
574
|
+
r(i, v, c), r(l, v, c), r(h, v, c);
|
|
575
|
+
const f = r(i, b);
|
|
576
576
|
u(f, o, i), u(f, t.domain, i);
|
|
577
577
|
const d = O();
|
|
578
578
|
u(c, t.domain, d), u(d, t.domain, d);
|
|
579
|
-
const m = r(d,
|
|
579
|
+
const m = r(d, b);
|
|
580
580
|
u(m, t.domain, d);
|
|
581
|
-
const E = O(
|
|
581
|
+
const E = O(pe);
|
|
582
582
|
u(m, t.tld, E), u(m, t.utld, E), r(c, J, E);
|
|
583
|
-
const
|
|
584
|
-
r(
|
|
585
|
-
const L = r(E,
|
|
586
|
-
u(L, t.numeric,
|
|
587
|
-
const T = r(a,
|
|
588
|
-
r(T,
|
|
583
|
+
const y = r(d, S);
|
|
584
|
+
r(y, S, y), u(y, t.domain, d), u(E, t.domain, d), r(E, b, m), r(E, S, y);
|
|
585
|
+
const L = r(E, D);
|
|
586
|
+
u(L, t.numeric, pe);
|
|
587
|
+
const T = r(a, S), p = r(a, b);
|
|
588
|
+
r(T, S, T), u(T, t.domain, a), u(p, o, i), u(p, t.domain, a);
|
|
589
589
|
const k = O(et);
|
|
590
|
-
u(p, t.tld, k), u(p, t.utld, k), u(k, t.domain, a), u(k, o, i), r(k,
|
|
591
|
-
const
|
|
592
|
-
u(
|
|
593
|
-
const
|
|
594
|
-
u(
|
|
595
|
-
const
|
|
596
|
-
u(l, t.domain, a), r(l,
|
|
597
|
-
const
|
|
598
|
-
[
|
|
590
|
+
u(p, t.tld, k), u(p, t.utld, k), u(k, t.domain, a), u(k, o, i), r(k, b, p), r(k, S, T), r(k, v, c);
|
|
591
|
+
const Se = r(k, D), ie = O(et);
|
|
592
|
+
u(Se, t.numeric, ie);
|
|
593
|
+
const C = O(et), z = O();
|
|
594
|
+
u(C, n, C), u(C, e, z), u(z, n, C), u(z, e, z), r(k, P, C), r(ie, P, C);
|
|
595
|
+
const wt = r(l, D), be = r(h, D), Pe = r(be, P), Ht = r(Pe, P);
|
|
596
|
+
u(l, t.domain, a), r(l, b, p), r(l, S, T), u(h, t.domain, a), r(h, b, p), r(h, S, T), u(wt, t.domain, C), r(wt, P, C), r(wt, q, C), u(Ht, t.domain, C), u(Ht, n, C), r(Ht, P, C);
|
|
597
|
+
const ae = [
|
|
598
|
+
[G, $],
|
|
599
599
|
// {}
|
|
600
600
|
[ot, st],
|
|
601
601
|
// []
|
|
@@ -609,23 +609,23 @@ function Qe({
|
|
|
609
609
|
// 「」
|
|
610
610
|
[ft, pt],
|
|
611
611
|
// 『』
|
|
612
|
-
[mt,
|
|
612
|
+
[mt, Et]
|
|
613
613
|
// <>
|
|
614
614
|
];
|
|
615
|
-
for (let vt = 0; vt <
|
|
616
|
-
const [
|
|
617
|
-
r(z,
|
|
615
|
+
for (let vt = 0; vt < ae.length; vt++) {
|
|
616
|
+
const [le, Dt] = ae[vt], X = r(C, le);
|
|
617
|
+
r(z, le, X), r(X, Dt, C);
|
|
618
618
|
const M = O(et);
|
|
619
619
|
u(X, n, M);
|
|
620
620
|
const W = O();
|
|
621
|
-
u(X, e), u(M, n, M), u(M, e, W), u(W, n, M), u(W, e, W), r(M,
|
|
621
|
+
u(X, e), u(M, n, M), u(M, e, W), u(W, n, M), u(W, e, W), r(M, Dt, C), r(W, Dt, C);
|
|
622
622
|
}
|
|
623
|
-
return r(s, J, k), r(s,
|
|
623
|
+
return r(s, J, k), r(s, Xt, $e), {
|
|
624
624
|
start: s,
|
|
625
|
-
tokens:
|
|
625
|
+
tokens: Ce
|
|
626
626
|
};
|
|
627
627
|
}
|
|
628
|
-
function
|
|
628
|
+
function qe(t, n, e) {
|
|
629
629
|
let o = e.length, s = 0, i = [], a = [];
|
|
630
630
|
for (; s < o; ) {
|
|
631
631
|
let l = t, h = null, c = null, f = 0, d = null, m = -1;
|
|
@@ -636,19 +636,19 @@ function _e(t, n, e) {
|
|
|
636
636
|
if (m < 0)
|
|
637
637
|
s -= f, s < o && (a.push(e[s]), s++);
|
|
638
638
|
else {
|
|
639
|
-
a.length > 0 && (i.push(
|
|
640
|
-
const E = d.t,
|
|
641
|
-
i.push(
|
|
639
|
+
a.length > 0 && (i.push(zt(me, n, a)), a = []), s -= m, f -= m;
|
|
640
|
+
const E = d.t, y = e.slice(s - f, s);
|
|
641
|
+
i.push(zt(E, n, y));
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
|
-
return a.length > 0 && i.push(
|
|
644
|
+
return a.length > 0 && i.push(zt(me, n, a)), i;
|
|
645
645
|
}
|
|
646
|
-
function
|
|
646
|
+
function zt(t, n, e) {
|
|
647
647
|
const o = e[0].s, s = e[e.length - 1].e, i = n.slice(o, s);
|
|
648
648
|
return new t(i, e);
|
|
649
649
|
}
|
|
650
|
-
const
|
|
651
|
-
}),
|
|
650
|
+
const Ve = typeof console < "u" && console && console.warn || (() => {
|
|
651
|
+
}), Je = "until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.", g = {
|
|
652
652
|
scanner: null,
|
|
653
653
|
parser: null,
|
|
654
654
|
tokenQueue: [],
|
|
@@ -656,19 +656,19 @@ const qe = typeof console < "u" && console && console.warn || (() => {
|
|
|
656
656
|
customSchemes: [],
|
|
657
657
|
initialized: !1
|
|
658
658
|
};
|
|
659
|
-
function
|
|
660
|
-
return
|
|
659
|
+
function Ye() {
|
|
660
|
+
return R.groups = {}, g.scanner = null, g.parser = null, g.tokenQueue = [], g.pluginQueue = [], g.customSchemes = [], g.initialized = !1, g;
|
|
661
661
|
}
|
|
662
|
-
function
|
|
663
|
-
if (g.initialized &&
|
|
662
|
+
function Ee(t, n = !1) {
|
|
663
|
+
if (g.initialized && Ve(`linkifyjs: already initialized - will not register custom scheme "${t}" ${Je}`), !/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))
|
|
664
664
|
throw new Error(`linkifyjs: incorrect scheme format.
|
|
665
665
|
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
666
666
|
2. Cannot start or end with "-"
|
|
667
667
|
3. "-" cannot repeat`);
|
|
668
668
|
g.customSchemes.push([t, n]);
|
|
669
669
|
}
|
|
670
|
-
function
|
|
671
|
-
g.scanner =
|
|
670
|
+
function Xe() {
|
|
671
|
+
g.scanner = _e(g.customSchemes);
|
|
672
672
|
for (let t = 0; t < g.tokenQueue.length; t++)
|
|
673
673
|
g.tokenQueue[t][1]({
|
|
674
674
|
scanner: g.scanner
|
|
@@ -682,10 +682,10 @@ function Ye() {
|
|
|
682
682
|
return g.initialized = !0, g;
|
|
683
683
|
}
|
|
684
684
|
function se(t) {
|
|
685
|
-
return g.initialized ||
|
|
685
|
+
return g.initialized || Xe(), qe(g.parser.start, t, Re(g.scanner.start, t));
|
|
686
686
|
}
|
|
687
|
-
se.scan =
|
|
688
|
-
function
|
|
687
|
+
se.scan = Re;
|
|
688
|
+
function Oe(t, n = null, e = null) {
|
|
689
689
|
if (n && typeof n == "object") {
|
|
690
690
|
if (e)
|
|
691
691
|
throw Error(`linkifyjs: Invalid link type ${n}; must be a string`);
|
|
@@ -698,36 +698,45 @@ function Re(t, n = null, e = null) {
|
|
|
698
698
|
}
|
|
699
699
|
return i;
|
|
700
700
|
}
|
|
701
|
-
|
|
701
|
+
const re = "[\0- -\u2029 ]", Ze = new RegExp(re), tn = new RegExp(`${re}$`), en = new RegExp(re, "g");
|
|
702
|
+
function nn(t) {
|
|
702
703
|
return t.length === 1 ? t[0].isLink : t.length === 3 && t[1].isLink ? ["()", "[]"].includes(t[0].value + t[2].value) : !1;
|
|
703
704
|
}
|
|
704
|
-
function
|
|
705
|
-
return new
|
|
706
|
-
key: new
|
|
705
|
+
function on(t) {
|
|
706
|
+
return new Vt({
|
|
707
|
+
key: new Jt("autolink"),
|
|
707
708
|
appendTransaction: (n, e, o) => {
|
|
708
709
|
const s = n.some((c) => c.docChanged) && !e.doc.eq(o.doc), i = n.some((c) => c.getMeta("preventAutolink"));
|
|
709
710
|
if (!s || i)
|
|
710
711
|
return;
|
|
711
|
-
const { tr: a } = o, l =
|
|
712
|
-
if (
|
|
712
|
+
const { tr: a } = o, l = we(e.doc, [...n]);
|
|
713
|
+
if (He(l).forEach(({ newRange: c }) => {
|
|
713
714
|
const f = ve(o.doc, c, (E) => E.isTextblock);
|
|
714
715
|
let d, m;
|
|
715
|
-
if (f.length > 1
|
|
716
|
-
|
|
716
|
+
if (f.length > 1)
|
|
717
|
+
d = f[0], m = o.doc.textBetween(d.pos, d.pos + d.node.nodeSize, void 0, " ");
|
|
718
|
+
else if (f.length) {
|
|
719
|
+
const E = o.doc.textBetween(c.from, c.to, " ", " ");
|
|
720
|
+
if (!tn.test(E))
|
|
721
|
+
return;
|
|
722
|
+
d = f[0], m = o.doc.textBetween(d.pos, c.to, void 0, " ");
|
|
723
|
+
}
|
|
724
|
+
if (d && m) {
|
|
725
|
+
const E = m.split(Ze).filter(Boolean);
|
|
717
726
|
if (E.length <= 0)
|
|
718
727
|
return !1;
|
|
719
|
-
const
|
|
720
|
-
if (!
|
|
728
|
+
const y = E[E.length - 1], L = d.pos + m.lastIndexOf(y);
|
|
729
|
+
if (!y)
|
|
721
730
|
return !1;
|
|
722
|
-
const T = se(
|
|
723
|
-
if (!
|
|
731
|
+
const T = se(y).map((p) => p.toObject(t.defaultProtocol));
|
|
732
|
+
if (!nn(T))
|
|
724
733
|
return !1;
|
|
725
734
|
T.filter((p) => p.isLink).map((p) => ({
|
|
726
735
|
...p,
|
|
727
736
|
from: L + p.start + 1,
|
|
728
737
|
to: L + p.end + 1
|
|
729
738
|
})).filter((p) => o.schema.marks.code ? !o.doc.rangeHasMark(p.from, p.to, o.schema.marks.code) : !0).filter((p) => t.validate(p.value)).filter((p) => t.shouldAutoLink(p.value)).forEach((p) => {
|
|
730
|
-
|
|
739
|
+
De(p.from, p.to, o.doc).some((k) => k.mark.type === t.type) || a.addMark(p.from, p.to, t.type.create({
|
|
731
740
|
href: p.href
|
|
732
741
|
}));
|
|
733
742
|
});
|
|
@@ -737,9 +746,9 @@ function Ze(t) {
|
|
|
737
746
|
}
|
|
738
747
|
});
|
|
739
748
|
}
|
|
740
|
-
function
|
|
741
|
-
return new
|
|
742
|
-
key: new
|
|
749
|
+
function sn(t) {
|
|
750
|
+
return new Vt({
|
|
751
|
+
key: new Jt("handleClickLink"),
|
|
743
752
|
props: {
|
|
744
753
|
handleClick: (n, e, o) => {
|
|
745
754
|
var s, i;
|
|
@@ -757,9 +766,9 @@ function tn(t) {
|
|
|
757
766
|
}
|
|
758
767
|
});
|
|
759
768
|
}
|
|
760
|
-
function
|
|
761
|
-
return new
|
|
762
|
-
key: new
|
|
769
|
+
function rn(t) {
|
|
770
|
+
return new Vt({
|
|
771
|
+
key: new Jt("handlePasteLink"),
|
|
763
772
|
props: {
|
|
764
773
|
handlePaste: (n, e, o) => {
|
|
765
774
|
const { state: s } = n, { selection: i } = s, { empty: a } = i;
|
|
@@ -769,7 +778,7 @@ function en(t) {
|
|
|
769
778
|
o.content.forEach((c) => {
|
|
770
779
|
l += c.textContent;
|
|
771
780
|
});
|
|
772
|
-
const h =
|
|
781
|
+
const h = Oe(l, { defaultProtocol: t.defaultProtocol }).find((c) => c.isLink && c.value === l);
|
|
773
782
|
return !l || !h ? !1 : t.editor.commands.setMark(t.type, {
|
|
774
783
|
href: h.href
|
|
775
784
|
});
|
|
@@ -777,8 +786,7 @@ function en(t) {
|
|
|
777
786
|
}
|
|
778
787
|
});
|
|
779
788
|
}
|
|
780
|
-
|
|
781
|
-
function x(t, n) {
|
|
789
|
+
function U(t, n) {
|
|
782
790
|
const e = [
|
|
783
791
|
"http",
|
|
784
792
|
"https",
|
|
@@ -794,13 +802,13 @@ function x(t, n) {
|
|
|
794
802
|
return n && n.forEach((o) => {
|
|
795
803
|
const s = typeof o == "string" ? o : o.scheme;
|
|
796
804
|
s && e.push(s);
|
|
797
|
-
}), !t || t.replace(
|
|
805
|
+
}), !t || t.replace(en, "").match(new RegExp(
|
|
798
806
|
// eslint-disable-next-line no-useless-escape
|
|
799
807
|
`^(?:(?:${e.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,
|
|
800
808
|
"i"
|
|
801
809
|
));
|
|
802
810
|
}
|
|
803
|
-
const
|
|
811
|
+
const an = Ne.create({
|
|
804
812
|
name: "link",
|
|
805
813
|
priority: 1e3,
|
|
806
814
|
keepOnSplit: !1,
|
|
@@ -808,14 +816,14 @@ const on = Pe.create({
|
|
|
808
816
|
onCreate() {
|
|
809
817
|
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((t) => {
|
|
810
818
|
if (typeof t == "string") {
|
|
811
|
-
|
|
819
|
+
Ee(t);
|
|
812
820
|
return;
|
|
813
821
|
}
|
|
814
|
-
|
|
822
|
+
Ee(t.scheme, t.optionalSlashes);
|
|
815
823
|
});
|
|
816
824
|
},
|
|
817
825
|
onDestroy() {
|
|
818
|
-
|
|
826
|
+
Ye();
|
|
819
827
|
},
|
|
820
828
|
inclusive() {
|
|
821
829
|
return this.options.autolink;
|
|
@@ -832,7 +840,7 @@ const on = Pe.create({
|
|
|
832
840
|
rel: "noopener noreferrer nofollow",
|
|
833
841
|
class: null
|
|
834
842
|
},
|
|
835
|
-
isAllowedUri: (t, n) => !!
|
|
843
|
+
isAllowedUri: (t, n) => !!U(t, n.protocols),
|
|
836
844
|
validate: (t) => !!t,
|
|
837
845
|
shouldAutoLink: (t) => !!t
|
|
838
846
|
};
|
|
@@ -863,7 +871,7 @@ const on = Pe.create({
|
|
|
863
871
|
getAttrs: (t) => {
|
|
864
872
|
const n = t.getAttribute("href");
|
|
865
873
|
return !n || !this.options.isAllowedUri(n, {
|
|
866
|
-
defaultValidate: (e) => !!
|
|
874
|
+
defaultValidate: (e) => !!U(e, this.options.protocols),
|
|
867
875
|
protocols: this.options.protocols,
|
|
868
876
|
defaultProtocol: this.options.defaultProtocol
|
|
869
877
|
}) ? !1 : null;
|
|
@@ -873,12 +881,12 @@ const on = Pe.create({
|
|
|
873
881
|
},
|
|
874
882
|
renderHTML({ HTMLAttributes: t }) {
|
|
875
883
|
return this.options.isAllowedUri(t.href, {
|
|
876
|
-
defaultValidate: (n) => !!
|
|
884
|
+
defaultValidate: (n) => !!U(n, this.options.protocols),
|
|
877
885
|
protocols: this.options.protocols,
|
|
878
886
|
defaultProtocol: this.options.defaultProtocol
|
|
879
|
-
}) ? ["a",
|
|
887
|
+
}) ? ["a", ce(this.options.HTMLAttributes, t), 0] : [
|
|
880
888
|
"a",
|
|
881
|
-
|
|
889
|
+
ce(this.options.HTMLAttributes, { ...t, href: "" }),
|
|
882
890
|
0
|
|
883
891
|
];
|
|
884
892
|
},
|
|
@@ -887,7 +895,7 @@ const on = Pe.create({
|
|
|
887
895
|
setLink: (t) => ({ chain: n }) => {
|
|
888
896
|
const { href: e } = t;
|
|
889
897
|
return this.options.isAllowedUri(e, {
|
|
890
|
-
defaultValidate: (o) => !!
|
|
898
|
+
defaultValidate: (o) => !!U(o, this.options.protocols),
|
|
891
899
|
protocols: this.options.protocols,
|
|
892
900
|
defaultProtocol: this.options.defaultProtocol
|
|
893
901
|
}) ? n().setMark(this.name, t).setMeta("preventAutolink", !0).run() : !1;
|
|
@@ -895,7 +903,7 @@ const on = Pe.create({
|
|
|
895
903
|
toggleLink: (t) => ({ chain: n }) => {
|
|
896
904
|
const { href: e } = t;
|
|
897
905
|
return this.options.isAllowedUri(e, {
|
|
898
|
-
defaultValidate: (o) => !!
|
|
906
|
+
defaultValidate: (o) => !!U(o, this.options.protocols),
|
|
899
907
|
protocols: this.options.protocols,
|
|
900
908
|
defaultProtocol: this.options.defaultProtocol
|
|
901
909
|
}) ? n().toggleMark(this.name, t, { extendEmptyMarkRange: !0 }).setMeta("preventAutolink", !0).run() : !1;
|
|
@@ -905,12 +913,12 @@ const on = Pe.create({
|
|
|
905
913
|
},
|
|
906
914
|
addPasteRules() {
|
|
907
915
|
return [
|
|
908
|
-
|
|
916
|
+
Ie({
|
|
909
917
|
find: (t) => {
|
|
910
918
|
const n = [];
|
|
911
919
|
if (t) {
|
|
912
|
-
const { protocols: e, defaultProtocol: o } = this.options, s =
|
|
913
|
-
defaultValidate: (a) => !!
|
|
920
|
+
const { protocols: e, defaultProtocol: o } = this.options, s = Oe(t).filter((i) => i.isLink && this.options.isAllowedUri(i.value, {
|
|
921
|
+
defaultValidate: (a) => !!U(a, e),
|
|
914
922
|
protocols: e,
|
|
915
923
|
defaultProtocol: o
|
|
916
924
|
}));
|
|
@@ -936,24 +944,24 @@ const on = Pe.create({
|
|
|
936
944
|
},
|
|
937
945
|
addProseMirrorPlugins() {
|
|
938
946
|
const t = [], { protocols: n, defaultProtocol: e } = this.options;
|
|
939
|
-
return this.options.autolink && t.push(
|
|
947
|
+
return this.options.autolink && t.push(on({
|
|
940
948
|
type: this.type,
|
|
941
949
|
defaultProtocol: this.options.defaultProtocol,
|
|
942
950
|
validate: (o) => this.options.isAllowedUri(o, {
|
|
943
|
-
defaultValidate: (s) => !!
|
|
951
|
+
defaultValidate: (s) => !!U(s, n),
|
|
944
952
|
protocols: n,
|
|
945
953
|
defaultProtocol: e
|
|
946
954
|
}),
|
|
947
955
|
shouldAutoLink: this.options.shouldAutoLink
|
|
948
|
-
})), this.options.openOnClick === !0 && t.push(
|
|
956
|
+
})), this.options.openOnClick === !0 && t.push(sn({
|
|
949
957
|
type: this.type
|
|
950
|
-
})), this.options.linkOnPaste && t.push(
|
|
958
|
+
})), this.options.linkOnPaste && t.push(rn({
|
|
951
959
|
editor: this.editor,
|
|
952
960
|
defaultProtocol: this.options.defaultProtocol,
|
|
953
961
|
type: this.type
|
|
954
962
|
})), t;
|
|
955
963
|
}
|
|
956
|
-
}),
|
|
964
|
+
}), cn = an.configure({
|
|
957
965
|
openOnClick: !1,
|
|
958
966
|
autolink: !0,
|
|
959
967
|
defaultProtocol: "https",
|
|
@@ -980,5 +988,5 @@ const on = Pe.create({
|
|
|
980
988
|
}
|
|
981
989
|
});
|
|
982
990
|
export {
|
|
983
|
-
|
|
991
|
+
cn as default
|
|
984
992
|
};
|