| title | 更新日志 |
|---|---|
| docClass | timeline |
| toc | false |
| spline | explain |
Warning
原 tdesign-web-components 包中的基础 UI 组件与 AI Chat 组件现已拆分为两个独立发布的 npm 包。原包用户升级时需调整依赖名称和引入路径。
@tdesign/web-components:承接原包的基础 UI 组件,如 Button、Input、Dialog 等,可独立使用。@tdesign/web-components-chat:承接原包的 AI Chat 组件,如 Chatbot、ChatMessage、ChatSender 等,并且依赖@tdesign/web-components提供基础 UI,并依赖@tdesign/ai-chat-engine提供对话引擎能力。
依赖关系:
@tdesign/web-components-chat
├── @tdesign/web-components(基础 UI)
└── @tdesign/ai-chat-engine(对话引擎)
原包用户需调整依赖名称和引入路径:
| 用途 | 原引入路径 | 新引入路径 |
|---|---|---|
| 基础组件 | tdesign-web-components/button |
@tdesign/web-components/button |
| 对话组件 | tdesign-web-components/chatbot |
@tdesign/web-components-chat/chatbot |
| 基础样式 | tdesign-web-components/style/index.css |
@tdesign/web-components/style/index.css |
ChatMessage: 支持通过命名 slot 自定义文本、Markdown、图片等内置消息内容 @LzhengH (#422)
ChatMarkdown: 修复引用块内列表缩进丢失导致样式重叠的问题 @RSS1102 (#431)ChatSender: 修复使用中文输入法时,在拼音组合阶段按 Enter 会误发送消息的问题 @LzhengH (#422)Chatbot:
- 独立发布包:Chat 从合包
tdesign-web-components拆分为@tdesign/web-components-chat - Peer 依赖:需安装
@tdesign/web-components(提供t-collapse、t-message等基础组件) - 按需引入:
import '@tdesign/web-components-chat/chatbot'注册<t-chatbot>自定义元素 - 构建:
vite build产出esm/dist;shared按需内联,@tdesign/ai-chat-engine为 runtime 依赖 - exports:
"."全量 +"./*"子模块(chatbot、chat-message、chat-engine等)
| 旧写法(develop) | 新写法 |
|---|---|
import 'tdesign-web-components/chatbot' |
import '@tdesign/web-components-chat/chatbot' |
import type { TdChatMessageProps } from '@tdesign/web-components-chat/chat-message/type' |
import type { TdChatMessageProps } from '@tdesign/web-components-chat/chat-message' |
import type { TdChatMarkdownContentProps } from '@tdesign/web-components-chat/chat-message/content/markdown-content' |
import type { TdChatMarkdownContentProps } from '@tdesign/web-components-chat/chat-message' |
| 无需单独装 UI 包 | npm i @tdesign/web-components @tdesign/web-components-chat |
- 构建产物排除
**/mock/**(文档站 Demo 假数据不再打入 npm 包)
1.2.x 及更早版本为 UI + Chat 合包 时期,完整记录见 @tdesign/web-components CHANGELOG。