@btst/stack 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +85 -37
- 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-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 +315 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-interface.mjs +313 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-layout.cjs +122 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-layout.mjs +120 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-message.cjs +397 -0
- package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-message.mjs +391 -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/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/api/plugin.cjs +8 -2
- package/dist/packages/better-stack/src/plugins/blog/api/plugin.mjs +8 -2
- package/dist/packages/better-stack/src/plugins/blog/client/components/pages/post-page.internal.cjs +1 -1
- package/dist/packages/better-stack/src/plugins/blog/client/components/pages/post-page.internal.mjs +1 -1
- 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/on-this-page.cjs +1 -1
- package/dist/packages/better-stack/src/plugins/blog/client/components/shared/on-this-page.mjs +1 -1
- 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/better-stack/src/plugins/blog/client/components/shared/recent-posts-carousel.cjs +2 -2
- package/dist/packages/better-stack/src/plugins/blog/client/components/shared/recent-posts-carousel.mjs +2 -2
- 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 +27 -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 +11 -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 +19 -0
- package/dist/plugins/ai-chat/client/index.d.cts +327 -0
- package/dist/plugins/ai-chat/client/index.d.mts +327 -0
- package/dist/plugins/ai-chat/client/index.d.ts +327 -0
- package/dist/plugins/ai-chat/client/index.mjs +7 -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 +85 -62
- package/dist/plugins/blog/client/hooks/index.d.cts +2 -2
- package/dist/plugins/blog/client/hooks/index.d.mts +2 -2
- package/dist/plugins/blog/client/hooks/index.d.ts +2 -2
- 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 +2 -2
- package/dist/plugins/blog/query-keys.d.mts +2 -2
- package/dist/plugins/blog/query-keys.d.ts +2 -2
- 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.DorMi9CZ.d.cts +80 -0
- package/dist/shared/stack.DorMi9CZ.d.mts +80 -0
- package/dist/shared/stack.DorMi9CZ.d.ts +80 -0
- package/package.json +61 -3
- 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 +455 -0
- package/src/plugins/ai-chat/client/components/chat-layout.tsx +160 -0
- package/src/plugins/ai-chat/client/components/chat-message.tsx +505 -0
- package/src/plugins/ai-chat/client/components/chat-sidebar.tsx +296 -0
- package/src/plugins/ai-chat/client/components/index.ts +16 -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/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 +14 -0
- package/src/plugins/ai-chat/client/localization/index.ts +156 -0
- package/src/plugins/ai-chat/client/overrides.ts +170 -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/api/plugin.ts +10 -4
- package/src/plugins/blog/client/components/pages/post-page.internal.tsx +1 -1
- package/src/plugins/blog/client/components/shared/markdown-content-styles.css +85 -62
- package/src/plugins/blog/client/components/shared/markdown-content.tsx +19 -427
- package/src/plugins/blog/client/components/shared/on-this-page.tsx +1 -1
- package/src/plugins/blog/client/components/shared/page-wrapper.tsx +2 -2
- package/src/plugins/blog/client/components/shared/recent-posts-carousel.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.DLhzx1-D.d.ts → stack.CcI4sYJP.d.cts} +1 -1
- package/dist/shared/{stack.DLhzx1-D.d.cts → stack.CcI4sYJP.d.mts} +1 -1
- package/dist/shared/{stack.DLhzx1-D.d.mts → stack.CcI4sYJP.d.ts} +1 -1
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
const React = require('react');
|
|
5
5
|
const floatingUi_reactDom = require('../../../../../@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');
|
|
6
|
-
const index$6 = require('../../../../../@radix-ui_react-arrow@1.1.7_@types_react-dom@19.2.
|
|
7
|
-
const index$1 = require('../../../../../@radix-ui_react-compose-refs@1.1.2_@types_react@19.2.
|
|
8
|
-
const index = require('../../../../../@radix-ui_react-context@1.1.2_@types_react@19.2.
|
|
9
|
-
const index$2 = require('../../../../../@radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.
|
|
10
|
-
const index$4 = require('../../../../../@radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.
|
|
11
|
-
const index$5 = require('../../../../../@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.
|
|
12
|
-
const index$3 = require('../../../../../@radix-ui_react-use-size@1.1.1_@types_react@19.2.
|
|
6
|
+
const index$6 = require('../../../../../@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');
|
|
7
|
+
const index$1 = 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');
|
|
8
|
+
const index = 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');
|
|
9
|
+
const index$2 = 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');
|
|
10
|
+
const index$4 = 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');
|
|
11
|
+
const index$5 = 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$3 = require('../../../../../@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');
|
|
13
13
|
const jsxRuntime = require('react/jsx-runtime');
|
|
14
14
|
const floatingUi_dom = require('../../../../../@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.cjs');
|
|
15
15
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useFloating, offset, shift, flip, size, arrow, hide, limitShift } from '../../../../../@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';
|
|
4
|
-
import { Root } from '../../../../../@radix-ui_react-arrow@1.1.7_@types_react-dom@19.2.
|
|
5
|
-
import { useComposedRefs } from '../../../../../@radix-ui_react-compose-refs@1.1.2_@types_react@19.2.
|
|
6
|
-
import { createContextScope } from '../../../../../@radix-ui_react-context@1.1.2_@types_react@19.2.
|
|
7
|
-
import { Primitive } from '../../../../../@radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.
|
|
8
|
-
import { useCallbackRef } from '../../../../../@radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.
|
|
9
|
-
import { useLayoutEffect as useLayoutEffect2 } from '../../../../../@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.
|
|
10
|
-
import { useSize } from '../../../../../@radix-ui_react-use-size@1.1.1_@types_react@19.2.
|
|
4
|
+
import { Root } from '../../../../../@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';
|
|
5
|
+
import { useComposedRefs } from '../../../../../@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';
|
|
6
|
+
import { createContextScope } from '../../../../../@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';
|
|
7
|
+
import { Primitive } from '../../../../../@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';
|
|
8
|
+
import { useCallbackRef } from '../../../../../@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';
|
|
9
|
+
import { useLayoutEffect as useLayoutEffect2 } from '../../../../../@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';
|
|
10
|
+
import { useSize } from '../../../../../@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';
|
|
11
11
|
import { jsx } from 'react/jsx-runtime';
|
|
12
12
|
import { autoUpdate } from '../../../../../@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs';
|
|
13
13
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
const React = require('react');
|
|
5
5
|
const ReactDOM = require('react-dom');
|
|
6
|
-
const index$1 = require('../../../../../@radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.
|
|
7
|
-
const index = require('../../../../../@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.
|
|
6
|
+
const index$1 = 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');
|
|
7
|
+
const index = 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');
|
|
8
8
|
const jsxRuntime = require('react/jsx-runtime');
|
|
9
9
|
|
|
10
10
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import ReactDOM__default from 'react-dom';
|
|
4
|
-
import { Primitive } from '../../../../../@radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.
|
|
5
|
-
import { useLayoutEffect as useLayoutEffect2 } from '../../../../../@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.
|
|
4
|
+
import { Primitive } from '../../../../../@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';
|
|
5
|
+
import { useLayoutEffect as useLayoutEffect2 } from '../../../../../@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';
|
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
var PORTAL_NAME = "Portal";
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const React = require('react');
|
|
5
|
+
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');
|
|
6
|
+
const index$1 = 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');
|
|
7
|
+
|
|
8
|
+
function _interopNamespaceCompat(e) {
|
|
9
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
10
|
+
const n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
for (const k in e) {
|
|
13
|
+
n[k] = e[k];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
n.default = e;
|
|
17
|
+
return n;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
|
|
21
|
+
|
|
22
|
+
function useStateMachine(initialState, machine) {
|
|
23
|
+
return React__namespace.useReducer((state, event) => {
|
|
24
|
+
const nextState = machine[state][event];
|
|
25
|
+
return nextState ?? state;
|
|
26
|
+
}, initialState);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// src/presence.tsx
|
|
30
|
+
var Presence = (props) => {
|
|
31
|
+
const { present, children } = props;
|
|
32
|
+
const presence = usePresence(present);
|
|
33
|
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React__namespace.Children.only(children);
|
|
34
|
+
const ref = index.useComposedRefs(presence.ref, getElementRef(child));
|
|
35
|
+
const forceMount = typeof children === "function";
|
|
36
|
+
return forceMount || presence.isPresent ? React__namespace.cloneElement(child, { ref }) : null;
|
|
37
|
+
};
|
|
38
|
+
Presence.displayName = "Presence";
|
|
39
|
+
function usePresence(present) {
|
|
40
|
+
const [node, setNode] = React__namespace.useState();
|
|
41
|
+
const stylesRef = React__namespace.useRef(null);
|
|
42
|
+
const prevPresentRef = React__namespace.useRef(present);
|
|
43
|
+
const prevAnimationNameRef = React__namespace.useRef("none");
|
|
44
|
+
const initialState = present ? "mounted" : "unmounted";
|
|
45
|
+
const [state, send] = useStateMachine(initialState, {
|
|
46
|
+
mounted: {
|
|
47
|
+
UNMOUNT: "unmounted",
|
|
48
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
49
|
+
},
|
|
50
|
+
unmountSuspended: {
|
|
51
|
+
MOUNT: "mounted",
|
|
52
|
+
ANIMATION_END: "unmounted"
|
|
53
|
+
},
|
|
54
|
+
unmounted: {
|
|
55
|
+
MOUNT: "mounted"
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
React__namespace.useEffect(() => {
|
|
59
|
+
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
60
|
+
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
61
|
+
}, [state]);
|
|
62
|
+
index$1.useLayoutEffect(() => {
|
|
63
|
+
const styles = stylesRef.current;
|
|
64
|
+
const wasPresent = prevPresentRef.current;
|
|
65
|
+
const hasPresentChanged = wasPresent !== present;
|
|
66
|
+
if (hasPresentChanged) {
|
|
67
|
+
const prevAnimationName = prevAnimationNameRef.current;
|
|
68
|
+
const currentAnimationName = getAnimationName(styles);
|
|
69
|
+
if (present) {
|
|
70
|
+
send("MOUNT");
|
|
71
|
+
} else if (currentAnimationName === "none" || styles?.display === "none") {
|
|
72
|
+
send("UNMOUNT");
|
|
73
|
+
} else {
|
|
74
|
+
const isAnimating = prevAnimationName !== currentAnimationName;
|
|
75
|
+
if (wasPresent && isAnimating) {
|
|
76
|
+
send("ANIMATION_OUT");
|
|
77
|
+
} else {
|
|
78
|
+
send("UNMOUNT");
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
prevPresentRef.current = present;
|
|
82
|
+
}
|
|
83
|
+
}, [present, send]);
|
|
84
|
+
index$1.useLayoutEffect(() => {
|
|
85
|
+
if (node) {
|
|
86
|
+
let timeoutId;
|
|
87
|
+
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
|
88
|
+
const handleAnimationEnd = (event) => {
|
|
89
|
+
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
90
|
+
const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
|
|
91
|
+
if (event.target === node && isCurrentAnimation) {
|
|
92
|
+
send("ANIMATION_END");
|
|
93
|
+
if (!prevPresentRef.current) {
|
|
94
|
+
const currentFillMode = node.style.animationFillMode;
|
|
95
|
+
node.style.animationFillMode = "forwards";
|
|
96
|
+
timeoutId = ownerWindow.setTimeout(() => {
|
|
97
|
+
if (node.style.animationFillMode === "forwards") {
|
|
98
|
+
node.style.animationFillMode = currentFillMode;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
const handleAnimationStart = (event) => {
|
|
105
|
+
if (event.target === node) {
|
|
106
|
+
prevAnimationNameRef.current = getAnimationName(stylesRef.current);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
node.addEventListener("animationstart", handleAnimationStart);
|
|
110
|
+
node.addEventListener("animationcancel", handleAnimationEnd);
|
|
111
|
+
node.addEventListener("animationend", handleAnimationEnd);
|
|
112
|
+
return () => {
|
|
113
|
+
ownerWindow.clearTimeout(timeoutId);
|
|
114
|
+
node.removeEventListener("animationstart", handleAnimationStart);
|
|
115
|
+
node.removeEventListener("animationcancel", handleAnimationEnd);
|
|
116
|
+
node.removeEventListener("animationend", handleAnimationEnd);
|
|
117
|
+
};
|
|
118
|
+
} else {
|
|
119
|
+
send("ANIMATION_END");
|
|
120
|
+
}
|
|
121
|
+
}, [node, send]);
|
|
122
|
+
return {
|
|
123
|
+
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
124
|
+
ref: React__namespace.useCallback((node2) => {
|
|
125
|
+
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
126
|
+
setNode(node2);
|
|
127
|
+
}, [])
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function getAnimationName(styles) {
|
|
131
|
+
return styles?.animationName || "none";
|
|
132
|
+
}
|
|
133
|
+
function getElementRef(element) {
|
|
134
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
135
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
136
|
+
if (mayWarn) {
|
|
137
|
+
return element.ref;
|
|
138
|
+
}
|
|
139
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
140
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
141
|
+
if (mayWarn) {
|
|
142
|
+
return element.props.ref;
|
|
143
|
+
}
|
|
144
|
+
return element.props.ref || element.ref;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
exports.Presence = Presence;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useComposedRefs } from '../../../../../@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';
|
|
4
|
+
import { useLayoutEffect as useLayoutEffect2 } from '../../../../../@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';
|
|
5
|
+
|
|
6
|
+
function useStateMachine(initialState, machine) {
|
|
7
|
+
return React.useReducer((state, event) => {
|
|
8
|
+
const nextState = machine[state][event];
|
|
9
|
+
return nextState ?? state;
|
|
10
|
+
}, initialState);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// src/presence.tsx
|
|
14
|
+
var Presence = (props) => {
|
|
15
|
+
const { present, children } = props;
|
|
16
|
+
const presence = usePresence(present);
|
|
17
|
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React.Children.only(children);
|
|
18
|
+
const ref = useComposedRefs(presence.ref, getElementRef(child));
|
|
19
|
+
const forceMount = typeof children === "function";
|
|
20
|
+
return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;
|
|
21
|
+
};
|
|
22
|
+
Presence.displayName = "Presence";
|
|
23
|
+
function usePresence(present) {
|
|
24
|
+
const [node, setNode] = React.useState();
|
|
25
|
+
const stylesRef = React.useRef(null);
|
|
26
|
+
const prevPresentRef = React.useRef(present);
|
|
27
|
+
const prevAnimationNameRef = React.useRef("none");
|
|
28
|
+
const initialState = present ? "mounted" : "unmounted";
|
|
29
|
+
const [state, send] = useStateMachine(initialState, {
|
|
30
|
+
mounted: {
|
|
31
|
+
UNMOUNT: "unmounted",
|
|
32
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
33
|
+
},
|
|
34
|
+
unmountSuspended: {
|
|
35
|
+
MOUNT: "mounted",
|
|
36
|
+
ANIMATION_END: "unmounted"
|
|
37
|
+
},
|
|
38
|
+
unmounted: {
|
|
39
|
+
MOUNT: "mounted"
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
React.useEffect(() => {
|
|
43
|
+
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
44
|
+
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
45
|
+
}, [state]);
|
|
46
|
+
useLayoutEffect2(() => {
|
|
47
|
+
const styles = stylesRef.current;
|
|
48
|
+
const wasPresent = prevPresentRef.current;
|
|
49
|
+
const hasPresentChanged = wasPresent !== present;
|
|
50
|
+
if (hasPresentChanged) {
|
|
51
|
+
const prevAnimationName = prevAnimationNameRef.current;
|
|
52
|
+
const currentAnimationName = getAnimationName(styles);
|
|
53
|
+
if (present) {
|
|
54
|
+
send("MOUNT");
|
|
55
|
+
} else if (currentAnimationName === "none" || styles?.display === "none") {
|
|
56
|
+
send("UNMOUNT");
|
|
57
|
+
} else {
|
|
58
|
+
const isAnimating = prevAnimationName !== currentAnimationName;
|
|
59
|
+
if (wasPresent && isAnimating) {
|
|
60
|
+
send("ANIMATION_OUT");
|
|
61
|
+
} else {
|
|
62
|
+
send("UNMOUNT");
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
prevPresentRef.current = present;
|
|
66
|
+
}
|
|
67
|
+
}, [present, send]);
|
|
68
|
+
useLayoutEffect2(() => {
|
|
69
|
+
if (node) {
|
|
70
|
+
let timeoutId;
|
|
71
|
+
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
|
72
|
+
const handleAnimationEnd = (event) => {
|
|
73
|
+
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
74
|
+
const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
|
|
75
|
+
if (event.target === node && isCurrentAnimation) {
|
|
76
|
+
send("ANIMATION_END");
|
|
77
|
+
if (!prevPresentRef.current) {
|
|
78
|
+
const currentFillMode = node.style.animationFillMode;
|
|
79
|
+
node.style.animationFillMode = "forwards";
|
|
80
|
+
timeoutId = ownerWindow.setTimeout(() => {
|
|
81
|
+
if (node.style.animationFillMode === "forwards") {
|
|
82
|
+
node.style.animationFillMode = currentFillMode;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const handleAnimationStart = (event) => {
|
|
89
|
+
if (event.target === node) {
|
|
90
|
+
prevAnimationNameRef.current = getAnimationName(stylesRef.current);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
node.addEventListener("animationstart", handleAnimationStart);
|
|
94
|
+
node.addEventListener("animationcancel", handleAnimationEnd);
|
|
95
|
+
node.addEventListener("animationend", handleAnimationEnd);
|
|
96
|
+
return () => {
|
|
97
|
+
ownerWindow.clearTimeout(timeoutId);
|
|
98
|
+
node.removeEventListener("animationstart", handleAnimationStart);
|
|
99
|
+
node.removeEventListener("animationcancel", handleAnimationEnd);
|
|
100
|
+
node.removeEventListener("animationend", handleAnimationEnd);
|
|
101
|
+
};
|
|
102
|
+
} else {
|
|
103
|
+
send("ANIMATION_END");
|
|
104
|
+
}
|
|
105
|
+
}, [node, send]);
|
|
106
|
+
return {
|
|
107
|
+
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
108
|
+
ref: React.useCallback((node2) => {
|
|
109
|
+
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
110
|
+
setNode(node2);
|
|
111
|
+
}, [])
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function getAnimationName(styles) {
|
|
115
|
+
return styles?.animationName || "none";
|
|
116
|
+
}
|
|
117
|
+
function getElementRef(element) {
|
|
118
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
119
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
120
|
+
if (mayWarn) {
|
|
121
|
+
return element.ref;
|
|
122
|
+
}
|
|
123
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
124
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
125
|
+
if (mayWarn) {
|
|
126
|
+
return element.props.ref;
|
|
127
|
+
}
|
|
128
|
+
return element.props.ref || element.ref;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export { Presence };
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const React = require('react');
|
|
5
|
+
const index$4 = require('../../../../../@radix-ui_primitive@1.1.3/node_modules/@radix-ui/primitive/dist/index.cjs');
|
|
6
|
+
const index$1 = require('../../../../../@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');
|
|
7
|
+
const index$5 = 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');
|
|
8
|
+
const index = 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');
|
|
9
|
+
const index$2 = require('../../../../../@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');
|
|
10
|
+
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');
|
|
11
|
+
const index$8 = 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');
|
|
12
|
+
const index$7 = require('../../../../../@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');
|
|
13
|
+
const index$6 = 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');
|
|
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
|
+
var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
|
|
31
|
+
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
32
|
+
var GROUP_NAME = "RovingFocusGroup";
|
|
33
|
+
var [Collection, useCollection, createCollectionScope] = index$1.createCollection(GROUP_NAME);
|
|
34
|
+
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = index.createContextScope(
|
|
35
|
+
GROUP_NAME,
|
|
36
|
+
[createCollectionScope]
|
|
37
|
+
);
|
|
38
|
+
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
|
|
39
|
+
var RovingFocusGroup = React__namespace.forwardRef(
|
|
40
|
+
(props, forwardedRef) => {
|
|
41
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsxRuntime.jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsxRuntime.jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
RovingFocusGroup.displayName = GROUP_NAME;
|
|
45
|
+
var RovingFocusGroupImpl = React__namespace.forwardRef((props, forwardedRef) => {
|
|
46
|
+
const {
|
|
47
|
+
__scopeRovingFocusGroup,
|
|
48
|
+
orientation,
|
|
49
|
+
loop = false,
|
|
50
|
+
dir,
|
|
51
|
+
currentTabStopId: currentTabStopIdProp,
|
|
52
|
+
defaultCurrentTabStopId,
|
|
53
|
+
onCurrentTabStopIdChange,
|
|
54
|
+
onEntryFocus,
|
|
55
|
+
preventScrollOnEntryFocus = false,
|
|
56
|
+
...groupProps
|
|
57
|
+
} = props;
|
|
58
|
+
const ref = React__namespace.useRef(null);
|
|
59
|
+
const composedRefs = index$5.useComposedRefs(forwardedRef, ref);
|
|
60
|
+
const direction = index$6.useDirection(dir);
|
|
61
|
+
const [currentTabStopId, setCurrentTabStopId] = index$7.useControllableState({
|
|
62
|
+
prop: currentTabStopIdProp,
|
|
63
|
+
defaultProp: defaultCurrentTabStopId ?? null,
|
|
64
|
+
onChange: onCurrentTabStopIdChange,
|
|
65
|
+
caller: GROUP_NAME
|
|
66
|
+
});
|
|
67
|
+
const [isTabbingBackOut, setIsTabbingBackOut] = React__namespace.useState(false);
|
|
68
|
+
const handleEntryFocus = index$8.useCallbackRef(onEntryFocus);
|
|
69
|
+
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
70
|
+
const isClickFocusRef = React__namespace.useRef(false);
|
|
71
|
+
const [focusableItemsCount, setFocusableItemsCount] = React__namespace.useState(0);
|
|
72
|
+
React__namespace.useEffect(() => {
|
|
73
|
+
const node = ref.current;
|
|
74
|
+
if (node) {
|
|
75
|
+
node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
76
|
+
return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
77
|
+
}
|
|
78
|
+
}, [handleEntryFocus]);
|
|
79
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
80
|
+
RovingFocusProvider,
|
|
81
|
+
{
|
|
82
|
+
scope: __scopeRovingFocusGroup,
|
|
83
|
+
orientation,
|
|
84
|
+
dir: direction,
|
|
85
|
+
loop,
|
|
86
|
+
currentTabStopId,
|
|
87
|
+
onItemFocus: React__namespace.useCallback(
|
|
88
|
+
(tabStopId) => setCurrentTabStopId(tabStopId),
|
|
89
|
+
[setCurrentTabStopId]
|
|
90
|
+
),
|
|
91
|
+
onItemShiftTab: React__namespace.useCallback(() => setIsTabbingBackOut(true), []),
|
|
92
|
+
onFocusableItemAdd: React__namespace.useCallback(
|
|
93
|
+
() => setFocusableItemsCount((prevCount) => prevCount + 1),
|
|
94
|
+
[]
|
|
95
|
+
),
|
|
96
|
+
onFocusableItemRemove: React__namespace.useCallback(
|
|
97
|
+
() => setFocusableItemsCount((prevCount) => prevCount - 1),
|
|
98
|
+
[]
|
|
99
|
+
),
|
|
100
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
101
|
+
index$3.Primitive.div,
|
|
102
|
+
{
|
|
103
|
+
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
104
|
+
"data-orientation": orientation,
|
|
105
|
+
...groupProps,
|
|
106
|
+
ref: composedRefs,
|
|
107
|
+
style: { outline: "none", ...props.style },
|
|
108
|
+
onMouseDown: index$4.composeEventHandlers(props.onMouseDown, () => {
|
|
109
|
+
isClickFocusRef.current = true;
|
|
110
|
+
}),
|
|
111
|
+
onFocus: index$4.composeEventHandlers(props.onFocus, (event) => {
|
|
112
|
+
const isKeyboardFocus = !isClickFocusRef.current;
|
|
113
|
+
if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
|
|
114
|
+
const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);
|
|
115
|
+
event.currentTarget.dispatchEvent(entryFocusEvent);
|
|
116
|
+
if (!entryFocusEvent.defaultPrevented) {
|
|
117
|
+
const items = getItems().filter((item) => item.focusable);
|
|
118
|
+
const activeItem = items.find((item) => item.active);
|
|
119
|
+
const currentItem = items.find((item) => item.id === currentTabStopId);
|
|
120
|
+
const candidateItems = [activeItem, currentItem, ...items].filter(
|
|
121
|
+
Boolean
|
|
122
|
+
);
|
|
123
|
+
const candidateNodes = candidateItems.map((item) => item.ref.current);
|
|
124
|
+
focusFirst(candidateNodes, preventScrollOnEntryFocus);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
isClickFocusRef.current = false;
|
|
128
|
+
}),
|
|
129
|
+
onBlur: index$4.composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
});
|
|
135
|
+
var ITEM_NAME = "RovingFocusGroupItem";
|
|
136
|
+
var RovingFocusGroupItem = React__namespace.forwardRef(
|
|
137
|
+
(props, forwardedRef) => {
|
|
138
|
+
const {
|
|
139
|
+
__scopeRovingFocusGroup,
|
|
140
|
+
focusable = true,
|
|
141
|
+
active = false,
|
|
142
|
+
tabStopId,
|
|
143
|
+
children,
|
|
144
|
+
...itemProps
|
|
145
|
+
} = props;
|
|
146
|
+
const autoId = index$2.useId();
|
|
147
|
+
const id = tabStopId || autoId;
|
|
148
|
+
const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);
|
|
149
|
+
const isCurrentTabStop = context.currentTabStopId === id;
|
|
150
|
+
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
151
|
+
const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
|
|
152
|
+
React__namespace.useEffect(() => {
|
|
153
|
+
if (focusable) {
|
|
154
|
+
onFocusableItemAdd();
|
|
155
|
+
return () => onFocusableItemRemove();
|
|
156
|
+
}
|
|
157
|
+
}, [focusable, onFocusableItemAdd, onFocusableItemRemove]);
|
|
158
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
159
|
+
Collection.ItemSlot,
|
|
160
|
+
{
|
|
161
|
+
scope: __scopeRovingFocusGroup,
|
|
162
|
+
id,
|
|
163
|
+
focusable,
|
|
164
|
+
active,
|
|
165
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
166
|
+
index$3.Primitive.span,
|
|
167
|
+
{
|
|
168
|
+
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
169
|
+
"data-orientation": context.orientation,
|
|
170
|
+
...itemProps,
|
|
171
|
+
ref: forwardedRef,
|
|
172
|
+
onMouseDown: index$4.composeEventHandlers(props.onMouseDown, (event) => {
|
|
173
|
+
if (!focusable) event.preventDefault();
|
|
174
|
+
else context.onItemFocus(id);
|
|
175
|
+
}),
|
|
176
|
+
onFocus: index$4.composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),
|
|
177
|
+
onKeyDown: index$4.composeEventHandlers(props.onKeyDown, (event) => {
|
|
178
|
+
if (event.key === "Tab" && event.shiftKey) {
|
|
179
|
+
context.onItemShiftTab();
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
if (event.target !== event.currentTarget) return;
|
|
183
|
+
const focusIntent = getFocusIntent(event, context.orientation, context.dir);
|
|
184
|
+
if (focusIntent !== void 0) {
|
|
185
|
+
if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;
|
|
186
|
+
event.preventDefault();
|
|
187
|
+
const items = getItems().filter((item) => item.focusable);
|
|
188
|
+
let candidateNodes = items.map((item) => item.ref.current);
|
|
189
|
+
if (focusIntent === "last") candidateNodes.reverse();
|
|
190
|
+
else if (focusIntent === "prev" || focusIntent === "next") {
|
|
191
|
+
if (focusIntent === "prev") candidateNodes.reverse();
|
|
192
|
+
const currentIndex = candidateNodes.indexOf(event.currentTarget);
|
|
193
|
+
candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
|
|
194
|
+
}
|
|
195
|
+
setTimeout(() => focusFirst(candidateNodes));
|
|
196
|
+
}
|
|
197
|
+
}),
|
|
198
|
+
children: typeof children === "function" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children
|
|
199
|
+
}
|
|
200
|
+
)
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
);
|
|
205
|
+
RovingFocusGroupItem.displayName = ITEM_NAME;
|
|
206
|
+
var MAP_KEY_TO_FOCUS_INTENT = {
|
|
207
|
+
ArrowLeft: "prev",
|
|
208
|
+
ArrowUp: "prev",
|
|
209
|
+
ArrowRight: "next",
|
|
210
|
+
ArrowDown: "next",
|
|
211
|
+
PageUp: "first",
|
|
212
|
+
Home: "first",
|
|
213
|
+
PageDown: "last",
|
|
214
|
+
End: "last"
|
|
215
|
+
};
|
|
216
|
+
function getDirectionAwareKey(key, dir) {
|
|
217
|
+
if (dir !== "rtl") return key;
|
|
218
|
+
return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
|
|
219
|
+
}
|
|
220
|
+
function getFocusIntent(event, orientation, dir) {
|
|
221
|
+
const key = getDirectionAwareKey(event.key, dir);
|
|
222
|
+
if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0;
|
|
223
|
+
if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0;
|
|
224
|
+
return MAP_KEY_TO_FOCUS_INTENT[key];
|
|
225
|
+
}
|
|
226
|
+
function focusFirst(candidates, preventScroll = false) {
|
|
227
|
+
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
228
|
+
for (const candidate of candidates) {
|
|
229
|
+
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
230
|
+
candidate.focus({ preventScroll });
|
|
231
|
+
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
function wrapArray(array, startIndex) {
|
|
235
|
+
return array.map((_, index) => array[(startIndex + index) % array.length]);
|
|
236
|
+
}
|
|
237
|
+
var Root = RovingFocusGroup;
|
|
238
|
+
var Item = RovingFocusGroupItem;
|
|
239
|
+
|
|
240
|
+
exports.Item = Item;
|
|
241
|
+
exports.Root = Root;
|
|
242
|
+
exports.RovingFocusGroup = RovingFocusGroup;
|
|
243
|
+
exports.RovingFocusGroupItem = RovingFocusGroupItem;
|
|
244
|
+
exports.createRovingFocusGroupScope = createRovingFocusGroupScope;
|