@vc-shell/framework 1.1.44 → 1.1.45
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 +11 -0
- package/core/plugins/modularity/loader.ts +120 -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 +33347 -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 +33 -163
- 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,966 @@
|
|
|
1
|
+
import { D as DomUtils } from './vendor-domutils-Bc-Opz-v.js';
|
|
2
|
+
import { a as boolbase } from './vendor-boolbase-Cp9L0GAZ.js';
|
|
3
|
+
import { S as SelectorType, A as AttributeAction, p as parse } from './vendor-css-what-DuPJ1HEF.js';
|
|
4
|
+
import { n as nthCheck } from './vendor-nth-check-Bx8TxtJt.js';
|
|
5
|
+
|
|
6
|
+
const procedure = new Map([
|
|
7
|
+
[SelectorType.Universal, 50],
|
|
8
|
+
[SelectorType.Tag, 30],
|
|
9
|
+
[SelectorType.Attribute, 1],
|
|
10
|
+
[SelectorType.Pseudo, 0],
|
|
11
|
+
]);
|
|
12
|
+
function isTraversal(token) {
|
|
13
|
+
return !procedure.has(token.type);
|
|
14
|
+
}
|
|
15
|
+
const attributes = new Map([
|
|
16
|
+
[AttributeAction.Exists, 10],
|
|
17
|
+
[AttributeAction.Equals, 8],
|
|
18
|
+
[AttributeAction.Not, 7],
|
|
19
|
+
[AttributeAction.Start, 6],
|
|
20
|
+
[AttributeAction.End, 6],
|
|
21
|
+
[AttributeAction.Any, 5],
|
|
22
|
+
]);
|
|
23
|
+
/**
|
|
24
|
+
* Sort the parts of the passed selector,
|
|
25
|
+
* as there is potential for optimization
|
|
26
|
+
* (some types of selectors are faster than others)
|
|
27
|
+
*
|
|
28
|
+
* @param arr Selector to sort
|
|
29
|
+
*/
|
|
30
|
+
function sortByProcedure(arr) {
|
|
31
|
+
const procs = arr.map(getProcedure);
|
|
32
|
+
for (let i = 1; i < arr.length; i++) {
|
|
33
|
+
const procNew = procs[i];
|
|
34
|
+
if (procNew < 0)
|
|
35
|
+
continue;
|
|
36
|
+
for (let j = i - 1; j >= 0 && procNew < procs[j]; j--) {
|
|
37
|
+
const token = arr[j + 1];
|
|
38
|
+
arr[j + 1] = arr[j];
|
|
39
|
+
arr[j] = token;
|
|
40
|
+
procs[j + 1] = procs[j];
|
|
41
|
+
procs[j] = procNew;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function getProcedure(token) {
|
|
46
|
+
var _a, _b;
|
|
47
|
+
let proc = (_a = procedure.get(token.type)) !== null && _a !== void 0 ? _a : -1;
|
|
48
|
+
if (token.type === SelectorType.Attribute) {
|
|
49
|
+
proc = (_b = attributes.get(token.action)) !== null && _b !== void 0 ? _b : 4;
|
|
50
|
+
if (token.action === AttributeAction.Equals && token.name === "id") {
|
|
51
|
+
// Prefer ID selectors (eg. #ID)
|
|
52
|
+
proc = 9;
|
|
53
|
+
}
|
|
54
|
+
if (token.ignoreCase) {
|
|
55
|
+
/*
|
|
56
|
+
* IgnoreCase adds some overhead, prefer "normal" token
|
|
57
|
+
* this is a binary operation, to ensure it's still an int
|
|
58
|
+
*/
|
|
59
|
+
proc >>= 1;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else if (token.type === SelectorType.Pseudo) {
|
|
63
|
+
if (!token.data) {
|
|
64
|
+
proc = 3;
|
|
65
|
+
}
|
|
66
|
+
else if (token.name === "has" || token.name === "contains") {
|
|
67
|
+
proc = 0; // Expensive in any case
|
|
68
|
+
}
|
|
69
|
+
else if (Array.isArray(token.data)) {
|
|
70
|
+
// Eg. :matches, :not
|
|
71
|
+
proc = Math.min(...token.data.map((d) => Math.min(...d.map(getProcedure))));
|
|
72
|
+
// If we have traversals, try to avoid executing this selector
|
|
73
|
+
if (proc < 0) {
|
|
74
|
+
proc = 0;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
proc = 2;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return proc;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* All reserved characters in a regex, used for escaping.
|
|
86
|
+
*
|
|
87
|
+
* Taken from XRegExp, (c) 2007-2020 Steven Levithan under the MIT license
|
|
88
|
+
* https://github.com/slevithan/xregexp/blob/95eeebeb8fac8754d54eafe2b4743661ac1cf028/src/xregexp.js#L794
|
|
89
|
+
*/
|
|
90
|
+
const reChars = /[-[\]{}()*+?.,\\^$|#\s]/g;
|
|
91
|
+
function escapeRegex(value) {
|
|
92
|
+
return value.replace(reChars, "\\$&");
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Attributes that are case-insensitive in HTML.
|
|
96
|
+
*
|
|
97
|
+
* @private
|
|
98
|
+
* @see https://html.spec.whatwg.org/multipage/semantics-other.html#case-sensitivity-of-selectors
|
|
99
|
+
*/
|
|
100
|
+
const caseInsensitiveAttributes = new Set([
|
|
101
|
+
"accept",
|
|
102
|
+
"accept-charset",
|
|
103
|
+
"align",
|
|
104
|
+
"alink",
|
|
105
|
+
"axis",
|
|
106
|
+
"bgcolor",
|
|
107
|
+
"charset",
|
|
108
|
+
"checked",
|
|
109
|
+
"clear",
|
|
110
|
+
"codetype",
|
|
111
|
+
"color",
|
|
112
|
+
"compact",
|
|
113
|
+
"declare",
|
|
114
|
+
"defer",
|
|
115
|
+
"dir",
|
|
116
|
+
"direction",
|
|
117
|
+
"disabled",
|
|
118
|
+
"enctype",
|
|
119
|
+
"face",
|
|
120
|
+
"frame",
|
|
121
|
+
"hreflang",
|
|
122
|
+
"http-equiv",
|
|
123
|
+
"lang",
|
|
124
|
+
"language",
|
|
125
|
+
"link",
|
|
126
|
+
"media",
|
|
127
|
+
"method",
|
|
128
|
+
"multiple",
|
|
129
|
+
"nohref",
|
|
130
|
+
"noresize",
|
|
131
|
+
"noshade",
|
|
132
|
+
"nowrap",
|
|
133
|
+
"readonly",
|
|
134
|
+
"rel",
|
|
135
|
+
"rev",
|
|
136
|
+
"rules",
|
|
137
|
+
"scope",
|
|
138
|
+
"scrolling",
|
|
139
|
+
"selected",
|
|
140
|
+
"shape",
|
|
141
|
+
"target",
|
|
142
|
+
"text",
|
|
143
|
+
"type",
|
|
144
|
+
"valign",
|
|
145
|
+
"valuetype",
|
|
146
|
+
"vlink",
|
|
147
|
+
]);
|
|
148
|
+
function shouldIgnoreCase(selector, options) {
|
|
149
|
+
return typeof selector.ignoreCase === "boolean"
|
|
150
|
+
? selector.ignoreCase
|
|
151
|
+
: selector.ignoreCase === "quirks"
|
|
152
|
+
? !!options.quirksMode
|
|
153
|
+
: !options.xmlMode && caseInsensitiveAttributes.has(selector.name);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Attribute selectors
|
|
157
|
+
*/
|
|
158
|
+
const attributeRules = {
|
|
159
|
+
equals(next, data, options) {
|
|
160
|
+
const { adapter } = options;
|
|
161
|
+
const { name } = data;
|
|
162
|
+
let { value } = data;
|
|
163
|
+
if (shouldIgnoreCase(data, options)) {
|
|
164
|
+
value = value.toLowerCase();
|
|
165
|
+
return (elem) => {
|
|
166
|
+
const attr = adapter.getAttributeValue(elem, name);
|
|
167
|
+
return (attr != null &&
|
|
168
|
+
attr.length === value.length &&
|
|
169
|
+
attr.toLowerCase() === value &&
|
|
170
|
+
next(elem));
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
return (elem) => adapter.getAttributeValue(elem, name) === value && next(elem);
|
|
174
|
+
},
|
|
175
|
+
hyphen(next, data, options) {
|
|
176
|
+
const { adapter } = options;
|
|
177
|
+
const { name } = data;
|
|
178
|
+
let { value } = data;
|
|
179
|
+
const len = value.length;
|
|
180
|
+
if (shouldIgnoreCase(data, options)) {
|
|
181
|
+
value = value.toLowerCase();
|
|
182
|
+
return function hyphenIC(elem) {
|
|
183
|
+
const attr = adapter.getAttributeValue(elem, name);
|
|
184
|
+
return (attr != null &&
|
|
185
|
+
(attr.length === len || attr.charAt(len) === "-") &&
|
|
186
|
+
attr.substr(0, len).toLowerCase() === value &&
|
|
187
|
+
next(elem));
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
return function hyphen(elem) {
|
|
191
|
+
const attr = adapter.getAttributeValue(elem, name);
|
|
192
|
+
return (attr != null &&
|
|
193
|
+
(attr.length === len || attr.charAt(len) === "-") &&
|
|
194
|
+
attr.substr(0, len) === value &&
|
|
195
|
+
next(elem));
|
|
196
|
+
};
|
|
197
|
+
},
|
|
198
|
+
element(next, data, options) {
|
|
199
|
+
const { adapter } = options;
|
|
200
|
+
const { name, value } = data;
|
|
201
|
+
if (/\s/.test(value)) {
|
|
202
|
+
return boolbase.falseFunc;
|
|
203
|
+
}
|
|
204
|
+
const regex = new RegExp(`(?:^|\\s)${escapeRegex(value)}(?:$|\\s)`, shouldIgnoreCase(data, options) ? "i" : "");
|
|
205
|
+
return function element(elem) {
|
|
206
|
+
const attr = adapter.getAttributeValue(elem, name);
|
|
207
|
+
return (attr != null &&
|
|
208
|
+
attr.length >= value.length &&
|
|
209
|
+
regex.test(attr) &&
|
|
210
|
+
next(elem));
|
|
211
|
+
};
|
|
212
|
+
},
|
|
213
|
+
exists(next, { name }, { adapter }) {
|
|
214
|
+
return (elem) => adapter.hasAttrib(elem, name) && next(elem);
|
|
215
|
+
},
|
|
216
|
+
start(next, data, options) {
|
|
217
|
+
const { adapter } = options;
|
|
218
|
+
const { name } = data;
|
|
219
|
+
let { value } = data;
|
|
220
|
+
const len = value.length;
|
|
221
|
+
if (len === 0) {
|
|
222
|
+
return boolbase.falseFunc;
|
|
223
|
+
}
|
|
224
|
+
if (shouldIgnoreCase(data, options)) {
|
|
225
|
+
value = value.toLowerCase();
|
|
226
|
+
return (elem) => {
|
|
227
|
+
const attr = adapter.getAttributeValue(elem, name);
|
|
228
|
+
return (attr != null &&
|
|
229
|
+
attr.length >= len &&
|
|
230
|
+
attr.substr(0, len).toLowerCase() === value &&
|
|
231
|
+
next(elem));
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
return (elem) => {
|
|
235
|
+
var _a;
|
|
236
|
+
return !!((_a = adapter.getAttributeValue(elem, name)) === null || _a === void 0 ? void 0 : _a.startsWith(value)) &&
|
|
237
|
+
next(elem);
|
|
238
|
+
};
|
|
239
|
+
},
|
|
240
|
+
end(next, data, options) {
|
|
241
|
+
const { adapter } = options;
|
|
242
|
+
const { name } = data;
|
|
243
|
+
let { value } = data;
|
|
244
|
+
const len = -value.length;
|
|
245
|
+
if (len === 0) {
|
|
246
|
+
return boolbase.falseFunc;
|
|
247
|
+
}
|
|
248
|
+
if (shouldIgnoreCase(data, options)) {
|
|
249
|
+
value = value.toLowerCase();
|
|
250
|
+
return (elem) => {
|
|
251
|
+
var _a;
|
|
252
|
+
return ((_a = adapter
|
|
253
|
+
.getAttributeValue(elem, name)) === null || _a === void 0 ? void 0 : _a.substr(len).toLowerCase()) === value && next(elem);
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
return (elem) => {
|
|
257
|
+
var _a;
|
|
258
|
+
return !!((_a = adapter.getAttributeValue(elem, name)) === null || _a === void 0 ? void 0 : _a.endsWith(value)) &&
|
|
259
|
+
next(elem);
|
|
260
|
+
};
|
|
261
|
+
},
|
|
262
|
+
any(next, data, options) {
|
|
263
|
+
const { adapter } = options;
|
|
264
|
+
const { name, value } = data;
|
|
265
|
+
if (value === "") {
|
|
266
|
+
return boolbase.falseFunc;
|
|
267
|
+
}
|
|
268
|
+
if (shouldIgnoreCase(data, options)) {
|
|
269
|
+
const regex = new RegExp(escapeRegex(value), "i");
|
|
270
|
+
return function anyIC(elem) {
|
|
271
|
+
const attr = adapter.getAttributeValue(elem, name);
|
|
272
|
+
return (attr != null &&
|
|
273
|
+
attr.length >= value.length &&
|
|
274
|
+
regex.test(attr) &&
|
|
275
|
+
next(elem));
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
return (elem) => {
|
|
279
|
+
var _a;
|
|
280
|
+
return !!((_a = adapter.getAttributeValue(elem, name)) === null || _a === void 0 ? void 0 : _a.includes(value)) &&
|
|
281
|
+
next(elem);
|
|
282
|
+
};
|
|
283
|
+
},
|
|
284
|
+
not(next, data, options) {
|
|
285
|
+
const { adapter } = options;
|
|
286
|
+
const { name } = data;
|
|
287
|
+
let { value } = data;
|
|
288
|
+
if (value === "") {
|
|
289
|
+
return (elem) => !!adapter.getAttributeValue(elem, name) && next(elem);
|
|
290
|
+
}
|
|
291
|
+
else if (shouldIgnoreCase(data, options)) {
|
|
292
|
+
value = value.toLowerCase();
|
|
293
|
+
return (elem) => {
|
|
294
|
+
const attr = adapter.getAttributeValue(elem, name);
|
|
295
|
+
return ((attr == null ||
|
|
296
|
+
attr.length !== value.length ||
|
|
297
|
+
attr.toLowerCase() !== value) &&
|
|
298
|
+
next(elem));
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
return (elem) => adapter.getAttributeValue(elem, name) !== value && next(elem);
|
|
302
|
+
},
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
function getChildFunc(next, adapter) {
|
|
306
|
+
return (elem) => {
|
|
307
|
+
const parent = adapter.getParent(elem);
|
|
308
|
+
return parent != null && adapter.isTag(parent) && next(elem);
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
const filters = {
|
|
312
|
+
contains(next, text, { adapter }) {
|
|
313
|
+
return function contains(elem) {
|
|
314
|
+
return next(elem) && adapter.getText(elem).includes(text);
|
|
315
|
+
};
|
|
316
|
+
},
|
|
317
|
+
icontains(next, text, { adapter }) {
|
|
318
|
+
const itext = text.toLowerCase();
|
|
319
|
+
return function icontains(elem) {
|
|
320
|
+
return (next(elem) &&
|
|
321
|
+
adapter.getText(elem).toLowerCase().includes(itext));
|
|
322
|
+
};
|
|
323
|
+
},
|
|
324
|
+
// Location specific methods
|
|
325
|
+
"nth-child"(next, rule, { adapter, equals }) {
|
|
326
|
+
const func = nthCheck(rule);
|
|
327
|
+
if (func === boolbase.falseFunc)
|
|
328
|
+
return boolbase.falseFunc;
|
|
329
|
+
if (func === boolbase.trueFunc)
|
|
330
|
+
return getChildFunc(next, adapter);
|
|
331
|
+
return function nthChild(elem) {
|
|
332
|
+
const siblings = adapter.getSiblings(elem);
|
|
333
|
+
let pos = 0;
|
|
334
|
+
for (let i = 0; i < siblings.length; i++) {
|
|
335
|
+
if (equals(elem, siblings[i]))
|
|
336
|
+
break;
|
|
337
|
+
if (adapter.isTag(siblings[i])) {
|
|
338
|
+
pos++;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
return func(pos) && next(elem);
|
|
342
|
+
};
|
|
343
|
+
},
|
|
344
|
+
"nth-last-child"(next, rule, { adapter, equals }) {
|
|
345
|
+
const func = nthCheck(rule);
|
|
346
|
+
if (func === boolbase.falseFunc)
|
|
347
|
+
return boolbase.falseFunc;
|
|
348
|
+
if (func === boolbase.trueFunc)
|
|
349
|
+
return getChildFunc(next, adapter);
|
|
350
|
+
return function nthLastChild(elem) {
|
|
351
|
+
const siblings = adapter.getSiblings(elem);
|
|
352
|
+
let pos = 0;
|
|
353
|
+
for (let i = siblings.length - 1; i >= 0; i--) {
|
|
354
|
+
if (equals(elem, siblings[i]))
|
|
355
|
+
break;
|
|
356
|
+
if (adapter.isTag(siblings[i])) {
|
|
357
|
+
pos++;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
return func(pos) && next(elem);
|
|
361
|
+
};
|
|
362
|
+
},
|
|
363
|
+
"nth-of-type"(next, rule, { adapter, equals }) {
|
|
364
|
+
const func = nthCheck(rule);
|
|
365
|
+
if (func === boolbase.falseFunc)
|
|
366
|
+
return boolbase.falseFunc;
|
|
367
|
+
if (func === boolbase.trueFunc)
|
|
368
|
+
return getChildFunc(next, adapter);
|
|
369
|
+
return function nthOfType(elem) {
|
|
370
|
+
const siblings = adapter.getSiblings(elem);
|
|
371
|
+
let pos = 0;
|
|
372
|
+
for (let i = 0; i < siblings.length; i++) {
|
|
373
|
+
const currentSibling = siblings[i];
|
|
374
|
+
if (equals(elem, currentSibling))
|
|
375
|
+
break;
|
|
376
|
+
if (adapter.isTag(currentSibling) &&
|
|
377
|
+
adapter.getName(currentSibling) === adapter.getName(elem)) {
|
|
378
|
+
pos++;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
return func(pos) && next(elem);
|
|
382
|
+
};
|
|
383
|
+
},
|
|
384
|
+
"nth-last-of-type"(next, rule, { adapter, equals }) {
|
|
385
|
+
const func = nthCheck(rule);
|
|
386
|
+
if (func === boolbase.falseFunc)
|
|
387
|
+
return boolbase.falseFunc;
|
|
388
|
+
if (func === boolbase.trueFunc)
|
|
389
|
+
return getChildFunc(next, adapter);
|
|
390
|
+
return function nthLastOfType(elem) {
|
|
391
|
+
const siblings = adapter.getSiblings(elem);
|
|
392
|
+
let pos = 0;
|
|
393
|
+
for (let i = siblings.length - 1; i >= 0; i--) {
|
|
394
|
+
const currentSibling = siblings[i];
|
|
395
|
+
if (equals(elem, currentSibling))
|
|
396
|
+
break;
|
|
397
|
+
if (adapter.isTag(currentSibling) &&
|
|
398
|
+
adapter.getName(currentSibling) === adapter.getName(elem)) {
|
|
399
|
+
pos++;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
return func(pos) && next(elem);
|
|
403
|
+
};
|
|
404
|
+
},
|
|
405
|
+
// TODO determine the actual root element
|
|
406
|
+
root(next, _rule, { adapter }) {
|
|
407
|
+
return (elem) => {
|
|
408
|
+
const parent = adapter.getParent(elem);
|
|
409
|
+
return (parent == null || !adapter.isTag(parent)) && next(elem);
|
|
410
|
+
};
|
|
411
|
+
},
|
|
412
|
+
scope(next, rule, options, context) {
|
|
413
|
+
const { equals } = options;
|
|
414
|
+
if (!context || context.length === 0) {
|
|
415
|
+
// Equivalent to :root
|
|
416
|
+
return filters["root"](next, rule, options);
|
|
417
|
+
}
|
|
418
|
+
if (context.length === 1) {
|
|
419
|
+
// NOTE: can't be unpacked, as :has uses this for side-effects
|
|
420
|
+
return (elem) => equals(context[0], elem) && next(elem);
|
|
421
|
+
}
|
|
422
|
+
return (elem) => context.includes(elem) && next(elem);
|
|
423
|
+
},
|
|
424
|
+
hover: dynamicStatePseudo("isHovered"),
|
|
425
|
+
visited: dynamicStatePseudo("isVisited"),
|
|
426
|
+
active: dynamicStatePseudo("isActive"),
|
|
427
|
+
};
|
|
428
|
+
/**
|
|
429
|
+
* Dynamic state pseudos. These depend on optional Adapter methods.
|
|
430
|
+
*
|
|
431
|
+
* @param name The name of the adapter method to call.
|
|
432
|
+
* @returns Pseudo for the `filters` object.
|
|
433
|
+
*/
|
|
434
|
+
function dynamicStatePseudo(name) {
|
|
435
|
+
return function dynamicPseudo(next, _rule, { adapter }) {
|
|
436
|
+
const func = adapter[name];
|
|
437
|
+
if (typeof func !== "function") {
|
|
438
|
+
return boolbase.falseFunc;
|
|
439
|
+
}
|
|
440
|
+
return function active(elem) {
|
|
441
|
+
return func(elem) && next(elem);
|
|
442
|
+
};
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
// While filters are precompiled, pseudos get called when they are needed
|
|
447
|
+
const pseudos = {
|
|
448
|
+
empty(elem, { adapter }) {
|
|
449
|
+
return !adapter.getChildren(elem).some((elem) =>
|
|
450
|
+
// FIXME: `getText` call is potentially expensive.
|
|
451
|
+
adapter.isTag(elem) || adapter.getText(elem) !== "");
|
|
452
|
+
},
|
|
453
|
+
"first-child"(elem, { adapter, equals }) {
|
|
454
|
+
if (adapter.prevElementSibling) {
|
|
455
|
+
return adapter.prevElementSibling(elem) == null;
|
|
456
|
+
}
|
|
457
|
+
const firstChild = adapter
|
|
458
|
+
.getSiblings(elem)
|
|
459
|
+
.find((elem) => adapter.isTag(elem));
|
|
460
|
+
return firstChild != null && equals(elem, firstChild);
|
|
461
|
+
},
|
|
462
|
+
"last-child"(elem, { adapter, equals }) {
|
|
463
|
+
const siblings = adapter.getSiblings(elem);
|
|
464
|
+
for (let i = siblings.length - 1; i >= 0; i--) {
|
|
465
|
+
if (equals(elem, siblings[i]))
|
|
466
|
+
return true;
|
|
467
|
+
if (adapter.isTag(siblings[i]))
|
|
468
|
+
break;
|
|
469
|
+
}
|
|
470
|
+
return false;
|
|
471
|
+
},
|
|
472
|
+
"first-of-type"(elem, { adapter, equals }) {
|
|
473
|
+
const siblings = adapter.getSiblings(elem);
|
|
474
|
+
const elemName = adapter.getName(elem);
|
|
475
|
+
for (let i = 0; i < siblings.length; i++) {
|
|
476
|
+
const currentSibling = siblings[i];
|
|
477
|
+
if (equals(elem, currentSibling))
|
|
478
|
+
return true;
|
|
479
|
+
if (adapter.isTag(currentSibling) &&
|
|
480
|
+
adapter.getName(currentSibling) === elemName) {
|
|
481
|
+
break;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
return false;
|
|
485
|
+
},
|
|
486
|
+
"last-of-type"(elem, { adapter, equals }) {
|
|
487
|
+
const siblings = adapter.getSiblings(elem);
|
|
488
|
+
const elemName = adapter.getName(elem);
|
|
489
|
+
for (let i = siblings.length - 1; i >= 0; i--) {
|
|
490
|
+
const currentSibling = siblings[i];
|
|
491
|
+
if (equals(elem, currentSibling))
|
|
492
|
+
return true;
|
|
493
|
+
if (adapter.isTag(currentSibling) &&
|
|
494
|
+
adapter.getName(currentSibling) === elemName) {
|
|
495
|
+
break;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
return false;
|
|
499
|
+
},
|
|
500
|
+
"only-of-type"(elem, { adapter, equals }) {
|
|
501
|
+
const elemName = adapter.getName(elem);
|
|
502
|
+
return adapter
|
|
503
|
+
.getSiblings(elem)
|
|
504
|
+
.every((sibling) => equals(elem, sibling) ||
|
|
505
|
+
!adapter.isTag(sibling) ||
|
|
506
|
+
adapter.getName(sibling) !== elemName);
|
|
507
|
+
},
|
|
508
|
+
"only-child"(elem, { adapter, equals }) {
|
|
509
|
+
return adapter
|
|
510
|
+
.getSiblings(elem)
|
|
511
|
+
.every((sibling) => equals(elem, sibling) || !adapter.isTag(sibling));
|
|
512
|
+
},
|
|
513
|
+
};
|
|
514
|
+
function verifyPseudoArgs(func, name, subselect, argIndex) {
|
|
515
|
+
if (subselect === null) {
|
|
516
|
+
if (func.length > argIndex) {
|
|
517
|
+
throw new Error(`Pseudo-class :${name} requires an argument`);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
else if (func.length === argIndex) {
|
|
521
|
+
throw new Error(`Pseudo-class :${name} doesn't have any arguments`);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Aliases are pseudos that are expressed as selectors.
|
|
527
|
+
*/
|
|
528
|
+
const aliases = {
|
|
529
|
+
// Links
|
|
530
|
+
"any-link": ":is(a, area, link)[href]",
|
|
531
|
+
link: ":any-link:not(:visited)",
|
|
532
|
+
// Forms
|
|
533
|
+
// https://html.spec.whatwg.org/multipage/scripting.html#disabled-elements
|
|
534
|
+
disabled: `:is(
|
|
535
|
+
:is(button, input, select, textarea, optgroup, option)[disabled],
|
|
536
|
+
optgroup[disabled] > option,
|
|
537
|
+
fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)
|
|
538
|
+
)`,
|
|
539
|
+
enabled: ":not(:disabled)",
|
|
540
|
+
checked: ":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",
|
|
541
|
+
required: ":is(input, select, textarea)[required]",
|
|
542
|
+
optional: ":is(input, select, textarea):not([required])",
|
|
543
|
+
// JQuery extensions
|
|
544
|
+
// https://html.spec.whatwg.org/multipage/form-elements.html#concept-option-selectedness
|
|
545
|
+
selected: "option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",
|
|
546
|
+
checkbox: "[type=checkbox]",
|
|
547
|
+
file: "[type=file]",
|
|
548
|
+
password: "[type=password]",
|
|
549
|
+
radio: "[type=radio]",
|
|
550
|
+
reset: "[type=reset]",
|
|
551
|
+
image: "[type=image]",
|
|
552
|
+
submit: "[type=submit]",
|
|
553
|
+
parent: ":not(:empty)",
|
|
554
|
+
header: ":is(h1, h2, h3, h4, h5, h6)",
|
|
555
|
+
button: ":is(button, input[type=button])",
|
|
556
|
+
input: ":is(input, textarea, select, button)",
|
|
557
|
+
text: "input:is(:not([type!='']), [type=text])",
|
|
558
|
+
};
|
|
559
|
+
|
|
560
|
+
/** Used as a placeholder for :has. Will be replaced with the actual element. */
|
|
561
|
+
const PLACEHOLDER_ELEMENT = {};
|
|
562
|
+
function ensureIsTag(next, adapter) {
|
|
563
|
+
if (next === boolbase.falseFunc)
|
|
564
|
+
return boolbase.falseFunc;
|
|
565
|
+
return (elem) => adapter.isTag(elem) && next(elem);
|
|
566
|
+
}
|
|
567
|
+
function getNextSiblings(elem, adapter) {
|
|
568
|
+
const siblings = adapter.getSiblings(elem);
|
|
569
|
+
if (siblings.length <= 1)
|
|
570
|
+
return [];
|
|
571
|
+
const elemIndex = siblings.indexOf(elem);
|
|
572
|
+
if (elemIndex < 0 || elemIndex === siblings.length - 1)
|
|
573
|
+
return [];
|
|
574
|
+
return siblings.slice(elemIndex + 1).filter(adapter.isTag);
|
|
575
|
+
}
|
|
576
|
+
function copyOptions(options) {
|
|
577
|
+
// Not copied: context, rootFunc
|
|
578
|
+
return {
|
|
579
|
+
xmlMode: !!options.xmlMode,
|
|
580
|
+
lowerCaseAttributeNames: !!options.lowerCaseAttributeNames,
|
|
581
|
+
lowerCaseTags: !!options.lowerCaseTags,
|
|
582
|
+
quirksMode: !!options.quirksMode,
|
|
583
|
+
cacheResults: !!options.cacheResults,
|
|
584
|
+
pseudos: options.pseudos,
|
|
585
|
+
adapter: options.adapter,
|
|
586
|
+
equals: options.equals,
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
const is = (next, token, options, context, compileToken) => {
|
|
590
|
+
const func = compileToken(token, copyOptions(options), context);
|
|
591
|
+
return func === boolbase.trueFunc
|
|
592
|
+
? next
|
|
593
|
+
: func === boolbase.falseFunc
|
|
594
|
+
? boolbase.falseFunc
|
|
595
|
+
: (elem) => func(elem) && next(elem);
|
|
596
|
+
};
|
|
597
|
+
/*
|
|
598
|
+
* :not, :has, :is, :matches and :where have to compile selectors
|
|
599
|
+
* doing this in src/pseudos.ts would lead to circular dependencies,
|
|
600
|
+
* so we add them here
|
|
601
|
+
*/
|
|
602
|
+
const subselects = {
|
|
603
|
+
is,
|
|
604
|
+
/**
|
|
605
|
+
* `:matches` and `:where` are aliases for `:is`.
|
|
606
|
+
*/
|
|
607
|
+
matches: is,
|
|
608
|
+
where: is,
|
|
609
|
+
not(next, token, options, context, compileToken) {
|
|
610
|
+
const func = compileToken(token, copyOptions(options), context);
|
|
611
|
+
return func === boolbase.falseFunc
|
|
612
|
+
? next
|
|
613
|
+
: func === boolbase.trueFunc
|
|
614
|
+
? boolbase.falseFunc
|
|
615
|
+
: (elem) => !func(elem) && next(elem);
|
|
616
|
+
},
|
|
617
|
+
has(next, subselect, options, _context, compileToken) {
|
|
618
|
+
const { adapter } = options;
|
|
619
|
+
const opts = copyOptions(options);
|
|
620
|
+
opts.relativeSelector = true;
|
|
621
|
+
const context = subselect.some((s) => s.some(isTraversal))
|
|
622
|
+
? // Used as a placeholder. Will be replaced with the actual element.
|
|
623
|
+
[PLACEHOLDER_ELEMENT]
|
|
624
|
+
: undefined;
|
|
625
|
+
const compiled = compileToken(subselect, opts, context);
|
|
626
|
+
if (compiled === boolbase.falseFunc)
|
|
627
|
+
return boolbase.falseFunc;
|
|
628
|
+
const hasElement = ensureIsTag(compiled, adapter);
|
|
629
|
+
// If `compiled` is `trueFunc`, we can skip this.
|
|
630
|
+
if (context && compiled !== boolbase.trueFunc) {
|
|
631
|
+
/*
|
|
632
|
+
* `shouldTestNextSiblings` will only be true if the query starts with
|
|
633
|
+
* a traversal (sibling or adjacent). That means we will always have a context.
|
|
634
|
+
*/
|
|
635
|
+
const { shouldTestNextSiblings = false } = compiled;
|
|
636
|
+
return (elem) => {
|
|
637
|
+
if (!next(elem))
|
|
638
|
+
return false;
|
|
639
|
+
context[0] = elem;
|
|
640
|
+
const childs = adapter.getChildren(elem);
|
|
641
|
+
const nextElements = shouldTestNextSiblings
|
|
642
|
+
? [...childs, ...getNextSiblings(elem, adapter)]
|
|
643
|
+
: childs;
|
|
644
|
+
return adapter.existsOne(hasElement, nextElements);
|
|
645
|
+
};
|
|
646
|
+
}
|
|
647
|
+
return (elem) => next(elem) &&
|
|
648
|
+
adapter.existsOne(hasElement, adapter.getChildren(elem));
|
|
649
|
+
},
|
|
650
|
+
};
|
|
651
|
+
|
|
652
|
+
function compilePseudoSelector(next, selector, options, context, compileToken) {
|
|
653
|
+
var _a;
|
|
654
|
+
const { name, data } = selector;
|
|
655
|
+
if (Array.isArray(data)) {
|
|
656
|
+
if (!(name in subselects)) {
|
|
657
|
+
throw new Error(`Unknown pseudo-class :${name}(${data})`);
|
|
658
|
+
}
|
|
659
|
+
return subselects[name](next, data, options, context, compileToken);
|
|
660
|
+
}
|
|
661
|
+
const userPseudo = (_a = options.pseudos) === null || _a === void 0 ? void 0 : _a[name];
|
|
662
|
+
const stringPseudo = typeof userPseudo === "string" ? userPseudo : aliases[name];
|
|
663
|
+
if (typeof stringPseudo === "string") {
|
|
664
|
+
if (data != null) {
|
|
665
|
+
throw new Error(`Pseudo ${name} doesn't have any arguments`);
|
|
666
|
+
}
|
|
667
|
+
// The alias has to be parsed here, to make sure options are respected.
|
|
668
|
+
const alias = parse(stringPseudo);
|
|
669
|
+
return subselects["is"](next, alias, options, context, compileToken);
|
|
670
|
+
}
|
|
671
|
+
if (typeof userPseudo === "function") {
|
|
672
|
+
verifyPseudoArgs(userPseudo, name, data, 1);
|
|
673
|
+
return (elem) => userPseudo(elem, data) && next(elem);
|
|
674
|
+
}
|
|
675
|
+
if (name in filters) {
|
|
676
|
+
return filters[name](next, data, options, context);
|
|
677
|
+
}
|
|
678
|
+
if (name in pseudos) {
|
|
679
|
+
const pseudo = pseudos[name];
|
|
680
|
+
verifyPseudoArgs(pseudo, name, data, 2);
|
|
681
|
+
return (elem) => pseudo(elem, options, data) && next(elem);
|
|
682
|
+
}
|
|
683
|
+
throw new Error(`Unknown pseudo-class :${name}`);
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
function getElementParent(node, adapter) {
|
|
687
|
+
const parent = adapter.getParent(node);
|
|
688
|
+
if (parent && adapter.isTag(parent)) {
|
|
689
|
+
return parent;
|
|
690
|
+
}
|
|
691
|
+
return null;
|
|
692
|
+
}
|
|
693
|
+
/*
|
|
694
|
+
* All available rules
|
|
695
|
+
*/
|
|
696
|
+
function compileGeneralSelector(next, selector, options, context, compileToken) {
|
|
697
|
+
const { adapter, equals } = options;
|
|
698
|
+
switch (selector.type) {
|
|
699
|
+
case SelectorType.PseudoElement: {
|
|
700
|
+
throw new Error("Pseudo-elements are not supported by css-select");
|
|
701
|
+
}
|
|
702
|
+
case SelectorType.ColumnCombinator: {
|
|
703
|
+
throw new Error("Column combinators are not yet supported by css-select");
|
|
704
|
+
}
|
|
705
|
+
case SelectorType.Attribute: {
|
|
706
|
+
if (selector.namespace != null) {
|
|
707
|
+
throw new Error("Namespaced attributes are not yet supported by css-select");
|
|
708
|
+
}
|
|
709
|
+
if (!options.xmlMode || options.lowerCaseAttributeNames) {
|
|
710
|
+
selector.name = selector.name.toLowerCase();
|
|
711
|
+
}
|
|
712
|
+
return attributeRules[selector.action](next, selector, options);
|
|
713
|
+
}
|
|
714
|
+
case SelectorType.Pseudo: {
|
|
715
|
+
return compilePseudoSelector(next, selector, options, context, compileToken);
|
|
716
|
+
}
|
|
717
|
+
// Tags
|
|
718
|
+
case SelectorType.Tag: {
|
|
719
|
+
if (selector.namespace != null) {
|
|
720
|
+
throw new Error("Namespaced tag names are not yet supported by css-select");
|
|
721
|
+
}
|
|
722
|
+
let { name } = selector;
|
|
723
|
+
if (!options.xmlMode || options.lowerCaseTags) {
|
|
724
|
+
name = name.toLowerCase();
|
|
725
|
+
}
|
|
726
|
+
return function tag(elem) {
|
|
727
|
+
return adapter.getName(elem) === name && next(elem);
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
// Traversal
|
|
731
|
+
case SelectorType.Descendant: {
|
|
732
|
+
if (options.cacheResults === false ||
|
|
733
|
+
typeof WeakSet === "undefined") {
|
|
734
|
+
return function descendant(elem) {
|
|
735
|
+
let current = elem;
|
|
736
|
+
while ((current = getElementParent(current, adapter))) {
|
|
737
|
+
if (next(current)) {
|
|
738
|
+
return true;
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
return false;
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
// @ts-expect-error `ElementNode` is not extending object
|
|
745
|
+
const isFalseCache = new WeakSet();
|
|
746
|
+
return function cachedDescendant(elem) {
|
|
747
|
+
let current = elem;
|
|
748
|
+
while ((current = getElementParent(current, adapter))) {
|
|
749
|
+
if (!isFalseCache.has(current)) {
|
|
750
|
+
if (adapter.isTag(current) && next(current)) {
|
|
751
|
+
return true;
|
|
752
|
+
}
|
|
753
|
+
isFalseCache.add(current);
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
return false;
|
|
757
|
+
};
|
|
758
|
+
}
|
|
759
|
+
case "_flexibleDescendant": {
|
|
760
|
+
// Include element itself, only used while querying an array
|
|
761
|
+
return function flexibleDescendant(elem) {
|
|
762
|
+
let current = elem;
|
|
763
|
+
do {
|
|
764
|
+
if (next(current))
|
|
765
|
+
return true;
|
|
766
|
+
} while ((current = getElementParent(current, adapter)));
|
|
767
|
+
return false;
|
|
768
|
+
};
|
|
769
|
+
}
|
|
770
|
+
case SelectorType.Parent: {
|
|
771
|
+
return function parent(elem) {
|
|
772
|
+
return adapter
|
|
773
|
+
.getChildren(elem)
|
|
774
|
+
.some((elem) => adapter.isTag(elem) && next(elem));
|
|
775
|
+
};
|
|
776
|
+
}
|
|
777
|
+
case SelectorType.Child: {
|
|
778
|
+
return function child(elem) {
|
|
779
|
+
const parent = adapter.getParent(elem);
|
|
780
|
+
return parent != null && adapter.isTag(parent) && next(parent);
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
case SelectorType.Sibling: {
|
|
784
|
+
return function sibling(elem) {
|
|
785
|
+
const siblings = adapter.getSiblings(elem);
|
|
786
|
+
for (let i = 0; i < siblings.length; i++) {
|
|
787
|
+
const currentSibling = siblings[i];
|
|
788
|
+
if (equals(elem, currentSibling))
|
|
789
|
+
break;
|
|
790
|
+
if (adapter.isTag(currentSibling) && next(currentSibling)) {
|
|
791
|
+
return true;
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
return false;
|
|
795
|
+
};
|
|
796
|
+
}
|
|
797
|
+
case SelectorType.Adjacent: {
|
|
798
|
+
if (adapter.prevElementSibling) {
|
|
799
|
+
return function adjacent(elem) {
|
|
800
|
+
const previous = adapter.prevElementSibling(elem);
|
|
801
|
+
return previous != null && next(previous);
|
|
802
|
+
};
|
|
803
|
+
}
|
|
804
|
+
return function adjacent(elem) {
|
|
805
|
+
const siblings = adapter.getSiblings(elem);
|
|
806
|
+
let lastElement;
|
|
807
|
+
for (let i = 0; i < siblings.length; i++) {
|
|
808
|
+
const currentSibling = siblings[i];
|
|
809
|
+
if (equals(elem, currentSibling))
|
|
810
|
+
break;
|
|
811
|
+
if (adapter.isTag(currentSibling)) {
|
|
812
|
+
lastElement = currentSibling;
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
return !!lastElement && next(lastElement);
|
|
816
|
+
};
|
|
817
|
+
}
|
|
818
|
+
case SelectorType.Universal: {
|
|
819
|
+
if (selector.namespace != null && selector.namespace !== "*") {
|
|
820
|
+
throw new Error("Namespaced universal selectors are not yet supported by css-select");
|
|
821
|
+
}
|
|
822
|
+
return next;
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
function includesScopePseudo(t) {
|
|
828
|
+
return (t.type === SelectorType.Pseudo &&
|
|
829
|
+
(t.name === "scope" ||
|
|
830
|
+
(Array.isArray(t.data) &&
|
|
831
|
+
t.data.some((data) => data.some(includesScopePseudo)))));
|
|
832
|
+
}
|
|
833
|
+
const DESCENDANT_TOKEN = { type: SelectorType.Descendant };
|
|
834
|
+
const FLEXIBLE_DESCENDANT_TOKEN = {
|
|
835
|
+
type: "_flexibleDescendant",
|
|
836
|
+
};
|
|
837
|
+
const SCOPE_TOKEN = {
|
|
838
|
+
type: SelectorType.Pseudo,
|
|
839
|
+
name: "scope",
|
|
840
|
+
data: null,
|
|
841
|
+
};
|
|
842
|
+
/*
|
|
843
|
+
* CSS 4 Spec (Draft): 3.4.1. Absolutizing a Relative Selector
|
|
844
|
+
* http://www.w3.org/TR/selectors4/#absolutizing
|
|
845
|
+
*/
|
|
846
|
+
function absolutize(token, { adapter }, context) {
|
|
847
|
+
// TODO Use better check if the context is a document
|
|
848
|
+
const hasContext = !!(context === null || context === void 0 ? void 0 : context.every((e) => {
|
|
849
|
+
const parent = adapter.isTag(e) && adapter.getParent(e);
|
|
850
|
+
return e === PLACEHOLDER_ELEMENT || (parent && adapter.isTag(parent));
|
|
851
|
+
}));
|
|
852
|
+
for (const t of token) {
|
|
853
|
+
if (t.length > 0 &&
|
|
854
|
+
isTraversal(t[0]) &&
|
|
855
|
+
t[0].type !== SelectorType.Descendant) ;
|
|
856
|
+
else if (hasContext && !t.some(includesScopePseudo)) {
|
|
857
|
+
t.unshift(DESCENDANT_TOKEN);
|
|
858
|
+
}
|
|
859
|
+
else {
|
|
860
|
+
continue;
|
|
861
|
+
}
|
|
862
|
+
t.unshift(SCOPE_TOKEN);
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
function compileToken(token, options, context) {
|
|
866
|
+
var _a;
|
|
867
|
+
token.forEach(sortByProcedure);
|
|
868
|
+
context = (_a = options.context) !== null && _a !== void 0 ? _a : context;
|
|
869
|
+
const isArrayContext = Array.isArray(context);
|
|
870
|
+
const finalContext = context && (Array.isArray(context) ? context : [context]);
|
|
871
|
+
// Check if the selector is relative
|
|
872
|
+
if (options.relativeSelector !== false) {
|
|
873
|
+
absolutize(token, options, finalContext);
|
|
874
|
+
}
|
|
875
|
+
else if (token.some((t) => t.length > 0 && isTraversal(t[0]))) {
|
|
876
|
+
throw new Error("Relative selectors are not allowed when the `relativeSelector` option is disabled");
|
|
877
|
+
}
|
|
878
|
+
let shouldTestNextSiblings = false;
|
|
879
|
+
const query = token
|
|
880
|
+
.map((rules) => {
|
|
881
|
+
if (rules.length >= 2) {
|
|
882
|
+
const [first, second] = rules;
|
|
883
|
+
if (first.type !== SelectorType.Pseudo ||
|
|
884
|
+
first.name !== "scope") ;
|
|
885
|
+
else if (isArrayContext &&
|
|
886
|
+
second.type === SelectorType.Descendant) {
|
|
887
|
+
rules[1] = FLEXIBLE_DESCENDANT_TOKEN;
|
|
888
|
+
}
|
|
889
|
+
else if (second.type === SelectorType.Adjacent ||
|
|
890
|
+
second.type === SelectorType.Sibling) {
|
|
891
|
+
shouldTestNextSiblings = true;
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
return compileRules(rules, options, finalContext);
|
|
895
|
+
})
|
|
896
|
+
.reduce(reduceRules, boolbase.falseFunc);
|
|
897
|
+
query.shouldTestNextSiblings = shouldTestNextSiblings;
|
|
898
|
+
return query;
|
|
899
|
+
}
|
|
900
|
+
function compileRules(rules, options, context) {
|
|
901
|
+
var _a;
|
|
902
|
+
return rules.reduce((previous, rule) => previous === boolbase.falseFunc
|
|
903
|
+
? boolbase.falseFunc
|
|
904
|
+
: compileGeneralSelector(previous, rule, options, context, compileToken), (_a = options.rootFunc) !== null && _a !== void 0 ? _a : boolbase.trueFunc);
|
|
905
|
+
}
|
|
906
|
+
function reduceRules(a, b) {
|
|
907
|
+
if (b === boolbase.falseFunc || a === boolbase.trueFunc) {
|
|
908
|
+
return a;
|
|
909
|
+
}
|
|
910
|
+
if (a === boolbase.falseFunc || b === boolbase.trueFunc) {
|
|
911
|
+
return b;
|
|
912
|
+
}
|
|
913
|
+
return function combine(elem) {
|
|
914
|
+
return a(elem) || b(elem);
|
|
915
|
+
};
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
const defaultEquals = (a, b) => a === b;
|
|
919
|
+
const defaultOptions = {
|
|
920
|
+
adapter: DomUtils,
|
|
921
|
+
equals: defaultEquals,
|
|
922
|
+
};
|
|
923
|
+
function convertOptionFormats(options) {
|
|
924
|
+
var _a, _b, _c, _d;
|
|
925
|
+
/*
|
|
926
|
+
* We force one format of options to the other one.
|
|
927
|
+
*/
|
|
928
|
+
// @ts-expect-error Default options may have incompatible `Node` / `ElementNode`.
|
|
929
|
+
const opts = options !== null && options !== void 0 ? options : defaultOptions;
|
|
930
|
+
// @ts-expect-error Same as above.
|
|
931
|
+
(_a = opts.adapter) !== null && _a !== void 0 ? _a : (opts.adapter = DomUtils);
|
|
932
|
+
// @ts-expect-error `equals` does not exist on `Options`
|
|
933
|
+
(_b = opts.equals) !== null && _b !== void 0 ? _b : (opts.equals = (_d = (_c = opts.adapter) === null || _c === void 0 ? void 0 : _c.equals) !== null && _d !== void 0 ? _d : defaultEquals);
|
|
934
|
+
return opts;
|
|
935
|
+
}
|
|
936
|
+
function wrapCompile(func) {
|
|
937
|
+
return function addAdapter(selector, options, context) {
|
|
938
|
+
const opts = convertOptionFormats(options);
|
|
939
|
+
return func(selector, opts, context);
|
|
940
|
+
};
|
|
941
|
+
}
|
|
942
|
+
const _compileToken = wrapCompile(compileToken);
|
|
943
|
+
function prepareContext(elems, adapter, shouldTestNextSiblings = false) {
|
|
944
|
+
/*
|
|
945
|
+
* Add siblings if the query requires them.
|
|
946
|
+
* See https://github.com/fb55/css-select/pull/43#issuecomment-225414692
|
|
947
|
+
*/
|
|
948
|
+
if (shouldTestNextSiblings) {
|
|
949
|
+
elems = appendNextSiblings(elems, adapter);
|
|
950
|
+
}
|
|
951
|
+
return Array.isArray(elems)
|
|
952
|
+
? adapter.removeSubsets(elems)
|
|
953
|
+
: adapter.getChildren(elems);
|
|
954
|
+
}
|
|
955
|
+
function appendNextSiblings(elem, adapter) {
|
|
956
|
+
// Order matters because jQuery seems to check the children before the siblings
|
|
957
|
+
const elems = Array.isArray(elem) ? elem.slice(0) : [elem];
|
|
958
|
+
const elemsLength = elems.length;
|
|
959
|
+
for (let i = 0; i < elemsLength; i++) {
|
|
960
|
+
const nextSiblings = getNextSiblings(elems[i], adapter);
|
|
961
|
+
elems.push(...nextSiblings);
|
|
962
|
+
}
|
|
963
|
+
return elems;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
export { _compileToken as _, prepareContext as p };
|