@blueking/chat-x 0.0.20 → 0.0.21
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/composables/use-custom-tab.d.ts +1 -0
- package/dist/index.css +1 -1
- package/dist/index.js +1396 -1333
- package/dist/index.js.map +1 -1
- package/dist/mcp/generated/docs/chat-container.md +1 -1
- package/dist/mcp/generated/docs/markdown-content.md +5 -0
- package/dist/mcp/generated/docs/use-custom-tab.md +5 -1
- package/dist/plugins/markdown-container.d.ts +25 -0
- package/dist/utils/tokens-to-vnodes.d.ts +8 -2
- package/package.json +1 -1
- package/dist/mcp/generated/docs/constants.md +0 -216
- package/dist/mcp/generated/docs/markdown-latex.md +0 -208
- package/dist/mcp/generated/docs/markdown-mermaid.md +0 -250
- package/dist/mcp/generated/docs/messages.md +0 -472
- package/dist/mcp/generated/docs/theme.md +0 -388
- package/dist/mcp/generated/index.json +0 -1279
|
@@ -1,388 +0,0 @@
|
|
|
1
|
-
<!-- AI SUMMARY -->
|
|
2
|
-
## 快速了解
|
|
3
|
-
|
|
4
|
-
说明通过 SCSS 变量(尺寸、颜色、z-index)与 CSS 类覆盖(chat-input、用户/助手消息、shortcut-btns、ai-markdown-body、tool-btn 等)自定义主题。 含渐变边框 mixin、ai-markdown-fade-in 与弹窗过渡。暗色示例通过根 class 切换。组件随包引入样式,业务侧按需覆写。
|
|
5
|
-
|
|
6
|
-
### 关联组件
|
|
7
|
-
- **chat-container** — 整体布局与侧栏
|
|
8
|
-
- **chat-input** — 输入区与渐变边框
|
|
9
|
-
- **message-container** — 消息区样式上下文
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
<!-- FULL DOC -->
|
|
13
|
-
|
|
14
|
-
# 主题配置
|
|
15
|
-
|
|
16
|
-
> **分类**:theme
|
|
17
|
-
|
|
18
|
-
`@blueking/chat-x` 使用 SCSS 变量和 CSS 类来控制样式,支持通过覆盖变量或样式来自定义主题。
|
|
19
|
-
|
|
20
|
-
## 样式引入
|
|
21
|
-
|
|
22
|
-
组件库的样式会在引入组件时自动加载,无需单独引入:
|
|
23
|
-
|
|
24
|
-
```typescript
|
|
25
|
-
// 引入组件时会自动引入样式
|
|
26
|
-
import { ChatInput, MessageContainer } from '@blueking/chat-x';
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## SCSS 变量
|
|
30
|
-
|
|
31
|
-
组件库使用以下 SCSS 变量,可以在项目中覆盖:
|
|
32
|
-
|
|
33
|
-
### 尺寸变量
|
|
34
|
-
|
|
35
|
-
```scss
|
|
36
|
-
// 输入框尺寸
|
|
37
|
-
$chat-input-min-width: 350px;
|
|
38
|
-
$chat-input-max-width: 700px;
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### 颜色变量
|
|
42
|
-
|
|
43
|
-
```scss
|
|
44
|
-
// 主题色
|
|
45
|
-
$primary-color: #3a84ff;
|
|
46
|
-
|
|
47
|
-
// 文字颜色
|
|
48
|
-
$text-color-primary: #313238;
|
|
49
|
-
$text-color-secondary: #4d4f56;
|
|
50
|
-
$text-color-placeholder: #979ba5;
|
|
51
|
-
|
|
52
|
-
// 背景色
|
|
53
|
-
$bg-color-white: #fff;
|
|
54
|
-
$bg-color-light: #f5f7fa;
|
|
55
|
-
$bg-color-hover: #f0f1f5;
|
|
56
|
-
|
|
57
|
-
// 边框色
|
|
58
|
-
$border-color: #dcdee5;
|
|
59
|
-
$border-color-hover: #c4c6cc;
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### Z-Index 变量
|
|
63
|
-
|
|
64
|
-
组件库使用分层的 z-index 管理:
|
|
65
|
-
|
|
66
|
-
```scss
|
|
67
|
-
// 基础 z-index
|
|
68
|
-
$chat-z-index: 9999;
|
|
69
|
-
|
|
70
|
-
// 编辑器 z-index
|
|
71
|
-
$editor-z-index: $chat-z-index + 1;
|
|
72
|
-
|
|
73
|
-
// 编辑器菜单 z-index
|
|
74
|
-
$editor-menu-z-index: $editor-z-index + 1;
|
|
75
|
-
|
|
76
|
-
// 快捷指令菜单 z-index
|
|
77
|
-
$shortcut-menu-z-index: $editor-menu-z-index + 1;
|
|
78
|
-
|
|
79
|
-
// 划选弹窗 z-index
|
|
80
|
-
$selection-z-index: $shortcut-menu-z-index + 1;
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
## CSS 类覆盖
|
|
84
|
-
|
|
85
|
-
### 输入框样式
|
|
86
|
-
|
|
87
|
-
```scss
|
|
88
|
-
// 覆盖输入框容器样式
|
|
89
|
-
.chat-input-container {
|
|
90
|
-
.chat-input {
|
|
91
|
-
min-height: 120px; // 自定义最小高度
|
|
92
|
-
max-height: 250px; // 自定义最大高度
|
|
93
|
-
background: #fafafa; // 自定义背景色
|
|
94
|
-
|
|
95
|
-
// 覆盖边框渐变
|
|
96
|
-
&::before {
|
|
97
|
-
background: linear-gradient(180deg, #ff6b6b, #ff8e53);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### 消息样式
|
|
104
|
-
|
|
105
|
-
```scss
|
|
106
|
-
// 用户消息样式
|
|
107
|
-
.ai-user-message {
|
|
108
|
-
&-content {
|
|
109
|
-
background-color: #d4edda; // 自定义背景色
|
|
110
|
-
border-radius: 8px;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// AI 消息样式
|
|
115
|
-
.assistant-message {
|
|
116
|
-
&-content {
|
|
117
|
-
background-color: #f8f9fa;
|
|
118
|
-
border-left: 3px solid #3a84ff;
|
|
119
|
-
padding-left: 12px;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### 快捷指令按钮样式
|
|
125
|
-
|
|
126
|
-
```scss
|
|
127
|
-
// 快捷指令按钮
|
|
128
|
-
.shortcut-btns {
|
|
129
|
-
&-item {
|
|
130
|
-
background: linear-gradient(135deg, #667eea, #764ba2);
|
|
131
|
-
color: #fff;
|
|
132
|
-
|
|
133
|
-
&:hover {
|
|
134
|
-
transform: translateY(-2px);
|
|
135
|
-
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// 移除默认渐变边框
|
|
139
|
-
&::before {
|
|
140
|
-
display: none;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
### 消息工具栏样式
|
|
147
|
-
|
|
148
|
-
```scss
|
|
149
|
-
// 工具按钮
|
|
150
|
-
.tool-btn {
|
|
151
|
-
width: 24px;
|
|
152
|
-
height: 24px;
|
|
153
|
-
font-size: 16px;
|
|
154
|
-
|
|
155
|
-
&:hover {
|
|
156
|
-
background-color: #e1ecff;
|
|
157
|
-
color: #3a84ff;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
### Markdown 内容样式
|
|
163
|
-
|
|
164
|
-
```scss
|
|
165
|
-
// Markdown 内容
|
|
166
|
-
.ai-markdown-content {
|
|
167
|
-
.ai-markdown-body {
|
|
168
|
-
font-size: 14px;
|
|
169
|
-
line-height: 1.6;
|
|
170
|
-
|
|
171
|
-
// 代码块样式
|
|
172
|
-
pre code.hljs {
|
|
173
|
-
background-color: #1e1e1e;
|
|
174
|
-
border-radius: 8px;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// 表格样式
|
|
178
|
-
table {
|
|
179
|
-
border-collapse: collapse;
|
|
180
|
-
|
|
181
|
-
th,
|
|
182
|
-
td {
|
|
183
|
-
border: 1px solid #dcdee5;
|
|
184
|
-
padding: 8px 12px;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
th {
|
|
188
|
-
background-color: #f5f7fa;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
## 主题切换示例
|
|
196
|
-
|
|
197
|
-
### 暗色主题
|
|
198
|
-
|
|
199
|
-
```scss
|
|
200
|
-
// 暗色主题变量
|
|
201
|
-
.dark-theme {
|
|
202
|
-
// 输入框
|
|
203
|
-
.chat-input-container .chat-input {
|
|
204
|
-
background: #2d2d2d;
|
|
205
|
-
|
|
206
|
-
&::before {
|
|
207
|
-
background: linear-gradient(180deg, #4a90d9, #357abd);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
// 用户消息
|
|
212
|
-
.ai-user-message-content {
|
|
213
|
-
background-color: #3d5a80;
|
|
214
|
-
color: #fff;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
// AI 消息
|
|
218
|
-
.assistant-message {
|
|
219
|
-
color: #e0e0e0;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
// Markdown 内容
|
|
223
|
-
.ai-markdown-content .ai-markdown-body {
|
|
224
|
-
color: #e0e0e0;
|
|
225
|
-
|
|
226
|
-
h1,
|
|
227
|
-
h2,
|
|
228
|
-
h3,
|
|
229
|
-
h4,
|
|
230
|
-
h5,
|
|
231
|
-
h6 {
|
|
232
|
-
color: #fff;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
a {
|
|
236
|
-
color: #6cb2eb;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
code {
|
|
240
|
-
background-color: #3d3d3d;
|
|
241
|
-
color: #e0e0e0;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
// 快捷指令
|
|
246
|
-
.shortcut-btns-item {
|
|
247
|
-
background: #3d3d3d;
|
|
248
|
-
color: #e0e0e0;
|
|
249
|
-
|
|
250
|
-
&::before {
|
|
251
|
-
background: linear-gradient(105deg, #4a90d940, #9b59b640);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
// 工具按钮
|
|
256
|
-
.tool-btn {
|
|
257
|
-
color: #9e9e9e;
|
|
258
|
-
|
|
259
|
-
&:hover {
|
|
260
|
-
background-color: #424242;
|
|
261
|
-
color: #fff;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
### 使用暗色主题
|
|
268
|
-
|
|
269
|
-
```vue
|
|
270
|
-
<template>
|
|
271
|
-
<div :class="{ 'dark-theme': isDark }">
|
|
272
|
-
<ChatInput v-model="input" />
|
|
273
|
-
<MessageContainer :messages="messages" />
|
|
274
|
-
</div>
|
|
275
|
-
</template>
|
|
276
|
-
|
|
277
|
-
<script setup lang="ts">
|
|
278
|
-
import { ref } from 'vue';
|
|
279
|
-
import { ChatInput, MessageContainer } from '@blueking/chat-x';
|
|
280
|
-
|
|
281
|
-
const isDark = ref(false);
|
|
282
|
-
const input = ref('');
|
|
283
|
-
const messages = ref([]);
|
|
284
|
-
</script>
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
## 渐变边框
|
|
288
|
-
|
|
289
|
-
组件库使用 CSS mask 实现渐变边框效果:
|
|
290
|
-
|
|
291
|
-
```scss
|
|
292
|
-
// 渐变边框 mixin
|
|
293
|
-
@mixin linear-gradient-border($angle: 105deg, $start-color: #235dfa40, $end-color: #bc81ef40) {
|
|
294
|
-
content: '';
|
|
295
|
-
position: absolute;
|
|
296
|
-
inset: 0;
|
|
297
|
-
padding: 1px;
|
|
298
|
-
background: linear-gradient($angle, $start-color, $end-color);
|
|
299
|
-
mask:
|
|
300
|
-
linear-gradient(#fff 0 0) content-box,
|
|
301
|
-
linear-gradient(#fff 0 0);
|
|
302
|
-
mask-composite: xor;
|
|
303
|
-
mask-composite: exclude;
|
|
304
|
-
border-radius: inherit;
|
|
305
|
-
pointer-events: none;
|
|
306
|
-
}
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
使用示例:
|
|
310
|
-
|
|
311
|
-
```scss
|
|
312
|
-
.custom-card {
|
|
313
|
-
position: relative;
|
|
314
|
-
border-radius: 8px;
|
|
315
|
-
|
|
316
|
-
&::before {
|
|
317
|
-
@include linear-gradient-border(180deg, #6cbaff, #3a84ff);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
## 动画效果
|
|
323
|
-
|
|
324
|
-
### 淡入动画
|
|
325
|
-
|
|
326
|
-
```scss
|
|
327
|
-
// 全局淡入动画
|
|
328
|
-
@keyframes ai-markdown-fade-in {
|
|
329
|
-
from {
|
|
330
|
-
opacity: 0;
|
|
331
|
-
}
|
|
332
|
-
to {
|
|
333
|
-
opacity: 1;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
.ai-blueking-markdown-fade-in {
|
|
338
|
-
animation: ai-markdown-fade-in 0.2s ease-out forwards;
|
|
339
|
-
}
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
### 弹窗过渡
|
|
343
|
-
|
|
344
|
-
```scss
|
|
345
|
-
// 选择弹窗过渡
|
|
346
|
-
.ai-fade-enter-active,
|
|
347
|
-
.ai-fade-leave-active {
|
|
348
|
-
transition:
|
|
349
|
-
opacity 0.2s ease,
|
|
350
|
-
transform 0.2s ease;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
.ai-fade-enter-from,
|
|
354
|
-
.ai-fade-leave-to {
|
|
355
|
-
opacity: 0;
|
|
356
|
-
transform: translateY(4px);
|
|
357
|
-
}
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
## 响应式设计
|
|
361
|
-
|
|
362
|
-
```scss
|
|
363
|
-
// 移动端适配
|
|
364
|
-
@media (max-width: 768px) {
|
|
365
|
-
.chat-input-container .chat-input {
|
|
366
|
-
min-width: 100%;
|
|
367
|
-
max-width: 100%;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
.shortcut-btns {
|
|
371
|
-
min-width: 100%;
|
|
372
|
-
max-width: 100%;
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
```
|
|
376
|
-
|
|
377
|
-
## 注意事项
|
|
378
|
-
|
|
379
|
-
1. **样式优先级**:覆盖样式时可能需要使用更高优先级的选择器
|
|
380
|
-
2. **变量位置**:SCSS 变量需要在组件样式之前定义
|
|
381
|
-
3. **构建配置**:确保项目配置支持 SCSS 处理
|
|
382
|
-
4. **组件隔离**:使用 scoped 样式时,深度选择器 `::v-deep` 或 `:deep()` 可能需要
|
|
383
|
-
|
|
384
|
-
## 关联组件
|
|
385
|
-
|
|
386
|
-
- [ChatContainer](../components/molecular/chat-container.md) — 布局与主题根节点
|
|
387
|
-
- [ChatInput](../components/molecular/chat-input.md) — 输入区变量与类名
|
|
388
|
-
- [MessageContainer](../components/molecular/message-container.md) — 消息列表区域
|