reactjs-tiptap-editor 0.4.1 → 1.0.0
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/lib/ActionMenuButton-BKOg7hkq.js +38 -0
- package/lib/ActionMenuButton-DLQyd_gx.cjs +1 -0
- package/lib/Attachment.cjs +2 -2
- package/lib/Attachment.d.cts +43 -55
- package/lib/Attachment.d.ts +43 -55
- package/lib/Attachment.js +129 -99
- package/lib/Blockquote.cjs +3 -3
- package/lib/Blockquote.d.cts +43 -55
- package/lib/Blockquote.d.ts +43 -55
- package/lib/Blockquote.js +50 -22
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.d.cts +43 -55
- package/lib/Bold.d.ts +43 -55
- package/lib/Bold.js +48 -20
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.d.cts +43 -55
- package/lib/BulletList.d.ts +43 -55
- package/lib/BulletList.js +38 -9
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.d.cts +43 -55
- package/lib/Clear.d.ts +43 -55
- package/lib/Clear.js +32 -6
- package/lib/Code.cjs +1 -1
- package/lib/Code.d.cts +43 -55
- package/lib/Code.d.ts +43 -55
- package/lib/Code.js +53 -25
- package/lib/CodeBlock.cjs +35 -35
- package/lib/CodeBlock.d.cts +43 -55
- package/lib/CodeBlock.d.ts +43 -55
- package/lib/CodeBlock.js +605 -590
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.d.cts +44 -56
- package/lib/CodeView.d.ts +44 -56
- package/lib/CodeView.js +49 -21
- package/lib/Color.cjs +1 -1
- package/lib/Color.d.cts +47 -55
- package/lib/Color.d.ts +47 -55
- package/lib/Color.js +123 -79
- package/lib/Column.cjs +1 -0
- package/lib/{Document.d.cts → Column.d.cts} +49 -58
- package/lib/{Document.d.ts → Column.d.ts} +49 -58
- package/lib/Column.js +217 -0
- package/lib/{Drawer-CaAfmqNo.js → Drawer-DZ5jvmrX.js} +404 -394
- package/lib/Drawer-SRhwOc6T.cjs +1 -0
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.d.cts +43 -55
- package/lib/Drawer.d.ts +43 -55
- package/lib/Drawer.js +6 -5
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.d.cts +43 -60
- package/lib/Emoji.d.ts +43 -60
- package/lib/Emoji.js +377 -392
- package/lib/Excalidraw-DwBRXEtC.js +345 -0
- package/lib/Excalidraw-ZN3DQvDC.cjs +1 -0
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.d.cts +43 -55
- package/lib/Excalidraw.d.ts +43 -55
- package/lib/Excalidraw.js +6 -4
- package/lib/ExportPdf.cjs +5 -5
- package/lib/ExportPdf.d.cts +43 -55
- package/lib/ExportPdf.d.ts +43 -55
- package/lib/ExportPdf.js +60 -32
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.d.cts +44 -56
- package/lib/ExportWord.d.ts +44 -56
- package/lib/ExportWord.js +84 -21
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.d.cts +57 -58
- package/lib/FontFamily.d.ts +57 -58
- package/lib/FontFamily.js +72 -74
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.d.cts +54 -58
- package/lib/FontSize.d.ts +54 -58
- package/lib/FontSize.js +72 -64
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.d.cts +57 -55
- package/lib/Heading.d.ts +57 -55
- package/lib/Heading.js +91 -73
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.d.cts +47 -55
- package/lib/Highlight.d.ts +47 -55
- package/lib/Highlight.js +152 -21
- package/lib/History.cjs +1 -1
- package/lib/History.d.cts +45 -55
- package/lib/History.d.ts +45 -55
- package/lib/History.js +976 -53
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.d.cts +43 -55
- package/lib/HorizontalRule.d.ts +43 -55
- package/lib/HorizontalRule.js +97 -17
- package/lib/Icon-DUpv2cI6.cjs +1 -0
- package/lib/Icon-jKs8Hr6p.js +11 -0
- package/lib/Iframe-CmXkEqOd.js +431 -0
- package/lib/Iframe-Cvca2G7X.cjs +1 -0
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.d.cts +42 -61
- package/lib/Iframe.d.ts +42 -61
- package/lib/Iframe.js +6 -4
- package/lib/Image.cjs +1 -1
- package/lib/Image.d.cts +43 -56
- package/lib/Image.d.ts +43 -56
- package/lib/Image.js +848 -5
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.d.cts +44 -58
- package/lib/ImageGif.d.ts +44 -58
- package/lib/ImageGif.js +424 -5
- package/lib/ImportWord.cjs +48 -48
- package/lib/ImportWord.d.cts +44 -56
- package/lib/ImportWord.d.ts +44 -56
- package/lib/ImportWord.js +2596 -2588
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.d.cts +43 -55
- package/lib/Indent.d.ts +43 -55
- package/lib/Indent.js +97 -27
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.d.cts +43 -55
- package/lib/Italic.d.ts +43 -55
- package/lib/Italic.js +47 -19
- package/lib/Katex-DsYXsjSS.js +2740 -0
- package/lib/Katex-XfrNne6U.cjs +4 -0
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.d.cts +43 -55
- package/lib/Katex.d.ts +43 -55
- package/lib/Katex.js +5 -196
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.d.cts +45 -61
- package/lib/LineHeight.d.ts +45 -61
- package/lib/LineHeight.js +71 -112
- package/lib/Link.cjs +1 -1
- package/lib/Link.d.cts +44 -58
- package/lib/Link.d.ts +44 -58
- package/lib/Link.js +3 -3
- package/lib/LinkEditBlock-BZenZq-Z.cjs +5 -0
- package/lib/LinkEditBlock-CB8yIffE.js +1241 -0
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.d.cts +40 -55
- package/lib/Mention.d.ts +40 -55
- package/lib/Mention.js +114 -130
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.d.cts +43 -55
- package/lib/Mermaid.d.ts +43 -55
- package/lib/Mermaid.js +177 -165
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.d.cts +58 -57
- package/lib/MoreMark.d.ts +58 -57
- package/lib/MoreMark.js +125 -55
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.d.cts +43 -55
- package/lib/OrderedList.d.ts +43 -55
- package/lib/OrderedList.js +37 -9
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.d.cts +43 -58
- package/lib/SearchAndReplace.d.ts +43 -58
- package/lib/SearchAndReplace.js +221 -197
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.d.cts +55 -62
- package/lib/SlashCommand.d.ts +55 -62
- package/lib/SlashCommand.js +235 -249
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.d.cts +43 -55
- package/lib/Strike.d.ts +43 -55
- package/lib/Strike.js +39 -11
- package/lib/Table-B1j1Ebmh.cjs +9 -0
- package/lib/Table-Db8TcQX8.js +1984 -0
- package/lib/Table.cjs +1 -9
- package/lib/Table.d.cts +44 -58
- package/lib/Table.d.ts +44 -58
- package/lib/Table.js +3 -558
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.d.cts +43 -55
- package/lib/TaskList.d.ts +43 -55
- package/lib/TaskList.js +38 -10
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.d.cts +56 -55
- package/lib/TextAlign.d.ts +56 -55
- package/lib/TextAlign.js +108 -101
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.d.cts +72 -55
- package/lib/TextDirection.d.ts +72 -55
- package/lib/TextDirection.js +105 -112
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.d.cts +43 -55
- package/lib/TextUnderline.d.ts +43 -55
- package/lib/TextUnderline.js +46 -18
- package/lib/{Twitter-BFULyqdR.js → Twitter-CXmmjz9R.js} +536 -498
- package/lib/Twitter-CtVTIWJW.cjs +1 -0
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.d.cts +43 -55
- package/lib/Twitter.d.ts +43 -55
- package/lib/Twitter.js +5 -4
- package/lib/Video.cjs +1 -1
- package/lib/Video.d.cts +43 -55
- package/lib/Video.d.ts +43 -55
- package/lib/Video.js +261 -4
- package/lib/_commonjsHelpers-BItOPCY9.js +28 -0
- package/lib/_commonjsHelpers-BTDuMlIz.cjs +1 -0
- package/lib/bubble.cjs +2 -0
- package/lib/{bubble-extra.d.cts → bubble.d.cts} +69 -70
- package/lib/{bubble-extra.d.ts → bubble.d.ts} +69 -70
- package/lib/bubble.js +1925 -0
- package/lib/button-B12K7BJ4.cjs +1 -0
- package/lib/button-DXMsXUEn.js +43 -0
- package/lib/clsx-C11secjj.cjs +1 -0
- package/lib/clsx-OuTLNxxd.js +16 -0
- package/lib/delete-node-CosiBes5.cjs +1 -0
- package/lib/delete-node-IyVmiRbI.js +22 -0
- package/lib/dialog-CaCS-W5S.cjs +1 -0
- package/lib/dialog-PtQivpHS.js +100 -0
- package/lib/dom-dataset-BqoJhJXt.cjs +1 -0
- package/lib/dom-dataset-CIEeltF6.js +47 -0
- package/lib/dropdown-menu-BPp2Z_U-.js +136 -0
- package/lib/dropdown-menu-CdSm4emp.cjs +1 -0
- package/lib/file-BLas99n7.js +43 -0
- package/lib/file-i7e4nQY2.cjs +1 -0
- package/lib/floating-ui.dom-U1vPFQ5f.js +1151 -0
- package/lib/floating-ui.dom-VCrc58uF.cjs +1 -0
- package/lib/icons-Cllpys39.js +362 -0
- package/lib/icons-CqHjeW5T.cjs +1 -0
- package/lib/index-BH4bc3jN.cjs +33 -0
- package/lib/index-BPfVXs5_.js +2380 -0
- package/lib/index-Bnmd0WvY.js +1631 -0
- package/lib/{index-Ch6dBBad.js → index-CBce_TWY.js} +40 -42
- package/lib/{index-5iBZLua9.cjs → index-D-5U8dY8.cjs} +8 -8
- package/lib/{index-ByurDDMv.js → index-D2TUfKkC.js} +2 -2
- package/lib/index-DV5kbgRU.cjs +1 -0
- package/lib/{index-LmrOdnen.js → index-DYkucCoF.js} +396 -495
- package/lib/index-Dfmm6FTT.cjs +1 -0
- package/lib/index-DnWWK9F_.js +6374 -0
- package/lib/index-DzcKxutn.js +632 -0
- package/lib/index-DzvuNTxo.cjs +4 -0
- package/lib/{index-BeCTd5v2.cjs → index-N--9MohJ.cjs} +1 -1
- package/lib/index-RfTlOzIr.cjs +22 -0
- package/lib/index.cjs +132 -1
- package/lib/index.d.cts +45 -296
- package/lib/index.d.ts +45 -296
- package/lib/index.js +243 -2
- package/lib/input-_ECRfn3Y.cjs +1 -0
- package/lib/input-wJ9PDEzZ.js +21 -0
- package/lib/isNumber-ClPupm7P.cjs +1 -0
- package/lib/isNumber-fpLGS0AZ.js +15 -0
- package/lib/label-BkgAe7IY.cjs +1 -0
- package/lib/label-CGdLYWv7.js +19 -0
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.d.cts +5421 -73
- package/lib/locale-bundle.d.ts +5421 -73
- package/lib/locale-bundle.js +9 -7
- package/lib/popover-BgmUNMHj.cjs +1 -0
- package/lib/popover-CAuEW0Mr.js +23 -0
- package/lib/separator-CuBW_w98.js +328 -0
- package/lib/separator-DRIrVZ2N.cjs +1 -0
- package/lib/store-DX599H5W.js +10 -0
- package/lib/store-WStcMOiW.cjs +1 -0
- package/lib/style.css +1 -1
- package/lib/switch-CnLJ7Y-b.cjs +1 -0
- package/lib/switch-Coix_FA1.js +27 -0
- package/lib/tabs-B5mVSN1I.js +46 -0
- package/lib/tabs-BoLCMcCI.cjs +1 -0
- package/lib/textarea-B-6zTKQz.cjs +1 -0
- package/lib/{textarea-aPtytkDx.js → textarea-DUUM1jZd.js} +1 -1
- package/lib/theme-B7aAsK_T.js +15 -0
- package/lib/theme-D8_cxGqB.cjs +1 -0
- package/lib/throttle-CdwDrFpn.js +249 -0
- package/lib/throttle-qX7Yjtsg.cjs +1 -0
- package/lib/toggle-Cdp4IT2U.js +85 -0
- package/lib/toggle-D41PzQLJ.cjs +1 -0
- package/lib/tooltip-BuEiE96N.cjs +1 -0
- package/lib/tooltip-CopwsU8q.js +23 -0
- package/lib/updatePosition-8Sdem5jb.cjs +1 -0
- package/lib/updatePosition-BPmcE0YD.js +215 -0
- package/lib/use-toast-Bz3QCOtE.cjs +1 -0
- package/lib/use-toast-Crf7-q5H.js +98 -0
- package/lib/useButtonProps-BsEd4zYM.js +141 -0
- package/lib/useButtonProps-C6Vpn190.cjs +1 -0
- package/package.json +22 -105
- package/lib/ActionMenuButton-CYdM1xx5.cjs +0 -1
- package/lib/ActionMenuButton-DKRF6oa0.js +0 -33
- package/lib/BaseKit.cjs +0 -3
- package/lib/BaseKit.d.cts +0 -481
- package/lib/BaseKit.d.ts +0 -481
- package/lib/BaseKit.js +0 -132
- package/lib/Document.cjs +0 -1
- package/lib/Document.js +0 -9
- package/lib/Drawer-CdvCMSzN.cjs +0 -1
- package/lib/Excalidraw-BbMQhNvs.cjs +0 -1
- package/lib/Excalidraw-CVWz2Vyn.js +0 -290
- package/lib/FormatPainter.cjs +0 -1
- package/lib/FormatPainter.d.cts +0 -372
- package/lib/FormatPainter.d.ts +0 -372
- package/lib/FormatPainter.js +0 -76
- package/lib/ListItem.cjs +0 -1
- package/lib/ListItem.d.cts +0 -290
- package/lib/ListItem.d.ts +0 -290
- package/lib/ListItem.js +0 -7
- package/lib/MultiColumn.cjs +0 -1
- package/lib/MultiColumn.d.cts +0 -294
- package/lib/MultiColumn.d.ts +0 -294
- package/lib/MultiColumn.js +0 -8
- package/lib/RichTextEditor-CxvwGvQG.cjs +0 -142
- package/lib/RichTextEditor-DGcKEUGr.js +0 -22166
- package/lib/Selection.cjs +0 -1
- package/lib/Selection.d.cts +0 -289
- package/lib/Selection.d.ts +0 -289
- package/lib/Selection.js +0 -25
- package/lib/SubAndSuperScript.cjs +0 -1
- package/lib/SubAndSuperScript.d.cts +0 -377
- package/lib/SubAndSuperScript.d.ts +0 -377
- package/lib/SubAndSuperScript.js +0 -43
- package/lib/TableOfContent.cjs +0 -1
- package/lib/TableOfContent.d.cts +0 -291
- package/lib/TableOfContent.d.ts +0 -291
- package/lib/TableOfContent.js +0 -185
- package/lib/TextBubble.cjs +0 -1
- package/lib/TextBubble.d.cts +0 -362
- package/lib/TextBubble.d.ts +0 -362
- package/lib/TextBubble.js +0 -133
- package/lib/TrailingNode.cjs +0 -1
- package/lib/TrailingNode.d.cts +0 -297
- package/lib/TrailingNode.d.ts +0 -297
- package/lib/TrailingNode.js +0 -41
- package/lib/Twitter-Cutpkh3h.cjs +0 -1
- package/lib/bubble-extra.cjs +0 -2
- package/lib/bubble-extra.js +0 -631
- package/lib/dom-dataset-_6-diIRQ.cjs +0 -33
- package/lib/dom-dataset-lYeH6gfI.js +0 -2361
- package/lib/index-6D1J-A-o.cjs +0 -1
- package/lib/index-B96Cclrj.cjs +0 -3
- package/lib/index-BBz7Nmv9.js +0 -55
- package/lib/index-CUogRI7j.cjs +0 -1
- package/lib/index-DF2Lp4HZ.cjs +0 -100
- package/lib/index-D_L6n8O8.js +0 -76
- package/lib/index-Dbvi-Bvh.cjs +0 -1
- package/lib/index-DpCrt7xs.cjs +0 -1
- package/lib/index-DsAX1Vq8.cjs +0 -1
- package/lib/index-Dy4DlW9o.js +0 -12
- package/lib/index-J3jHHZ4d.js +0 -200
- package/lib/index-VvXaaKe3.js +0 -898
- package/lib/index-kbO3iWqL.js +0 -13432
- package/lib/textarea-DFo_aXnj.cjs +0 -1
|
@@ -0,0 +1,1241 @@
|
|
|
1
|
+
import { jsx as C, Fragment as De, jsxs as st } from "react/jsx-runtime";
|
|
2
|
+
import { useState as Gt, useRef as me, useEffect as Ue } from "react";
|
|
3
|
+
import { a as je } from "./index-BPfVXs5_.js";
|
|
4
|
+
import { I as Ce } from "./Icon-jKs8Hr6p.js";
|
|
5
|
+
import { M as Be, f as ze, m as $t, z as We, B as Fe, C as Ke, G as _e, H as Ge } from "./index-DnWWK9F_.js";
|
|
6
|
+
import { Plugin as ee, PluginKey as ne } from "@tiptap/pm/state";
|
|
7
|
+
import { A as $e } from "./toggle-Cdp4IT2U.js";
|
|
8
|
+
import { u as Qe, a as qe, d as Je } from "./useButtonProps-BsEd4zYM.js";
|
|
9
|
+
import { u as Ve } from "./index-DYkucCoF.js";
|
|
10
|
+
import { S as Ye } from "./switch-Coix_FA1.js";
|
|
11
|
+
import { L as jt } from "./label-CGdLYWv7.js";
|
|
12
|
+
import { I as pe } from "./input-wJ9PDEzZ.js";
|
|
13
|
+
import { B as Xe } from "./button-DXMsXUEn.js";
|
|
14
|
+
import { P as Ze, a as tn, b as en } from "./popover-CAuEW0Mr.js";
|
|
15
|
+
const nn = "aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2", on = "ελ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", Qt = "numeric", qt = "ascii", Jt = "alpha", $ = "asciinumeric", G = "alphanumeric", Vt = "domain", be = "emoji", sn = "scheme", rn = "slashscheme", Bt = "whitespace";
|
|
16
|
+
function an(t, n) {
|
|
17
|
+
return t in n || (n[t] = []), n[t];
|
|
18
|
+
}
|
|
19
|
+
function j(t, n, e) {
|
|
20
|
+
n[Qt] && (n[$] = !0, n[G] = !0), n[qt] && (n[$] = !0, n[Jt] = !0), n[$] && (n[G] = !0), n[Jt] && (n[G] = !0), n[G] && (n[Vt] = !0), n[be] && (n[Vt] = !0);
|
|
21
|
+
for (const i in n) {
|
|
22
|
+
const o = an(i, e);
|
|
23
|
+
o.indexOf(t) < 0 && o.push(t);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function ln(t, n) {
|
|
27
|
+
const e = {};
|
|
28
|
+
for (const i in n)
|
|
29
|
+
n[i].indexOf(t) >= 0 && (e[i] = !0);
|
|
30
|
+
return e;
|
|
31
|
+
}
|
|
32
|
+
function R(t = null) {
|
|
33
|
+
this.j = {}, this.jr = [], this.jd = null, this.t = t;
|
|
34
|
+
}
|
|
35
|
+
R.groups = {};
|
|
36
|
+
R.prototype = {
|
|
37
|
+
accepts() {
|
|
38
|
+
return !!this.t;
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* Follow an existing transition from the given input to the next state.
|
|
42
|
+
* Does not mutate.
|
|
43
|
+
* @param {string} input character or token type to transition on
|
|
44
|
+
* @returns {?State<T>} the next state, if any
|
|
45
|
+
*/
|
|
46
|
+
go(t) {
|
|
47
|
+
const n = this, e = n.j[t];
|
|
48
|
+
if (e)
|
|
49
|
+
return e;
|
|
50
|
+
for (let i = 0; i < n.jr.length; i++) {
|
|
51
|
+
const o = n.jr[i][0], s = n.jr[i][1];
|
|
52
|
+
if (s && o.test(t))
|
|
53
|
+
return s;
|
|
54
|
+
}
|
|
55
|
+
return n.jd;
|
|
56
|
+
},
|
|
57
|
+
/**
|
|
58
|
+
* Whether the state has a transition for the given input. Set the second
|
|
59
|
+
* argument to true to only look for an exact match (and not a default or
|
|
60
|
+
* regular-expression-based transition)
|
|
61
|
+
* @param {string} input
|
|
62
|
+
* @param {boolean} exactOnly
|
|
63
|
+
*/
|
|
64
|
+
has(t, n = !1) {
|
|
65
|
+
return n ? t in this.j : !!this.go(t);
|
|
66
|
+
},
|
|
67
|
+
/**
|
|
68
|
+
* Short for "transition all"; create a transition from the array of items
|
|
69
|
+
* in the given list to the same final resulting state.
|
|
70
|
+
* @param {string | string[]} inputs Group of inputs to transition on
|
|
71
|
+
* @param {Transition<T> | State<T>} [next] Transition options
|
|
72
|
+
* @param {Flags} [flags] Collections flags to add token to
|
|
73
|
+
* @param {Collections<T>} [groups] Master list of token groups
|
|
74
|
+
*/
|
|
75
|
+
ta(t, n, e, i) {
|
|
76
|
+
for (let o = 0; o < t.length; o++)
|
|
77
|
+
this.tt(t[o], n, e, i);
|
|
78
|
+
},
|
|
79
|
+
/**
|
|
80
|
+
* Short for "take regexp transition"; defines a transition for this state
|
|
81
|
+
* when it encounters a token which matches the given regular expression
|
|
82
|
+
* @param {RegExp} regexp Regular expression transition (populate first)
|
|
83
|
+
* @param {T | State<T>} [next] Transition options
|
|
84
|
+
* @param {Flags} [flags] Collections flags to add token to
|
|
85
|
+
* @param {Collections<T>} [groups] Master list of token groups
|
|
86
|
+
* @returns {State<T>} taken after the given input
|
|
87
|
+
*/
|
|
88
|
+
tr(t, n, e, i) {
|
|
89
|
+
i = i || R.groups;
|
|
90
|
+
let o;
|
|
91
|
+
return n && n.j ? o = n : (o = new R(n), e && i && j(n, e, i)), this.jr.push([t, o]), o;
|
|
92
|
+
},
|
|
93
|
+
/**
|
|
94
|
+
* Short for "take transitions", will take as many sequential transitions as
|
|
95
|
+
* the length of the given input and returns the
|
|
96
|
+
* resulting final state.
|
|
97
|
+
* @param {string | string[]} input
|
|
98
|
+
* @param {T | State<T>} [next] Transition options
|
|
99
|
+
* @param {Flags} [flags] Collections flags to add token to
|
|
100
|
+
* @param {Collections<T>} [groups] Master list of token groups
|
|
101
|
+
* @returns {State<T>} taken after the given input
|
|
102
|
+
*/
|
|
103
|
+
ts(t, n, e, i) {
|
|
104
|
+
let o = this;
|
|
105
|
+
const s = t.length;
|
|
106
|
+
if (!s)
|
|
107
|
+
return o;
|
|
108
|
+
for (let a = 0; a < s - 1; a++)
|
|
109
|
+
o = o.tt(t[a]);
|
|
110
|
+
return o.tt(t[s - 1], n, e, i);
|
|
111
|
+
},
|
|
112
|
+
/**
|
|
113
|
+
* Short for "take transition", this is a method for building/working with
|
|
114
|
+
* state machines.
|
|
115
|
+
*
|
|
116
|
+
* If a state already exists for the given input, returns it.
|
|
117
|
+
*
|
|
118
|
+
* If a token is specified, that state will emit that token when reached by
|
|
119
|
+
* the linkify engine.
|
|
120
|
+
*
|
|
121
|
+
* If no state exists, it will be initialized with some default transitions
|
|
122
|
+
* that resemble existing default transitions.
|
|
123
|
+
*
|
|
124
|
+
* If a state is given for the second argument, that state will be
|
|
125
|
+
* transitioned to on the given input regardless of what that input
|
|
126
|
+
* previously did.
|
|
127
|
+
*
|
|
128
|
+
* Specify a token group flags to define groups that this token belongs to.
|
|
129
|
+
* The token will be added to corresponding entires in the given groups
|
|
130
|
+
* object.
|
|
131
|
+
*
|
|
132
|
+
* @param {string} input character, token type to transition on
|
|
133
|
+
* @param {T | State<T>} [next] Transition options
|
|
134
|
+
* @param {Flags} [flags] Collections flags to add token to
|
|
135
|
+
* @param {Collections<T>} [groups] Master list of groups
|
|
136
|
+
* @returns {State<T>} taken after the given input
|
|
137
|
+
*/
|
|
138
|
+
tt(t, n, e, i) {
|
|
139
|
+
i = i || R.groups;
|
|
140
|
+
const o = this;
|
|
141
|
+
if (n && n.j)
|
|
142
|
+
return o.j[t] = n, n;
|
|
143
|
+
const s = n;
|
|
144
|
+
let a, l = o.go(t);
|
|
145
|
+
if (l ? (a = new R(), Object.assign(a.j, l.j), a.jr.push.apply(a.jr, l.jr), a.jd = l.jd, a.t = l.t) : a = new R(), s) {
|
|
146
|
+
if (i)
|
|
147
|
+
if (a.t && typeof a.t == "string") {
|
|
148
|
+
const d = Object.assign(ln(a.t, i), e);
|
|
149
|
+
j(s, d, i);
|
|
150
|
+
} else e && j(s, e, i);
|
|
151
|
+
a.t = s;
|
|
152
|
+
}
|
|
153
|
+
return o.j[t] = a, a;
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
const f = (t, n, e, i, o) => t.ta(n, e, i, o), L = (t, n, e, i, o) => t.tr(n, e, i, o), ge = (t, n, e, i, o) => t.ts(n, e, i, o), r = (t, n, e, i, o) => t.tt(n, e, i, o), P = "WORD", Yt = "UWORD", Re = "ASCIINUMERICAL", ye = "ALPHANUMERICAL", X = "LOCALHOST", Xt = "TLD", Zt = "UTLD", rt = "SCHEME", z = "SLASH_SCHEME", ie = "NUM", te = "WS", oe = "NL", Q = "OPENBRACE", q = "CLOSEBRACE", at = "OPENBRACKET", lt = "CLOSEBRACKET", ct = "OPENPAREN", ut = "CLOSEPAREN", dt = "OPENANGLEBRACKET", ht = "CLOSEANGLEBRACKET", ft = "FULLWIDTHLEFTPAREN", mt = "FULLWIDTHRIGHTPAREN", pt = "LEFTCORNERBRACKET", gt = "RIGHTCORNERBRACKET", Et = "LEFTWHITECORNERBRACKET", kt = "RIGHTWHITECORNERBRACKET", At = "FULLWIDTHLESSTHAN", Lt = "FULLWIDTHGREATERTHAN", Tt = "AMPERSAND", xt = "APOSTROPHE", Ct = "ASTERISK", M = "AT", bt = "BACKSLASH", Rt = "BACKTICK", yt = "CARET", D = "COLON", se = "COMMA", Ot = "DOLLAR", S = "DOT", St = "EQUALS", re = "EXCLAMATION", O = "HYPHEN", J = "PERCENT", Nt = "PIPE", vt = "PLUS", It = "POUND", V = "QUERY", ae = "QUOTE", Oe = "FULLWIDTHMIDDLEDOT", le = "SEMI", N = "SLASH", Y = "TILDE", wt = "UNDERSCORE", Se = "EMOJI", Pt = "SYM";
|
|
157
|
+
var Ne = /* @__PURE__ */ Object.freeze({
|
|
158
|
+
__proto__: null,
|
|
159
|
+
ALPHANUMERICAL: ye,
|
|
160
|
+
AMPERSAND: Tt,
|
|
161
|
+
APOSTROPHE: xt,
|
|
162
|
+
ASCIINUMERICAL: Re,
|
|
163
|
+
ASTERISK: Ct,
|
|
164
|
+
AT: M,
|
|
165
|
+
BACKSLASH: bt,
|
|
166
|
+
BACKTICK: Rt,
|
|
167
|
+
CARET: yt,
|
|
168
|
+
CLOSEANGLEBRACKET: ht,
|
|
169
|
+
CLOSEBRACE: q,
|
|
170
|
+
CLOSEBRACKET: lt,
|
|
171
|
+
CLOSEPAREN: ut,
|
|
172
|
+
COLON: D,
|
|
173
|
+
COMMA: se,
|
|
174
|
+
DOLLAR: Ot,
|
|
175
|
+
DOT: S,
|
|
176
|
+
EMOJI: Se,
|
|
177
|
+
EQUALS: St,
|
|
178
|
+
EXCLAMATION: re,
|
|
179
|
+
FULLWIDTHGREATERTHAN: Lt,
|
|
180
|
+
FULLWIDTHLEFTPAREN: ft,
|
|
181
|
+
FULLWIDTHLESSTHAN: At,
|
|
182
|
+
FULLWIDTHMIDDLEDOT: Oe,
|
|
183
|
+
FULLWIDTHRIGHTPAREN: mt,
|
|
184
|
+
HYPHEN: O,
|
|
185
|
+
LEFTCORNERBRACKET: pt,
|
|
186
|
+
LEFTWHITECORNERBRACKET: Et,
|
|
187
|
+
LOCALHOST: X,
|
|
188
|
+
NL: oe,
|
|
189
|
+
NUM: ie,
|
|
190
|
+
OPENANGLEBRACKET: dt,
|
|
191
|
+
OPENBRACE: Q,
|
|
192
|
+
OPENBRACKET: at,
|
|
193
|
+
OPENPAREN: ct,
|
|
194
|
+
PERCENT: J,
|
|
195
|
+
PIPE: Nt,
|
|
196
|
+
PLUS: vt,
|
|
197
|
+
POUND: It,
|
|
198
|
+
QUERY: V,
|
|
199
|
+
QUOTE: ae,
|
|
200
|
+
RIGHTCORNERBRACKET: gt,
|
|
201
|
+
RIGHTWHITECORNERBRACKET: kt,
|
|
202
|
+
SCHEME: rt,
|
|
203
|
+
SEMI: le,
|
|
204
|
+
SLASH: N,
|
|
205
|
+
SLASH_SCHEME: z,
|
|
206
|
+
SYM: Pt,
|
|
207
|
+
TILDE: Y,
|
|
208
|
+
TLD: Xt,
|
|
209
|
+
UNDERSCORE: wt,
|
|
210
|
+
UTLD: Zt,
|
|
211
|
+
UWORD: Yt,
|
|
212
|
+
WORD: P,
|
|
213
|
+
WS: te
|
|
214
|
+
});
|
|
215
|
+
const I = /[a-z]/, _ = new RegExp("\\p{L}", "u"), zt = new RegExp("\\p{Emoji}", "u"), w = /\d/, Wt = /\s/, Ee = "\r", Ft = `
|
|
216
|
+
`, cn = "️", un = "", Kt = "";
|
|
217
|
+
let nt = null, it = null;
|
|
218
|
+
function dn(t = []) {
|
|
219
|
+
const n = {};
|
|
220
|
+
R.groups = n;
|
|
221
|
+
const e = new R();
|
|
222
|
+
nt == null && (nt = ke(nn)), it == null && (it = ke(on)), r(e, "'", xt), r(e, "{", Q), r(e, "}", q), r(e, "[", at), r(e, "]", lt), r(e, "(", ct), r(e, ")", ut), r(e, "<", dt), r(e, ">", ht), r(e, "(", ft), r(e, ")", mt), r(e, "「", pt), r(e, "」", gt), r(e, "『", Et), r(e, "』", kt), r(e, "<", At), r(e, ">", Lt), r(e, "&", Tt), r(e, "*", Ct), r(e, "@", M), r(e, "`", Rt), r(e, "^", yt), r(e, ":", D), r(e, ",", se), r(e, "$", Ot), r(e, ".", S), r(e, "=", St), r(e, "!", re), r(e, "-", O), r(e, "%", J), r(e, "|", Nt), r(e, "+", vt), r(e, "#", It), r(e, "?", V), r(e, '"', ae), r(e, "/", N), r(e, ";", le), r(e, "~", Y), r(e, "_", wt), r(e, "\\", bt), r(e, "・", Oe);
|
|
223
|
+
const i = L(e, w, ie, {
|
|
224
|
+
[Qt]: !0
|
|
225
|
+
});
|
|
226
|
+
L(i, w, i);
|
|
227
|
+
const o = L(i, I, Re, {
|
|
228
|
+
[$]: !0
|
|
229
|
+
}), s = L(i, _, ye, {
|
|
230
|
+
[G]: !0
|
|
231
|
+
}), a = L(e, I, P, {
|
|
232
|
+
[qt]: !0
|
|
233
|
+
});
|
|
234
|
+
L(a, w, o), L(a, I, a), L(o, w, o), L(o, I, o);
|
|
235
|
+
const l = L(e, _, Yt, {
|
|
236
|
+
[Jt]: !0
|
|
237
|
+
});
|
|
238
|
+
L(l, I), L(l, w, s), L(l, _, l), L(s, w, s), L(s, I), L(s, _, s);
|
|
239
|
+
const d = r(e, Ft, oe, {
|
|
240
|
+
[Bt]: !0
|
|
241
|
+
}), h = r(e, Ee, te, {
|
|
242
|
+
[Bt]: !0
|
|
243
|
+
}), c = L(e, Wt, te, {
|
|
244
|
+
[Bt]: !0
|
|
245
|
+
});
|
|
246
|
+
r(e, Kt, c), r(h, Ft, d), r(h, Kt, c), L(h, Wt, c), r(c, Ee), r(c, Ft), L(c, Wt, c), r(c, Kt, c);
|
|
247
|
+
const u = L(e, zt, Se, {
|
|
248
|
+
[be]: !0
|
|
249
|
+
});
|
|
250
|
+
r(u, "#"), L(u, zt, u), r(u, cn, u);
|
|
251
|
+
const m = r(u, un);
|
|
252
|
+
r(m, "#"), L(m, zt, u);
|
|
253
|
+
const g = [[I, a], [w, o]], b = [[I, null], [_, l], [w, s]];
|
|
254
|
+
for (let E = 0; E < nt.length; E++)
|
|
255
|
+
H(e, nt[E], Xt, P, g);
|
|
256
|
+
for (let E = 0; E < it.length; E++)
|
|
257
|
+
H(e, it[E], Zt, Yt, b);
|
|
258
|
+
j(Xt, {
|
|
259
|
+
tld: !0,
|
|
260
|
+
ascii: !0
|
|
261
|
+
}, n), j(Zt, {
|
|
262
|
+
utld: !0,
|
|
263
|
+
alpha: !0
|
|
264
|
+
}, n), H(e, "file", rt, P, g), H(e, "mailto", rt, P, g), H(e, "http", z, P, g), H(e, "https", z, P, g), H(e, "ftp", z, P, g), H(e, "ftps", z, P, g), j(rt, {
|
|
265
|
+
scheme: !0,
|
|
266
|
+
ascii: !0
|
|
267
|
+
}, n), j(z, {
|
|
268
|
+
slashscheme: !0,
|
|
269
|
+
ascii: !0
|
|
270
|
+
}, n), t = t.sort((E, T) => E[0] > T[0] ? 1 : -1);
|
|
271
|
+
for (let E = 0; E < t.length; E++) {
|
|
272
|
+
const T = t[E][0], A = t[E][1] ? {
|
|
273
|
+
[sn]: !0
|
|
274
|
+
} : {
|
|
275
|
+
[rn]: !0
|
|
276
|
+
};
|
|
277
|
+
T.indexOf("-") >= 0 ? A[Vt] = !0 : I.test(T) ? w.test(T) ? A[$] = !0 : A[qt] = !0 : A[Qt] = !0, ge(e, T, T, A);
|
|
278
|
+
}
|
|
279
|
+
return ge(e, "localhost", X, {
|
|
280
|
+
ascii: !0
|
|
281
|
+
}), e.jd = new R(Pt), {
|
|
282
|
+
start: e,
|
|
283
|
+
tokens: Object.assign({
|
|
284
|
+
groups: n
|
|
285
|
+
}, Ne)
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
function ve(t, n) {
|
|
289
|
+
const e = hn(n.replace(/[A-Z]/g, (l) => l.toLowerCase())), i = e.length, o = [];
|
|
290
|
+
let s = 0, a = 0;
|
|
291
|
+
for (; a < i; ) {
|
|
292
|
+
let l = t, d = null, h = 0, c = null, u = -1, m = -1;
|
|
293
|
+
for (; a < i && (d = l.go(e[a])); )
|
|
294
|
+
l = d, l.accepts() ? (u = 0, m = 0, c = l) : u >= 0 && (u += e[a].length, m++), h += e[a].length, s += e[a].length, a++;
|
|
295
|
+
s -= u, a -= m, h -= u, o.push({
|
|
296
|
+
t: c.t,
|
|
297
|
+
// token type/name
|
|
298
|
+
v: n.slice(s - h, s),
|
|
299
|
+
// string value
|
|
300
|
+
s: s - h,
|
|
301
|
+
// start index
|
|
302
|
+
e: s
|
|
303
|
+
// end index (excluding)
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
return o;
|
|
307
|
+
}
|
|
308
|
+
function hn(t) {
|
|
309
|
+
const n = [], e = t.length;
|
|
310
|
+
let i = 0;
|
|
311
|
+
for (; i < e; ) {
|
|
312
|
+
let o = t.charCodeAt(i), s, a = o < 55296 || o > 56319 || i + 1 === e || (s = t.charCodeAt(i + 1)) < 56320 || s > 57343 ? t[i] : t.slice(i, i + 2);
|
|
313
|
+
n.push(a), i += a.length;
|
|
314
|
+
}
|
|
315
|
+
return n;
|
|
316
|
+
}
|
|
317
|
+
function H(t, n, e, i, o) {
|
|
318
|
+
let s;
|
|
319
|
+
const a = n.length;
|
|
320
|
+
for (let l = 0; l < a - 1; l++) {
|
|
321
|
+
const d = n[l];
|
|
322
|
+
t.j[d] ? s = t.j[d] : (s = new R(i), s.jr = o.slice(), t.j[d] = s), t = s;
|
|
323
|
+
}
|
|
324
|
+
return s = new R(e), s.jr = o.slice(), t.j[n[a - 1]] = s, s;
|
|
325
|
+
}
|
|
326
|
+
function ke(t) {
|
|
327
|
+
const n = [], e = [];
|
|
328
|
+
let i = 0, o = "0123456789";
|
|
329
|
+
for (; i < t.length; ) {
|
|
330
|
+
let s = 0;
|
|
331
|
+
for (; o.indexOf(t[i + s]) >= 0; )
|
|
332
|
+
s++;
|
|
333
|
+
if (s > 0) {
|
|
334
|
+
n.push(e.join(""));
|
|
335
|
+
for (let a = parseInt(t.substring(i, i + s), 10); a > 0; a--)
|
|
336
|
+
e.pop();
|
|
337
|
+
i += s;
|
|
338
|
+
} else
|
|
339
|
+
e.push(t[i]), i++;
|
|
340
|
+
}
|
|
341
|
+
return n;
|
|
342
|
+
}
|
|
343
|
+
const Z = {
|
|
344
|
+
defaultProtocol: "http",
|
|
345
|
+
events: null,
|
|
346
|
+
format: Ae,
|
|
347
|
+
formatHref: Ae,
|
|
348
|
+
nl2br: !1,
|
|
349
|
+
tagName: "a",
|
|
350
|
+
target: null,
|
|
351
|
+
rel: null,
|
|
352
|
+
validate: !0,
|
|
353
|
+
truncate: 1 / 0,
|
|
354
|
+
className: null,
|
|
355
|
+
attributes: null,
|
|
356
|
+
ignoreTags: [],
|
|
357
|
+
render: null
|
|
358
|
+
};
|
|
359
|
+
function ce(t, n = null) {
|
|
360
|
+
let e = Object.assign({}, Z);
|
|
361
|
+
t && (e = Object.assign(e, t instanceof ce ? t.o : t));
|
|
362
|
+
const i = e.ignoreTags, o = [];
|
|
363
|
+
for (let s = 0; s < i.length; s++)
|
|
364
|
+
o.push(i[s].toUpperCase());
|
|
365
|
+
this.o = e, n && (this.defaultRender = n), this.ignoreTags = o;
|
|
366
|
+
}
|
|
367
|
+
ce.prototype = {
|
|
368
|
+
o: Z,
|
|
369
|
+
/**
|
|
370
|
+
* @type string[]
|
|
371
|
+
*/
|
|
372
|
+
ignoreTags: [],
|
|
373
|
+
/**
|
|
374
|
+
* @param {IntermediateRepresentation} ir
|
|
375
|
+
* @returns {any}
|
|
376
|
+
*/
|
|
377
|
+
defaultRender(t) {
|
|
378
|
+
return t;
|
|
379
|
+
},
|
|
380
|
+
/**
|
|
381
|
+
* Returns true or false based on whether a token should be displayed as a
|
|
382
|
+
* link based on the user options.
|
|
383
|
+
* @param {MultiToken} token
|
|
384
|
+
* @returns {boolean}
|
|
385
|
+
*/
|
|
386
|
+
check(t) {
|
|
387
|
+
return this.get("validate", t.toString(), t);
|
|
388
|
+
},
|
|
389
|
+
// Private methods
|
|
390
|
+
/**
|
|
391
|
+
* Resolve an option's value based on the value of the option and the given
|
|
392
|
+
* params. If operator and token are specified and the target option is
|
|
393
|
+
* callable, automatically calls the function with the given argument.
|
|
394
|
+
* @template {keyof Opts} K
|
|
395
|
+
* @param {K} key Name of option to use
|
|
396
|
+
* @param {string} [operator] will be passed to the target option if it's a
|
|
397
|
+
* function. If not specified, RAW function value gets returned
|
|
398
|
+
* @param {MultiToken} [token] The token from linkify.tokenize
|
|
399
|
+
* @returns {Opts[K] | any}
|
|
400
|
+
*/
|
|
401
|
+
get(t, n, e) {
|
|
402
|
+
const i = n != null;
|
|
403
|
+
let o = this.o[t];
|
|
404
|
+
return o && (typeof o == "object" ? (o = e.t in o ? o[e.t] : Z[t], typeof o == "function" && i && (o = o(n, e))) : typeof o == "function" && i && (o = o(n, e.t, e)), o);
|
|
405
|
+
},
|
|
406
|
+
/**
|
|
407
|
+
* @template {keyof Opts} L
|
|
408
|
+
* @param {L} key Name of options object to use
|
|
409
|
+
* @param {string} [operator]
|
|
410
|
+
* @param {MultiToken} [token]
|
|
411
|
+
* @returns {Opts[L] | any}
|
|
412
|
+
*/
|
|
413
|
+
getObj(t, n, e) {
|
|
414
|
+
let i = this.o[t];
|
|
415
|
+
return typeof i == "function" && n != null && (i = i(n, e.t, e)), i;
|
|
416
|
+
},
|
|
417
|
+
/**
|
|
418
|
+
* Convert the given token to a rendered element that may be added to the
|
|
419
|
+
* calling-interface's DOM
|
|
420
|
+
* @param {MultiToken} token Token to render to an HTML element
|
|
421
|
+
* @returns {any} Render result; e.g., HTML string, DOM element, React
|
|
422
|
+
* Component, etc.
|
|
423
|
+
*/
|
|
424
|
+
render(t) {
|
|
425
|
+
const n = t.render(this);
|
|
426
|
+
return (this.get("render", null, t) || this.defaultRender)(n, t.t, t);
|
|
427
|
+
}
|
|
428
|
+
};
|
|
429
|
+
function Ae(t) {
|
|
430
|
+
return t;
|
|
431
|
+
}
|
|
432
|
+
function Ie(t, n) {
|
|
433
|
+
this.t = "token", this.v = t, this.tk = n;
|
|
434
|
+
}
|
|
435
|
+
Ie.prototype = {
|
|
436
|
+
isLink: !1,
|
|
437
|
+
/**
|
|
438
|
+
* Return the string this token represents.
|
|
439
|
+
* @return {string}
|
|
440
|
+
*/
|
|
441
|
+
toString() {
|
|
442
|
+
return this.v;
|
|
443
|
+
},
|
|
444
|
+
/**
|
|
445
|
+
* What should the value for this token be in the `href` HTML attribute?
|
|
446
|
+
* Returns the `.toString` value by default.
|
|
447
|
+
* @param {string} [scheme]
|
|
448
|
+
* @return {string}
|
|
449
|
+
*/
|
|
450
|
+
toHref(t) {
|
|
451
|
+
return this.toString();
|
|
452
|
+
},
|
|
453
|
+
/**
|
|
454
|
+
* @param {Options} options Formatting options
|
|
455
|
+
* @returns {string}
|
|
456
|
+
*/
|
|
457
|
+
toFormattedString(t) {
|
|
458
|
+
const n = this.toString(), e = t.get("truncate", n, this), i = t.get("format", n, this);
|
|
459
|
+
return e && i.length > e ? i.substring(0, e) + "…" : i;
|
|
460
|
+
},
|
|
461
|
+
/**
|
|
462
|
+
*
|
|
463
|
+
* @param {Options} options
|
|
464
|
+
* @returns {string}
|
|
465
|
+
*/
|
|
466
|
+
toFormattedHref(t) {
|
|
467
|
+
return t.get("formatHref", this.toHref(t.get("defaultProtocol")), this);
|
|
468
|
+
},
|
|
469
|
+
/**
|
|
470
|
+
* The start index of this token in the original input string
|
|
471
|
+
* @returns {number}
|
|
472
|
+
*/
|
|
473
|
+
startIndex() {
|
|
474
|
+
return this.tk[0].s;
|
|
475
|
+
},
|
|
476
|
+
/**
|
|
477
|
+
* The end index of this token in the original input string (up to this
|
|
478
|
+
* index but not including it)
|
|
479
|
+
* @returns {number}
|
|
480
|
+
*/
|
|
481
|
+
endIndex() {
|
|
482
|
+
return this.tk[this.tk.length - 1].e;
|
|
483
|
+
},
|
|
484
|
+
/**
|
|
485
|
+
Returns an object of relevant values for this token, which includes keys
|
|
486
|
+
* type - Kind of token ('url', 'email', etc.)
|
|
487
|
+
* value - Original text
|
|
488
|
+
* href - The value that should be added to the anchor tag's href
|
|
489
|
+
attribute
|
|
490
|
+
@method toObject
|
|
491
|
+
@param {string} [protocol] `'http'` by default
|
|
492
|
+
*/
|
|
493
|
+
toObject(t = Z.defaultProtocol) {
|
|
494
|
+
return {
|
|
495
|
+
type: this.t,
|
|
496
|
+
value: this.toString(),
|
|
497
|
+
isLink: this.isLink,
|
|
498
|
+
href: this.toHref(t),
|
|
499
|
+
start: this.startIndex(),
|
|
500
|
+
end: this.endIndex()
|
|
501
|
+
};
|
|
502
|
+
},
|
|
503
|
+
/**
|
|
504
|
+
*
|
|
505
|
+
* @param {Options} options Formatting option
|
|
506
|
+
*/
|
|
507
|
+
toFormattedObject(t) {
|
|
508
|
+
return {
|
|
509
|
+
type: this.t,
|
|
510
|
+
value: this.toFormattedString(t),
|
|
511
|
+
isLink: this.isLink,
|
|
512
|
+
href: this.toFormattedHref(t),
|
|
513
|
+
start: this.startIndex(),
|
|
514
|
+
end: this.endIndex()
|
|
515
|
+
};
|
|
516
|
+
},
|
|
517
|
+
/**
|
|
518
|
+
* Whether this token should be rendered as a link according to the given options
|
|
519
|
+
* @param {Options} options
|
|
520
|
+
* @returns {boolean}
|
|
521
|
+
*/
|
|
522
|
+
validate(t) {
|
|
523
|
+
return t.get("validate", this.toString(), this);
|
|
524
|
+
},
|
|
525
|
+
/**
|
|
526
|
+
* Return an object that represents how this link should be rendered.
|
|
527
|
+
* @param {Options} options Formattinng options
|
|
528
|
+
*/
|
|
529
|
+
render(t) {
|
|
530
|
+
const n = this, e = this.toHref(t.get("defaultProtocol")), i = t.get("formatHref", e, this), o = t.get("tagName", e, n), s = this.toFormattedString(t), a = {}, l = t.get("className", e, n), d = t.get("target", e, n), h = t.get("rel", e, n), c = t.getObj("attributes", e, n), u = t.getObj("events", e, n);
|
|
531
|
+
return a.href = i, l && (a.class = l), d && (a.target = d), h && (a.rel = h), c && Object.assign(a, c), {
|
|
532
|
+
tagName: o,
|
|
533
|
+
attributes: a,
|
|
534
|
+
content: s,
|
|
535
|
+
eventListeners: u
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
};
|
|
539
|
+
function Ht(t, n) {
|
|
540
|
+
class e extends Ie {
|
|
541
|
+
constructor(o, s) {
|
|
542
|
+
super(o, s), this.t = t;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
for (const i in n)
|
|
546
|
+
e.prototype[i] = n[i];
|
|
547
|
+
return e.t = t, e;
|
|
548
|
+
}
|
|
549
|
+
const Le = Ht("email", {
|
|
550
|
+
isLink: !0,
|
|
551
|
+
toHref() {
|
|
552
|
+
return "mailto:" + this.toString();
|
|
553
|
+
}
|
|
554
|
+
}), Te = Ht("text"), fn = Ht("nl"), ot = Ht("url", {
|
|
555
|
+
isLink: !0,
|
|
556
|
+
/**
|
|
557
|
+
Lowercases relevant parts of the domain and adds the protocol if
|
|
558
|
+
required. Note that this will not escape unsafe HTML characters in the
|
|
559
|
+
URL.
|
|
560
|
+
@param {string} [scheme] default scheme (e.g., 'https')
|
|
561
|
+
@return {string} the full href
|
|
562
|
+
*/
|
|
563
|
+
toHref(t = Z.defaultProtocol) {
|
|
564
|
+
return this.hasProtocol() ? this.v : `${t}://${this.v}`;
|
|
565
|
+
},
|
|
566
|
+
/**
|
|
567
|
+
* Check whether this URL token has a protocol
|
|
568
|
+
* @return {boolean}
|
|
569
|
+
*/
|
|
570
|
+
hasProtocol() {
|
|
571
|
+
const t = this.tk;
|
|
572
|
+
return t.length >= 2 && t[0].t !== X && t[1].t === D;
|
|
573
|
+
}
|
|
574
|
+
}), y = (t) => new R(t);
|
|
575
|
+
function mn({
|
|
576
|
+
groups: t
|
|
577
|
+
}) {
|
|
578
|
+
const n = t.domain.concat([Tt, Ct, M, bt, Rt, yt, Ot, St, O, ie, J, Nt, vt, It, N, Pt, Y, wt]), e = [xt, D, se, S, re, J, V, ae, le, dt, ht, Q, q, lt, at, ct, ut, ft, mt, pt, gt, Et, kt, At, Lt], i = [Tt, xt, Ct, bt, Rt, yt, Ot, St, O, Q, q, J, Nt, vt, It, V, N, Pt, Y, wt], o = y(), s = r(o, Y);
|
|
579
|
+
f(s, i, s), f(s, t.domain, s);
|
|
580
|
+
const a = y(), l = y(), d = y();
|
|
581
|
+
f(o, t.domain, a), f(o, t.scheme, l), f(o, t.slashscheme, d), f(a, i, s), f(a, t.domain, a);
|
|
582
|
+
const h = r(a, M);
|
|
583
|
+
r(s, M, h), r(l, M, h), r(d, M, h);
|
|
584
|
+
const c = r(s, S);
|
|
585
|
+
f(c, i, s), f(c, t.domain, s);
|
|
586
|
+
const u = y();
|
|
587
|
+
f(h, t.domain, u), f(u, t.domain, u);
|
|
588
|
+
const m = r(u, S);
|
|
589
|
+
f(m, t.domain, u);
|
|
590
|
+
const g = y(Le);
|
|
591
|
+
f(m, t.tld, g), f(m, t.utld, g), r(h, X, g);
|
|
592
|
+
const b = r(u, O);
|
|
593
|
+
r(b, O, b), f(b, t.domain, u), f(g, t.domain, u), r(g, S, m), r(g, O, b);
|
|
594
|
+
const E = r(g, D);
|
|
595
|
+
f(E, t.numeric, Le);
|
|
596
|
+
const T = r(a, O), p = r(a, S);
|
|
597
|
+
r(T, O, T), f(T, t.domain, a), f(p, i, s), f(p, t.domain, a);
|
|
598
|
+
const A = y(ot);
|
|
599
|
+
f(p, t.tld, A), f(p, t.utld, A), f(A, t.domain, a), f(A, i, s), r(A, S, p), r(A, O, T), r(A, M, h);
|
|
600
|
+
const tt = r(A, D), W = y(ot);
|
|
601
|
+
f(tt, t.numeric, W);
|
|
602
|
+
const x = y(ot), v = y();
|
|
603
|
+
f(x, n, x), f(x, e, v), f(v, n, x), f(v, e, v), r(A, N, x), r(W, N, x);
|
|
604
|
+
const F = r(l, D), He = r(d, D), Me = r(He, N), Mt = r(Me, N);
|
|
605
|
+
f(l, t.domain, a), r(l, S, p), r(l, O, T), f(d, t.domain, a), r(d, S, p), r(d, O, T), f(F, t.domain, x), r(F, N, x), r(F, V, x), f(Mt, t.domain, x), f(Mt, n, x), r(Mt, N, x);
|
|
606
|
+
const he = [
|
|
607
|
+
[Q, q],
|
|
608
|
+
// {}
|
|
609
|
+
[at, lt],
|
|
610
|
+
// []
|
|
611
|
+
[ct, ut],
|
|
612
|
+
// ()
|
|
613
|
+
[dt, ht],
|
|
614
|
+
// <>
|
|
615
|
+
[ft, mt],
|
|
616
|
+
// ()
|
|
617
|
+
[pt, gt],
|
|
618
|
+
// 「」
|
|
619
|
+
[Et, kt],
|
|
620
|
+
// 『』
|
|
621
|
+
[At, Lt]
|
|
622
|
+
// <>
|
|
623
|
+
];
|
|
624
|
+
for (let Dt = 0; Dt < he.length; Dt++) {
|
|
625
|
+
const [fe, Ut] = he[Dt], et = r(x, fe);
|
|
626
|
+
r(v, fe, et), r(et, Ut, x);
|
|
627
|
+
const B = y(ot);
|
|
628
|
+
f(et, n, B);
|
|
629
|
+
const K = y();
|
|
630
|
+
f(et, e), f(B, n, B), f(B, e, K), f(K, n, B), f(K, e, K), r(B, Ut, x), r(K, Ut, x);
|
|
631
|
+
}
|
|
632
|
+
return r(o, X, A), r(o, oe, fn), {
|
|
633
|
+
start: o,
|
|
634
|
+
tokens: Ne
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
function pn(t, n, e) {
|
|
638
|
+
let i = e.length, o = 0, s = [], a = [];
|
|
639
|
+
for (; o < i; ) {
|
|
640
|
+
let l = t, d = null, h = null, c = 0, u = null, m = -1;
|
|
641
|
+
for (; o < i && !(d = l.go(e[o].t)); )
|
|
642
|
+
a.push(e[o++]);
|
|
643
|
+
for (; o < i && (h = d || l.go(e[o].t)); )
|
|
644
|
+
d = null, l = h, l.accepts() ? (m = 0, u = l) : m >= 0 && m++, o++, c++;
|
|
645
|
+
if (m < 0)
|
|
646
|
+
o -= c, o < i && (a.push(e[o]), o++);
|
|
647
|
+
else {
|
|
648
|
+
a.length > 0 && (s.push(_t(Te, n, a)), a = []), o -= m, c -= m;
|
|
649
|
+
const g = u.t, b = e.slice(o - c, o);
|
|
650
|
+
s.push(_t(g, n, b));
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
return a.length > 0 && s.push(_t(Te, n, a)), s;
|
|
654
|
+
}
|
|
655
|
+
function _t(t, n, e) {
|
|
656
|
+
const i = e[0].s, o = e[e.length - 1].e, s = n.slice(i, o);
|
|
657
|
+
return new t(s, e);
|
|
658
|
+
}
|
|
659
|
+
const gn = typeof console < "u" && console && console.warn || (() => {
|
|
660
|
+
}), En = "until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.", k = {
|
|
661
|
+
scanner: null,
|
|
662
|
+
parser: null,
|
|
663
|
+
tokenQueue: [],
|
|
664
|
+
pluginQueue: [],
|
|
665
|
+
customSchemes: [],
|
|
666
|
+
initialized: !1
|
|
667
|
+
};
|
|
668
|
+
function kn() {
|
|
669
|
+
return R.groups = {}, k.scanner = null, k.parser = null, k.tokenQueue = [], k.pluginQueue = [], k.customSchemes = [], k.initialized = !1, k;
|
|
670
|
+
}
|
|
671
|
+
function xe(t, n = !1) {
|
|
672
|
+
if (k.initialized && gn(`linkifyjs: already initialized - will not register custom scheme "${t}" ${En}`), !/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))
|
|
673
|
+
throw new Error(`linkifyjs: incorrect scheme format.
|
|
674
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
675
|
+
2. Cannot start or end with "-"
|
|
676
|
+
3. "-" cannot repeat`);
|
|
677
|
+
k.customSchemes.push([t, n]);
|
|
678
|
+
}
|
|
679
|
+
function An() {
|
|
680
|
+
k.scanner = dn(k.customSchemes);
|
|
681
|
+
for (let t = 0; t < k.tokenQueue.length; t++)
|
|
682
|
+
k.tokenQueue[t][1]({
|
|
683
|
+
scanner: k.scanner
|
|
684
|
+
});
|
|
685
|
+
k.parser = mn(k.scanner.tokens);
|
|
686
|
+
for (let t = 0; t < k.pluginQueue.length; t++)
|
|
687
|
+
k.pluginQueue[t][1]({
|
|
688
|
+
scanner: k.scanner,
|
|
689
|
+
parser: k.parser
|
|
690
|
+
});
|
|
691
|
+
return k.initialized = !0, k;
|
|
692
|
+
}
|
|
693
|
+
function ue(t) {
|
|
694
|
+
return k.initialized || An(), pn(k.parser.start, t, ve(k.scanner.start, t));
|
|
695
|
+
}
|
|
696
|
+
ue.scan = ve;
|
|
697
|
+
function we(t, n = null, e = null) {
|
|
698
|
+
if (n && typeof n == "object") {
|
|
699
|
+
if (e)
|
|
700
|
+
throw Error(`linkifyjs: Invalid link type ${n}; must be a string`);
|
|
701
|
+
e = n, n = null;
|
|
702
|
+
}
|
|
703
|
+
const i = new ce(e), o = ue(t), s = [];
|
|
704
|
+
for (let a = 0; a < o.length; a++) {
|
|
705
|
+
const l = o[a];
|
|
706
|
+
l.isLink && (!n || l.t === n) && i.check(l) && s.push(l.toFormattedObject(i));
|
|
707
|
+
}
|
|
708
|
+
return s;
|
|
709
|
+
}
|
|
710
|
+
var de = "[\0- -\u2029 ]", Ln = new RegExp(de), Tn = new RegExp(`${de}$`), xn = new RegExp(de, "g");
|
|
711
|
+
function Cn(t) {
|
|
712
|
+
return t.length === 1 ? t[0].isLink : t.length === 3 && t[1].isLink ? ["()", "[]"].includes(t[0].value + t[2].value) : !1;
|
|
713
|
+
}
|
|
714
|
+
function bn(t) {
|
|
715
|
+
return new ee({
|
|
716
|
+
key: new ne("autolink"),
|
|
717
|
+
appendTransaction: (n, e, i) => {
|
|
718
|
+
const o = n.some((h) => h.docChanged) && !e.doc.eq(i.doc), s = n.some((h) => h.getMeta("preventAutolink"));
|
|
719
|
+
if (!o || s)
|
|
720
|
+
return;
|
|
721
|
+
const { tr: a } = i, l = We(e.doc, [...n]);
|
|
722
|
+
if (Fe(l).forEach(({ newRange: h }) => {
|
|
723
|
+
const c = Ke(i.doc, h, (g) => g.isTextblock);
|
|
724
|
+
let u, m;
|
|
725
|
+
if (c.length > 1)
|
|
726
|
+
u = c[0], m = i.doc.textBetween(
|
|
727
|
+
u.pos,
|
|
728
|
+
u.pos + u.node.nodeSize,
|
|
729
|
+
void 0,
|
|
730
|
+
" "
|
|
731
|
+
);
|
|
732
|
+
else if (c.length) {
|
|
733
|
+
const g = i.doc.textBetween(h.from, h.to, " ", " ");
|
|
734
|
+
if (!Tn.test(g))
|
|
735
|
+
return;
|
|
736
|
+
u = c[0], m = i.doc.textBetween(u.pos, h.to, void 0, " ");
|
|
737
|
+
}
|
|
738
|
+
if (u && m) {
|
|
739
|
+
const g = m.split(Ln).filter(Boolean);
|
|
740
|
+
if (g.length <= 0)
|
|
741
|
+
return !1;
|
|
742
|
+
const b = g[g.length - 1], E = u.pos + m.lastIndexOf(b);
|
|
743
|
+
if (!b)
|
|
744
|
+
return !1;
|
|
745
|
+
const T = ue(b).map((p) => p.toObject(t.defaultProtocol));
|
|
746
|
+
if (!Cn(T))
|
|
747
|
+
return !1;
|
|
748
|
+
T.filter((p) => p.isLink).map((p) => ({
|
|
749
|
+
...p,
|
|
750
|
+
from: E + p.start + 1,
|
|
751
|
+
to: E + p.end + 1
|
|
752
|
+
})).filter((p) => i.schema.marks.code ? !i.doc.rangeHasMark(p.from, p.to, i.schema.marks.code) : !0).filter((p) => t.validate(p.value)).filter((p) => t.shouldAutoLink(p.value)).forEach((p) => {
|
|
753
|
+
_e(p.from, p.to, i.doc).some((A) => A.mark.type === t.type) || a.addMark(
|
|
754
|
+
p.from,
|
|
755
|
+
p.to,
|
|
756
|
+
t.type.create({
|
|
757
|
+
href: p.href
|
|
758
|
+
})
|
|
759
|
+
);
|
|
760
|
+
});
|
|
761
|
+
}
|
|
762
|
+
}), !!a.steps.length)
|
|
763
|
+
return a;
|
|
764
|
+
}
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
function Rn(t) {
|
|
768
|
+
return new ee({
|
|
769
|
+
key: new ne("handleClickLink"),
|
|
770
|
+
props: {
|
|
771
|
+
handleClick: (n, e, i) => {
|
|
772
|
+
var o, s;
|
|
773
|
+
if (i.button !== 0 || !n.editable)
|
|
774
|
+
return !1;
|
|
775
|
+
let a = !1;
|
|
776
|
+
if (t.enableClickSelection && (a = t.editor.commands.extendMarkRange(t.type.name)), t.openOnClick) {
|
|
777
|
+
let l = null;
|
|
778
|
+
if (i.target instanceof HTMLAnchorElement)
|
|
779
|
+
l = i.target;
|
|
780
|
+
else {
|
|
781
|
+
let u = i.target;
|
|
782
|
+
const m = [];
|
|
783
|
+
for (; u.nodeName !== "DIV"; )
|
|
784
|
+
m.push(u), u = u.parentNode;
|
|
785
|
+
l = m.find((g) => g.nodeName === "A");
|
|
786
|
+
}
|
|
787
|
+
if (!l)
|
|
788
|
+
return a;
|
|
789
|
+
const d = Ge(n.state, t.type.name), h = (o = l == null ? void 0 : l.href) != null ? o : d.href, c = (s = l == null ? void 0 : l.target) != null ? s : d.target;
|
|
790
|
+
l && h && (window.open(h, c), a = !0);
|
|
791
|
+
}
|
|
792
|
+
return a;
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
function yn(t) {
|
|
798
|
+
return new ee({
|
|
799
|
+
key: new ne("handlePasteLink"),
|
|
800
|
+
props: {
|
|
801
|
+
handlePaste: (n, e, i) => {
|
|
802
|
+
const { shouldAutoLink: o } = t, { state: s } = n, { selection: a } = s, { empty: l } = a;
|
|
803
|
+
if (l)
|
|
804
|
+
return !1;
|
|
805
|
+
let d = "";
|
|
806
|
+
i.content.forEach((c) => {
|
|
807
|
+
d += c.textContent;
|
|
808
|
+
});
|
|
809
|
+
const h = we(d, { defaultProtocol: t.defaultProtocol }).find(
|
|
810
|
+
(c) => c.isLink && c.value === d
|
|
811
|
+
);
|
|
812
|
+
return !d || !h || o !== void 0 && !o(h.href) ? !1 : t.editor.commands.setMark(t.type, {
|
|
813
|
+
href: h.href
|
|
814
|
+
});
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
});
|
|
818
|
+
}
|
|
819
|
+
function U(t, n) {
|
|
820
|
+
const e = ["http", "https", "ftp", "ftps", "mailto", "tel", "callto", "sms", "cid", "xmpp"];
|
|
821
|
+
return n && n.forEach((i) => {
|
|
822
|
+
const o = typeof i == "string" ? i : i.scheme;
|
|
823
|
+
o && e.push(o);
|
|
824
|
+
}), !t || t.replace(xn, "").match(
|
|
825
|
+
new RegExp(
|
|
826
|
+
// eslint-disable-next-line no-useless-escape
|
|
827
|
+
`^(?:(?:${e.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,
|
|
828
|
+
"i"
|
|
829
|
+
)
|
|
830
|
+
);
|
|
831
|
+
}
|
|
832
|
+
var On = Be.create({
|
|
833
|
+
name: "link",
|
|
834
|
+
priority: 1e3,
|
|
835
|
+
keepOnSplit: !1,
|
|
836
|
+
exitable: !0,
|
|
837
|
+
onCreate() {
|
|
838
|
+
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) => {
|
|
839
|
+
if (typeof t == "string") {
|
|
840
|
+
xe(t);
|
|
841
|
+
return;
|
|
842
|
+
}
|
|
843
|
+
xe(t.scheme, t.optionalSlashes);
|
|
844
|
+
});
|
|
845
|
+
},
|
|
846
|
+
onDestroy() {
|
|
847
|
+
kn();
|
|
848
|
+
},
|
|
849
|
+
inclusive() {
|
|
850
|
+
return this.options.autolink;
|
|
851
|
+
},
|
|
852
|
+
addOptions() {
|
|
853
|
+
return {
|
|
854
|
+
openOnClick: !0,
|
|
855
|
+
enableClickSelection: !1,
|
|
856
|
+
linkOnPaste: !0,
|
|
857
|
+
autolink: !0,
|
|
858
|
+
protocols: [],
|
|
859
|
+
defaultProtocol: "http",
|
|
860
|
+
HTMLAttributes: {
|
|
861
|
+
target: "_blank",
|
|
862
|
+
rel: "noopener noreferrer nofollow",
|
|
863
|
+
class: null
|
|
864
|
+
},
|
|
865
|
+
isAllowedUri: (t, n) => !!U(t, n.protocols),
|
|
866
|
+
validate: (t) => !!t,
|
|
867
|
+
shouldAutoLink: (t) => !!t
|
|
868
|
+
};
|
|
869
|
+
},
|
|
870
|
+
addAttributes() {
|
|
871
|
+
return {
|
|
872
|
+
href: {
|
|
873
|
+
default: null,
|
|
874
|
+
parseHTML(t) {
|
|
875
|
+
return t.getAttribute("href");
|
|
876
|
+
}
|
|
877
|
+
},
|
|
878
|
+
target: {
|
|
879
|
+
default: this.options.HTMLAttributes.target
|
|
880
|
+
},
|
|
881
|
+
rel: {
|
|
882
|
+
default: this.options.HTMLAttributes.rel
|
|
883
|
+
},
|
|
884
|
+
class: {
|
|
885
|
+
default: this.options.HTMLAttributes.class
|
|
886
|
+
}
|
|
887
|
+
};
|
|
888
|
+
},
|
|
889
|
+
parseHTML() {
|
|
890
|
+
return [
|
|
891
|
+
{
|
|
892
|
+
tag: "a[href]",
|
|
893
|
+
getAttrs: (t) => {
|
|
894
|
+
const n = t.getAttribute("href");
|
|
895
|
+
return !n || !this.options.isAllowedUri(n, {
|
|
896
|
+
defaultValidate: (e) => !!U(e, this.options.protocols),
|
|
897
|
+
protocols: this.options.protocols,
|
|
898
|
+
defaultProtocol: this.options.defaultProtocol
|
|
899
|
+
}) ? !1 : null;
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
];
|
|
903
|
+
},
|
|
904
|
+
renderHTML({ HTMLAttributes: t }) {
|
|
905
|
+
return this.options.isAllowedUri(t.href, {
|
|
906
|
+
defaultValidate: (n) => !!U(n, this.options.protocols),
|
|
907
|
+
protocols: this.options.protocols,
|
|
908
|
+
defaultProtocol: this.options.defaultProtocol
|
|
909
|
+
}) ? ["a", $t(this.options.HTMLAttributes, t), 0] : ["a", $t(this.options.HTMLAttributes, { ...t, href: "" }), 0];
|
|
910
|
+
},
|
|
911
|
+
markdownTokenName: "link",
|
|
912
|
+
parseMarkdown: (t, n) => n.applyMark("link", n.parseInline(t.tokens || []), {
|
|
913
|
+
href: t.href,
|
|
914
|
+
title: t.title || null
|
|
915
|
+
}),
|
|
916
|
+
renderMarkdown: (t, n) => {
|
|
917
|
+
var e;
|
|
918
|
+
const i = ((e = t.attrs) == null ? void 0 : e.href) || "";
|
|
919
|
+
return `[${n.renderChildren(t)}](${i})`;
|
|
920
|
+
},
|
|
921
|
+
addCommands() {
|
|
922
|
+
return {
|
|
923
|
+
setLink: (t) => ({ chain: n }) => {
|
|
924
|
+
const { href: e } = t;
|
|
925
|
+
return this.options.isAllowedUri(e, {
|
|
926
|
+
defaultValidate: (i) => !!U(i, this.options.protocols),
|
|
927
|
+
protocols: this.options.protocols,
|
|
928
|
+
defaultProtocol: this.options.defaultProtocol
|
|
929
|
+
}) ? n().setMark(this.name, t).setMeta("preventAutolink", !0).run() : !1;
|
|
930
|
+
},
|
|
931
|
+
toggleLink: (t) => ({ chain: n }) => {
|
|
932
|
+
const { href: e } = t || {};
|
|
933
|
+
return e && !this.options.isAllowedUri(e, {
|
|
934
|
+
defaultValidate: (i) => !!U(i, this.options.protocols),
|
|
935
|
+
protocols: this.options.protocols,
|
|
936
|
+
defaultProtocol: this.options.defaultProtocol
|
|
937
|
+
}) ? !1 : n().toggleMark(this.name, t, { extendEmptyMarkRange: !0 }).setMeta("preventAutolink", !0).run();
|
|
938
|
+
},
|
|
939
|
+
unsetLink: () => ({ chain: t }) => t().unsetMark(this.name, { extendEmptyMarkRange: !0 }).setMeta("preventAutolink", !0).run()
|
|
940
|
+
};
|
|
941
|
+
},
|
|
942
|
+
addPasteRules() {
|
|
943
|
+
return [
|
|
944
|
+
ze({
|
|
945
|
+
find: (t) => {
|
|
946
|
+
const n = [];
|
|
947
|
+
if (t) {
|
|
948
|
+
const { protocols: e, defaultProtocol: i } = this.options, o = we(t).filter(
|
|
949
|
+
(s) => s.isLink && this.options.isAllowedUri(s.value, {
|
|
950
|
+
defaultValidate: (a) => !!U(a, e),
|
|
951
|
+
protocols: e,
|
|
952
|
+
defaultProtocol: i
|
|
953
|
+
})
|
|
954
|
+
);
|
|
955
|
+
o.length && o.forEach((s) => {
|
|
956
|
+
this.options.shouldAutoLink(s.value) && n.push({
|
|
957
|
+
text: s.value,
|
|
958
|
+
data: {
|
|
959
|
+
href: s.href
|
|
960
|
+
},
|
|
961
|
+
index: s.start
|
|
962
|
+
});
|
|
963
|
+
});
|
|
964
|
+
}
|
|
965
|
+
return n;
|
|
966
|
+
},
|
|
967
|
+
type: this.type,
|
|
968
|
+
getAttributes: (t) => {
|
|
969
|
+
var n;
|
|
970
|
+
return {
|
|
971
|
+
href: (n = t.data) == null ? void 0 : n.href
|
|
972
|
+
};
|
|
973
|
+
}
|
|
974
|
+
})
|
|
975
|
+
];
|
|
976
|
+
},
|
|
977
|
+
addProseMirrorPlugins() {
|
|
978
|
+
const t = [], { protocols: n, defaultProtocol: e } = this.options;
|
|
979
|
+
return this.options.autolink && t.push(
|
|
980
|
+
bn({
|
|
981
|
+
type: this.type,
|
|
982
|
+
defaultProtocol: this.options.defaultProtocol,
|
|
983
|
+
validate: (i) => this.options.isAllowedUri(i, {
|
|
984
|
+
defaultValidate: (o) => !!U(o, n),
|
|
985
|
+
protocols: n,
|
|
986
|
+
defaultProtocol: e
|
|
987
|
+
}),
|
|
988
|
+
shouldAutoLink: this.options.shouldAutoLink
|
|
989
|
+
})
|
|
990
|
+
), t.push(
|
|
991
|
+
Rn({
|
|
992
|
+
type: this.type,
|
|
993
|
+
editor: this.editor,
|
|
994
|
+
openOnClick: this.options.openOnClick === "whenNotEditable" ? !0 : this.options.openOnClick,
|
|
995
|
+
enableClickSelection: this.options.enableClickSelection
|
|
996
|
+
})
|
|
997
|
+
), this.options.linkOnPaste && t.push(
|
|
998
|
+
yn({
|
|
999
|
+
editor: this.editor,
|
|
1000
|
+
defaultProtocol: this.options.defaultProtocol,
|
|
1001
|
+
type: this.type,
|
|
1002
|
+
shouldAutoLink: this.options.shouldAutoLink
|
|
1003
|
+
})
|
|
1004
|
+
), t;
|
|
1005
|
+
}
|
|
1006
|
+
});
|
|
1007
|
+
function Kn() {
|
|
1008
|
+
const [t, n] = Gt(!1), e = je(), i = Qe(Pe.name), {
|
|
1009
|
+
isActive: o,
|
|
1010
|
+
icon: s,
|
|
1011
|
+
tooltip: a,
|
|
1012
|
+
target: l,
|
|
1013
|
+
action: d
|
|
1014
|
+
} = (i == null ? void 0 : i.componentProps) ?? {}, { dataState: h, editorDisabled: c, update: u } = qe(o);
|
|
1015
|
+
function m(g, b, E) {
|
|
1016
|
+
c || d && (d({ link: g, text: b, openInNewTab: E }), n(!1), u());
|
|
1017
|
+
}
|
|
1018
|
+
return i ? /* @__PURE__ */ st(
|
|
1019
|
+
Ze,
|
|
1020
|
+
{
|
|
1021
|
+
modal: !0,
|
|
1022
|
+
onOpenChange: n,
|
|
1023
|
+
open: t,
|
|
1024
|
+
children: [
|
|
1025
|
+
/* @__PURE__ */ C(
|
|
1026
|
+
tn,
|
|
1027
|
+
{
|
|
1028
|
+
asChild: !0,
|
|
1029
|
+
"data-state": h ? "on" : "off",
|
|
1030
|
+
disabled: c,
|
|
1031
|
+
children: /* @__PURE__ */ C(
|
|
1032
|
+
$e,
|
|
1033
|
+
{
|
|
1034
|
+
dataState: h,
|
|
1035
|
+
disabled: c,
|
|
1036
|
+
tooltip: a,
|
|
1037
|
+
children: /* @__PURE__ */ C(Ce, { name: s })
|
|
1038
|
+
}
|
|
1039
|
+
)
|
|
1040
|
+
}
|
|
1041
|
+
),
|
|
1042
|
+
/* @__PURE__ */ C(
|
|
1043
|
+
en,
|
|
1044
|
+
{
|
|
1045
|
+
align: "start",
|
|
1046
|
+
className: "richtext-w-full",
|
|
1047
|
+
hideWhenDetached: !0,
|
|
1048
|
+
side: "bottom",
|
|
1049
|
+
children: /* @__PURE__ */ C(
|
|
1050
|
+
Sn,
|
|
1051
|
+
{
|
|
1052
|
+
editor: e,
|
|
1053
|
+
onSetLink: m,
|
|
1054
|
+
open: t,
|
|
1055
|
+
target: l
|
|
1056
|
+
}
|
|
1057
|
+
)
|
|
1058
|
+
}
|
|
1059
|
+
)
|
|
1060
|
+
]
|
|
1061
|
+
}
|
|
1062
|
+
) : /* @__PURE__ */ C(De, {});
|
|
1063
|
+
}
|
|
1064
|
+
const Pe = /* @__PURE__ */ On.extend({
|
|
1065
|
+
inclusive: !1,
|
|
1066
|
+
parseHTML() {
|
|
1067
|
+
return [
|
|
1068
|
+
{
|
|
1069
|
+
tag: 'a[href]:not([data-type="button"]):not([href *= "javascript:" i])'
|
|
1070
|
+
}
|
|
1071
|
+
];
|
|
1072
|
+
},
|
|
1073
|
+
renderHTML({ HTMLAttributes: t }) {
|
|
1074
|
+
return [
|
|
1075
|
+
"a",
|
|
1076
|
+
$t(this.options.HTMLAttributes, t, {
|
|
1077
|
+
class: "link"
|
|
1078
|
+
}),
|
|
1079
|
+
0
|
|
1080
|
+
];
|
|
1081
|
+
},
|
|
1082
|
+
//@ts-expect-error
|
|
1083
|
+
addOptions() {
|
|
1084
|
+
var e, i;
|
|
1085
|
+
const t = ((e = this.parent) == null ? void 0 : e.call(this)) || {}, n = (i = t.HTMLAttributes) == null ? void 0 : i.target;
|
|
1086
|
+
return {
|
|
1087
|
+
...t,
|
|
1088
|
+
openOnClick: !1,
|
|
1089
|
+
button: ({ editor: o, t: s }) => ({
|
|
1090
|
+
componentProps: {
|
|
1091
|
+
action: (a) => {
|
|
1092
|
+
const { link: l, text: d, openInNewTab: h } = a;
|
|
1093
|
+
if (!l) {
|
|
1094
|
+
o.chain().extendMarkRange("link").unsetLink().run();
|
|
1095
|
+
return;
|
|
1096
|
+
}
|
|
1097
|
+
o.isActive("link") && o.chain().extendMarkRange("link").run();
|
|
1098
|
+
const { from: c } = o.state.selection, u = d.length;
|
|
1099
|
+
o.chain().insertContent({
|
|
1100
|
+
type: "text",
|
|
1101
|
+
text: d,
|
|
1102
|
+
marks: [
|
|
1103
|
+
{
|
|
1104
|
+
type: "link",
|
|
1105
|
+
attrs: {
|
|
1106
|
+
href: /^https?:\/\//i.test(l) ? l : `http://${l}`,
|
|
1107
|
+
target: n ?? (h ? "_blank" : "")
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
]
|
|
1111
|
+
}).setLink({ href: l }).setTextSelection({ from: c, to: c + u }).focus().run();
|
|
1112
|
+
},
|
|
1113
|
+
isActive: () => o.isActive("link"),
|
|
1114
|
+
disabled: !o.can().setLink({ href: "" }),
|
|
1115
|
+
icon: "Link",
|
|
1116
|
+
tooltip: s("editor.link.tooltip"),
|
|
1117
|
+
target: n
|
|
1118
|
+
}
|
|
1119
|
+
})
|
|
1120
|
+
};
|
|
1121
|
+
}
|
|
1122
|
+
// addProseMirrorPlugins() {
|
|
1123
|
+
// return [
|
|
1124
|
+
// new Plugin({
|
|
1125
|
+
// key: new PluginKey(`richtextCustomPlugin${this.name}`),
|
|
1126
|
+
// props: {
|
|
1127
|
+
// handleClick: (view: EditorView, pos: number) => {
|
|
1128
|
+
// const { schema, doc, tr } = view.state;
|
|
1129
|
+
// const range = getMarkRange(doc.resolve(pos), schema.marks.link);
|
|
1130
|
+
// if (!range) {
|
|
1131
|
+
// return false;
|
|
1132
|
+
// }
|
|
1133
|
+
// // honor openOnClick setting
|
|
1134
|
+
// let mark: any = null;
|
|
1135
|
+
// doc.nodesBetween(range.from, range.to, (node) => {
|
|
1136
|
+
// mark = node.marks.find((m) => m.type === schema.marks.link);
|
|
1137
|
+
// return !mark;
|
|
1138
|
+
// });
|
|
1139
|
+
// if (this.options.openOnClick && mark?.attrs.href && pos !== range.to) {
|
|
1140
|
+
// window.open(mark.attrs.href, mark.attrs.target || '_self');
|
|
1141
|
+
// return true;
|
|
1142
|
+
// }
|
|
1143
|
+
// const $start = doc.resolve(range.from);
|
|
1144
|
+
// const $end = doc.resolve(range.to);
|
|
1145
|
+
// const transaction = tr.setSelection(
|
|
1146
|
+
// new TextSelection($start, $end)
|
|
1147
|
+
// );
|
|
1148
|
+
// view.dispatch(transaction);
|
|
1149
|
+
// },
|
|
1150
|
+
// },
|
|
1151
|
+
// }),
|
|
1152
|
+
// ];
|
|
1153
|
+
// },
|
|
1154
|
+
});
|
|
1155
|
+
function Sn(t) {
|
|
1156
|
+
const { t: n } = Ve(), [e, i] = Gt({
|
|
1157
|
+
text: "",
|
|
1158
|
+
link: ""
|
|
1159
|
+
}), [o, s] = Gt(!1), a = me(null), l = me(null), d = Je(Pe.name);
|
|
1160
|
+
Ue(() => {
|
|
1161
|
+
const c = () => {
|
|
1162
|
+
var tt, W, x;
|
|
1163
|
+
const { from: u, to: m, empty: g } = t.editor.state.selection, b = d == null ? void 0 : d.options;
|
|
1164
|
+
let E = "", T = "", p = (tt = b == null ? void 0 : b.HTMLAttributes) == null ? void 0 : tt.target;
|
|
1165
|
+
const A = t.editor.state.doc.nodeAt(u);
|
|
1166
|
+
if (A) {
|
|
1167
|
+
const v = A.marks.find((F) => F.type.name === "link");
|
|
1168
|
+
v ? (T = v.attrs.href || "", p = v.attrs.target, g ? E = A.text || "" : E = t.editor.state.doc.textBetween(u, m, " ")) : E = t.editor.state.doc.textBetween(u, m, " ");
|
|
1169
|
+
}
|
|
1170
|
+
A || (E = t.editor.state.doc.textBetween(u, m, " ")), i({ link: T, text: E }), s(t.target ? t.target === "_blank" : p === "_blank"), t.open && (E === "" ? (W = a.current) == null || W.focus() : (x = l.current) == null || x.focus());
|
|
1171
|
+
};
|
|
1172
|
+
return c(), t.editor.on("selectionUpdate", c), () => {
|
|
1173
|
+
t.editor.off("selectionUpdate", c);
|
|
1174
|
+
};
|
|
1175
|
+
}, [t.editor, d, t.open]);
|
|
1176
|
+
function h(c) {
|
|
1177
|
+
c.preventDefault(), c.stopPropagation(), t == null || t.onSetLink(e.link, e.text, o), i({ text: "", link: "" });
|
|
1178
|
+
}
|
|
1179
|
+
return /* @__PURE__ */ C("div", { className: "border-neutral-200 richtext-rounded-lg !richtext-border richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black", children: /* @__PURE__ */ st("div", { className: "richtext-flex richtext-flex-col richtext-gap-2", children: [
|
|
1180
|
+
/* @__PURE__ */ C(jt, { className: "mb-[6px]", children: n("editor.link.dialog.text") }),
|
|
1181
|
+
/* @__PURE__ */ C("div", { className: "richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ C("div", { className: "richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center", children: /* @__PURE__ */ C(
|
|
1182
|
+
pe,
|
|
1183
|
+
{
|
|
1184
|
+
className: "richtext-w-80",
|
|
1185
|
+
onChange: (c) => i({ ...e, text: c.target.value }),
|
|
1186
|
+
placeholder: "Text",
|
|
1187
|
+
ref: a,
|
|
1188
|
+
required: !0,
|
|
1189
|
+
type: "text",
|
|
1190
|
+
value: e.text
|
|
1191
|
+
}
|
|
1192
|
+
) }) }),
|
|
1193
|
+
/* @__PURE__ */ C(jt, { className: "mb-[6px]", children: n("editor.link.dialog.link") }),
|
|
1194
|
+
/* @__PURE__ */ C("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ st("div", { className: "richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center", children: [
|
|
1195
|
+
/* @__PURE__ */ C(
|
|
1196
|
+
pe,
|
|
1197
|
+
{
|
|
1198
|
+
className: "richtext-pl-10",
|
|
1199
|
+
onChange: (c) => i({ ...e, link: c.target.value }),
|
|
1200
|
+
ref: l,
|
|
1201
|
+
required: !0,
|
|
1202
|
+
type: "url",
|
|
1203
|
+
value: e.link
|
|
1204
|
+
}
|
|
1205
|
+
),
|
|
1206
|
+
/* @__PURE__ */ C("span", { className: "richtext-absolute richtext-inset-y-0 richtext-start-0 richtext-flex richtext-items-center richtext-justify-center richtext-px-2", children: /* @__PURE__ */ C(
|
|
1207
|
+
Ce,
|
|
1208
|
+
{
|
|
1209
|
+
className: "richtext-size-5 richtext-text-muted-foreground",
|
|
1210
|
+
name: "Link"
|
|
1211
|
+
}
|
|
1212
|
+
) })
|
|
1213
|
+
] }) }),
|
|
1214
|
+
!t.target && /* @__PURE__ */ st("div", { className: "richtext-flex richtext-items-center richtext-space-x-2", children: [
|
|
1215
|
+
/* @__PURE__ */ C(jt, { children: n("editor.link.dialog.openInNewTab") }),
|
|
1216
|
+
/* @__PURE__ */ C(
|
|
1217
|
+
Ye,
|
|
1218
|
+
{
|
|
1219
|
+
checked: o,
|
|
1220
|
+
onCheckedChange: (c) => {
|
|
1221
|
+
s(c);
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
)
|
|
1225
|
+
] }),
|
|
1226
|
+
/* @__PURE__ */ C(
|
|
1227
|
+
Xe,
|
|
1228
|
+
{
|
|
1229
|
+
className: "richtext-mt-2 richtext-self-end",
|
|
1230
|
+
onClick: h,
|
|
1231
|
+
type: "button",
|
|
1232
|
+
children: n("editor.link.dialog.button.apply")
|
|
1233
|
+
}
|
|
1234
|
+
)
|
|
1235
|
+
] }) });
|
|
1236
|
+
}
|
|
1237
|
+
export {
|
|
1238
|
+
Pe as L,
|
|
1239
|
+
Kn as R,
|
|
1240
|
+
Sn as a
|
|
1241
|
+
};
|