@blueking/chat-x 0.0.45-beta.6 → 0.0.45-beta.7

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.
@@ -34,7 +34,7 @@ UserMessage 渲染右对齐用户消息,支持文本、附件、文本/结构
34
34
 
35
35
  ├── .ai-user-message-content(气泡:bg #e1ecff,padding 8×12,border-radius 4px)
36
36
  │ v-if: cite 为数组 → KeyValueContent(title + key/value 列表)
37
- │ v-else-if: content → MarkdownContent × N(每个 text 项一个实例)
37
+ │ v-else-if: content → TextContent × N(textParts 中每个文本片段一个实例)
38
38
 
39
39
  └── MessageTools(.ai-user-message-tools)
40
40
  v-if: messageToolsStatus !== 'hidden'
@@ -53,7 +53,7 @@ UserMessage 渲染右对齐用户消息,支持文本、附件、文本/结构
53
53
  │ @submit(formModel) → onShortcutConfirm(formModel) + isEdit=false
54
54
 
55
55
  └── ChatInput(v-else,带自定义 #send-icon slot)
56
- v-model: editContent(仅含文本内容,数组时取第一个 text 项)
56
+ v-model: editContent(取 textParts[0],即第一个文本片段)
57
57
  defaultUploadFiles: binaryFiles
58
58
  #send-icon slot → .user-edit-footer
59
59
  Button "取消" → isEdit=false
@@ -62,7 +62,7 @@ UserMessage 渲染右对齐用户消息,支持文本、附件、文本/结构
62
62
 
63
63
  ## 基础用法
64
64
 
65
- `content` 为字符串时,通过 `MarkdownContent` 渲染(支持 Markdown 语法)。
65
+ `content` 为字符串时,通过 `TextContent` 渲染(内部使用 `MarkdownContent`,支持 Markdown 语法)。
66
66
 
67
67
  ```vue
68
68
  <template>
@@ -92,7 +92,7 @@ UserMessage 渲染右对齐用户消息,支持文本、附件、文本/结构
92
92
  - **图片文件**(`binaryImageFiles`):判断 `url` 存在或 `mimeType` / `file.type` 以 `image/` 开头的文件,统一放入一个 `FileContent`(`readonly=true`)中渲染,支持点击缩略图全屏预览
93
93
  - **非图片文件**(`binaryNonImageFiles`):每个文件单独渲染在 `FileContent`(`readonly=true`)中
94
94
 
95
- `text` 项按顺序各渲染一个 `MarkdownContent`。
95
+ `text` 项经 `textParts` 计算属性统一为 `string[]`,按顺序各渲染一个 `TextContent`。
96
96
 
97
97
  ```vue
98
98
  <script setup lang="ts">
@@ -223,12 +223,12 @@ UserMessage 渲染右对齐用户消息,支持文本、附件、文本/结构
223
223
  **`editContent` 的初始化逻辑**(仅文本部分,二进制文件通过 `defaultUploadFiles` 恢复):
224
224
 
225
225
  ```
226
- content 为 string → editContent = content
227
- textContent string → editContent = textContent
228
- textContent 为 array → editContent = textContent[0]?.text(取第一个文本项)
229
- binaryFiles 有值 → 进入编辑模式(editContent 可为空)
226
+ textParts 有值 → editContent = textParts[0](取第一个文本片段)
227
+ binaryFiles 有值进入编辑模式(editContent 可为空)
230
228
  ```
231
229
 
230
+ `textParts` 由 `content` 统一计算:`string` 转为单元素数组,`InputContent[]` 则过滤出 `type: 'text'` 且非空的项并映射为 `string[]`。
231
+
232
232
  ```vue
233
233
  <template>
234
234
  <UserMessage
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "2.0.0",
3
- "generatedAt": "2026-06-11T14:14:16.495Z",
3
+ "generatedAt": "2026-06-17T04:05:40.649Z",
4
4
  "domains": {
5
5
  "message": {
6
6
  "label": "消息展示",
@@ -14,6 +14,7 @@ export interface IAiSlashMenuItem {
14
14
  }
15
15
  export declare const resourceTypeMap: {
16
16
  readonly tool: "工具";
17
+ readonly skill: "Skill";
17
18
  readonly mcp: "MCP";
18
19
  readonly doc: "知识库";
19
20
  readonly knowledgebase: "知识库";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueking/chat-x",
3
- "version": "0.0.45-beta.6",
3
+ "version": "0.0.45-beta.7",
4
4
  "description": "蓝鲸智云 AI Chat 组件库 —— 遵循 AG-UI,为 AI Agent 和人类开发者共同设计的对话 UI 组件库。",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -78,7 +78,7 @@
78
78
  "vitepress": "2.0.0-alpha.16",
79
79
  "vitest": "^4.0.18",
80
80
  "vue-tsc": "^3.1.4",
81
- "@blueking/chat-helper": "0.0.12-beta.1"
81
+ "@blueking/chat-helper": "0.0.12-beta.2"
82
82
  },
83
83
  "scripts": {
84
84
  "dev": "vite --config vite.config.ts",