@vc-shell/framework 1.1.44 → 1.1.46
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/CHANGELOG.md +20 -0
- package/core/plugins/modularity/loader.ts +150 -74
- package/core/services/app-bar-mobile-buttons-service.ts +1 -1
- package/dist/core/plugins/modularity/loader.d.ts.map +1 -1
- package/dist/core/services/app-bar-mobile-buttons-service.d.ts +1 -1
- package/dist/core/services/app-bar-mobile-buttons-service.d.ts.map +1 -1
- package/dist/framework.js +33355 -295
- package/dist/index.css +1 -9
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/locales/de.json +0 -84
- package/dist/locales/en.json +0 -84
- package/dist/shared/components/blade-navigation/components/vc-blade-navigation/_internal/vc-mobile-back-button.vue.d.ts.map +1 -1
- package/dist/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.d.ts +1 -1
- package/dist/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.d.ts.map +1 -1
- package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeRouteResolver.d.ts.map +1 -1
- package/dist/shared/components/change-password-button/change-password-button.vue.d.ts.map +1 -1
- package/dist/shared/components/logout-button/logout-button.vue.d.ts.map +1 -1
- package/dist/shared/components/settings-menu-item/settings-menu-item.vue.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts +2 -2
- package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts +6 -6
- package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/atoms/vc-hint/vc-hint.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-icon/icons/MenuBurgerIcon.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-icon/icons/index.d.ts +0 -26
- package/dist/ui/components/atoms/vc-icon/icons/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-icon/vc-bootstrap-icon.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-icon/vc-fontawesome-icon.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-icon/vc-lucide-icon.vue.d.ts +0 -5
- package/dist/ui/components/atoms/vc-icon/vc-lucide-icon.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-icon/vc-material-icon.vue.d.ts +0 -20
- package/dist/ui/components/atoms/vc-icon/vc-material-icon.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-button.vue.d.ts +36 -0
- package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-button.vue.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-toolbar.vue.d.ts +17 -0
- package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-toolbar.vue.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts +16 -2381
- package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-form/vc-form.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts +1 -1
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts +1 -1
- package/dist/ui/components/molecules/vc-pagination/vc-pagination.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/MenuSidebar.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-desktop.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-mobile.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue.d.ts +2 -2
- package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts +2 -2
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue.d.ts.map +1 -1
- package/dist/vendor-boolbase-Cp9L0GAZ.js +25 -0
- package/dist/vendor-cheerio-HN9zIPZn.js +3135 -0
- package/dist/vendor-cheerio-select-5Ry0HvBq.js +306 -0
- package/dist/vendor-core-js-l0sNRNKZ.js +1 -0
- package/dist/vendor-css-select-DRIZ9kfZ.js +966 -0
- package/dist/vendor-css-what-DuPJ1HEF.js +448 -0
- package/dist/vendor-cypress-signalr-mock-BKdBJpdt.js +778 -0
- package/dist/vendor-date-fns-515YWkk-.js +6724 -0
- package/dist/vendor-dom-serializer-nQMsqjYW.js +286 -0
- package/dist/vendor-dom7-CJLPMwy5.js +941 -0
- package/dist/vendor-domelementtype-CjSzQey5.js +53 -0
- package/dist/vendor-domhandler-9z8cS16a.js +484 -0
- package/dist/vendor-dompurify-CRFzu7ib.js +1336 -0
- package/dist/vendor-domutils-Bc-Opz-v.js +981 -0
- package/dist/vendor-entities-Bfsx4xOQ.js +636 -0
- package/dist/vendor-floating-ui-core-wV8u8QP4.js +511 -0
- package/dist/vendor-floating-ui-dom-DDnRPs17.js +706 -0
- package/dist/vendor-floating-ui-utils-OMIFy1QU.js +296 -0
- package/dist/vendor-floating-ui-vue-D-tCDAMm.js +167 -0
- package/dist/vendor-fontsource-plus-jakarta-sans.css +1 -0
- package/dist/vendor-headlessui-vue-CY9FRgTb.js +83 -0
- package/dist/vendor-htmlparser2-B1dhFPOs.js +1426 -0
- package/dist/vendor-iconify-vue-DfRGgyNu.js +1840 -0
- package/dist/vendor-intlify-core-base-BuknsFQe.js +1876 -0
- package/dist/vendor-intlify-message-compiler-CuOQDWx1.js +1508 -0
- package/dist/vendor-intlify-shared-Cz4YRMuC.js +241 -0
- package/dist/vendor-iso-639-1-BJCk9DvE.js +819 -0
- package/dist/vendor-linkify-it-CKUf4vsc.js +830 -0
- package/dist/vendor-linkifyjs-BfyGgbCh.js +1756 -0
- package/dist/vendor-lodash-es-BySUOlwf.js +18333 -0
- package/dist/vendor-markdown-it-D-apazHa.js +6000 -0
- package/dist/vendor-markdown-it-task-lists-rxMVH6Ku.js +131 -0
- package/dist/vendor-mdurl-BNh2CCgT.js +537 -0
- package/dist/vendor-microsoft-applicationinsights-analytics-js-kG3lLg8X.js +1275 -0
- package/dist/vendor-microsoft-applicationinsights-cfgsync-js-C0uQkiQq.js +591 -0
- package/dist/vendor-microsoft-applicationinsights-channel-js-Dyd_PXA3.js +2153 -0
- package/dist/vendor-microsoft-applicationinsights-common-CfmP1_Qr.js +2470 -0
- package/dist/vendor-microsoft-applicationinsights-core-js-Cq4YSEvZ.js +6589 -0
- package/dist/vendor-microsoft-applicationinsights-dependencies-js-C56OBFr4.js +1510 -0
- package/dist/vendor-microsoft-applicationinsights-properties-js-CBJTBawx.js +761 -0
- package/dist/vendor-microsoft-applicationinsights-shims-CX8sJgar.js +70 -0
- package/dist/vendor-microsoft-applicationinsights-web-pim2ri-g.js +667 -0
- package/dist/vendor-microsoft-dynamicproto-js-CFBBUu9p.js +520 -0
- package/dist/vendor-microsoft-signalr-dUnlRsGm.js +3339 -0
- package/dist/vendor-moment-Mki5YqAR.js +5679 -0
- package/dist/vendor-nevware21-ts-async-CLMApQ9E.js +395 -0
- package/dist/vendor-nevware21-ts-utils-e8v8Jty3.js +1160 -0
- package/dist/vendor-normalize-css.css +1 -0
- package/dist/vendor-nth-check-Bx8TxtJt.js +157 -0
- package/dist/vendor-orderedmap-dGG6uMFJ.js +137 -0
- package/dist/vendor-parse5-Bt2NhSzR.js +8432 -0
- package/dist/vendor-parse5-htmlparser2-tree-adapter-BUUtKzf8.js +216 -0
- package/dist/vendor-popperjs-core-Cr2byIky.js +1790 -0
- package/dist/vendor-prettier-B4PaeWRQ.js +98 -0
- package/dist/vendor-prosemirror-commands-BH9lWGpW.js +561 -0
- package/dist/vendor-prosemirror-dropcursor-CeyPcxrA.js +146 -0
- package/dist/vendor-prosemirror-gapcursor-U8UoUJII.js +236 -0
- package/dist/vendor-prosemirror-history-BDaJkvNx.js +414 -0
- package/dist/vendor-prosemirror-keymap-BbWvIWmH.js +128 -0
- package/dist/vendor-prosemirror-markdown-gB0PXBbz.js +866 -0
- package/dist/vendor-prosemirror-model-BZu3WVcD.js +3463 -0
- package/dist/vendor-prosemirror-schema-list-Bl9NpKA7.js +158 -0
- package/dist/vendor-prosemirror-state-BvL9Pxph.js +1003 -0
- package/dist/vendor-prosemirror-tables-17qAnviK.js +2159 -0
- package/dist/vendor-prosemirror-transform-CE9VV3qg.js +2156 -0
- package/dist/vendor-prosemirror-view-CU2WTHT7.js +5811 -0
- package/dist/vendor-punycode-js-iAs5RxMf.js +441 -0
- package/dist/vendor-rope-sequence-BdXDKoGt.js +207 -0
- package/dist/vendor-semver-CVLMK-S4.js +2702 -0
- package/dist/vendor-ssr-window-s6OpKa3O.js +150 -0
- package/dist/vendor-swiper-CdiyNHVt.js +5679 -0
- package/dist/vendor-swiper.css +1 -0
- package/dist/vendor-tanstack-virtual-core-l0sNRNKZ.js +1 -0
- package/dist/vendor-tanstack-vue-virtual-l0sNRNKZ.js +1 -0
- package/dist/vendor-tippy-js-DWFe2TfK.js +1647 -0
- package/dist/vendor-tiptap-core-NfwGfaQk.js +4910 -0
- package/dist/vendor-tiptap-extension-blockquote-jmWBTtsI.js +57 -0
- package/dist/vendor-tiptap-extension-bold-p5frh4ak.js +97 -0
- package/dist/vendor-tiptap-extension-bubble-menu-KUhZSfrs.js +218 -0
- package/dist/vendor-tiptap-extension-bullet-list-COmZRoSB.js +73 -0
- package/dist/vendor-tiptap-extension-code-block-DyTARZss.js +221 -0
- package/dist/vendor-tiptap-extension-code-jVv6CXpX.js +75 -0
- package/dist/vendor-tiptap-extension-document-DssuotYs.js +13 -0
- package/dist/vendor-tiptap-extension-dropcursor-BoO0Qv91.js +26 -0
- package/dist/vendor-tiptap-extension-floating-menu-CrO8CN5w.js +165 -0
- package/dist/vendor-tiptap-extension-gapcursor-KpsWEoMD.js +30 -0
- package/dist/vendor-tiptap-extension-hard-break-ldOzhSvf.js +68 -0
- package/dist/vendor-tiptap-extension-heading-CKz2llX0.js +77 -0
- package/dist/vendor-tiptap-extension-history-DeKZ2VQ9.js +48 -0
- package/dist/vendor-tiptap-extension-horizontal-rule-CAjWRyDS.js +92 -0
- package/dist/vendor-tiptap-extension-image-ZagcEYuk.js +76 -0
- package/dist/vendor-tiptap-extension-italic-CM4xdznY.js +96 -0
- package/dist/vendor-tiptap-extension-link-Z-AMC4Ri.js +414 -0
- package/dist/vendor-tiptap-extension-list-item-BJi5QpXc.js +37 -0
- package/dist/vendor-tiptap-extension-ordered-list-C_TMrfBE.js +97 -0
- package/dist/vendor-tiptap-extension-paragraph-CQw0E0Au.js +39 -0
- package/dist/vendor-tiptap-extension-placeholder-BBNVKfa_.js +66 -0
- package/dist/vendor-tiptap-extension-strike-DUyMYX1Z.js +79 -0
- package/dist/vendor-tiptap-extension-table-cell-CoDIMPA5.js +47 -0
- package/dist/vendor-tiptap-extension-table-header-DvbGHnmw.js +47 -0
- package/dist/vendor-tiptap-extension-table-row-D1uqN5Aj.js +26 -0
- package/dist/vendor-tiptap-extension-table-tKS4MOM4.js +354 -0
- package/dist/vendor-tiptap-extension-text-DtRBhKB2.js +12 -0
- package/dist/vendor-tiptap-extension-underline-DqaSFp_P.js +50 -0
- package/dist/vendor-tiptap-markdown-7-PCADTU.js +1017 -0
- package/dist/vendor-tiptap-pm-l0sNRNKZ.js +1 -0
- package/dist/vendor-tiptap-starter-kit-CDSV_Zuu.js +88 -0
- package/dist/vendor-tiptap-vue-3-DZg2fjq_.js +268 -0
- package/dist/vendor-truncate-html-3qQY0Djo.js +196 -0
- package/dist/vendor-uc-micro-jjt6LQ65.js +23 -0
- package/dist/vendor-vee-validate-i18n-v_gHjRmD.js +154 -0
- package/dist/vendor-vee-validate-rules-DzV3VY3N.js +536 -0
- package/dist/vendor-vue-currency-input-DGAkEFBO.js +545 -0
- package/dist/vendor-vue-demi-l0sNRNKZ.js +1 -0
- package/dist/vendor-vue-devtools-api-DXYR8qBG.js +169 -0
- package/dist/vendor-vue-i18n-Co752uk3.js +1897 -0
- package/dist/vendor-vue3-application-insights-CYWFCr_J.js +119 -0
- package/dist/vendor-vue3-touch-events-BJEAiSa3.js +416 -0
- package/dist/vendor-vuepic-vue-datepicker-BSWXRSiu.js +5019 -0
- package/dist/vendor-vuepic-vue-datepicker.css +1 -0
- package/dist/vendor-vueuse-components-l1bL12mE.js +339 -0
- package/dist/vendor-vueuse-core-DGcJOmwG.js +7743 -0
- package/dist/vendor-vueuse-shared-_mOXsFuM.js +1568 -0
- package/dist/vendor-w3c-keyname-BOm2dtJm.js +121 -0
- package/package.json +22 -11
- package/shared/components/blade-navigation/components/vc-blade-navigation/_internal/vc-mobile-back-button.vue +3 -3
- package/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.ts +2 -1
- package/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeRouteResolver.ts +1 -0
- package/shared/components/change-password-button/change-password-button.vue +1 -2
- package/shared/components/logout-button/logout-button.vue +1 -2
- package/shared/components/notifications/components/notification-container/index.ts +1 -1
- package/shared/components/notifications/core/notification.ts +1 -1
- package/shared/components/settings-menu-item/settings-menu-item.vue +1 -0
- package/shared/components/sidebar/sidebar.vue +2 -2
- package/shared/modules/dynamic/pages/dynamic-blade-list.vue +2 -1
- package/ui/components/atoms/vc-hint/vc-hint.vue +2 -0
- package/ui/components/atoms/vc-icon/composables/use-icon.ts +1 -1
- package/ui/components/atoms/vc-icon/icons/MenuBurgerIcon.vue +18 -14
- package/ui/components/atoms/vc-icon/icons/index.ts +1 -27
- package/ui/components/atoms/vc-icon/vc-bootstrap-icon.vue +7 -11
- package/ui/components/atoms/vc-icon/vc-fontawesome-icon.vue +37 -31
- package/ui/components/atoms/vc-icon/vc-icon-examples.vue +1 -1
- package/ui/components/atoms/vc-icon/vc-icon.stories.ts +4 -5
- package/ui/components/atoms/vc-icon/vc-icon.vue +43 -186
- package/ui/components/atoms/vc-icon/vc-lucide-icon.vue +22 -70
- package/ui/components/atoms/vc-icon/vc-material-icon.vue +28 -59
- package/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue +2 -3
- package/ui/components/molecules/vc-editor/_internal/vc-editor-button.vue +103 -0
- package/ui/components/molecules/vc-editor/_internal/vc-editor-toolbar.vue +252 -0
- package/ui/components/molecules/vc-editor/vc-editor.stories.ts +1 -4
- package/ui/components/molecules/vc-editor/vc-editor.vue +666 -360
- package/ui/components/molecules/vc-form/vc-form.vue +7 -5
- package/ui/components/molecules/vc-input/vc-input.vue +1 -1
- package/ui/components/molecules/vc-pagination/vc-pagination.vue +4 -17
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarMobileActions.vue +1 -1
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/MenuSidebar.vue +1 -3
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +1 -4
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue +1 -3
- package/ui/components/organisms/vc-app/vc-app.backupsb.ts +214 -214
- package/ui/components/organisms/vc-app/vc-app.vue +3 -5
- package/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue +3 -10
- package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/mobile/vc-blade-toolbar-mobile.vue +1 -1
- package/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-desktop.vue +2 -2
- package/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-mobile.vue +2 -2
- package/ui/components/organisms/vc-blade/vc-blade.vue +4 -5
- package/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue +1 -3
- package/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue +1 -2
- package/ui/components/organisms/vc-table/composables/useTableState.ts +5 -5
- package/dist/apl-B2DGVGxc.js +0 -76
- package/dist/asciiarmor-2LVJmxlE.js +0 -34
- package/dist/asn1-jKiBa2Ya.js +0 -95
- package/dist/asterisk-DS281yxp.js +0 -271
- package/dist/brainfuck-C_p9pTT8.js +0 -34
- package/dist/clike-DGTaUp48.js +0 -620
- package/dist/clojure-CCKyeQKf.js +0 -800
- package/dist/cmake-CuaCgAKt.js +0 -28
- package/dist/cobol-BlTKFDRj.js +0 -72
- package/dist/coffeescript-BVCvwO8I.js +0 -179
- package/dist/commonlisp-D_kxz07b.js +0 -75
- package/dist/crystal-D309uH6_.js +0 -217
- package/dist/css-BkF-NPzE.js +0 -1553
- package/dist/cypher-BMq4Fwjl.js +0 -68
- package/dist/d-BZcgY6La.js +0 -127
- package/dist/diff-Cg9d_RX2.js +0 -18
- package/dist/dockerfile-DIy8NleC.js +0 -194
- package/dist/dtd-CtLokQ-U.js +0 -84
- package/dist/dylan-QYeExnWK.js +0 -234
- package/dist/ebnf-DUPDuY4r.js +0 -78
- package/dist/ecl-CiXN-g_D.js +0 -121
- package/dist/eiffel-yQhjl4T1.js +0 -110
- package/dist/elm-CNT9vbN0.js +0 -108
- package/dist/erlang-CFOYdy9e.js +0 -487
- package/dist/factor-DDOC7X6P.js +0 -65
- package/dist/fcl-CPC2WYrI.js +0 -103
- package/dist/forth-BmxRyE9S.js +0 -60
- package/dist/fortran-9bvPyrOW.js +0 -442
- package/dist/gas-cpmYfFX2.js +0 -183
- package/dist/gherkin-CJuwpceU.js +0 -34
- package/dist/groovy-DZeT_VM-.js +0 -146
- package/dist/haskell-Bvt3Qq1t.js +0 -375
- package/dist/haxe-70NVW1pR.js +0 -359
- package/dist/http-D9LttvKF.js +0 -44
- package/dist/idl-B6TRFYjl.js +0 -947
- package/dist/index-4DWvmoYg.js +0 -71
- package/dist/index-52o7mJaX.js +0 -156
- package/dist/index-B0KatioT.js +0 -98
- package/dist/index-BP3W8zuk.js +0 -268
- package/dist/index-BykT5L1A.js +0 -148134
- package/dist/index-CfXo9hsG.js +0 -75
- package/dist/index-Ch37pBUt.js +0 -308
- package/dist/index-D2KGkAYT.js +0 -93
- package/dist/index-D83zQom_.js +0 -58
- package/dist/index-DuQrVLbu.js +0 -134
- package/dist/index-_fdMid5h.js +0 -288
- package/dist/index-a1wO-owY.js +0 -545
- package/dist/index-crMpNSFe.js +0 -611
- package/dist/index-dmBRpHHY.js +0 -137
- package/dist/index-kBdB14Fz.js +0 -341
- package/dist/index-uBhy41le.js +0 -249
- package/dist/index-zZrijNsr.js +0 -299
- package/dist/javascript-C2yteZeJ.js +0 -691
- package/dist/jinja2-DnB6dQmV.js +0 -154
- package/dist/julia-DpvXAuO6.js +0 -241
- package/dist/livescript-CanGTf8u.js +0 -272
- package/dist/lua-XplVlWi_.js +0 -217
- package/dist/mathematica-jaRHnSxC.js +0 -35
- package/dist/mbox-BctzC1hL.js +0 -76
- package/dist/mirc-CFBPAOaF.js +0 -72
- package/dist/mllike-BSnXJBGA.js +0 -272
- package/dist/modelica-vUgVs--1.js +0 -93
- package/dist/mscgen-Cpl0NYLN.js +0 -104
- package/dist/mumps-CQoS1kWX.js +0 -25
- package/dist/nginx-zDPm3Z74.js +0 -89
- package/dist/nsis-fePjrhq7.js +0 -62
- package/dist/ntriples-CsNjv2QF.js +0 -79
- package/dist/octave-C8PmmSRH.js +0 -143
- package/dist/oz-Ce8aN8oE.js +0 -151
- package/dist/pascal-De0D6mP7.js +0 -77
- package/dist/perl-B4bSCe1C.js +0 -915
- package/dist/pig-D24Z8EXi.js +0 -54
- package/dist/powershell-DkYVfTzP.js +0 -249
- package/dist/properties-Dn9wna3M.js +0 -26
- package/dist/protobuf-BPIjwpzm.js +0 -49
- package/dist/pug-CwAQJzGR.js +0 -248
- package/dist/puppet-nyd4dhjf.js +0 -45
- package/dist/python-BkR3uSy8.js +0 -313
- package/dist/q-DXjKs-tC.js +0 -83
- package/dist/r-LKEuhEGI.js +0 -104
- package/dist/rpm-IznJm2Xc.js +0 -57
- package/dist/ruby-CcYfvIk6.js +0 -228
- package/dist/sas-7E8yHoCW.js +0 -105
- package/dist/scheme-DjibxsNh.js +0 -124
- package/dist/shared/modules/dynamic/components/fields/storybook/common/args.d.ts +0 -113
- package/dist/shared/modules/dynamic/components/fields/storybook/common/args.d.ts.map +0 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/common/templates.d.ts +0 -3
- package/dist/shared/modules/dynamic/components/fields/storybook/common/templates.d.ts.map +0 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.d.ts +0 -102
- package/dist/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.d.ts.map +0 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.d.ts +0 -4
- package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.d.ts.map +0 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.d.ts +0 -3
- package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.d.ts.map +0 -1
- package/dist/shell-C0C2sNA_.js +0 -182
- package/dist/sieve-Bwz7vjP5.js +0 -72
- package/dist/simple-mode-B0dvCdAA.js +0 -89
- package/dist/smalltalk-Bhddl2pB.js +0 -48
- package/dist/solr-BNlsLglM.js +0 -41
- package/dist/sparql-FarWu_Gb.js +0 -197
- package/dist/spreadsheet-C-cy4P5N.js +0 -49
- package/dist/sql-CfG5lQ3l.js +0 -282
- package/dist/stex-Du4h4KAU.js +0 -129
- package/dist/stylus-CAdqWld3.js +0 -250
- package/dist/swift-DSxqR9R6.js +0 -230
- package/dist/tcl-xfoLljhY.js +0 -81
- package/dist/textile-D1AWE-pc.js +0 -295
- package/dist/tiddlywiki-5wqsXtSk.js +0 -155
- package/dist/tiki-__Kn3CeS.js +0 -181
- package/dist/toml-BHiuTcfn.js +0 -49
- package/dist/troff-D2UO-fKf.js +0 -35
- package/dist/ttcn-Bsa4sfRm.js +0 -123
- package/dist/ttcn-cfg-Bac_acMi.js +0 -88
- package/dist/turtle-xwJUxoPV.js +0 -80
- package/dist/ui/components/atoms/vc-icon/icons/AppWindowIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/AppWindowIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/ArrowLeftIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/ArrowLeftIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/ArrowRightIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/ArrowRightIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/BellIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/BellIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/ChevronDownIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/ChevronDownIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/ChevronLeftIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/ChevronLeftIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/ChevronRightIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/ChevronRightIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/ChevronUpIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/ChevronUpIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/CircleDotsIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/CircleDotsIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/CrossSignIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/CrossSignIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/DoubleArrowLeftIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/DoubleArrowLeftIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/DoubleArrowRightIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/DoubleArrowRightIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/FulfillmentCentersIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/FulfillmentCentersIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/LogoutIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/LogoutIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/MinusSignIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/MinusSignIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/OffersIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/OffersIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/OrdersIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/OrdersIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/PeopleIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/PeopleIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/PlusSignIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/PlusSignIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/ProductsIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/ProductsIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/ProfileIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/ProfileIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/SearchIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/SearchIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/SettingsBoltIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/SettingsBoltIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/VendorSwitchIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/VendorSwitchIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/VertDotsIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/VertDotsIcon.vue.d.ts.map +0 -1
- package/dist/vb-c2kQGd6-.js +0 -74
- package/dist/vbscript-1f_Dhg5H.js +0 -324
- package/dist/velocity-DJd0pTTC.js +0 -96
- package/dist/verilog-CiS1jyi5.js +0 -262
- package/dist/vhdl-T9HkrbI2.js +0 -106
- package/dist/webidl-CjfDENEo.js +0 -155
- package/dist/xquery-BUQdORAS.js +0 -422
- package/dist/yacas-C0absKBh.js +0 -73
- package/dist/z80-Pki2zAjW.js +0 -61
- package/shared/modules/dynamic/components/fields/storybook/Button.stories.ts +0 -186
- package/shared/modules/dynamic/components/fields/storybook/Card.stories.ts +0 -175
- package/shared/modules/dynamic/components/fields/storybook/Checkbox.stories.ts +0 -185
- package/shared/modules/dynamic/components/fields/storybook/ContentField.stories.ts +0 -245
- package/shared/modules/dynamic/components/fields/storybook/EditorField.stories.ts +0 -192
- package/shared/modules/dynamic/components/fields/storybook/Fieldset.stories.ts +0 -347
- package/shared/modules/dynamic/components/fields/storybook/GalleryField.stories.ts +0 -239
- package/shared/modules/dynamic/components/fields/storybook/ImageField.stories.ts +0 -186
- package/shared/modules/dynamic/components/fields/storybook/InputCurrency.stories.ts +0 -281
- package/shared/modules/dynamic/components/fields/storybook/InputField.stories.ts +0 -312
- package/shared/modules/dynamic/components/fields/storybook/MultivalueField.stories.ts +0 -361
- package/shared/modules/dynamic/components/fields/storybook/RadioButtonGroup.stories.ts +0 -224
- package/shared/modules/dynamic/components/fields/storybook/RatingField.stories.ts +0 -131
- package/shared/modules/dynamic/components/fields/storybook/SelectField.stories.ts +0 -666
- package/shared/modules/dynamic/components/fields/storybook/StatusField.stories.ts +0 -202
- package/shared/modules/dynamic/components/fields/storybook/SwitchField.stories.ts +0 -178
- package/shared/modules/dynamic/components/fields/storybook/TextareaField.stories.ts +0 -203
- package/shared/modules/dynamic/components/fields/storybook/VideoField.stories.ts +0 -92
- package/shared/modules/dynamic/components/fields/storybook/common/args.ts +0 -130
- package/shared/modules/dynamic/components/fields/storybook/common/templates.ts +0 -8
- package/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.ts +0 -54
- package/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.ts +0 -16
- package/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.ts +0 -41
- package/ui/components/atoms/vc-icon/icons/AppWindowIcon.vue +0 -15
- package/ui/components/atoms/vc-icon/icons/ArrowLeftIcon.vue +0 -20
- package/ui/components/atoms/vc-icon/icons/ArrowRightIcon.vue +0 -13
- package/ui/components/atoms/vc-icon/icons/BellIcon.vue +0 -14
- package/ui/components/atoms/vc-icon/icons/ChevronDownIcon.vue +0 -13
- package/ui/components/atoms/vc-icon/icons/ChevronLeftIcon.vue +0 -13
- package/ui/components/atoms/vc-icon/icons/ChevronRightIcon.vue +0 -13
- package/ui/components/atoms/vc-icon/icons/ChevronUpIcon.vue +0 -13
- package/ui/components/atoms/vc-icon/icons/CircleDotsIcon.vue +0 -16
- package/ui/components/atoms/vc-icon/icons/CrossSignIcon.vue +0 -20
- package/ui/components/atoms/vc-icon/icons/DoubleArrowLeftIcon.vue +0 -14
- package/ui/components/atoms/vc-icon/icons/DoubleArrowRightIcon.vue +0 -14
- package/ui/components/atoms/vc-icon/icons/FulfillmentCentersIcon.vue +0 -27
- package/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue +0 -22
- package/ui/components/atoms/vc-icon/icons/LogoutIcon.vue +0 -13
- package/ui/components/atoms/vc-icon/icons/MinusSignIcon.vue +0 -14
- package/ui/components/atoms/vc-icon/icons/OffersIcon.vue +0 -23
- package/ui/components/atoms/vc-icon/icons/OrdersIcon.vue +0 -19
- package/ui/components/atoms/vc-icon/icons/PeopleIcon.vue +0 -21
- package/ui/components/atoms/vc-icon/icons/PlusSignIcon.vue +0 -20
- package/ui/components/atoms/vc-icon/icons/ProductsIcon.vue +0 -23
- package/ui/components/atoms/vc-icon/icons/ProfileIcon.vue +0 -18
- package/ui/components/atoms/vc-icon/icons/SearchIcon.vue +0 -14
- package/ui/components/atoms/vc-icon/icons/SettingsBoltIcon.vue +0 -21
- package/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue +0 -16
- package/ui/components/atoms/vc-icon/icons/VendorSwitchIcon.vue +0 -26
- package/ui/components/atoms/vc-icon/icons/VertDotsIcon.vue +0 -19
|
@@ -0,0 +1,830 @@
|
|
|
1
|
+
import { A as Any, C as Cc, Z, P } from './vendor-uc-micro-jjt6LQ65.js';
|
|
2
|
+
|
|
3
|
+
function reFactory (opts) {
|
|
4
|
+
const re = {};
|
|
5
|
+
opts = opts || {};
|
|
6
|
+
|
|
7
|
+
re.src_Any = Any.source;
|
|
8
|
+
re.src_Cc = Cc.source;
|
|
9
|
+
re.src_Z = Z.source;
|
|
10
|
+
re.src_P = P.source;
|
|
11
|
+
|
|
12
|
+
// \p{\Z\P\Cc\CF} (white spaces + control + format + punctuation)
|
|
13
|
+
re.src_ZPCc = [re.src_Z, re.src_P, re.src_Cc].join('|');
|
|
14
|
+
|
|
15
|
+
// \p{\Z\Cc} (white spaces + control)
|
|
16
|
+
re.src_ZCc = [re.src_Z, re.src_Cc].join('|');
|
|
17
|
+
|
|
18
|
+
// Experimental. List of chars, completely prohibited in links
|
|
19
|
+
// because can separate it from other part of text
|
|
20
|
+
const text_separators = '[><\uff5c]';
|
|
21
|
+
|
|
22
|
+
// All possible word characters (everything without punctuation, spaces & controls)
|
|
23
|
+
// Defined via punctuation & spaces to save space
|
|
24
|
+
// Should be something like \p{\L\N\S\M} (\w but without `_`)
|
|
25
|
+
re.src_pseudo_letter = '(?:(?!' + text_separators + '|' + re.src_ZPCc + ')' + re.src_Any + ')';
|
|
26
|
+
// The same as abothe but without [0-9]
|
|
27
|
+
// var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')';
|
|
28
|
+
|
|
29
|
+
re.src_ip4 =
|
|
30
|
+
|
|
31
|
+
'(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)';
|
|
32
|
+
|
|
33
|
+
// Prohibit any of "@/[]()" in user/pass to avoid wrong domain fetch.
|
|
34
|
+
re.src_auth = '(?:(?:(?!' + re.src_ZCc + '|[@/\\[\\]()]).)+@)?';
|
|
35
|
+
|
|
36
|
+
re.src_port =
|
|
37
|
+
|
|
38
|
+
'(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?';
|
|
39
|
+
|
|
40
|
+
re.src_host_terminator =
|
|
41
|
+
|
|
42
|
+
'(?=$|' + text_separators + '|' + re.src_ZPCc + ')' +
|
|
43
|
+
'(?!' + (opts['---'] ? '-(?!--)|' : '-|') + '_|:\\d|\\.-|\\.(?!$|' + re.src_ZPCc + '))';
|
|
44
|
+
|
|
45
|
+
re.src_path =
|
|
46
|
+
|
|
47
|
+
'(?:' +
|
|
48
|
+
'[/?#]' +
|
|
49
|
+
'(?:' +
|
|
50
|
+
'(?!' + re.src_ZCc + '|' + text_separators + '|[()[\\]{}.,"\'?!\\-;]).|' +
|
|
51
|
+
'\\[(?:(?!' + re.src_ZCc + '|\\]).)*\\]|' +
|
|
52
|
+
'\\((?:(?!' + re.src_ZCc + '|[)]).)*\\)|' +
|
|
53
|
+
'\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\}|' +
|
|
54
|
+
'\\"(?:(?!' + re.src_ZCc + '|["]).)+\\"|' +
|
|
55
|
+
"\\'(?:(?!" + re.src_ZCc + "|[']).)+\\'|" +
|
|
56
|
+
|
|
57
|
+
// allow `I'm_king` if no pair found
|
|
58
|
+
"\\'(?=" + re.src_pseudo_letter + '|[-])|' +
|
|
59
|
+
|
|
60
|
+
// google has many dots in "google search" links (#66, #81).
|
|
61
|
+
// github has ... in commit range links,
|
|
62
|
+
// Restrict to
|
|
63
|
+
// - english
|
|
64
|
+
// - percent-encoded
|
|
65
|
+
// - parts of file path
|
|
66
|
+
// - params separator
|
|
67
|
+
// until more examples found.
|
|
68
|
+
'\\.{2,}[a-zA-Z0-9%/&]|' +
|
|
69
|
+
|
|
70
|
+
'\\.(?!' + re.src_ZCc + '|[.]|$)|' +
|
|
71
|
+
(opts['---']
|
|
72
|
+
? '\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate
|
|
73
|
+
: '\\-+|'
|
|
74
|
+
) +
|
|
75
|
+
// allow `,,,` in paths
|
|
76
|
+
',(?!' + re.src_ZCc + '|$)|' +
|
|
77
|
+
|
|
78
|
+
// allow `;` if not followed by space-like char
|
|
79
|
+
';(?!' + re.src_ZCc + '|$)|' +
|
|
80
|
+
|
|
81
|
+
// allow `!!!` in paths, but not at the end
|
|
82
|
+
'\\!+(?!' + re.src_ZCc + '|[!]|$)|' +
|
|
83
|
+
|
|
84
|
+
'\\?(?!' + re.src_ZCc + '|[?]|$)' +
|
|
85
|
+
')+' +
|
|
86
|
+
'|\\/' +
|
|
87
|
+
')?';
|
|
88
|
+
|
|
89
|
+
// Allow anything in markdown spec, forbid quote (") at the first position
|
|
90
|
+
// because emails enclosed in quotes are far more common
|
|
91
|
+
re.src_email_name =
|
|
92
|
+
|
|
93
|
+
'[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*';
|
|
94
|
+
|
|
95
|
+
re.src_xn =
|
|
96
|
+
|
|
97
|
+
'xn--[a-z0-9\\-]{1,59}';
|
|
98
|
+
|
|
99
|
+
// More to read about domain names
|
|
100
|
+
// http://serverfault.com/questions/638260/
|
|
101
|
+
|
|
102
|
+
re.src_domain_root =
|
|
103
|
+
|
|
104
|
+
// Allow letters & digits (http://test1)
|
|
105
|
+
'(?:' +
|
|
106
|
+
re.src_xn +
|
|
107
|
+
'|' +
|
|
108
|
+
re.src_pseudo_letter + '{1,63}' +
|
|
109
|
+
')';
|
|
110
|
+
|
|
111
|
+
re.src_domain =
|
|
112
|
+
|
|
113
|
+
'(?:' +
|
|
114
|
+
re.src_xn +
|
|
115
|
+
'|' +
|
|
116
|
+
'(?:' + re.src_pseudo_letter + ')' +
|
|
117
|
+
'|' +
|
|
118
|
+
'(?:' + re.src_pseudo_letter + '(?:-|' + re.src_pseudo_letter + '){0,61}' + re.src_pseudo_letter + ')' +
|
|
119
|
+
')';
|
|
120
|
+
|
|
121
|
+
re.src_host =
|
|
122
|
+
|
|
123
|
+
'(?:' +
|
|
124
|
+
// Don't need IP check, because digits are already allowed in normal domain names
|
|
125
|
+
// src_ip4 +
|
|
126
|
+
// '|' +
|
|
127
|
+
'(?:(?:(?:' + re.src_domain + ')\\.)*' + re.src_domain/* _root */ + ')' +
|
|
128
|
+
')';
|
|
129
|
+
|
|
130
|
+
re.tpl_host_fuzzy =
|
|
131
|
+
|
|
132
|
+
'(?:' +
|
|
133
|
+
re.src_ip4 +
|
|
134
|
+
'|' +
|
|
135
|
+
'(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))' +
|
|
136
|
+
')';
|
|
137
|
+
|
|
138
|
+
re.tpl_host_no_ip_fuzzy =
|
|
139
|
+
|
|
140
|
+
'(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))';
|
|
141
|
+
|
|
142
|
+
re.src_host_strict =
|
|
143
|
+
|
|
144
|
+
re.src_host + re.src_host_terminator;
|
|
145
|
+
|
|
146
|
+
re.tpl_host_fuzzy_strict =
|
|
147
|
+
|
|
148
|
+
re.tpl_host_fuzzy + re.src_host_terminator;
|
|
149
|
+
|
|
150
|
+
re.src_host_port_strict =
|
|
151
|
+
|
|
152
|
+
re.src_host + re.src_port + re.src_host_terminator;
|
|
153
|
+
|
|
154
|
+
re.tpl_host_port_fuzzy_strict =
|
|
155
|
+
|
|
156
|
+
re.tpl_host_fuzzy + re.src_port + re.src_host_terminator;
|
|
157
|
+
|
|
158
|
+
re.tpl_host_port_no_ip_fuzzy_strict =
|
|
159
|
+
|
|
160
|
+
re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator;
|
|
161
|
+
|
|
162
|
+
//
|
|
163
|
+
// Main rules
|
|
164
|
+
//
|
|
165
|
+
|
|
166
|
+
// Rude test fuzzy links by host, for quick deny
|
|
167
|
+
re.tpl_host_fuzzy_test =
|
|
168
|
+
|
|
169
|
+
'localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:' + re.src_ZPCc + '|>|$))';
|
|
170
|
+
|
|
171
|
+
re.tpl_email_fuzzy =
|
|
172
|
+
|
|
173
|
+
'(^|' + text_separators + '|"|\\(|' + re.src_ZCc + ')' +
|
|
174
|
+
'(' + re.src_email_name + '@' + re.tpl_host_fuzzy_strict + ')';
|
|
175
|
+
|
|
176
|
+
re.tpl_link_fuzzy =
|
|
177
|
+
// Fuzzy link can't be prepended with .:/\- and non punctuation.
|
|
178
|
+
// but can start with > (markdown blockquote)
|
|
179
|
+
'(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' +
|
|
180
|
+
'((?![$+<=>^`|\uff5c])' + re.tpl_host_port_fuzzy_strict + re.src_path + ')';
|
|
181
|
+
|
|
182
|
+
re.tpl_link_no_ip_fuzzy =
|
|
183
|
+
// Fuzzy link can't be prepended with .:/\- and non punctuation.
|
|
184
|
+
// but can start with > (markdown blockquote)
|
|
185
|
+
'(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' +
|
|
186
|
+
'((?![$+<=>^`|\uff5c])' + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ')';
|
|
187
|
+
|
|
188
|
+
return re
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
//
|
|
192
|
+
// Helpers
|
|
193
|
+
//
|
|
194
|
+
|
|
195
|
+
// Merge objects
|
|
196
|
+
//
|
|
197
|
+
function assign (obj /* from1, from2, from3, ... */) {
|
|
198
|
+
const sources = Array.prototype.slice.call(arguments, 1);
|
|
199
|
+
|
|
200
|
+
sources.forEach(function (source) {
|
|
201
|
+
if (!source) { return }
|
|
202
|
+
|
|
203
|
+
Object.keys(source).forEach(function (key) {
|
|
204
|
+
obj[key] = source[key];
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
return obj
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function _class (obj) { return Object.prototype.toString.call(obj) }
|
|
212
|
+
function isString (obj) { return _class(obj) === '[object String]' }
|
|
213
|
+
function isObject (obj) { return _class(obj) === '[object Object]' }
|
|
214
|
+
function isRegExp (obj) { return _class(obj) === '[object RegExp]' }
|
|
215
|
+
function isFunction (obj) { return _class(obj) === '[object Function]' }
|
|
216
|
+
|
|
217
|
+
function escapeRE (str) { return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&') }
|
|
218
|
+
|
|
219
|
+
//
|
|
220
|
+
|
|
221
|
+
const defaultOptions = {
|
|
222
|
+
fuzzyLink: true,
|
|
223
|
+
fuzzyEmail: true,
|
|
224
|
+
fuzzyIP: false
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
function isOptionsObj (obj) {
|
|
228
|
+
return Object.keys(obj || {}).reduce(function (acc, k) {
|
|
229
|
+
/* eslint-disable-next-line no-prototype-builtins */
|
|
230
|
+
return acc || defaultOptions.hasOwnProperty(k)
|
|
231
|
+
}, false)
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const defaultSchemas = {
|
|
235
|
+
'http:': {
|
|
236
|
+
validate: function (text, pos, self) {
|
|
237
|
+
const tail = text.slice(pos);
|
|
238
|
+
|
|
239
|
+
if (!self.re.http) {
|
|
240
|
+
// compile lazily, because "host"-containing variables can change on tlds update.
|
|
241
|
+
self.re.http = new RegExp(
|
|
242
|
+
'^\\/\\/' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i'
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
if (self.re.http.test(tail)) {
|
|
246
|
+
return tail.match(self.re.http)[0].length
|
|
247
|
+
}
|
|
248
|
+
return 0
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
'https:': 'http:',
|
|
252
|
+
'ftp:': 'http:',
|
|
253
|
+
'//': {
|
|
254
|
+
validate: function (text, pos, self) {
|
|
255
|
+
const tail = text.slice(pos);
|
|
256
|
+
|
|
257
|
+
if (!self.re.no_http) {
|
|
258
|
+
// compile lazily, because "host"-containing variables can change on tlds update.
|
|
259
|
+
self.re.no_http = new RegExp(
|
|
260
|
+
'^' +
|
|
261
|
+
self.re.src_auth +
|
|
262
|
+
// Don't allow single-level domains, because of false positives like '//test'
|
|
263
|
+
// with code comments
|
|
264
|
+
'(?:localhost|(?:(?:' + self.re.src_domain + ')\\.)+' + self.re.src_domain_root + ')' +
|
|
265
|
+
self.re.src_port +
|
|
266
|
+
self.re.src_host_terminator +
|
|
267
|
+
self.re.src_path,
|
|
268
|
+
|
|
269
|
+
'i'
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
if (self.re.no_http.test(tail)) {
|
|
274
|
+
// should not be `://` & `///`, that protects from errors in protocol name
|
|
275
|
+
if (pos >= 3 && text[pos - 3] === ':') { return 0 }
|
|
276
|
+
if (pos >= 3 && text[pos - 3] === '/') { return 0 }
|
|
277
|
+
return tail.match(self.re.no_http)[0].length
|
|
278
|
+
}
|
|
279
|
+
return 0
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
'mailto:': {
|
|
283
|
+
validate: function (text, pos, self) {
|
|
284
|
+
const tail = text.slice(pos);
|
|
285
|
+
|
|
286
|
+
if (!self.re.mailto) {
|
|
287
|
+
self.re.mailto = new RegExp(
|
|
288
|
+
'^' + self.re.src_email_name + '@' + self.re.src_host_strict, 'i'
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
if (self.re.mailto.test(tail)) {
|
|
292
|
+
return tail.match(self.re.mailto)[0].length
|
|
293
|
+
}
|
|
294
|
+
return 0
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
// RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js)
|
|
300
|
+
/* eslint-disable-next-line max-len */
|
|
301
|
+
const tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]';
|
|
302
|
+
|
|
303
|
+
// DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead
|
|
304
|
+
const tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|');
|
|
305
|
+
|
|
306
|
+
function resetScanCache (self) {
|
|
307
|
+
self.__index__ = -1;
|
|
308
|
+
self.__text_cache__ = '';
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
function createValidator (re) {
|
|
312
|
+
return function (text, pos) {
|
|
313
|
+
const tail = text.slice(pos);
|
|
314
|
+
|
|
315
|
+
if (re.test(tail)) {
|
|
316
|
+
return tail.match(re)[0].length
|
|
317
|
+
}
|
|
318
|
+
return 0
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
function createNormalizer () {
|
|
323
|
+
return function (match, self) {
|
|
324
|
+
self.normalize(match);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// Schemas compiler. Build regexps.
|
|
329
|
+
//
|
|
330
|
+
function compile (self) {
|
|
331
|
+
// Load & clone RE patterns.
|
|
332
|
+
const re = self.re = reFactory(self.__opts__);
|
|
333
|
+
|
|
334
|
+
// Define dynamic patterns
|
|
335
|
+
const tlds = self.__tlds__.slice();
|
|
336
|
+
|
|
337
|
+
self.onCompile();
|
|
338
|
+
|
|
339
|
+
if (!self.__tlds_replaced__) {
|
|
340
|
+
tlds.push(tlds_2ch_src_re);
|
|
341
|
+
}
|
|
342
|
+
tlds.push(re.src_xn);
|
|
343
|
+
|
|
344
|
+
re.src_tlds = tlds.join('|');
|
|
345
|
+
|
|
346
|
+
function untpl (tpl) { return tpl.replace('%TLDS%', re.src_tlds) }
|
|
347
|
+
|
|
348
|
+
re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i');
|
|
349
|
+
re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i');
|
|
350
|
+
re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i');
|
|
351
|
+
re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i');
|
|
352
|
+
|
|
353
|
+
//
|
|
354
|
+
// Compile each schema
|
|
355
|
+
//
|
|
356
|
+
|
|
357
|
+
const aliases = [];
|
|
358
|
+
|
|
359
|
+
self.__compiled__ = {}; // Reset compiled data
|
|
360
|
+
|
|
361
|
+
function schemaError (name, val) {
|
|
362
|
+
throw new Error('(LinkifyIt) Invalid schema "' + name + '": ' + val)
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
Object.keys(self.__schemas__).forEach(function (name) {
|
|
366
|
+
const val = self.__schemas__[name];
|
|
367
|
+
|
|
368
|
+
// skip disabled methods
|
|
369
|
+
if (val === null) { return }
|
|
370
|
+
|
|
371
|
+
const compiled = { validate: null, link: null };
|
|
372
|
+
|
|
373
|
+
self.__compiled__[name] = compiled;
|
|
374
|
+
|
|
375
|
+
if (isObject(val)) {
|
|
376
|
+
if (isRegExp(val.validate)) {
|
|
377
|
+
compiled.validate = createValidator(val.validate);
|
|
378
|
+
} else if (isFunction(val.validate)) {
|
|
379
|
+
compiled.validate = val.validate;
|
|
380
|
+
} else {
|
|
381
|
+
schemaError(name, val);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
if (isFunction(val.normalize)) {
|
|
385
|
+
compiled.normalize = val.normalize;
|
|
386
|
+
} else if (!val.normalize) {
|
|
387
|
+
compiled.normalize = createNormalizer();
|
|
388
|
+
} else {
|
|
389
|
+
schemaError(name, val);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
return
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
if (isString(val)) {
|
|
396
|
+
aliases.push(name);
|
|
397
|
+
return
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
schemaError(name, val);
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
//
|
|
404
|
+
// Compile postponed aliases
|
|
405
|
+
//
|
|
406
|
+
|
|
407
|
+
aliases.forEach(function (alias) {
|
|
408
|
+
if (!self.__compiled__[self.__schemas__[alias]]) {
|
|
409
|
+
// Silently fail on missed schemas to avoid errons on disable.
|
|
410
|
+
// schemaError(alias, self.__schemas__[alias]);
|
|
411
|
+
return
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
self.__compiled__[alias].validate =
|
|
415
|
+
self.__compiled__[self.__schemas__[alias]].validate;
|
|
416
|
+
self.__compiled__[alias].normalize =
|
|
417
|
+
self.__compiled__[self.__schemas__[alias]].normalize;
|
|
418
|
+
});
|
|
419
|
+
|
|
420
|
+
//
|
|
421
|
+
// Fake record for guessed links
|
|
422
|
+
//
|
|
423
|
+
self.__compiled__[''] = { validate: null, normalize: createNormalizer() };
|
|
424
|
+
|
|
425
|
+
//
|
|
426
|
+
// Build schema condition
|
|
427
|
+
//
|
|
428
|
+
const slist = Object.keys(self.__compiled__)
|
|
429
|
+
.filter(function (name) {
|
|
430
|
+
// Filter disabled & fake schemas
|
|
431
|
+
return name.length > 0 && self.__compiled__[name]
|
|
432
|
+
})
|
|
433
|
+
.map(escapeRE)
|
|
434
|
+
.join('|');
|
|
435
|
+
// (?!_) cause 1.5x slowdown
|
|
436
|
+
self.re.schema_test = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'i');
|
|
437
|
+
self.re.schema_search = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'ig');
|
|
438
|
+
self.re.schema_at_start = RegExp('^' + self.re.schema_search.source, 'i');
|
|
439
|
+
|
|
440
|
+
self.re.pretest = RegExp(
|
|
441
|
+
'(' + self.re.schema_test.source + ')|(' + self.re.host_fuzzy_test.source + ')|@',
|
|
442
|
+
'i'
|
|
443
|
+
);
|
|
444
|
+
|
|
445
|
+
//
|
|
446
|
+
// Cleanup
|
|
447
|
+
//
|
|
448
|
+
|
|
449
|
+
resetScanCache(self);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* class Match
|
|
454
|
+
*
|
|
455
|
+
* Match result. Single element of array, returned by [[LinkifyIt#match]]
|
|
456
|
+
**/
|
|
457
|
+
function Match (self, shift) {
|
|
458
|
+
const start = self.__index__;
|
|
459
|
+
const end = self.__last_index__;
|
|
460
|
+
const text = self.__text_cache__.slice(start, end);
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Match#schema -> String
|
|
464
|
+
*
|
|
465
|
+
* Prefix (protocol) for matched string.
|
|
466
|
+
**/
|
|
467
|
+
this.schema = self.__schema__.toLowerCase();
|
|
468
|
+
/**
|
|
469
|
+
* Match#index -> Number
|
|
470
|
+
*
|
|
471
|
+
* First position of matched string.
|
|
472
|
+
**/
|
|
473
|
+
this.index = start + shift;
|
|
474
|
+
/**
|
|
475
|
+
* Match#lastIndex -> Number
|
|
476
|
+
*
|
|
477
|
+
* Next position after matched string.
|
|
478
|
+
**/
|
|
479
|
+
this.lastIndex = end + shift;
|
|
480
|
+
/**
|
|
481
|
+
* Match#raw -> String
|
|
482
|
+
*
|
|
483
|
+
* Matched string.
|
|
484
|
+
**/
|
|
485
|
+
this.raw = text;
|
|
486
|
+
/**
|
|
487
|
+
* Match#text -> String
|
|
488
|
+
*
|
|
489
|
+
* Notmalized text of matched string.
|
|
490
|
+
**/
|
|
491
|
+
this.text = text;
|
|
492
|
+
/**
|
|
493
|
+
* Match#url -> String
|
|
494
|
+
*
|
|
495
|
+
* Normalized url of matched string.
|
|
496
|
+
**/
|
|
497
|
+
this.url = text;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
function createMatch (self, shift) {
|
|
501
|
+
const match = new Match(self, shift);
|
|
502
|
+
|
|
503
|
+
self.__compiled__[match.schema].normalize(match, self);
|
|
504
|
+
|
|
505
|
+
return match
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* class LinkifyIt
|
|
510
|
+
**/
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* new LinkifyIt(schemas, options)
|
|
514
|
+
* - schemas (Object): Optional. Additional schemas to validate (prefix/validator)
|
|
515
|
+
* - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }
|
|
516
|
+
*
|
|
517
|
+
* Creates new linkifier instance with optional additional schemas.
|
|
518
|
+
* Can be called without `new` keyword for convenience.
|
|
519
|
+
*
|
|
520
|
+
* By default understands:
|
|
521
|
+
*
|
|
522
|
+
* - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links
|
|
523
|
+
* - "fuzzy" links and emails (example.com, foo@bar.com).
|
|
524
|
+
*
|
|
525
|
+
* `schemas` is an object, where each key/value describes protocol/rule:
|
|
526
|
+
*
|
|
527
|
+
* - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:`
|
|
528
|
+
* for example). `linkify-it` makes shure that prefix is not preceeded with
|
|
529
|
+
* alphanumeric char and symbols. Only whitespaces and punctuation allowed.
|
|
530
|
+
* - __value__ - rule to check tail after link prefix
|
|
531
|
+
* - _String_ - just alias to existing rule
|
|
532
|
+
* - _Object_
|
|
533
|
+
* - _validate_ - validator function (should return matched length on success),
|
|
534
|
+
* or `RegExp`.
|
|
535
|
+
* - _normalize_ - optional function to normalize text & url of matched result
|
|
536
|
+
* (for example, for @twitter mentions).
|
|
537
|
+
*
|
|
538
|
+
* `options`:
|
|
539
|
+
*
|
|
540
|
+
* - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`.
|
|
541
|
+
* - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts
|
|
542
|
+
* like version numbers. Default `false`.
|
|
543
|
+
* - __fuzzyEmail__ - recognize emails without `mailto:` prefix.
|
|
544
|
+
*
|
|
545
|
+
**/
|
|
546
|
+
function LinkifyIt (schemas, options) {
|
|
547
|
+
if (!(this instanceof LinkifyIt)) {
|
|
548
|
+
return new LinkifyIt(schemas, options)
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
if (!options) {
|
|
552
|
+
if (isOptionsObj(schemas)) {
|
|
553
|
+
options = schemas;
|
|
554
|
+
schemas = {};
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
this.__opts__ = assign({}, defaultOptions, options);
|
|
559
|
+
|
|
560
|
+
// Cache last tested result. Used to skip repeating steps on next `match` call.
|
|
561
|
+
this.__index__ = -1;
|
|
562
|
+
this.__last_index__ = -1; // Next scan position
|
|
563
|
+
this.__schema__ = '';
|
|
564
|
+
this.__text_cache__ = '';
|
|
565
|
+
|
|
566
|
+
this.__schemas__ = assign({}, defaultSchemas, schemas);
|
|
567
|
+
this.__compiled__ = {};
|
|
568
|
+
|
|
569
|
+
this.__tlds__ = tlds_default;
|
|
570
|
+
this.__tlds_replaced__ = false;
|
|
571
|
+
|
|
572
|
+
this.re = {};
|
|
573
|
+
|
|
574
|
+
compile(this);
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
/** chainable
|
|
578
|
+
* LinkifyIt#add(schema, definition)
|
|
579
|
+
* - schema (String): rule name (fixed pattern prefix)
|
|
580
|
+
* - definition (String|RegExp|Object): schema definition
|
|
581
|
+
*
|
|
582
|
+
* Add new rule definition. See constructor description for details.
|
|
583
|
+
**/
|
|
584
|
+
LinkifyIt.prototype.add = function add (schema, definition) {
|
|
585
|
+
this.__schemas__[schema] = definition;
|
|
586
|
+
compile(this);
|
|
587
|
+
return this
|
|
588
|
+
};
|
|
589
|
+
|
|
590
|
+
/** chainable
|
|
591
|
+
* LinkifyIt#set(options)
|
|
592
|
+
* - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }
|
|
593
|
+
*
|
|
594
|
+
* Set recognition options for links without schema.
|
|
595
|
+
**/
|
|
596
|
+
LinkifyIt.prototype.set = function set (options) {
|
|
597
|
+
this.__opts__ = assign(this.__opts__, options);
|
|
598
|
+
return this
|
|
599
|
+
};
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* LinkifyIt#test(text) -> Boolean
|
|
603
|
+
*
|
|
604
|
+
* Searches linkifiable pattern and returns `true` on success or `false` on fail.
|
|
605
|
+
**/
|
|
606
|
+
LinkifyIt.prototype.test = function test (text) {
|
|
607
|
+
// Reset scan cache
|
|
608
|
+
this.__text_cache__ = text;
|
|
609
|
+
this.__index__ = -1;
|
|
610
|
+
|
|
611
|
+
if (!text.length) { return false }
|
|
612
|
+
|
|
613
|
+
let m, ml, me, len, shift, next, re, tld_pos, at_pos;
|
|
614
|
+
|
|
615
|
+
// try to scan for link with schema - that's the most simple rule
|
|
616
|
+
if (this.re.schema_test.test(text)) {
|
|
617
|
+
re = this.re.schema_search;
|
|
618
|
+
re.lastIndex = 0;
|
|
619
|
+
while ((m = re.exec(text)) !== null) {
|
|
620
|
+
len = this.testSchemaAt(text, m[2], re.lastIndex);
|
|
621
|
+
if (len) {
|
|
622
|
+
this.__schema__ = m[2];
|
|
623
|
+
this.__index__ = m.index + m[1].length;
|
|
624
|
+
this.__last_index__ = m.index + m[0].length + len;
|
|
625
|
+
break
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
if (this.__opts__.fuzzyLink && this.__compiled__['http:']) {
|
|
631
|
+
// guess schemaless links
|
|
632
|
+
tld_pos = text.search(this.re.host_fuzzy_test);
|
|
633
|
+
if (tld_pos >= 0) {
|
|
634
|
+
// if tld is located after found link - no need to check fuzzy pattern
|
|
635
|
+
if (this.__index__ < 0 || tld_pos < this.__index__) {
|
|
636
|
+
if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {
|
|
637
|
+
shift = ml.index + ml[1].length;
|
|
638
|
+
|
|
639
|
+
if (this.__index__ < 0 || shift < this.__index__) {
|
|
640
|
+
this.__schema__ = '';
|
|
641
|
+
this.__index__ = shift;
|
|
642
|
+
this.__last_index__ = ml.index + ml[0].length;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) {
|
|
650
|
+
// guess schemaless emails
|
|
651
|
+
at_pos = text.indexOf('@');
|
|
652
|
+
if (at_pos >= 0) {
|
|
653
|
+
// We can't skip this check, because this cases are possible:
|
|
654
|
+
// 192.168.1.1@gmail.com, my.in@example.com
|
|
655
|
+
if ((me = text.match(this.re.email_fuzzy)) !== null) {
|
|
656
|
+
shift = me.index + me[1].length;
|
|
657
|
+
next = me.index + me[0].length;
|
|
658
|
+
|
|
659
|
+
if (this.__index__ < 0 || shift < this.__index__ ||
|
|
660
|
+
(shift === this.__index__ && next > this.__last_index__)) {
|
|
661
|
+
this.__schema__ = 'mailto:';
|
|
662
|
+
this.__index__ = shift;
|
|
663
|
+
this.__last_index__ = next;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
return this.__index__ >= 0
|
|
670
|
+
};
|
|
671
|
+
|
|
672
|
+
/**
|
|
673
|
+
* LinkifyIt#pretest(text) -> Boolean
|
|
674
|
+
*
|
|
675
|
+
* Very quick check, that can give false positives. Returns true if link MAY BE
|
|
676
|
+
* can exists. Can be used for speed optimization, when you need to check that
|
|
677
|
+
* link NOT exists.
|
|
678
|
+
**/
|
|
679
|
+
LinkifyIt.prototype.pretest = function pretest (text) {
|
|
680
|
+
return this.re.pretest.test(text)
|
|
681
|
+
};
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* LinkifyIt#testSchemaAt(text, name, position) -> Number
|
|
685
|
+
* - text (String): text to scan
|
|
686
|
+
* - name (String): rule (schema) name
|
|
687
|
+
* - position (Number): text offset to check from
|
|
688
|
+
*
|
|
689
|
+
* Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly
|
|
690
|
+
* at given position. Returns length of found pattern (0 on fail).
|
|
691
|
+
**/
|
|
692
|
+
LinkifyIt.prototype.testSchemaAt = function testSchemaAt (text, schema, pos) {
|
|
693
|
+
// If not supported schema check requested - terminate
|
|
694
|
+
if (!this.__compiled__[schema.toLowerCase()]) {
|
|
695
|
+
return 0
|
|
696
|
+
}
|
|
697
|
+
return this.__compiled__[schema.toLowerCase()].validate(text, pos, this)
|
|
698
|
+
};
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* LinkifyIt#match(text) -> Array|null
|
|
702
|
+
*
|
|
703
|
+
* Returns array of found link descriptions or `null` on fail. We strongly
|
|
704
|
+
* recommend to use [[LinkifyIt#test]] first, for best speed.
|
|
705
|
+
*
|
|
706
|
+
* ##### Result match description
|
|
707
|
+
*
|
|
708
|
+
* - __schema__ - link schema, can be empty for fuzzy links, or `//` for
|
|
709
|
+
* protocol-neutral links.
|
|
710
|
+
* - __index__ - offset of matched text
|
|
711
|
+
* - __lastIndex__ - index of next char after mathch end
|
|
712
|
+
* - __raw__ - matched text
|
|
713
|
+
* - __text__ - normalized text
|
|
714
|
+
* - __url__ - link, generated from matched text
|
|
715
|
+
**/
|
|
716
|
+
LinkifyIt.prototype.match = function match (text) {
|
|
717
|
+
const result = [];
|
|
718
|
+
let shift = 0;
|
|
719
|
+
|
|
720
|
+
// Try to take previous element from cache, if .test() called before
|
|
721
|
+
if (this.__index__ >= 0 && this.__text_cache__ === text) {
|
|
722
|
+
result.push(createMatch(this, shift));
|
|
723
|
+
shift = this.__last_index__;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
// Cut head if cache was used
|
|
727
|
+
let tail = shift ? text.slice(shift) : text;
|
|
728
|
+
|
|
729
|
+
// Scan string until end reached
|
|
730
|
+
while (this.test(tail)) {
|
|
731
|
+
result.push(createMatch(this, shift));
|
|
732
|
+
|
|
733
|
+
tail = tail.slice(this.__last_index__);
|
|
734
|
+
shift += this.__last_index__;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
if (result.length) {
|
|
738
|
+
return result
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
return null
|
|
742
|
+
};
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* LinkifyIt#matchAtStart(text) -> Match|null
|
|
746
|
+
*
|
|
747
|
+
* Returns fully-formed (not fuzzy) link if it starts at the beginning
|
|
748
|
+
* of the string, and null otherwise.
|
|
749
|
+
**/
|
|
750
|
+
LinkifyIt.prototype.matchAtStart = function matchAtStart (text) {
|
|
751
|
+
// Reset scan cache
|
|
752
|
+
this.__text_cache__ = text;
|
|
753
|
+
this.__index__ = -1;
|
|
754
|
+
|
|
755
|
+
if (!text.length) return null
|
|
756
|
+
|
|
757
|
+
const m = this.re.schema_at_start.exec(text);
|
|
758
|
+
if (!m) return null
|
|
759
|
+
|
|
760
|
+
const len = this.testSchemaAt(text, m[2], m[0].length);
|
|
761
|
+
if (!len) return null
|
|
762
|
+
|
|
763
|
+
this.__schema__ = m[2];
|
|
764
|
+
this.__index__ = m.index + m[1].length;
|
|
765
|
+
this.__last_index__ = m.index + m[0].length + len;
|
|
766
|
+
|
|
767
|
+
return createMatch(this, 0)
|
|
768
|
+
};
|
|
769
|
+
|
|
770
|
+
/** chainable
|
|
771
|
+
* LinkifyIt#tlds(list [, keepOld]) -> this
|
|
772
|
+
* - list (Array): list of tlds
|
|
773
|
+
* - keepOld (Boolean): merge with current list if `true` (`false` by default)
|
|
774
|
+
*
|
|
775
|
+
* Load (or merge) new tlds list. Those are user for fuzzy links (without prefix)
|
|
776
|
+
* to avoid false positives. By default this algorythm used:
|
|
777
|
+
*
|
|
778
|
+
* - hostname with any 2-letter root zones are ok.
|
|
779
|
+
* - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф
|
|
780
|
+
* are ok.
|
|
781
|
+
* - encoded (`xn--...`) root zones are ok.
|
|
782
|
+
*
|
|
783
|
+
* If list is replaced, then exact match for 2-chars root zones will be checked.
|
|
784
|
+
**/
|
|
785
|
+
LinkifyIt.prototype.tlds = function tlds (list, keepOld) {
|
|
786
|
+
list = Array.isArray(list) ? list : [list];
|
|
787
|
+
|
|
788
|
+
if (!keepOld) {
|
|
789
|
+
this.__tlds__ = list.slice();
|
|
790
|
+
this.__tlds_replaced__ = true;
|
|
791
|
+
compile(this);
|
|
792
|
+
return this
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
this.__tlds__ = this.__tlds__.concat(list)
|
|
796
|
+
.sort()
|
|
797
|
+
.filter(function (el, idx, arr) {
|
|
798
|
+
return el !== arr[idx - 1]
|
|
799
|
+
})
|
|
800
|
+
.reverse();
|
|
801
|
+
|
|
802
|
+
compile(this);
|
|
803
|
+
return this
|
|
804
|
+
};
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* LinkifyIt#normalize(match)
|
|
808
|
+
*
|
|
809
|
+
* Default normalizer (if schema does not define it's own).
|
|
810
|
+
**/
|
|
811
|
+
LinkifyIt.prototype.normalize = function normalize (match) {
|
|
812
|
+
// Do minimal possible changes by default. Need to collect feedback prior
|
|
813
|
+
// to move forward https://github.com/markdown-it/linkify-it/issues/1
|
|
814
|
+
|
|
815
|
+
if (!match.schema) { match.url = 'http://' + match.url; }
|
|
816
|
+
|
|
817
|
+
if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) {
|
|
818
|
+
match.url = 'mailto:' + match.url;
|
|
819
|
+
}
|
|
820
|
+
};
|
|
821
|
+
|
|
822
|
+
/**
|
|
823
|
+
* LinkifyIt#onCompile()
|
|
824
|
+
*
|
|
825
|
+
* Override to modify basic RegExp-s.
|
|
826
|
+
**/
|
|
827
|
+
LinkifyIt.prototype.onCompile = function onCompile () {
|
|
828
|
+
};
|
|
829
|
+
|
|
830
|
+
export { LinkifyIt as L };
|