@blueking/chat-x 2.4.1 → 2.4.2-beta.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.
@@ -309,6 +309,24 @@ const components: ShortcutComponent[] = [
309
309
  ];
310
310
  ```
311
311
 
312
+ `type: 'select'` 时,组件会把默认挂载点写进 `popoverOptions.boundary`,再与 `component.props.popoverOptions` 浅合并。调用方传入的字段(含 `boundary`)优先。
313
+
314
+ ## select 下拉挂载
315
+
316
+ Select 的下拉是 bkui Popover,默认会 Teleport 到 `document.body`,层级从 8000 起算。小鲸浮窗是 `position: fixed; z-index: 10000`,下拉挂到 body 后会画在浮窗后面。
317
+
318
+ `ShortcutRender` 挂在 `ChatContainer` 内时,复用同一份 tippy `appendTo`(`useCommonTippyInject`)作为 `popoverOptions.boundary`:
319
+
320
+ | `appendTo` | `boundary` |
321
+ | --- | --- |
322
+ | `HTMLElement` | 该元素 |
323
+ | 返回 `HTMLElement` 的函数 | 函数返回值。ChatBot 默认是 `() => rootRef ?? document.body`,即 `.ai-chatbot` |
324
+ | 未注入,或值为 `'parent'` 等无法解析的结果 | `'body'` |
325
+
326
+ 这样下拉留在小鲸自己的层叠上下文里,bkui 自己的递增 z-index 即可盖过表单,不必再写死一个高于浮窗的数字。
327
+
328
+ 不要把 `boundary` 设成 `'parent'`。`.ai-shortcut-render` 有 `overflow: hidden`,下拉会被裁掉。全屏时 `ChatContainer` 会把 `appendTo` 换成全屏容器,下拉跟着挂到那里。
329
+
312
330
  通过 `component.formItemProps` 透传给 `Form.FormItem`:
313
331
 
314
332
  ```typescript
@@ -368,7 +386,7 @@ const components: ShortcutComponent[] = [
368
386
  | `text` | `Input` | 同 `input`,兼容旧版写法 |
369
387
  | `textarea` | `Input[type=textarea]` | 多行文本,**始终独占一行** |
370
388
  | `number` | `Input[type=number]` | 数字输入,支持 `min` / `max` |
371
- | `select` | `Select` | 下拉选择,需配置 `options` |
389
+ | `select` | `Select` | 下拉选择,需配置 `options`;下拉挂载见 [select 下拉挂载](#select-下拉挂载) |
372
390
  | `radioGroup` | `Radio.Group` | 单选组,需配置 `options` |
373
391
  | `checkboxGroup` | `Checkbox.Group` | 多选组,需配置 `options` |
374
392
  | `switcher` | `Switcher` | 开关,值为 `boolean` |
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "2.0.0",
3
- "generatedAt": "2026-09-21T11:36:57.667Z",
3
+ "generatedAt": "2026-09-28T07:36:28.606Z",
4
4
  "domains": {
5
5
  "setup": {
6
6
  "label": "对话搭建",
package/dist/mcp/index.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,26 +1,8 @@
1
1
  {
2
2
  "name": "@blueking/chat-x",
3
- "version": "2.4.1",
3
+ "version": "2.4.2-beta.1",
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
- },
24
6
  "bin": {
25
7
  "chat-x-mcp": "dist/mcp/index.js"
26
8
  },
@@ -69,7 +51,6 @@
69
51
  "zod": "^4.3.6"
70
52
  },
71
53
  "devDependencies": {
72
- "@blueking/chat-helper": "workspace:*",
73
54
  "@types/katex": "^0.16.7",
74
55
  "@types/lodash": "^4.17.23",
75
56
  "@types/markdown-it": "^14.1.2",
@@ -98,6 +79,24 @@
98
79
  "vite-bundle-analyzer": "^1.3.2",
99
80
  "vitepress": "2.0.0-alpha.16",
100
81
  "vitest": "^4.0.18",
101
- "vue-tsc": "^3.1.4"
82
+ "vue-tsc": "^3.1.4",
83
+ "@blueking/chat-helper": "2.4.0"
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"
102
101
  }
103
- }
102
+ }
@@ -306,6 +306,24 @@ const components: ShortcutComponent[] = [
306
306
  ];
307
307
  ```
308
308
 
309
+ `type: 'select'` 时,组件会把默认挂载点写进 `popoverOptions.boundary`,再与 `component.props.popoverOptions` 浅合并。调用方传入的字段(含 `boundary`)优先。
310
+
311
+ ## select 下拉挂载
312
+
313
+ Select 的下拉是 bkui Popover,默认会 Teleport 到 `document.body`,层级从 8000 起算。小鲸浮窗是 `position: fixed; z-index: 10000`,下拉挂到 body 后会画在浮窗后面。
314
+
315
+ `ShortcutRender` 挂在 `ChatContainer` 内时,复用同一份 tippy `appendTo`(`useCommonTippyInject`)作为 `popoverOptions.boundary`:
316
+
317
+ | `appendTo` | `boundary` |
318
+ | --- | --- |
319
+ | `HTMLElement` | 该元素 |
320
+ | 返回 `HTMLElement` 的函数 | 函数返回值。ChatBot 默认是 `() => rootRef ?? document.body`,即 `.ai-chatbot` |
321
+ | 未注入,或值为 `'parent'` 等无法解析的结果 | `'body'` |
322
+
323
+ 这样下拉留在小鲸自己的层叠上下文里,bkui 自己的递增 z-index 即可盖过表单,不必再写死一个高于浮窗的数字。
324
+
325
+ 不要把 `boundary` 设成 `'parent'`。`.ai-shortcut-render` 有 `overflow: hidden`,下拉会被裁掉。全屏时 `ChatContainer` 会把 `appendTo` 换成全屏容器,下拉跟着挂到那里。
326
+
309
327
  通过 `component.formItemProps` 透传给 `Form.FormItem`:
310
328
 
311
329
  ```typescript
@@ -365,7 +383,7 @@ const components: ShortcutComponent[] = [
365
383
  | `text` | `Input` | 同 `input`,兼容旧版写法 |
366
384
  | `textarea` | `Input[type=textarea]` | 多行文本,**始终独占一行** |
367
385
  | `number` | `Input[type=number]` | 数字输入,支持 `min` / `max` |
368
- | `select` | `Select` | 下拉选择,需配置 `options` |
386
+ | `select` | `Select` | 下拉选择,需配置 `options`;下拉挂载见 [select 下拉挂载](#select-下拉挂载) |
369
387
  | `radioGroup` | `Radio.Group` | 单选组,需配置 `options` |
370
388
  | `checkboxGroup` | `Checkbox.Group` | 多选组,需配置 `options` |
371
389
  | `switcher` | `Switcher` | 开关,值为 `boolean` |