feat(ui): 创建共享 UI 组件包

将 web 和 desktop 的重复代码抽取到 @ai-assistant/ui 包:

- 添加可配置的 API 客户端 (configureApiClient)
- 迁移共享组件: ChatMessage, ChatInput, Sidebar, FileBrowser, ConfigPanel
- 迁移共享 hook: useChat
- 添加 responsive prop 支持响应式布局
- 更新 web/desktop 依赖并删除重复代码
This commit is contained in:
2025-12-12 15:52:53 +08:00
parent 563224fa73
commit 68ab6a2016
30 changed files with 711 additions and 1388 deletions
+9
View File
@@ -1,7 +1,16 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import { configureApiClient } from '@ai-assistant/ui';
import { App } from './App';
import './styles/index.css';
import '@ai-assistant/ui/styles';
// 配置 API 客户端:Tauri 应用需要完整的后端 URL
configureApiClient({
baseUrl: 'http://localhost:3000/api',
wsBaseUrl: 'ws://localhost:3000/api',
healthUrl: 'http://localhost:3000/health',
});
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>