@btst/stack 1.3.1 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. package/README.md +85 -37
  2. package/dist/node_modules/.pnpm/@radix-ui_react-accordion@1.2.12_@types_react-dom@19.2.3_@types_react@19.2.6__@types_re_947719a27ff11ec6f09710dd9e85efc5/node_modules/@radix-ui/react-accordion/dist/index.cjs +321 -0
  3. package/dist/node_modules/.pnpm/@radix-ui_react-accordion@1.2.12_@types_react-dom@19.2.3_@types_react@19.2.6__@types_re_947719a27ff11ec6f09710dd9e85efc5/node_modules/@radix-ui/react-accordion/dist/index.mjs +306 -0
  4. 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
  5. 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
  6. 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
  7. 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
  8. package/dist/node_modules/.pnpm/@radix-ui_react-collapsible@1.1.12_@types_react-dom@19.2.3_@types_react@19.2.6__@types__d025a77f62ee83ca6bd8b0ea1f9de738/node_modules/@radix-ui/react-collapsible/dist/index.cjs +168 -0
  9. package/dist/node_modules/.pnpm/@radix-ui_react-collapsible@1.1.12_@types_react-dom@19.2.3_@types_react@19.2.6__@types__d025a77f62ee83ca6bd8b0ea1f9de738/node_modules/@radix-ui/react-collapsible/dist/index.mjs +146 -0
  10. 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
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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
  16. 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
  17. 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
  18. 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
  19. 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
  20. 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
  21. 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
  22. 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
  23. 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
  24. 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
  25. 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
  26. 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
  27. 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
  28. 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
  29. 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
  30. 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
  31. 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
  32. 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
  33. 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
  34. 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
  35. 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
  36. 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
  37. 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
  38. 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
  39. 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
  40. 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
  41. 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
  42. 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
  43. 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
  44. 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
  45. 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
  46. 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
  47. 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
  48. 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
  49. 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
  50. 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
  51. 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
  52. package/dist/packages/better-stack/src/plugins/ai-chat/api/plugin.cjs +610 -0
  53. package/dist/packages/better-stack/src/plugins/ai-chat/api/plugin.mjs +608 -0
  54. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-input.cjs +221 -0
  55. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-input.mjs +219 -0
  56. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-interface.cjs +341 -0
  57. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-interface.mjs +339 -0
  58. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-layout.cjs +135 -0
  59. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-layout.mjs +133 -0
  60. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-message.cjs +429 -0
  61. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-message.mjs +423 -0
  62. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-sidebar.cjs +227 -0
  63. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-sidebar.mjs +225 -0
  64. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/loading/chat-page-skeleton.cjs +31 -0
  65. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/loading/chat-page-skeleton.mjs +29 -0
  66. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/loading/index.cjs +11 -0
  67. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/loading/index.mjs +8 -0
  68. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/pages/404-page.cjs +18 -0
  69. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/pages/404-page.mjs +16 -0
  70. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/pages/chat-page.cjs +39 -0
  71. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/pages/chat-page.internal.cjs +22 -0
  72. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/pages/chat-page.internal.mjs +20 -0
  73. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/pages/chat-page.mjs +37 -0
  74. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/shared/default-error.cjs +18 -0
  75. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/shared/default-error.mjs +16 -0
  76. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/shared/error-placeholder.cjs +26 -0
  77. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/shared/error-placeholder.mjs +24 -0
  78. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/tool-call-display.cjs +123 -0
  79. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/tool-call-display.mjs +121 -0
  80. package/dist/packages/better-stack/src/plugins/ai-chat/client/hooks/chat-hooks.cjs +199 -0
  81. package/dist/packages/better-stack/src/plugins/ai-chat/client/hooks/chat-hooks.mjs +191 -0
  82. package/dist/packages/better-stack/src/plugins/ai-chat/client/localization/index.cjs +63 -0
  83. package/dist/packages/better-stack/src/plugins/ai-chat/client/localization/index.mjs +61 -0
  84. package/dist/packages/better-stack/src/plugins/ai-chat/client/overrides.cjs +14 -0
  85. package/dist/packages/better-stack/src/plugins/ai-chat/client/overrides.mjs +11 -0
  86. package/dist/packages/better-stack/src/plugins/ai-chat/client/plugin.cjs +241 -0
  87. package/dist/packages/better-stack/src/plugins/ai-chat/client/plugin.mjs +239 -0
  88. package/dist/packages/better-stack/src/plugins/ai-chat/db.cjs +65 -0
  89. package/dist/packages/better-stack/src/plugins/ai-chat/db.mjs +63 -0
  90. package/dist/packages/better-stack/src/plugins/ai-chat/schemas.cjs +42 -0
  91. package/dist/packages/better-stack/src/plugins/ai-chat/schemas.mjs +38 -0
  92. package/dist/packages/better-stack/src/plugins/blog/client/components/shared/markdown-content.cjs +12 -309
  93. package/dist/packages/better-stack/src/plugins/blog/client/components/shared/markdown-content.mjs +13 -303
  94. package/dist/packages/better-stack/src/plugins/blog/client/components/shared/page-wrapper.cjs +2 -2
  95. package/dist/packages/better-stack/src/plugins/blog/client/components/shared/page-wrapper.mjs +2 -2
  96. package/dist/packages/ui/src/components/accordion.cjs +67 -0
  97. package/dist/packages/ui/src/components/accordion.mjs +62 -0
  98. package/dist/packages/ui/src/components/alert-dialog.cjs +1 -1
  99. package/dist/packages/ui/src/components/alert-dialog.mjs +1 -1
  100. package/dist/packages/{better-stack/src/plugins/blog/client/components/shared/better-blog-attribution.cjs → ui/src/components/better-stack-attribution.cjs} +3 -3
  101. package/dist/packages/{better-stack/src/plugins/blog/client/components/shared/better-blog-attribution.mjs → ui/src/components/better-stack-attribution.mjs} +3 -3
  102. package/dist/packages/ui/src/components/dialog.cjs +14 -0
  103. package/dist/packages/ui/src/components/dialog.mjs +14 -1
  104. package/dist/packages/ui/src/components/dropdown-menu.cjs +67 -0
  105. package/dist/packages/ui/src/components/dropdown-menu.mjs +62 -0
  106. package/dist/packages/ui/src/components/markdown-content.cjs +306 -0
  107. package/dist/packages/ui/src/components/markdown-content.mjs +297 -0
  108. package/dist/packages/ui/src/components/scroll-area.cjs +63 -0
  109. package/dist/packages/ui/src/components/scroll-area.mjs +60 -0
  110. package/dist/packages/ui/src/components/select.cjs +1 -1
  111. package/dist/packages/ui/src/components/select.mjs +1 -1
  112. package/dist/packages/ui/src/components/sheet.cjs +87 -0
  113. package/dist/packages/ui/src/components/sheet.mjs +69 -0
  114. package/dist/plugins/ai-chat/api/index.cjs +9 -0
  115. package/dist/plugins/ai-chat/api/index.d.cts +9 -0
  116. package/dist/plugins/ai-chat/api/index.d.mts +9 -0
  117. package/dist/plugins/ai-chat/api/index.d.ts +9 -0
  118. package/dist/plugins/ai-chat/api/index.mjs +2 -0
  119. package/dist/plugins/ai-chat/client/components/index.cjs +29 -0
  120. package/dist/plugins/ai-chat/client/components/index.d.cts +30 -0
  121. package/dist/plugins/ai-chat/client/components/index.d.mts +30 -0
  122. package/dist/plugins/ai-chat/client/components/index.d.ts +30 -0
  123. package/dist/plugins/ai-chat/client/components/index.mjs +12 -0
  124. package/dist/plugins/ai-chat/client/hooks/index.cjs +13 -0
  125. package/dist/plugins/ai-chat/client/hooks/index.d.cts +98 -0
  126. package/dist/plugins/ai-chat/client/hooks/index.d.mts +98 -0
  127. package/dist/plugins/ai-chat/client/hooks/index.d.ts +98 -0
  128. package/dist/plugins/ai-chat/client/hooks/index.mjs +1 -0
  129. package/dist/plugins/ai-chat/client/index.cjs +21 -0
  130. package/dist/plugins/ai-chat/client/index.d.cts +156 -0
  131. package/dist/plugins/ai-chat/client/index.d.mts +156 -0
  132. package/dist/plugins/ai-chat/client/index.d.ts +156 -0
  133. package/dist/plugins/ai-chat/client/index.mjs +8 -0
  134. package/dist/plugins/ai-chat/client.css +6 -0
  135. package/dist/plugins/ai-chat/query-keys.cjs +60 -0
  136. package/dist/plugins/ai-chat/query-keys.d.cts +478 -0
  137. package/dist/plugins/ai-chat/query-keys.d.mts +478 -0
  138. package/dist/plugins/ai-chat/query-keys.d.ts +478 -0
  139. package/dist/plugins/ai-chat/query-keys.mjs +58 -0
  140. package/dist/plugins/ai-chat/style.css +19 -0
  141. package/dist/plugins/blog/api/index.d.cts +1 -1
  142. package/dist/plugins/blog/api/index.d.mts +1 -1
  143. package/dist/plugins/blog/api/index.d.ts +1 -1
  144. package/dist/plugins/blog/client/components/shared/markdown-content-styles.css +91 -62
  145. package/dist/plugins/blog/client/hooks/index.d.cts +4 -4
  146. package/dist/plugins/blog/client/hooks/index.d.mts +4 -4
  147. package/dist/plugins/blog/client/hooks/index.d.ts +4 -4
  148. package/dist/plugins/blog/client/index.d.cts +1 -1
  149. package/dist/plugins/blog/client/index.d.mts +1 -1
  150. package/dist/plugins/blog/client/index.d.ts +1 -1
  151. package/dist/plugins/blog/query-keys.d.cts +7 -7
  152. package/dist/plugins/blog/query-keys.d.mts +7 -7
  153. package/dist/plugins/blog/query-keys.d.ts +7 -7
  154. package/dist/shared/stack.Be1QIHEn.d.cts +23 -0
  155. package/dist/shared/stack.Be1QIHEn.d.mts +23 -0
  156. package/dist/shared/stack.Be1QIHEn.d.ts +23 -0
  157. package/dist/shared/stack.DaOcgmrM.d.cts +323 -0
  158. package/dist/shared/stack.DaOcgmrM.d.mts +323 -0
  159. package/dist/shared/stack.DaOcgmrM.d.ts +323 -0
  160. package/package.json +59 -1
  161. package/src/plugins/ai-chat/api/index.ts +2 -0
  162. package/src/plugins/ai-chat/api/plugin.ts +1083 -0
  163. package/src/plugins/ai-chat/client/components/chat-input.tsx +295 -0
  164. package/src/plugins/ai-chat/client/components/chat-interface.tsx +494 -0
  165. package/src/plugins/ai-chat/client/components/chat-layout.tsx +175 -0
  166. package/src/plugins/ai-chat/client/components/chat-message.tsx +561 -0
  167. package/src/plugins/ai-chat/client/components/chat-sidebar.tsx +296 -0
  168. package/src/plugins/ai-chat/client/components/index.ts +18 -0
  169. package/src/plugins/ai-chat/client/components/loading/chat-page-skeleton.tsx +57 -0
  170. package/src/plugins/ai-chat/client/components/loading/index.tsx +11 -0
  171. package/src/plugins/ai-chat/client/components/pages/404-page.tsx +27 -0
  172. package/src/plugins/ai-chat/client/components/pages/chat-page.internal.tsx +31 -0
  173. package/src/plugins/ai-chat/client/components/pages/chat-page.tsx +46 -0
  174. package/src/plugins/ai-chat/client/components/shared/default-error.tsx +28 -0
  175. package/src/plugins/ai-chat/client/components/shared/error-placeholder.tsx +22 -0
  176. package/src/plugins/ai-chat/client/components/tool-call-display.tsx +197 -0
  177. package/src/plugins/ai-chat/client/hooks/chat-hooks.tsx +349 -0
  178. package/src/plugins/ai-chat/client/hooks/index.tsx +1 -0
  179. package/src/plugins/ai-chat/client/index.ts +25 -0
  180. package/src/plugins/ai-chat/client/localization/index.ts +156 -0
  181. package/src/plugins/ai-chat/client/overrides.ts +241 -0
  182. package/src/plugins/ai-chat/client/plugin.tsx +449 -0
  183. package/src/plugins/ai-chat/client.css +6 -0
  184. package/src/plugins/ai-chat/db.ts +65 -0
  185. package/src/plugins/ai-chat/query-keys.ts +87 -0
  186. package/src/plugins/ai-chat/schemas.ts +40 -0
  187. package/src/plugins/ai-chat/style.css +19 -0
  188. package/src/plugins/ai-chat/types.ts +29 -0
  189. package/src/plugins/blog/client/components/shared/markdown-content-styles.css +91 -62
  190. package/src/plugins/blog/client/components/shared/markdown-content.tsx +19 -427
  191. package/src/plugins/blog/client/components/shared/page-wrapper.tsx +2 -2
  192. 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
  193. package/src/plugins/blog/client/components/shared/better-blog-attribution.tsx +0 -19
  194. 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
  195. 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
  196. 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
  197. 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
  198. 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
  199. 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
  200. 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
  201. 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
  202. 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
  203. 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
  204. 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
  205. 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
  206. 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
  207. 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
  208. 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
  209. 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
  210. 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
  211. 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
  212. 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
  213. 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
  214. 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
  215. 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
  216. 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
  217. 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
  218. 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
  219. 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
  220. 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
  221. 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
  222. 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
  223. 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
  224. 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
  225. 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
  226. 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
  227. 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
  228. 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
  229. 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
  230. 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
  231. 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
  232. 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
  233. 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
  234. 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
  235. 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
  236. package/dist/shared/{stack.CbuN2zVV.d.ts → stack.CcI4sYJP.d.cts} +3 -3
  237. package/dist/shared/{stack.CbuN2zVV.d.cts → stack.CcI4sYJP.d.mts} +3 -3
  238. package/dist/shared/{stack.CbuN2zVV.d.mts → stack.CcI4sYJP.d.ts} +3 -3
@@ -0,0 +1,423 @@
1
+ "use client";
2
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
+ import { cn } from '../../../../../../ui/src/lib/utils.mjs';
4
+ import { MarkdownContent } from '../../../../../../ui/src/components/markdown-content.mjs';
5
+ import { Button } from '../../../../../../ui/src/components/button.mjs';
6
+ import { Dialog, DialogContent, DialogTitle } from '../../../../../../ui/src/components/dialog.mjs';
7
+ import { Bot, FileText, X, Send, Pencil, Check, Copy, RefreshCw, User } from 'lucide-react';
8
+ import { isToolUIPart, getToolName } from 'ai';
9
+ import { useState, useRef, useEffect, useMemo } from 'react';
10
+ import { usePluginOverrides } from '@btst/stack/context';
11
+ import { AI_CHAT_LOCALIZATION } from '../localization/index.mjs';
12
+ import { ToolCallDisplay } from './tool-call-display.mjs';
13
+ import 'highlight.js/styles/panda-syntax-light.css';
14
+ import completeMarkdown from 'remend';
15
+
16
+ const DefaultLink = (props) => /* @__PURE__ */ jsx("a", { ...props });
17
+ const DefaultImage = (props) => /* @__PURE__ */ jsx("img", { ...props });
18
+ function ClickableImage({
19
+ src,
20
+ alt,
21
+ width = 200,
22
+ height = 200,
23
+ className,
24
+ ImageComponent
25
+ }) {
26
+ const [isOpen, setIsOpen] = useState(false);
27
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
28
+ /* @__PURE__ */ jsx(
29
+ "button",
30
+ {
31
+ type: "button",
32
+ onClick: () => setIsOpen(true),
33
+ className: "cursor-zoom-in focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 rounded-md overflow-hidden",
34
+ style: { width, height },
35
+ children: /* @__PURE__ */ jsx(
36
+ ImageComponent,
37
+ {
38
+ src,
39
+ alt,
40
+ width,
41
+ height,
42
+ className: cn(
43
+ "object-cover hover:opacity-90 transition-opacity",
44
+ className
45
+ )
46
+ }
47
+ )
48
+ }
49
+ ),
50
+ /* @__PURE__ */ jsx(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: /* @__PURE__ */ jsxs(
51
+ DialogContent,
52
+ {
53
+ className: "max-w-[90vw] max-h-[90vh] p-2 sm:max-w-[90vw]",
54
+ showCloseButton: true,
55
+ children: [
56
+ /* @__PURE__ */ jsx(DialogTitle, { className: "sr-only", children: alt }),
57
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(
58
+ "img",
59
+ {
60
+ src,
61
+ alt,
62
+ className: "max-w-full max-h-[85vh] object-contain rounded-md"
63
+ }
64
+ ) })
65
+ ]
66
+ }
67
+ ) })
68
+ ] });
69
+ }
70
+ function ChatMessage({
71
+ message,
72
+ isStreaming = false,
73
+ variant = "default",
74
+ onRetry,
75
+ onEdit,
76
+ isRetrying = false
77
+ }) {
78
+ const isUser = message.role === "user";
79
+ const {
80
+ Link,
81
+ Image,
82
+ localization: customLocalization,
83
+ toolRenderers
84
+ } = usePluginOverrides(
85
+ "ai-chat",
86
+ {}
87
+ );
88
+ const localization = { ...AI_CHAT_LOCALIZATION, ...customLocalization };
89
+ const ImageComponent = Image ?? DefaultImage;
90
+ const [copied, setCopied] = useState(false);
91
+ const [isEditing, setIsEditing] = useState(false);
92
+ const [editText, setEditText] = useState("");
93
+ const editTextareaRef = useRef(null);
94
+ useEffect(() => {
95
+ if (isEditing && editTextareaRef.current) {
96
+ editTextareaRef.current.style.height = "auto";
97
+ editTextareaRef.current.style.height = `${editTextareaRef.current.scrollHeight}px`;
98
+ editTextareaRef.current.focus();
99
+ }
100
+ }, [isEditing, editText]);
101
+ const handleCopy = async () => {
102
+ try {
103
+ await navigator.clipboard.writeText(textContent);
104
+ setCopied(true);
105
+ setTimeout(() => setCopied(false), 2e3);
106
+ } catch (err) {
107
+ console.error("Failed to copy text:", err);
108
+ }
109
+ };
110
+ const handleStartEdit = () => {
111
+ setEditText(textContent);
112
+ setIsEditing(true);
113
+ };
114
+ const handleCancelEdit = () => {
115
+ setIsEditing(false);
116
+ setEditText("");
117
+ };
118
+ const handleSaveEdit = () => {
119
+ if (editText.trim() && onEdit) {
120
+ onEdit(editText.trim());
121
+ setIsEditing(false);
122
+ setEditText("");
123
+ }
124
+ };
125
+ const handleEditKeyDown = (e) => {
126
+ if (e.key === "Enter" && !e.shiftKey) {
127
+ e.preventDefault();
128
+ handleSaveEdit();
129
+ } else if (e.key === "Escape") {
130
+ handleCancelEdit();
131
+ }
132
+ };
133
+ const textContent = useMemo(() => {
134
+ if (message.parts && Array.isArray(message.parts)) {
135
+ return message.parts.filter((part) => part.type === "text").map((part) => part.text).join("");
136
+ }
137
+ return "";
138
+ }, [message.parts]);
139
+ const imageParts = useMemo(() => {
140
+ if (message.parts && Array.isArray(message.parts)) {
141
+ return message.parts.filter(
142
+ (part) => part.type === "file" && part.mediaType?.startsWith("image/")
143
+ );
144
+ }
145
+ return [];
146
+ }, [message.parts]);
147
+ const fileParts = useMemo(() => {
148
+ if (message.parts && Array.isArray(message.parts)) {
149
+ return message.parts.filter(
150
+ (part) => part.type === "file" && !part.mediaType?.startsWith("image/")
151
+ );
152
+ }
153
+ return [];
154
+ }, [message.parts]);
155
+ const toolParts = useMemo(() => {
156
+ if (message.parts && Array.isArray(message.parts)) {
157
+ return message.parts.filter((part) => isToolUIPart(part));
158
+ }
159
+ return [];
160
+ }, [message.parts]);
161
+ const displayContent = useMemo(() => {
162
+ if (!textContent) return "";
163
+ if (isStreaming && !isUser) {
164
+ return completeMarkdown(textContent);
165
+ }
166
+ return textContent;
167
+ }, [textContent, isStreaming, isUser]);
168
+ const isCompact = variant === "compact";
169
+ return /* @__PURE__ */ jsxs(
170
+ "div",
171
+ {
172
+ className: cn(
173
+ "flex gap-3 w-full",
174
+ isCompact ? "mb-3" : "mb-4",
175
+ isUser ? "justify-end" : "justify-start"
176
+ ),
177
+ "aria-label": isUser ? localization.A11Y_USER_MESSAGE : localization.A11Y_ASSISTANT_MESSAGE,
178
+ children: [
179
+ !isUser && /* @__PURE__ */ jsx(
180
+ "div",
181
+ {
182
+ className: cn(
183
+ "rounded-full bg-muted flex items-center justify-center shrink-0",
184
+ isCompact ? "w-7 h-7" : "w-8 h-8"
185
+ ),
186
+ children: /* @__PURE__ */ jsx(Bot, { className: cn(isCompact ? "w-4 h-4" : "w-5 h-5") })
187
+ }
188
+ ),
189
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 max-w-[80%] group", children: [
190
+ /* @__PURE__ */ jsx(
191
+ "div",
192
+ {
193
+ className: cn(
194
+ "rounded-lg",
195
+ isCompact ? "px-3 py-2" : "px-4 py-3",
196
+ isUser ? "bg-primary text-primary-foreground" : "bg-muted"
197
+ ),
198
+ children: isUser ? (
199
+ // User messages: files + images + text (or edit mode)
200
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
201
+ fileParts.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: fileParts.map((part, index) => /* @__PURE__ */ jsxs(
202
+ "a",
203
+ {
204
+ href: part.url,
205
+ target: "_blank",
206
+ rel: "noopener noreferrer",
207
+ className: "flex items-center gap-2 px-3 py-2 rounded-md bg-primary-foreground/10 hover:bg-primary-foreground/20 transition-colors",
208
+ children: [
209
+ /* @__PURE__ */ jsx(FileText, { className: "h-4 w-4 shrink-0" }),
210
+ /* @__PURE__ */ jsx("span", { className: "text-xs truncate max-w-[150px]", children: part.filename || "File" })
211
+ ]
212
+ },
213
+ index
214
+ )) }),
215
+ imageParts.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: imageParts.map((part, index) => /* @__PURE__ */ jsx(
216
+ ClickableImage,
217
+ {
218
+ src: part.url,
219
+ alt: part.filename || `Attached image ${index + 1}`,
220
+ width: 150,
221
+ height: 150,
222
+ className: "rounded-md",
223
+ ImageComponent
224
+ },
225
+ index
226
+ )) }),
227
+ isEditing ? /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
228
+ /* @__PURE__ */ jsx(
229
+ "textarea",
230
+ {
231
+ ref: editTextareaRef,
232
+ value: editText,
233
+ onChange: (e) => setEditText(e.target.value),
234
+ onKeyDown: handleEditKeyDown,
235
+ className: cn(
236
+ "w-full min-w-[200px] resize-none rounded-md border-0 bg-primary-foreground/10 p-2 text-sm",
237
+ "focus:outline-none focus:ring-1 focus:ring-primary-foreground/30",
238
+ "text-primary-foreground placeholder:text-primary-foreground/50"
239
+ ),
240
+ rows: 1
241
+ }
242
+ ),
243
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-2", children: [
244
+ /* @__PURE__ */ jsx(
245
+ Button,
246
+ {
247
+ type: "button",
248
+ size: "icon-sm",
249
+ variant: "ghost",
250
+ onClick: handleCancelEdit,
251
+ className: "h-7 w-7 text-primary-foreground hover:bg-primary-foreground/20",
252
+ title: localization.MESSAGE_CANCEL,
253
+ children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
254
+ }
255
+ ),
256
+ /* @__PURE__ */ jsx(
257
+ Button,
258
+ {
259
+ type: "button",
260
+ size: "icon-sm",
261
+ variant: "ghost",
262
+ onClick: handleSaveEdit,
263
+ disabled: !editText.trim(),
264
+ className: "h-7 w-7 text-primary-foreground hover:bg-primary-foreground/20 disabled:opacity-50",
265
+ title: localization.MESSAGE_SAVE,
266
+ children: /* @__PURE__ */ jsx(Send, { className: "h-4 w-4" })
267
+ }
268
+ )
269
+ ] })
270
+ ] }) : textContent && /* @__PURE__ */ jsx(
271
+ "p",
272
+ {
273
+ className: cn(
274
+ "whitespace-pre-wrap wrap-break-word",
275
+ isCompact ? "text-sm" : "text-sm"
276
+ ),
277
+ children: textContent
278
+ }
279
+ )
280
+ ] })
281
+ ) : (
282
+ // Assistant messages: rendered markdown + files + images + tool calls
283
+ /* @__PURE__ */ jsxs("div", { className: "wrap-break-word space-y-2", children: [
284
+ fileParts.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: fileParts.map((part, index) => /* @__PURE__ */ jsxs(
285
+ "a",
286
+ {
287
+ href: part.url,
288
+ target: "_blank",
289
+ rel: "noopener noreferrer",
290
+ className: "flex items-center gap-2 px-3 py-2 rounded-md bg-muted-foreground/10 hover:bg-muted-foreground/20 transition-colors border",
291
+ children: [
292
+ /* @__PURE__ */ jsx(FileText, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
293
+ /* @__PURE__ */ jsx("span", { className: "text-xs truncate max-w-[150px]", children: part.filename || "File" })
294
+ ]
295
+ },
296
+ index
297
+ )) }),
298
+ imageParts.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: imageParts.map((part, index) => /* @__PURE__ */ jsx(
299
+ ClickableImage,
300
+ {
301
+ src: part.url,
302
+ alt: part.filename || `Image ${index + 1}`,
303
+ width: 200,
304
+ height: 200,
305
+ className: "rounded-md",
306
+ ImageComponent
307
+ },
308
+ index
309
+ )) }),
310
+ toolParts.length > 0 && /* @__PURE__ */ jsx("div", { className: "space-y-2", children: toolParts.map((part) => {
311
+ const toolName = getToolName(part);
312
+ const toolCallId = part.toolCallId;
313
+ const state = part.state;
314
+ const input = part.input;
315
+ const output = part.output;
316
+ const errorText = part.errorText;
317
+ const isLoading = state === "input-streaming" || state === "input-available";
318
+ const toolCallProps = {
319
+ toolCallId,
320
+ toolName,
321
+ state,
322
+ input,
323
+ output,
324
+ errorText,
325
+ isLoading
326
+ };
327
+ const CustomRenderer = toolRenderers?.[toolName];
328
+ if (CustomRenderer) {
329
+ return /* @__PURE__ */ jsx(CustomRenderer, { ...toolCallProps }, toolCallId);
330
+ }
331
+ return /* @__PURE__ */ jsx(ToolCallDisplay, { ...toolCallProps }, toolCallId);
332
+ }) }),
333
+ displayContent ? /* @__PURE__ */ jsx(
334
+ MarkdownContent,
335
+ {
336
+ markdown: displayContent,
337
+ variant: "chat",
338
+ LinkComponent: Link ?? DefaultLink,
339
+ ImageComponent
340
+ }
341
+ ) : imageParts.length === 0 && fileParts.length === 0 && toolParts.length === 0 ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "..." }) : null
342
+ ] })
343
+ )
344
+ }
345
+ ),
346
+ !isStreaming && !isEditing && /* @__PURE__ */ jsx(
347
+ "div",
348
+ {
349
+ className: cn(
350
+ "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",
351
+ isUser ? "justify-end" : "justify-start"
352
+ ),
353
+ children: isUser ? (
354
+ // User message actions: Edit
355
+ onEdit && /* @__PURE__ */ jsx(
356
+ Button,
357
+ {
358
+ type: "button",
359
+ size: "icon-sm",
360
+ variant: "ghost",
361
+ onClick: handleStartEdit,
362
+ className: "h-7 w-7 bg-transparent text-muted-foreground hover:text-foreground hover:bg-muted/50",
363
+ title: localization.MESSAGE_EDIT,
364
+ children: /* @__PURE__ */ jsx(Pencil, { className: "h-3.5 w-3.5" })
365
+ }
366
+ )
367
+ ) : (
368
+ // Assistant message actions: Copy and Retry
369
+ /* @__PURE__ */ jsxs(Fragment, { children: [
370
+ /* @__PURE__ */ jsx(
371
+ Button,
372
+ {
373
+ type: "button",
374
+ size: "icon-sm",
375
+ variant: "ghost",
376
+ onClick: handleCopy,
377
+ className: "h-7 w-7 bg-transparent text-muted-foreground hover:text-foreground hover:bg-muted/50",
378
+ title: copied ? localization.MESSAGE_COPIED : localization.MESSAGE_COPY,
379
+ children: copied ? /* @__PURE__ */ jsx(Check, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx(Copy, { className: "h-3.5 w-3.5" })
380
+ }
381
+ ),
382
+ onRetry && /* @__PURE__ */ jsx(
383
+ Button,
384
+ {
385
+ type: "button",
386
+ size: "icon-sm",
387
+ variant: "ghost",
388
+ onClick: onRetry,
389
+ disabled: isRetrying,
390
+ className: "h-7 w-7 bg-transparent text-muted-foreground hover:text-foreground hover:bg-muted/50 disabled:opacity-50",
391
+ title: localization.MESSAGE_RETRY,
392
+ children: /* @__PURE__ */ jsx(
393
+ RefreshCw,
394
+ {
395
+ className: cn(
396
+ "h-3.5 w-3.5",
397
+ isRetrying && "animate-spin"
398
+ )
399
+ }
400
+ )
401
+ }
402
+ )
403
+ ] })
404
+ )
405
+ }
406
+ )
407
+ ] }),
408
+ isUser && /* @__PURE__ */ jsx(
409
+ "div",
410
+ {
411
+ className: cn(
412
+ "rounded-full bg-primary flex items-center justify-center shrink-0 text-primary-foreground",
413
+ isCompact ? "w-7 h-7" : "w-8 h-8"
414
+ ),
415
+ children: /* @__PURE__ */ jsx(User, { className: cn(isCompact ? "w-4 h-4" : "w-5 h-5") })
416
+ }
417
+ )
418
+ ]
419
+ }
420
+ );
421
+ }
422
+
423
+ export { ChatMessage };
@@ -0,0 +1,227 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ const jsxRuntime = require('react/jsx-runtime');
5
+ const React = require('react');
6
+ const button = require('../../../../../../ui/src/components/button.cjs');
7
+ const input = require('../../../../../../ui/src/components/input.cjs');
8
+ const scrollArea = require('../../../../../../ui/src/components/scroll-area.cjs');
9
+ const dropdownMenu = require('../../../../../../ui/src/components/dropdown-menu.cjs');
10
+ const alertDialog = require('../../../../../../ui/src/components/alert-dialog.cjs');
11
+ const dialog = require('../../../../../../ui/src/components/dialog.cjs');
12
+ const lucideReact = require('lucide-react');
13
+ const utils = require('../../../../../../ui/src/lib/utils.cjs');
14
+ const context = require('@btst/stack/context');
15
+ const chatHooks = require('../hooks/chat-hooks.cjs');
16
+ const index = require('../localization/index.cjs');
17
+
18
+ function ChatSidebar({
19
+ currentConversationId,
20
+ onNewChat,
21
+ className
22
+ }) {
23
+ const { navigate, localization: customLocalization } = context.usePluginOverrides("ai-chat", {});
24
+ const basePath = context.useBasePath();
25
+ const localization = { ...index.AI_CHAT_LOCALIZATION, ...customLocalization };
26
+ const { conversations, isLoading } = chatHooks.useConversations();
27
+ const renameMutation = chatHooks.useRenameConversation();
28
+ const deleteMutation = chatHooks.useDeleteConversation();
29
+ const [renameDialogOpen, setRenameDialogOpen] = React.useState(false);
30
+ const [deleteDialogOpen, setDeleteDialogOpen] = React.useState(false);
31
+ const [selectedConversation, setSelectedConversation] = React.useState(null);
32
+ const [newTitle, setNewTitle] = React.useState("");
33
+ const handleNewChat = () => {
34
+ if (navigate) {
35
+ navigate(`${basePath}/chat`);
36
+ }
37
+ if (onNewChat) {
38
+ onNewChat();
39
+ }
40
+ };
41
+ const handleConversationClick = (conversation) => {
42
+ if (navigate) {
43
+ navigate(`${basePath}/chat/${conversation.id}`);
44
+ }
45
+ };
46
+ const handleRenameClick = (conversation) => {
47
+ setSelectedConversation(conversation);
48
+ setNewTitle(conversation.title);
49
+ setRenameDialogOpen(true);
50
+ };
51
+ const handleDeleteClick = (conversation) => {
52
+ setSelectedConversation(conversation);
53
+ setDeleteDialogOpen(true);
54
+ };
55
+ const handleRenameConfirm = async () => {
56
+ if (selectedConversation && newTitle.trim()) {
57
+ await renameMutation.mutateAsync({
58
+ id: selectedConversation.id,
59
+ title: newTitle.trim()
60
+ });
61
+ setRenameDialogOpen(false);
62
+ setSelectedConversation(null);
63
+ setNewTitle("");
64
+ }
65
+ };
66
+ const handleDeleteConfirm = async () => {
67
+ if (selectedConversation) {
68
+ await deleteMutation.mutateAsync({ id: selectedConversation.id });
69
+ setDeleteDialogOpen(false);
70
+ setSelectedConversation(null);
71
+ if (selectedConversation.id === currentConversationId && navigate) {
72
+ navigate(`${basePath}/chat`);
73
+ }
74
+ }
75
+ };
76
+ const formatDate = (dateString) => {
77
+ const date = new Date(dateString);
78
+ const now = /* @__PURE__ */ new Date();
79
+ const diffMs = now.getTime() - date.getTime();
80
+ const diffMins = Math.floor(diffMs / 6e4);
81
+ const diffHours = Math.floor(diffMs / 36e5);
82
+ const diffDays = Math.floor(diffMs / 864e5);
83
+ if (diffMins < 1) return localization.TIME_JUST_NOW;
84
+ if (diffMins < 60)
85
+ return localization.TIME_MINUTES_AGO.replace("{count}", String(diffMins));
86
+ if (diffHours < 24)
87
+ return localization.TIME_HOURS_AGO.replace("{count}", String(diffHours));
88
+ if (diffDays === 1) return localization.TIME_YESTERDAY;
89
+ if (diffDays < 7)
90
+ return localization.TIME_DAYS_AGO.replace("{count}", String(diffDays));
91
+ return date.toLocaleDateString();
92
+ };
93
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: utils.cn("flex flex-col h-full bg-muted/30 border-r", className), children: [
94
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 border-b", children: /* @__PURE__ */ jsxRuntime.jsxs(
95
+ button.Button,
96
+ {
97
+ onClick: handleNewChat,
98
+ className: "w-full justify-start gap-2",
99
+ variant: "outline",
100
+ children: [
101
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquarePlus, { className: "h-4 w-4" }),
102
+ localization.SIDEBAR_NEW_CHAT
103
+ ]
104
+ }
105
+ ) }),
106
+ /* @__PURE__ */ jsxRuntime.jsx(scrollArea.ScrollArea, { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2", children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 text-center text-sm text-muted-foreground", children: localization.CHAT_LOADING }) : conversations.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 text-center text-sm text-muted-foreground", children: localization.SIDEBAR_NO_CONVERSATIONS }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: conversations.map((conversation) => /* @__PURE__ */ jsxRuntime.jsxs(
107
+ "div",
108
+ {
109
+ className: utils.cn(
110
+ "group flex items-center gap-2 rounded-lg px-3 py-2 hover:bg-accent cursor-pointer transition-colors overflow-hidden",
111
+ currentConversationId === conversation.id && "bg-accent"
112
+ ),
113
+ children: [
114
+ /* @__PURE__ */ jsxRuntime.jsxs(
115
+ "button",
116
+ {
117
+ type: "button",
118
+ className: "flex-1 flex items-center gap-2 text-left min-w-0 overflow-hidden",
119
+ onClick: () => handleConversationClick(conversation),
120
+ children: [
121
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquare, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
122
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0 overflow-hidden", children: [
123
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium truncate", children: conversation.title }),
124
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground truncate", children: formatDate(conversation.updatedAt) })
125
+ ] })
126
+ ]
127
+ }
128
+ ),
129
+ /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenu, { children: [
130
+ /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
131
+ button.Button,
132
+ {
133
+ variant: "ghost",
134
+ size: "icon",
135
+ className: "h-8 w-8 opacity-0 group-hover:opacity-100 transition-opacity",
136
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, { className: "h-4 w-4" })
137
+ }
138
+ ) }),
139
+ /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenuContent, { align: "end", children: [
140
+ /* @__PURE__ */ jsxRuntime.jsxs(
141
+ dropdownMenu.DropdownMenuItem,
142
+ {
143
+ onClick: (e) => {
144
+ e.stopPropagation();
145
+ handleRenameClick(conversation);
146
+ },
147
+ children: [
148
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pencil, { className: "h-4 w-4 mr-2" }),
149
+ localization.CONVERSATION_RENAME
150
+ ]
151
+ }
152
+ ),
153
+ /* @__PURE__ */ jsxRuntime.jsxs(
154
+ dropdownMenu.DropdownMenuItem,
155
+ {
156
+ onClick: (e) => {
157
+ e.stopPropagation();
158
+ handleDeleteClick(conversation);
159
+ },
160
+ className: "text-destructive focus:text-destructive",
161
+ children: [
162
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "h-4 w-4 mr-2" }),
163
+ localization.CONVERSATION_DELETE
164
+ ]
165
+ }
166
+ )
167
+ ] })
168
+ ] })
169
+ ]
170
+ },
171
+ conversation.id
172
+ )) }) }) }),
173
+ /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog, { open: renameDialogOpen, onOpenChange: setRenameDialogOpen, children: /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogContent, { children: [
174
+ /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: localization.CONVERSATION_RENAME }) }),
175
+ /* @__PURE__ */ jsxRuntime.jsx(
176
+ input.Input,
177
+ {
178
+ value: newTitle,
179
+ onChange: (e) => setNewTitle(e.target.value),
180
+ placeholder: localization.CONVERSATION_RENAME_PLACEHOLDER,
181
+ onKeyDown: (e) => {
182
+ if (e.key === "Enter") {
183
+ void handleRenameConfirm();
184
+ }
185
+ }
186
+ }
187
+ ),
188
+ /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogFooter, { children: [
189
+ /* @__PURE__ */ jsxRuntime.jsx(
190
+ button.Button,
191
+ {
192
+ variant: "outline",
193
+ onClick: () => setRenameDialogOpen(false),
194
+ children: localization.CONVERSATION_RENAME_CANCEL
195
+ }
196
+ ),
197
+ /* @__PURE__ */ jsxRuntime.jsx(
198
+ button.Button,
199
+ {
200
+ onClick: handleRenameConfirm,
201
+ disabled: !newTitle.trim() || renameMutation.isPending,
202
+ children: localization.CONVERSATION_RENAME_SAVE
203
+ }
204
+ )
205
+ ] })
206
+ ] }) }),
207
+ /* @__PURE__ */ jsxRuntime.jsx(alertDialog.AlertDialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxRuntime.jsxs(alertDialog.AlertDialogContent, { children: [
208
+ /* @__PURE__ */ jsxRuntime.jsxs(alertDialog.AlertDialogHeader, { children: [
209
+ /* @__PURE__ */ jsxRuntime.jsx(alertDialog.AlertDialogTitle, { children: localization.CONVERSATION_DELETE_CONFIRM_TITLE }),
210
+ /* @__PURE__ */ jsxRuntime.jsx(alertDialog.AlertDialogDescription, { children: localization.CONVERSATION_DELETE_CONFIRM_DESCRIPTION })
211
+ ] }),
212
+ /* @__PURE__ */ jsxRuntime.jsxs(alertDialog.AlertDialogFooter, { children: [
213
+ /* @__PURE__ */ jsxRuntime.jsx(alertDialog.AlertDialogCancel, { children: localization.CONVERSATION_DELETE_CANCEL }),
214
+ /* @__PURE__ */ jsxRuntime.jsx(
215
+ alertDialog.AlertDialogAction,
216
+ {
217
+ onClick: handleDeleteConfirm,
218
+ className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
219
+ children: localization.CONVERSATION_DELETE_CONFIRM_BUTTON
220
+ }
221
+ )
222
+ ] })
223
+ ] }) })
224
+ ] });
225
+ }
226
+
227
+ exports.ChatSidebar = ChatSidebar;