@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
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const client = require('@btst/stack/plugins/client');
|
|
5
|
+
const reactQuery = require('@tanstack/react-query');
|
|
6
|
+
const plugins_aiChat_queryKeys = require('../../../../../../../plugins/ai-chat/query-keys.cjs');
|
|
7
|
+
const context = require('@btst/stack/context');
|
|
8
|
+
|
|
9
|
+
const SHARED_QUERY_CONFIG = {
|
|
10
|
+
retry: false,
|
|
11
|
+
refetchOnWindowFocus: false,
|
|
12
|
+
refetchOnMount: false,
|
|
13
|
+
refetchOnReconnect: false,
|
|
14
|
+
staleTime: 1e3 * 60 * 5,
|
|
15
|
+
// 5 minutes
|
|
16
|
+
gcTime: 1e3 * 60 * 10
|
|
17
|
+
// 10 minutes
|
|
18
|
+
};
|
|
19
|
+
function useConversations(options = {}) {
|
|
20
|
+
const { apiBaseURL, apiBasePath, headers } = context.usePluginOverrides("ai-chat");
|
|
21
|
+
const client$1 = client.createApiClient({
|
|
22
|
+
baseURL: apiBaseURL,
|
|
23
|
+
basePath: apiBasePath
|
|
24
|
+
});
|
|
25
|
+
const { enabled = true } = options;
|
|
26
|
+
const queries = plugins_aiChat_queryKeys.createAiChatQueryKeys(client$1, headers);
|
|
27
|
+
const listQuery = queries.conversations.list();
|
|
28
|
+
const { data, isLoading, error, refetch } = reactQuery.useQuery({
|
|
29
|
+
...listQuery,
|
|
30
|
+
...SHARED_QUERY_CONFIG,
|
|
31
|
+
enabled: enabled && !!client$1
|
|
32
|
+
});
|
|
33
|
+
return {
|
|
34
|
+
conversations: data ?? [],
|
|
35
|
+
isLoading,
|
|
36
|
+
error,
|
|
37
|
+
refetch
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function useSuspenseConversations() {
|
|
41
|
+
const { apiBaseURL, apiBasePath, headers } = context.usePluginOverrides("ai-chat");
|
|
42
|
+
const client$1 = client.createApiClient({
|
|
43
|
+
baseURL: apiBaseURL,
|
|
44
|
+
basePath: apiBasePath
|
|
45
|
+
});
|
|
46
|
+
const queries = plugins_aiChat_queryKeys.createAiChatQueryKeys(client$1, headers);
|
|
47
|
+
const listQuery = queries.conversations.list();
|
|
48
|
+
const { data, refetch, error, isFetching } = reactQuery.useSuspenseQuery({
|
|
49
|
+
...listQuery,
|
|
50
|
+
...SHARED_QUERY_CONFIG
|
|
51
|
+
});
|
|
52
|
+
if (error && !isFetching) {
|
|
53
|
+
throw error;
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
conversations: data ?? [],
|
|
57
|
+
refetch
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function useConversation(id, options = {}) {
|
|
61
|
+
const { apiBaseURL, apiBasePath, headers } = context.usePluginOverrides("ai-chat");
|
|
62
|
+
const client$1 = client.createApiClient({
|
|
63
|
+
baseURL: apiBaseURL,
|
|
64
|
+
basePath: apiBasePath
|
|
65
|
+
});
|
|
66
|
+
const { enabled = true } = options;
|
|
67
|
+
const queries = plugins_aiChat_queryKeys.createAiChatQueryKeys(client$1, headers);
|
|
68
|
+
const detailQuery = queries.conversations.detail(id ?? "");
|
|
69
|
+
const { data, isLoading, error, refetch } = reactQuery.useQuery({
|
|
70
|
+
...detailQuery,
|
|
71
|
+
...SHARED_QUERY_CONFIG,
|
|
72
|
+
enabled: enabled && !!client$1 && !!id
|
|
73
|
+
});
|
|
74
|
+
return {
|
|
75
|
+
conversation: data || null,
|
|
76
|
+
isLoading,
|
|
77
|
+
error,
|
|
78
|
+
refetch
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function useSuspenseConversation(id) {
|
|
82
|
+
const { apiBaseURL, apiBasePath, headers } = context.usePluginOverrides("ai-chat");
|
|
83
|
+
const client$1 = client.createApiClient({
|
|
84
|
+
baseURL: apiBaseURL,
|
|
85
|
+
basePath: apiBasePath
|
|
86
|
+
});
|
|
87
|
+
const queries = plugins_aiChat_queryKeys.createAiChatQueryKeys(client$1, headers);
|
|
88
|
+
const detailQuery = queries.conversations.detail(id);
|
|
89
|
+
const { data, refetch, error, isFetching } = reactQuery.useSuspenseQuery({
|
|
90
|
+
...detailQuery,
|
|
91
|
+
...SHARED_QUERY_CONFIG
|
|
92
|
+
});
|
|
93
|
+
if (error && !isFetching) {
|
|
94
|
+
throw error;
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
conversation: data || null,
|
|
98
|
+
refetch
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function useCreateConversation() {
|
|
102
|
+
const { refresh, apiBaseURL, apiBasePath } = context.usePluginOverrides("ai-chat");
|
|
103
|
+
const client$1 = client.createApiClient({
|
|
104
|
+
baseURL: apiBaseURL,
|
|
105
|
+
basePath: apiBasePath
|
|
106
|
+
});
|
|
107
|
+
const queryClient = reactQuery.useQueryClient();
|
|
108
|
+
const queries = plugins_aiChat_queryKeys.createAiChatQueryKeys(client$1);
|
|
109
|
+
return reactQuery.useMutation({
|
|
110
|
+
mutationKey: [...queries.conversations._def, "create"],
|
|
111
|
+
mutationFn: async (data) => {
|
|
112
|
+
const response = await client$1("@post/chat/conversations", {
|
|
113
|
+
method: "POST",
|
|
114
|
+
body: data
|
|
115
|
+
});
|
|
116
|
+
return response.data;
|
|
117
|
+
},
|
|
118
|
+
onSuccess: async (created) => {
|
|
119
|
+
await queryClient.invalidateQueries({
|
|
120
|
+
queryKey: queries.conversations.list().queryKey
|
|
121
|
+
});
|
|
122
|
+
if (refresh) {
|
|
123
|
+
await refresh();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
function useRenameConversation() {
|
|
129
|
+
const { refresh, apiBaseURL, apiBasePath } = context.usePluginOverrides("ai-chat");
|
|
130
|
+
const client$1 = client.createApiClient({
|
|
131
|
+
baseURL: apiBaseURL,
|
|
132
|
+
basePath: apiBasePath
|
|
133
|
+
});
|
|
134
|
+
const queryClient = reactQuery.useQueryClient();
|
|
135
|
+
const queries = plugins_aiChat_queryKeys.createAiChatQueryKeys(client$1);
|
|
136
|
+
return reactQuery.useMutation({
|
|
137
|
+
mutationKey: [...queries.conversations._def, "rename"],
|
|
138
|
+
mutationFn: async ({ id, title }) => {
|
|
139
|
+
const response = await client$1("@put/chat/conversations/:id", {
|
|
140
|
+
method: "PUT",
|
|
141
|
+
params: { id },
|
|
142
|
+
body: { title }
|
|
143
|
+
});
|
|
144
|
+
return response.data;
|
|
145
|
+
},
|
|
146
|
+
onSuccess: async (updated) => {
|
|
147
|
+
if (updated?.id) {
|
|
148
|
+
queryClient.setQueryData(
|
|
149
|
+
queries.conversations.detail(updated.id).queryKey,
|
|
150
|
+
(old) => old ? { ...old, ...updated } : null
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
await queryClient.invalidateQueries({
|
|
154
|
+
queryKey: queries.conversations.list().queryKey
|
|
155
|
+
});
|
|
156
|
+
if (refresh) {
|
|
157
|
+
await refresh();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
function useDeleteConversation() {
|
|
163
|
+
const { refresh, apiBaseURL, apiBasePath } = context.usePluginOverrides("ai-chat");
|
|
164
|
+
const client$1 = client.createApiClient({
|
|
165
|
+
baseURL: apiBaseURL,
|
|
166
|
+
basePath: apiBasePath
|
|
167
|
+
});
|
|
168
|
+
const queryClient = reactQuery.useQueryClient();
|
|
169
|
+
const queries = plugins_aiChat_queryKeys.createAiChatQueryKeys(client$1);
|
|
170
|
+
return reactQuery.useMutation({
|
|
171
|
+
mutationKey: [...queries.conversations._def, "delete"],
|
|
172
|
+
mutationFn: async ({ id }) => {
|
|
173
|
+
const response = await client$1("@delete/chat/conversations/:id", {
|
|
174
|
+
method: "DELETE",
|
|
175
|
+
params: { id }
|
|
176
|
+
});
|
|
177
|
+
return response.data;
|
|
178
|
+
},
|
|
179
|
+
onSuccess: async (_, { id }) => {
|
|
180
|
+
queryClient.removeQueries({
|
|
181
|
+
queryKey: queries.conversations.detail(id).queryKey
|
|
182
|
+
});
|
|
183
|
+
await queryClient.invalidateQueries({
|
|
184
|
+
queryKey: queries.conversations.list().queryKey
|
|
185
|
+
});
|
|
186
|
+
if (refresh) {
|
|
187
|
+
await refresh();
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
exports.useConversation = useConversation;
|
|
194
|
+
exports.useConversations = useConversations;
|
|
195
|
+
exports.useCreateConversation = useCreateConversation;
|
|
196
|
+
exports.useDeleteConversation = useDeleteConversation;
|
|
197
|
+
exports.useRenameConversation = useRenameConversation;
|
|
198
|
+
exports.useSuspenseConversation = useSuspenseConversation;
|
|
199
|
+
exports.useSuspenseConversations = useSuspenseConversations;
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createApiClient } from '@btst/stack/plugins/client';
|
|
3
|
+
import { useQuery, useSuspenseQuery, useQueryClient, useMutation } from '@tanstack/react-query';
|
|
4
|
+
import { createAiChatQueryKeys } from '../../../../../../../plugins/ai-chat/query-keys.mjs';
|
|
5
|
+
import { usePluginOverrides } from '@btst/stack/context';
|
|
6
|
+
|
|
7
|
+
const SHARED_QUERY_CONFIG = {
|
|
8
|
+
retry: false,
|
|
9
|
+
refetchOnWindowFocus: false,
|
|
10
|
+
refetchOnMount: false,
|
|
11
|
+
refetchOnReconnect: false,
|
|
12
|
+
staleTime: 1e3 * 60 * 5,
|
|
13
|
+
// 5 minutes
|
|
14
|
+
gcTime: 1e3 * 60 * 10
|
|
15
|
+
// 10 minutes
|
|
16
|
+
};
|
|
17
|
+
function useConversations(options = {}) {
|
|
18
|
+
const { apiBaseURL, apiBasePath, headers } = usePluginOverrides("ai-chat");
|
|
19
|
+
const client = createApiClient({
|
|
20
|
+
baseURL: apiBaseURL,
|
|
21
|
+
basePath: apiBasePath
|
|
22
|
+
});
|
|
23
|
+
const { enabled = true } = options;
|
|
24
|
+
const queries = createAiChatQueryKeys(client, headers);
|
|
25
|
+
const listQuery = queries.conversations.list();
|
|
26
|
+
const { data, isLoading, error, refetch } = useQuery({
|
|
27
|
+
...listQuery,
|
|
28
|
+
...SHARED_QUERY_CONFIG,
|
|
29
|
+
enabled: enabled && !!client
|
|
30
|
+
});
|
|
31
|
+
return {
|
|
32
|
+
conversations: data ?? [],
|
|
33
|
+
isLoading,
|
|
34
|
+
error,
|
|
35
|
+
refetch
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function useSuspenseConversations() {
|
|
39
|
+
const { apiBaseURL, apiBasePath, headers } = usePluginOverrides("ai-chat");
|
|
40
|
+
const client = createApiClient({
|
|
41
|
+
baseURL: apiBaseURL,
|
|
42
|
+
basePath: apiBasePath
|
|
43
|
+
});
|
|
44
|
+
const queries = createAiChatQueryKeys(client, headers);
|
|
45
|
+
const listQuery = queries.conversations.list();
|
|
46
|
+
const { data, refetch, error, isFetching } = useSuspenseQuery({
|
|
47
|
+
...listQuery,
|
|
48
|
+
...SHARED_QUERY_CONFIG
|
|
49
|
+
});
|
|
50
|
+
if (error && !isFetching) {
|
|
51
|
+
throw error;
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
conversations: data ?? [],
|
|
55
|
+
refetch
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function useConversation(id, options = {}) {
|
|
59
|
+
const { apiBaseURL, apiBasePath, headers } = usePluginOverrides("ai-chat");
|
|
60
|
+
const client = createApiClient({
|
|
61
|
+
baseURL: apiBaseURL,
|
|
62
|
+
basePath: apiBasePath
|
|
63
|
+
});
|
|
64
|
+
const { enabled = true } = options;
|
|
65
|
+
const queries = createAiChatQueryKeys(client, headers);
|
|
66
|
+
const detailQuery = queries.conversations.detail(id ?? "");
|
|
67
|
+
const { data, isLoading, error, refetch } = useQuery({
|
|
68
|
+
...detailQuery,
|
|
69
|
+
...SHARED_QUERY_CONFIG,
|
|
70
|
+
enabled: enabled && !!client && !!id
|
|
71
|
+
});
|
|
72
|
+
return {
|
|
73
|
+
conversation: data || null,
|
|
74
|
+
isLoading,
|
|
75
|
+
error,
|
|
76
|
+
refetch
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function useSuspenseConversation(id) {
|
|
80
|
+
const { apiBaseURL, apiBasePath, headers } = usePluginOverrides("ai-chat");
|
|
81
|
+
const client = createApiClient({
|
|
82
|
+
baseURL: apiBaseURL,
|
|
83
|
+
basePath: apiBasePath
|
|
84
|
+
});
|
|
85
|
+
const queries = createAiChatQueryKeys(client, headers);
|
|
86
|
+
const detailQuery = queries.conversations.detail(id);
|
|
87
|
+
const { data, refetch, error, isFetching } = useSuspenseQuery({
|
|
88
|
+
...detailQuery,
|
|
89
|
+
...SHARED_QUERY_CONFIG
|
|
90
|
+
});
|
|
91
|
+
if (error && !isFetching) {
|
|
92
|
+
throw error;
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
conversation: data || null,
|
|
96
|
+
refetch
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
function useCreateConversation() {
|
|
100
|
+
const { refresh, apiBaseURL, apiBasePath } = usePluginOverrides("ai-chat");
|
|
101
|
+
const client = createApiClient({
|
|
102
|
+
baseURL: apiBaseURL,
|
|
103
|
+
basePath: apiBasePath
|
|
104
|
+
});
|
|
105
|
+
const queryClient = useQueryClient();
|
|
106
|
+
const queries = createAiChatQueryKeys(client);
|
|
107
|
+
return useMutation({
|
|
108
|
+
mutationKey: [...queries.conversations._def, "create"],
|
|
109
|
+
mutationFn: async (data) => {
|
|
110
|
+
const response = await client("@post/chat/conversations", {
|
|
111
|
+
method: "POST",
|
|
112
|
+
body: data
|
|
113
|
+
});
|
|
114
|
+
return response.data;
|
|
115
|
+
},
|
|
116
|
+
onSuccess: async (created) => {
|
|
117
|
+
await queryClient.invalidateQueries({
|
|
118
|
+
queryKey: queries.conversations.list().queryKey
|
|
119
|
+
});
|
|
120
|
+
if (refresh) {
|
|
121
|
+
await refresh();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function useRenameConversation() {
|
|
127
|
+
const { refresh, apiBaseURL, apiBasePath } = usePluginOverrides("ai-chat");
|
|
128
|
+
const client = createApiClient({
|
|
129
|
+
baseURL: apiBaseURL,
|
|
130
|
+
basePath: apiBasePath
|
|
131
|
+
});
|
|
132
|
+
const queryClient = useQueryClient();
|
|
133
|
+
const queries = createAiChatQueryKeys(client);
|
|
134
|
+
return useMutation({
|
|
135
|
+
mutationKey: [...queries.conversations._def, "rename"],
|
|
136
|
+
mutationFn: async ({ id, title }) => {
|
|
137
|
+
const response = await client("@put/chat/conversations/:id", {
|
|
138
|
+
method: "PUT",
|
|
139
|
+
params: { id },
|
|
140
|
+
body: { title }
|
|
141
|
+
});
|
|
142
|
+
return response.data;
|
|
143
|
+
},
|
|
144
|
+
onSuccess: async (updated) => {
|
|
145
|
+
if (updated?.id) {
|
|
146
|
+
queryClient.setQueryData(
|
|
147
|
+
queries.conversations.detail(updated.id).queryKey,
|
|
148
|
+
(old) => old ? { ...old, ...updated } : null
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
await queryClient.invalidateQueries({
|
|
152
|
+
queryKey: queries.conversations.list().queryKey
|
|
153
|
+
});
|
|
154
|
+
if (refresh) {
|
|
155
|
+
await refresh();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
function useDeleteConversation() {
|
|
161
|
+
const { refresh, apiBaseURL, apiBasePath } = usePluginOverrides("ai-chat");
|
|
162
|
+
const client = createApiClient({
|
|
163
|
+
baseURL: apiBaseURL,
|
|
164
|
+
basePath: apiBasePath
|
|
165
|
+
});
|
|
166
|
+
const queryClient = useQueryClient();
|
|
167
|
+
const queries = createAiChatQueryKeys(client);
|
|
168
|
+
return useMutation({
|
|
169
|
+
mutationKey: [...queries.conversations._def, "delete"],
|
|
170
|
+
mutationFn: async ({ id }) => {
|
|
171
|
+
const response = await client("@delete/chat/conversations/:id", {
|
|
172
|
+
method: "DELETE",
|
|
173
|
+
params: { id }
|
|
174
|
+
});
|
|
175
|
+
return response.data;
|
|
176
|
+
},
|
|
177
|
+
onSuccess: async (_, { id }) => {
|
|
178
|
+
queryClient.removeQueries({
|
|
179
|
+
queryKey: queries.conversations.detail(id).queryKey
|
|
180
|
+
});
|
|
181
|
+
await queryClient.invalidateQueries({
|
|
182
|
+
queryKey: queries.conversations.list().queryKey
|
|
183
|
+
});
|
|
184
|
+
if (refresh) {
|
|
185
|
+
await refresh();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export { useConversation, useConversations, useCreateConversation, useDeleteConversation, useRenameConversation, useSuspenseConversation, useSuspenseConversations };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const AI_CHAT_LOCALIZATION = {
|
|
4
|
+
// Chat interface
|
|
5
|
+
CHAT_PLACEHOLDER: "Type a message...",
|
|
6
|
+
CHAT_SEND_BUTTON: "Send",
|
|
7
|
+
CHAT_EMPTY_STATE: "Start a conversation...",
|
|
8
|
+
CHAT_LOADING: "Thinking...",
|
|
9
|
+
CHAT_ERROR: "Something went wrong. Please try again.",
|
|
10
|
+
CHAT_RETRY: "Retry",
|
|
11
|
+
// Page errors
|
|
12
|
+
CHAT_GENERIC_ERROR_TITLE: "Something went wrong",
|
|
13
|
+
CHAT_GENERIC_ERROR_MESSAGE: "An error occurred while loading the chat. Please try again.",
|
|
14
|
+
CHAT_PAGE_NOT_FOUND_TITLE: "Chat not found",
|
|
15
|
+
CHAT_PAGE_NOT_FOUND_DESCRIPTION: "The conversation you're looking for doesn't exist or has been deleted.",
|
|
16
|
+
// Sidebar
|
|
17
|
+
SIDEBAR_TITLE: "Conversations",
|
|
18
|
+
SIDEBAR_NEW_CHAT: "New chat",
|
|
19
|
+
SIDEBAR_NO_CONVERSATIONS: "No conversations yet",
|
|
20
|
+
SIDEBAR_SEARCH_PLACEHOLDER: "Search conversations...",
|
|
21
|
+
// Conversation actions
|
|
22
|
+
CONVERSATION_RENAME: "Rename",
|
|
23
|
+
CONVERSATION_RENAME_PLACEHOLDER: "Enter conversation name",
|
|
24
|
+
CONVERSATION_RENAME_SAVE: "Save",
|
|
25
|
+
CONVERSATION_RENAME_CANCEL: "Cancel",
|
|
26
|
+
CONVERSATION_DELETE: "Delete",
|
|
27
|
+
CONVERSATION_DELETE_CONFIRM_TITLE: "Delete conversation",
|
|
28
|
+
CONVERSATION_DELETE_CONFIRM_DESCRIPTION: "Are you sure you want to delete this conversation? This action cannot be undone.",
|
|
29
|
+
CONVERSATION_DELETE_CONFIRM_BUTTON: "Delete",
|
|
30
|
+
CONVERSATION_DELETE_CANCEL: "Cancel",
|
|
31
|
+
// Image upload (legacy)
|
|
32
|
+
IMAGE_UPLOAD_BUTTON: "Attach image",
|
|
33
|
+
IMAGE_UPLOAD_UPLOADING: "Uploading...",
|
|
34
|
+
IMAGE_UPLOAD_ERROR_NOT_IMAGE: "Please select an image file",
|
|
35
|
+
IMAGE_UPLOAD_ERROR_TOO_LARGE: "Image must be less than 4MB",
|
|
36
|
+
IMAGE_UPLOAD_SUCCESS: "Image uploaded",
|
|
37
|
+
IMAGE_UPLOAD_FAILURE: "Failed to upload image",
|
|
38
|
+
// File upload
|
|
39
|
+
FILE_UPLOAD_BUTTON: "Attach file",
|
|
40
|
+
FILE_UPLOAD_ERROR_TOO_LARGE: "File must be less than 10MB",
|
|
41
|
+
FILE_UPLOAD_SUCCESS: "File attached",
|
|
42
|
+
FILE_UPLOAD_FAILURE: "Failed to attach file",
|
|
43
|
+
// Timestamps
|
|
44
|
+
TIME_JUST_NOW: "Just now",
|
|
45
|
+
TIME_MINUTES_AGO: "{count} minutes ago",
|
|
46
|
+
TIME_HOURS_AGO: "{count} hours ago",
|
|
47
|
+
TIME_YESTERDAY: "Yesterday",
|
|
48
|
+
TIME_DAYS_AGO: "{count} days ago",
|
|
49
|
+
// Message actions
|
|
50
|
+
MESSAGE_COPY: "Copy message",
|
|
51
|
+
MESSAGE_COPIED: "Copied!",
|
|
52
|
+
MESSAGE_RETRY: "Retry",
|
|
53
|
+
MESSAGE_EDIT: "Edit message",
|
|
54
|
+
MESSAGE_SAVE: "Save",
|
|
55
|
+
MESSAGE_CANCEL: "Cancel",
|
|
56
|
+
// Accessibility
|
|
57
|
+
A11Y_USER_MESSAGE: "Your message",
|
|
58
|
+
A11Y_ASSISTANT_MESSAGE: "AI response",
|
|
59
|
+
A11Y_COPY_CODE: "Copy code",
|
|
60
|
+
A11Y_CODE_COPIED: "Code copied"
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
exports.AI_CHAT_LOCALIZATION = AI_CHAT_LOCALIZATION;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
const AI_CHAT_LOCALIZATION = {
|
|
2
|
+
// Chat interface
|
|
3
|
+
CHAT_PLACEHOLDER: "Type a message...",
|
|
4
|
+
CHAT_SEND_BUTTON: "Send",
|
|
5
|
+
CHAT_EMPTY_STATE: "Start a conversation...",
|
|
6
|
+
CHAT_LOADING: "Thinking...",
|
|
7
|
+
CHAT_ERROR: "Something went wrong. Please try again.",
|
|
8
|
+
CHAT_RETRY: "Retry",
|
|
9
|
+
// Page errors
|
|
10
|
+
CHAT_GENERIC_ERROR_TITLE: "Something went wrong",
|
|
11
|
+
CHAT_GENERIC_ERROR_MESSAGE: "An error occurred while loading the chat. Please try again.",
|
|
12
|
+
CHAT_PAGE_NOT_FOUND_TITLE: "Chat not found",
|
|
13
|
+
CHAT_PAGE_NOT_FOUND_DESCRIPTION: "The conversation you're looking for doesn't exist or has been deleted.",
|
|
14
|
+
// Sidebar
|
|
15
|
+
SIDEBAR_TITLE: "Conversations",
|
|
16
|
+
SIDEBAR_NEW_CHAT: "New chat",
|
|
17
|
+
SIDEBAR_NO_CONVERSATIONS: "No conversations yet",
|
|
18
|
+
SIDEBAR_SEARCH_PLACEHOLDER: "Search conversations...",
|
|
19
|
+
// Conversation actions
|
|
20
|
+
CONVERSATION_RENAME: "Rename",
|
|
21
|
+
CONVERSATION_RENAME_PLACEHOLDER: "Enter conversation name",
|
|
22
|
+
CONVERSATION_RENAME_SAVE: "Save",
|
|
23
|
+
CONVERSATION_RENAME_CANCEL: "Cancel",
|
|
24
|
+
CONVERSATION_DELETE: "Delete",
|
|
25
|
+
CONVERSATION_DELETE_CONFIRM_TITLE: "Delete conversation",
|
|
26
|
+
CONVERSATION_DELETE_CONFIRM_DESCRIPTION: "Are you sure you want to delete this conversation? This action cannot be undone.",
|
|
27
|
+
CONVERSATION_DELETE_CONFIRM_BUTTON: "Delete",
|
|
28
|
+
CONVERSATION_DELETE_CANCEL: "Cancel",
|
|
29
|
+
// Image upload (legacy)
|
|
30
|
+
IMAGE_UPLOAD_BUTTON: "Attach image",
|
|
31
|
+
IMAGE_UPLOAD_UPLOADING: "Uploading...",
|
|
32
|
+
IMAGE_UPLOAD_ERROR_NOT_IMAGE: "Please select an image file",
|
|
33
|
+
IMAGE_UPLOAD_ERROR_TOO_LARGE: "Image must be less than 4MB",
|
|
34
|
+
IMAGE_UPLOAD_SUCCESS: "Image uploaded",
|
|
35
|
+
IMAGE_UPLOAD_FAILURE: "Failed to upload image",
|
|
36
|
+
// File upload
|
|
37
|
+
FILE_UPLOAD_BUTTON: "Attach file",
|
|
38
|
+
FILE_UPLOAD_ERROR_TOO_LARGE: "File must be less than 10MB",
|
|
39
|
+
FILE_UPLOAD_SUCCESS: "File attached",
|
|
40
|
+
FILE_UPLOAD_FAILURE: "Failed to attach file",
|
|
41
|
+
// Timestamps
|
|
42
|
+
TIME_JUST_NOW: "Just now",
|
|
43
|
+
TIME_MINUTES_AGO: "{count} minutes ago",
|
|
44
|
+
TIME_HOURS_AGO: "{count} hours ago",
|
|
45
|
+
TIME_YESTERDAY: "Yesterday",
|
|
46
|
+
TIME_DAYS_AGO: "{count} days ago",
|
|
47
|
+
// Message actions
|
|
48
|
+
MESSAGE_COPY: "Copy message",
|
|
49
|
+
MESSAGE_COPIED: "Copied!",
|
|
50
|
+
MESSAGE_RETRY: "Retry",
|
|
51
|
+
MESSAGE_EDIT: "Edit message",
|
|
52
|
+
MESSAGE_SAVE: "Save",
|
|
53
|
+
MESSAGE_CANCEL: "Cancel",
|
|
54
|
+
// Accessibility
|
|
55
|
+
A11Y_USER_MESSAGE: "Your message",
|
|
56
|
+
A11Y_ASSISTANT_MESSAGE: "AI response",
|
|
57
|
+
A11Y_COPY_CODE: "Copy code",
|
|
58
|
+
A11Y_CODE_COPIED: "Code copied"
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export { AI_CHAT_LOCALIZATION };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const DEFAULT_ALLOWED_FILE_TYPES = ["image"];
|
|
4
|
+
const FILE_TYPE_MIME_MAP = {
|
|
5
|
+
image: ["image/*"],
|
|
6
|
+
text: ["text/plain"],
|
|
7
|
+
markdown: ["text/markdown"],
|
|
8
|
+
csv: ["text/csv"],
|
|
9
|
+
pdf: ["application/pdf"],
|
|
10
|
+
json: ["application/json"]
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
exports.DEFAULT_ALLOWED_FILE_TYPES = DEFAULT_ALLOWED_FILE_TYPES;
|
|
14
|
+
exports.FILE_TYPE_MIME_MAP = FILE_TYPE_MIME_MAP;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const DEFAULT_ALLOWED_FILE_TYPES = ["image"];
|
|
2
|
+
const FILE_TYPE_MIME_MAP = {
|
|
3
|
+
image: ["image/*"],
|
|
4
|
+
text: ["text/plain"],
|
|
5
|
+
markdown: ["text/markdown"],
|
|
6
|
+
csv: ["text/csv"],
|
|
7
|
+
pdf: ["application/pdf"],
|
|
8
|
+
json: ["application/json"]
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { DEFAULT_ALLOWED_FILE_TYPES, FILE_TYPE_MIME_MAP };
|