@btst/stack 1.3.1 → 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/client/components/shared/markdown-content.cjs +12 -309
- package/dist/packages/better-stack/src/plugins/blog/client/components/shared/markdown-content.mjs +13 -303
- package/dist/packages/better-stack/src/plugins/blog/client/components/shared/page-wrapper.cjs +2 -2
- package/dist/packages/better-stack/src/plugins/blog/client/components/shared/page-wrapper.mjs +2 -2
- package/dist/packages/ui/src/components/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 +4 -4
- package/dist/plugins/blog/client/hooks/index.d.mts +4 -4
- package/dist/plugins/blog/client/hooks/index.d.ts +4 -4
- package/dist/plugins/blog/client/index.d.cts +1 -1
- package/dist/plugins/blog/client/index.d.mts +1 -1
- package/dist/plugins/blog/client/index.d.ts +1 -1
- package/dist/plugins/blog/query-keys.d.cts +7 -7
- package/dist/plugins/blog/query-keys.d.mts +7 -7
- package/dist/plugins/blog/query-keys.d.ts +7 -7
- package/dist/shared/stack.Be1QIHEn.d.cts +23 -0
- package/dist/shared/stack.Be1QIHEn.d.mts +23 -0
- package/dist/shared/stack.Be1QIHEn.d.ts +23 -0
- package/dist/shared/stack.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 +59 -1
- package/src/plugins/ai-chat/api/index.ts +2 -0
- package/src/plugins/ai-chat/api/plugin.ts +1083 -0
- package/src/plugins/ai-chat/client/components/chat-input.tsx +295 -0
- package/src/plugins/ai-chat/client/components/chat-interface.tsx +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/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/page-wrapper.tsx +2 -2
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/sidecar.cjs +0 -9
- package/src/plugins/blog/client/components/shared/better-blog-attribution.tsx +0 -19
- package/dist/node_modules/.pnpm/{@radix-ui_react-compose-refs@1.1.2_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-compose-refs@1.1.2_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-compose-refs@1.1.2_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-compose-refs@1.1.2_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-compose-refs/dist/index.mjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-context@1.1.2_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-context@1.1.2_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-context/dist/index.cjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-context@1.1.2_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-context@1.1.2_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-context/dist/index.mjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-direction@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-direction@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-direction/dist/index.cjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-direction@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-direction@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-direction/dist/index.mjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-focus-guards@1.1.3_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-focus-guards@1.1.3_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-focus-guards/dist/index.cjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-focus-guards@1.1.3_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-focus-guards@1.1.3_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-focus-guards/dist/index.mjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.2_@types_react@19.2.2__@types_rea_bdc15f10281778271ffcbe8dd3cd491e → @radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.3_@types_react@19.2.6__@types_rea_a92a69cb1cb39305138539e4fa72f596}/node_modules/@radix-ui/react-primitive/dist/index.cjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.2_@types_react@19.2.2__@types_rea_bdc15f10281778271ffcbe8dd3cd491e → @radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.3_@types_react@19.2.6__@types_rea_a92a69cb1cb39305138539e4fa72f596}/node_modules/@radix-ui/react-primitive/dist/index.mjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-use-previous@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-previous@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-previous/dist/index.cjs +0 -0
- package/dist/node_modules/.pnpm/{@radix-ui_react-use-previous@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-previous@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-previous/dist/index.mjs +0 -0
- package/dist/node_modules/.pnpm/{react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0 → react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll-bar/dist/es2015/constants.cjs +0 -0
- package/dist/node_modules/.pnpm/{react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0 → react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll-bar/dist/es2015/constants.mjs +0 -0
- package/dist/node_modules/.pnpm/{react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0 → react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll-bar/dist/es2015/utils.cjs +0 -0
- package/dist/node_modules/.pnpm/{react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0 → react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll-bar/dist/es2015/utils.mjs +0 -0
- package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/Combination.cjs +0 -0
- package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/Combination.mjs +0 -0
- package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.cjs +0 -0
- package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.mjs +0 -0
- package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/handleScroll.cjs +0 -0
- package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/handleScroll.mjs +0 -0
- package/dist/node_modules/.pnpm/{react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0 → react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0}/node_modules/react-style-singleton/dist/es2015/component.cjs +0 -0
- package/dist/node_modules/.pnpm/{react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0 → react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0}/node_modules/react-style-singleton/dist/es2015/component.mjs +0 -0
- package/dist/node_modules/.pnpm/{react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0 → react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0}/node_modules/react-style-singleton/dist/es2015/hook.cjs +0 -0
- package/dist/node_modules/.pnpm/{react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0 → react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0}/node_modules/react-style-singleton/dist/es2015/hook.mjs +0 -0
- package/dist/node_modules/.pnpm/{react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0 → react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0}/node_modules/react-style-singleton/dist/es2015/singleton.cjs +0 -0
- package/dist/node_modules/.pnpm/{react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0 → react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0}/node_modules/react-style-singleton/dist/es2015/singleton.mjs +0 -0
- package/dist/node_modules/.pnpm/{use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0 → use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-callback-ref/dist/es2015/assignRef.cjs +0 -0
- package/dist/node_modules/.pnpm/{use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0 → use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-callback-ref/dist/es2015/assignRef.mjs +0 -0
- package/dist/node_modules/.pnpm/{use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0 → use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-callback-ref/dist/es2015/useMergeRef.cjs +0 -0
- package/dist/node_modules/.pnpm/{use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0 → use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-callback-ref/dist/es2015/useMergeRef.mjs +0 -0
- package/dist/node_modules/.pnpm/{use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0 → use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-callback-ref/dist/es2015/useRef.cjs +0 -0
- package/dist/node_modules/.pnpm/{use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0 → use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-callback-ref/dist/es2015/useRef.mjs +0 -0
- package/dist/node_modules/.pnpm/{use-sidecar@1.1.3_@types_react@19.2.2_react@19.2.0 → use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-sidecar/dist/es2015/exports.cjs +0 -0
- package/dist/node_modules/.pnpm/{use-sidecar@1.1.3_@types_react@19.2.2_react@19.2.0 → use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-sidecar/dist/es2015/exports.mjs +0 -0
- package/dist/node_modules/.pnpm/{use-sidecar@1.1.3_@types_react@19.2.2_react@19.2.0 → use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-sidecar/dist/es2015/medium.cjs +0 -0
- package/dist/node_modules/.pnpm/{use-sidecar@1.1.3_@types_react@19.2.2_react@19.2.0 → use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-sidecar/dist/es2015/medium.mjs +0 -0
- package/dist/shared/{stack.CbuN2zVV.d.ts → stack.CcI4sYJP.d.cts} +3 -3
- package/dist/shared/{stack.CbuN2zVV.d.cts → stack.CcI4sYJP.d.mts} +3 -3
- package/dist/shared/{stack.CbuN2zVV.d.mts → stack.CcI4sYJP.d.ts} +3 -3
|
@@ -1,448 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
createElement,
|
|
5
|
-
isValidElement,
|
|
6
|
-
useMemo,
|
|
7
|
-
useRef,
|
|
8
|
-
useState,
|
|
9
|
-
useEffect,
|
|
10
|
-
} from "react";
|
|
11
|
-
import type {
|
|
12
|
-
ComponentPropsWithoutRef,
|
|
13
|
-
MouseEventHandler,
|
|
14
|
-
ReactNode,
|
|
15
|
-
} from "react";
|
|
16
|
-
import ReactMarkdown from "react-markdown";
|
|
17
|
-
import type { Components } from "react-markdown";
|
|
18
|
-
import rehypeHighlight from "rehype-highlight";
|
|
19
|
-
import rehypeRaw from "rehype-raw";
|
|
20
|
-
import remarkGfm from "remark-gfm";
|
|
21
|
-
import "../shared/markdown-content-styles.css";
|
|
22
|
-
import "highlight.js/styles/panda-syntax-light.css";
|
|
23
|
-
import { slugify } from "../../../utils";
|
|
24
|
-
import { CopyIcon } from "lucide-react";
|
|
25
|
-
import { CheckIcon } from "lucide-react";
|
|
2
|
+
|
|
3
|
+
import { MarkdownContent as SharedMarkdownContent } from "@workspace/ui/components/markdown-content";
|
|
26
4
|
import { usePluginOverrides } from "@btst/stack/context";
|
|
27
5
|
import type { BlogPluginOverrides } from "../../overrides";
|
|
28
6
|
import { DefaultImage, DefaultLink } from "./defaults";
|
|
29
7
|
|
|
30
|
-
//
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
// Check for display math: $$...$$
|
|
34
|
-
// Check for block math environments
|
|
35
|
-
return (
|
|
36
|
-
/\$\$[\s\S]+?\$\$/.test(markdown) || // Display math
|
|
37
|
-
/(?<!\$)\$(?!\$)[^\$\n]+?\$(?!\$)/.test(markdown) || // Inline math (not $$)
|
|
38
|
-
/\\begin\{(equation|align|gather|math)\}/.test(markdown) // Math environments
|
|
39
|
-
);
|
|
40
|
-
}
|
|
8
|
+
// Import blog-specific styles
|
|
9
|
+
import "../shared/markdown-content-styles.css";
|
|
10
|
+
import "highlight.js/styles/panda-syntax-light.css";
|
|
41
11
|
|
|
42
12
|
export type MarkdownContentProps = {
|
|
43
13
|
markdown: string;
|
|
44
14
|
className?: string;
|
|
45
15
|
};
|
|
46
16
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
return "";
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// Deterministic hash function for generating consistent IDs
|
|
59
|
-
function simpleHash(str: string): string {
|
|
60
|
-
let hash = 0;
|
|
61
|
-
for (let i = 0; i < str.length; i++) {
|
|
62
|
-
const char = str.charCodeAt(i);
|
|
63
|
-
hash = (hash << 5) - hash + char;
|
|
64
|
-
hash = hash & hash; // Convert to 32-bit integer
|
|
65
|
-
}
|
|
66
|
-
// Convert to base36 and take first 6 characters (matching Math.random().toString(36).slice(2, 8))
|
|
67
|
-
return Math.abs(hash).toString(36).slice(0, 6);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function isCheckboxElement(
|
|
71
|
-
node: ReactNode,
|
|
72
|
-
): node is ReturnType<typeof createElement> {
|
|
73
|
-
return (
|
|
74
|
-
isValidElement(node) &&
|
|
75
|
-
(node.type as unknown) === "input" &&
|
|
76
|
-
(node.props as { type?: string }).type === "checkbox"
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function createTaskListItemRenderer() {
|
|
81
|
-
return function LiRenderer(
|
|
82
|
-
props: React.LiHTMLAttributes<HTMLLIElement> & { children?: ReactNode },
|
|
83
|
-
) {
|
|
84
|
-
const { className, children, ...rest } = props;
|
|
85
|
-
const isTaskItem = (className ?? "").split(" ").includes("task-list-item");
|
|
86
|
-
if (!isTaskItem) {
|
|
87
|
-
return (
|
|
88
|
-
<li className={className} {...rest}>
|
|
89
|
-
{children}
|
|
90
|
-
</li>
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const childArray = Array.isArray(children) ? children : [children];
|
|
95
|
-
const checkboxNode = childArray.find(isCheckboxElement);
|
|
96
|
-
const nonCheckboxChildren = childArray.filter((c) => !isCheckboxElement(c));
|
|
97
|
-
|
|
98
|
-
const labelText = getNodeText(nonCheckboxChildren as unknown as ReactNode);
|
|
99
|
-
const baseId = slugify(labelText || "task-item");
|
|
100
|
-
// Use deterministic hash instead of Math.random() to avoid hydration mismatches
|
|
101
|
-
const hashSuffix = simpleHash(labelText || "task-item");
|
|
102
|
-
const uniqueId = `${baseId}-${hashSuffix}`;
|
|
103
|
-
|
|
104
|
-
return (
|
|
105
|
-
<li className={className} {...rest}>
|
|
106
|
-
{checkboxNode
|
|
107
|
-
? createElement(checkboxNode.type, {
|
|
108
|
-
...checkboxNode.props,
|
|
109
|
-
id: uniqueId,
|
|
110
|
-
"aria-label": labelText || "Task item",
|
|
111
|
-
})
|
|
112
|
-
: null}
|
|
113
|
-
<label htmlFor={uniqueId}>
|
|
114
|
-
{nonCheckboxChildren as unknown as ReactNode}
|
|
115
|
-
</label>
|
|
116
|
-
</li>
|
|
117
|
-
);
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
type HeadingTag = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
122
|
-
function createHeadingRenderer<T extends HeadingTag>(tag: T) {
|
|
123
|
-
return function HeadingRenderer(props: ComponentPropsWithoutRef<T>) {
|
|
124
|
-
const { children, ...rest } = props as { children: ReactNode };
|
|
125
|
-
const text = getNodeText(children);
|
|
126
|
-
const id = slugify(text);
|
|
127
|
-
return createElement(
|
|
128
|
-
tag,
|
|
129
|
-
{ id, ...(rest as object) },
|
|
130
|
-
children,
|
|
131
|
-
text ? (
|
|
132
|
-
<a
|
|
133
|
-
className="heading-anchor"
|
|
134
|
-
href={`#${id}`}
|
|
135
|
-
aria-label="Link to heading"
|
|
136
|
-
>
|
|
137
|
-
#
|
|
138
|
-
</a>
|
|
139
|
-
) : null,
|
|
140
|
-
);
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
function AnchorRenderer(props: React.AnchorHTMLAttributes<HTMLAnchorElement>) {
|
|
145
|
-
const { Link } = usePluginOverrides<
|
|
17
|
+
/**
|
|
18
|
+
* Blog-specific markdown content renderer.
|
|
19
|
+
* This is a thin wrapper around the shared MarkdownContent component
|
|
20
|
+
* that provides blog plugin overrides for Link and Image components.
|
|
21
|
+
*/
|
|
22
|
+
export function MarkdownContent({ markdown, className }: MarkdownContentProps) {
|
|
23
|
+
const { Link, Image } = usePluginOverrides<
|
|
146
24
|
BlogPluginOverrides,
|
|
147
25
|
Partial<BlogPluginOverrides>
|
|
148
26
|
>("blog", {
|
|
149
27
|
Link: DefaultLink,
|
|
150
|
-
});
|
|
151
|
-
const { href = "", children, className: anchorClassName, ...rest } = props;
|
|
152
|
-
|
|
153
|
-
return (
|
|
154
|
-
<Link href={href} className={anchorClassName as string} {...rest}>
|
|
155
|
-
{children}
|
|
156
|
-
</Link>
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
function ImgRenderer(props: React.ImgHTMLAttributes<HTMLImageElement>) {
|
|
161
|
-
const { Image } = usePluginOverrides<
|
|
162
|
-
BlogPluginOverrides,
|
|
163
|
-
Partial<BlogPluginOverrides>
|
|
164
|
-
>("blog", {
|
|
165
28
|
Image: DefaultImage,
|
|
166
29
|
});
|
|
167
|
-
const {
|
|
168
|
-
src = "",
|
|
169
|
-
alt = "",
|
|
170
|
-
className: imgClassName,
|
|
171
|
-
width,
|
|
172
|
-
height,
|
|
173
|
-
style,
|
|
174
|
-
...rest
|
|
175
|
-
} = props;
|
|
176
|
-
|
|
177
|
-
// Only pass width/height if they're actually defined
|
|
178
|
-
const imageProps: React.ComponentProps<typeof Image> = {
|
|
179
|
-
src,
|
|
180
|
-
alt,
|
|
181
|
-
className: imgClassName as string,
|
|
182
|
-
style,
|
|
183
|
-
...rest,
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
if (width != null && height != null) {
|
|
187
|
-
imageProps.width = width as number;
|
|
188
|
-
imageProps.height = height as number;
|
|
189
|
-
} else {
|
|
190
|
-
// When dimensions are missing, wrap in a container for fill mode
|
|
191
|
-
// The container will be styled via CSS to work with fill mode images
|
|
192
|
-
return (
|
|
193
|
-
<span className="markdown-image-wrapper">
|
|
194
|
-
<Image {...imageProps} />
|
|
195
|
-
</span>
|
|
196
|
-
);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
return <Image {...imageProps} />;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
type CodeProps = React.HTMLAttributes<HTMLElement> & {
|
|
203
|
-
inline?: boolean;
|
|
204
|
-
node?: unknown;
|
|
205
|
-
};
|
|
206
|
-
function CodeRenderer({ inline, className, children, ...rest }: CodeProps) {
|
|
207
|
-
const hasLanguage = /language-([a-z0-9-]+)/i.test(className ?? "");
|
|
208
|
-
const isInline = inline ?? !hasLanguage;
|
|
209
|
-
if (isInline) {
|
|
210
|
-
return (
|
|
211
|
-
<code className={className} {...rest}>
|
|
212
|
-
{children}
|
|
213
|
-
</code>
|
|
214
|
-
);
|
|
215
|
-
}
|
|
216
|
-
// Block code: keep markup simple here; the <pre> wrapper will handle toolbar/copier
|
|
217
|
-
return (
|
|
218
|
-
<code className={className} {...rest}>
|
|
219
|
-
{children}
|
|
220
|
-
</code>
|
|
221
|
-
);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
function PreRenderer(props: React.HTMLAttributes<HTMLPreElement>) {
|
|
225
|
-
const { children, ...rest } = props;
|
|
226
|
-
const child = Array.isArray(children) ? children[0] : children;
|
|
227
|
-
let language: string | undefined;
|
|
228
|
-
if (isValidElement(child)) {
|
|
229
|
-
const className = (child.props as { className?: string }).className;
|
|
230
|
-
const match = /language-([a-z0-9-]+)/i.exec(className ?? "");
|
|
231
|
-
language = match?.[1];
|
|
232
|
-
}
|
|
233
|
-
const label = (language ?? "text").toUpperCase();
|
|
234
|
-
|
|
235
|
-
const preRef = useRef<HTMLPreElement | null>(null);
|
|
236
|
-
const [copied, setCopied] = useState(false);
|
|
237
|
-
const resetTimerRef = useRef<number | null>(null);
|
|
238
|
-
|
|
239
|
-
// Prepare line numbers based on code text
|
|
240
|
-
let codeText = "";
|
|
241
|
-
if (isValidElement(child)) {
|
|
242
|
-
const childProps = child.props as { children?: ReactNode };
|
|
243
|
-
codeText = getNodeText(childProps.children as ReactNode);
|
|
244
|
-
}
|
|
245
|
-
const normalized = codeText.endsWith("\n") ? codeText.slice(0, -1) : codeText;
|
|
246
|
-
const lineCount = Math.max(1, normalized.split("\n").length);
|
|
247
|
-
const digitCount = String(lineCount).length;
|
|
248
|
-
const onCopy: MouseEventHandler<HTMLButtonElement> = async (e) => {
|
|
249
|
-
e.preventDefault();
|
|
250
|
-
e.stopPropagation();
|
|
251
|
-
try {
|
|
252
|
-
const text = preRef.current?.textContent ?? "";
|
|
253
|
-
if (
|
|
254
|
-
text &&
|
|
255
|
-
typeof navigator !== "undefined" &&
|
|
256
|
-
navigator.clipboard?.writeText
|
|
257
|
-
) {
|
|
258
|
-
await navigator.clipboard.writeText(text);
|
|
259
|
-
setCopied(true);
|
|
260
|
-
if (resetTimerRef.current) window.clearTimeout(resetTimerRef.current);
|
|
261
|
-
resetTimerRef.current = window.setTimeout(() => {
|
|
262
|
-
setCopied(false);
|
|
263
|
-
resetTimerRef.current = null;
|
|
264
|
-
}, 2000);
|
|
265
|
-
}
|
|
266
|
-
} catch {}
|
|
267
|
-
};
|
|
268
|
-
return (
|
|
269
|
-
<div
|
|
270
|
-
className="milkdown-code-block"
|
|
271
|
-
style={{
|
|
272
|
-
["--code-gutter-width" as unknown as string]: `${digitCount + 1}ch`,
|
|
273
|
-
}}
|
|
274
|
-
>
|
|
275
|
-
<div className="code-toolbar">
|
|
276
|
-
<span className="language-label">{label}</span>
|
|
277
|
-
<button
|
|
278
|
-
type="button"
|
|
279
|
-
className="copy-button"
|
|
280
|
-
onClick={onCopy}
|
|
281
|
-
aria-label={copied ? "Copied" : "Copy code"}
|
|
282
|
-
>
|
|
283
|
-
{copied ? <CheckIcon size={16} /> : <CopyIcon size={16} />}
|
|
284
|
-
</button>
|
|
285
|
-
</div>
|
|
286
|
-
<div className="code-content">
|
|
287
|
-
<ol className="line-numbers" aria-hidden>
|
|
288
|
-
{Array.from({ length: lineCount }).map((_, idx) => (
|
|
289
|
-
<li key={idx + 1}>{idx + 1}</li>
|
|
290
|
-
))}
|
|
291
|
-
</ol>
|
|
292
|
-
<pre ref={preRef} {...rest}>
|
|
293
|
-
{children}
|
|
294
|
-
</pre>
|
|
295
|
-
</div>
|
|
296
|
-
</div>
|
|
297
|
-
);
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
export function MarkdownContent({ markdown, className }: MarkdownContentProps) {
|
|
301
|
-
const [mathPlugins, setMathPlugins] = useState<{
|
|
302
|
-
remarkMath: unknown;
|
|
303
|
-
rehypeKatex: unknown;
|
|
304
|
-
} | null>(null);
|
|
305
|
-
const [isLoadingMath, setIsLoadingMath] = useState(false);
|
|
306
|
-
|
|
307
|
-
const hasMath = useMemo(() => containsMath(markdown), [markdown]);
|
|
308
|
-
|
|
309
|
-
// Dynamically load math plugins and CSS only if needed
|
|
310
|
-
useEffect(() => {
|
|
311
|
-
if (!hasMath || mathPlugins || isLoadingMath) return;
|
|
312
|
-
|
|
313
|
-
setIsLoadingMath(true);
|
|
314
|
-
|
|
315
|
-
// Dynamically inject KaTeX CSS into the document
|
|
316
|
-
const katexCSSId = "katex-css";
|
|
317
|
-
if (!document.getElementById(katexCSSId)) {
|
|
318
|
-
const link = document.createElement("link");
|
|
319
|
-
link.id = katexCSSId;
|
|
320
|
-
link.rel = "stylesheet";
|
|
321
|
-
link.href =
|
|
322
|
-
"https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css";
|
|
323
|
-
link.integrity =
|
|
324
|
-
"sha384-nB0miv6/jRmo5UMMR1wu3Gz6NLsoTkbqJghGIsx//Rlm+ZU03BU6SQNC66uf4l5+";
|
|
325
|
-
link.crossOrigin = "anonymous";
|
|
326
|
-
document.head.appendChild(link);
|
|
327
|
-
|
|
328
|
-
// Add font-display override for KaTeX fonts to prevent FOIT
|
|
329
|
-
// This ensures text remains visible while fonts are loading
|
|
330
|
-
const fontDisplayStyleId = "katex-font-display-override";
|
|
331
|
-
if (!document.getElementById(fontDisplayStyleId)) {
|
|
332
|
-
const style = document.createElement("style");
|
|
333
|
-
style.id = fontDisplayStyleId;
|
|
334
|
-
style.textContent = `
|
|
335
|
-
/* Override KaTeX font-face declarations to add font-display: swap */
|
|
336
|
-
@font-face {
|
|
337
|
-
font-family: 'KaTeX_Main';
|
|
338
|
-
font-style: normal;
|
|
339
|
-
font-weight: normal;
|
|
340
|
-
font-display: swap;
|
|
341
|
-
src: url('https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Main-Regular.woff2') format('woff2');
|
|
342
|
-
}
|
|
343
|
-
@font-face {
|
|
344
|
-
font-family: 'KaTeX_Math';
|
|
345
|
-
font-style: italic;
|
|
346
|
-
font-weight: normal;
|
|
347
|
-
font-display: swap;
|
|
348
|
-
src: url('https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Math-Italic.woff2') format('woff2');
|
|
349
|
-
}
|
|
350
|
-
@font-face {
|
|
351
|
-
font-family: 'KaTeX_Size1';
|
|
352
|
-
font-style: normal;
|
|
353
|
-
font-weight: normal;
|
|
354
|
-
font-display: swap;
|
|
355
|
-
src: url('https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Size1-Regular.woff2') format('woff2');
|
|
356
|
-
}
|
|
357
|
-
@font-face {
|
|
358
|
-
font-family: 'KaTeX_Size2';
|
|
359
|
-
font-style: normal;
|
|
360
|
-
font-weight: normal;
|
|
361
|
-
font-display: swap;
|
|
362
|
-
src: url('https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Size2-Regular.woff2') format('woff2');
|
|
363
|
-
}
|
|
364
|
-
@font-face {
|
|
365
|
-
font-family: 'KaTeX_Size3';
|
|
366
|
-
font-style: normal;
|
|
367
|
-
font-weight: normal;
|
|
368
|
-
font-display: swap;
|
|
369
|
-
src: url('https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Size3-Regular.woff2') format('woff2');
|
|
370
|
-
}
|
|
371
|
-
@font-face {
|
|
372
|
-
font-family: 'KaTeX_Size4';
|
|
373
|
-
font-style: normal;
|
|
374
|
-
font-weight: normal;
|
|
375
|
-
font-display: swap;
|
|
376
|
-
src: url('https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Size4-Regular.woff2') format('woff2');
|
|
377
|
-
}
|
|
378
|
-
`;
|
|
379
|
-
document.head.appendChild(style);
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
// Load both the plugins
|
|
384
|
-
Promise.all([import("remark-math"), import("rehype-katex")])
|
|
385
|
-
.then(([remarkMathModule, rehypeKatexModule]) => {
|
|
386
|
-
setMathPlugins({
|
|
387
|
-
remarkMath: remarkMathModule.default,
|
|
388
|
-
rehypeKatex: rehypeKatexModule.default,
|
|
389
|
-
});
|
|
390
|
-
})
|
|
391
|
-
.catch((error) => {
|
|
392
|
-
console.error("Failed to load math plugins:", error);
|
|
393
|
-
})
|
|
394
|
-
.finally(() => {
|
|
395
|
-
setIsLoadingMath(false);
|
|
396
|
-
});
|
|
397
|
-
}, [hasMath, mathPlugins, isLoadingMath]);
|
|
398
|
-
|
|
399
|
-
const components = useMemo<Components>(() => {
|
|
400
|
-
return {
|
|
401
|
-
a: AnchorRenderer,
|
|
402
|
-
img: ImgRenderer,
|
|
403
|
-
code: CodeRenderer,
|
|
404
|
-
pre: PreRenderer,
|
|
405
|
-
h1: createHeadingRenderer("h1"),
|
|
406
|
-
h2: createHeadingRenderer("h2"),
|
|
407
|
-
h3: createHeadingRenderer("h3"),
|
|
408
|
-
h4: createHeadingRenderer("h4"),
|
|
409
|
-
h5: createHeadingRenderer("h5"),
|
|
410
|
-
h6: createHeadingRenderer("h6"),
|
|
411
|
-
li: createTaskListItemRenderer(),
|
|
412
|
-
};
|
|
413
|
-
}, []);
|
|
414
|
-
|
|
415
|
-
// Build plugin arrays based on whether math is needed and loaded
|
|
416
|
-
const remarkPlugins = useMemo(() => {
|
|
417
|
-
const plugins: unknown[] = [remarkGfm];
|
|
418
|
-
if (hasMath && mathPlugins?.remarkMath) {
|
|
419
|
-
plugins.push(mathPlugins.remarkMath);
|
|
420
|
-
}
|
|
421
|
-
return plugins as never;
|
|
422
|
-
}, [hasMath, mathPlugins]);
|
|
423
|
-
|
|
424
|
-
const rehypePlugins = useMemo(() => {
|
|
425
|
-
const plugins: unknown[] = [rehypeRaw, rehypeHighlight];
|
|
426
|
-
if (hasMath && mathPlugins?.rehypeKatex) {
|
|
427
|
-
plugins.push(mathPlugins.rehypeKatex);
|
|
428
|
-
}
|
|
429
|
-
return plugins as never;
|
|
430
|
-
}, [hasMath, mathPlugins]);
|
|
431
30
|
|
|
432
|
-
// Render content immediately; math will re-render once plugins load
|
|
433
31
|
return (
|
|
434
|
-
<
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
>
|
|
442
|
-
{markdown}
|
|
443
|
-
</ReactMarkdown>
|
|
444
|
-
</div>
|
|
445
|
-
</div>
|
|
446
|
-
</div>
|
|
32
|
+
<SharedMarkdownContent
|
|
33
|
+
markdown={markdown}
|
|
34
|
+
className={className}
|
|
35
|
+
variant="default"
|
|
36
|
+
LinkComponent={Link}
|
|
37
|
+
ImageComponent={Image}
|
|
38
|
+
/>
|
|
447
39
|
);
|
|
448
40
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { usePluginOverrides } from "@btst/stack/context";
|
|
4
|
-
import {
|
|
4
|
+
import { BetterStackAttribution } from "@workspace/ui/components/better-stack-attribution";
|
|
5
5
|
import { PageLayout } from "./page-layout";
|
|
6
6
|
import type { BlogPluginOverrides } from "../../overrides";
|
|
7
7
|
|
|
@@ -26,7 +26,7 @@ export function PageWrapper({
|
|
|
26
26
|
{children}
|
|
27
27
|
</PageLayout>
|
|
28
28
|
|
|
29
|
-
{showAttribution && <
|
|
29
|
+
{showAttribution && <BetterStackAttribution />}
|
|
30
30
|
</>
|
|
31
31
|
);
|
|
32
32
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const SideEffect = require('./SideEffect.cjs');
|
|
4
|
-
const medium = require('./medium.cjs');
|
|
5
|
-
const exports$1 = require('../../../../../use-sidecar@1.1.3_@types_react@19.2.2_react@19.2.0/node_modules/use-sidecar/dist/es2015/exports.cjs');
|
|
6
|
-
|
|
7
|
-
const SideCar = exports$1.exportSidecar(medium.effectCar, SideEffect.RemoveScrollSideCar);
|
|
8
|
-
|
|
9
|
-
module.exports = SideCar;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export function BetterBlogAttribution() {
|
|
2
|
-
return (
|
|
3
|
-
<div className="w-full text-center">
|
|
4
|
-
<p className="flex items-center justify-center gap-1 py-2 text-gray-500 text-sm">
|
|
5
|
-
Powered by{" "}
|
|
6
|
-
<a
|
|
7
|
-
className="flex items-center gap-1 font-semibold underline"
|
|
8
|
-
href="https://www.better-stack.ai"
|
|
9
|
-
target="_blank"
|
|
10
|
-
rel="noreferrer noopener"
|
|
11
|
-
aria-label="Better Stack — Composable full-stack plugin system for React frameworks"
|
|
12
|
-
title="Better Stack — Composable full-stack plugin system for React frameworks"
|
|
13
|
-
>
|
|
14
|
-
<span className="cursor-pointer">Better-Stack</span>
|
|
15
|
-
</a>
|
|
16
|
-
</p>
|
|
17
|
-
</div>
|
|
18
|
-
);
|
|
19
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -36,14 +36,12 @@ interface SerializedTag extends Omit<Tag, "createdAt" | "updatedAt"> {
|
|
|
36
36
|
|
|
37
37
|
declare const createPostSchema: z.ZodObject<{
|
|
38
38
|
slug: z.ZodOptional<z.ZodString>;
|
|
39
|
-
|
|
39
|
+
published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
40
40
|
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
41
|
-
updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
42
41
|
title: z.ZodString;
|
|
43
42
|
content: z.ZodString;
|
|
44
43
|
excerpt: z.ZodString;
|
|
45
44
|
image: z.ZodOptional<z.ZodString>;
|
|
46
|
-
published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
47
45
|
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
48
46
|
name: z.ZodString;
|
|
49
47
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -51,6 +49,8 @@ declare const createPostSchema: z.ZodObject<{
|
|
|
51
49
|
name: z.ZodString;
|
|
52
50
|
slug: z.ZodString;
|
|
53
51
|
}, z.core.$strip>]>>>>;
|
|
52
|
+
publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
53
|
+
updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
54
54
|
}, z.core.$strip>;
|
|
55
55
|
declare const updatePostSchema: z.ZodObject<{
|
|
56
56
|
publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|