@blueking/chat-x 0.0.51-beta.2 → 0.0.51-beta.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.
- package/dist/components/chat-content/file-content/upload-image-item.vue.d.ts +2 -0
- package/dist/components/chat-content/file-content/upload-spinner.vue.d.ts +3 -0
- package/dist/components/chat-input/chat-input.vue.d.ts +7 -3
- package/dist/index.css +1 -1
- package/dist/index.js +1044 -1010
- package/dist/index.js.map +1 -1
- package/dist/lang/lang.d.ts +4 -1
- package/dist/mcp/generated/docs/chat-container.md +1 -1
- package/dist/mcp/generated/docs/chat-input.md +11 -10
- package/dist/mcp/generated/docs/file-content.md +27 -10
- package/dist/mcp/generated/index.json +3 -3
- package/dist/mcp/index.js +0 -0
- package/package.json +21 -23
- package/skills/blueking-chat-x/SKILL.md +0 -139
- package/skills/blueking-chat-x/references/_index.md +0 -131
- package/skills/blueking-chat-x/references/components/activity-layout.md +0 -134
- package/skills/blueking-chat-x/references/components/activity-message.md +0 -486
- package/skills/blueking-chat-x/references/components/ai-image.md +0 -230
- package/skills/blueking-chat-x/references/components/ai-loading.md +0 -131
- package/skills/blueking-chat-x/references/components/ai-prompt-list.md +0 -44
- package/skills/blueking-chat-x/references/components/ai-selection.md +0 -439
- package/skills/blueking-chat-x/references/components/ai-skill-list.md +0 -73
- package/skills/blueking-chat-x/references/components/ai-slash-editor.md +0 -43
- package/skills/blueking-chat-x/references/components/ai-slash-input.md +0 -56
- package/skills/blueking-chat-x/references/components/ai-slash-menu.md +0 -42
- package/skills/blueking-chat-x/references/components/animation-text.md +0 -202
- package/skills/blueking-chat-x/references/components/assistant-message.md +0 -498
- package/skills/blueking-chat-x/references/components/chat-container.md +0 -869
- package/skills/blueking-chat-x/references/components/chat-input.md +0 -769
- package/skills/blueking-chat-x/references/components/cite-content.md +0 -142
- package/skills/blueking-chat-x/references/components/code-content.md +0 -211
- package/skills/blueking-chat-x/references/components/common-error-content.md +0 -73
- package/skills/blueking-chat-x/references/components/content-render.md +0 -233
- package/skills/blueking-chat-x/references/components/delete-tool.md +0 -191
- package/skills/blueking-chat-x/references/components/desc-panel.md +0 -162
- package/skills/blueking-chat-x/references/components/detail-section.md +0 -91
- package/skills/blueking-chat-x/references/components/execution-summary.md +0 -128
- package/skills/blueking-chat-x/references/components/file-artifact-panel.md +0 -289
- package/skills/blueking-chat-x/references/components/file-content.md +0 -319
- package/skills/blueking-chat-x/references/components/file-icon.md +0 -109
- package/skills/blueking-chat-x/references/components/file-upload-btn.md +0 -159
- package/skills/blueking-chat-x/references/components/flow-agent-content.md +0 -264
- package/skills/blueking-chat-x/references/components/flow-agent-node-detail.md +0 -236
- package/skills/blueking-chat-x/references/components/highlight-keyword.md +0 -146
- package/skills/blueking-chat-x/references/components/image-content.md +0 -182
- package/skills/blueking-chat-x/references/components/image-preview-group.md +0 -184
- package/skills/blueking-chat-x/references/components/image-preview.md +0 -226
- package/skills/blueking-chat-x/references/components/info-message.md +0 -144
- package/skills/blueking-chat-x/references/components/input-attachment.md +0 -49
- package/skills/blueking-chat-x/references/components/input-info-alert.md +0 -42
- package/skills/blueking-chat-x/references/components/interrupt-message.md +0 -212
- package/skills/blueking-chat-x/references/components/key-value-content.md +0 -128
- package/skills/blueking-chat-x/references/components/knowledge-rag-content.md +0 -122
- package/skills/blueking-chat-x/references/components/latex-content.md +0 -200
- package/skills/blueking-chat-x/references/components/loading-message.md +0 -192
- package/skills/blueking-chat-x/references/components/markdown-content.md +0 -232
- package/skills/blueking-chat-x/references/components/mermaid-content.md +0 -189
- package/skills/blueking-chat-x/references/components/message-container.md +0 -645
- package/skills/blueking-chat-x/references/components/message-loading.md +0 -118
- package/skills/blueking-chat-x/references/components/message-render.md +0 -327
- package/skills/blueking-chat-x/references/components/message-time.md +0 -177
- package/skills/blueking-chat-x/references/components/message-tools.md +0 -416
- package/skills/blueking-chat-x/references/components/model-selector.md +0 -155
- package/skills/blueking-chat-x/references/components/preview-toolbar.md +0 -42
- package/skills/blueking-chat-x/references/components/questions-container.md +0 -85
- package/skills/blueking-chat-x/references/components/reasoning-message.md +0 -232
- package/skills/blueking-chat-x/references/components/reference-content.md +0 -135
- package/skills/blueking-chat-x/references/components/reference-doc-content.md +0 -109
- package/skills/blueking-chat-x/references/components/scroll-btn.md +0 -159
- package/skills/blueking-chat-x/references/components/selection-footer.md +0 -78
- package/skills/blueking-chat-x/references/components/selection-question.md +0 -88
- package/skills/blueking-chat-x/references/components/shortcut-btn.md +0 -204
- package/skills/blueking-chat-x/references/components/shortcut-btns.md +0 -266
- package/skills/blueking-chat-x/references/components/shortcut-render.md +0 -424
- package/skills/blueking-chat-x/references/components/simple-table.md +0 -101
- package/skills/blueking-chat-x/references/components/text-content.md +0 -77
- package/skills/blueking-chat-x/references/components/tool-approval-card.md +0 -183
- package/skills/blueking-chat-x/references/components/tool-btn.md +0 -317
- package/skills/blueking-chat-x/references/components/tool-message.md +0 -235
- package/skills/blueking-chat-x/references/components/toolcall-render.md +0 -348
- package/skills/blueking-chat-x/references/components/user-feedback.md +0 -233
- package/skills/blueking-chat-x/references/components/user-message.md +0 -424
- package/skills/blueking-chat-x/references/components/user-question-answered-card.md +0 -104
- package/skills/blueking-chat-x/references/components/user-question-card.md +0 -231
- package/skills/blueking-chat-x/references/components/user-question-choice.md +0 -105
- package/skills/blueking-chat-x/references/components/user-question-option.md +0 -42
- package/skills/blueking-chat-x/references/components/vnode-renderer.md +0 -122
- package/skills/blueking-chat-x/references/composables/use-animation-text.md +0 -196
- package/skills/blueking-chat-x/references/composables/use-artifact-preview.md +0 -231
- package/skills/blueking-chat-x/references/composables/use-clipboard.md +0 -203
- package/skills/blueking-chat-x/references/composables/use-command-selection.md +0 -150
- package/skills/blueking-chat-x/references/composables/use-container-scroll.md +0 -57
- package/skills/blueking-chat-x/references/composables/use-custom-tab.md +0 -158
- package/skills/blueking-chat-x/references/composables/use-flow-node-actions.md +0 -157
- package/skills/blueking-chat-x/references/composables/use-full-screen.md +0 -112
- package/skills/blueking-chat-x/references/composables/use-global-config.md +0 -148
- package/skills/blueking-chat-x/references/composables/use-menu-keydown.md +0 -163
- package/skills/blueking-chat-x/references/composables/use-message-group.md +0 -247
- package/skills/blueking-chat-x/references/composables/use-observer-visible-list.md +0 -188
- package/skills/blueking-chat-x/references/composables/use-parent-scrolling.md +0 -46
- package/skills/blueking-chat-x/references/theme/theme.md +0 -431
- package/skills/blueking-chat-x/references/types/constants.md +0 -307
- package/skills/blueking-chat-x/references/types/interrupt.md +0 -379
- package/skills/blueking-chat-x/references/types/messages.md +0 -553
- package/skills/blueking-chat-x/references/types/schema.md +0 -91
- package/skills/blueking-chat-x/scripts/generate-references.mjs +0 -314
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
# AiImage 图片展示
|
|
2
|
-
|
|
3
|
-
> 能力域:媒体文件 | 导入:`import { AiImage } from '@blueking/chat-x'` | since 1.0.0
|
|
4
|
-
|
|
5
|
-
图片展示组件,组合加载、错误、预览和 extra 插槽。 源码位置:src/components/image-preview/image.vue。
|
|
6
|
-
|
|
7
|
-
**关联**:image-preview(独立模式下内嵌全屏预览,单图预览入口)、image-preview-group(组内注册子图并统一打开多图预览)
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# AiImage 图片展示
|
|
12
|
-
## 源码事实
|
|
13
|
-
|
|
14
|
-
- **源码位置**:`src/components/image-preview/image.vue`
|
|
15
|
-
- **能力域**:媒体文件
|
|
16
|
-
- **能力说明**:图片展示组件,组合加载、错误、预览和 extra 插槽。
|
|
17
|
-
|
|
18
|
-
> **能力域**:媒体文件
|
|
19
|
-
|
|
20
|
-
图片展示组件,支持加载状态、加载失败重试、懒加载、点击预览等功能。可独立使用(单图预览),也可配合 `ImagePreviewGroup` 实现多图预览。
|
|
21
|
-
|
|
22
|
-
## 组件结构
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
.ai-image(display: inline-block,border-radius: 4px)
|
|
26
|
-
├── <img>(v-if status !== 'error' && actualSrc,object-fit: cover)
|
|
27
|
-
├── .ai-image-error(v-if status === 'error')
|
|
28
|
-
│ └── ImageErrorIcon(24×24,color: #c4c6cc)
|
|
29
|
-
├── .ai-image-error-overlay(v-if status === 'error',hover 时显示)
|
|
30
|
-
│ ├── ReloadIcon(16×16)
|
|
31
|
-
│ └── <span>"重新加载"</span>
|
|
32
|
-
├── <slot />
|
|
33
|
-
└── ImagePreview(v-if !groupContext && preview && previewVisible)
|
|
34
|
-
独立模式下的内置全屏预览
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## 基础用法
|
|
38
|
-
|
|
39
|
-
```vue
|
|
40
|
-
<template>
|
|
41
|
-
<AiImage
|
|
42
|
-
src="https://images.unsplash.com/photo-1506744038136-46273834b3fb?w=400&h=300&fit=crop"
|
|
43
|
-
:width="200"
|
|
44
|
-
:height="150"
|
|
45
|
-
alt="风景图"
|
|
46
|
-
@load="handleLoad"
|
|
47
|
-
@error="handleError"
|
|
48
|
-
@preview="handlePreview"
|
|
49
|
-
/>
|
|
50
|
-
</template>
|
|
51
|
-
|
|
52
|
-
<script setup lang="ts">
|
|
53
|
-
import { AiImage } from '@blueking/chat-x';
|
|
54
|
-
|
|
55
|
-
const handleLoad = (ev: Event) => {
|
|
56
|
-
console.log('图片加载成功', ev);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const handleError = (ev: Event) => {
|
|
60
|
-
console.log('图片加载失败', ev);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const handlePreview = () => {
|
|
64
|
-
console.log('触发预览');
|
|
65
|
-
};
|
|
66
|
-
</script>
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
## 加载失败与重新加载
|
|
70
|
-
|
|
71
|
-
当图片加载失败时,显示错误占位图标,鼠标悬停后出现"重新加载"遮罩,点击可重新加载(内部通过追加时间戳参数实现缓存破坏):
|
|
72
|
-
|
|
73
|
-
```vue
|
|
74
|
-
<template>
|
|
75
|
-
<AiImage
|
|
76
|
-
src="https://invalid-url.example.com/not-exist.png"
|
|
77
|
-
:width="200"
|
|
78
|
-
:height="150"
|
|
79
|
-
/>
|
|
80
|
-
</template>
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
## 禁用预览
|
|
84
|
-
|
|
85
|
-
将 `preview` 设为 `false` 可禁用点击预览功能,此时图片不显示 `zoom-in` 光标:
|
|
86
|
-
|
|
87
|
-
```vue
|
|
88
|
-
<template>
|
|
89
|
-
<AiImage
|
|
90
|
-
src="https://images.unsplash.com/photo-1469474968028-56623f02e42e?w=400&h=300&fit=crop"
|
|
91
|
-
:width="200"
|
|
92
|
-
:height="150"
|
|
93
|
-
:preview="false"
|
|
94
|
-
/>
|
|
95
|
-
</template>
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
## 预览属性配置
|
|
99
|
-
|
|
100
|
-
通过 `previewProps` 可为预览弹窗配置不同的图片源(如高清原图)、名称、尺寸信息等:
|
|
101
|
-
|
|
102
|
-
```vue
|
|
103
|
-
<template>
|
|
104
|
-
<AiImage
|
|
105
|
-
src="https://images.unsplash.com/photo-1447752875215-b2761acb3c5d?w=400&h=300&fit=crop"
|
|
106
|
-
:width="200"
|
|
107
|
-
:height="150"
|
|
108
|
-
:preview-props="{
|
|
109
|
-
src: 'https://images.unsplash.com/photo-1447752875215-b2761acb3c5d?w=1920',
|
|
110
|
-
name: '森林.jpg',
|
|
111
|
-
width: 1920,
|
|
112
|
-
resolution: '1920×1080',
|
|
113
|
-
}"
|
|
114
|
-
:show-info="true"
|
|
115
|
-
/>
|
|
116
|
-
</template>
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
## 多图预览(配合 ImagePreviewGroup)
|
|
120
|
-
|
|
121
|
-
将多个 `AiImage` 放在 `ImagePreviewGroup` 中,点击任意图片会打开多图预览模式,支持左右切换:
|
|
122
|
-
|
|
123
|
-
```vue
|
|
124
|
-
<template>
|
|
125
|
-
<ImagePreviewGroup>
|
|
126
|
-
<AiImage
|
|
127
|
-
v-for="(src, i) in images"
|
|
128
|
-
:key="i"
|
|
129
|
-
:src="src"
|
|
130
|
-
:width="160"
|
|
131
|
-
:height="120"
|
|
132
|
-
/>
|
|
133
|
-
</ImagePreviewGroup>
|
|
134
|
-
</template>
|
|
135
|
-
|
|
136
|
-
<script setup lang="ts">
|
|
137
|
-
import { AiImage, ImagePreviewGroup } from '@blueking/chat-x';
|
|
138
|
-
|
|
139
|
-
const images = [
|
|
140
|
-
'https://images.unsplash.com/photo-1506744038136-46273834b3fb?w=400&h=300&fit=crop',
|
|
141
|
-
'https://images.unsplash.com/photo-1469474968028-56623f02e42e?w=400&h=300&fit=crop',
|
|
142
|
-
'https://images.unsplash.com/photo-1447752875215-b2761acb3c5d?w=400&h=300&fit=crop',
|
|
143
|
-
];
|
|
144
|
-
</script>
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
## 自定义下载
|
|
148
|
-
|
|
149
|
-
通过 `onDownload` 自定义下载行为(例如调用后端接口),不传时使用默认的 `<a>` 标签下载:
|
|
150
|
-
|
|
151
|
-
```vue
|
|
152
|
-
<template>
|
|
153
|
-
<AiImage
|
|
154
|
-
src="https://images.unsplash.com/photo-1506744038136-46273834b3fb?w=400&h=300&fit=crop"
|
|
155
|
-
:width="200"
|
|
156
|
-
:height="150"
|
|
157
|
-
:on-download="handleDownload"
|
|
158
|
-
/>
|
|
159
|
-
</template>
|
|
160
|
-
|
|
161
|
-
<script setup lang="ts">
|
|
162
|
-
import { AiImage } from '@blueking/chat-x';
|
|
163
|
-
|
|
164
|
-
const handleDownload = (url: string) => {
|
|
165
|
-
console.log('自定义下载:', url);
|
|
166
|
-
};
|
|
167
|
-
</script>
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
## API
|
|
171
|
-
|
|
172
|
-
### Props
|
|
173
|
-
|
|
174
|
-
| 属性名 | 类型 | 默认值 | 说明 |
|
|
175
|
-
| ------------ | ----------------------- | ------- | --------------------------------------------------------------- |
|
|
176
|
-
| src | `string` | — | **必填**,图片地址 |
|
|
177
|
-
| alt | `string` | `''` | 图片 alt 属性 |
|
|
178
|
-
| width | `number \| string` | — | 容器宽度,数字时单位为 px |
|
|
179
|
-
| height | `number \| string` | — | 容器高度,数字时单位为 px |
|
|
180
|
-
| lazy | `boolean` | `false` | 是否懒加载(IntersectionObserver,rootMargin: 200px) |
|
|
181
|
-
| preview | `boolean` | `true` | 是否启用点击预览;为 `true` 且图片加载成功时显示 `zoom-in` 光标 |
|
|
182
|
-
| previewProps | `ImagePreviewConfig` | — | 预览弹窗配置(可指定高清源、名称、尺寸等) |
|
|
183
|
-
| showInfo | `boolean` | `false` | 预览工具栏是否显示图片尺寸信息 |
|
|
184
|
-
| onDownload | `(url: string) => void` | — | 自定义下载回调;不传时使用默认 `<a>` 标签下载 |
|
|
185
|
-
|
|
186
|
-
### Events
|
|
187
|
-
|
|
188
|
-
| 事件名 | 参数 | 说明 |
|
|
189
|
-
| ------- | ------------- | ------------------ |
|
|
190
|
-
| load | `(ev: Event)` | 图片加载成功时触发 |
|
|
191
|
-
| error | `(ev: Event)` | 图片加载失败时触发 |
|
|
192
|
-
| preview | — | 点击触发预览时触发 |
|
|
193
|
-
|
|
194
|
-
### Slots
|
|
195
|
-
|
|
196
|
-
| 插槽名 | 说明 |
|
|
197
|
-
| ------- | ----------------------------------------------- |
|
|
198
|
-
| default | 覆盖在图片上方的自定义内容 |
|
|
199
|
-
| extra | 预览工具栏的额外操作区域(透传给 ImagePreview) |
|
|
200
|
-
|
|
201
|
-
### Expose
|
|
202
|
-
|
|
203
|
-
| 属性名 | 类型 | 说明 |
|
|
204
|
-
| -------------- | -------------- | -------------------------------- |
|
|
205
|
-
| previewVisible | `Ref<boolean>` | 当前预览弹窗是否可见(独立模式) |
|
|
206
|
-
|
|
207
|
-
## 类型定义
|
|
208
|
-
|
|
209
|
-
```typescript
|
|
210
|
-
interface ImagePreviewConfig {
|
|
211
|
-
src?: string;
|
|
212
|
-
name?: string;
|
|
213
|
-
width?: number;
|
|
214
|
-
height?: number;
|
|
215
|
-
resolution?: string;
|
|
216
|
-
downloadUrl?: string;
|
|
217
|
-
}
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
## 使用场景
|
|
221
|
-
|
|
222
|
-
- AI 对话中的图片消息展示
|
|
223
|
-
- 需要点击放大查看的缩略图
|
|
224
|
-
- 多图浏览场景(配合 `ImagePreviewGroup`)
|
|
225
|
-
- 懒加载长列表中的图片
|
|
226
|
-
|
|
227
|
-
## 关联组件
|
|
228
|
-
|
|
229
|
-
- [ImagePreview](/components/medias/image-preview) — 独立模式下的全屏预览
|
|
230
|
-
- [ImagePreviewGroup](/components/medias/image-preview-group) — 多图注册与预览上下文
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
# AiLoading 三点加载
|
|
2
|
-
|
|
3
|
-
> 能力域:辅助能力 | 导入:`import { AiLoading } from '@blueking/chat-x'` | since 1.0.0
|
|
4
|
-
|
|
5
|
-
小尺寸 AI 加载动效。 源码位置:src/components/ai-loading/ai-loading.vue。
|
|
6
|
-
|
|
7
|
-
**关联**:loading-message(列表末尾加载占位)、reasoning-message(推理进行中的加载指示)、activity-message(活动消息加载态指示)
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# AiLoading AI 加载动画
|
|
12
|
-
## 源码事实
|
|
13
|
-
|
|
14
|
-
- **源码位置**:`src/components/ai-loading/ai-loading.vue`
|
|
15
|
-
- **能力域**:辅助能力
|
|
16
|
-
- **能力说明**:小尺寸 AI 加载动效。
|
|
17
|
-
|
|
18
|
-
> **能力域**:辅助能力
|
|
19
|
-
|
|
20
|
-
AI 加载动画基础组件。由两层 SVG 叠加构成:外层旋转光环(带渐变弧线)+ 内层脉冲星形图标,两者共用同一套蓝→紫→粉渐变色。
|
|
21
|
-
|
|
22
|
-
## 组件结构
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
.ai-loading(inline-flex,position: relative,width/height 由 size prop 控制)
|
|
26
|
-
│ CSS 同时定义 width/height: 1em 兜底,inline style 优先
|
|
27
|
-
│
|
|
28
|
-
├── .ai-loading-ring(position: absolute,svg 100%×100%)
|
|
29
|
-
│ 旋转弧线:ai-loading-rotate 0.8s linear infinite
|
|
30
|
-
│ 渐变:#235DFA → #8A77EC → #EB8CEC(蓝 → 紫 → 粉)
|
|
31
|
-
│
|
|
32
|
-
└── .ai-loading-star(position: absolute,svg 100%×100%)
|
|
33
|
-
脉冲星形:ai-loading-pulse 0.8s ease-in-out infinite
|
|
34
|
-
关键帧:scale(0.5) → scale(1) → scale(0.5)(小→大→小)
|
|
35
|
-
渐变:同上
|
|
36
|
-
|
|
37
|
-
stopLoading=true → 根元素加 .ai-loading-stopped
|
|
38
|
-
→ .ai-loading-stopped .ai-loading-ring { animation-play-state: paused }
|
|
39
|
-
→ .ai-loading-stopped .ai-loading-star { animation-play-state: paused }
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## 基础用法
|
|
43
|
-
|
|
44
|
-
```vue
|
|
45
|
-
<template>
|
|
46
|
-
<AiLoading />
|
|
47
|
-
</template>
|
|
48
|
-
|
|
49
|
-
<script setup lang="ts">
|
|
50
|
-
import { AiLoading } from '@blueking/chat-x';
|
|
51
|
-
</script>
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## 自定义尺寸
|
|
55
|
-
|
|
56
|
-
通过 `size` 属性控制图标大小(单位 px),默认 `16`:
|
|
57
|
-
|
|
58
|
-
```vue
|
|
59
|
-
<template>
|
|
60
|
-
<AiLoading />
|
|
61
|
-
<!-- 16px(默认) -->
|
|
62
|
-
<AiLoading :size="24" />
|
|
63
|
-
<AiLoading :size="32" />
|
|
64
|
-
<AiLoading :size="48" />
|
|
65
|
-
</template>
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## 暂停动画
|
|
69
|
-
|
|
70
|
-
`stopLoading` 为 `true` 时,组件根元素添加 `.ai-loading-stopped` class,两层动画同时进入 `paused` 状态(不移除元素,仅冻结帧):
|
|
71
|
-
|
|
72
|
-
```vue
|
|
73
|
-
<template>
|
|
74
|
-
<AiLoading :stop-loading="isPaused" />
|
|
75
|
-
<button @click="isPaused = !isPaused">
|
|
76
|
-
{{ isPaused ? '恢复' : '暂停' }}
|
|
77
|
-
</button>
|
|
78
|
-
</template>
|
|
79
|
-
|
|
80
|
-
<script setup lang="ts">
|
|
81
|
-
import { ref } from 'vue';
|
|
82
|
-
import { AiLoading } from '@blueking/chat-x';
|
|
83
|
-
|
|
84
|
-
const isPaused = ref(false);
|
|
85
|
-
</script>
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
## 多实例渐变隔离
|
|
89
|
-
|
|
90
|
-
每个 `AiLoading` 实例通过**模块级 `uid` 计数器**生成唯一的 SVG 渐变 ID:
|
|
91
|
-
|
|
92
|
-
```
|
|
93
|
-
ai-loading-ring-{instanceId}
|
|
94
|
-
ai-loading-star-{instanceId}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
同一页面挂载多个实例时,渐变互不影响。ring 和 star 的 `instanceId` 始终相同(同一组件内),SVG `<path fill="url(#...)" />` 正确引用各自实例的渐变定义。
|
|
98
|
-
|
|
99
|
-
## 动画规格
|
|
100
|
-
|
|
101
|
-
| 层 | 动画名 | 时长 | 缓动 | 关键帧 |
|
|
102
|
-
| ------------------ | ------------------- | ---- | ----------- | --------------------------------------- |
|
|
103
|
-
| `.ai-loading-ring` | `ai-loading-rotate` | 0.8s | linear | `0deg → 360deg` 匀速旋转 |
|
|
104
|
-
| `.ai-loading-star` | `ai-loading-pulse` | 0.8s | ease-in-out | `0%/100%: scale(0.5)` → `50%: scale(1)` |
|
|
105
|
-
|
|
106
|
-
脉冲动画节奏:以**半尺寸**起始 → 膨胀至**全尺寸**(0.4s)→ 收缩回**半尺寸**(0.4s),循环往复。
|
|
107
|
-
|
|
108
|
-
## API
|
|
109
|
-
|
|
110
|
-
### Props
|
|
111
|
-
|
|
112
|
-
| 属性名 | 类型 | 默认值 | 说明 |
|
|
113
|
-
| ----------- | --------- | ------- | -------------------------------------------------- |
|
|
114
|
-
| size | `number` | `16` | 图标尺寸(px),应用为 inline style,覆盖 CSS 默认 |
|
|
115
|
-
| stopLoading | `boolean` | `false` | `true` 时两层动画均 `paused`,图标停在当前帧 |
|
|
116
|
-
|
|
117
|
-
## 使用场景
|
|
118
|
-
|
|
119
|
-
组件库内部以下场景自动使用 `AiLoading`:
|
|
120
|
-
|
|
121
|
-
| 使用方 | 触发时机 | 固定尺寸 |
|
|
122
|
-
| ------------------ | ---------------------------------------------- | --------- |
|
|
123
|
-
| `LoadingMessage` | 等待 AI 首次响应(loading 消息占位) | 18px |
|
|
124
|
-
| `ReasoningMessage` | `status` 为 `pending`/`streaming` 时(思考中) | 默认 16px |
|
|
125
|
-
| `ActivityMessage` | 活动消息加载状态 | 默认 16px |
|
|
126
|
-
|
|
127
|
-
## 关联组件
|
|
128
|
-
|
|
129
|
-
- [LoadingMessage](/components/message/loading-message) — 对话加载消息
|
|
130
|
-
- [ReasoningMessage](/components/message/reasoning-message) — 推理加载态
|
|
131
|
-
- [ActivityMessage](/components/message/activity-message) — 活动加载态
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# AiPromptList Prompt 列表
|
|
2
|
-
|
|
3
|
-
> 能力域:输入交互 | 导入:`import { AiPromptList } from '@blueking/chat-x'` | since 1.0.0
|
|
4
|
-
|
|
5
|
-
\ Prompt 选择列表,供 AiSlashInput 插入模板文本。 源码位置:src/components/chat-input/ai-slash-input/ai-prompt-list/ai-prompt-list.vue。
|
|
6
|
-
|
|
7
|
-
**关联**:ai-slash-input(输入 \ 时由 AiSlashInput tippy 菜单渲染)
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# AiPromptList Prompt 列表
|
|
12
|
-
|
|
13
|
-
> **能力域**:输入交互
|
|
14
|
-
|
|
15
|
-
## 源码事实
|
|
16
|
-
|
|
17
|
-
- **源码位置**:`src/components/chat-input/ai-slash-input/ai-prompt-list/ai-prompt-list.vue`
|
|
18
|
-
- **能力说明**:`\` Prompt 选择列表,供 AiSlashInput 插入模板文本。
|
|
19
|
-
|
|
20
|
-
## API 摘要
|
|
21
|
-
|
|
22
|
-
### Props
|
|
23
|
-
|
|
24
|
-
- `{ onSelect: (prompt: string) => void; prompts: string[]; }`
|
|
25
|
-
|
|
26
|
-
### Emits
|
|
27
|
-
|
|
28
|
-
- 无。
|
|
29
|
-
|
|
30
|
-
### Slots
|
|
31
|
-
|
|
32
|
-
- 无。
|
|
33
|
-
|
|
34
|
-
### Expose
|
|
35
|
-
|
|
36
|
-
- 无。
|
|
37
|
-
|
|
38
|
-
## 组件依赖
|
|
39
|
-
|
|
40
|
-
- 无组件依赖或仅依赖基础库。
|
|
41
|
-
|
|
42
|
-
## 使用建议
|
|
43
|
-
|
|
44
|
-
- 优先通过上层组合组件使用;直接使用前请确认 props 数据结构来自对应类型定义。
|