@opengis/form 0.1.32 → 0.1.33
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/README.md +61 -61
- package/dist/api/suggest/suggestions_list.json +7 -7
- package/dist/{index-Bh8_Wx51.js → index-B1zV9Aax.js} +477 -434
- package/dist/{index-DQur75TQ.js → index-B3op5uFx.js} +28 -29
- package/dist/index-BIES3-my.js +3085 -0
- package/dist/index-CkUvn8lm.js +153 -0
- package/dist/index-D49VHc9h.js +237 -0
- package/dist/{index-sa_Wbgbt.js → index-DOuvAvn1.js} +4131 -4129
- package/dist/index-DZ7xh8lh.js +50 -0
- package/dist/index-MfTTOwHR.js +89 -0
- package/dist/{index-CQZi4RyF.js → index-RwV1hx3A.js} +19 -21
- package/dist/{index-CMmJu2Ql.js → index-W4UOw8lU.js} +505 -428
- package/dist/index-pYkcVgEL.js +12134 -0
- package/dist/{index-DspmCbXc.js → index-qhd_7MCX.js} +20 -16
- package/dist/{index-DsT4tZvp.js → index-sFkGqyu8.js} +20 -16
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +86 -86
- package/dist/src/components/inputs/date/datepicker/Datepicker.vue.d.ts.map +1 -1
- package/dist/src/composables/useInputOptions.d.ts +2 -2
- package/dist/src/composables/useInputOptions.d.ts.map +1 -1
- package/dist/{vs-richtext-BJeMF-be.js → vs-richtext-DVj8X5Tr.js} +22 -22
- package/locales/en.json +39 -39
- package/locales/uk.json +39 -39
- package/package.json +93 -93
- package/dist/index-B9CEJ-PZ.js +0 -187
- package/dist/index-CHHagWDa.js +0 -2794
- package/dist/index-C_6bjz0U.js +0 -138
- package/dist/index-D3gVZYzr.js +0 -78
- package/dist/index-DJVijc0x.js +0 -47
- package/dist/index-z-RdtcIQ.js +0 -11862
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { M as Ie, a as me, m as ae, P as qt, d as Vt, p as Ne, q as He, r as xe, s as Me, u as De, v as Ue, b as je, I as
|
|
2
|
-
const Be = "aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",
|
|
3
|
-
function
|
|
1
|
+
import { M as Ie, a as me, m as ae, P as qt, d as Vt, p as Ne, q as He, r as xe, s as Me, u as De, v as Ue, b as je, I as _e } from "./index-pYkcVgEL.js";
|
|
2
|
+
const Be = "aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2", ze = "ελ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", Bt = "numeric", zt = "ascii", Wt = "alpha", K = "asciinumeric", W = "alphanumeric", Kt = "domain", ge = "emoji", We = "scheme", Ke = "slashscheme", xt = "whitespace";
|
|
3
|
+
function Fe(t, n) {
|
|
4
4
|
return t in n || (n[t] = []), n[t];
|
|
5
5
|
}
|
|
6
6
|
function M(t, n, e) {
|
|
7
|
-
n[Bt] && (n[
|
|
8
|
-
for (const
|
|
9
|
-
const
|
|
10
|
-
|
|
7
|
+
n[Bt] && (n[K] = !0, n[W] = !0), n[zt] && (n[K] = !0, n[Wt] = !0), n[K] && (n[W] = !0), n[Wt] && (n[W] = !0), n[W] && (n[Kt] = !0), n[ge] && (n[Kt] = !0);
|
|
8
|
+
for (const s in n) {
|
|
9
|
+
const o = Fe(s, e);
|
|
10
|
+
o.indexOf(t) < 0 && o.push(t);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function Ge(t, n) {
|
|
14
14
|
const e = {};
|
|
15
|
-
for (const
|
|
16
|
-
n[
|
|
15
|
+
for (const s in n)
|
|
16
|
+
n[s].indexOf(t) >= 0 && (e[s] = !0);
|
|
17
17
|
return e;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function R(t = null) {
|
|
20
20
|
this.j = {}, this.jr = [], this.jd = null, this.t = t;
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
R.groups = {};
|
|
23
|
+
R.prototype = {
|
|
24
24
|
accepts() {
|
|
25
25
|
return !!this.t;
|
|
26
26
|
},
|
|
@@ -34,10 +34,10 @@ T.prototype = {
|
|
|
34
34
|
const n = this, e = n.j[t];
|
|
35
35
|
if (e)
|
|
36
36
|
return e;
|
|
37
|
-
for (let
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
return
|
|
37
|
+
for (let s = 0; s < n.jr.length; s++) {
|
|
38
|
+
const o = n.jr[s][0], r = n.jr[s][1];
|
|
39
|
+
if (r && o.test(t))
|
|
40
|
+
return r;
|
|
41
41
|
}
|
|
42
42
|
return n.jd;
|
|
43
43
|
},
|
|
@@ -59,9 +59,9 @@ T.prototype = {
|
|
|
59
59
|
* @param {Flags} [flags] Collections flags to add token to
|
|
60
60
|
* @param {Collections<T>} [groups] Master list of token groups
|
|
61
61
|
*/
|
|
62
|
-
ta(t, n, e,
|
|
63
|
-
for (let
|
|
64
|
-
this.tt(t[
|
|
62
|
+
ta(t, n, e, s) {
|
|
63
|
+
for (let o = 0; o < t.length; o++)
|
|
64
|
+
this.tt(t[o], n, e, s);
|
|
65
65
|
},
|
|
66
66
|
/**
|
|
67
67
|
* Short for "take regexp transition"; defines a transition for this state
|
|
@@ -72,10 +72,10 @@ T.prototype = {
|
|
|
72
72
|
* @param {Collections<T>} [groups] Master list of token groups
|
|
73
73
|
* @returns {State<T>} taken after the given input
|
|
74
74
|
*/
|
|
75
|
-
tr(t, n, e,
|
|
76
|
-
|
|
77
|
-
let
|
|
78
|
-
return n && n.j ?
|
|
75
|
+
tr(t, n, e, s) {
|
|
76
|
+
s = s || R.groups;
|
|
77
|
+
let o;
|
|
78
|
+
return n && n.j ? o = n : (o = new R(n), e && s && M(n, e, s)), this.jr.push([t, o]), o;
|
|
79
79
|
},
|
|
80
80
|
/**
|
|
81
81
|
* Short for "take transitions", will take as many sequential transitions as
|
|
@@ -87,14 +87,14 @@ T.prototype = {
|
|
|
87
87
|
* @param {Collections<T>} [groups] Master list of token groups
|
|
88
88
|
* @returns {State<T>} taken after the given input
|
|
89
89
|
*/
|
|
90
|
-
ts(t, n, e,
|
|
91
|
-
let
|
|
92
|
-
const
|
|
93
|
-
if (!
|
|
94
|
-
return
|
|
95
|
-
for (let
|
|
96
|
-
|
|
97
|
-
return
|
|
90
|
+
ts(t, n, e, s) {
|
|
91
|
+
let o = this;
|
|
92
|
+
const r = t.length;
|
|
93
|
+
if (!r)
|
|
94
|
+
return o;
|
|
95
|
+
for (let i = 0; i < r - 1; i++)
|
|
96
|
+
o = o.tt(t[i]);
|
|
97
|
+
return o.tt(t[r - 1], n, e, s);
|
|
98
98
|
},
|
|
99
99
|
/**
|
|
100
100
|
* Short for "take transition", this is a method for building/working with
|
|
@@ -122,25 +122,25 @@ T.prototype = {
|
|
|
122
122
|
* @param {Collections<T>} [groups] Master list of groups
|
|
123
123
|
* @returns {State<T>} taken after the given input
|
|
124
124
|
*/
|
|
125
|
-
tt(t, n, e,
|
|
126
|
-
|
|
127
|
-
const
|
|
125
|
+
tt(t, n, e, s) {
|
|
126
|
+
s = s || R.groups;
|
|
127
|
+
const o = this;
|
|
128
128
|
if (n && n.j)
|
|
129
|
-
return
|
|
130
|
-
const
|
|
131
|
-
let
|
|
132
|
-
if (a ? (
|
|
133
|
-
if (
|
|
134
|
-
if (
|
|
135
|
-
const c = Object.assign(
|
|
136
|
-
M(
|
|
137
|
-
} else e && M(
|
|
138
|
-
|
|
129
|
+
return o.j[t] = n, n;
|
|
130
|
+
const r = n;
|
|
131
|
+
let i, a = o.go(t);
|
|
132
|
+
if (a ? (i = new R(), Object.assign(i.j, a.j), i.jr.push.apply(i.jr, a.jr), i.jd = a.jd, i.t = a.t) : i = new R(), r) {
|
|
133
|
+
if (s)
|
|
134
|
+
if (i.t && typeof i.t == "string") {
|
|
135
|
+
const c = Object.assign(Ge(i.t, s), e);
|
|
136
|
+
M(r, c, s);
|
|
137
|
+
} else e && M(r, e, s);
|
|
138
|
+
i.t = r;
|
|
139
139
|
}
|
|
140
|
-
return
|
|
140
|
+
return o.j[t] = i, i;
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
|
-
const d = (t, n, e,
|
|
143
|
+
const d = (t, n, e, s, o) => t.ta(n, e, s, o), k = (t, n, e, s, o) => t.tr(n, e, s, o), ce = (t, n, e, s, o) => t.ts(n, e, s, o), l = (t, n, e, s, o) => t.tt(n, e, s, o), N = "WORD", Ft = "UWORD", Ee = "ASCIINUMERICAL", Ae = "ALPHANUMERICAL", V = "LOCALHOST", Gt = "TLD", $t = "UTLD", et = "SCHEME", _ = "SLASH_SCHEME", Jt = "NUM", Qt = "WS", Yt = "NL", F = "OPENBRACE", G = "CLOSEBRACE", nt = "OPENBRACKET", st = "CLOSEBRACKET", ot = "OPENPAREN", it = "CLOSEPAREN", rt = "OPENANGLEBRACKET", lt = "CLOSEANGLEBRACKET", at = "FULLWIDTHLEFTPAREN", ct = "FULLWIDTHRIGHTPAREN", ut = "LEFTCORNERBRACKET", dt = "RIGHTCORNERBRACKET", ht = "LEFTWHITECORNERBRACKET", ft = "RIGHTWHITECORNERBRACKET", pt = "FULLWIDTHLESSTHAN", mt = "FULLWIDTHGREATERTHAN", gt = "AMPERSAND", Et = "APOSTROPHE", At = "ASTERISK", x = "AT", kt = "BACKSLASH", Lt = "BACKTICK", Tt = "CARET", D = "COLON", Xt = "COMMA", Rt = "DOLLAR", O = "DOT", Ct = "EQUALS", Zt = "EXCLAMATION", b = "HYPHEN", $ = "PERCENT", yt = "PIPE", bt = "PLUS", Ot = "POUND", Q = "QUERY", te = "QUOTE", ke = "FULLWIDTHMIDDLEDOT", ee = "SEMI", S = "SLASH", q = "TILDE", St = "UNDERSCORE", Le = "EMOJI", vt = "SYM";
|
|
144
144
|
var Te = /* @__PURE__ */ Object.freeze({
|
|
145
145
|
__proto__: null,
|
|
146
146
|
ALPHANUMERICAL: Ae,
|
|
@@ -148,18 +148,18 @@ var Te = /* @__PURE__ */ Object.freeze({
|
|
|
148
148
|
APOSTROPHE: Et,
|
|
149
149
|
ASCIINUMERICAL: Ee,
|
|
150
150
|
ASTERISK: At,
|
|
151
|
-
AT:
|
|
151
|
+
AT: x,
|
|
152
152
|
BACKSLASH: kt,
|
|
153
153
|
BACKTICK: Lt,
|
|
154
154
|
CARET: Tt,
|
|
155
155
|
CLOSEANGLEBRACKET: lt,
|
|
156
|
-
CLOSEBRACE:
|
|
157
|
-
CLOSEBRACKET:
|
|
156
|
+
CLOSEBRACE: G,
|
|
157
|
+
CLOSEBRACKET: st,
|
|
158
158
|
CLOSEPAREN: it,
|
|
159
159
|
COLON: D,
|
|
160
160
|
COMMA: Xt,
|
|
161
161
|
DOLLAR: Rt,
|
|
162
|
-
DOT:
|
|
162
|
+
DOT: O,
|
|
163
163
|
EMOJI: Le,
|
|
164
164
|
EQUALS: Ct,
|
|
165
165
|
EXCLAMATION: Zt,
|
|
@@ -168,104 +168,104 @@ var Te = /* @__PURE__ */ Object.freeze({
|
|
|
168
168
|
FULLWIDTHLESSTHAN: pt,
|
|
169
169
|
FULLWIDTHMIDDLEDOT: ke,
|
|
170
170
|
FULLWIDTHRIGHTPAREN: ct,
|
|
171
|
-
HYPHEN:
|
|
171
|
+
HYPHEN: b,
|
|
172
172
|
LEFTCORNERBRACKET: ut,
|
|
173
173
|
LEFTWHITECORNERBRACKET: ht,
|
|
174
174
|
LOCALHOST: V,
|
|
175
175
|
NL: Yt,
|
|
176
176
|
NUM: Jt,
|
|
177
177
|
OPENANGLEBRACKET: rt,
|
|
178
|
-
OPENBRACE:
|
|
178
|
+
OPENBRACE: F,
|
|
179
179
|
OPENBRACKET: nt,
|
|
180
|
-
OPENPAREN:
|
|
181
|
-
PERCENT:
|
|
180
|
+
OPENPAREN: ot,
|
|
181
|
+
PERCENT: $,
|
|
182
182
|
PIPE: yt,
|
|
183
|
-
PLUS:
|
|
184
|
-
POUND:
|
|
183
|
+
PLUS: bt,
|
|
184
|
+
POUND: Ot,
|
|
185
185
|
QUERY: Q,
|
|
186
186
|
QUOTE: te,
|
|
187
187
|
RIGHTCORNERBRACKET: dt,
|
|
188
188
|
RIGHTWHITECORNERBRACKET: ft,
|
|
189
189
|
SCHEME: et,
|
|
190
190
|
SEMI: ee,
|
|
191
|
-
SLASH:
|
|
192
|
-
SLASH_SCHEME:
|
|
193
|
-
SYM:
|
|
191
|
+
SLASH: S,
|
|
192
|
+
SLASH_SCHEME: _,
|
|
193
|
+
SYM: vt,
|
|
194
194
|
TILDE: q,
|
|
195
|
-
TLD:
|
|
196
|
-
UNDERSCORE:
|
|
197
|
-
UTLD:
|
|
198
|
-
UWORD:
|
|
199
|
-
WORD:
|
|
195
|
+
TLD: Gt,
|
|
196
|
+
UNDERSCORE: St,
|
|
197
|
+
UTLD: $t,
|
|
198
|
+
UWORD: Ft,
|
|
199
|
+
WORD: N,
|
|
200
200
|
WS: Qt
|
|
201
201
|
});
|
|
202
|
-
const
|
|
203
|
-
`,
|
|
202
|
+
const P = /[a-z]/, z = new RegExp("\\p{L}", "u"), Mt = new RegExp("\\p{Emoji}", "u"), w = /\d/, Dt = /\s/, ue = "\r", Ut = `
|
|
203
|
+
`, $e = "️", Qe = "", jt = "";
|
|
204
204
|
let X = null, Z = null;
|
|
205
205
|
function qe(t = []) {
|
|
206
206
|
const n = {};
|
|
207
|
-
|
|
208
|
-
const e = new
|
|
209
|
-
X == null && (X = de(Be)), Z == null && (Z = de(
|
|
210
|
-
const
|
|
207
|
+
R.groups = n;
|
|
208
|
+
const e = new R();
|
|
209
|
+
X == null && (X = de(Be)), Z == null && (Z = de(ze)), l(e, "'", Et), l(e, "{", F), l(e, "}", G), l(e, "[", nt), l(e, "]", st), l(e, "(", ot), l(e, ")", it), l(e, "<", rt), l(e, ">", lt), l(e, "(", at), l(e, ")", ct), l(e, "「", ut), l(e, "」", dt), l(e, "『", ht), l(e, "』", ft), l(e, "<", pt), l(e, ">", mt), l(e, "&", gt), l(e, "*", At), l(e, "@", x), l(e, "`", Lt), l(e, "^", Tt), l(e, ":", D), l(e, ",", Xt), l(e, "$", Rt), l(e, ".", O), l(e, "=", Ct), l(e, "!", Zt), l(e, "-", b), l(e, "%", $), l(e, "|", yt), l(e, "+", bt), l(e, "#", Ot), l(e, "?", Q), l(e, '"', te), l(e, "/", S), l(e, ";", ee), l(e, "~", q), l(e, "_", St), l(e, "\\", kt), l(e, "・", ke);
|
|
210
|
+
const s = k(e, w, Jt, {
|
|
211
211
|
[Bt]: !0
|
|
212
212
|
});
|
|
213
|
-
|
|
214
|
-
const
|
|
213
|
+
k(s, w, s);
|
|
214
|
+
const o = k(s, P, Ee, {
|
|
215
|
+
[K]: !0
|
|
216
|
+
}), r = k(s, z, Ae, {
|
|
215
217
|
[W]: !0
|
|
216
|
-
}), i =
|
|
217
|
-
[
|
|
218
|
-
}), r = A(e, S, I, {
|
|
219
|
-
[_t]: !0
|
|
218
|
+
}), i = k(e, P, N, {
|
|
219
|
+
[zt]: !0
|
|
220
220
|
});
|
|
221
|
-
|
|
222
|
-
const a =
|
|
223
|
-
[
|
|
221
|
+
k(i, w, o), k(i, P, i), k(o, w, o), k(o, P, o);
|
|
222
|
+
const a = k(e, z, Ft, {
|
|
223
|
+
[Wt]: !0
|
|
224
224
|
});
|
|
225
|
-
|
|
225
|
+
k(a, P), k(a, w, r), k(a, z, a), k(r, w, r), k(r, P), k(r, z, r);
|
|
226
226
|
const c = l(e, Ut, Yt, {
|
|
227
227
|
[xt]: !0
|
|
228
|
-
}),
|
|
228
|
+
}), u = l(e, ue, Qt, {
|
|
229
229
|
[xt]: !0
|
|
230
|
-
}),
|
|
230
|
+
}), f = k(e, Dt, Qt, {
|
|
231
231
|
[xt]: !0
|
|
232
232
|
});
|
|
233
|
-
l(e, jt,
|
|
234
|
-
const
|
|
233
|
+
l(e, jt, f), l(u, Ut, c), l(u, jt, f), k(u, Dt, f), l(f, ue), l(f, Ut), k(f, Dt, f), l(f, jt, f);
|
|
234
|
+
const h = k(e, Mt, Le, {
|
|
235
235
|
[ge]: !0
|
|
236
236
|
});
|
|
237
|
-
l(
|
|
238
|
-
const
|
|
239
|
-
l(
|
|
240
|
-
const
|
|
241
|
-
for (let
|
|
242
|
-
|
|
243
|
-
for (let
|
|
244
|
-
|
|
245
|
-
M(
|
|
237
|
+
l(h, "#"), k(h, Mt, h), l(h, $e, h);
|
|
238
|
+
const g = l(h, Qe);
|
|
239
|
+
l(g, "#"), k(g, Mt, h);
|
|
240
|
+
const E = [[P, i], [w, o]], C = [[P, null], [z, a], [w, r]];
|
|
241
|
+
for (let A = 0; A < X.length; A++)
|
|
242
|
+
H(e, X[A], Gt, N, E);
|
|
243
|
+
for (let A = 0; A < Z.length; A++)
|
|
244
|
+
H(e, Z[A], $t, Ft, C);
|
|
245
|
+
M(Gt, {
|
|
246
246
|
tld: !0,
|
|
247
247
|
ascii: !0
|
|
248
|
-
}, n), M(
|
|
248
|
+
}, n), M($t, {
|
|
249
249
|
utld: !0,
|
|
250
250
|
alpha: !0
|
|
251
|
-
}, n),
|
|
251
|
+
}, n), H(e, "file", et, N, E), H(e, "mailto", et, N, E), H(e, "http", _, N, E), H(e, "https", _, N, E), H(e, "ftp", _, N, E), H(e, "ftps", _, N, E), M(et, {
|
|
252
252
|
scheme: !0,
|
|
253
253
|
ascii: !0
|
|
254
|
-
}, n), M(
|
|
254
|
+
}, n), M(_, {
|
|
255
255
|
slashscheme: !0,
|
|
256
256
|
ascii: !0
|
|
257
|
-
}, n), t = t.sort((
|
|
258
|
-
for (let
|
|
259
|
-
const
|
|
260
|
-
[$e]: !0
|
|
261
|
-
} : {
|
|
257
|
+
}, n), t = t.sort((A, L) => A[0] > L[0] ? 1 : -1);
|
|
258
|
+
for (let A = 0; A < t.length; A++) {
|
|
259
|
+
const L = t[A][0], v = t[A][1] ? {
|
|
262
260
|
[We]: !0
|
|
261
|
+
} : {
|
|
262
|
+
[Ke]: !0
|
|
263
263
|
};
|
|
264
|
-
|
|
264
|
+
L.indexOf("-") >= 0 ? v[Kt] = !0 : P.test(L) ? w.test(L) ? v[K] = !0 : v[zt] = !0 : v[Bt] = !0, ce(e, L, L, v);
|
|
265
265
|
}
|
|
266
266
|
return ce(e, "localhost", V, {
|
|
267
267
|
ascii: !0
|
|
268
|
-
}), e.jd = new
|
|
268
|
+
}), e.jd = new R(vt), {
|
|
269
269
|
start: e,
|
|
270
270
|
tokens: Object.assign({
|
|
271
271
|
groups: n
|
|
@@ -273,57 +273,57 @@ function qe(t = []) {
|
|
|
273
273
|
};
|
|
274
274
|
}
|
|
275
275
|
function Re(t, n) {
|
|
276
|
-
const e = Ve(n.replace(/[A-Z]/g, (a) => a.toLowerCase())),
|
|
277
|
-
let
|
|
278
|
-
for (;
|
|
279
|
-
let a = t, c = null,
|
|
280
|
-
for (;
|
|
281
|
-
a = c, a.accepts() ? (
|
|
282
|
-
|
|
283
|
-
t:
|
|
276
|
+
const e = Ve(n.replace(/[A-Z]/g, (a) => a.toLowerCase())), s = e.length, o = [];
|
|
277
|
+
let r = 0, i = 0;
|
|
278
|
+
for (; i < s; ) {
|
|
279
|
+
let a = t, c = null, u = 0, f = null, h = -1, g = -1;
|
|
280
|
+
for (; i < s && (c = a.go(e[i])); )
|
|
281
|
+
a = c, a.accepts() ? (h = 0, g = 0, f = a) : h >= 0 && (h += e[i].length, g++), u += e[i].length, r += e[i].length, i++;
|
|
282
|
+
r -= h, i -= g, u -= h, o.push({
|
|
283
|
+
t: f.t,
|
|
284
284
|
// token type/name
|
|
285
|
-
v: n.slice(
|
|
285
|
+
v: n.slice(r - u, r),
|
|
286
286
|
// string value
|
|
287
|
-
s:
|
|
287
|
+
s: r - u,
|
|
288
288
|
// start index
|
|
289
|
-
e:
|
|
289
|
+
e: r
|
|
290
290
|
// end index (excluding)
|
|
291
291
|
});
|
|
292
292
|
}
|
|
293
|
-
return
|
|
293
|
+
return o;
|
|
294
294
|
}
|
|
295
295
|
function Ve(t) {
|
|
296
296
|
const n = [], e = t.length;
|
|
297
|
-
let
|
|
298
|
-
for (;
|
|
299
|
-
let
|
|
300
|
-
n.push(
|
|
297
|
+
let s = 0;
|
|
298
|
+
for (; s < e; ) {
|
|
299
|
+
let o = t.charCodeAt(s), r, i = o < 55296 || o > 56319 || s + 1 === e || (r = t.charCodeAt(s + 1)) < 56320 || r > 57343 ? t[s] : t.slice(s, s + 2);
|
|
300
|
+
n.push(i), s += i.length;
|
|
301
301
|
}
|
|
302
302
|
return n;
|
|
303
303
|
}
|
|
304
|
-
function
|
|
305
|
-
let
|
|
306
|
-
const
|
|
307
|
-
for (let a = 0; a <
|
|
304
|
+
function H(t, n, e, s, o) {
|
|
305
|
+
let r;
|
|
306
|
+
const i = n.length;
|
|
307
|
+
for (let a = 0; a < i - 1; a++) {
|
|
308
308
|
const c = n[a];
|
|
309
|
-
t.j[c] ?
|
|
309
|
+
t.j[c] ? r = t.j[c] : (r = new R(s), r.jr = o.slice(), t.j[c] = r), t = r;
|
|
310
310
|
}
|
|
311
|
-
return
|
|
311
|
+
return r = new R(e), r.jr = o.slice(), t.j[n[i - 1]] = r, r;
|
|
312
312
|
}
|
|
313
313
|
function de(t) {
|
|
314
314
|
const n = [], e = [];
|
|
315
|
-
let
|
|
316
|
-
for (;
|
|
317
|
-
let
|
|
318
|
-
for (;
|
|
319
|
-
|
|
320
|
-
if (
|
|
315
|
+
let s = 0, o = "0123456789";
|
|
316
|
+
for (; s < t.length; ) {
|
|
317
|
+
let r = 0;
|
|
318
|
+
for (; o.indexOf(t[s + r]) >= 0; )
|
|
319
|
+
r++;
|
|
320
|
+
if (r > 0) {
|
|
321
321
|
n.push(e.join(""));
|
|
322
|
-
for (let
|
|
322
|
+
for (let i = parseInt(t.substring(s, s + r), 10); i > 0; i--)
|
|
323
323
|
e.pop();
|
|
324
|
-
|
|
324
|
+
s += r;
|
|
325
325
|
} else
|
|
326
|
-
e.push(t[
|
|
326
|
+
e.push(t[s]), s++;
|
|
327
327
|
}
|
|
328
328
|
return n;
|
|
329
329
|
}
|
|
@@ -346,10 +346,10 @@ const J = {
|
|
|
346
346
|
function ne(t, n = null) {
|
|
347
347
|
let e = Object.assign({}, J);
|
|
348
348
|
t && (e = Object.assign(e, t instanceof ne ? t.o : t));
|
|
349
|
-
const
|
|
350
|
-
for (let
|
|
351
|
-
|
|
352
|
-
this.o = e, n && (this.defaultRender = n), this.ignoreTags =
|
|
349
|
+
const s = e.ignoreTags, o = [];
|
|
350
|
+
for (let r = 0; r < s.length; r++)
|
|
351
|
+
o.push(s[r].toUpperCase());
|
|
352
|
+
this.o = e, n && (this.defaultRender = n), this.ignoreTags = o;
|
|
353
353
|
}
|
|
354
354
|
ne.prototype = {
|
|
355
355
|
o: J,
|
|
@@ -386,9 +386,9 @@ ne.prototype = {
|
|
|
386
386
|
* @returns {Opts[K] | any}
|
|
387
387
|
*/
|
|
388
388
|
get(t, n, e) {
|
|
389
|
-
const
|
|
390
|
-
let
|
|
391
|
-
return
|
|
389
|
+
const s = n != null;
|
|
390
|
+
let o = this.o[t];
|
|
391
|
+
return o && (typeof o == "object" ? (o = e.t in o ? o[e.t] : J[t], typeof o == "function" && s && (o = o(n, e))) : typeof o == "function" && s && (o = o(n, e.t, e)), o);
|
|
392
392
|
},
|
|
393
393
|
/**
|
|
394
394
|
* @template {keyof Opts} L
|
|
@@ -398,8 +398,8 @@ ne.prototype = {
|
|
|
398
398
|
* @returns {Opts[L] | any}
|
|
399
399
|
*/
|
|
400
400
|
getObj(t, n, e) {
|
|
401
|
-
let
|
|
402
|
-
return typeof
|
|
401
|
+
let s = this.o[t];
|
|
402
|
+
return typeof s == "function" && n != null && (s = s(n, e.t, e)), s;
|
|
403
403
|
},
|
|
404
404
|
/**
|
|
405
405
|
* Convert the given token to a rendered element that may be added to the
|
|
@@ -442,8 +442,8 @@ Ce.prototype = {
|
|
|
442
442
|
* @returns {string}
|
|
443
443
|
*/
|
|
444
444
|
toFormattedString(t) {
|
|
445
|
-
const n = this.toString(), e = t.get("truncate", n, this),
|
|
446
|
-
return e &&
|
|
445
|
+
const n = this.toString(), e = t.get("truncate", n, this), s = t.get("format", n, this);
|
|
446
|
+
return e && s.length > e ? s.substring(0, e) + "…" : s;
|
|
447
447
|
},
|
|
448
448
|
/**
|
|
449
449
|
*
|
|
@@ -514,23 +514,23 @@ Ce.prototype = {
|
|
|
514
514
|
* @param {Options} options Formattinng options
|
|
515
515
|
*/
|
|
516
516
|
render(t) {
|
|
517
|
-
const n = this, e = this.toHref(t.get("defaultProtocol")),
|
|
518
|
-
return
|
|
519
|
-
tagName:
|
|
520
|
-
attributes:
|
|
521
|
-
content:
|
|
522
|
-
eventListeners:
|
|
517
|
+
const n = this, e = this.toHref(t.get("defaultProtocol")), s = t.get("formatHref", e, this), o = t.get("tagName", e, n), r = this.toFormattedString(t), i = {}, a = t.get("className", e, n), c = t.get("target", e, n), u = t.get("rel", e, n), f = t.getObj("attributes", e, n), h = t.getObj("events", e, n);
|
|
518
|
+
return i.href = s, a && (i.class = a), c && (i.target = c), u && (i.rel = u), f && Object.assign(i, f), {
|
|
519
|
+
tagName: o,
|
|
520
|
+
attributes: i,
|
|
521
|
+
content: r,
|
|
522
|
+
eventListeners: h
|
|
523
523
|
};
|
|
524
524
|
}
|
|
525
525
|
};
|
|
526
526
|
function Pt(t, n) {
|
|
527
527
|
class e extends Ce {
|
|
528
|
-
constructor(
|
|
529
|
-
super(
|
|
528
|
+
constructor(o, r) {
|
|
529
|
+
super(o, r), this.t = t;
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
|
-
for (const
|
|
533
|
-
e.prototype[
|
|
532
|
+
for (const s in n)
|
|
533
|
+
e.prototype[s] = n[s];
|
|
534
534
|
return e.t = t, e;
|
|
535
535
|
}
|
|
536
536
|
const Je = Pt("email", {
|
|
@@ -558,42 +558,42 @@ const Je = Pt("email", {
|
|
|
558
558
|
const t = this.tk;
|
|
559
559
|
return t.length >= 2 && t[0].t !== V && t[1].t === D;
|
|
560
560
|
}
|
|
561
|
-
}),
|
|
561
|
+
}), y = (t) => new R(t);
|
|
562
562
|
function Xe({
|
|
563
563
|
groups: t
|
|
564
564
|
}) {
|
|
565
|
-
const n = t.domain.concat([gt, At,
|
|
566
|
-
d(
|
|
567
|
-
const
|
|
568
|
-
d(
|
|
569
|
-
const
|
|
570
|
-
l(
|
|
571
|
-
const
|
|
572
|
-
d(
|
|
573
|
-
const
|
|
574
|
-
d(
|
|
575
|
-
const
|
|
576
|
-
d(
|
|
577
|
-
const
|
|
578
|
-
d(
|
|
579
|
-
const
|
|
580
|
-
l(
|
|
581
|
-
const
|
|
582
|
-
l(
|
|
583
|
-
const
|
|
584
|
-
d(
|
|
585
|
-
const
|
|
586
|
-
d(
|
|
587
|
-
const
|
|
588
|
-
d(
|
|
589
|
-
const wt = l(a, D), Pe = l(c, D), we = l(Pe,
|
|
590
|
-
d(a, t.domain,
|
|
565
|
+
const n = t.domain.concat([gt, At, x, kt, Lt, Tt, Rt, Ct, b, Jt, $, yt, bt, Ot, S, vt, q, St]), e = [Et, D, Xt, O, Zt, $, Q, te, ee, rt, lt, F, G, st, nt, ot, it, at, ct, ut, dt, ht, ft, pt, mt], s = [gt, Et, At, kt, Lt, Tt, Rt, Ct, b, F, G, $, yt, bt, Ot, Q, S, vt, q, St], o = y(), r = l(o, q);
|
|
566
|
+
d(r, s, r), d(r, t.domain, r);
|
|
567
|
+
const i = y(), a = y(), c = y();
|
|
568
|
+
d(o, t.domain, i), d(o, t.scheme, a), d(o, t.slashscheme, c), d(i, s, r), d(i, t.domain, i);
|
|
569
|
+
const u = l(i, x);
|
|
570
|
+
l(r, x, u), l(a, x, u), l(c, x, u);
|
|
571
|
+
const f = l(r, O);
|
|
572
|
+
d(f, s, r), d(f, t.domain, r);
|
|
573
|
+
const h = y();
|
|
574
|
+
d(u, t.domain, h), d(h, t.domain, h);
|
|
575
|
+
const g = l(h, O);
|
|
576
|
+
d(g, t.domain, h);
|
|
577
|
+
const E = y(Je);
|
|
578
|
+
d(g, t.tld, E), d(g, t.utld, E), l(u, V, E);
|
|
579
|
+
const C = l(h, b);
|
|
580
|
+
l(C, b, C), d(C, t.domain, h), d(E, t.domain, h), l(E, O, g), l(E, b, C);
|
|
581
|
+
const A = l(i, b), L = l(i, O);
|
|
582
|
+
l(A, b, A), d(A, t.domain, i), d(L, s, r), d(L, t.domain, i);
|
|
583
|
+
const p = y(tt);
|
|
584
|
+
d(L, t.tld, p), d(L, t.utld, p), d(p, t.domain, i), d(p, s, r), l(p, O, L), l(p, b, A), l(p, x, u);
|
|
585
|
+
const v = l(p, D), ie = y(tt);
|
|
586
|
+
d(v, t.numeric, ie);
|
|
587
|
+
const T = y(tt), B = y();
|
|
588
|
+
d(T, n, T), d(T, e, B), d(B, n, T), d(B, e, B), l(p, S, T), l(ie, S, T);
|
|
589
|
+
const wt = l(a, D), Pe = l(c, D), we = l(Pe, S), It = l(we, S);
|
|
590
|
+
d(a, t.domain, i), l(a, O, L), l(a, b, A), d(c, t.domain, i), l(c, O, L), l(c, b, A), d(wt, t.domain, T), l(wt, S, T), l(wt, Q, T), d(It, t.domain, T), d(It, n, T), l(It, S, T);
|
|
591
591
|
const re = [
|
|
592
|
-
[
|
|
592
|
+
[F, G],
|
|
593
593
|
// {}
|
|
594
|
-
[nt,
|
|
594
|
+
[nt, st],
|
|
595
595
|
// []
|
|
596
|
-
[
|
|
596
|
+
[ot, it],
|
|
597
597
|
// ()
|
|
598
598
|
[rt, lt],
|
|
599
599
|
// <>
|
|
@@ -607,42 +607,42 @@ function Xe({
|
|
|
607
607
|
// <>
|
|
608
608
|
];
|
|
609
609
|
for (let Nt = 0; Nt < re.length; Nt++) {
|
|
610
|
-
const [le, Ht] = re[Nt], Y = l(
|
|
610
|
+
const [le, Ht] = re[Nt], Y = l(T, le);
|
|
611
611
|
l(B, le, Y);
|
|
612
|
-
const U =
|
|
612
|
+
const U = y(tt);
|
|
613
613
|
d(Y, n, U);
|
|
614
|
-
const j =
|
|
615
|
-
d(Y, e, j), l(Y, Ht,
|
|
614
|
+
const j = y();
|
|
615
|
+
d(Y, e, j), l(Y, Ht, T), d(U, n, U), d(U, e, j), d(j, n, U), d(j, e, j), l(U, Ht, T), l(j, Ht, T);
|
|
616
616
|
}
|
|
617
|
-
return l(
|
|
618
|
-
start:
|
|
617
|
+
return l(o, V, p), l(o, Yt, Ye), {
|
|
618
|
+
start: o,
|
|
619
619
|
tokens: Te
|
|
620
620
|
};
|
|
621
621
|
}
|
|
622
622
|
function Ze(t, n, e) {
|
|
623
|
-
let
|
|
624
|
-
for (;
|
|
625
|
-
let a = t, c = null,
|
|
626
|
-
for (;
|
|
627
|
-
|
|
628
|
-
for (;
|
|
629
|
-
c = null, a =
|
|
630
|
-
if (
|
|
631
|
-
|
|
623
|
+
let s = e.length, o = 0, r = [], i = [];
|
|
624
|
+
for (; o < s; ) {
|
|
625
|
+
let a = t, c = null, u = null, f = 0, h = null, g = -1;
|
|
626
|
+
for (; o < s && !(c = a.go(e[o].t)); )
|
|
627
|
+
i.push(e[o++]);
|
|
628
|
+
for (; o < s && (u = c || a.go(e[o].t)); )
|
|
629
|
+
c = null, a = u, a.accepts() ? (g = 0, h = a) : g >= 0 && g++, o++, f++;
|
|
630
|
+
if (g < 0)
|
|
631
|
+
o -= f, o < s && (i.push(e[o]), o++);
|
|
632
632
|
else {
|
|
633
|
-
|
|
634
|
-
const
|
|
635
|
-
|
|
633
|
+
i.length > 0 && (r.push(_t(fe, n, i)), i = []), o -= g, f -= g;
|
|
634
|
+
const E = h.t, C = e.slice(o - f, o);
|
|
635
|
+
r.push(_t(E, n, C));
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
|
-
return
|
|
638
|
+
return i.length > 0 && r.push(_t(fe, n, i)), r;
|
|
639
639
|
}
|
|
640
|
-
function
|
|
641
|
-
const
|
|
642
|
-
return new t(
|
|
640
|
+
function _t(t, n, e) {
|
|
641
|
+
const s = e[0].s, o = e[e.length - 1].e, r = n.slice(s, o);
|
|
642
|
+
return new t(r, e);
|
|
643
643
|
}
|
|
644
644
|
const tn = typeof console < "u" && console && console.warn || (() => {
|
|
645
|
-
}), en = "until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",
|
|
645
|
+
}), en = "until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.", m = {
|
|
646
646
|
scanner: null,
|
|
647
647
|
parser: null,
|
|
648
648
|
tokenQueue: [],
|
|
@@ -651,151 +651,190 @@ const tn = typeof console < "u" && console && console.warn || (() => {
|
|
|
651
651
|
initialized: !1
|
|
652
652
|
};
|
|
653
653
|
function nn() {
|
|
654
|
-
return
|
|
654
|
+
return R.groups = {}, m.scanner = null, m.parser = null, m.tokenQueue = [], m.pluginQueue = [], m.customSchemes = [], m.initialized = !1, m;
|
|
655
655
|
}
|
|
656
656
|
function pe(t, n = !1) {
|
|
657
|
-
if (
|
|
657
|
+
if (m.initialized && tn(`linkifyjs: already initialized - will not register custom scheme "${t}" ${en}`), !/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))
|
|
658
658
|
throw new Error(`linkifyjs: incorrect scheme format.
|
|
659
659
|
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
660
660
|
2. Cannot start or end with "-"
|
|
661
661
|
3. "-" cannot repeat`);
|
|
662
|
-
|
|
662
|
+
m.customSchemes.push([t, n]);
|
|
663
663
|
}
|
|
664
|
-
function
|
|
665
|
-
|
|
666
|
-
for (let t = 0; t <
|
|
667
|
-
|
|
668
|
-
scanner:
|
|
664
|
+
function sn() {
|
|
665
|
+
m.scanner = qe(m.customSchemes);
|
|
666
|
+
for (let t = 0; t < m.tokenQueue.length; t++)
|
|
667
|
+
m.tokenQueue[t][1]({
|
|
668
|
+
scanner: m.scanner
|
|
669
669
|
});
|
|
670
|
-
|
|
671
|
-
for (let t = 0; t <
|
|
672
|
-
|
|
673
|
-
scanner:
|
|
674
|
-
parser:
|
|
670
|
+
m.parser = Xe(m.scanner.tokens);
|
|
671
|
+
for (let t = 0; t < m.pluginQueue.length; t++)
|
|
672
|
+
m.pluginQueue[t][1]({
|
|
673
|
+
scanner: m.scanner,
|
|
674
|
+
parser: m.parser
|
|
675
675
|
});
|
|
676
|
-
return
|
|
676
|
+
return m.initialized = !0, m;
|
|
677
677
|
}
|
|
678
|
-
function
|
|
679
|
-
return
|
|
678
|
+
function se(t) {
|
|
679
|
+
return m.initialized || sn(), Ze(m.parser.start, t, Re(m.scanner.start, t));
|
|
680
680
|
}
|
|
681
|
-
|
|
681
|
+
se.scan = Re;
|
|
682
682
|
function ye(t, n = null, e = null) {
|
|
683
683
|
if (n && typeof n == "object") {
|
|
684
684
|
if (e)
|
|
685
685
|
throw Error(`linkifyjs: Invalid link type ${n}; must be a string`);
|
|
686
686
|
e = n, n = null;
|
|
687
687
|
}
|
|
688
|
-
const
|
|
689
|
-
for (let
|
|
690
|
-
const a =
|
|
691
|
-
a.isLink && (!n || a.t === n) &&
|
|
688
|
+
const s = new ne(e), o = se(t), r = [];
|
|
689
|
+
for (let i = 0; i < o.length; i++) {
|
|
690
|
+
const a = o[i];
|
|
691
|
+
a.isLink && (!n || a.t === n) && s.check(a) && r.push(a.toFormattedObject(s));
|
|
692
692
|
}
|
|
693
|
-
return
|
|
693
|
+
return r;
|
|
694
694
|
}
|
|
695
|
-
|
|
695
|
+
var oe = "[\0- -\u2029 ]", on = new RegExp(oe), rn = new RegExp(`${oe}$`), ln = new RegExp(oe, "g");
|
|
696
696
|
function an(t) {
|
|
697
697
|
return t.length === 1 ? t[0].isLink : t.length === 3 && t[1].isLink ? ["()", "[]"].includes(t[0].value + t[2].value) : !1;
|
|
698
698
|
}
|
|
699
699
|
function cn(t) {
|
|
700
700
|
return new qt({
|
|
701
701
|
key: new Vt("autolink"),
|
|
702
|
-
appendTransaction: (n, e,
|
|
703
|
-
const
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
if (
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
702
|
+
appendTransaction: (n, e, s) => {
|
|
703
|
+
const o = n.some((u) => u.docChanged) && !e.doc.eq(s.doc), r = n.some(
|
|
704
|
+
(u) => u.getMeta("preventAutolink")
|
|
705
|
+
);
|
|
706
|
+
if (!o || r)
|
|
707
|
+
return;
|
|
708
|
+
const { tr: i } = s, a = Ne(e.doc, [...n]);
|
|
709
|
+
if (He(a).forEach(({ newRange: u }) => {
|
|
710
|
+
const f = xe(
|
|
711
|
+
s.doc,
|
|
712
|
+
u,
|
|
713
|
+
(E) => E.isTextblock
|
|
714
|
+
);
|
|
715
|
+
let h, g;
|
|
716
|
+
if (f.length > 1)
|
|
717
|
+
h = f[0], g = s.doc.textBetween(
|
|
718
|
+
h.pos,
|
|
719
|
+
h.pos + h.node.nodeSize,
|
|
720
|
+
void 0,
|
|
721
|
+
" "
|
|
722
|
+
);
|
|
723
|
+
else if (f.length) {
|
|
724
|
+
const E = s.doc.textBetween(u.from, u.to, " ", " ");
|
|
725
|
+
if (!rn.test(E))
|
|
726
|
+
return;
|
|
727
|
+
h = f[0], g = s.doc.textBetween(
|
|
728
|
+
h.pos,
|
|
729
|
+
u.to,
|
|
730
|
+
void 0,
|
|
731
|
+
" "
|
|
732
|
+
);
|
|
715
733
|
}
|
|
716
|
-
if (
|
|
717
|
-
const
|
|
718
|
-
if (
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
734
|
+
if (h && g) {
|
|
735
|
+
const E = g.split(on).filter(Boolean);
|
|
736
|
+
if (E.length <= 0)
|
|
737
|
+
return !1;
|
|
738
|
+
const C = E[E.length - 1], A = h.pos + g.lastIndexOf(C);
|
|
739
|
+
if (!C)
|
|
740
|
+
return !1;
|
|
741
|
+
const L = se(C).map(
|
|
742
|
+
(p) => p.toObject(t.defaultProtocol)
|
|
743
|
+
);
|
|
744
|
+
if (!an(L))
|
|
745
|
+
return !1;
|
|
746
|
+
L.filter((p) => p.isLink).map((p) => ({
|
|
747
|
+
...p,
|
|
748
|
+
from: A + p.start + 1,
|
|
749
|
+
to: A + p.end + 1
|
|
750
|
+
})).filter((p) => s.schema.marks.code ? !s.doc.rangeHasMark(p.from, p.to, s.schema.marks.code) : !0).filter((p) => t.validate(p.value)).filter((p) => t.shouldAutoLink(p.value)).forEach((p) => {
|
|
751
|
+
Me(p.from, p.to, s.doc).some(
|
|
752
|
+
(v) => v.mark.type === t.type
|
|
753
|
+
) || i.addMark(
|
|
754
|
+
p.from,
|
|
755
|
+
p.to,
|
|
756
|
+
t.type.create({
|
|
757
|
+
href: p.href
|
|
758
|
+
})
|
|
759
|
+
);
|
|
729
760
|
});
|
|
730
761
|
}
|
|
731
|
-
}), !!
|
|
732
|
-
return
|
|
762
|
+
}), !!i.steps.length)
|
|
763
|
+
return i;
|
|
733
764
|
}
|
|
734
765
|
});
|
|
735
766
|
}
|
|
736
767
|
function un(t) {
|
|
737
768
|
return new qt({
|
|
738
769
|
key: new Vt("handleClickLink"),
|
|
739
|
-
props: {
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
if (
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
770
|
+
props: {
|
|
771
|
+
handleClick: (n, e, s) => {
|
|
772
|
+
var o, r;
|
|
773
|
+
if (s.button !== 0 || !n.editable)
|
|
774
|
+
return !1;
|
|
775
|
+
let i = null;
|
|
776
|
+
if (s.target instanceof HTMLAnchorElement)
|
|
777
|
+
i = s.target;
|
|
778
|
+
else {
|
|
779
|
+
const c = s.target;
|
|
780
|
+
if (!c)
|
|
781
|
+
return !1;
|
|
782
|
+
const u = t.editor.view.dom;
|
|
783
|
+
i = c.closest("a"), i && !u.contains(i) && (i = null);
|
|
784
|
+
}
|
|
785
|
+
if (!i)
|
|
786
|
+
return !1;
|
|
787
|
+
let a = !1;
|
|
788
|
+
if (t.enableClickSelection && (a = t.editor.commands.extendMarkRange(t.type.name)), t.openOnClick) {
|
|
789
|
+
const c = De(n.state, t.type.name), u = (o = i.href) != null ? o : c.href, f = (r = i.target) != null ? r : c.target;
|
|
790
|
+
u && (window.open(u, f), a = !0);
|
|
791
|
+
}
|
|
792
|
+
return a;
|
|
755
793
|
}
|
|
756
|
-
|
|
757
|
-
} }
|
|
794
|
+
}
|
|
758
795
|
});
|
|
759
796
|
}
|
|
760
|
-
|
|
761
|
-
function
|
|
797
|
+
var dn = /\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/, hn = /\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;
|
|
798
|
+
function be(t, n) {
|
|
762
799
|
let e = 0;
|
|
763
|
-
for (let
|
|
800
|
+
for (let s = n - 1; s >= 0 && t[s] === "\\"; s -= 1)
|
|
801
|
+
e += 1;
|
|
764
802
|
return e % 2 === 1;
|
|
765
803
|
}
|
|
766
804
|
function fn(t, n) {
|
|
767
|
-
let e = 0,
|
|
768
|
-
for (;
|
|
769
|
-
if (t[
|
|
770
|
-
|
|
805
|
+
let e = 0, s = 0;
|
|
806
|
+
for (; s < n; ) {
|
|
807
|
+
if (t[s] !== "`") {
|
|
808
|
+
s += 1;
|
|
771
809
|
continue;
|
|
772
810
|
}
|
|
773
|
-
if (e === 0 &&
|
|
774
|
-
|
|
811
|
+
if (e === 0 && be(t, s)) {
|
|
812
|
+
s += 1;
|
|
775
813
|
continue;
|
|
776
814
|
}
|
|
777
|
-
let
|
|
778
|
-
for (;
|
|
779
|
-
|
|
780
|
-
e === 0 ? e =
|
|
815
|
+
let o = 0;
|
|
816
|
+
for (; s < n && t[s] === "`"; )
|
|
817
|
+
o += 1, s += 1;
|
|
818
|
+
e === 0 ? e = o : o === e && (e = 0);
|
|
781
819
|
}
|
|
782
820
|
return e > 0;
|
|
783
821
|
}
|
|
784
|
-
function
|
|
785
|
-
var
|
|
786
|
-
const [,
|
|
787
|
-
return (n.index ? t[n.index - 1] : void 0) === "!" ||
|
|
822
|
+
function Oe(t, n, e) {
|
|
823
|
+
var s, o;
|
|
824
|
+
const [, r, i] = n;
|
|
825
|
+
return (n.index ? t[n.index - 1] : void 0) === "!" || be(t, (s = n.index) != null ? s : 0) || fn(t, (o = n.index) != null ? o : 0) ? !1 : !!r.trim() && e(i);
|
|
788
826
|
}
|
|
789
|
-
function
|
|
827
|
+
function Se(t) {
|
|
790
828
|
var n, e;
|
|
791
|
-
const [
|
|
829
|
+
const [s, o, r, , i, a, c] = t, u = (n = i ?? a) != null ? n : c;
|
|
792
830
|
return {
|
|
793
|
-
index: (e = t.index)
|
|
794
|
-
text:
|
|
795
|
-
replaceWith:
|
|
831
|
+
index: (e = t.index) != null ? e : 0,
|
|
832
|
+
text: s,
|
|
833
|
+
replaceWith: o,
|
|
796
834
|
data: {
|
|
797
|
-
href:
|
|
798
|
-
title
|
|
835
|
+
href: r,
|
|
836
|
+
// an empty title ("") counts as no title, as in CommonMark
|
|
837
|
+
title: u || null,
|
|
799
838
|
markdown: !0
|
|
800
839
|
}
|
|
801
840
|
};
|
|
@@ -803,68 +842,78 @@ function ve(t) {
|
|
|
803
842
|
function pn(t, n) {
|
|
804
843
|
return t.index < n.index + n.text.length && n.index < t.index + t.text.length;
|
|
805
844
|
}
|
|
806
|
-
function
|
|
807
|
-
var n, e,
|
|
845
|
+
function ve(t) {
|
|
846
|
+
var n, e, s;
|
|
808
847
|
return {
|
|
809
|
-
href: (n = t.data)
|
|
810
|
-
title: (
|
|
848
|
+
href: (n = t.data) == null ? void 0 : n.href,
|
|
849
|
+
title: (s = (e = t.data) == null ? void 0 : e.title) != null ? s : null
|
|
811
850
|
};
|
|
812
851
|
}
|
|
813
852
|
function mn(t) {
|
|
814
853
|
const n = je({
|
|
815
854
|
find: (e) => {
|
|
816
|
-
const
|
|
817
|
-
return !
|
|
855
|
+
const s = dn.exec(e);
|
|
856
|
+
return !s || !Oe(e, s, t.isAllowedHref) ? null : Se(s);
|
|
818
857
|
},
|
|
819
858
|
type: t.type,
|
|
820
|
-
getAttributes:
|
|
859
|
+
getAttributes: ve
|
|
821
860
|
});
|
|
822
|
-
return new
|
|
861
|
+
return new _e({
|
|
823
862
|
find: n.find,
|
|
824
863
|
handler: (e) => {
|
|
825
|
-
const
|
|
826
|
-
return
|
|
864
|
+
const s = n.handler(e);
|
|
865
|
+
return s !== null && e.state.tr.steps.length && e.state.tr.setMeta("preventAutolink", !0), s;
|
|
827
866
|
}
|
|
828
867
|
});
|
|
829
868
|
}
|
|
830
869
|
function gn(t) {
|
|
831
870
|
const n = me({
|
|
832
871
|
find: (e) => {
|
|
833
|
-
var
|
|
834
|
-
const
|
|
835
|
-
for (const a of e.matchAll(hn))
|
|
836
|
-
|
|
837
|
-
|
|
872
|
+
var s, o;
|
|
873
|
+
const r = [];
|
|
874
|
+
for (const a of e.matchAll(hn))
|
|
875
|
+
Oe(e, a, t.isAllowedHref) && r.push(Se(a));
|
|
876
|
+
const i = ((o = (s = t.findPlainUrls) == null ? void 0 : s.call(t, e)) != null ? o : []).filter(
|
|
877
|
+
(a) => !r.some((c) => pn(c, a))
|
|
878
|
+
);
|
|
879
|
+
return [...r, ...i];
|
|
838
880
|
},
|
|
839
881
|
type: t.type,
|
|
840
|
-
getAttributes:
|
|
882
|
+
getAttributes: ve
|
|
841
883
|
});
|
|
842
884
|
return new Ue({
|
|
843
885
|
find: n.find,
|
|
844
886
|
handler: (e) => {
|
|
845
|
-
var
|
|
846
|
-
const
|
|
847
|
-
return
|
|
887
|
+
var s;
|
|
888
|
+
const o = n.handler(e);
|
|
889
|
+
return o !== null && e.state.tr.steps.length && ((s = e.match.data) != null && s.markdown) && e.state.tr.setMeta("preventAutolink", !0), o;
|
|
848
890
|
}
|
|
849
891
|
});
|
|
850
892
|
}
|
|
851
893
|
function En(t) {
|
|
852
894
|
return new qt({
|
|
853
895
|
key: new Vt("handlePasteLink"),
|
|
854
|
-
props: {
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
c
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
896
|
+
props: {
|
|
897
|
+
handlePaste: (n, e, s) => {
|
|
898
|
+
const { shouldAutoLink: o } = t, { state: r } = n, { selection: i } = r, { empty: a } = i;
|
|
899
|
+
if (a)
|
|
900
|
+
return !1;
|
|
901
|
+
let c = "";
|
|
902
|
+
s.content.forEach((f) => {
|
|
903
|
+
c += f.textContent;
|
|
904
|
+
});
|
|
905
|
+
const u = ye(c, { defaultProtocol: t.defaultProtocol }).find(
|
|
906
|
+
(f) => f.isLink && f.value === c
|
|
907
|
+
);
|
|
908
|
+
return !c || !u || o !== void 0 && !o(u.value) ? !1 : t.editor.commands.setMark(t.type, {
|
|
909
|
+
href: u.href
|
|
910
|
+
});
|
|
911
|
+
}
|
|
912
|
+
}
|
|
864
913
|
});
|
|
865
914
|
}
|
|
866
|
-
|
|
867
|
-
function
|
|
915
|
+
var Ln = /https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)/gi;
|
|
916
|
+
function I(t, n) {
|
|
868
917
|
const e = [
|
|
869
918
|
"http",
|
|
870
919
|
"https",
|
|
@@ -877,18 +926,25 @@ function w(t, n) {
|
|
|
877
926
|
"cid",
|
|
878
927
|
"xmpp"
|
|
879
928
|
];
|
|
880
|
-
return n && n.forEach((
|
|
881
|
-
const
|
|
882
|
-
|
|
883
|
-
}), !t || t.replace(ln, "").match(
|
|
929
|
+
return n && n.forEach((s) => {
|
|
930
|
+
const o = typeof s == "string" ? s : s.scheme;
|
|
931
|
+
o && e.push(o);
|
|
932
|
+
}), !t || t.replace(ln, "").match(
|
|
933
|
+
new RegExp(
|
|
934
|
+
`^(?:(?:${e.map((s) => s.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,
|
|
935
|
+
"i"
|
|
936
|
+
)
|
|
937
|
+
);
|
|
884
938
|
}
|
|
885
|
-
|
|
939
|
+
var An = Ie.create({
|
|
886
940
|
name: "link",
|
|
887
941
|
priority: 1e3,
|
|
888
942
|
keepOnSplit: !1,
|
|
889
943
|
exitable: !0,
|
|
890
944
|
onCreate() {
|
|
891
|
-
this.options.validate && !this.options.shouldAutoLink && (this.options.shouldAutoLink = this.options.validate, console.warn(
|
|
945
|
+
this.options.validate && !this.options.shouldAutoLink && (this.options.shouldAutoLink = this.options.validate, console.warn(
|
|
946
|
+
"The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead."
|
|
947
|
+
)), this.options.protocols.forEach((t) => {
|
|
892
948
|
if (typeof t == "string") {
|
|
893
949
|
pe(t);
|
|
894
950
|
return;
|
|
@@ -908,6 +964,7 @@ const An = Ie.create({
|
|
|
908
964
|
enableClickSelection: !1,
|
|
909
965
|
linkOnPaste: !0,
|
|
910
966
|
markdownLinks: !1,
|
|
967
|
+
// TODO (major) - default to true on next major version
|
|
911
968
|
autolink: !0,
|
|
912
969
|
protocols: [],
|
|
913
970
|
defaultProtocol: "http",
|
|
@@ -916,11 +973,12 @@ const An = Ie.create({
|
|
|
916
973
|
rel: "noopener noreferrer nofollow",
|
|
917
974
|
class: null
|
|
918
975
|
},
|
|
919
|
-
isAllowedUri: (t, n) => !!
|
|
976
|
+
isAllowedUri: (t, n) => !!I(t, n.protocols),
|
|
920
977
|
validate: (t) => !!t,
|
|
921
978
|
shouldAutoLink: (t) => {
|
|
922
979
|
const n = /^[a-z][a-z0-9+.-]*:\/\//i.test(t), e = /^[a-z][a-z0-9+.-]*:/i.test(t);
|
|
923
|
-
if (n || e && !t.includes("@"))
|
|
980
|
+
if (n || e && !t.includes("@"))
|
|
981
|
+
return !0;
|
|
924
982
|
const o = (t.includes("@") ? t.split("@").pop() : t).split(/[/?#:]/)[0];
|
|
925
983
|
return !(/^\d{1,3}(\.\d{1,3}){3}$/.test(o) || !/\./.test(o));
|
|
926
984
|
}
|
|
@@ -931,46 +989,48 @@ const An = Ie.create({
|
|
|
931
989
|
return {
|
|
932
990
|
href: {
|
|
933
991
|
default: null,
|
|
934
|
-
parseHTML(
|
|
935
|
-
return
|
|
992
|
+
parseHTML(s) {
|
|
993
|
+
return s.getAttribute("href");
|
|
936
994
|
}
|
|
937
995
|
},
|
|
938
|
-
target: {
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
996
|
+
target: {
|
|
997
|
+
// Coerce `undefined` to `null` because `undefined` is an invalid attribute value
|
|
998
|
+
default: (t = this.options.HTMLAttributes.target) != null ? t : null
|
|
999
|
+
},
|
|
1000
|
+
rel: {
|
|
1001
|
+
// Coerce `undefined` to `null` because `undefined` is an invalid attribute value
|
|
1002
|
+
default: (n = this.options.HTMLAttributes.rel) != null ? n : null
|
|
1003
|
+
},
|
|
1004
|
+
class: {
|
|
1005
|
+
// Coerce `undefined` to `null` because `undefined` is an invalid attribute value
|
|
1006
|
+
default: (e = this.options.HTMLAttributes.class) != null ? e : null
|
|
1007
|
+
},
|
|
1008
|
+
title: {
|
|
1009
|
+
default: null
|
|
1010
|
+
}
|
|
942
1011
|
};
|
|
943
1012
|
},
|
|
944
1013
|
parseHTML() {
|
|
945
|
-
return [
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
1014
|
+
return [
|
|
1015
|
+
{
|
|
1016
|
+
tag: "a[href]",
|
|
1017
|
+
getAttrs: (t) => {
|
|
1018
|
+
const n = t.getAttribute("href");
|
|
1019
|
+
return !n || !this.options.isAllowedUri(n, {
|
|
1020
|
+
defaultValidate: (e) => !!I(e, this.options.protocols),
|
|
1021
|
+
protocols: this.options.protocols,
|
|
1022
|
+
defaultProtocol: this.options.defaultProtocol
|
|
1023
|
+
}) ? !1 : null;
|
|
1024
|
+
}
|
|
954
1025
|
}
|
|
955
|
-
|
|
1026
|
+
];
|
|
956
1027
|
},
|
|
957
1028
|
renderHTML({ HTMLAttributes: t }) {
|
|
958
1029
|
return this.options.isAllowedUri(t.href, {
|
|
959
|
-
defaultValidate: (n) => !!
|
|
1030
|
+
defaultValidate: (n) => !!I(n, this.options.protocols),
|
|
960
1031
|
protocols: this.options.protocols,
|
|
961
1032
|
defaultProtocol: this.options.defaultProtocol
|
|
962
|
-
}) ? [
|
|
963
|
-
"a",
|
|
964
|
-
ae(this.options.HTMLAttributes, t),
|
|
965
|
-
0
|
|
966
|
-
] : [
|
|
967
|
-
"a",
|
|
968
|
-
ae(this.options.HTMLAttributes, {
|
|
969
|
-
...t,
|
|
970
|
-
href: ""
|
|
971
|
-
}),
|
|
972
|
-
0
|
|
973
|
-
];
|
|
1033
|
+
}) ? ["a", ae(this.options.HTMLAttributes, t), 0] : ["a", ae(this.options.HTMLAttributes, { ...t, href: "" }), 0];
|
|
974
1034
|
},
|
|
975
1035
|
markdownTokenName: "link",
|
|
976
1036
|
parseMarkdown: (t, n) => n.applyMark("link", n.parseInline(t.tokens || []), {
|
|
@@ -978,16 +1038,16 @@ const An = Ie.create({
|
|
|
978
1038
|
title: t.title || null
|
|
979
1039
|
}),
|
|
980
1040
|
renderMarkdown: (t, n) => {
|
|
981
|
-
var e,
|
|
982
|
-
const
|
|
983
|
-
return a ? `[${c}](${
|
|
1041
|
+
var e, s, o, r;
|
|
1042
|
+
const i = (s = (e = t.attrs) == null ? void 0 : e.href) != null ? s : "", a = (r = (o = t.attrs) == null ? void 0 : o.title) != null ? r : "", c = n.renderChildren(t);
|
|
1043
|
+
return a ? `[${c}](${i} "${a}")` : `[${c}](${i})`;
|
|
984
1044
|
},
|
|
985
1045
|
addCommands() {
|
|
986
1046
|
return {
|
|
987
1047
|
setLink: (t) => ({ chain: n }) => {
|
|
988
1048
|
const { href: e } = t;
|
|
989
1049
|
return this.options.isAllowedUri(e, {
|
|
990
|
-
defaultValidate: (
|
|
1050
|
+
defaultValidate: (s) => !!I(s, this.options.protocols),
|
|
991
1051
|
protocols: this.options.protocols,
|
|
992
1052
|
defaultProtocol: this.options.defaultProtocol
|
|
993
1053
|
}) ? n().setMark(this.name, t).setMeta("preventAutolink", !0).run() : !1;
|
|
@@ -995,7 +1055,7 @@ const An = Ie.create({
|
|
|
995
1055
|
toggleLink: (t) => ({ chain: n }) => {
|
|
996
1056
|
const { href: e } = t || {};
|
|
997
1057
|
return e && !this.options.isAllowedUri(e, {
|
|
998
|
-
defaultValidate: (
|
|
1058
|
+
defaultValidate: (s) => !!I(s, this.options.protocols),
|
|
999
1059
|
protocols: this.options.protocols,
|
|
1000
1060
|
defaultProtocol: this.options.defaultProtocol
|
|
1001
1061
|
}) ? !1 : n().toggleMark(this.name, t, { extendEmptyMarkRange: !0 }).setMeta("preventAutolink", !0).run();
|
|
@@ -1004,79 +1064,96 @@ const An = Ie.create({
|
|
|
1004
1064
|
};
|
|
1005
1065
|
},
|
|
1006
1066
|
addInputRules() {
|
|
1007
|
-
return this.options.markdownLinks ? [
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1067
|
+
return this.options.markdownLinks ? [
|
|
1068
|
+
mn({
|
|
1069
|
+
type: this.type,
|
|
1070
|
+
isAllowedHref: (t) => this.options.isAllowedUri(t, {
|
|
1071
|
+
defaultValidate: (n) => !!I(n, this.options.protocols),
|
|
1072
|
+
protocols: this.options.protocols,
|
|
1073
|
+
defaultProtocol: this.options.defaultProtocol
|
|
1074
|
+
})
|
|
1013
1075
|
})
|
|
1014
|
-
|
|
1076
|
+
] : [];
|
|
1015
1077
|
},
|
|
1016
1078
|
addPasteRules() {
|
|
1017
1079
|
const t = (n) => {
|
|
1018
1080
|
const e = [];
|
|
1019
1081
|
if (n) {
|
|
1020
|
-
const { protocols:
|
|
1021
|
-
ye(n).filter(
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1082
|
+
const { protocols: s, defaultProtocol: o } = this.options;
|
|
1083
|
+
ye(n).filter(
|
|
1084
|
+
(i) => i.isLink && this.options.isAllowedUri(i.value, {
|
|
1085
|
+
defaultValidate: (a) => !!I(a, s),
|
|
1086
|
+
protocols: s,
|
|
1087
|
+
defaultProtocol: o
|
|
1088
|
+
})
|
|
1089
|
+
).forEach((i) => {
|
|
1026
1090
|
this.options.shouldAutoLink(i.value) && e.push({
|
|
1027
1091
|
text: i.value,
|
|
1028
|
-
data: {
|
|
1092
|
+
data: {
|
|
1093
|
+
href: i.href
|
|
1094
|
+
},
|
|
1029
1095
|
index: i.start
|
|
1030
1096
|
});
|
|
1031
1097
|
});
|
|
1032
1098
|
}
|
|
1033
1099
|
return e;
|
|
1034
1100
|
};
|
|
1035
|
-
return this.options.markdownLinks ? [
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1101
|
+
return this.options.markdownLinks ? [
|
|
1102
|
+
gn({
|
|
1103
|
+
type: this.type,
|
|
1104
|
+
isAllowedHref: (n) => this.options.isAllowedUri(n, {
|
|
1105
|
+
defaultValidate: (e) => !!I(e, this.options.protocols),
|
|
1106
|
+
protocols: this.options.protocols,
|
|
1107
|
+
defaultProtocol: this.options.defaultProtocol
|
|
1108
|
+
}),
|
|
1109
|
+
findPlainUrls: t
|
|
1110
|
+
})
|
|
1111
|
+
] : [
|
|
1112
|
+
me({
|
|
1113
|
+
find: t,
|
|
1114
|
+
type: this.type,
|
|
1115
|
+
getAttributes: (n) => {
|
|
1116
|
+
var e;
|
|
1117
|
+
return {
|
|
1118
|
+
href: (e = n.data) == null ? void 0 : e.href
|
|
1119
|
+
};
|
|
1120
|
+
}
|
|
1121
|
+
})
|
|
1122
|
+
];
|
|
1051
1123
|
},
|
|
1052
1124
|
addProseMirrorPlugins() {
|
|
1053
1125
|
const t = [], { protocols: n, defaultProtocol: e } = this.options;
|
|
1054
|
-
return this.options.autolink && t.push(
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1126
|
+
return this.options.autolink && t.push(
|
|
1127
|
+
cn({
|
|
1128
|
+
type: this.type,
|
|
1129
|
+
defaultProtocol: this.options.defaultProtocol,
|
|
1130
|
+
validate: (s) => this.options.isAllowedUri(s, {
|
|
1131
|
+
defaultValidate: (o) => !!I(o, n),
|
|
1132
|
+
protocols: n,
|
|
1133
|
+
defaultProtocol: e
|
|
1134
|
+
}),
|
|
1135
|
+
shouldAutoLink: this.options.shouldAutoLink
|
|
1136
|
+
})
|
|
1137
|
+
), t.push(
|
|
1138
|
+
un({
|
|
1139
|
+
type: this.type,
|
|
1140
|
+
editor: this.editor,
|
|
1141
|
+
openOnClick: this.options.openOnClick === "whenNotEditable" ? !0 : this.options.openOnClick,
|
|
1142
|
+
enableClickSelection: this.options.enableClickSelection
|
|
1143
|
+
})
|
|
1144
|
+
), this.options.linkOnPaste && t.push(
|
|
1145
|
+
En({
|
|
1146
|
+
editor: this.editor,
|
|
1147
|
+
defaultProtocol: this.options.defaultProtocol,
|
|
1148
|
+
type: this.type,
|
|
1149
|
+
shouldAutoLink: this.options.shouldAutoLink
|
|
1150
|
+
})
|
|
1151
|
+
), t;
|
|
1074
1152
|
}
|
|
1075
|
-
});
|
|
1076
|
-
var Tn = An;
|
|
1153
|
+
}), Tn = An;
|
|
1077
1154
|
export {
|
|
1078
1155
|
An as Link,
|
|
1079
1156
|
Tn as default,
|
|
1080
|
-
|
|
1157
|
+
I as isAllowedUri,
|
|
1081
1158
|
Ln as pasteRegex
|
|
1082
1159
|
};
|