langgraph-vue3-chatbot 0.1.20 → 0.1.22

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.
Files changed (2) hide show
  1. package/README.md +21 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -19,13 +19,17 @@
19
19
  - `AskAiBot`:悬浮按钮 + 展开聊天窗,适合挂在页面右下角快速唤起
20
20
  - `ChatBot`:可直接嵌入页面的聊天面板,适合详情页、工作台、后台系统等场景
21
21
 
22
- 组件内部已集成:流式消息渲染、工具调用展示、附件能力、建议问题、模型选择等常见 AI 聊天能力。
22
+ 组件内部已集成:流式消息渲染、工具调用展示、附件能力、建议问题、模型选择、浅色/深色主题切换等常见 AI 聊天能力。
23
23
 
24
24
  ## 预览
25
25
 
26
26
  <p align="center">
27
- <img src="https://raw.githubusercontent.com/izerui/langgraph-vue3-chatbot/main/docs/img.png" alt="langgraph-vue3-chatbot preview 1" width="48%" />
28
- <img src="https://raw.githubusercontent.com/izerui/langgraph-vue3-chatbot/main/docs/img_1.png" alt="langgraph-vue3-chatbot preview 2" width="48%" />
27
+ <img src="https://raw.githubusercontent.com/izerui/langgraph-vue3-chatbot/main/docs/img.png" alt="langgraph-vue3-chatbot light theme preview" width="48%" />
28
+ <img src="https://raw.githubusercontent.com/izerui/langgraph-vue3-chatbot/main/docs/img_1.png" alt="langgraph-vue3-chatbot dark theme preview" width="48%" />
29
+ </p>
30
+
31
+ <p align="center">
32
+ 左图为浅色主题(<code>light</code>),右图为深色主题(<code>dark</code>)。
29
33
  </p>
30
34
 
31
35
  ## 特性
@@ -79,6 +83,7 @@ import { AskAiBot } from 'langgraph-vue3-chatbot'
79
83
  assistant-id="research"
80
84
  assistant-name="AI 助手"
81
85
  api-url="http://localhost:2024"
86
+ theme="light"
82
87
  :width="400"
83
88
  height="calc(100vh - 120px)"
84
89
  />
@@ -100,6 +105,7 @@ import { ChatBot } from 'langgraph-vue3-chatbot'
100
105
  assistant-id="research"
101
106
  assistant-name="AI 助手"
102
107
  api-url="http://localhost:2024"
108
+ theme="dark"
103
109
  :show-header-actions="false"
104
110
  />
105
111
  </div>
@@ -112,11 +118,13 @@ import { ChatBot } from 'langgraph-vue3-chatbot'
112
118
 
113
119
  ```vue
114
120
  <script setup lang="ts">
115
- import { AskAiBot, ChatBot } from 'langgraph-vue3-chatbot'
121
+ import { AskAiBot, ChatBot, type AiBotTheme } from 'langgraph-vue3-chatbot'
116
122
 
117
123
  const apiUrl = import.meta.env.VITE_LANGGRAPH_API_URL || 'http://localhost:2024'
118
124
  const assistantId = import.meta.env.VITE_LANGGRAPH_ASSISTANT_ID || 'demo-assistant'
119
125
  const assistantName = import.meta.env.VITE_LANGGRAPH_ASSISTANT_NAME || 'AI 助手'
126
+ const chatbotTheme: AiBotTheme = 'light'
127
+ const askAiBotTheme: AiBotTheme = 'dark'
120
128
 
121
129
  const suggestions = [
122
130
  '这个 demo 怎么接入真实服务?',
@@ -129,6 +137,7 @@ const suggestions = [
129
137
  :api-url="apiUrl"
130
138
  :assistant-id="assistantId"
131
139
  :assistant-name="assistantName"
140
+ :theme="chatbotTheme"
132
141
  />
133
142
 
134
143
  <AskAiBot
@@ -136,6 +145,7 @@ const suggestions = [
136
145
  :assistant-id="assistantId"
137
146
  :assistant-name="assistantName"
138
147
  :suggestions="suggestions"
148
+ :theme="askAiBotTheme"
139
149
  />
140
150
  </template>
141
151
  ```
@@ -155,6 +165,7 @@ const suggestions = [
155
165
  | `suggestions` | 配置输入区上方的建议问题列表 | `[]` |
156
166
  | `apiUrl` | 指定 LangGraph 服务地址 | `'http://localhost:2024'` |
157
167
  | `apiKey` | 指定 LangGraph 服务访问凭证 | `undefined` |
168
+ | `theme` | 设置组件主题,可选 `light` / `dark` | `'light'` |
158
169
  | `width` | 设置悬浮聊天窗打开后的宽度,支持 `number` 或 CSS 尺寸字符串 | `400` |
159
170
  | `height` | 设置悬浮聊天窗打开后的高度,支持 `number` 或 CSS 尺寸字符串 | `'calc(100vh - 90px)'` |
160
171
 
@@ -171,6 +182,7 @@ const suggestions = [
171
182
  | `suggestions` | 配置输入区上方的建议问题列表 | `[]` |
172
183
  | `apiUrl` | 指定 LangGraph 服务地址 | `'http://localhost:2024'` |
173
184
  | `apiKey` | 指定 LangGraph 服务访问凭证 | `undefined` |
185
+ | `theme` | 设置组件主题,可选 `light` / `dark` | `'light'` |
174
186
 
175
187
  ## Slots
176
188
 
@@ -195,6 +207,11 @@ const suggestions = [
195
207
  - 组件通过主入口导出
196
208
  - 主入口会自动带出组件样式
197
209
  - 使用时无需额外单独引入样式文件
210
+ - 当前内置两套主题:`light`(浅色,默认)与 `dark`(深色)
211
+ - `AskAiBot` 的 `theme` 会同时作用于外层悬浮按钮、内部 `ChatBot` 与 portal 浮层
212
+ - 内部 markdown 渲染基于 `markstream-vue`,代码高亮会随主题自动切换:
213
+ - `light` -> `vitesse-light`
214
+ - `dark` -> `vitesse-dark`
198
215
 
199
216
  ## 使用建议
200
217
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langgraph-vue3-chatbot",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist-lib/index.js",