vzcode 1.54.0 → 1.55.0
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/assets/{index-BxRNGHcB.js → index-DILO4YFE.js} +100 -100
- package/dist/assets/{index-L1AANcDx.css → index-GFaZu2lY.css} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/src/client/VZSidebar/AIChat/StreamingMessage.tsx +5 -0
- package/src/client/VZSidebar/AIChat/index.tsx +112 -105
- package/src/client/VZSidebar/AIChat/styles.scss +1 -0
package/dist/index.html
CHANGED
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap"
|
|
21
21
|
rel="stylesheet"
|
|
22
22
|
/>
|
|
23
|
-
<script type="module" crossorigin src="/assets/index-
|
|
24
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
23
|
+
<script type="module" crossorigin src="/assets/index-DILO4YFE.js"></script>
|
|
24
|
+
<link rel="stylesheet" crossorigin href="/assets/index-GFaZu2lY.css">
|
|
25
25
|
</head>
|
|
26
26
|
<body>
|
|
27
27
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -11,6 +11,11 @@ const StreamingMessageComponent = ({
|
|
|
11
11
|
content,
|
|
12
12
|
status,
|
|
13
13
|
}: StreamingMessageProps) => {
|
|
14
|
+
// Don't render if there's no content and no status
|
|
15
|
+
if (!content.trim() && !status) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
14
19
|
return (
|
|
15
20
|
<div className="ai-chat-message assistant streaming">
|
|
16
21
|
{status && (
|
|
@@ -15,6 +15,8 @@ const defaultAIChatEndpoint = '/api/ai-chat/';
|
|
|
15
15
|
|
|
16
16
|
const DEBUG = false;
|
|
17
17
|
|
|
18
|
+
const showSuggestedRequests = false;
|
|
19
|
+
|
|
18
20
|
export const AIChat = () => {
|
|
19
21
|
const { aiChatMessage, setAIChatMessage } =
|
|
20
22
|
useContext(VZCodeContext);
|
|
@@ -222,115 +224,120 @@ export const AIChat = () => {
|
|
|
222
224
|
<div className="ai-chat-empty">
|
|
223
225
|
<div className="ai-chat-empty-icon">✨</div>
|
|
224
226
|
<h3 className="ai-chat-empty-title">
|
|
225
|
-
|
|
227
|
+
Edit with AI
|
|
226
228
|
</h3>
|
|
227
229
|
<div className="ai-chat-empty-text">
|
|
228
230
|
How can I help you?
|
|
229
231
|
</div>
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
<
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
<
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
232
|
+
{showSuggestedRequests && (
|
|
233
|
+
<div className="ai-chat-empty-examples">
|
|
234
|
+
{aiChatMode === 'ask' ? (
|
|
235
|
+
<>
|
|
236
|
+
<h4>Try asking questions like:</h4>
|
|
237
|
+
<div className="ai-chat-suggested-prompts">
|
|
238
|
+
<button
|
|
239
|
+
className="ai-chat-suggested-prompt"
|
|
240
|
+
onClick={() =>
|
|
241
|
+
handleSendMessage(
|
|
242
|
+
'Explain how this works',
|
|
243
|
+
)
|
|
244
|
+
}
|
|
245
|
+
>
|
|
246
|
+
"Explain how this works"
|
|
247
|
+
</button>
|
|
248
|
+
<button
|
|
249
|
+
className="ai-chat-suggested-prompt"
|
|
250
|
+
onClick={() =>
|
|
251
|
+
handleSendMessage(
|
|
252
|
+
'How could I change it so that the circles are bigger?',
|
|
253
|
+
)
|
|
254
|
+
}
|
|
255
|
+
>
|
|
256
|
+
"How could I change it so that the
|
|
257
|
+
circles are bigger?"
|
|
258
|
+
</button>
|
|
259
|
+
<button
|
|
260
|
+
className="ai-chat-suggested-prompt"
|
|
261
|
+
onClick={() =>
|
|
262
|
+
handleSendMessage(
|
|
263
|
+
'What does this function do?',
|
|
264
|
+
)
|
|
265
|
+
}
|
|
266
|
+
>
|
|
267
|
+
"What does this function do?"
|
|
268
|
+
</button>
|
|
269
|
+
<button
|
|
270
|
+
className="ai-chat-suggested-prompt"
|
|
271
|
+
onClick={() =>
|
|
272
|
+
handleSendMessage(
|
|
273
|
+
'How can I make this more accessible?',
|
|
274
|
+
)
|
|
275
|
+
}
|
|
276
|
+
>
|
|
277
|
+
"How can I make this more
|
|
278
|
+
accessible?"
|
|
279
|
+
</button>
|
|
280
|
+
</div>
|
|
281
|
+
</>
|
|
282
|
+
) : (
|
|
283
|
+
<>
|
|
284
|
+
<h4>Try edit requests like these:</h4>
|
|
285
|
+
<div className="ai-chat-suggested-prompts">
|
|
286
|
+
<button
|
|
287
|
+
className="ai-chat-suggested-prompt"
|
|
288
|
+
onClick={() =>
|
|
289
|
+
handleSendMessage(
|
|
290
|
+
'Change the circles to squares',
|
|
291
|
+
)
|
|
292
|
+
}
|
|
293
|
+
>
|
|
294
|
+
"Change the circles to squares"
|
|
295
|
+
</button>
|
|
296
|
+
<button
|
|
297
|
+
className="ai-chat-suggested-prompt"
|
|
298
|
+
onClick={() =>
|
|
299
|
+
handleSendMessage(
|
|
300
|
+
'Add a button that toggles the animation',
|
|
301
|
+
)
|
|
302
|
+
}
|
|
303
|
+
>
|
|
304
|
+
"Add a button that toggles the
|
|
305
|
+
animation"
|
|
306
|
+
</button>
|
|
307
|
+
<button
|
|
308
|
+
className="ai-chat-suggested-prompt"
|
|
309
|
+
onClick={() =>
|
|
310
|
+
handleSendMessage(
|
|
311
|
+
'Fix the CSS so the layout is responsive',
|
|
312
|
+
)
|
|
313
|
+
}
|
|
314
|
+
>
|
|
315
|
+
"Fix the CSS so the layout is
|
|
316
|
+
responsive"
|
|
317
|
+
</button>
|
|
318
|
+
<button
|
|
319
|
+
className="ai-chat-suggested-prompt"
|
|
320
|
+
onClick={() =>
|
|
321
|
+
handleSendMessage(
|
|
322
|
+
'Refactor this function to use async/await',
|
|
323
|
+
)
|
|
324
|
+
}
|
|
325
|
+
>
|
|
326
|
+
"Refactor this function to use
|
|
327
|
+
async/await"
|
|
328
|
+
</button>
|
|
329
|
+
</div>
|
|
330
|
+
</>
|
|
331
|
+
)}
|
|
332
|
+
</div>
|
|
333
|
+
)}
|
|
334
|
+
{showSuggestedRequests && (
|
|
335
|
+
<div className="ai-chat-empty-text">
|
|
336
|
+
{aiChatMode === 'ask'
|
|
337
|
+
? 'Type your question below to get started!'
|
|
338
|
+
: 'Type your edit request below to get started!'}
|
|
339
|
+
</div>
|
|
340
|
+
)}
|
|
334
341
|
</div>
|
|
335
342
|
) : (
|
|
336
343
|
<MessageList
|