@huyooo/ai-chat-frontend-react 0.2.14 → 0.2.16
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/index.css +0 -1
- package/dist/index.js +1 -5418
- package/package.json +4 -5
- package/dist/index.css.map +0 -1
- package/dist/index.js.map +0 -1
- package/src/adapter.ts +0 -68
- package/src/components/ChatPanel.tsx +0 -553
- package/src/components/common/ConfirmDialog.css +0 -136
- package/src/components/common/ConfirmDialog.tsx +0 -91
- package/src/components/common/CopyButton.css +0 -22
- package/src/components/common/CopyButton.tsx +0 -46
- package/src/components/common/IndexingSettings.css +0 -207
- package/src/components/common/IndexingSettings.tsx +0 -398
- package/src/components/common/SettingsPanel.css +0 -337
- package/src/components/common/SettingsPanel.tsx +0 -215
- package/src/components/common/Toast.css +0 -50
- package/src/components/common/Toast.tsx +0 -38
- package/src/components/common/ToggleSwitch.css +0 -52
- package/src/components/common/ToggleSwitch.tsx +0 -20
- package/src/components/header/ChatHeader.css +0 -285
- package/src/components/header/ChatHeader.tsx +0 -376
- package/src/components/input/AtFilePicker.css +0 -147
- package/src/components/input/AtFilePicker.tsx +0 -519
- package/src/components/input/ChatInput.css +0 -283
- package/src/components/input/ChatInput.tsx +0 -575
- package/src/components/input/DropdownSelector.css +0 -231
- package/src/components/input/DropdownSelector.tsx +0 -333
- package/src/components/input/ImagePreviewModal.css +0 -124
- package/src/components/input/ImagePreviewModal.tsx +0 -118
- package/src/components/input/at-views/AtBranchView.tsx +0 -34
- package/src/components/input/at-views/AtBrowserView.tsx +0 -34
- package/src/components/input/at-views/AtChatsView.tsx +0 -34
- package/src/components/input/at-views/AtDocsView.tsx +0 -34
- package/src/components/input/at-views/AtFilesView.tsx +0 -168
- package/src/components/input/at-views/AtTerminalsView.tsx +0 -34
- package/src/components/input/at-views/AtViewStyles.css +0 -143
- package/src/components/input/at-views/index.ts +0 -9
- package/src/components/message/ContentRenderer.css +0 -9
- package/src/components/message/MessageBubble.css +0 -193
- package/src/components/message/MessageBubble.tsx +0 -240
- package/src/components/message/PartsRenderer.css +0 -12
- package/src/components/message/PartsRenderer.tsx +0 -168
- package/src/components/message/WelcomeMessage.css +0 -221
- package/src/components/message/WelcomeMessage.tsx +0 -93
- package/src/components/message/parts/CollapsibleCard.css +0 -80
- package/src/components/message/parts/CollapsibleCard.tsx +0 -80
- package/src/components/message/parts/ErrorPart.css +0 -9
- package/src/components/message/parts/ErrorPart.tsx +0 -40
- package/src/components/message/parts/ImagePart.css +0 -49
- package/src/components/message/parts/ImagePart.tsx +0 -54
- package/src/components/message/parts/SearchPart.css +0 -44
- package/src/components/message/parts/SearchPart.tsx +0 -63
- package/src/components/message/parts/TextPart.css +0 -579
- package/src/components/message/parts/TextPart.tsx +0 -213
- package/src/components/message/parts/ThinkingPart.css +0 -9
- package/src/components/message/parts/ThinkingPart.tsx +0 -48
- package/src/components/message/parts/ToolCallPart.css +0 -246
- package/src/components/message/parts/ToolCallPart.tsx +0 -289
- package/src/components/message/parts/ToolResultPart.css +0 -67
- package/src/components/message/parts/index.ts +0 -13
- package/src/components/message/parts/visual-predicate.ts +0 -43
- package/src/components/message/parts/visual-render.ts +0 -19
- package/src/components/message/parts/visual.ts +0 -12
- package/src/components/message/welcome-types.ts +0 -46
- package/src/context/AutoRunConfigContext.tsx +0 -13
- package/src/context/ChatAdapterContext.tsx +0 -8
- package/src/context/ChatInputContext.tsx +0 -40
- package/src/context/RenderersContext.tsx +0 -35
- package/src/hooks/useChat.ts +0 -1569
- package/src/hooks/useImageUpload.ts +0 -345
- package/src/hooks/useVoiceInput.ts +0 -454
- package/src/hooks/useVoiceToTextInput.ts +0 -87
- package/src/index.ts +0 -151
- package/src/styles.css +0 -330
- package/src/types/index.ts +0 -196
- package/src/utils/fileIcon.ts +0 -49
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ChatInput 组件样式
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
.chat-input {
|
|
6
|
-
padding: 12px;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.chat-input.message-variant {
|
|
10
|
-
padding: 0;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.input-container {
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-direction: column;
|
|
16
|
-
background: var(--chat-input-bg, #2d2d2d);
|
|
17
|
-
border: 1px solid var(--chat-border, #444);
|
|
18
|
-
border-radius: 12px;
|
|
19
|
-
padding: 12px;
|
|
20
|
-
transition: border-color 0.15s;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.input-container.focused {
|
|
24
|
-
border-color: rgba(255, 255, 255, 0.2);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.input-container.drag-over {
|
|
28
|
-
border-color: var(--chat-primary, #2563eb);
|
|
29
|
-
background: rgba(37, 99, 235, 0.1);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/* 录音态不改变 textarea 样式(仅改变图标颜色) */
|
|
33
|
-
|
|
34
|
-
/* 图片预览区 */
|
|
35
|
-
.images-preview {
|
|
36
|
-
display: flex;
|
|
37
|
-
flex-wrap: wrap;
|
|
38
|
-
gap: 6px;
|
|
39
|
-
margin-bottom: 8px;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.image-preview-item {
|
|
43
|
-
position: relative;
|
|
44
|
-
width: 48px;
|
|
45
|
-
height: 48px;
|
|
46
|
-
border-radius: 6px;
|
|
47
|
-
overflow: hidden;
|
|
48
|
-
background: rgba(0, 0, 0, 0.2);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.image-thumbnail {
|
|
52
|
-
width: 100%;
|
|
53
|
-
height: 100%;
|
|
54
|
-
object-fit: cover;
|
|
55
|
-
cursor: pointer;
|
|
56
|
-
transition: opacity 0.15s;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.image-thumbnail:hover {
|
|
60
|
-
opacity: 0.8;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.image-remove-btn {
|
|
64
|
-
position: absolute;
|
|
65
|
-
top: 2px;
|
|
66
|
-
right: 2px;
|
|
67
|
-
width: 16px;
|
|
68
|
-
height: 16px;
|
|
69
|
-
display: flex;
|
|
70
|
-
align-items: center;
|
|
71
|
-
justify-content: center;
|
|
72
|
-
background: rgba(0, 0, 0, 0.5);
|
|
73
|
-
border: none;
|
|
74
|
-
border-radius: 50%;
|
|
75
|
-
color: #fff;
|
|
76
|
-
cursor: pointer;
|
|
77
|
-
opacity: 0;
|
|
78
|
-
transition: all 0.15s;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.image-preview-item:hover .image-remove-btn {
|
|
82
|
-
opacity: 1;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.image-remove-btn:hover {
|
|
86
|
-
background: rgba(239, 68, 68, 0.9);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/* 隐藏的文件输入 */
|
|
90
|
-
.hidden-input {
|
|
91
|
-
display: none;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/* 输入框 */
|
|
95
|
-
.input-field-wrapper {
|
|
96
|
-
margin-bottom: 8px;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.input-field {
|
|
100
|
-
width: 100%;
|
|
101
|
-
background: transparent;
|
|
102
|
-
border: none;
|
|
103
|
-
padding: 0;
|
|
104
|
-
padding-right: 8px;
|
|
105
|
-
color: var(--chat-text, #ccc);
|
|
106
|
-
font-size: 14px;
|
|
107
|
-
resize: none;
|
|
108
|
-
min-height: 24px;
|
|
109
|
-
max-height: 150px;
|
|
110
|
-
line-height: 1.5;
|
|
111
|
-
font-family: inherit;
|
|
112
|
-
overflow-y: auto;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.input-field:focus {
|
|
116
|
-
outline: none;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.input-field::placeholder {
|
|
120
|
-
color: var(--chat-text-muted, #666);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/* 底部控制栏 */
|
|
124
|
-
.input-controls {
|
|
125
|
-
display: flex;
|
|
126
|
-
align-items: center;
|
|
127
|
-
justify-content: space-between;
|
|
128
|
-
gap: 8px;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.input-left {
|
|
132
|
-
display: flex;
|
|
133
|
-
align-items: center;
|
|
134
|
-
gap: 4px;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/* 右侧按钮 */
|
|
138
|
-
.input-right {
|
|
139
|
-
display: flex;
|
|
140
|
-
align-items: center;
|
|
141
|
-
gap: 2px;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/* @ 选择器容器 */
|
|
145
|
-
.at-picker-wrapper {
|
|
146
|
-
position: relative;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.input-right .icon-btn {
|
|
150
|
-
display: flex;
|
|
151
|
-
align-items: center;
|
|
152
|
-
justify-content: center;
|
|
153
|
-
width: 28px;
|
|
154
|
-
height: 28px;
|
|
155
|
-
background: transparent;
|
|
156
|
-
border: none;
|
|
157
|
-
border-radius: 6px;
|
|
158
|
-
color: var(--chat-text-muted, #666);
|
|
159
|
-
cursor: pointer;
|
|
160
|
-
transition: all 0.15s;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.input-right .icon-btn:hover {
|
|
164
|
-
color: var(--chat-text, #ccc);
|
|
165
|
-
background: rgba(0, 0, 0, 0.06);
|
|
166
|
-
background: color-mix(in srgb, var(--chat-text, #ccc) 10%, transparent);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
.input-right .voice-btn {
|
|
170
|
-
display: flex;
|
|
171
|
-
align-items: center;
|
|
172
|
-
justify-content: center;
|
|
173
|
-
width: 28px;
|
|
174
|
-
height: 28px;
|
|
175
|
-
background: transparent;
|
|
176
|
-
border: none;
|
|
177
|
-
border-radius: 6px;
|
|
178
|
-
color: var(--chat-text-muted, #666);
|
|
179
|
-
cursor: pointer;
|
|
180
|
-
transition: all 0.15s;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.input-right .voice-btn:hover {
|
|
184
|
-
color: var(--chat-text, #ccc);
|
|
185
|
-
background: rgba(0, 0, 0, 0.06);
|
|
186
|
-
background: color-mix(in srgb, var(--chat-text, #ccc) 10%, transparent);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.input-right .voice-btn.connecting {
|
|
190
|
-
color: #f59e0b;
|
|
191
|
-
background: transparent;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
.input-right .voice-btn.connecting:hover {
|
|
195
|
-
color: #f59e0b;
|
|
196
|
-
background: rgba(0, 0, 0, 0.06);
|
|
197
|
-
background: color-mix(in srgb, var(--chat-text, #ccc) 10%, transparent);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.input-right .voice-btn .spin {
|
|
201
|
-
animation: spin 1s linear infinite;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.input-right .voice-btn:disabled {
|
|
205
|
-
opacity: 0.5;
|
|
206
|
-
cursor: not-allowed;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
.input-right .voice-btn.recording {
|
|
210
|
-
color: #ef4444;
|
|
211
|
-
background: transparent;
|
|
212
|
-
animation: none;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
.input-right .voice-btn.recording:hover {
|
|
216
|
-
color: #ef4444;
|
|
217
|
-
background: rgba(0, 0, 0, 0.06);
|
|
218
|
-
background: color-mix(in srgb, var(--chat-text, #ccc) 10%, transparent);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/* 录音态不加动效(使用实心暂停图标即可) */
|
|
222
|
-
|
|
223
|
-
.toggle-btn {
|
|
224
|
-
display: flex;
|
|
225
|
-
align-items: center;
|
|
226
|
-
justify-content: center;
|
|
227
|
-
width: 28px;
|
|
228
|
-
height: 28px;
|
|
229
|
-
background: transparent;
|
|
230
|
-
border: none;
|
|
231
|
-
border-radius: 6px;
|
|
232
|
-
color: var(--chat-text-muted, #666);
|
|
233
|
-
cursor: pointer;
|
|
234
|
-
transition: all 0.15s;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
.toggle-btn:hover {
|
|
238
|
-
color: var(--chat-text, #ccc);
|
|
239
|
-
background: rgba(0, 0, 0, 0.06);
|
|
240
|
-
background: color-mix(in srgb, var(--chat-text, #ccc) 10%, transparent);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
.toggle-btn.active {
|
|
244
|
-
/* 激活态使用主色调(更清晰的对比度) */
|
|
245
|
-
color: var(--chat-primary, #54a9ff);
|
|
246
|
-
background: rgba(84, 169, 255, 0.14);
|
|
247
|
-
background: color-mix(in srgb, var(--chat-primary, #54a9ff) 14%, transparent);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
.toggle-btn.active:hover {
|
|
251
|
-
color: var(--chat-primary-hover, #2f90ff);
|
|
252
|
-
background: rgba(84, 169, 255, 0.2);
|
|
253
|
-
background: color-mix(in srgb, var(--chat-primary, #54a9ff) 20%, transparent);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
.send-btn {
|
|
257
|
-
display: flex;
|
|
258
|
-
align-items: center;
|
|
259
|
-
justify-content: center;
|
|
260
|
-
width: 28px;
|
|
261
|
-
height: 28px;
|
|
262
|
-
background: transparent;
|
|
263
|
-
border: none;
|
|
264
|
-
border-radius: 6px;
|
|
265
|
-
color: var(--chat-text-muted, #666);
|
|
266
|
-
cursor: pointer;
|
|
267
|
-
transition: all 0.15s;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
.send-btn:hover {
|
|
271
|
-
color: var(--chat-text, #ccc);
|
|
272
|
-
background: rgba(0, 0, 0, 0.06);
|
|
273
|
-
background: color-mix(in srgb, var(--chat-text, #ccc) 10%, transparent);
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
.send-btn:disabled {
|
|
277
|
-
opacity: 0.5;
|
|
278
|
-
cursor: not-allowed;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
.send-btn:disabled:hover {
|
|
282
|
-
color: var(--chat-text-muted, #666);
|
|
283
|
-
}
|