ai-chat-ui-kit 0.1.0 → 0.1.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.
- package/LICENSE +21 -0
- package/README.md +4 -7
- package/package.json +8 -4
- package/.eslintrc.cjs +0 -74
- package/.github/actions/screenshot/action.yml +0 -35
- package/.github/workflows/pages.yml +0 -46
- package/docs/README.md +0 -176
- package/docs/api/components.md +0 -344
- package/docs/api/core.md +0 -349
- package/docs/chat-style-1-minimal.html +0 -78
- package/docs/chat-style-2-neon.html +0 -74
- package/docs/chat-style-3-glass.html +0 -73
- package/docs/chat-style-4-terminal.html +0 -84
- package/docs/chat-style-5-gradient.html +0 -69
- package/docs/chat-style-6-corporate.html +0 -116
- package/docs/examples/basic-chat.md +0 -291
- package/docs/examples/custom-plugins.md +0 -431
- package/docs/examples/multi-model.md +0 -466
- package/docs/guide/api-adapters.md +0 -431
- package/docs/guide/getting-started.md +0 -244
- package/docs/guide/headless-mode.md +0 -508
- package/docs/guide/plugins.md +0 -416
- package/docs/guide/themes.md +0 -327
- package/docs/index.html +0 -256
- package/docs/theme-preview-1-minimal.html +0 -74
- package/docs/theme-preview-2-neon.html +0 -73
- package/docs/theme-preview-3-glass.html +0 -77
- package/docs/theme-preview-4-terminal.html +0 -86
- package/docs/theme-preview-5-gradient.html +0 -79
- package/docs/theme-preview-6-corporate.html +0 -71
- package/examples/index.html +0 -414
- package/examples/react-app/App.tsx +0 -131
- package/examples/react-app/index.html +0 -12
- package/examples/react-app/main.tsx +0 -15
- package/examples/react-app/package.json +0 -24
- package/examples/vue-app/index.html +0 -12
- package/examples/vue-app/package.json +0 -22
- package/examples/vue-app/src/App.vue +0 -145
- package/examples/vue-app/src/main.ts +0 -9
- package/packages/components/package.json +0 -25
- package/packages/components/src/chat/chat.css +0 -80
- package/packages/components/src/chat/chat.ts +0 -236
- package/packages/components/src/index.ts +0 -36
- package/packages/components/src/input/input.css +0 -52
- package/packages/components/src/input/input.ts +0 -116
- package/packages/components/src/markdown/markdown.css +0 -118
- package/packages/components/src/markdown/markdown.ts +0 -229
- package/packages/components/src/message/message.css +0 -56
- package/packages/components/src/message/message.ts +0 -72
- package/packages/components/src/styles/global.css +0 -43
- package/packages/components/src/tool-call/tool-call.css +0 -98
- package/packages/components/src/tool-call/tool-call.ts +0 -171
- package/packages/components/src/types.ts +0 -55
- package/packages/components/src/utils/helpers.ts +0 -128
- package/packages/components/tsconfig.json +0 -25
- package/packages/components/tsup.config.ts +0 -18
- package/packages/core/package.json +0 -47
- package/packages/core/pnpm-lock.yaml +0 -2032
- package/packages/core/pnpm-workspace.yaml +0 -2
- package/packages/core/src/api/adapters.ts +0 -717
- package/packages/core/src/api/base.ts +0 -210
- package/packages/core/src/api/index.ts +0 -54
- package/packages/core/src/index.ts +0 -93
- package/packages/core/src/parser/latex.ts +0 -274
- package/packages/core/src/parser/markdown.test.ts +0 -58
- package/packages/core/src/parser/markdown.ts +0 -206
- package/packages/core/src/parser/mermaid.ts +0 -276
- package/packages/core/src/plugins/PluginManager.ts +0 -232
- package/packages/core/src/plugins/builtin.ts +0 -406
- package/packages/core/src/store/ChatStore.ts +0 -163
- package/packages/core/src/store/ModelConfigStore.ts +0 -136
- package/packages/core/src/store/ToolCallStore.ts +0 -164
- package/packages/core/src/store/base.ts +0 -75
- package/packages/core/src/types/index.ts +0 -133
- package/packages/core/tsup.config.ts +0 -18
- package/packages/themes/package.json +0 -33
- package/packages/themes/src/corporate/index.ts +0 -52
- package/packages/themes/src/corporate/theme.css +0 -228
- package/packages/themes/src/glass/index.ts +0 -52
- package/packages/themes/src/glass/theme.css +0 -237
- package/packages/themes/src/gradient/index.ts +0 -53
- package/packages/themes/src/gradient/theme.css +0 -218
- package/packages/themes/src/index.ts +0 -13
- package/packages/themes/src/minimal/index.ts +0 -52
- package/packages/themes/src/minimal/theme.css +0 -198
- package/packages/themes/src/neon/index.ts +0 -52
- package/packages/themes/src/neon/theme.css +0 -233
- package/packages/themes/src/terminal/index.ts +0 -52
- package/packages/themes/src/terminal/theme.css +0 -235
- package/packages/themes/src/types.ts +0 -10
- package/packages/themes/src/vite-env.d.ts +0 -9
- package/packages/themes/tsup.config.ts +0 -21
- package/pnpm-workspace.yaml +0 -4
- package/tsconfig.json +0 -27
- package/vite.config.ts +0 -25
- package/vitest.config.ts +0 -28
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @generated-by AI: edenxpzhang
|
|
3
|
-
* @generated-date 2026-05-13
|
|
4
|
-
*
|
|
5
|
-
* Retro Terminal —— 复古终端
|
|
6
|
-
* 对齐 docs/chat-style-4-terminal.html
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
:root[data-theme='terminal'],
|
|
10
|
-
.ai-theme-terminal {
|
|
11
|
-
--ai-primary: #00ff00;
|
|
12
|
-
--ai-bg-primary: #0a0a0a;
|
|
13
|
-
--ai-text-primary: #00ff00;
|
|
14
|
-
--ai-text-secondary: #008000;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/* 全局 body 配置 + 扫描线 */
|
|
18
|
-
.ai-theme-terminal-host,
|
|
19
|
-
body[data-theme='terminal'] {
|
|
20
|
-
background: #0c0c0c;
|
|
21
|
-
}
|
|
22
|
-
.ai-theme-terminal-host::after,
|
|
23
|
-
body[data-theme='terminal']::after {
|
|
24
|
-
content: '';
|
|
25
|
-
position: fixed;
|
|
26
|
-
inset: 0;
|
|
27
|
-
background: repeating-linear-gradient(
|
|
28
|
-
0deg,
|
|
29
|
-
rgba(0, 255, 0, 0.03) 0px,
|
|
30
|
-
rgba(0, 255, 0, 0.03) 1px,
|
|
31
|
-
transparent 1px,
|
|
32
|
-
transparent 2px
|
|
33
|
-
);
|
|
34
|
-
pointer-events: none;
|
|
35
|
-
z-index: 100;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/* 容器 */
|
|
39
|
-
.ai-theme-terminal .ai-chat,
|
|
40
|
-
[data-theme='terminal'] .ai-chat {
|
|
41
|
-
background: #0a0a0a;
|
|
42
|
-
border: 2px solid #00ff00;
|
|
43
|
-
border-radius: 8px;
|
|
44
|
-
box-shadow:
|
|
45
|
-
0 0 30px rgba(0, 255, 0, 0.3),
|
|
46
|
-
inset 0 0 30px rgba(0, 255, 0, 0.05);
|
|
47
|
-
font-family: 'Courier New', monospace;
|
|
48
|
-
position: relative;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/* Header */
|
|
52
|
-
.ai-theme-terminal .ai-chat__header,
|
|
53
|
-
[data-theme='terminal'] .ai-chat__header {
|
|
54
|
-
padding: 16px 20px;
|
|
55
|
-
background: #0a0a0a;
|
|
56
|
-
border-bottom: 1px solid #00ff00;
|
|
57
|
-
display: flex;
|
|
58
|
-
align-items: center;
|
|
59
|
-
gap: 12px;
|
|
60
|
-
}
|
|
61
|
-
.ai-theme-terminal .ai-chat__avatar,
|
|
62
|
-
[data-theme='terminal'] .ai-chat__avatar {
|
|
63
|
-
background: transparent;
|
|
64
|
-
color: #00ff00;
|
|
65
|
-
font-size: 20px;
|
|
66
|
-
width: auto;
|
|
67
|
-
height: auto;
|
|
68
|
-
animation: ai-terminal-blink 1s infinite;
|
|
69
|
-
}
|
|
70
|
-
.ai-theme-terminal .ai-chat__title,
|
|
71
|
-
[data-theme='terminal'] .ai-chat__title {
|
|
72
|
-
font-size: 14px;
|
|
73
|
-
font-weight: normal;
|
|
74
|
-
color: #00ff00;
|
|
75
|
-
letter-spacing: 2px;
|
|
76
|
-
}
|
|
77
|
-
.ai-theme-terminal .ai-chat__subtitle,
|
|
78
|
-
[data-theme='terminal'] .ai-chat__subtitle {
|
|
79
|
-
font-size: 11px;
|
|
80
|
-
color: #008000;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
@keyframes ai-terminal-blink {
|
|
84
|
-
0%, 100% { opacity: 1; }
|
|
85
|
-
50% { opacity: 0.3; }
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/* Messages */
|
|
89
|
-
.ai-theme-terminal .ai-chat__messages,
|
|
90
|
-
[data-theme='terminal'] .ai-chat__messages {
|
|
91
|
-
background: #0a0a0a;
|
|
92
|
-
padding: 20px;
|
|
93
|
-
gap: 12px;
|
|
94
|
-
}
|
|
95
|
-
.ai-theme-terminal .ai-chat__messages::-webkit-scrollbar,
|
|
96
|
-
[data-theme='terminal'] .ai-chat__messages::-webkit-scrollbar { width: 8px; }
|
|
97
|
-
.ai-theme-terminal .ai-chat__messages::-webkit-scrollbar-thumb,
|
|
98
|
-
[data-theme='terminal'] .ai-chat__messages::-webkit-scrollbar-thumb {
|
|
99
|
-
background: #00ff00;
|
|
100
|
-
border-radius: 0;
|
|
101
|
-
}
|
|
102
|
-
.ai-theme-terminal .ai-chat__messages::-webkit-scrollbar-track,
|
|
103
|
-
[data-theme='terminal'] .ai-chat__messages::-webkit-scrollbar-track { background: #0a0a0a; }
|
|
104
|
-
|
|
105
|
-
/* Message —— terminal 风格强调单行命令式 */
|
|
106
|
-
.ai-theme-terminal .ai-message,
|
|
107
|
-
[data-theme='terminal'] .ai-message {
|
|
108
|
-
display: block;
|
|
109
|
-
max-width: 100%;
|
|
110
|
-
font-size: 13px;
|
|
111
|
-
line-height: 1.6;
|
|
112
|
-
padding: 8px 0 8px 12px;
|
|
113
|
-
border-left: 2px solid transparent;
|
|
114
|
-
margin: 0 !important;
|
|
115
|
-
}
|
|
116
|
-
.ai-theme-terminal .ai-message--user,
|
|
117
|
-
[data-theme='terminal'] .ai-message--user {
|
|
118
|
-
color: #00ffff;
|
|
119
|
-
border-left-color: #00ffff;
|
|
120
|
-
}
|
|
121
|
-
.ai-theme-terminal .ai-message--assistant,
|
|
122
|
-
[data-theme='terminal'] .ai-message--assistant {
|
|
123
|
-
color: #00ff00;
|
|
124
|
-
border-left-color: #00ff00;
|
|
125
|
-
}
|
|
126
|
-
.ai-theme-terminal .ai-message__avatar,
|
|
127
|
-
[data-theme='terminal'] .ai-message__avatar { display: none; }
|
|
128
|
-
.ai-theme-terminal .ai-message__content,
|
|
129
|
-
[data-theme='terminal'] .ai-message__content {
|
|
130
|
-
padding: 0;
|
|
131
|
-
background: transparent !important;
|
|
132
|
-
border: none !important;
|
|
133
|
-
box-shadow: none !important;
|
|
134
|
-
color: inherit;
|
|
135
|
-
border-radius: 0;
|
|
136
|
-
}
|
|
137
|
-
.ai-theme-terminal .ai-message--user .ai-message__content::before,
|
|
138
|
-
[data-theme='terminal'] .ai-message--user .ai-message__content::before {
|
|
139
|
-
content: 'USER> ';
|
|
140
|
-
font-weight: bold;
|
|
141
|
-
margin-right: 4px;
|
|
142
|
-
}
|
|
143
|
-
.ai-theme-terminal .ai-message--assistant .ai-message__content::before,
|
|
144
|
-
[data-theme='terminal'] .ai-message--assistant .ai-message__content::before {
|
|
145
|
-
content: 'AI> ';
|
|
146
|
-
font-weight: bold;
|
|
147
|
-
margin-right: 4px;
|
|
148
|
-
}
|
|
149
|
-
.ai-theme-terminal .ai-message__time,
|
|
150
|
-
[data-theme='terminal'] .ai-message__time { display: none; }
|
|
151
|
-
|
|
152
|
-
/* Input */
|
|
153
|
-
.ai-theme-terminal .ai-input,
|
|
154
|
-
[data-theme='terminal'] .ai-input {
|
|
155
|
-
padding: 16px 20px;
|
|
156
|
-
background: #0a0a0a;
|
|
157
|
-
border-top: 1px solid #00ff00;
|
|
158
|
-
}
|
|
159
|
-
.ai-theme-terminal .ai-input__wrapper,
|
|
160
|
-
[data-theme='terminal'] .ai-input__wrapper {
|
|
161
|
-
display: flex;
|
|
162
|
-
gap: 12px;
|
|
163
|
-
align-items: center;
|
|
164
|
-
}
|
|
165
|
-
.ai-theme-terminal .ai-input__wrapper::before,
|
|
166
|
-
[data-theme='terminal'] .ai-input__wrapper::before {
|
|
167
|
-
content: 'USER>';
|
|
168
|
-
color: #00ff00;
|
|
169
|
-
font-size: 14px;
|
|
170
|
-
font-family: 'Courier New', monospace;
|
|
171
|
-
flex-shrink: 0;
|
|
172
|
-
}
|
|
173
|
-
.ai-theme-terminal .ai-input__textarea,
|
|
174
|
-
[data-theme='terminal'] .ai-input__textarea {
|
|
175
|
-
flex: 1;
|
|
176
|
-
background: transparent;
|
|
177
|
-
border: none;
|
|
178
|
-
color: #00ff00;
|
|
179
|
-
font-family: 'Courier New', monospace;
|
|
180
|
-
font-size: 14px;
|
|
181
|
-
outline: none;
|
|
182
|
-
resize: none;
|
|
183
|
-
caret-color: #00ff00;
|
|
184
|
-
min-height: 24px;
|
|
185
|
-
max-height: 120px;
|
|
186
|
-
padding: 0;
|
|
187
|
-
}
|
|
188
|
-
.ai-theme-terminal .ai-input__textarea::placeholder,
|
|
189
|
-
[data-theme='terminal'] .ai-input__textarea::placeholder { color: #006600; }
|
|
190
|
-
.ai-theme-terminal .ai-input__send,
|
|
191
|
-
[data-theme='terminal'] .ai-input__send {
|
|
192
|
-
background: transparent;
|
|
193
|
-
border: 1px solid #00ff00;
|
|
194
|
-
color: #00ff00;
|
|
195
|
-
padding: 8px 16px;
|
|
196
|
-
cursor: pointer;
|
|
197
|
-
font-family: 'Courier New', monospace;
|
|
198
|
-
font-size: 12px;
|
|
199
|
-
letter-spacing: 2px;
|
|
200
|
-
transition: all 0.3s;
|
|
201
|
-
border-radius: 0;
|
|
202
|
-
}
|
|
203
|
-
.ai-theme-terminal .ai-input__send:hover:not(:disabled),
|
|
204
|
-
[data-theme='terminal'] .ai-input__send:hover:not(:disabled) {
|
|
205
|
-
background: #00ff00;
|
|
206
|
-
color: #0a0a0a;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/* Typing */
|
|
210
|
-
.ai-theme-terminal .ai-typing-indicator,
|
|
211
|
-
[data-theme='terminal'] .ai-typing-indicator {
|
|
212
|
-
display: flex;
|
|
213
|
-
gap: 6px;
|
|
214
|
-
padding: 8px 0 8px 12px;
|
|
215
|
-
border-left: 2px solid #00ff00;
|
|
216
|
-
}
|
|
217
|
-
.ai-theme-terminal .ai-typing-indicator::before,
|
|
218
|
-
[data-theme='terminal'] .ai-typing-indicator::before {
|
|
219
|
-
content: 'AI> ';
|
|
220
|
-
color: #00ff00;
|
|
221
|
-
font-weight: bold;
|
|
222
|
-
margin-right: 4px;
|
|
223
|
-
}
|
|
224
|
-
.ai-theme-terminal .ai-typing-indicator__dot,
|
|
225
|
-
[data-theme='terminal'] .ai-typing-indicator__dot {
|
|
226
|
-
width: 8px;
|
|
227
|
-
height: 8px;
|
|
228
|
-
background: #00ff00;
|
|
229
|
-
border-radius: 0;
|
|
230
|
-
animation: ai-terminal-blink 1.4s infinite;
|
|
231
|
-
}
|
|
232
|
-
.ai-theme-terminal .ai-typing-indicator__dot:nth-child(2),
|
|
233
|
-
[data-theme='terminal'] .ai-typing-indicator__dot:nth-child(2) { animation-delay: 0.2s; }
|
|
234
|
-
.ai-theme-terminal .ai-typing-indicator__dot:nth-child(3),
|
|
235
|
-
[data-theme='terminal'] .ai-typing-indicator__dot:nth-child(3) { animation-delay: 0.4s; }
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @generated-by AI: edenxpzhang
|
|
3
|
-
* @generated-date 2026-05-13
|
|
4
|
-
*/
|
|
5
|
-
import { defineConfig } from 'tsup';
|
|
6
|
-
|
|
7
|
-
export default defineConfig({
|
|
8
|
-
entry: ['src/index.ts', 'src/default/index.ts', 'src/bubble/index.ts', 'src/flat/index.ts'],
|
|
9
|
-
outDir: 'dist',
|
|
10
|
-
format: ['esm'],
|
|
11
|
-
target: 'es2020',
|
|
12
|
-
splitting: true,
|
|
13
|
-
clean: true,
|
|
14
|
-
dts: true,
|
|
15
|
-
sourcemap: false,
|
|
16
|
-
treeshake: false,
|
|
17
|
-
external: [],
|
|
18
|
-
loader: {
|
|
19
|
-
'.css': 'copy',
|
|
20
|
-
},
|
|
21
|
-
});
|
package/pnpm-workspace.yaml
DELETED
package/tsconfig.json
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2020",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
6
|
-
"moduleResolution": "node",
|
|
7
|
-
"strict": true,
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"skipLibCheck": true,
|
|
10
|
-
"forceConsistentCasingInFileNames": true,
|
|
11
|
-
"resolveJsonModule": true,
|
|
12
|
-
"isolatedModules": true,
|
|
13
|
-
"noEmit": true,
|
|
14
|
-
"jsx": "react-jsx",
|
|
15
|
-
"declaration": true,
|
|
16
|
-
"declarationMap": true,
|
|
17
|
-
"sourceMap": true,
|
|
18
|
-
"baseUrl": ".",
|
|
19
|
-
"paths": {
|
|
20
|
-
"@ai-chat/core": ["packages/core/src"],
|
|
21
|
-
"@ai-chat/components": ["packages/components/src"],
|
|
22
|
-
"@ai-chat/themes/*": ["packages/themes/src/*"]
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"include": ["packages/*/src"],
|
|
26
|
-
"exclude": ["node_modules", "dist", "packages/*/dist"]
|
|
27
|
-
}
|
package/vite.config.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @generated-by AI: edenxpzhang
|
|
3
|
-
* @generated-date 2026-05-13
|
|
4
|
-
*/
|
|
5
|
-
import { defineConfig } from 'vite';
|
|
6
|
-
import { resolve } from 'path';
|
|
7
|
-
|
|
8
|
-
export default defineConfig({
|
|
9
|
-
root: resolve(__dirname, 'examples'),
|
|
10
|
-
publicDir: resolve(__dirname, 'packages'),
|
|
11
|
-
server: {
|
|
12
|
-
port: 3000,
|
|
13
|
-
open: '/index.html',
|
|
14
|
-
},
|
|
15
|
-
build: {
|
|
16
|
-
outDir: resolve(__dirname, 'dist-examples'),
|
|
17
|
-
},
|
|
18
|
-
resolve: {
|
|
19
|
-
alias: {
|
|
20
|
-
'@ai-chat/core': resolve(__dirname, 'packages/core/src'),
|
|
21
|
-
'@ai-chat/components': resolve(__dirname, 'packages/components/src'),
|
|
22
|
-
'@ai-chat/themes': resolve(__dirname, 'packages/themes/src'),
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
});
|
package/vitest.config.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @generated-by AI: edenxpzhang
|
|
3
|
-
* @generated-date 2026-05-13
|
|
4
|
-
*/
|
|
5
|
-
import { defineConfig } from 'vitest/config';
|
|
6
|
-
import path from 'path';
|
|
7
|
-
|
|
8
|
-
export default defineConfig({
|
|
9
|
-
test: {
|
|
10
|
-
globals: true,
|
|
11
|
-
environment: 'node',
|
|
12
|
-
include: ['packages/*/src/**/*.test.{ts,tsx}'],
|
|
13
|
-
exclude: ['node_modules', 'dist', 'packages/*/dist'],
|
|
14
|
-
coverage: {
|
|
15
|
-
provider: 'v8',
|
|
16
|
-
reporter: ['text', 'json', 'html'],
|
|
17
|
-
include: ['packages/*/src/**/*.ts'],
|
|
18
|
-
exclude: ['packages/*/src/**/*.test.ts', 'packages/*/src/types/**'],
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
resolve: {
|
|
22
|
-
alias: {
|
|
23
|
-
'@ai-chat/core': path.resolve(__dirname, 'packages/core/src'),
|
|
24
|
-
'@ai-chat/components': path.resolve(__dirname, 'packages/components/src'),
|
|
25
|
-
'@ai-chat/themes': path.resolve(__dirname, 'packages/themes/src'),
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
});
|