@blueking/chat-x 0.0.52-dev.2 → 0.0.52-dev.4

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.
@@ -32,16 +32,16 @@
32
32
  ai-chat-input-container(padding: 0 16px 16px)
33
33
  ├── slot#top(框体外顶部)
34
34
  ├── slot#interrupt(框体外顶部,位于 top 之后)
35
- └── chat-input-wrapper(相对定位;宽度 168px ~ 1000px)
36
- ├── InputMenuPanel(绝对定位于框体上方 8px、与框体等宽,菜单激活且有条目时渲染)
37
- └── chat-input(框体,min-height 110px,max-height 由 inputMaxHeight 控制)
38
- ├── slot#input-header(默认:cite 非空时渲染 CiteContent)
39
- ├── slot#files(默认:有上传文件时渲染 FileContent)
40
- ├── AiSlashInput(富文本编辑区,默认保持 4 行高度)
41
- └── InputAttachment(底部工具栏,固定 32px 高)
42
- ├── slot#default → 隐藏 file input + AddMenuBtn(+ 号)+ 分隔线 + slot#attachment
43
- ├── slot#before-send → slot#model-selector(默认 ModelSelector)
44
- └── slot#send-icon(默认:发送 / 停止图标)
35
+ └── chat-input-wrapper(宽度 168px ~ 1000px)
36
+ └── InputMenu(vue-tippy 挂到输入框,菜单激活且有条目时展开;面板在 body,框体上方 8px、与框体等宽)
37
+ └── chat-input(框体,min-height 110px,max-height 由 inputMaxHeight 控制)
38
+ ├── slot#input-header(默认:cite 非空时渲染 CiteContent)
39
+ ├── slot#files(默认:有上传文件时渲染 FileContent)
40
+ ├── AiSlashInput(富文本编辑区,默认保持 4 行高度)
41
+ └── InputAttachment(底部工具栏,固定 32px 高)
42
+ ├── slot#default → 隐藏 file input + AddMenuBtn(+ 号)+ 分隔线 + slot#attachment
43
+ ├── slot#before-send → slot#model-selector(默认 ModelSelector)
44
+ └── slot#send-icon(默认:发送 / 停止图标)
45
45
  ```
46
46
 
47
47
  > `slot#attachment` 只替换快捷指令区,`AddMenuBtn` 在其外部,使用该插槽不会移除 + 号。`slot#send-icon` 只替换图标,点击逻辑与按钮样式仍由组件控制。
@@ -396,7 +396,7 @@ const defaultFiles: UploadFile[] = [
396
396
 
397
397
  ## 模型选择
398
398
 
399
- 传入 `models` 后在发送按钮左侧展示 [ModelSelector](/components/input/model-selector)。选中值(模型的 `llm_name`)通过 `v-model:selected-model` 双向绑定,`@model-change` 可获取完整模型对象,能力标签由组件依据 `property` 自动派生。
399
+ 传入 `models` 后在发送按钮左侧展示 [ModelSelector](/components/input/model-selector)。选中值(模型的 `llm_name`)通过 `v-model:selected-model` 双向绑定,`@model-change` 可获取完整模型对象,能力标签由组件依据 `property` 自动派生。默认选择器展开时会收起输入框菜单;自定义 `#model-selector` 时需自行处理。
400
400
 
401
401
  ```vue
402
402
  <template>
@@ -1,10 +1,10 @@
1
1
  <!-- AI SUMMARY -->
2
2
  ## 快速了解
3
3
 
4
- InputMenuPanel 渲染输入框菜单:分组标题 + InputMenuOption 条目 + 「更多 +N」折叠开关, 内置键盘上下导航与 Esc 关闭;分组数据由 useInputMenu 纯数据逻辑算出(按触发方式筛类型 → 关键字过滤 → 分组 → 折叠 → 扁平化)。 源码位置:src/components/chat-input/input-menu/(input-menu-panel.vue、input-menu-option.vue、use-input-menu.ts、constants.ts)。
4
+ InputMenuPanel 渲染输入框菜单:分组标题 + InputMenuOption 条目 + 「更多 +N」折叠开关, 内置键盘上下导航与 Esc 关闭;分组数据由 useInputMenu 纯数据逻辑算出(按触发方式筛类型 → 关键字过滤 → 分组 → 折叠 → 扁平化)。 源码位置:src/components/chat-input/input-menu/(input-menu.vue、input-menu-panel.vue、input-menu-option.vue、use-input-menu.ts、constants.ts)。
5
5
 
6
6
  ### 关联组件
7
- - **chat-input** — 上层持有触发态与数据源并渲染本面板
7
+ - **chat-input** — 上层持有触发态与数据源,通过 InputMenu(vue-tippy)渲染本面板
8
8
  - **ai-slash-input** — 触发方式与过滤关键字由编辑器 menuChange 抛出
9
9
  - **add-menu-btn** — + 号唤起 plus 触发的聚合菜单
10
10
  - **resource-icon** — 条目左侧图标由 ResourceIcon 渲染
@@ -19,6 +19,7 @@ InputMenuPanel 渲染输入框菜单:分组标题 + InputMenuOption 条目 +
19
19
  ## 源码事实
20
20
 
21
21
  - **面板**:`src/components/chat-input/input-menu/input-menu-panel.vue`
22
+ - **浮层壳**:`src/components/chat-input/input-menu/input-menu.vue`(vue-tippy,把面板挂到输入框上方)
22
23
  - **条目**:`src/components/chat-input/input-menu/input-menu-option.vue`
23
24
  - **数据逻辑**:`src/components/chat-input/input-menu/use-input-menu.ts`
24
25
  - **分组定义**:`src/components/chat-input/input-menu/constants.ts`
@@ -26,7 +27,7 @@ InputMenuPanel 渲染输入框菜单:分组标题 + InputMenuOption 条目 +
26
27
 
27
28
  ## 布局与交互
28
29
 
29
- - 面板由 [ChatInput](/components/input/chat-input) 绝对定位在输入框**正上方 8px**、与输入框等宽,**不跟随光标**;最大高度 400px,超出滚动。
30
+ - 面板由 [ChatInput](/components/input/chat-input) `InputMenu` 通过 **vue-tippy** 挂到输入框上:默认 `appendTo` body,位于框体**正上方 8px**、与输入框等宽,**不跟随光标**;最大高度 400px,超出滚动。浮层不再使用绝对定位,避免被外层 `overflow` 裁切。
30
31
  - 键盘导航由 [useMenuKeydown](/composables/use-menu-keydown) 提供:`↑` / `↓` 移动高亮,`Enter` 选中,高亮项滚动进可视区;结果集变化后高亮回到首项。
31
32
  - `Esc` 在**捕获阶段**监听并 emit `close`,避免被编辑器先行消费。
32
33
  - 面板滚动时关闭条目描述气泡,防止气泡与列表错位。
@@ -98,6 +98,7 @@ ModelSelector(Tippy 容器,theme: ai-model-selector)
98
98
  | 事件名 | 参数 | 说明 |
99
99
  | ------ | ----------------------- | -------------------- |
100
100
  | change | `(model: IModelOption)` | 用户选中模型时触发 |
101
+ | show | — | 下拉展开时触发(ChatInput 用来收起输入框菜单) |
101
102
 
102
103
  ## 类型定义
103
104
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "2.0.0",
3
- "generatedAt": "2026-09-15T08:21:06.653Z",
3
+ "generatedAt": "2026-09-16T03:27:02.809Z",
4
4
  "domains": {
5
5
  "setup": {
6
6
  "label": "对话搭建",
@@ -903,11 +903,11 @@
903
903
  "slug": "input-menu-panel",
904
904
  "kind": "component",
905
905
  "description": "输入框上方的统一菜单面板,@ / \\ 与 + 号共用一套数据源、分组与折叠逻辑。",
906
- "aiSummary": "InputMenuPanel 渲染输入框菜单:分组标题 + InputMenuOption 条目 + 「更多 +N」折叠开关, 内置键盘上下导航与 Esc 关闭;分组数据由 useInputMenu 纯数据逻辑算出(按触发方式筛类型 → 关键字过滤 → 分组 → 折叠 → 扁平化)。 源码位置:src/components/chat-input/input-menu/(input-menu-panel.vue、input-menu-option.vue、use-input-menu.ts、constants.ts)。",
906
+ "aiSummary": "InputMenuPanel 渲染输入框菜单:分组标题 + InputMenuOption 条目 + 「更多 +N」折叠开关, 内置键盘上下导航与 Esc 关闭;分组数据由 useInputMenu 纯数据逻辑算出(按触发方式筛类型 → 关键字过滤 → 分组 → 折叠 → 扁平化)。 源码位置:src/components/chat-input/input-menu/(input-menu.vue、input-menu-panel.vue、input-menu-option.vue、use-input-menu.ts、constants.ts)。",
907
907
  "relatedComponents": [
908
908
  {
909
909
  "slug": "chat-input",
910
- "relation": "上层持有触发态与数据源并渲染本面板"
910
+ "relation": "上层持有触发态与数据源,通过 InputMenu(vue-tippy)渲染本面板"
911
911
  },
912
912
  {
913
913
  "slug": "ai-slash-input",
package/dist/mcp/index.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,8 +1,26 @@
1
1
  {
2
2
  "name": "@blueking/chat-x",
3
- "version": "0.0.52-dev.2",
3
+ "version": "0.0.52-dev.4",
4
4
  "description": "蓝鲸智云 AI Chat 组件库 —— 遵循 AG-UI,为 AI Agent 和人类开发者共同设计的对话 UI 组件库。",
5
5
  "main": "index.js",
6
+ "scripts": {
7
+ "prepublishOnly": "vite --config vite.config.ts build && pnpm dts && pnpm mcp:build",
8
+ "dev": "vite --config vite.config.ts",
9
+ "dts": "vue-tsc --project tsconfig.dts.json",
10
+ "build": "vitest && vite --config vite.config.ts build && pnpm dts",
11
+ "preview": "vite --config vite.config.ts build --mode preview && pnpm dts",
12
+ "lint:script": "eslint . --ext .vue,.ts --fix",
13
+ "lint:style": "stylelint \"**/*.{scss,css,vue}\" --fix",
14
+ "lint:all": "pnpm lint:script && pnpm lint:style",
15
+ "test": "vitest",
16
+ "test:coverage": "vitest run --coverage",
17
+ "wiki:dev": "vitepress dev wikis",
18
+ "wiki:build": "vitepress build wikis",
19
+ "mcp:build:index": "tsx mcp/scripts/build-index.ts",
20
+ "mcp:build": "tsc -p mcp/tsconfig.json && pnpm mcp:build:index",
21
+ "mcp:start": "node dist/mcp/index.js",
22
+ "mcp:dev": "tsx mcp/src/index.ts"
23
+ },
6
24
  "bin": {
7
25
  "chat-x-mcp": "dist/mcp/index.js"
8
26
  },
@@ -51,6 +69,7 @@
51
69
  "zod": "^4.3.6"
52
70
  },
53
71
  "devDependencies": {
72
+ "@blueking/chat-helper": "workspace:*",
54
73
  "@types/katex": "^0.16.7",
55
74
  "@types/lodash": "^4.17.23",
56
75
  "@types/markdown-it": "^14.1.2",
@@ -79,24 +98,6 @@
79
98
  "vite-bundle-analyzer": "^1.3.2",
80
99
  "vitepress": "2.0.0-alpha.16",
81
100
  "vitest": "^4.0.18",
82
- "vue-tsc": "^3.1.4",
83
- "@blueking/chat-helper": "0.0.13-dev.1"
84
- },
85
- "scripts": {
86
- "dev": "vite --config vite.config.ts",
87
- "dts": "vue-tsc --project tsconfig.dts.json",
88
- "build": "vitest && vite --config vite.config.ts build && pnpm dts",
89
- "preview": "vite --config vite.config.ts build --mode preview && pnpm dts",
90
- "lint:script": "eslint . --ext .vue,.ts --fix",
91
- "lint:style": "stylelint \"**/*.{scss,css,vue}\" --fix",
92
- "lint:all": "pnpm lint:script && pnpm lint:style",
93
- "test": "vitest",
94
- "test:coverage": "vitest run --coverage",
95
- "wiki:dev": "vitepress dev wikis",
96
- "wiki:build": "vitepress build wikis",
97
- "mcp:build:index": "tsx mcp/scripts/build-index.ts",
98
- "mcp:build": "tsc -p mcp/tsconfig.json && pnpm mcp:build:index",
99
- "mcp:start": "node dist/mcp/index.js",
100
- "mcp:dev": "tsx mcp/src/index.ts"
101
+ "vue-tsc": "^3.1.4"
101
102
  }
102
103
  }
@@ -24,16 +24,16 @@
24
24
  ai-chat-input-container(padding: 0 16px 16px)
25
25
  ├── slot#top(框体外顶部)
26
26
  ├── slot#interrupt(框体外顶部,位于 top 之后)
27
- └── chat-input-wrapper(相对定位;宽度 168px ~ 1000px)
28
- ├── InputMenuPanel(绝对定位于框体上方 8px、与框体等宽,菜单激活且有条目时渲染)
29
- └── chat-input(框体,min-height 110px,max-height 由 inputMaxHeight 控制)
30
- ├── slot#input-header(默认:cite 非空时渲染 CiteContent)
31
- ├── slot#files(默认:有上传文件时渲染 FileContent)
32
- ├── AiSlashInput(富文本编辑区,默认保持 4 行高度)
33
- └── InputAttachment(底部工具栏,固定 32px 高)
34
- ├── slot#default → 隐藏 file input + AddMenuBtn(+ 号)+ 分隔线 + slot#attachment
35
- ├── slot#before-send → slot#model-selector(默认 ModelSelector)
36
- └── slot#send-icon(默认:发送 / 停止图标)
27
+ └── chat-input-wrapper(宽度 168px ~ 1000px)
28
+ └── InputMenu(vue-tippy 挂到输入框,菜单激活且有条目时展开;面板在 body,框体上方 8px、与框体等宽)
29
+ └── chat-input(框体,min-height 110px,max-height 由 inputMaxHeight 控制)
30
+ ├── slot#input-header(默认:cite 非空时渲染 CiteContent)
31
+ ├── slot#files(默认:有上传文件时渲染 FileContent)
32
+ ├── AiSlashInput(富文本编辑区,默认保持 4 行高度)
33
+ └── InputAttachment(底部工具栏,固定 32px 高)
34
+ ├── slot#default → 隐藏 file input + AddMenuBtn(+ 号)+ 分隔线 + slot#attachment
35
+ ├── slot#before-send → slot#model-selector(默认 ModelSelector)
36
+ └── slot#send-icon(默认:发送 / 停止图标)
37
37
  ```
38
38
 
39
39
  > `slot#attachment` 只替换快捷指令区,`AddMenuBtn` 在其外部,使用该插槽不会移除 + 号。`slot#send-icon` 只替换图标,点击逻辑与按钮样式仍由组件控制。
@@ -388,7 +388,7 @@ const defaultFiles: UploadFile[] = [
388
388
 
389
389
  ## 模型选择
390
390
 
391
- 传入 `models` 后在发送按钮左侧展示 [ModelSelector](/components/input/model-selector)。选中值(模型的 `llm_name`)通过 `v-model:selected-model` 双向绑定,`@model-change` 可获取完整模型对象,能力标签由组件依据 `property` 自动派生。
391
+ 传入 `models` 后在发送按钮左侧展示 [ModelSelector](/components/input/model-selector)。选中值(模型的 `llm_name`)通过 `v-model:selected-model` 双向绑定,`@model-change` 可获取完整模型对象,能力标签由组件依据 `property` 自动派生。默认选择器展开时会收起输入框菜单;自定义 `#model-selector` 时需自行处理。
392
392
 
393
393
  ```vue
394
394
  <template>
@@ -2,9 +2,9 @@
2
2
 
3
3
  > 能力域:输入交互 | 未从包入口导出:内部组件,请通过上层组件使用 | since 0.0.51
4
4
 
5
- InputMenuPanel 渲染输入框菜单:分组标题 + InputMenuOption 条目 + 「更多 +N」折叠开关, 内置键盘上下导航与 Esc 关闭;分组数据由 useInputMenu 纯数据逻辑算出(按触发方式筛类型 → 关键字过滤 → 分组 → 折叠 → 扁平化)。 源码位置:src/components/chat-input/input-menu/(input-menu-panel.vue、input-menu-option.vue、use-input-menu.ts、constants.ts)。
5
+ InputMenuPanel 渲染输入框菜单:分组标题 + InputMenuOption 条目 + 「更多 +N」折叠开关, 内置键盘上下导航与 Esc 关闭;分组数据由 useInputMenu 纯数据逻辑算出(按触发方式筛类型 → 关键字过滤 → 分组 → 折叠 → 扁平化)。 源码位置:src/components/chat-input/input-menu/(input-menu.vue、input-menu-panel.vue、input-menu-option.vue、use-input-menu.ts、constants.ts)。
6
6
 
7
- **关联**:chat-input(上层持有触发态与数据源并渲染本面板)、ai-slash-input(触发方式与过滤关键字由编辑器 menuChange 抛出)、add-menu-btn(+ 号唤起 plus 触发的聚合菜单)、resource-icon(条目左侧图标由 ResourceIcon 渲染)
7
+ **关联**:chat-input(上层持有触发态与数据源,通过 InputMenu / vue-tippy 渲染本面板)、ai-slash-input(触发方式与过滤关键字由编辑器 menuChange 抛出)、add-menu-btn(+ 号唤起 plus 触发的聚合菜单)、resource-icon(条目左侧图标由 ResourceIcon 渲染)
8
8
 
9
9
  ---
10
10
 
@@ -15,6 +15,7 @@ InputMenuPanel 渲染输入框菜单:分组标题 + InputMenuOption 条目 +
15
15
  ## 源码事实
16
16
 
17
17
  - **面板**:`src/components/chat-input/input-menu/input-menu-panel.vue`
18
+ - **浮层壳**:`src/components/chat-input/input-menu/input-menu.vue`(vue-tippy,把面板挂到输入框上方)
18
19
  - **条目**:`src/components/chat-input/input-menu/input-menu-option.vue`
19
20
  - **数据逻辑**:`src/components/chat-input/input-menu/use-input-menu.ts`
20
21
  - **分组定义**:`src/components/chat-input/input-menu/constants.ts`
@@ -22,7 +23,7 @@ InputMenuPanel 渲染输入框菜单:分组标题 + InputMenuOption 条目 +
22
23
 
23
24
  ## 布局与交互
24
25
 
25
- - 面板由 [ChatInput](/components/input/chat-input) 绝对定位在输入框**正上方 8px**、与输入框等宽,**不跟随光标**;最大高度 400px,超出滚动。
26
+ - 面板由 [ChatInput](/components/input/chat-input) `InputMenu` 通过 **vue-tippy** 挂到输入框上:默认 `appendTo` body,位于框体**正上方 8px**、与输入框等宽,**不跟随光标**;最大高度 400px,超出滚动。浮层不再使用绝对定位,避免被外层 `overflow` 裁切。
26
27
  - 键盘导航由 [useMenuKeydown](/composables/use-menu-keydown) 提供:`↑` / `↓` 移动高亮,`Enter` 选中,高亮项滚动进可视区;结果集变化后高亮回到首项。
27
28
  - `Esc` 在**捕获阶段**监听并 emit `close`,避免被编辑器先行消费。
28
29
  - 面板滚动时关闭条目描述气泡,防止气泡与列表错位。
@@ -96,6 +96,7 @@ ModelSelector(Tippy 容器,theme: ai-model-selector)
96
96
  | 事件名 | 参数 | 说明 |
97
97
  | ------ | ----------------------- | -------------------- |
98
98
  | change | `(model: IModelOption)` | 用户选中模型时触发 |
99
+ | show | — | 下拉展开时触发(ChatInput 用来收起输入框菜单) |
99
100
 
100
101
  ## 类型定义
101
102