@btst/stack 1.3.1 → 1.4.1
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 +85 -37
- package/dist/node_modules/.pnpm/@radix-ui_react-accordion@1.2.12_@types_react-dom@19.2.3_@types_react@19.2.6__@types_re_947719a27ff11ec6f09710dd9e85efc5/node_modules/@radix-ui/react-accordion/dist/index.cjs +321 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-accordion@1.2.12_@types_react-dom@19.2.3_@types_react@19.2.6__@types_re_947719a27ff11ec6f09710dd9e85efc5/node_modules/@radix-ui/react-accordion/dist/index.mjs +306 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-alert-dialog@1.1.15_@types_react-dom@19.2.2_@types_react@19.2.2__@types_ec789942cd38340bd7362c09e7d34384 → @radix-ui_react-alert-dialog@1.1.15_@types_react-dom@19.2.3_@types_react@19.2.6__@types_4f58c757aa677e233cf96d60fda2f1da}/node_modules/@radix-ui/react-alert-dialog/dist/index.cjs +2 -2
- package/dist/node_modules/.pnpm/{@radix-ui_react-alert-dialog@1.1.15_@types_react-dom@19.2.2_@types_react@19.2.2__@types_ec789942cd38340bd7362c09e7d34384 → @radix-ui_react-alert-dialog@1.1.15_@types_react-dom@19.2.3_@types_react@19.2.6__@types_4f58c757aa677e233cf96d60fda2f1da}/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs +2 -2
- 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 → @radix-ui_react-arrow@1.1.7_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@1_35df44f6d87656c1401686c91d770dbb}/node_modules/@radix-ui/react-arrow/dist/index.cjs +1 -1
- 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 → @radix-ui_react-arrow@1.1.7_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@1_35df44f6d87656c1401686c91d770dbb}/node_modules/@radix-ui/react-arrow/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-collapsible@1.1.12_@types_react-dom@19.2.3_@types_react@19.2.6__@types__d025a77f62ee83ca6bd8b0ea1f9de738/node_modules/@radix-ui/react-collapsible/dist/index.cjs +168 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-collapsible@1.1.12_@types_react-dom@19.2.3_@types_react@19.2.6__@types__d025a77f62ee83ca6bd8b0ea1f9de738/node_modules/@radix-ui/react-collapsible/dist/index.mjs +146 -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 → @radix-ui_react-collection@1.1.7_@types_react-dom@19.2.3_@types_react@19.2.6__@types_re_59aa5e150e70a3e7bfb1567148b021b5}/node_modules/@radix-ui/react-collection/dist/index.cjs +2 -2
- 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 → @radix-ui_react-collection@1.1.7_@types_react-dom@19.2.3_@types_react@19.2.6__@types_re_59aa5e150e70a3e7bfb1567148b021b5}/node_modules/@radix-ui/react-collection/dist/index.mjs +2 -2
- 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 → @radix-ui_react-dismissable-layer@1.1.11_@types_react-dom@19.2.3_@types_react@19.2.6__@_9ee1db7daf927866cf505b31d40047ad}/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs +4 -4
- 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 → @radix-ui_react-dismissable-layer@1.1.11_@types_react-dom@19.2.3_@types_react@19.2.6__@_9ee1db7daf927866cf505b31d40047ad}/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs +4 -4
- package/dist/node_modules/.pnpm/@radix-ui_react-dropdown-menu@2.1.16_@types_react-dom@19.2.3_@types_react@19.2.6__@type_a50051c7210b6fbd5be09388bda08578/node_modules/@radix-ui/react-dropdown-menu/dist/index.cjs +282 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-dropdown-menu@2.1.16_@types_react-dom@19.2.3_@types_react@19.2.6__@type_a50051c7210b6fbd5be09388bda08578/node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs +247 -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 → @radix-ui_react-focus-scope@1.1.7_@types_react-dom@19.2.3_@types_react@19.2.6__@types_r_0a31b7f987af9482d13505312e1a1be9}/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +3 -3
- 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 → @radix-ui_react-focus-scope@1.1.7_@types_react-dom@19.2.3_@types_react@19.2.6__@types_r_0a31b7f987af9482d13505312e1a1be9}/node_modules/@radix-ui/react-focus-scope/dist/index.mjs +3 -3
- package/dist/node_modules/.pnpm/{@radix-ui_react-id@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-id@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-id/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@radix-ui_react-id@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-id@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-id/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-menu@2.1.16_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@1_82ed1fcd848b6984d9291a784d477cf4/node_modules/@radix-ui/react-menu/dist/index.cjs +845 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-menu@2.1.16_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@1_82ed1fcd848b6984d9291a784d477cf4/node_modules/@radix-ui/react-menu/dist/index.mjs +799 -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 → @radix-ui_react-popper@1.2.8_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_7ac2caae1e39f9ba93d5015614525161}/node_modules/@radix-ui/react-popper/dist/index.cjs +7 -7
- 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 → @radix-ui_react-popper@1.2.8_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_7ac2caae1e39f9ba93d5015614525161}/node_modules/@radix-ui/react-popper/dist/index.mjs +7 -7
- 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 → @radix-ui_react-portal@1.1.9_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_1bb4e0f97f86496802d28a2e74e2a8b9}/node_modules/@radix-ui/react-portal/dist/index.cjs +2 -2
- 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 → @radix-ui_react-portal@1.1.9_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_1bb4e0f97f86496802d28a2e74e2a8b9}/node_modules/@radix-ui/react-portal/dist/index.mjs +2 -2
- package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.1.5_@types_react-dom@19.2.3_@types_react@19.2.6__@types_reac_90f8e5c12233caef3399d5fd66452a13/node_modules/@radix-ui/react-presence/dist/index.cjs +147 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.1.5_@types_react-dom@19.2.3_@types_react@19.2.6__@types_reac_90f8e5c12233caef3399d5fd66452a13/node_modules/@radix-ui/react-presence/dist/index.mjs +131 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-roving-focus@1.1.11_@types_react-dom@19.2.3_@types_react@19.2.6__@types_fe1151d1f393bbc1072b24a86dff3a23/node_modules/@radix-ui/react-roving-focus/dist/index.cjs +244 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-roving-focus@1.1.11_@types_react-dom@19.2.3_@types_react@19.2.6__@types_fe1151d1f393bbc1072b24a86dff3a23/node_modules/@radix-ui/react-roving-focus/dist/index.mjs +224 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-scroll-area@1.2.10_@types_react-dom@19.2.3_@types_react@19.2.6__@types__e3f7735e9b444a10b3bbfd9fe97d44d0/node_modules/@radix-ui/react-scroll-area/dist/index.cjs +742 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-scroll-area@1.2.10_@types_react-dom@19.2.3_@types_react@19.2.6__@types__e3f7735e9b444a10b3bbfd9fe97d44d0/node_modules/@radix-ui/react-scroll-area/dist/index.mjs +719 -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 → @radix-ui_react-select@2.2.6_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_38dc681bb1f2bcfeb5249d8ca2bc01f5}/node_modules/@radix-ui/react-select/dist/index.cjs +17 -17
- 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 → @radix-ui_react-select@2.2.6_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_38dc681bb1f2bcfeb5249d8ca2bc01f5}/node_modules/@radix-ui/react-select/dist/index.mjs +17 -17
- package/dist/node_modules/.pnpm/{@radix-ui_react-use-controllable-state@1.2.2_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-controllable-state@1.2.2_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@radix-ui_react-use-controllable-state@1.2.2_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-controllable-state@1.2.2_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{@radix-ui_react-use-escape-keydown@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-escape-keydown@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-escape-keydown/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@radix-ui_react-use-escape-keydown@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-escape-keydown@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{@radix-ui_react-use-size@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-size@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-size/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@radix-ui_react-use-size@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-size@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-size/dist/index.mjs +1 -1
- 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 → @radix-ui_react-visually-hidden@1.2.3_@types_react-dom@19.2.3_@types_react@19.2.6__@typ_f453379bbd5a4932ec515167f81be42a}/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs +1 -1
- 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 → @radix-ui_react-visually-hidden@1.2.3_@types_react-dom@19.2.3_@types_react@19.2.6__@typ_f453379bbd5a4932ec515167f81be42a}/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0 → react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll-bar/dist/es2015/component.cjs +1 -1
- package/dist/node_modules/.pnpm/{react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0 → react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll-bar/dist/es2015/component.mjs +1 -1
- package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/SideEffect.cjs +2 -2
- package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/SideEffect.mjs +2 -2
- package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/UI.cjs +2 -2
- package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/UI.mjs +2 -2
- package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/medium.cjs +1 -1
- package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/medium.mjs +1 -1
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_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 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/sidecar.mjs +1 -1
- package/dist/packages/better-stack/src/plugins/ai-chat/api/plugin.cjs +610 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/api/plugin.mjs +608 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-input.cjs +221 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-input.mjs +219 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-interface.cjs +341 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-interface.mjs +339 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-layout.cjs +135 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-layout.mjs +133 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-message.cjs +429 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-message.mjs +423 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-sidebar.cjs +227 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-sidebar.mjs +225 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/loading/chat-page-skeleton.cjs +31 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/loading/chat-page-skeleton.mjs +29 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/loading/index.cjs +11 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/loading/index.mjs +8 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/pages/404-page.cjs +18 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/pages/404-page.mjs +16 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/pages/chat-page.cjs +39 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/pages/chat-page.internal.cjs +22 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/pages/chat-page.internal.mjs +20 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/pages/chat-page.mjs +37 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/shared/default-error.cjs +18 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/shared/default-error.mjs +16 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/shared/error-placeholder.cjs +26 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/shared/error-placeholder.mjs +24 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/tool-call-display.cjs +123 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/tool-call-display.mjs +121 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/hooks/chat-hooks.cjs +199 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/hooks/chat-hooks.mjs +191 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/localization/index.cjs +63 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/localization/index.mjs +61 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/overrides.cjs +14 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/overrides.mjs +11 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/plugin.cjs +241 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/plugin.mjs +239 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/db.cjs +65 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/db.mjs +63 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/schemas.cjs +42 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/schemas.mjs +38 -0
- package/dist/packages/better-stack/src/plugins/blog/client/components/shared/markdown-content.cjs +12 -309
- package/dist/packages/better-stack/src/plugins/blog/client/components/shared/markdown-content.mjs +13 -303
- package/dist/packages/better-stack/src/plugins/blog/client/components/shared/page-wrapper.cjs +2 -2
- package/dist/packages/better-stack/src/plugins/blog/client/components/shared/page-wrapper.mjs +2 -2
- package/dist/packages/ui/src/components/accordion.cjs +67 -0
- package/dist/packages/ui/src/components/accordion.mjs +62 -0
- package/dist/packages/ui/src/components/alert-dialog.cjs +1 -1
- package/dist/packages/ui/src/components/alert-dialog.mjs +1 -1
- package/dist/packages/{better-stack/src/plugins/blog/client/components/shared/better-blog-attribution.cjs → ui/src/components/better-stack-attribution.cjs} +3 -3
- package/dist/packages/{better-stack/src/plugins/blog/client/components/shared/better-blog-attribution.mjs → ui/src/components/better-stack-attribution.mjs} +3 -3
- package/dist/packages/ui/src/components/dialog.cjs +14 -0
- package/dist/packages/ui/src/components/dialog.mjs +14 -1
- package/dist/packages/ui/src/components/dropdown-menu.cjs +67 -0
- package/dist/packages/ui/src/components/dropdown-menu.mjs +62 -0
- package/dist/packages/ui/src/components/markdown-content.cjs +306 -0
- package/dist/packages/ui/src/components/markdown-content.mjs +297 -0
- package/dist/packages/ui/src/components/scroll-area.cjs +63 -0
- package/dist/packages/ui/src/components/scroll-area.mjs +60 -0
- package/dist/packages/ui/src/components/select.cjs +1 -1
- package/dist/packages/ui/src/components/select.mjs +1 -1
- package/dist/packages/ui/src/components/sheet.cjs +87 -0
- package/dist/packages/ui/src/components/sheet.mjs +69 -0
- package/dist/plugins/ai-chat/api/index.cjs +9 -0
- package/dist/plugins/ai-chat/api/index.d.cts +9 -0
- package/dist/plugins/ai-chat/api/index.d.mts +9 -0
- package/dist/plugins/ai-chat/api/index.d.ts +9 -0
- package/dist/plugins/ai-chat/api/index.mjs +2 -0
- package/dist/plugins/ai-chat/client/components/index.cjs +29 -0
- package/dist/plugins/ai-chat/client/components/index.d.cts +30 -0
- package/dist/plugins/ai-chat/client/components/index.d.mts +30 -0
- package/dist/plugins/ai-chat/client/components/index.d.ts +30 -0
- package/dist/plugins/ai-chat/client/components/index.mjs +12 -0
- package/dist/plugins/ai-chat/client/hooks/index.cjs +13 -0
- package/dist/plugins/ai-chat/client/hooks/index.d.cts +98 -0
- package/dist/plugins/ai-chat/client/hooks/index.d.mts +98 -0
- package/dist/plugins/ai-chat/client/hooks/index.d.ts +98 -0
- package/dist/plugins/ai-chat/client/hooks/index.mjs +1 -0
- package/dist/plugins/ai-chat/client/index.cjs +21 -0
- package/dist/plugins/ai-chat/client/index.d.cts +156 -0
- package/dist/plugins/ai-chat/client/index.d.mts +156 -0
- package/dist/plugins/ai-chat/client/index.d.ts +156 -0
- package/dist/plugins/ai-chat/client/index.mjs +8 -0
- package/dist/plugins/ai-chat/client.css +6 -0
- package/dist/plugins/ai-chat/query-keys.cjs +60 -0
- package/dist/plugins/ai-chat/query-keys.d.cts +478 -0
- package/dist/plugins/ai-chat/query-keys.d.mts +478 -0
- package/dist/plugins/ai-chat/query-keys.d.ts +478 -0
- package/dist/plugins/ai-chat/query-keys.mjs +58 -0
- package/dist/plugins/ai-chat/style.css +19 -0
- package/dist/plugins/blog/api/index.d.cts +1 -1
- package/dist/plugins/blog/api/index.d.mts +1 -1
- package/dist/plugins/blog/api/index.d.ts +1 -1
- package/dist/plugins/blog/client/components/shared/markdown-content-styles.css +91 -62
- package/dist/plugins/blog/client/hooks/index.d.cts +4 -4
- package/dist/plugins/blog/client/hooks/index.d.mts +4 -4
- package/dist/plugins/blog/client/hooks/index.d.ts +4 -4
- package/dist/plugins/blog/client/index.d.cts +1 -1
- package/dist/plugins/blog/client/index.d.mts +1 -1
- package/dist/plugins/blog/client/index.d.ts +1 -1
- package/dist/plugins/blog/query-keys.d.cts +7 -7
- package/dist/plugins/blog/query-keys.d.mts +7 -7
- package/dist/plugins/blog/query-keys.d.ts +7 -7
- package/dist/shared/stack.Be1QIHEn.d.cts +23 -0
- package/dist/shared/stack.Be1QIHEn.d.mts +23 -0
- package/dist/shared/stack.Be1QIHEn.d.ts +23 -0
- package/dist/shared/stack.DaOcgmrM.d.cts +323 -0
- package/dist/shared/stack.DaOcgmrM.d.mts +323 -0
- package/dist/shared/stack.DaOcgmrM.d.ts +323 -0
- package/package.json +59 -1
- package/src/plugins/ai-chat/api/index.ts +2 -0
- package/src/plugins/ai-chat/api/plugin.ts +1083 -0
- package/src/plugins/ai-chat/client/components/chat-input.tsx +295 -0
- package/src/plugins/ai-chat/client/components/chat-interface.tsx +494 -0
- package/src/plugins/ai-chat/client/components/chat-layout.tsx +175 -0
- package/src/plugins/ai-chat/client/components/chat-message.tsx +561 -0
- package/src/plugins/ai-chat/client/components/chat-sidebar.tsx +296 -0
- package/src/plugins/ai-chat/client/components/index.ts +18 -0
- package/src/plugins/ai-chat/client/components/loading/chat-page-skeleton.tsx +57 -0
- package/src/plugins/ai-chat/client/components/loading/index.tsx +11 -0
- package/src/plugins/ai-chat/client/components/pages/404-page.tsx +27 -0
- package/src/plugins/ai-chat/client/components/pages/chat-page.internal.tsx +31 -0
- package/src/plugins/ai-chat/client/components/pages/chat-page.tsx +46 -0
- package/src/plugins/ai-chat/client/components/shared/default-error.tsx +28 -0
- package/src/plugins/ai-chat/client/components/shared/error-placeholder.tsx +22 -0
- package/src/plugins/ai-chat/client/components/tool-call-display.tsx +197 -0
- package/src/plugins/ai-chat/client/hooks/chat-hooks.tsx +349 -0
- package/src/plugins/ai-chat/client/hooks/index.tsx +1 -0
- package/src/plugins/ai-chat/client/index.ts +25 -0
- package/src/plugins/ai-chat/client/localization/index.ts +156 -0
- package/src/plugins/ai-chat/client/overrides.ts +241 -0
- package/src/plugins/ai-chat/client/plugin.tsx +449 -0
- package/src/plugins/ai-chat/client.css +6 -0
- package/src/plugins/ai-chat/db.ts +65 -0
- package/src/plugins/ai-chat/query-keys.ts +87 -0
- package/src/plugins/ai-chat/schemas.ts +40 -0
- package/src/plugins/ai-chat/style.css +19 -0
- package/src/plugins/ai-chat/types.ts +29 -0
- package/src/plugins/blog/client/components/shared/markdown-content-styles.css +91 -62
- package/src/plugins/blog/client/components/shared/markdown-content.tsx +19 -427
- package/src/plugins/blog/client/components/shared/page-wrapper.tsx +2 -2
- 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 +0 -9
- package/src/plugins/blog/client/components/shared/better-blog-attribution.tsx +0 -19
- package/dist/node_modules/.pnpm/{@radix-ui_react-compose-refs@1.1.2_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-compose-refs@1.1.2_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-compose-refs@1.1.2_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-compose-refs@1.1.2_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-compose-refs/dist/index.mjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-context@1.1.2_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-context@1.1.2_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-context/dist/index.cjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-context@1.1.2_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-context@1.1.2_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-context/dist/index.mjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-direction@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-direction@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-direction/dist/index.cjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-direction@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-direction@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-direction/dist/index.mjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-focus-guards@1.1.3_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-focus-guards@1.1.3_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-focus-guards/dist/index.cjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-focus-guards@1.1.3_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-focus-guards@1.1.3_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-focus-guards/dist/index.mjs +0 -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 → @radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.3_@types_react@19.2.6__@types_rea_a92a69cb1cb39305138539e4fa72f596}/node_modules/@radix-ui/react-primitive/dist/index.cjs +0 -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 → @radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.3_@types_react@19.2.6__@types_rea_a92a69cb1cb39305138539e4fa72f596}/node_modules/@radix-ui/react-primitive/dist/index.mjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-use-previous@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-previous@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-previous/dist/index.cjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-use-previous@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-previous@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-previous/dist/index.mjs +0 -0
- package/dist/node_modules/.pnpm/{react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0 → react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll-bar/dist/es2015/constants.cjs +0 -0
- package/dist/node_modules/.pnpm/{react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0 → react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll-bar/dist/es2015/constants.mjs +0 -0
- package/dist/node_modules/.pnpm/{react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0 → react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll-bar/dist/es2015/utils.cjs +0 -0
- package/dist/node_modules/.pnpm/{react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0 → react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll-bar/dist/es2015/utils.mjs +0 -0
- package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/Combination.cjs +0 -0
- package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/Combination.mjs +0 -0
- package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.cjs +0 -0
- package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.mjs +0 -0
- package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/handleScroll.cjs +0 -0
- package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/handleScroll.mjs +0 -0
- package/dist/node_modules/.pnpm/{react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0 → react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0}/node_modules/react-style-singleton/dist/es2015/component.cjs +0 -0
- package/dist/node_modules/.pnpm/{react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0 → react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0}/node_modules/react-style-singleton/dist/es2015/component.mjs +0 -0
- package/dist/node_modules/.pnpm/{react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0 → react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0}/node_modules/react-style-singleton/dist/es2015/hook.cjs +0 -0
- package/dist/node_modules/.pnpm/{react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0 → react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0}/node_modules/react-style-singleton/dist/es2015/hook.mjs +0 -0
- package/dist/node_modules/.pnpm/{react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0 → react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0}/node_modules/react-style-singleton/dist/es2015/singleton.cjs +0 -0
- package/dist/node_modules/.pnpm/{react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0 → react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0}/node_modules/react-style-singleton/dist/es2015/singleton.mjs +0 -0
- package/dist/node_modules/.pnpm/{use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0 → use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-callback-ref/dist/es2015/assignRef.cjs +0 -0
- package/dist/node_modules/.pnpm/{use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0 → use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-callback-ref/dist/es2015/assignRef.mjs +0 -0
- package/dist/node_modules/.pnpm/{use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0 → use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-callback-ref/dist/es2015/useMergeRef.cjs +0 -0
- package/dist/node_modules/.pnpm/{use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0 → use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-callback-ref/dist/es2015/useMergeRef.mjs +0 -0
- package/dist/node_modules/.pnpm/{use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0 → use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-callback-ref/dist/es2015/useRef.cjs +0 -0
- package/dist/node_modules/.pnpm/{use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0 → use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-callback-ref/dist/es2015/useRef.mjs +0 -0
- package/dist/node_modules/.pnpm/{use-sidecar@1.1.3_@types_react@19.2.2_react@19.2.0 → use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-sidecar/dist/es2015/exports.cjs +0 -0
- package/dist/node_modules/.pnpm/{use-sidecar@1.1.3_@types_react@19.2.2_react@19.2.0 → use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-sidecar/dist/es2015/exports.mjs +0 -0
- package/dist/node_modules/.pnpm/{use-sidecar@1.1.3_@types_react@19.2.2_react@19.2.0 → use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-sidecar/dist/es2015/medium.cjs +0 -0
- package/dist/node_modules/.pnpm/{use-sidecar@1.1.3_@types_react@19.2.2_react@19.2.0 → use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-sidecar/dist/es2015/medium.mjs +0 -0
- package/dist/shared/{stack.CbuN2zVV.d.ts → stack.CcI4sYJP.d.cts} +3 -3
- package/dist/shared/{stack.CbuN2zVV.d.cts → stack.CcI4sYJP.d.mts} +3 -3
- package/dist/shared/{stack.CbuN2zVV.d.mts → stack.CcI4sYJP.d.ts} +3 -3
|
@@ -0,0 +1,742 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const React = require('react');
|
|
5
|
+
const index$3 = require('../../../../../@radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.3_@types_react@19.2.6__@types_rea_a92a69cb1cb39305138539e4fa72f596/node_modules/@radix-ui/react-primitive/dist/index.cjs');
|
|
6
|
+
const index$4 = require('../../../../../@radix-ui_react-presence@1.1.5_@types_react-dom@19.2.3_@types_react@19.2.6__@types_reac_90f8e5c12233caef3399d5fd66452a13/node_modules/@radix-ui/react-presence/dist/index.cjs');
|
|
7
|
+
const index$2 = require('../../../../../@radix-ui_react-context@1.1.2_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-context/dist/index.cjs');
|
|
8
|
+
const index = require('../../../../../@radix-ui_react-compose-refs@1.1.2_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-compose-refs/dist/index.cjs');
|
|
9
|
+
const index$6 = require('../../../../../@radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs');
|
|
10
|
+
const index$1 = require('../../../../../@radix-ui_react-direction@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-direction/dist/index.cjs');
|
|
11
|
+
const index$7 = require('../../../../../@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs');
|
|
12
|
+
const index$8 = require('../../../../../@radix-ui_number@1.1.1/node_modules/@radix-ui/number/dist/index.cjs');
|
|
13
|
+
const index$5 = require('../../../../../@radix-ui_primitive@1.1.3/node_modules/@radix-ui/primitive/dist/index.cjs');
|
|
14
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
15
|
+
|
|
16
|
+
function _interopNamespaceCompat(e) {
|
|
17
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
18
|
+
const n = Object.create(null);
|
|
19
|
+
if (e) {
|
|
20
|
+
for (const k in e) {
|
|
21
|
+
n[k] = e[k];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
n.default = e;
|
|
25
|
+
return n;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
|
|
29
|
+
|
|
30
|
+
function useStateMachine(initialState, machine) {
|
|
31
|
+
return React__namespace.useReducer((state, event) => {
|
|
32
|
+
const nextState = machine[state][event];
|
|
33
|
+
return nextState ?? state;
|
|
34
|
+
}, initialState);
|
|
35
|
+
}
|
|
36
|
+
var SCROLL_AREA_NAME = "ScrollArea";
|
|
37
|
+
var [createScrollAreaContext] = index$2.createContextScope(SCROLL_AREA_NAME);
|
|
38
|
+
var [ScrollAreaProvider, useScrollAreaContext] = createScrollAreaContext(SCROLL_AREA_NAME);
|
|
39
|
+
var ScrollArea = React__namespace.forwardRef(
|
|
40
|
+
(props, forwardedRef) => {
|
|
41
|
+
const {
|
|
42
|
+
__scopeScrollArea,
|
|
43
|
+
type = "hover",
|
|
44
|
+
dir,
|
|
45
|
+
scrollHideDelay = 600,
|
|
46
|
+
...scrollAreaProps
|
|
47
|
+
} = props;
|
|
48
|
+
const [scrollArea, setScrollArea] = React__namespace.useState(null);
|
|
49
|
+
const [viewport, setViewport] = React__namespace.useState(null);
|
|
50
|
+
const [content, setContent] = React__namespace.useState(null);
|
|
51
|
+
const [scrollbarX, setScrollbarX] = React__namespace.useState(null);
|
|
52
|
+
const [scrollbarY, setScrollbarY] = React__namespace.useState(null);
|
|
53
|
+
const [cornerWidth, setCornerWidth] = React__namespace.useState(0);
|
|
54
|
+
const [cornerHeight, setCornerHeight] = React__namespace.useState(0);
|
|
55
|
+
const [scrollbarXEnabled, setScrollbarXEnabled] = React__namespace.useState(false);
|
|
56
|
+
const [scrollbarYEnabled, setScrollbarYEnabled] = React__namespace.useState(false);
|
|
57
|
+
const composedRefs = index.useComposedRefs(forwardedRef, (node) => setScrollArea(node));
|
|
58
|
+
const direction = index$1.useDirection(dir);
|
|
59
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
60
|
+
ScrollAreaProvider,
|
|
61
|
+
{
|
|
62
|
+
scope: __scopeScrollArea,
|
|
63
|
+
type,
|
|
64
|
+
dir: direction,
|
|
65
|
+
scrollHideDelay,
|
|
66
|
+
scrollArea,
|
|
67
|
+
viewport,
|
|
68
|
+
onViewportChange: setViewport,
|
|
69
|
+
content,
|
|
70
|
+
onContentChange: setContent,
|
|
71
|
+
scrollbarX,
|
|
72
|
+
onScrollbarXChange: setScrollbarX,
|
|
73
|
+
scrollbarXEnabled,
|
|
74
|
+
onScrollbarXEnabledChange: setScrollbarXEnabled,
|
|
75
|
+
scrollbarY,
|
|
76
|
+
onScrollbarYChange: setScrollbarY,
|
|
77
|
+
scrollbarYEnabled,
|
|
78
|
+
onScrollbarYEnabledChange: setScrollbarYEnabled,
|
|
79
|
+
onCornerWidthChange: setCornerWidth,
|
|
80
|
+
onCornerHeightChange: setCornerHeight,
|
|
81
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
82
|
+
index$3.Primitive.div,
|
|
83
|
+
{
|
|
84
|
+
dir: direction,
|
|
85
|
+
...scrollAreaProps,
|
|
86
|
+
ref: composedRefs,
|
|
87
|
+
style: {
|
|
88
|
+
position: "relative",
|
|
89
|
+
// Pass corner sizes as CSS vars to reduce re-renders of context consumers
|
|
90
|
+
["--radix-scroll-area-corner-width"]: cornerWidth + "px",
|
|
91
|
+
["--radix-scroll-area-corner-height"]: cornerHeight + "px",
|
|
92
|
+
...props.style
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
ScrollArea.displayName = SCROLL_AREA_NAME;
|
|
101
|
+
var VIEWPORT_NAME = "ScrollAreaViewport";
|
|
102
|
+
var ScrollAreaViewport = React__namespace.forwardRef(
|
|
103
|
+
(props, forwardedRef) => {
|
|
104
|
+
const { __scopeScrollArea, children, nonce, ...viewportProps } = props;
|
|
105
|
+
const context = useScrollAreaContext(VIEWPORT_NAME, __scopeScrollArea);
|
|
106
|
+
const ref = React__namespace.useRef(null);
|
|
107
|
+
const composedRefs = index.useComposedRefs(forwardedRef, ref, context.onViewportChange);
|
|
108
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
109
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
110
|
+
"style",
|
|
111
|
+
{
|
|
112
|
+
dangerouslySetInnerHTML: {
|
|
113
|
+
__html: `[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`
|
|
114
|
+
},
|
|
115
|
+
nonce
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
119
|
+
index$3.Primitive.div,
|
|
120
|
+
{
|
|
121
|
+
"data-radix-scroll-area-viewport": "",
|
|
122
|
+
...viewportProps,
|
|
123
|
+
ref: composedRefs,
|
|
124
|
+
style: {
|
|
125
|
+
/**
|
|
126
|
+
* We don't support `visible` because the intention is to have at least one scrollbar
|
|
127
|
+
* if this component is used and `visible` will behave like `auto` in that case
|
|
128
|
+
* https://developer.mozilla.org/en-US/docs/Web/CSS/overflow#description
|
|
129
|
+
*
|
|
130
|
+
* We don't handle `auto` because the intention is for the native implementation
|
|
131
|
+
* to be hidden if using this component. We just want to ensure the node is scrollable
|
|
132
|
+
* so could have used either `scroll` or `auto` here. We picked `scroll` to prevent
|
|
133
|
+
* the browser from having to work out whether to render native scrollbars or not,
|
|
134
|
+
* we tell it to with the intention of hiding them in CSS.
|
|
135
|
+
*/
|
|
136
|
+
overflowX: context.scrollbarXEnabled ? "scroll" : "hidden",
|
|
137
|
+
overflowY: context.scrollbarYEnabled ? "scroll" : "hidden",
|
|
138
|
+
...props.style
|
|
139
|
+
},
|
|
140
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: context.onContentChange, style: { minWidth: "100%", display: "table" }, children })
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
] });
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
ScrollAreaViewport.displayName = VIEWPORT_NAME;
|
|
147
|
+
var SCROLLBAR_NAME = "ScrollAreaScrollbar";
|
|
148
|
+
var ScrollAreaScrollbar = React__namespace.forwardRef(
|
|
149
|
+
(props, forwardedRef) => {
|
|
150
|
+
const { forceMount, ...scrollbarProps } = props;
|
|
151
|
+
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
152
|
+
const { onScrollbarXEnabledChange, onScrollbarYEnabledChange } = context;
|
|
153
|
+
const isHorizontal = props.orientation === "horizontal";
|
|
154
|
+
React__namespace.useEffect(() => {
|
|
155
|
+
isHorizontal ? onScrollbarXEnabledChange(true) : onScrollbarYEnabledChange(true);
|
|
156
|
+
return () => {
|
|
157
|
+
isHorizontal ? onScrollbarXEnabledChange(false) : onScrollbarYEnabledChange(false);
|
|
158
|
+
};
|
|
159
|
+
}, [isHorizontal, onScrollbarXEnabledChange, onScrollbarYEnabledChange]);
|
|
160
|
+
return context.type === "hover" ? /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaScrollbarHover, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === "scroll" ? /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaScrollbarScroll, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === "auto" ? /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaScrollbarAuto, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === "always" ? /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaScrollbarVisible, { ...scrollbarProps, ref: forwardedRef }) : null;
|
|
161
|
+
}
|
|
162
|
+
);
|
|
163
|
+
ScrollAreaScrollbar.displayName = SCROLLBAR_NAME;
|
|
164
|
+
var ScrollAreaScrollbarHover = React__namespace.forwardRef((props, forwardedRef) => {
|
|
165
|
+
const { forceMount, ...scrollbarProps } = props;
|
|
166
|
+
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
167
|
+
const [visible, setVisible] = React__namespace.useState(false);
|
|
168
|
+
React__namespace.useEffect(() => {
|
|
169
|
+
const scrollArea = context.scrollArea;
|
|
170
|
+
let hideTimer = 0;
|
|
171
|
+
if (scrollArea) {
|
|
172
|
+
const handlePointerEnter = () => {
|
|
173
|
+
window.clearTimeout(hideTimer);
|
|
174
|
+
setVisible(true);
|
|
175
|
+
};
|
|
176
|
+
const handlePointerLeave = () => {
|
|
177
|
+
hideTimer = window.setTimeout(() => setVisible(false), context.scrollHideDelay);
|
|
178
|
+
};
|
|
179
|
+
scrollArea.addEventListener("pointerenter", handlePointerEnter);
|
|
180
|
+
scrollArea.addEventListener("pointerleave", handlePointerLeave);
|
|
181
|
+
return () => {
|
|
182
|
+
window.clearTimeout(hideTimer);
|
|
183
|
+
scrollArea.removeEventListener("pointerenter", handlePointerEnter);
|
|
184
|
+
scrollArea.removeEventListener("pointerleave", handlePointerLeave);
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
}, [context.scrollArea, context.scrollHideDelay]);
|
|
188
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index$4.Presence, { present: forceMount || visible, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
189
|
+
ScrollAreaScrollbarAuto,
|
|
190
|
+
{
|
|
191
|
+
"data-state": visible ? "visible" : "hidden",
|
|
192
|
+
...scrollbarProps,
|
|
193
|
+
ref: forwardedRef
|
|
194
|
+
}
|
|
195
|
+
) });
|
|
196
|
+
});
|
|
197
|
+
var ScrollAreaScrollbarScroll = React__namespace.forwardRef((props, forwardedRef) => {
|
|
198
|
+
const { forceMount, ...scrollbarProps } = props;
|
|
199
|
+
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
200
|
+
const isHorizontal = props.orientation === "horizontal";
|
|
201
|
+
const debounceScrollEnd = useDebounceCallback(() => send("SCROLL_END"), 100);
|
|
202
|
+
const [state, send] = useStateMachine("hidden", {
|
|
203
|
+
hidden: {
|
|
204
|
+
SCROLL: "scrolling"
|
|
205
|
+
},
|
|
206
|
+
scrolling: {
|
|
207
|
+
SCROLL_END: "idle",
|
|
208
|
+
POINTER_ENTER: "interacting"
|
|
209
|
+
},
|
|
210
|
+
interacting: {
|
|
211
|
+
SCROLL: "interacting",
|
|
212
|
+
POINTER_LEAVE: "idle"
|
|
213
|
+
},
|
|
214
|
+
idle: {
|
|
215
|
+
HIDE: "hidden",
|
|
216
|
+
SCROLL: "scrolling",
|
|
217
|
+
POINTER_ENTER: "interacting"
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
React__namespace.useEffect(() => {
|
|
221
|
+
if (state === "idle") {
|
|
222
|
+
const hideTimer = window.setTimeout(() => send("HIDE"), context.scrollHideDelay);
|
|
223
|
+
return () => window.clearTimeout(hideTimer);
|
|
224
|
+
}
|
|
225
|
+
}, [state, context.scrollHideDelay, send]);
|
|
226
|
+
React__namespace.useEffect(() => {
|
|
227
|
+
const viewport = context.viewport;
|
|
228
|
+
const scrollDirection = isHorizontal ? "scrollLeft" : "scrollTop";
|
|
229
|
+
if (viewport) {
|
|
230
|
+
let prevScrollPos = viewport[scrollDirection];
|
|
231
|
+
const handleScroll = () => {
|
|
232
|
+
const scrollPos = viewport[scrollDirection];
|
|
233
|
+
const hasScrollInDirectionChanged = prevScrollPos !== scrollPos;
|
|
234
|
+
if (hasScrollInDirectionChanged) {
|
|
235
|
+
send("SCROLL");
|
|
236
|
+
debounceScrollEnd();
|
|
237
|
+
}
|
|
238
|
+
prevScrollPos = scrollPos;
|
|
239
|
+
};
|
|
240
|
+
viewport.addEventListener("scroll", handleScroll);
|
|
241
|
+
return () => viewport.removeEventListener("scroll", handleScroll);
|
|
242
|
+
}
|
|
243
|
+
}, [context.viewport, isHorizontal, send, debounceScrollEnd]);
|
|
244
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index$4.Presence, { present: forceMount || state !== "hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
245
|
+
ScrollAreaScrollbarVisible,
|
|
246
|
+
{
|
|
247
|
+
"data-state": state === "hidden" ? "hidden" : "visible",
|
|
248
|
+
...scrollbarProps,
|
|
249
|
+
ref: forwardedRef,
|
|
250
|
+
onPointerEnter: index$5.composeEventHandlers(props.onPointerEnter, () => send("POINTER_ENTER")),
|
|
251
|
+
onPointerLeave: index$5.composeEventHandlers(props.onPointerLeave, () => send("POINTER_LEAVE"))
|
|
252
|
+
}
|
|
253
|
+
) });
|
|
254
|
+
});
|
|
255
|
+
var ScrollAreaScrollbarAuto = React__namespace.forwardRef((props, forwardedRef) => {
|
|
256
|
+
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
257
|
+
const { forceMount, ...scrollbarProps } = props;
|
|
258
|
+
const [visible, setVisible] = React__namespace.useState(false);
|
|
259
|
+
const isHorizontal = props.orientation === "horizontal";
|
|
260
|
+
const handleResize = useDebounceCallback(() => {
|
|
261
|
+
if (context.viewport) {
|
|
262
|
+
const isOverflowX = context.viewport.offsetWidth < context.viewport.scrollWidth;
|
|
263
|
+
const isOverflowY = context.viewport.offsetHeight < context.viewport.scrollHeight;
|
|
264
|
+
setVisible(isHorizontal ? isOverflowX : isOverflowY);
|
|
265
|
+
}
|
|
266
|
+
}, 10);
|
|
267
|
+
useResizeObserver(context.viewport, handleResize);
|
|
268
|
+
useResizeObserver(context.content, handleResize);
|
|
269
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index$4.Presence, { present: forceMount || visible, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
270
|
+
ScrollAreaScrollbarVisible,
|
|
271
|
+
{
|
|
272
|
+
"data-state": visible ? "visible" : "hidden",
|
|
273
|
+
...scrollbarProps,
|
|
274
|
+
ref: forwardedRef
|
|
275
|
+
}
|
|
276
|
+
) });
|
|
277
|
+
});
|
|
278
|
+
var ScrollAreaScrollbarVisible = React__namespace.forwardRef((props, forwardedRef) => {
|
|
279
|
+
const { orientation = "vertical", ...scrollbarProps } = props;
|
|
280
|
+
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
281
|
+
const thumbRef = React__namespace.useRef(null);
|
|
282
|
+
const pointerOffsetRef = React__namespace.useRef(0);
|
|
283
|
+
const [sizes, setSizes] = React__namespace.useState({
|
|
284
|
+
content: 0,
|
|
285
|
+
viewport: 0,
|
|
286
|
+
scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
|
|
287
|
+
});
|
|
288
|
+
const thumbRatio = getThumbRatio(sizes.viewport, sizes.content);
|
|
289
|
+
const commonProps = {
|
|
290
|
+
...scrollbarProps,
|
|
291
|
+
sizes,
|
|
292
|
+
onSizesChange: setSizes,
|
|
293
|
+
hasThumb: Boolean(thumbRatio > 0 && thumbRatio < 1),
|
|
294
|
+
onThumbChange: (thumb) => thumbRef.current = thumb,
|
|
295
|
+
onThumbPointerUp: () => pointerOffsetRef.current = 0,
|
|
296
|
+
onThumbPointerDown: (pointerPos) => pointerOffsetRef.current = pointerPos
|
|
297
|
+
};
|
|
298
|
+
function getScrollPosition(pointerPos, dir) {
|
|
299
|
+
return getScrollPositionFromPointer(pointerPos, pointerOffsetRef.current, sizes, dir);
|
|
300
|
+
}
|
|
301
|
+
if (orientation === "horizontal") {
|
|
302
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
303
|
+
ScrollAreaScrollbarX,
|
|
304
|
+
{
|
|
305
|
+
...commonProps,
|
|
306
|
+
ref: forwardedRef,
|
|
307
|
+
onThumbPositionChange: () => {
|
|
308
|
+
if (context.viewport && thumbRef.current) {
|
|
309
|
+
const scrollPos = context.viewport.scrollLeft;
|
|
310
|
+
const offset = getThumbOffsetFromScroll(scrollPos, sizes, context.dir);
|
|
311
|
+
thumbRef.current.style.transform = `translate3d(${offset}px, 0, 0)`;
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
onWheelScroll: (scrollPos) => {
|
|
315
|
+
if (context.viewport) context.viewport.scrollLeft = scrollPos;
|
|
316
|
+
},
|
|
317
|
+
onDragScroll: (pointerPos) => {
|
|
318
|
+
if (context.viewport) {
|
|
319
|
+
context.viewport.scrollLeft = getScrollPosition(pointerPos, context.dir);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
if (orientation === "vertical") {
|
|
326
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
327
|
+
ScrollAreaScrollbarY,
|
|
328
|
+
{
|
|
329
|
+
...commonProps,
|
|
330
|
+
ref: forwardedRef,
|
|
331
|
+
onThumbPositionChange: () => {
|
|
332
|
+
if (context.viewport && thumbRef.current) {
|
|
333
|
+
const scrollPos = context.viewport.scrollTop;
|
|
334
|
+
const offset = getThumbOffsetFromScroll(scrollPos, sizes);
|
|
335
|
+
thumbRef.current.style.transform = `translate3d(0, ${offset}px, 0)`;
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
onWheelScroll: (scrollPos) => {
|
|
339
|
+
if (context.viewport) context.viewport.scrollTop = scrollPos;
|
|
340
|
+
},
|
|
341
|
+
onDragScroll: (pointerPos) => {
|
|
342
|
+
if (context.viewport) context.viewport.scrollTop = getScrollPosition(pointerPos);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
);
|
|
346
|
+
}
|
|
347
|
+
return null;
|
|
348
|
+
});
|
|
349
|
+
var ScrollAreaScrollbarX = React__namespace.forwardRef((props, forwardedRef) => {
|
|
350
|
+
const { sizes, onSizesChange, ...scrollbarProps } = props;
|
|
351
|
+
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
352
|
+
const [computedStyle, setComputedStyle] = React__namespace.useState();
|
|
353
|
+
const ref = React__namespace.useRef(null);
|
|
354
|
+
const composeRefs = index.useComposedRefs(forwardedRef, ref, context.onScrollbarXChange);
|
|
355
|
+
React__namespace.useEffect(() => {
|
|
356
|
+
if (ref.current) setComputedStyle(getComputedStyle(ref.current));
|
|
357
|
+
}, [ref]);
|
|
358
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
359
|
+
ScrollAreaScrollbarImpl,
|
|
360
|
+
{
|
|
361
|
+
"data-orientation": "horizontal",
|
|
362
|
+
...scrollbarProps,
|
|
363
|
+
ref: composeRefs,
|
|
364
|
+
sizes,
|
|
365
|
+
style: {
|
|
366
|
+
bottom: 0,
|
|
367
|
+
left: context.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0,
|
|
368
|
+
right: context.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0,
|
|
369
|
+
["--radix-scroll-area-thumb-width"]: getThumbSize(sizes) + "px",
|
|
370
|
+
...props.style
|
|
371
|
+
},
|
|
372
|
+
onThumbPointerDown: (pointerPos) => props.onThumbPointerDown(pointerPos.x),
|
|
373
|
+
onDragScroll: (pointerPos) => props.onDragScroll(pointerPos.x),
|
|
374
|
+
onWheelScroll: (event, maxScrollPos) => {
|
|
375
|
+
if (context.viewport) {
|
|
376
|
+
const scrollPos = context.viewport.scrollLeft + event.deltaX;
|
|
377
|
+
props.onWheelScroll(scrollPos);
|
|
378
|
+
if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) {
|
|
379
|
+
event.preventDefault();
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
onResize: () => {
|
|
384
|
+
if (ref.current && context.viewport && computedStyle) {
|
|
385
|
+
onSizesChange({
|
|
386
|
+
content: context.viewport.scrollWidth,
|
|
387
|
+
viewport: context.viewport.offsetWidth,
|
|
388
|
+
scrollbar: {
|
|
389
|
+
size: ref.current.clientWidth,
|
|
390
|
+
paddingStart: toInt(computedStyle.paddingLeft),
|
|
391
|
+
paddingEnd: toInt(computedStyle.paddingRight)
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
);
|
|
398
|
+
});
|
|
399
|
+
var ScrollAreaScrollbarY = React__namespace.forwardRef((props, forwardedRef) => {
|
|
400
|
+
const { sizes, onSizesChange, ...scrollbarProps } = props;
|
|
401
|
+
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
402
|
+
const [computedStyle, setComputedStyle] = React__namespace.useState();
|
|
403
|
+
const ref = React__namespace.useRef(null);
|
|
404
|
+
const composeRefs = index.useComposedRefs(forwardedRef, ref, context.onScrollbarYChange);
|
|
405
|
+
React__namespace.useEffect(() => {
|
|
406
|
+
if (ref.current) setComputedStyle(getComputedStyle(ref.current));
|
|
407
|
+
}, [ref]);
|
|
408
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
409
|
+
ScrollAreaScrollbarImpl,
|
|
410
|
+
{
|
|
411
|
+
"data-orientation": "vertical",
|
|
412
|
+
...scrollbarProps,
|
|
413
|
+
ref: composeRefs,
|
|
414
|
+
sizes,
|
|
415
|
+
style: {
|
|
416
|
+
top: 0,
|
|
417
|
+
right: context.dir === "ltr" ? 0 : void 0,
|
|
418
|
+
left: context.dir === "rtl" ? 0 : void 0,
|
|
419
|
+
bottom: "var(--radix-scroll-area-corner-height)",
|
|
420
|
+
["--radix-scroll-area-thumb-height"]: getThumbSize(sizes) + "px",
|
|
421
|
+
...props.style
|
|
422
|
+
},
|
|
423
|
+
onThumbPointerDown: (pointerPos) => props.onThumbPointerDown(pointerPos.y),
|
|
424
|
+
onDragScroll: (pointerPos) => props.onDragScroll(pointerPos.y),
|
|
425
|
+
onWheelScroll: (event, maxScrollPos) => {
|
|
426
|
+
if (context.viewport) {
|
|
427
|
+
const scrollPos = context.viewport.scrollTop + event.deltaY;
|
|
428
|
+
props.onWheelScroll(scrollPos);
|
|
429
|
+
if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) {
|
|
430
|
+
event.preventDefault();
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
},
|
|
434
|
+
onResize: () => {
|
|
435
|
+
if (ref.current && context.viewport && computedStyle) {
|
|
436
|
+
onSizesChange({
|
|
437
|
+
content: context.viewport.scrollHeight,
|
|
438
|
+
viewport: context.viewport.offsetHeight,
|
|
439
|
+
scrollbar: {
|
|
440
|
+
size: ref.current.clientHeight,
|
|
441
|
+
paddingStart: toInt(computedStyle.paddingTop),
|
|
442
|
+
paddingEnd: toInt(computedStyle.paddingBottom)
|
|
443
|
+
}
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
);
|
|
449
|
+
});
|
|
450
|
+
var [ScrollbarProvider, useScrollbarContext] = createScrollAreaContext(SCROLLBAR_NAME);
|
|
451
|
+
var ScrollAreaScrollbarImpl = React__namespace.forwardRef((props, forwardedRef) => {
|
|
452
|
+
const {
|
|
453
|
+
__scopeScrollArea,
|
|
454
|
+
sizes,
|
|
455
|
+
hasThumb,
|
|
456
|
+
onThumbChange,
|
|
457
|
+
onThumbPointerUp,
|
|
458
|
+
onThumbPointerDown,
|
|
459
|
+
onThumbPositionChange,
|
|
460
|
+
onDragScroll,
|
|
461
|
+
onWheelScroll,
|
|
462
|
+
onResize,
|
|
463
|
+
...scrollbarProps
|
|
464
|
+
} = props;
|
|
465
|
+
const context = useScrollAreaContext(SCROLLBAR_NAME, __scopeScrollArea);
|
|
466
|
+
const [scrollbar, setScrollbar] = React__namespace.useState(null);
|
|
467
|
+
const composeRefs = index.useComposedRefs(forwardedRef, (node) => setScrollbar(node));
|
|
468
|
+
const rectRef = React__namespace.useRef(null);
|
|
469
|
+
const prevWebkitUserSelectRef = React__namespace.useRef("");
|
|
470
|
+
const viewport = context.viewport;
|
|
471
|
+
const maxScrollPos = sizes.content - sizes.viewport;
|
|
472
|
+
const handleWheelScroll = index$6.useCallbackRef(onWheelScroll);
|
|
473
|
+
const handleThumbPositionChange = index$6.useCallbackRef(onThumbPositionChange);
|
|
474
|
+
const handleResize = useDebounceCallback(onResize, 10);
|
|
475
|
+
function handleDragScroll(event) {
|
|
476
|
+
if (rectRef.current) {
|
|
477
|
+
const x = event.clientX - rectRef.current.left;
|
|
478
|
+
const y = event.clientY - rectRef.current.top;
|
|
479
|
+
onDragScroll({ x, y });
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
React__namespace.useEffect(() => {
|
|
483
|
+
const handleWheel = (event) => {
|
|
484
|
+
const element = event.target;
|
|
485
|
+
const isScrollbarWheel = scrollbar?.contains(element);
|
|
486
|
+
if (isScrollbarWheel) handleWheelScroll(event, maxScrollPos);
|
|
487
|
+
};
|
|
488
|
+
document.addEventListener("wheel", handleWheel, { passive: false });
|
|
489
|
+
return () => document.removeEventListener("wheel", handleWheel, { passive: false });
|
|
490
|
+
}, [viewport, scrollbar, maxScrollPos, handleWheelScroll]);
|
|
491
|
+
React__namespace.useEffect(handleThumbPositionChange, [sizes, handleThumbPositionChange]);
|
|
492
|
+
useResizeObserver(scrollbar, handleResize);
|
|
493
|
+
useResizeObserver(context.content, handleResize);
|
|
494
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
495
|
+
ScrollbarProvider,
|
|
496
|
+
{
|
|
497
|
+
scope: __scopeScrollArea,
|
|
498
|
+
scrollbar,
|
|
499
|
+
hasThumb,
|
|
500
|
+
onThumbChange: index$6.useCallbackRef(onThumbChange),
|
|
501
|
+
onThumbPointerUp: index$6.useCallbackRef(onThumbPointerUp),
|
|
502
|
+
onThumbPositionChange: handleThumbPositionChange,
|
|
503
|
+
onThumbPointerDown: index$6.useCallbackRef(onThumbPointerDown),
|
|
504
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
505
|
+
index$3.Primitive.div,
|
|
506
|
+
{
|
|
507
|
+
...scrollbarProps,
|
|
508
|
+
ref: composeRefs,
|
|
509
|
+
style: { position: "absolute", ...scrollbarProps.style },
|
|
510
|
+
onPointerDown: index$5.composeEventHandlers(props.onPointerDown, (event) => {
|
|
511
|
+
const mainPointer = 0;
|
|
512
|
+
if (event.button === mainPointer) {
|
|
513
|
+
const element = event.target;
|
|
514
|
+
element.setPointerCapture(event.pointerId);
|
|
515
|
+
rectRef.current = scrollbar.getBoundingClientRect();
|
|
516
|
+
prevWebkitUserSelectRef.current = document.body.style.webkitUserSelect;
|
|
517
|
+
document.body.style.webkitUserSelect = "none";
|
|
518
|
+
if (context.viewport) context.viewport.style.scrollBehavior = "auto";
|
|
519
|
+
handleDragScroll(event);
|
|
520
|
+
}
|
|
521
|
+
}),
|
|
522
|
+
onPointerMove: index$5.composeEventHandlers(props.onPointerMove, handleDragScroll),
|
|
523
|
+
onPointerUp: index$5.composeEventHandlers(props.onPointerUp, (event) => {
|
|
524
|
+
const element = event.target;
|
|
525
|
+
if (element.hasPointerCapture(event.pointerId)) {
|
|
526
|
+
element.releasePointerCapture(event.pointerId);
|
|
527
|
+
}
|
|
528
|
+
document.body.style.webkitUserSelect = prevWebkitUserSelectRef.current;
|
|
529
|
+
if (context.viewport) context.viewport.style.scrollBehavior = "";
|
|
530
|
+
rectRef.current = null;
|
|
531
|
+
})
|
|
532
|
+
}
|
|
533
|
+
)
|
|
534
|
+
}
|
|
535
|
+
);
|
|
536
|
+
});
|
|
537
|
+
var THUMB_NAME = "ScrollAreaThumb";
|
|
538
|
+
var ScrollAreaThumb = React__namespace.forwardRef(
|
|
539
|
+
(props, forwardedRef) => {
|
|
540
|
+
const { forceMount, ...thumbProps } = props;
|
|
541
|
+
const scrollbarContext = useScrollbarContext(THUMB_NAME, props.__scopeScrollArea);
|
|
542
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index$4.Presence, { present: forceMount || scrollbarContext.hasThumb, children: /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaThumbImpl, { ref: forwardedRef, ...thumbProps }) });
|
|
543
|
+
}
|
|
544
|
+
);
|
|
545
|
+
var ScrollAreaThumbImpl = React__namespace.forwardRef(
|
|
546
|
+
(props, forwardedRef) => {
|
|
547
|
+
const { __scopeScrollArea, style, ...thumbProps } = props;
|
|
548
|
+
const scrollAreaContext = useScrollAreaContext(THUMB_NAME, __scopeScrollArea);
|
|
549
|
+
const scrollbarContext = useScrollbarContext(THUMB_NAME, __scopeScrollArea);
|
|
550
|
+
const { onThumbPositionChange } = scrollbarContext;
|
|
551
|
+
const composedRef = index.useComposedRefs(
|
|
552
|
+
forwardedRef,
|
|
553
|
+
(node) => scrollbarContext.onThumbChange(node)
|
|
554
|
+
);
|
|
555
|
+
const removeUnlinkedScrollListenerRef = React__namespace.useRef(void 0);
|
|
556
|
+
const debounceScrollEnd = useDebounceCallback(() => {
|
|
557
|
+
if (removeUnlinkedScrollListenerRef.current) {
|
|
558
|
+
removeUnlinkedScrollListenerRef.current();
|
|
559
|
+
removeUnlinkedScrollListenerRef.current = void 0;
|
|
560
|
+
}
|
|
561
|
+
}, 100);
|
|
562
|
+
React__namespace.useEffect(() => {
|
|
563
|
+
const viewport = scrollAreaContext.viewport;
|
|
564
|
+
if (viewport) {
|
|
565
|
+
const handleScroll = () => {
|
|
566
|
+
debounceScrollEnd();
|
|
567
|
+
if (!removeUnlinkedScrollListenerRef.current) {
|
|
568
|
+
const listener = addUnlinkedScrollListener(viewport, onThumbPositionChange);
|
|
569
|
+
removeUnlinkedScrollListenerRef.current = listener;
|
|
570
|
+
onThumbPositionChange();
|
|
571
|
+
}
|
|
572
|
+
};
|
|
573
|
+
onThumbPositionChange();
|
|
574
|
+
viewport.addEventListener("scroll", handleScroll);
|
|
575
|
+
return () => viewport.removeEventListener("scroll", handleScroll);
|
|
576
|
+
}
|
|
577
|
+
}, [scrollAreaContext.viewport, debounceScrollEnd, onThumbPositionChange]);
|
|
578
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
579
|
+
index$3.Primitive.div,
|
|
580
|
+
{
|
|
581
|
+
"data-state": scrollbarContext.hasThumb ? "visible" : "hidden",
|
|
582
|
+
...thumbProps,
|
|
583
|
+
ref: composedRef,
|
|
584
|
+
style: {
|
|
585
|
+
width: "var(--radix-scroll-area-thumb-width)",
|
|
586
|
+
height: "var(--radix-scroll-area-thumb-height)",
|
|
587
|
+
...style
|
|
588
|
+
},
|
|
589
|
+
onPointerDownCapture: index$5.composeEventHandlers(props.onPointerDownCapture, (event) => {
|
|
590
|
+
const thumb = event.target;
|
|
591
|
+
const thumbRect = thumb.getBoundingClientRect();
|
|
592
|
+
const x = event.clientX - thumbRect.left;
|
|
593
|
+
const y = event.clientY - thumbRect.top;
|
|
594
|
+
scrollbarContext.onThumbPointerDown({ x, y });
|
|
595
|
+
}),
|
|
596
|
+
onPointerUp: index$5.composeEventHandlers(props.onPointerUp, scrollbarContext.onThumbPointerUp)
|
|
597
|
+
}
|
|
598
|
+
);
|
|
599
|
+
}
|
|
600
|
+
);
|
|
601
|
+
ScrollAreaThumb.displayName = THUMB_NAME;
|
|
602
|
+
var CORNER_NAME = "ScrollAreaCorner";
|
|
603
|
+
var ScrollAreaCorner = React__namespace.forwardRef(
|
|
604
|
+
(props, forwardedRef) => {
|
|
605
|
+
const context = useScrollAreaContext(CORNER_NAME, props.__scopeScrollArea);
|
|
606
|
+
const hasBothScrollbarsVisible = Boolean(context.scrollbarX && context.scrollbarY);
|
|
607
|
+
const hasCorner = context.type !== "scroll" && hasBothScrollbarsVisible;
|
|
608
|
+
return hasCorner ? /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaCornerImpl, { ...props, ref: forwardedRef }) : null;
|
|
609
|
+
}
|
|
610
|
+
);
|
|
611
|
+
ScrollAreaCorner.displayName = CORNER_NAME;
|
|
612
|
+
var ScrollAreaCornerImpl = React__namespace.forwardRef((props, forwardedRef) => {
|
|
613
|
+
const { __scopeScrollArea, ...cornerProps } = props;
|
|
614
|
+
const context = useScrollAreaContext(CORNER_NAME, __scopeScrollArea);
|
|
615
|
+
const [width, setWidth] = React__namespace.useState(0);
|
|
616
|
+
const [height, setHeight] = React__namespace.useState(0);
|
|
617
|
+
const hasSize = Boolean(width && height);
|
|
618
|
+
useResizeObserver(context.scrollbarX, () => {
|
|
619
|
+
const height2 = context.scrollbarX?.offsetHeight || 0;
|
|
620
|
+
context.onCornerHeightChange(height2);
|
|
621
|
+
setHeight(height2);
|
|
622
|
+
});
|
|
623
|
+
useResizeObserver(context.scrollbarY, () => {
|
|
624
|
+
const width2 = context.scrollbarY?.offsetWidth || 0;
|
|
625
|
+
context.onCornerWidthChange(width2);
|
|
626
|
+
setWidth(width2);
|
|
627
|
+
});
|
|
628
|
+
return hasSize ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
629
|
+
index$3.Primitive.div,
|
|
630
|
+
{
|
|
631
|
+
...cornerProps,
|
|
632
|
+
ref: forwardedRef,
|
|
633
|
+
style: {
|
|
634
|
+
width,
|
|
635
|
+
height,
|
|
636
|
+
position: "absolute",
|
|
637
|
+
right: context.dir === "ltr" ? 0 : void 0,
|
|
638
|
+
left: context.dir === "rtl" ? 0 : void 0,
|
|
639
|
+
bottom: 0,
|
|
640
|
+
...props.style
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
) : null;
|
|
644
|
+
});
|
|
645
|
+
function toInt(value) {
|
|
646
|
+
return value ? parseInt(value, 10) : 0;
|
|
647
|
+
}
|
|
648
|
+
function getThumbRatio(viewportSize, contentSize) {
|
|
649
|
+
const ratio = viewportSize / contentSize;
|
|
650
|
+
return isNaN(ratio) ? 0 : ratio;
|
|
651
|
+
}
|
|
652
|
+
function getThumbSize(sizes) {
|
|
653
|
+
const ratio = getThumbRatio(sizes.viewport, sizes.content);
|
|
654
|
+
const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;
|
|
655
|
+
const thumbSize = (sizes.scrollbar.size - scrollbarPadding) * ratio;
|
|
656
|
+
return Math.max(thumbSize, 18);
|
|
657
|
+
}
|
|
658
|
+
function getScrollPositionFromPointer(pointerPos, pointerOffset, sizes, dir = "ltr") {
|
|
659
|
+
const thumbSizePx = getThumbSize(sizes);
|
|
660
|
+
const thumbCenter = thumbSizePx / 2;
|
|
661
|
+
const offset = pointerOffset || thumbCenter;
|
|
662
|
+
const thumbOffsetFromEnd = thumbSizePx - offset;
|
|
663
|
+
const minPointerPos = sizes.scrollbar.paddingStart + offset;
|
|
664
|
+
const maxPointerPos = sizes.scrollbar.size - sizes.scrollbar.paddingEnd - thumbOffsetFromEnd;
|
|
665
|
+
const maxScrollPos = sizes.content - sizes.viewport;
|
|
666
|
+
const scrollRange = dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0];
|
|
667
|
+
const interpolate = linearScale([minPointerPos, maxPointerPos], scrollRange);
|
|
668
|
+
return interpolate(pointerPos);
|
|
669
|
+
}
|
|
670
|
+
function getThumbOffsetFromScroll(scrollPos, sizes, dir = "ltr") {
|
|
671
|
+
const thumbSizePx = getThumbSize(sizes);
|
|
672
|
+
const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;
|
|
673
|
+
const scrollbar = sizes.scrollbar.size - scrollbarPadding;
|
|
674
|
+
const maxScrollPos = sizes.content - sizes.viewport;
|
|
675
|
+
const maxThumbPos = scrollbar - thumbSizePx;
|
|
676
|
+
const scrollClampRange = dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0];
|
|
677
|
+
const scrollWithoutMomentum = index$8.clamp(scrollPos, scrollClampRange);
|
|
678
|
+
const interpolate = linearScale([0, maxScrollPos], [0, maxThumbPos]);
|
|
679
|
+
return interpolate(scrollWithoutMomentum);
|
|
680
|
+
}
|
|
681
|
+
function linearScale(input, output) {
|
|
682
|
+
return (value) => {
|
|
683
|
+
if (input[0] === input[1] || output[0] === output[1]) return output[0];
|
|
684
|
+
const ratio = (output[1] - output[0]) / (input[1] - input[0]);
|
|
685
|
+
return output[0] + ratio * (value - input[0]);
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
function isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos) {
|
|
689
|
+
return scrollPos > 0 && scrollPos < maxScrollPos;
|
|
690
|
+
}
|
|
691
|
+
var addUnlinkedScrollListener = (node, handler = () => {
|
|
692
|
+
}) => {
|
|
693
|
+
let prevPosition = { left: node.scrollLeft, top: node.scrollTop };
|
|
694
|
+
let rAF = 0;
|
|
695
|
+
(function loop() {
|
|
696
|
+
const position = { left: node.scrollLeft, top: node.scrollTop };
|
|
697
|
+
const isHorizontalScroll = prevPosition.left !== position.left;
|
|
698
|
+
const isVerticalScroll = prevPosition.top !== position.top;
|
|
699
|
+
if (isHorizontalScroll || isVerticalScroll) handler();
|
|
700
|
+
prevPosition = position;
|
|
701
|
+
rAF = window.requestAnimationFrame(loop);
|
|
702
|
+
})();
|
|
703
|
+
return () => window.cancelAnimationFrame(rAF);
|
|
704
|
+
};
|
|
705
|
+
function useDebounceCallback(callback, delay) {
|
|
706
|
+
const handleCallback = index$6.useCallbackRef(callback);
|
|
707
|
+
const debounceTimerRef = React__namespace.useRef(0);
|
|
708
|
+
React__namespace.useEffect(() => () => window.clearTimeout(debounceTimerRef.current), []);
|
|
709
|
+
return React__namespace.useCallback(() => {
|
|
710
|
+
window.clearTimeout(debounceTimerRef.current);
|
|
711
|
+
debounceTimerRef.current = window.setTimeout(handleCallback, delay);
|
|
712
|
+
}, [handleCallback, delay]);
|
|
713
|
+
}
|
|
714
|
+
function useResizeObserver(element, onResize) {
|
|
715
|
+
const handleResize = index$6.useCallbackRef(onResize);
|
|
716
|
+
index$7.useLayoutEffect(() => {
|
|
717
|
+
let rAF = 0;
|
|
718
|
+
if (element) {
|
|
719
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
720
|
+
cancelAnimationFrame(rAF);
|
|
721
|
+
rAF = window.requestAnimationFrame(handleResize);
|
|
722
|
+
});
|
|
723
|
+
resizeObserver.observe(element);
|
|
724
|
+
return () => {
|
|
725
|
+
window.cancelAnimationFrame(rAF);
|
|
726
|
+
resizeObserver.unobserve(element);
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
}, [element, handleResize]);
|
|
730
|
+
}
|
|
731
|
+
var Root = ScrollArea;
|
|
732
|
+
var Viewport = ScrollAreaViewport;
|
|
733
|
+
var Corner = ScrollAreaCorner;
|
|
734
|
+
|
|
735
|
+
exports.Corner = Corner;
|
|
736
|
+
exports.Root = Root;
|
|
737
|
+
exports.ScrollArea = ScrollArea;
|
|
738
|
+
exports.ScrollAreaCorner = ScrollAreaCorner;
|
|
739
|
+
exports.ScrollAreaScrollbar = ScrollAreaScrollbar;
|
|
740
|
+
exports.ScrollAreaThumb = ScrollAreaThumb;
|
|
741
|
+
exports.ScrollAreaViewport = ScrollAreaViewport;
|
|
742
|
+
exports.Viewport = Viewport;
|