vzcode 2.35.0 → 3.0.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/README.md +30 -0
- package/dist/assets/buildWorker-BZlya278.js +687 -0
- package/dist/assets/index-DT8aFBKg.js +356 -0
- package/dist/assets/index-DyMLoJaw.css +1 -0
- package/dist/assets/{worker-D8p1JlHW.js → worker-1oQYaz-F.js} +251 -251
- package/dist/assets/worker-BfgPD8zR.js +125 -0
- package/dist/assets/{worker-k7HZ3t-V.js → worker-CoJaqtpi.js} +12 -12
- package/dist/index.html +2 -2
- package/dist/ot.js +180 -2
- package/dist/server/createServer.js +281 -0
- package/dist/server/index.js +6 -269
- package/package.json +14 -6
- package/src/client/AIAssist/AIAssistWidget/index.tsx +2 -2
- package/src/client/AIAssist/AIAssistWidget/style.scss +8 -8
- package/src/client/AIAssist/Spinner.jsx +2 -2
- package/src/client/App/style.scss +6 -9
- package/src/client/CodeEditor/getOrCreateEditor.tsx +1 -15
- package/src/client/CodeEditor/style.scss +13 -13
- package/src/client/CodeErrorOverlay/index.tsx +1 -1
- package/src/client/CodeErrorOverlay/style.scss +3 -3
- package/src/client/ImageViewer/style.scss +6 -6
- package/src/client/RunCodeWidget/index.tsx +3 -3
- package/src/client/RunCodeWidget/style.scss +2 -2
- package/src/client/TabList/Tab.tsx +2 -2
- package/src/client/TabList/style.scss +6 -5
- package/src/client/VZKeyboardShortcutsDoc.tsx +4 -4
- package/src/client/VZSettings.tsx +27 -19
- package/src/client/VZSidebar/AIChatWrapper.tsx +85 -0
- package/src/client/VZSidebar/CreateDirModal.tsx +3 -3
- package/src/client/VZSidebar/CreateFileModal.tsx +3 -3
- package/src/client/VZSidebar/DeleteConfirmationModal.tsx +2 -2
- package/src/client/VZSidebar/Item.tsx +4 -4
- package/src/client/VZSidebar/Search.tsx +2 -2
- package/src/client/VZSidebar/VisualEditor/VisualEditor.tsx +13 -9
- package/src/client/VZSidebar/VisualEditor/colorUtils.ts +14 -0
- package/src/client/VZSidebar/VoiceChatModal.tsx +1 -1
- package/src/client/VZSidebar/index.tsx +25 -22
- package/src/client/VZSidebar/styles.scss +99 -98
- package/src/client/main.jsx +1 -0
- package/src/client/standalone.scss +6 -0
- package/src/client/ui.scss +317 -0
- package/src/client/ui.tsx +323 -0
- package/src/client/useOpenDirectories.ts +0 -1
- package/src/llm-streaming-server/README.md +5 -3
- package/src/llm-streaming-ui/README.md +44 -42
- package/src/llm-streaming-ui/components/ChatInput.tsx +31 -67
- package/src/llm-streaming-ui/components/DiffView.scss +1 -1
- package/src/llm-streaming-ui/components/DiffView.tsx +6 -24
- package/src/llm-streaming-ui/components/FileEditingIndicator.tsx +1 -1
- package/src/llm-streaming-ui/components/Message.tsx +11 -27
- package/src/llm-streaming-ui/components/MessageList.tsx +15 -29
- package/src/llm-streaming-ui/components/Spinner.scss +37 -0
- package/src/llm-streaming-ui/components/Spinner.tsx +59 -0
- package/src/llm-streaming-ui/components/icons.tsx +68 -0
- package/src/llm-streaming-ui/components/index.tsx +34 -30
- package/src/llm-streaming-ui/components/styles.scss +127 -75
- package/src/llm-streaming-ui/index.ts +13 -0
- package/src/llm-streaming-ui/props.ts +137 -0
- package/src/ot.ts +221 -4
- package/src/server/createServer.ts +413 -0
- package/src/server/index.ts +8 -333
- package/dist/assets/bootstrap-icons-BeopsB42.woff +0 -0
- package/dist/assets/bootstrap-icons-mSm7cUeB.woff2 +0 -0
- package/dist/assets/buildWorker-DylWm2VX.js +0 -687
- package/dist/assets/index-Dyt9tpmu.css +0 -1
- package/dist/assets/index-rg2Zvfo_.js +0 -364
- package/dist/assets/worker-b9bkZkXK.js +0 -116
- package/src/client/AIAssist/AIAssistCodeMirrorKeyMap.ts +0 -42
- package/src/client/AIAssist/generateFilesContext.ts +0 -25
- package/src/client/AIAssist/index.ts +0 -2
- package/src/client/CodeEditor/InteractiveWidgets/highlightWidgets.ts +0 -79
- package/src/client/bootstrap.ts +0 -26
- /package/src/{client → llm-streaming-ui}/hooks/useAutoScroll.ts +0 -0
- /package/src/{client → llm-streaming-ui}/utils/scrollUtils.ts +0 -0
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import { PlaySVG } from '../Icons';
|
|
8
8
|
import { SplitEditorSVG } from '../Icons/SplitEditorSVG';
|
|
9
9
|
import { VZCodeContext } from '../VZCodeContext';
|
|
10
|
-
import { OverlayTrigger, Tooltip } from '../
|
|
10
|
+
import { OverlayTrigger, Tooltip } from '../ui';
|
|
11
11
|
|
|
12
12
|
import './style.scss';
|
|
13
13
|
|
|
@@ -88,7 +88,7 @@ export const RunCodeWidget = ({
|
|
|
88
88
|
>
|
|
89
89
|
<i
|
|
90
90
|
onClick={handleSplitEditor}
|
|
91
|
-
className="
|
|
91
|
+
className="vz-icon-button"
|
|
92
92
|
>
|
|
93
93
|
<SplitEditorSVG />
|
|
94
94
|
</i>
|
|
@@ -105,7 +105,7 @@ export const RunCodeWidget = ({
|
|
|
105
105
|
}
|
|
106
106
|
>
|
|
107
107
|
<i
|
|
108
|
-
className={`
|
|
108
|
+
className={`vz-icon-button ${isRunning ? 'rotate-icon' : ''}`}
|
|
109
109
|
onClick={handleClick}
|
|
110
110
|
>
|
|
111
111
|
<PlaySVG />
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
position: absolute;
|
|
3
3
|
right: 16px;
|
|
4
4
|
top: 9px;
|
|
5
|
-
color: var(--
|
|
5
|
+
color: var(--vz-color-neutral-04);
|
|
6
6
|
.rotate-icon {
|
|
7
7
|
animation: spin 1s linear;
|
|
8
8
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
position: absolute;
|
|
12
12
|
right: 51px;
|
|
13
13
|
top: 9px;
|
|
14
|
-
color: var(--
|
|
14
|
+
color: var(--vz-color-neutral-04);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
@keyframes spin {
|
|
@@ -55,7 +55,7 @@ export const Tab = ({
|
|
|
55
55
|
|
|
56
56
|
return (
|
|
57
57
|
<div
|
|
58
|
-
className={`tab
|
|
58
|
+
className={`tab ${
|
|
59
59
|
isActive ? 'active' : ''
|
|
60
60
|
} ${isTransient ? 'transient' : ''}`}
|
|
61
61
|
onClick={handleClick}
|
|
@@ -63,7 +63,7 @@ export const Tab = ({
|
|
|
63
63
|
>
|
|
64
64
|
{tabName}
|
|
65
65
|
<i
|
|
66
|
-
className="
|
|
66
|
+
className="vz-icon-button"
|
|
67
67
|
onClick={handleCloseClick}
|
|
68
68
|
>
|
|
69
69
|
<CloseSVG />
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
overflow-x: auto;
|
|
6
6
|
|
|
7
7
|
.tab {
|
|
8
|
+
user-select: none;
|
|
8
9
|
// background: #47546b;
|
|
9
10
|
color: #fff;
|
|
10
11
|
font-family: var(--vzcode-font-family);
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
|
|
30
31
|
// on hover
|
|
31
32
|
&:hover {
|
|
32
|
-
// background-color: var(--
|
|
33
|
+
// background-color: var(--vz-color-hover-dark);
|
|
33
34
|
background-color: rgba(255, 255, 255, 0.075);
|
|
34
35
|
}
|
|
35
36
|
}
|
|
@@ -42,10 +43,10 @@
|
|
|
42
43
|
font-style: italic;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
.icon-button {
|
|
46
|
-
color: var(--
|
|
46
|
+
.vz-icon-button {
|
|
47
|
+
color: var(--vz-color-neutral-03);
|
|
47
48
|
}
|
|
48
|
-
.icon-button:hover {
|
|
49
|
-
color: var(--
|
|
49
|
+
.vz-icon-button:hover {
|
|
50
|
+
color: var(--vz-color-action-03);
|
|
50
51
|
}
|
|
51
52
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
|
-
import { Button, Modal, Form } from './
|
|
2
|
+
import { Button, Modal, Form } from './ui';
|
|
3
3
|
import { VZCodeContext } from './VZCodeContext';
|
|
4
4
|
|
|
5
5
|
export const VZKeyboardShortcutsDoc = ({
|
|
@@ -20,9 +20,9 @@ export const VZKeyboardShortcutsDoc = ({
|
|
|
20
20
|
<Modal.Header closeButton>
|
|
21
21
|
<Modal.Title>Keyboard Shortcuts</Modal.Title>
|
|
22
22
|
</Modal.Header>
|
|
23
|
-
<Modal.Body
|
|
24
|
-
<Form.Group
|
|
25
|
-
<Form.Text
|
|
23
|
+
<Modal.Body>
|
|
24
|
+
<Form.Group>
|
|
25
|
+
<Form.Text>
|
|
26
26
|
Keyboard shortcuts and interactive widgets for
|
|
27
27
|
quick actions
|
|
28
28
|
</Form.Text>
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
useRef,
|
|
6
6
|
useState,
|
|
7
7
|
} from 'react';
|
|
8
|
-
import { Button, Modal, Form } from './
|
|
8
|
+
import { Button, Modal, Form } from './ui';
|
|
9
9
|
import { ThemeLabel, themes } from './themes';
|
|
10
10
|
import { VZCodeContext } from './VZCodeContext';
|
|
11
11
|
|
|
@@ -77,6 +77,7 @@ export const VZSettings = ({
|
|
|
77
77
|
setTheme,
|
|
78
78
|
username,
|
|
79
79
|
setUsername,
|
|
80
|
+
sidebarRef,
|
|
80
81
|
} = useContext(VZCodeContext);
|
|
81
82
|
|
|
82
83
|
// State variables for managing font and font size
|
|
@@ -143,19 +144,23 @@ export const VZSettings = ({
|
|
|
143
144
|
|
|
144
145
|
// Update font family in the document's style
|
|
145
146
|
useEffect(() => {
|
|
146
|
-
|
|
147
|
-
'
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
147
|
+
sidebarRef.current
|
|
148
|
+
?.closest<HTMLElement>('.app')
|
|
149
|
+
?.style.setProperty(
|
|
150
|
+
'--vzcode-font-family',
|
|
151
|
+
selectedFont,
|
|
152
|
+
);
|
|
153
|
+
}, [selectedFont, sidebarRef]);
|
|
151
154
|
|
|
152
155
|
// Update font size in the document's style
|
|
153
156
|
useEffect(() => {
|
|
154
|
-
|
|
155
|
-
'
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
sidebarRef.current
|
|
158
|
+
?.closest<HTMLElement>('.app')
|
|
159
|
+
?.style.setProperty(
|
|
160
|
+
'--vzcode-font-size',
|
|
161
|
+
selectedFontSize,
|
|
162
|
+
);
|
|
163
|
+
}, [selectedFontSize, sidebarRef]);
|
|
159
164
|
|
|
160
165
|
const usernameRef = useRef<HTMLInputElement>(null);
|
|
161
166
|
|
|
@@ -195,7 +200,7 @@ export const VZSettings = ({
|
|
|
195
200
|
</Modal.Header>
|
|
196
201
|
<Modal.Body>
|
|
197
202
|
{enableUsernameField ? (
|
|
198
|
-
<Form.Group
|
|
203
|
+
<Form.Group controlId="vz-settings-username">
|
|
199
204
|
<Form.Label>Username</Form.Label>
|
|
200
205
|
<Form.Control
|
|
201
206
|
type="text"
|
|
@@ -204,17 +209,18 @@ export const VZSettings = ({
|
|
|
204
209
|
placeholder="Enter username"
|
|
205
210
|
value={username}
|
|
206
211
|
/>
|
|
207
|
-
<Form.Text
|
|
212
|
+
<Form.Text>
|
|
208
213
|
Enter a username to be displayed on your
|
|
209
214
|
cursor
|
|
210
215
|
</Form.Text>
|
|
211
216
|
</Form.Group>
|
|
212
217
|
) : null}
|
|
213
218
|
|
|
214
|
-
<Form.Group
|
|
219
|
+
<Form.Group controlId="vz-settings-theme">
|
|
215
220
|
<Form.Label>Theme</Form.Label>
|
|
216
221
|
<select
|
|
217
|
-
|
|
222
|
+
id="vz-settings-theme"
|
|
223
|
+
className="vz-ui-select"
|
|
218
224
|
value={theme}
|
|
219
225
|
onChange={(e) =>
|
|
220
226
|
setTheme(e.target.value as ThemeLabel)
|
|
@@ -228,10 +234,11 @@ export const VZSettings = ({
|
|
|
228
234
|
</select>
|
|
229
235
|
</Form.Group>
|
|
230
236
|
|
|
231
|
-
<Form.Group
|
|
237
|
+
<Form.Group controlId="vz-settings-font">
|
|
232
238
|
<Form.Label>Font</Form.Label>
|
|
233
239
|
<select
|
|
234
|
-
|
|
240
|
+
id="vz-settings-font"
|
|
241
|
+
className="vz-ui-select"
|
|
235
242
|
onChange={(e) =>
|
|
236
243
|
setSelectedFont(e.target.value)
|
|
237
244
|
}
|
|
@@ -245,10 +252,11 @@ export const VZSettings = ({
|
|
|
245
252
|
</select>
|
|
246
253
|
</Form.Group>
|
|
247
254
|
|
|
248
|
-
<Form.Group
|
|
255
|
+
<Form.Group controlId="vz-settings-size">
|
|
249
256
|
<Form.Label>Font Size</Form.Label>
|
|
250
257
|
<select
|
|
251
|
-
|
|
258
|
+
id="vz-settings-size"
|
|
259
|
+
className="vz-ui-select"
|
|
252
260
|
onChange={(e) =>
|
|
253
261
|
setSelectedFontSize(e.target.value)
|
|
254
262
|
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { useCallback, useContext } from 'react';
|
|
2
|
+
import { getFileId } from '@vizhub/viz-utils';
|
|
3
|
+
import { AIChat } from '../../llm-streaming-ui';
|
|
4
|
+
import { VZCodeContext } from '../VZCodeContext';
|
|
5
|
+
import {
|
|
6
|
+
enableAskMode,
|
|
7
|
+
enableDiffView,
|
|
8
|
+
enableVoiceInput,
|
|
9
|
+
} from '../featureFlags';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Bridges VZCode's context into the standalone `AIChat` component.
|
|
13
|
+
*
|
|
14
|
+
* `AIChat` (from `llm-streaming-ui`) is fully controlled and reads no
|
|
15
|
+
* application state. This wrapper supplies the chat state, callbacks,
|
|
16
|
+
* feature flags, and file-link handling from `VZCodeContext`.
|
|
17
|
+
*/
|
|
18
|
+
export const AIChatWrapper = () => {
|
|
19
|
+
const {
|
|
20
|
+
content,
|
|
21
|
+
aiChatFocused,
|
|
22
|
+
aiChatMode,
|
|
23
|
+
aiChatMessage,
|
|
24
|
+
currentChatId,
|
|
25
|
+
selectedChatId,
|
|
26
|
+
setSelectedChatId,
|
|
27
|
+
aiErrorMessage,
|
|
28
|
+
setAIChatMode,
|
|
29
|
+
getStoredAIPrompt,
|
|
30
|
+
setAIChatMessage,
|
|
31
|
+
handleSendMessage,
|
|
32
|
+
setAIErrorMessage,
|
|
33
|
+
navigateMessageHistoryUp,
|
|
34
|
+
navigateMessageHistoryDown,
|
|
35
|
+
resetMessageHistoryNavigation,
|
|
36
|
+
enableMinimalEditFlow,
|
|
37
|
+
additionalWidgets,
|
|
38
|
+
openTab,
|
|
39
|
+
setIsAIChatOpen,
|
|
40
|
+
} = useContext(VZCodeContext);
|
|
41
|
+
|
|
42
|
+
// Open a file referenced by a link inside a diff.
|
|
43
|
+
const handleOpenFile = useCallback(
|
|
44
|
+
(fileName: string) => {
|
|
45
|
+
if (!content) return;
|
|
46
|
+
const fileId = getFileId(content, fileName);
|
|
47
|
+
if (fileId) {
|
|
48
|
+
openTab({ fileId, isTransient: false });
|
|
49
|
+
setIsAIChatOpen(false);
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
[content, openTab, setIsAIChatOpen],
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<AIChat
|
|
57
|
+
content={content}
|
|
58
|
+
aiChatFocused={aiChatFocused}
|
|
59
|
+
aiChatMode={aiChatMode}
|
|
60
|
+
setAIChatMode={setAIChatMode}
|
|
61
|
+
aiChatMessage={aiChatMessage}
|
|
62
|
+
setAIChatMessage={setAIChatMessage}
|
|
63
|
+
aiErrorMessage={aiErrorMessage}
|
|
64
|
+
setAIErrorMessage={setAIErrorMessage}
|
|
65
|
+
currentChatId={currentChatId}
|
|
66
|
+
selectedChatId={selectedChatId}
|
|
67
|
+
setSelectedChatId={setSelectedChatId}
|
|
68
|
+
handleSendMessage={handleSendMessage}
|
|
69
|
+
navigateMessageHistoryUp={navigateMessageHistoryUp}
|
|
70
|
+
navigateMessageHistoryDown={
|
|
71
|
+
navigateMessageHistoryDown
|
|
72
|
+
}
|
|
73
|
+
resetMessageHistoryNavigation={
|
|
74
|
+
resetMessageHistoryNavigation
|
|
75
|
+
}
|
|
76
|
+
getStoredAIPrompt={getStoredAIPrompt}
|
|
77
|
+
onOpenFile={handleOpenFile}
|
|
78
|
+
additionalWidgets={additionalWidgets}
|
|
79
|
+
enableDiffView={enableDiffView}
|
|
80
|
+
enableAskMode={enableAskMode}
|
|
81
|
+
enableVoiceInput={enableVoiceInput}
|
|
82
|
+
enableMinimalEditFlow={enableMinimalEditFlow}
|
|
83
|
+
/>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
useEffect,
|
|
6
6
|
useContext,
|
|
7
7
|
} from 'react';
|
|
8
|
-
import { Modal, Form, Button } from '../
|
|
8
|
+
import { Modal, Form, Button } from '../ui';
|
|
9
9
|
import { VZCodeContext } from '../VZCodeContext';
|
|
10
10
|
|
|
11
11
|
export const CreateDirModal = ({
|
|
@@ -83,7 +83,7 @@ export const CreateDirModal = ({
|
|
|
83
83
|
<Modal.Title>Create Directory</Modal.Title>
|
|
84
84
|
</Modal.Header>
|
|
85
85
|
<Modal.Body>
|
|
86
|
-
<Form.Group
|
|
86
|
+
<Form.Group controlId="fileName">
|
|
87
87
|
<Form.Label>Directory Name</Form.Label>
|
|
88
88
|
<Form.Control
|
|
89
89
|
type="text"
|
|
@@ -92,7 +92,7 @@ export const CreateDirModal = ({
|
|
|
92
92
|
ref={inputRef}
|
|
93
93
|
spellCheck="false"
|
|
94
94
|
/>
|
|
95
|
-
<Form.Text
|
|
95
|
+
<Form.Text>
|
|
96
96
|
Enter the name for your file
|
|
97
97
|
</Form.Text>
|
|
98
98
|
</Form.Group>
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
useEffect,
|
|
6
6
|
useContext,
|
|
7
7
|
} from 'react';
|
|
8
|
-
import { Modal, Form, Button } from '../
|
|
8
|
+
import { Modal, Form, Button } from '../ui';
|
|
9
9
|
import { VZCodeContext } from '../VZCodeContext';
|
|
10
10
|
|
|
11
11
|
export const CreateFileModal = ({
|
|
@@ -83,7 +83,7 @@ export const CreateFileModal = ({
|
|
|
83
83
|
<Modal.Title>Create File</Modal.Title>
|
|
84
84
|
</Modal.Header>
|
|
85
85
|
<Modal.Body>
|
|
86
|
-
<Form.Group
|
|
86
|
+
<Form.Group controlId="fileName">
|
|
87
87
|
<Form.Label>File Name</Form.Label>
|
|
88
88
|
<Form.Control
|
|
89
89
|
type="text"
|
|
@@ -92,7 +92,7 @@ export const CreateFileModal = ({
|
|
|
92
92
|
ref={inputRef}
|
|
93
93
|
spellCheck="false"
|
|
94
94
|
/>
|
|
95
|
-
<Form.Text
|
|
95
|
+
<Form.Text>
|
|
96
96
|
Enter the name for your file
|
|
97
97
|
</Form.Text>
|
|
98
98
|
</Form.Group>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Button, Modal } from '../
|
|
1
|
+
import { Button, Modal } from '../ui';
|
|
2
2
|
import { useCallback, useEffect } from 'react';
|
|
3
3
|
|
|
4
4
|
// Confirmation modal for deleting a file or directory.
|
|
5
|
-
//
|
|
5
|
+
// Built on VZCode's native dialog-based modal primitives.
|
|
6
6
|
|
|
7
7
|
export const DeleteConfirmationModal = ({
|
|
8
8
|
show,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from 'react';
|
|
8
8
|
import { ItemId } from '../../types';
|
|
9
9
|
import { EditSVG, TrashSVG } from '../Icons';
|
|
10
|
-
import { Tooltip, OverlayTrigger } from '../
|
|
10
|
+
import { Tooltip, OverlayTrigger } from '../ui';
|
|
11
11
|
import { VZCodeContext } from '../VZCodeContext';
|
|
12
12
|
import { FileTypeIcon } from './FileTypeIcon';
|
|
13
13
|
|
|
@@ -152,7 +152,7 @@ export const Item = ({
|
|
|
152
152
|
|
|
153
153
|
return (
|
|
154
154
|
<div
|
|
155
|
-
className={`file-or-directory
|
|
155
|
+
className={`file-or-directory ${
|
|
156
156
|
isActive ? 'active-file' : ''
|
|
157
157
|
}`}
|
|
158
158
|
onClick={isRenaming ? null : handleClick}
|
|
@@ -199,7 +199,7 @@ export const Item = ({
|
|
|
199
199
|
>
|
|
200
200
|
<i
|
|
201
201
|
onClick={handleRenameIconClick}
|
|
202
|
-
className="
|
|
202
|
+
className="vz-icon-button"
|
|
203
203
|
>
|
|
204
204
|
<EditSVG />
|
|
205
205
|
</i>
|
|
@@ -215,7 +215,7 @@ export const Item = ({
|
|
|
215
215
|
>
|
|
216
216
|
<i
|
|
217
217
|
onClick={handleModalOpen}
|
|
218
|
-
className="
|
|
218
|
+
className="vz-icon-button"
|
|
219
219
|
>
|
|
220
220
|
<TrashSVG />
|
|
221
221
|
</i>
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
useState,
|
|
6
6
|
useCallback,
|
|
7
7
|
} from 'react';
|
|
8
|
-
import { Form } from '../
|
|
8
|
+
import { Form } from '../ui';
|
|
9
9
|
import { VZCodeContext } from '../VZCodeContext';
|
|
10
10
|
import { VizFileId } from '@vizhub/viz-types';
|
|
11
11
|
import { SearchFile } from '../../types';
|
|
@@ -311,7 +311,7 @@ export const Search = () => {
|
|
|
311
311
|
return (
|
|
312
312
|
<div>
|
|
313
313
|
<Form.Group
|
|
314
|
-
className="sidebar-search-form
|
|
314
|
+
className="sidebar-search-form"
|
|
315
315
|
controlId="searchName"
|
|
316
316
|
>
|
|
317
317
|
<Form.Control
|
|
@@ -11,6 +11,7 @@ import { VisualEditorConfigEntry } from '../../../types';
|
|
|
11
11
|
import { EmptyState } from '../EmptyState';
|
|
12
12
|
import {
|
|
13
13
|
toHclChannels,
|
|
14
|
+
coerceChannelNumber,
|
|
14
15
|
hclChannelsToHex,
|
|
15
16
|
} from './colorUtils';
|
|
16
17
|
import { CONFIG_FILE_NAME } from './constants';
|
|
@@ -377,15 +378,18 @@ export const VisualEditor = () => {
|
|
|
377
378
|
'#000000';
|
|
378
379
|
|
|
379
380
|
const channels = toHclChannels(currentHex);
|
|
380
|
-
const currentH =
|
|
381
|
-
localValues[`${widgetConfig.property}_h`]
|
|
382
|
-
channels.h
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
381
|
+
const currentH = coerceChannelNumber(
|
|
382
|
+
localValues[`${widgetConfig.property}_h`],
|
|
383
|
+
channels.h,
|
|
384
|
+
);
|
|
385
|
+
const currentC = coerceChannelNumber(
|
|
386
|
+
localValues[`${widgetConfig.property}_c`],
|
|
387
|
+
channels.c,
|
|
388
|
+
);
|
|
389
|
+
const currentL = coerceChannelNumber(
|
|
390
|
+
localValues[`${widgetConfig.property}_l`],
|
|
391
|
+
channels.l,
|
|
392
|
+
);
|
|
389
393
|
|
|
390
394
|
return (
|
|
391
395
|
<ColorWidget
|
|
@@ -16,6 +16,20 @@ export function toHclChannels(value: string): HclChannels {
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Coerces a widget value to a finite number, falling back when
|
|
21
|
+
* the stored value is not numeric (widget values may be strings or
|
|
22
|
+
* booleans for other widget types).
|
|
23
|
+
*/
|
|
24
|
+
export function coerceChannelNumber(
|
|
25
|
+
value: unknown,
|
|
26
|
+
fallback: number,
|
|
27
|
+
): number {
|
|
28
|
+
return typeof value === 'number' && Number.isFinite(value)
|
|
29
|
+
? value
|
|
30
|
+
: fallback;
|
|
31
|
+
}
|
|
32
|
+
|
|
19
33
|
export function hclChannelsToHex(
|
|
20
34
|
channels: HclChannels,
|
|
21
35
|
fallback: string,
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
useRoomContext,
|
|
6
6
|
} from '@livekit/components-react';
|
|
7
7
|
import { useContext, useState } from 'react';
|
|
8
|
-
import { Button, Form, Modal } from '
|
|
8
|
+
import { Button, Form, Modal } from '../ui';
|
|
9
9
|
import { v4 } from 'uuid';
|
|
10
10
|
import { VZCodeContext } from '../VZCodeContext';
|
|
11
11
|
|
|
@@ -14,7 +14,13 @@ import {
|
|
|
14
14
|
PresenceIndicator,
|
|
15
15
|
} from '../../types';
|
|
16
16
|
import { VizFileId } from '@vizhub/viz-types';
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
Download,
|
|
19
|
+
Copy,
|
|
20
|
+
ClipboardPlus,
|
|
21
|
+
Trash2,
|
|
22
|
+
} from 'lucide-react';
|
|
23
|
+
import { OverlayTrigger, Tooltip } from '../ui';
|
|
18
24
|
import { getFileTree } from '../getFileTree';
|
|
19
25
|
import {
|
|
20
26
|
BugSVG,
|
|
@@ -32,7 +38,7 @@ import { MicSVG } from '../Icons/MicSVG';
|
|
|
32
38
|
import { sortFileTree } from '../sortFileTree';
|
|
33
39
|
import { SplitPaneResizeContext } from '../SplitPaneResizeContext';
|
|
34
40
|
import { VZCodeContext } from '../VZCodeContext';
|
|
35
|
-
import {
|
|
41
|
+
import { AIChatWrapper } from './AIChatWrapper';
|
|
36
42
|
import { Listing } from './Listing';
|
|
37
43
|
import { Search } from './Search';
|
|
38
44
|
import { DeleteConfirmationModal } from './DeleteConfirmationModal';
|
|
@@ -350,7 +356,7 @@ export const VZSidebar = ({
|
|
|
350
356
|
>
|
|
351
357
|
<i
|
|
352
358
|
id="ai-chat-icon"
|
|
353
|
-
className="
|
|
359
|
+
className="vz-icon-button"
|
|
354
360
|
onClick={() =>
|
|
355
361
|
handleAIChatButtonClick({
|
|
356
362
|
aiChatButtonEvent,
|
|
@@ -378,7 +384,7 @@ export const VZSidebar = ({
|
|
|
378
384
|
>
|
|
379
385
|
<i
|
|
380
386
|
id="files-icon"
|
|
381
|
-
className="
|
|
387
|
+
className="vz-icon-button"
|
|
382
388
|
onClick={() => {
|
|
383
389
|
setIsSearchOpen(false);
|
|
384
390
|
setIsAIChatOpen(false);
|
|
@@ -400,7 +406,7 @@ export const VZSidebar = ({
|
|
|
400
406
|
>
|
|
401
407
|
<i
|
|
402
408
|
id="search-icon"
|
|
403
|
-
className="
|
|
409
|
+
className="vz-icon-button"
|
|
404
410
|
onClick={() => {
|
|
405
411
|
setIsSearchOpen(true);
|
|
406
412
|
setIsAIChatOpen(false);
|
|
@@ -422,7 +428,7 @@ export const VZSidebar = ({
|
|
|
422
428
|
>
|
|
423
429
|
<i
|
|
424
430
|
id="visual-editor-icon"
|
|
425
|
-
className="
|
|
431
|
+
className="vz-icon-button"
|
|
426
432
|
onClick={() => {
|
|
427
433
|
setIsVisualEditorOpen(true);
|
|
428
434
|
setIsAIChatOpen(false);
|
|
@@ -444,7 +450,7 @@ export const VZSidebar = ({
|
|
|
444
450
|
>
|
|
445
451
|
<i
|
|
446
452
|
id="shortcut-icon"
|
|
447
|
-
className="
|
|
453
|
+
className="vz-icon-button"
|
|
448
454
|
onClick={handleQuestionMarkClick}
|
|
449
455
|
>
|
|
450
456
|
<QuestionMarkSVG />
|
|
@@ -464,10 +470,7 @@ export const VZSidebar = ({
|
|
|
464
470
|
target="_blank"
|
|
465
471
|
rel="noopener noreferrer"
|
|
466
472
|
>
|
|
467
|
-
<i
|
|
468
|
-
id="bug-icon"
|
|
469
|
-
className="icon-button icon-button-dark"
|
|
470
|
-
>
|
|
473
|
+
<i id="bug-icon" className="vz-icon-button">
|
|
471
474
|
<BugSVG />
|
|
472
475
|
</i>
|
|
473
476
|
</a>
|
|
@@ -483,7 +486,7 @@ export const VZSidebar = ({
|
|
|
483
486
|
>
|
|
484
487
|
<i
|
|
485
488
|
id="settings-icon"
|
|
486
|
-
className="
|
|
489
|
+
className="vz-icon-button"
|
|
487
490
|
onClick={handleSettingsClick}
|
|
488
491
|
>
|
|
489
492
|
<GearSVG />
|
|
@@ -500,7 +503,7 @@ export const VZSidebar = ({
|
|
|
500
503
|
>
|
|
501
504
|
<i
|
|
502
505
|
id="new-file-icon"
|
|
503
|
-
className="
|
|
506
|
+
className="vz-icon-button"
|
|
504
507
|
onClick={handleOpenCreateFileModal}
|
|
505
508
|
>
|
|
506
509
|
<NewSVG />
|
|
@@ -518,7 +521,7 @@ export const VZSidebar = ({
|
|
|
518
521
|
>
|
|
519
522
|
<i
|
|
520
523
|
id="new-directory-icon"
|
|
521
|
-
className="
|
|
524
|
+
className="vz-icon-button"
|
|
522
525
|
onClick={handleOpenCreateDirModal}
|
|
523
526
|
>
|
|
524
527
|
<FileSVG />
|
|
@@ -538,9 +541,9 @@ export const VZSidebar = ({
|
|
|
538
541
|
>
|
|
539
542
|
<i
|
|
540
543
|
id="auto-focus-icon"
|
|
541
|
-
className={`
|
|
544
|
+
className={`vz-icon-button${
|
|
542
545
|
enableAutoFollow
|
|
543
|
-
? '
|
|
546
|
+
? ' vz-color-success-01'
|
|
544
547
|
: ''
|
|
545
548
|
}`}
|
|
546
549
|
onClick={toggleAutoFollow}
|
|
@@ -561,7 +564,7 @@ export const VZSidebar = ({
|
|
|
561
564
|
>
|
|
562
565
|
<i
|
|
563
566
|
id="mic-icon"
|
|
564
|
-
className="
|
|
567
|
+
className="vz-icon-button"
|
|
565
568
|
onClick={() => {
|
|
566
569
|
setVoiceChatModalOpen(true);
|
|
567
570
|
}}
|
|
@@ -581,7 +584,7 @@ export const VZSidebar = ({
|
|
|
581
584
|
>
|
|
582
585
|
{isAIChatOpen ? (
|
|
583
586
|
<div className="sidebar-ai-chat">
|
|
584
|
-
<
|
|
587
|
+
<AIChatWrapper />
|
|
585
588
|
</div>
|
|
586
589
|
) : isSearchOpen ? (
|
|
587
590
|
<div className="sidebar-search">
|
|
@@ -646,7 +649,7 @@ export const VZSidebar = ({
|
|
|
646
649
|
onClick={handleExportToZip}
|
|
647
650
|
title="Export files to ZIP"
|
|
648
651
|
>
|
|
649
|
-
<
|
|
652
|
+
<Download size={14} aria-hidden="true" />
|
|
650
653
|
{exportButtonText}
|
|
651
654
|
</button>
|
|
652
655
|
)}
|
|
@@ -656,7 +659,7 @@ export const VZSidebar = ({
|
|
|
656
659
|
onClick={handleCopyForAI}
|
|
657
660
|
title="Copy files formatted for AI"
|
|
658
661
|
>
|
|
659
|
-
<
|
|
662
|
+
<Copy size={14} aria-hidden="true" />
|
|
660
663
|
{copyButtonText}
|
|
661
664
|
</button>
|
|
662
665
|
)}
|
|
@@ -666,7 +669,7 @@ export const VZSidebar = ({
|
|
|
666
669
|
onClick={handlePasteForAI}
|
|
667
670
|
title="Paste files from AI"
|
|
668
671
|
>
|
|
669
|
-
<
|
|
672
|
+
<ClipboardPlus size={14} aria-hidden="true" />
|
|
670
673
|
{pasteButtonText}
|
|
671
674
|
</button>
|
|
672
675
|
|
|
@@ -676,7 +679,7 @@ export const VZSidebar = ({
|
|
|
676
679
|
onClick={handleDeleteAllClick}
|
|
677
680
|
title="Delete all files"
|
|
678
681
|
>
|
|
679
|
-
<
|
|
682
|
+
<Trash2 size={14} aria-hidden="true" />
|
|
680
683
|
delete all
|
|
681
684
|
</button>
|
|
682
685
|
)}
|