@btst/stack 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -12
- package/dist/api/index.cjs +2 -0
- package/dist/api/index.d.cts +1 -0
- package/dist/api/index.d.mts +1 -0
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.mjs +1 -0
- package/dist/client/components/index.cjs +2 -2
- package/dist/client/components/index.mjs +2 -2
- package/dist/client/index.cjs +4 -2
- package/dist/client/index.d.cts +24 -1
- package/dist/client/index.d.mts +24 -1
- package/dist/client/index.d.ts +24 -1
- package/dist/client/index.mjs +3 -2
- package/dist/context/index.cjs +1 -1
- package/dist/context/index.mjs +1 -1
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.cjs +825 -0
- package/dist/node_modules/.pnpm/@floating-ui_core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.mjs +814 -0
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.cjs +763 -0
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs +751 -0
- package/dist/node_modules/.pnpm/@floating-ui_react-dom@2.1.6_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs +375 -0
- package/dist/node_modules/.pnpm/@floating-ui_react-dom@2.1.6_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs +350 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.cjs +160 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.cjs +182 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs +161 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs +137 -0
- package/dist/node_modules/.pnpm/@radix-ui_number@1.1.1/node_modules/@radix-ui/number/dist/index.cjs +8 -0
- package/dist/node_modules/.pnpm/@radix-ui_number@1.1.1/node_modules/@radix-ui/number/dist/index.mjs +6 -0
- package/dist/node_modules/.pnpm/@radix-ui_primitive@1.1.3/node_modules/@radix-ui/primitive/dist/index.cjs +13 -0
- package/dist/node_modules/.pnpm/@radix-ui_primitive@1.1.3/node_modules/@radix-ui/primitive/dist/index.mjs +11 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-arrow@1.1.7_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react@1_9e04309f365863673e44407648bb0cb6/node_modules/@radix-ui/react-arrow/dist/index.cjs +42 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-arrow@1.1.7_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react@1_9e04309f365863673e44407648bb0cb6/node_modules/@radix-ui/react-arrow/dist/index.mjs +25 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-collection@1.1.7_@types_react-dom@19.2.2_@types_react@19.2.2__@types_re_6d7c277722b3619c9ee7e64e9a822c45/node_modules/@radix-ui/react-collection/dist/index.cjs +77 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-collection@1.1.7_@types_react-dom@19.2.2_@types_react@19.2.2__@types_re_6d7c277722b3619c9ee7e64e9a822c45/node_modules/@radix-ui/react-collection/dist/index.mjs +71 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.1.2_@types_react@19.2.2_react@19.2.0/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +56 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.1.2_@types_react@19.2.2_react@19.2.0/node_modules/@radix-ui/react-compose-refs/dist/index.mjs +39 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-context@1.1.2_@types_react@19.2.2_react@19.2.0/node_modules/@radix-ui/react-context/dist/index.cjs +79 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-context@1.1.2_@types_react@19.2.2_react@19.2.0/node_modules/@radix-ui/react-context/dist/index.mjs +63 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-direction@1.1.1_@types_react@19.2.2_react@19.2.0/node_modules/@radix-ui/react-direction/dist/index.cjs +27 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-direction@1.1.1_@types_react@19.2.2_react@19.2.0/node_modules/@radix-ui/react-direction/dist/index.mjs +11 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.1.11_@types_react-dom@19.2.2_@types_react@19.2.2__@_ca5522e5d45d4722cb9eb5ce53defa61/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs +229 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.1.11_@types_react-dom@19.2.2_@types_react@19.2.2__@_ca5522e5d45d4722cb9eb5ce53defa61/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs +212 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-guards@1.1.3_@types_react@19.2.2_react@19.2.0/node_modules/@radix-ui/react-focus-guards/dist/index.cjs +46 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-guards@1.1.3_@types_react@19.2.2_react@19.2.0/node_modules/@radix-ui/react-focus-guards/dist/index.mjs +30 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-scope@1.1.7_@types_react-dom@19.2.2_@types_react@19.2.2__@types_r_93de389b3f622f9f764acc8e59ec80c0/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +224 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-scope@1.1.7_@types_react-dom@19.2.2_@types_react@19.2.2__@types_r_93de389b3f622f9f764acc8e59ec80c0/node_modules/@radix-ui/react-focus-scope/dist/index.mjs +208 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-id@1.1.1_@types_react@19.2.2_react@19.2.0/node_modules/@radix-ui/react-id/dist/index.cjs +31 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-id@1.1.1_@types_react@19.2.2_react@19.2.0/node_modules/@radix-ui/react-id/dist/index.mjs +15 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-popper@1.2.8_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react@_d6285b8269ea5d6b59b300f5be279a0c/node_modules/@radix-ui/react-popper/dist/index.cjs +308 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-popper@1.2.8_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react@_d6285b8269ea5d6b59b300f5be279a0c/node_modules/@radix-ui/react-popper/dist/index.mjs +284 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.1.9_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react@_478b3d5dd4afab1a3dcce7ed1748cb95/node_modules/@radix-ui/react-portal/dist/index.cjs +37 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.1.9_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react@_478b3d5dd4afab1a3dcce7ed1748cb95/node_modules/@radix-ui/react-portal/dist/index.mjs +18 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.2_@types_react@19.2.2__@types_rea_bdc15f10281778271ffcbe8dd3cd491e/node_modules/@radix-ui/react-primitive/dist/index.cjs +61 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.2_@types_react@19.2.2__@types_rea_bdc15f10281778271ffcbe8dd3cd491e/node_modules/@radix-ui/react-primitive/dist/index.mjs +43 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-select@2.2.6_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react@_802c3d414c85063bee785fcc98a39c07/node_modules/@radix-ui/react-select/dist/index.cjs +1198 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-select@2.2.6_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react@_802c3d414c85063bee785fcc98a39c07/node_modules/@radix-ui/react-select/dist/index.mjs +1154 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.2_react@19.2.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +28 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.2_react@19.2.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs +12 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-controllable-state@1.2.2_@types_react@19.2.2_react@19.2.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs +86 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-controllable-state@1.2.2_@types_react@19.2.2_react@19.2.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs +70 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-escape-keydown@1.1.1_@types_react@19.2.2_react@19.2.0/node_modules/@radix-ui/react-use-escape-keydown/dist/index.cjs +34 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-escape-keydown@1.1.1_@types_react@19.2.2_react@19.2.0/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs +18 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.2_react@19.2.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs +23 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.2_react@19.2.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs +7 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-previous@1.1.1_@types_react@19.2.2_react@19.2.0/node_modules/@radix-ui/react-use-previous/dist/index.cjs +31 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-previous@1.1.1_@types_react@19.2.2_react@19.2.0/node_modules/@radix-ui/react-use-previous/dist/index.mjs +15 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-size@1.1.1_@types_react@19.2.2_react@19.2.0/node_modules/@radix-ui/react-use-size/dist/index.cjs +56 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-size@1.1.1_@types_react@19.2.2_react@19.2.0/node_modules/@radix-ui/react-use-size/dist/index.mjs +40 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-visually-hidden@1.2.3_@types_react-dom@19.2.2_@types_react@19.2.2__@typ_a84e98a44624c31e835a98d4b8b0c30d/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs +51 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-visually-hidden@1.2.3_@types_react-dom@19.2.2_@types_react@19.2.2__@typ_a84e98a44624c31e835a98d4b8b0c30d/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs +34 -0
- package/dist/node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.cjs +139 -0
- package/dist/node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.mjs +137 -0
- package/dist/node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.2.0/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.cjs +39 -0
- package/dist/node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.2.0/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.mjs +37 -0
- package/dist/node_modules/.pnpm/embla-carousel-reactive-utils@8.6.0_embla-carousel@8.6.0/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.cjs +43 -0
- package/dist/node_modules/.pnpm/embla-carousel-reactive-utils@8.6.0_embla-carousel@8.6.0/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.mjs +38 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.cjs +1671 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.mjs +1669 -0
- package/dist/node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.cjs +10 -0
- package/dist/node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.mjs +8 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll-bar/dist/es2015/component.cjs +74 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll-bar/dist/es2015/component.mjs +56 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll-bar/dist/es2015/constants.cjs +15 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll-bar/dist/es2015/constants.mjs +10 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll-bar/dist/es2015/utils.cjs +34 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll-bar/dist/es2015/utils.mjs +31 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/Combination.cjs +25 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/Combination.mjs +9 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.cjs +178 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.mjs +160 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/UI.cjs +54 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/UI.mjs +38 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.cjs +23 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.mjs +21 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/handleScroll.cjs +113 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/handleScroll.mjs +110 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/medium.cjs +7 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/medium.mjs +5 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/sidecar.cjs +9 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/sidecar.mjs +7 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0/node_modules/react-style-singleton/dist/es2015/component.cjs +21 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0/node_modules/react-style-singleton/dist/es2015/component.mjs +19 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0/node_modules/react-style-singleton/dist/es2015/hook.cjs +41 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0/node_modules/react-style-singleton/dist/es2015/hook.mjs +25 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0/node_modules/react-style-singleton/dist/es2015/singleton.cjs +53 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0/node_modules/react-style-singleton/dist/es2015/singleton.mjs +51 -0
- package/dist/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.cjs +59 -0
- package/dist/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs +56 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0/node_modules/use-callback-ref/dist/es2015/assignRef.cjs +26 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0/node_modules/use-callback-ref/dist/es2015/assignRef.mjs +24 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0/node_modules/use-callback-ref/dist/es2015/useMergeRef.cjs +64 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0/node_modules/use-callback-ref/dist/es2015/useMergeRef.mjs +48 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0/node_modules/use-callback-ref/dist/es2015/useRef.cjs +44 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0/node_modules/use-callback-ref/dist/es2015/useRef.mjs +42 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.2.2_react@19.2.0/node_modules/use-sidecar/dist/es2015/exports.cjs +37 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.2.2_react@19.2.0/node_modules/use-sidecar/dist/es2015/exports.mjs +21 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.2.2_react@19.2.0/node_modules/use-sidecar/dist/es2015/medium.cjs +79 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.2.2_react@19.2.0/node_modules/use-sidecar/dist/es2015/medium.mjs +77 -0
- package/dist/packages/better-stack/src/client/path-utils.cjs +15 -0
- package/dist/packages/better-stack/src/client/path-utils.mjs +13 -0
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/forms/image-field.cjs +3 -3
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/forms/image-field.mjs +3 -3
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/forms/post-forms.cjs +5 -5
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/forms/post-forms.mjs +5 -5
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/forms/tags-multiselect.cjs +2 -6
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/forms/tags-multiselect.mjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/loading/form-page-skeleton.cjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/loading/form-page-skeleton.mjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/loading/list-page-skeleton.cjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/loading/list-page-skeleton.mjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/loading/page-header-skeleton.cjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/loading/page-header-skeleton.mjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/loading/post-card-skeleton.cjs +2 -2
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/loading/post-card-skeleton.mjs +2 -2
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/loading/post-page-skeleton.cjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/loading/post-page-skeleton.mjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/pages/post-page.internal.cjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/pages/post-page.internal.mjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/better-blog-attribution.cjs +4 -4
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/better-blog-attribution.mjs +4 -4
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/empty-list.cjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/empty-list.mjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/on-this-page.cjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/on-this-page.mjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/post-card.cjs +2 -2
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/post-card.mjs +2 -2
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/post-navigation.cjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/post-navigation.mjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/posts-list.cjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/posts-list.mjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/recent-posts-carousel.cjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/recent-posts-carousel.mjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/search-modal.cjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/search-modal.mjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/tags-list.cjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/tags-list.mjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/hooks/blog-hooks.cjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/hooks/blog-hooks.mjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/plugin.cjs +1 -1
- package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/plugin.mjs +1 -1
- package/dist/packages/ui/src/components/badge.cjs +42 -0
- package/dist/packages/ui/src/components/badge.mjs +39 -0
- package/dist/packages/ui/src/components/button.cjs +54 -0
- package/dist/packages/ui/src/components/button.mjs +51 -0
- package/dist/packages/ui/src/components/card.cjs +67 -0
- package/dist/packages/ui/src/components/card.mjs +61 -0
- package/dist/packages/ui/src/components/carousel.cjs +215 -0
- package/dist/packages/ui/src/components/carousel.mjs +195 -0
- package/dist/packages/ui/src/components/command.cjs +142 -0
- package/dist/packages/ui/src/components/command.mjs +134 -0
- package/dist/packages/ui/src/components/dialog.cjs +127 -0
- package/dist/packages/ui/src/components/dialog.mjs +105 -0
- package/dist/packages/ui/src/components/empty.cjs +76 -0
- package/dist/packages/ui/src/components/empty.mjs +71 -0
- package/dist/packages/ui/src/components/form.cjs +133 -0
- package/dist/packages/ui/src/components/form.mjs +110 -0
- package/dist/packages/ui/src/components/input.cjs +23 -0
- package/dist/packages/ui/src/components/input.mjs +21 -0
- package/dist/packages/ui/src/components/label.cjs +39 -0
- package/dist/packages/ui/src/components/label.mjs +23 -0
- package/dist/packages/ui/src/components/multi-select.cjs +555 -0
- package/dist/packages/ui/src/components/multi-select.mjs +540 -0
- package/dist/packages/ui/src/components/select.cjs +140 -0
- package/dist/packages/ui/src/components/select.mjs +132 -0
- package/dist/packages/ui/src/components/skeleton.cjs +17 -0
- package/dist/packages/ui/src/components/skeleton.mjs +15 -0
- package/dist/packages/ui/src/components/switch.cjs +48 -0
- package/dist/packages/ui/src/components/switch.mjs +32 -0
- package/dist/packages/ui/src/components/textarea.cjs +20 -0
- package/dist/packages/ui/src/components/textarea.mjs +18 -0
- package/dist/packages/ui/src/hooks/use-debounce.cjs +18 -0
- package/dist/packages/ui/src/hooks/use-debounce.mjs +16 -0
- package/dist/packages/ui/src/lib/utils.cjs +10 -0
- package/dist/packages/ui/src/lib/utils.mjs +8 -0
- package/dist/plugins/api/index.cjs +0 -2
- package/dist/plugins/api/index.d.cts +0 -1
- package/dist/plugins/api/index.d.mts +0 -1
- package/dist/plugins/api/index.d.ts +0 -1
- package/dist/plugins/api/index.mjs +0 -1
- package/dist/plugins/blog/api/index.cjs +1 -1
- package/dist/plugins/blog/api/index.mjs +1 -1
- package/dist/plugins/blog/client/components/index.cjs +4 -4
- package/dist/plugins/blog/client/components/index.mjs +4 -4
- package/dist/plugins/blog/client/hooks/index.cjs +1 -1
- package/dist/plugins/blog/client/hooks/index.mjs +1 -1
- package/dist/plugins/blog/client/index.cjs +1 -1
- package/dist/plugins/blog/client/index.mjs +1 -1
- package/dist/plugins/client/index.cjs +1 -1
- package/dist/plugins/client/index.mjs +1 -1
- package/package.json +5 -5
- package/src/api/index.ts +2 -0
- package/src/client/index.ts +2 -0
- package/src/client/path-utils.ts +38 -0
- package/src/plugins/api/index.ts +0 -1
- package/src/plugins/blog/client/components/shared/better-blog-attribution.tsx +4 -4
- /package/dist/{client → packages/better-stack/src/client}/components/compose.cjs +0 -0
- /package/dist/{client → packages/better-stack/src/client}/components/compose.mjs +0 -0
- /package/dist/{client → packages/better-stack/src/client}/components/error-boundary.cjs +0 -0
- /package/dist/{client → packages/better-stack/src/client}/components/error-boundary.mjs +0 -0
- /package/dist/{client → packages/better-stack/src/client}/meta-utils.cjs +0 -0
- /package/dist/{client → packages/better-stack/src/client}/meta-utils.mjs +0 -0
- /package/dist/{client → packages/better-stack/src/client}/sitemap-utils.cjs +0 -0
- /package/dist/{client → packages/better-stack/src/client}/sitemap-utils.mjs +0 -0
- /package/dist/{context → packages/better-stack/src/context}/provider.cjs +0 -0
- /package/dist/{context → packages/better-stack/src/context}/provider.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/api/plugin.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/api/plugin.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/forms/markdown-editor.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/forms/markdown-editor.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/loading/index.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/loading/index.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/pages/404-page.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/pages/404-page.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/pages/edit-post-page.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/pages/edit-post-page.internal.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/pages/edit-post-page.internal.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/pages/edit-post-page.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/pages/home-page.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/pages/home-page.internal.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/pages/home-page.internal.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/pages/home-page.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/pages/new-post-page.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/pages/new-post-page.internal.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/pages/new-post-page.internal.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/pages/new-post-page.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/pages/post-page.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/pages/post-page.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/pages/tag-page.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/pages/tag-page.internal.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/pages/tag-page.internal.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/pages/tag-page.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/default-error.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/default-error.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/defaults.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/defaults.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/error-placeholder.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/error-placeholder.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/highlight-text.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/highlight-text.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/markdown-content.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/markdown-content.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/page-header.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/page-header.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/page-layout.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/page-layout.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/page-wrapper.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/page-wrapper.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/search-input.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/search-input.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/use-route-lifecycle.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/components/shared/use-route-lifecycle.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/hooks/use-debounce.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/hooks/use-debounce.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/localization/blog-card.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/localization/blog-card.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/localization/blog-common.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/localization/blog-common.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/localization/blog-forms.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/localization/blog-forms.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/localization/blog-list.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/localization/blog-list.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/localization/blog-post.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/localization/blog-post.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/localization/index.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/client/localization/index.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/db.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/db.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/schemas.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/schemas.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/utils.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/blog/utils.mjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/utils.cjs +0 -0
- /package/dist/{plugins → packages/better-stack/src/plugins}/utils.mjs +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const tslib_es6 = require('../../../../../tslib@2.8.1/node_modules/tslib/tslib.es6.cjs');
|
|
4
|
+
const React = require('react');
|
|
5
|
+
const constants = require('../../../../../react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll-bar/dist/es2015/constants.cjs');
|
|
6
|
+
const medium = require('./medium.cjs');
|
|
7
|
+
const useMergeRef = require('../../../../../use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0/node_modules/use-callback-ref/dist/es2015/useMergeRef.cjs');
|
|
8
|
+
|
|
9
|
+
function _interopNamespaceCompat(e) {
|
|
10
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
11
|
+
const n = Object.create(null);
|
|
12
|
+
if (e) {
|
|
13
|
+
for (const k in e) {
|
|
14
|
+
n[k] = e[k];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
n.default = e;
|
|
18
|
+
return n;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
|
|
22
|
+
|
|
23
|
+
var nothing = function () {
|
|
24
|
+
return;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Removes scrollbar from the page and contain the scroll within the Lock
|
|
28
|
+
*/
|
|
29
|
+
var RemoveScroll = React__namespace.forwardRef(function (props, parentRef) {
|
|
30
|
+
var ref = React__namespace.useRef(null);
|
|
31
|
+
var _a = React__namespace.useState({
|
|
32
|
+
onScrollCapture: nothing,
|
|
33
|
+
onWheelCapture: nothing,
|
|
34
|
+
onTouchMoveCapture: nothing,
|
|
35
|
+
}), callbacks = _a[0], setCallbacks = _a[1];
|
|
36
|
+
var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noRelative = props.noRelative, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? 'div' : _b, gapMode = props.gapMode, rest = tslib_es6.__rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]);
|
|
37
|
+
var SideCar = sideCar;
|
|
38
|
+
var containerRef = useMergeRef.useMergeRefs([ref, parentRef]);
|
|
39
|
+
var containerProps = tslib_es6.__assign(tslib_es6.__assign({}, rest), callbacks);
|
|
40
|
+
return (React__namespace.createElement(React__namespace.Fragment, null,
|
|
41
|
+
enabled && (React__namespace.createElement(SideCar, { sideCar: medium.effectCar, removeScrollBar: removeScrollBar, shards: shards, noRelative: noRelative, noIsolation: noIsolation, inert: inert, setCallbacks: setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode: gapMode })),
|
|
42
|
+
forwardProps ? (React__namespace.cloneElement(React__namespace.Children.only(children), tslib_es6.__assign(tslib_es6.__assign({}, containerProps), { ref: containerRef }))) : (React__namespace.createElement(Container, tslib_es6.__assign({}, containerProps, { className: className, ref: containerRef }), children))));
|
|
43
|
+
});
|
|
44
|
+
RemoveScroll.defaultProps = {
|
|
45
|
+
enabled: true,
|
|
46
|
+
removeScrollBar: true,
|
|
47
|
+
inert: false,
|
|
48
|
+
};
|
|
49
|
+
RemoveScroll.classNames = {
|
|
50
|
+
fullWidth: constants.fullWidthClassName,
|
|
51
|
+
zeroRight: constants.zeroRightClassName,
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
exports.RemoveScroll = RemoveScroll;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { __rest, __assign } from '../../../../../tslib@2.8.1/node_modules/tslib/tslib.es6.mjs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { zeroRightClassName, fullWidthClassName } from '../../../../../react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll-bar/dist/es2015/constants.mjs';
|
|
4
|
+
import { effectCar } from './medium.mjs';
|
|
5
|
+
import { useMergeRefs } from '../../../../../use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0/node_modules/use-callback-ref/dist/es2015/useMergeRef.mjs';
|
|
6
|
+
|
|
7
|
+
var nothing = function () {
|
|
8
|
+
return;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Removes scrollbar from the page and contain the scroll within the Lock
|
|
12
|
+
*/
|
|
13
|
+
var RemoveScroll = React.forwardRef(function (props, parentRef) {
|
|
14
|
+
var ref = React.useRef(null);
|
|
15
|
+
var _a = React.useState({
|
|
16
|
+
onScrollCapture: nothing,
|
|
17
|
+
onWheelCapture: nothing,
|
|
18
|
+
onTouchMoveCapture: nothing,
|
|
19
|
+
}), callbacks = _a[0], setCallbacks = _a[1];
|
|
20
|
+
var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noRelative = props.noRelative, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? 'div' : _b, gapMode = props.gapMode, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]);
|
|
21
|
+
var SideCar = sideCar;
|
|
22
|
+
var containerRef = useMergeRefs([ref, parentRef]);
|
|
23
|
+
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
24
|
+
return (React.createElement(React.Fragment, null,
|
|
25
|
+
enabled && (React.createElement(SideCar, { sideCar: effectCar, removeScrollBar: removeScrollBar, shards: shards, noRelative: noRelative, noIsolation: noIsolation, inert: inert, setCallbacks: setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode: gapMode })),
|
|
26
|
+
forwardProps ? (React.cloneElement(React.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef }))) : (React.createElement(Container, __assign({}, containerProps, { className: className, ref: containerRef }), children))));
|
|
27
|
+
});
|
|
28
|
+
RemoveScroll.defaultProps = {
|
|
29
|
+
enabled: true,
|
|
30
|
+
removeScrollBar: true,
|
|
31
|
+
inert: false,
|
|
32
|
+
};
|
|
33
|
+
RemoveScroll.classNames = {
|
|
34
|
+
fullWidth: fullWidthClassName,
|
|
35
|
+
zeroRight: zeroRightClassName,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export { RemoveScroll };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var passiveSupported = false;
|
|
4
|
+
if (typeof window !== 'undefined') {
|
|
5
|
+
try {
|
|
6
|
+
var options = Object.defineProperty({}, 'passive', {
|
|
7
|
+
get: function () {
|
|
8
|
+
passiveSupported = true;
|
|
9
|
+
return true;
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
// @ts-ignore
|
|
13
|
+
window.addEventListener('test', options, options);
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
window.removeEventListener('test', options, options);
|
|
16
|
+
}
|
|
17
|
+
catch (err) {
|
|
18
|
+
passiveSupported = false;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
var nonPassive = passiveSupported ? { passive: false } : false;
|
|
22
|
+
|
|
23
|
+
exports.nonPassive = nonPassive;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var passiveSupported = false;
|
|
2
|
+
if (typeof window !== 'undefined') {
|
|
3
|
+
try {
|
|
4
|
+
var options = Object.defineProperty({}, 'passive', {
|
|
5
|
+
get: function () {
|
|
6
|
+
passiveSupported = true;
|
|
7
|
+
return true;
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
window.addEventListener('test', options, options);
|
|
12
|
+
// @ts-ignore
|
|
13
|
+
window.removeEventListener('test', options, options);
|
|
14
|
+
}
|
|
15
|
+
catch (err) {
|
|
16
|
+
passiveSupported = false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
var nonPassive = passiveSupported ? { passive: false } : false;
|
|
20
|
+
|
|
21
|
+
export { nonPassive };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var alwaysContainsScroll = function (node) {
|
|
4
|
+
// textarea will always _contain_ scroll inside self. It only can be hidden
|
|
5
|
+
return node.tagName === 'TEXTAREA';
|
|
6
|
+
};
|
|
7
|
+
var elementCanBeScrolled = function (node, overflow) {
|
|
8
|
+
if (!(node instanceof Element)) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
var styles = window.getComputedStyle(node);
|
|
12
|
+
return (
|
|
13
|
+
// not-not-scrollable
|
|
14
|
+
styles[overflow] !== 'hidden' &&
|
|
15
|
+
// contains scroll inside self
|
|
16
|
+
!(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === 'visible'));
|
|
17
|
+
};
|
|
18
|
+
var elementCouldBeVScrolled = function (node) { return elementCanBeScrolled(node, 'overflowY'); };
|
|
19
|
+
var elementCouldBeHScrolled = function (node) { return elementCanBeScrolled(node, 'overflowX'); };
|
|
20
|
+
var locationCouldBeScrolled = function (axis, node) {
|
|
21
|
+
var ownerDocument = node.ownerDocument;
|
|
22
|
+
var current = node;
|
|
23
|
+
do {
|
|
24
|
+
// Skip over shadow root
|
|
25
|
+
if (typeof ShadowRoot !== 'undefined' && current instanceof ShadowRoot) {
|
|
26
|
+
current = current.host;
|
|
27
|
+
}
|
|
28
|
+
var isScrollable = elementCouldBeScrolled(axis, current);
|
|
29
|
+
if (isScrollable) {
|
|
30
|
+
var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2];
|
|
31
|
+
if (scrollHeight > clientHeight) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
current = current.parentNode;
|
|
36
|
+
} while (current && current !== ownerDocument.body);
|
|
37
|
+
return false;
|
|
38
|
+
};
|
|
39
|
+
var getVScrollVariables = function (_a) {
|
|
40
|
+
var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
|
|
41
|
+
return [
|
|
42
|
+
scrollTop,
|
|
43
|
+
scrollHeight,
|
|
44
|
+
clientHeight,
|
|
45
|
+
];
|
|
46
|
+
};
|
|
47
|
+
var getHScrollVariables = function (_a) {
|
|
48
|
+
var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
|
|
49
|
+
return [
|
|
50
|
+
scrollLeft,
|
|
51
|
+
scrollWidth,
|
|
52
|
+
clientWidth,
|
|
53
|
+
];
|
|
54
|
+
};
|
|
55
|
+
var elementCouldBeScrolled = function (axis, node) {
|
|
56
|
+
return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
|
|
57
|
+
};
|
|
58
|
+
var getScrollVariables = function (axis, node) {
|
|
59
|
+
return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node);
|
|
60
|
+
};
|
|
61
|
+
var getDirectionFactor = function (axis, direction) {
|
|
62
|
+
/**
|
|
63
|
+
* If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position,
|
|
64
|
+
* and then increasingly negative as you scroll towards the end of the content.
|
|
65
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft
|
|
66
|
+
*/
|
|
67
|
+
return axis === 'h' && direction === 'rtl' ? -1 : 1;
|
|
68
|
+
};
|
|
69
|
+
var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) {
|
|
70
|
+
var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
|
|
71
|
+
var delta = directionFactor * sourceDelta;
|
|
72
|
+
// find scrollable target
|
|
73
|
+
var target = event.target;
|
|
74
|
+
var targetInLock = endTarget.contains(target);
|
|
75
|
+
var shouldCancelScroll = false;
|
|
76
|
+
var isDeltaPositive = delta > 0;
|
|
77
|
+
var availableScroll = 0;
|
|
78
|
+
var availableScrollTop = 0;
|
|
79
|
+
do {
|
|
80
|
+
if (!target) {
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
|
|
84
|
+
var elementScroll = scroll_1 - capacity - directionFactor * position;
|
|
85
|
+
if (position || elementScroll) {
|
|
86
|
+
if (elementCouldBeScrolled(axis, target)) {
|
|
87
|
+
availableScroll += elementScroll;
|
|
88
|
+
availableScrollTop += position;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
var parent_1 = target.parentNode;
|
|
92
|
+
// we will "bubble" from ShadowDom in case we are, or just to the parent in normal case
|
|
93
|
+
// this is the same logic used in focus-lock
|
|
94
|
+
target = (parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1);
|
|
95
|
+
} while (
|
|
96
|
+
// portaled content
|
|
97
|
+
(!targetInLock && target !== document.body) ||
|
|
98
|
+
// self content
|
|
99
|
+
(targetInLock && (endTarget.contains(target) || endTarget === target)));
|
|
100
|
+
// handle epsilon around 0 (non standard zoom levels)
|
|
101
|
+
if (isDeltaPositive &&
|
|
102
|
+
((Math.abs(availableScroll) < 1) || (false))) {
|
|
103
|
+
shouldCancelScroll = true;
|
|
104
|
+
}
|
|
105
|
+
else if (!isDeltaPositive &&
|
|
106
|
+
((Math.abs(availableScrollTop) < 1) || (false))) {
|
|
107
|
+
shouldCancelScroll = true;
|
|
108
|
+
}
|
|
109
|
+
return shouldCancelScroll;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
exports.handleScroll = handleScroll;
|
|
113
|
+
exports.locationCouldBeScrolled = locationCouldBeScrolled;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
var alwaysContainsScroll = function (node) {
|
|
2
|
+
// textarea will always _contain_ scroll inside self. It only can be hidden
|
|
3
|
+
return node.tagName === 'TEXTAREA';
|
|
4
|
+
};
|
|
5
|
+
var elementCanBeScrolled = function (node, overflow) {
|
|
6
|
+
if (!(node instanceof Element)) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
var styles = window.getComputedStyle(node);
|
|
10
|
+
return (
|
|
11
|
+
// not-not-scrollable
|
|
12
|
+
styles[overflow] !== 'hidden' &&
|
|
13
|
+
// contains scroll inside self
|
|
14
|
+
!(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === 'visible'));
|
|
15
|
+
};
|
|
16
|
+
var elementCouldBeVScrolled = function (node) { return elementCanBeScrolled(node, 'overflowY'); };
|
|
17
|
+
var elementCouldBeHScrolled = function (node) { return elementCanBeScrolled(node, 'overflowX'); };
|
|
18
|
+
var locationCouldBeScrolled = function (axis, node) {
|
|
19
|
+
var ownerDocument = node.ownerDocument;
|
|
20
|
+
var current = node;
|
|
21
|
+
do {
|
|
22
|
+
// Skip over shadow root
|
|
23
|
+
if (typeof ShadowRoot !== 'undefined' && current instanceof ShadowRoot) {
|
|
24
|
+
current = current.host;
|
|
25
|
+
}
|
|
26
|
+
var isScrollable = elementCouldBeScrolled(axis, current);
|
|
27
|
+
if (isScrollable) {
|
|
28
|
+
var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2];
|
|
29
|
+
if (scrollHeight > clientHeight) {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
current = current.parentNode;
|
|
34
|
+
} while (current && current !== ownerDocument.body);
|
|
35
|
+
return false;
|
|
36
|
+
};
|
|
37
|
+
var getVScrollVariables = function (_a) {
|
|
38
|
+
var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
|
|
39
|
+
return [
|
|
40
|
+
scrollTop,
|
|
41
|
+
scrollHeight,
|
|
42
|
+
clientHeight,
|
|
43
|
+
];
|
|
44
|
+
};
|
|
45
|
+
var getHScrollVariables = function (_a) {
|
|
46
|
+
var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
|
|
47
|
+
return [
|
|
48
|
+
scrollLeft,
|
|
49
|
+
scrollWidth,
|
|
50
|
+
clientWidth,
|
|
51
|
+
];
|
|
52
|
+
};
|
|
53
|
+
var elementCouldBeScrolled = function (axis, node) {
|
|
54
|
+
return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
|
|
55
|
+
};
|
|
56
|
+
var getScrollVariables = function (axis, node) {
|
|
57
|
+
return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node);
|
|
58
|
+
};
|
|
59
|
+
var getDirectionFactor = function (axis, direction) {
|
|
60
|
+
/**
|
|
61
|
+
* If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position,
|
|
62
|
+
* and then increasingly negative as you scroll towards the end of the content.
|
|
63
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft
|
|
64
|
+
*/
|
|
65
|
+
return axis === 'h' && direction === 'rtl' ? -1 : 1;
|
|
66
|
+
};
|
|
67
|
+
var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) {
|
|
68
|
+
var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
|
|
69
|
+
var delta = directionFactor * sourceDelta;
|
|
70
|
+
// find scrollable target
|
|
71
|
+
var target = event.target;
|
|
72
|
+
var targetInLock = endTarget.contains(target);
|
|
73
|
+
var shouldCancelScroll = false;
|
|
74
|
+
var isDeltaPositive = delta > 0;
|
|
75
|
+
var availableScroll = 0;
|
|
76
|
+
var availableScrollTop = 0;
|
|
77
|
+
do {
|
|
78
|
+
if (!target) {
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
|
|
82
|
+
var elementScroll = scroll_1 - capacity - directionFactor * position;
|
|
83
|
+
if (position || elementScroll) {
|
|
84
|
+
if (elementCouldBeScrolled(axis, target)) {
|
|
85
|
+
availableScroll += elementScroll;
|
|
86
|
+
availableScrollTop += position;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
var parent_1 = target.parentNode;
|
|
90
|
+
// we will "bubble" from ShadowDom in case we are, or just to the parent in normal case
|
|
91
|
+
// this is the same logic used in focus-lock
|
|
92
|
+
target = (parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1);
|
|
93
|
+
} while (
|
|
94
|
+
// portaled content
|
|
95
|
+
(!targetInLock && target !== document.body) ||
|
|
96
|
+
// self content
|
|
97
|
+
(targetInLock && (endTarget.contains(target) || endTarget === target)));
|
|
98
|
+
// handle epsilon around 0 (non standard zoom levels)
|
|
99
|
+
if (isDeltaPositive &&
|
|
100
|
+
((Math.abs(availableScroll) < 1) || (false))) {
|
|
101
|
+
shouldCancelScroll = true;
|
|
102
|
+
}
|
|
103
|
+
else if (!isDeltaPositive &&
|
|
104
|
+
((Math.abs(availableScrollTop) < 1) || (false))) {
|
|
105
|
+
shouldCancelScroll = true;
|
|
106
|
+
}
|
|
107
|
+
return shouldCancelScroll;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export { handleScroll, locationCouldBeScrolled };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const SideEffect = require('./SideEffect.cjs');
|
|
4
|
+
const medium = require('./medium.cjs');
|
|
5
|
+
const exports$1 = require('../../../../../use-sidecar@1.1.3_@types_react@19.2.2_react@19.2.0/node_modules/use-sidecar/dist/es2015/exports.cjs');
|
|
6
|
+
|
|
7
|
+
const SideCar = exports$1.exportSidecar(medium.effectCar, SideEffect.RemoveScrollSideCar);
|
|
8
|
+
|
|
9
|
+
module.exports = SideCar;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RemoveScrollSideCar } from './SideEffect.mjs';
|
|
2
|
+
import { effectCar } from './medium.mjs';
|
|
3
|
+
import { exportSidecar } from '../../../../../use-sidecar@1.1.3_@types_react@19.2.2_react@19.2.0/node_modules/use-sidecar/dist/es2015/exports.mjs';
|
|
4
|
+
|
|
5
|
+
const SideCar = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
6
|
+
|
|
7
|
+
export { SideCar as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const hook = require('./hook.cjs');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* create a Component to add styles on demand
|
|
7
|
+
* - styles are added when first instance is mounted
|
|
8
|
+
* - styles are removed when the last instance is unmounted
|
|
9
|
+
* - changing styles in runtime does nothing unless dynamic is set. But with multiple components that can lead to the undefined behavior
|
|
10
|
+
*/
|
|
11
|
+
var styleSingleton = function () {
|
|
12
|
+
var useStyle = hook.styleHookSingleton();
|
|
13
|
+
var Sheet = function (_a) {
|
|
14
|
+
var styles = _a.styles, dynamic = _a.dynamic;
|
|
15
|
+
useStyle(styles, dynamic);
|
|
16
|
+
return null;
|
|
17
|
+
};
|
|
18
|
+
return Sheet;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.styleSingleton = styleSingleton;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { styleHookSingleton } from './hook.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* create a Component to add styles on demand
|
|
5
|
+
* - styles are added when first instance is mounted
|
|
6
|
+
* - styles are removed when the last instance is unmounted
|
|
7
|
+
* - changing styles in runtime does nothing unless dynamic is set. But with multiple components that can lead to the undefined behavior
|
|
8
|
+
*/
|
|
9
|
+
var styleSingleton = function () {
|
|
10
|
+
var useStyle = styleHookSingleton();
|
|
11
|
+
var Sheet = function (_a) {
|
|
12
|
+
var styles = _a.styles, dynamic = _a.dynamic;
|
|
13
|
+
useStyle(styles, dynamic);
|
|
14
|
+
return null;
|
|
15
|
+
};
|
|
16
|
+
return Sheet;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { styleSingleton };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const React = require('react');
|
|
4
|
+
const singleton = require('./singleton.cjs');
|
|
5
|
+
|
|
6
|
+
function _interopNamespaceCompat(e) {
|
|
7
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
8
|
+
const n = Object.create(null);
|
|
9
|
+
if (e) {
|
|
10
|
+
for (const k in e) {
|
|
11
|
+
n[k] = e[k];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
n.default = e;
|
|
15
|
+
return n;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* creates a hook to control style singleton
|
|
22
|
+
* @see {@link styleSingleton} for a safer component version
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* const useStyle = styleHookSingleton();
|
|
26
|
+
* ///
|
|
27
|
+
* useStyle('body { overflow: hidden}');
|
|
28
|
+
*/
|
|
29
|
+
var styleHookSingleton = function () {
|
|
30
|
+
var sheet = singleton.stylesheetSingleton();
|
|
31
|
+
return function (styles, isDynamic) {
|
|
32
|
+
React__namespace.useEffect(function () {
|
|
33
|
+
sheet.add(styles);
|
|
34
|
+
return function () {
|
|
35
|
+
sheet.remove();
|
|
36
|
+
};
|
|
37
|
+
}, [styles && isDynamic]);
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
exports.styleHookSingleton = styleHookSingleton;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { stylesheetSingleton } from './singleton.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* creates a hook to control style singleton
|
|
6
|
+
* @see {@link styleSingleton} for a safer component version
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* const useStyle = styleHookSingleton();
|
|
10
|
+
* ///
|
|
11
|
+
* useStyle('body { overflow: hidden}');
|
|
12
|
+
*/
|
|
13
|
+
var styleHookSingleton = function () {
|
|
14
|
+
var sheet = stylesheetSingleton();
|
|
15
|
+
return function (styles, isDynamic) {
|
|
16
|
+
React.useEffect(function () {
|
|
17
|
+
sheet.add(styles);
|
|
18
|
+
return function () {
|
|
19
|
+
sheet.remove();
|
|
20
|
+
};
|
|
21
|
+
}, [styles && isDynamic]);
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { styleHookSingleton };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('../../../../../get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.cjs');
|
|
4
|
+
|
|
5
|
+
function makeStyleTag() {
|
|
6
|
+
if (!document)
|
|
7
|
+
return null;
|
|
8
|
+
var tag = document.createElement('style');
|
|
9
|
+
tag.type = 'text/css';
|
|
10
|
+
var nonce = index.getNonce();
|
|
11
|
+
if (nonce) {
|
|
12
|
+
tag.setAttribute('nonce', nonce);
|
|
13
|
+
}
|
|
14
|
+
return tag;
|
|
15
|
+
}
|
|
16
|
+
function injectStyles(tag, css) {
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
if (tag.styleSheet) {
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
tag.styleSheet.cssText = css;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
tag.appendChild(document.createTextNode(css));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function insertStyleTag(tag) {
|
|
27
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
28
|
+
head.appendChild(tag);
|
|
29
|
+
}
|
|
30
|
+
var stylesheetSingleton = function () {
|
|
31
|
+
var counter = 0;
|
|
32
|
+
var stylesheet = null;
|
|
33
|
+
return {
|
|
34
|
+
add: function (style) {
|
|
35
|
+
if (counter == 0) {
|
|
36
|
+
if ((stylesheet = makeStyleTag())) {
|
|
37
|
+
injectStyles(stylesheet, style);
|
|
38
|
+
insertStyleTag(stylesheet);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
counter++;
|
|
42
|
+
},
|
|
43
|
+
remove: function () {
|
|
44
|
+
counter--;
|
|
45
|
+
if (!counter && stylesheet) {
|
|
46
|
+
stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
|
|
47
|
+
stylesheet = null;
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
exports.stylesheetSingleton = stylesheetSingleton;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { getNonce } from '../../../../../get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.mjs';
|
|
2
|
+
|
|
3
|
+
function makeStyleTag() {
|
|
4
|
+
if (!document)
|
|
5
|
+
return null;
|
|
6
|
+
var tag = document.createElement('style');
|
|
7
|
+
tag.type = 'text/css';
|
|
8
|
+
var nonce = getNonce();
|
|
9
|
+
if (nonce) {
|
|
10
|
+
tag.setAttribute('nonce', nonce);
|
|
11
|
+
}
|
|
12
|
+
return tag;
|
|
13
|
+
}
|
|
14
|
+
function injectStyles(tag, css) {
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
if (tag.styleSheet) {
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
tag.styleSheet.cssText = css;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
tag.appendChild(document.createTextNode(css));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function insertStyleTag(tag) {
|
|
25
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
26
|
+
head.appendChild(tag);
|
|
27
|
+
}
|
|
28
|
+
var stylesheetSingleton = function () {
|
|
29
|
+
var counter = 0;
|
|
30
|
+
var stylesheet = null;
|
|
31
|
+
return {
|
|
32
|
+
add: function (style) {
|
|
33
|
+
if (counter == 0) {
|
|
34
|
+
if ((stylesheet = makeStyleTag())) {
|
|
35
|
+
injectStyles(stylesheet, style);
|
|
36
|
+
insertStyleTag(stylesheet);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
counter++;
|
|
40
|
+
},
|
|
41
|
+
remove: function () {
|
|
42
|
+
counter--;
|
|
43
|
+
if (!counter && stylesheet) {
|
|
44
|
+
stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
|
|
45
|
+
stylesheet = null;
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export { stylesheetSingleton };
|