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.
Files changed (74) hide show
  1. package/README.md +30 -0
  2. package/dist/assets/buildWorker-BZlya278.js +687 -0
  3. package/dist/assets/index-DT8aFBKg.js +356 -0
  4. package/dist/assets/index-DyMLoJaw.css +1 -0
  5. package/dist/assets/{worker-D8p1JlHW.js → worker-1oQYaz-F.js} +251 -251
  6. package/dist/assets/worker-BfgPD8zR.js +125 -0
  7. package/dist/assets/{worker-k7HZ3t-V.js → worker-CoJaqtpi.js} +12 -12
  8. package/dist/index.html +2 -2
  9. package/dist/ot.js +180 -2
  10. package/dist/server/createServer.js +281 -0
  11. package/dist/server/index.js +6 -269
  12. package/package.json +14 -6
  13. package/src/client/AIAssist/AIAssistWidget/index.tsx +2 -2
  14. package/src/client/AIAssist/AIAssistWidget/style.scss +8 -8
  15. package/src/client/AIAssist/Spinner.jsx +2 -2
  16. package/src/client/App/style.scss +6 -9
  17. package/src/client/CodeEditor/getOrCreateEditor.tsx +1 -15
  18. package/src/client/CodeEditor/style.scss +13 -13
  19. package/src/client/CodeErrorOverlay/index.tsx +1 -1
  20. package/src/client/CodeErrorOverlay/style.scss +3 -3
  21. package/src/client/ImageViewer/style.scss +6 -6
  22. package/src/client/RunCodeWidget/index.tsx +3 -3
  23. package/src/client/RunCodeWidget/style.scss +2 -2
  24. package/src/client/TabList/Tab.tsx +2 -2
  25. package/src/client/TabList/style.scss +6 -5
  26. package/src/client/VZKeyboardShortcutsDoc.tsx +4 -4
  27. package/src/client/VZSettings.tsx +27 -19
  28. package/src/client/VZSidebar/AIChatWrapper.tsx +85 -0
  29. package/src/client/VZSidebar/CreateDirModal.tsx +3 -3
  30. package/src/client/VZSidebar/CreateFileModal.tsx +3 -3
  31. package/src/client/VZSidebar/DeleteConfirmationModal.tsx +2 -2
  32. package/src/client/VZSidebar/Item.tsx +4 -4
  33. package/src/client/VZSidebar/Search.tsx +2 -2
  34. package/src/client/VZSidebar/VisualEditor/VisualEditor.tsx +13 -9
  35. package/src/client/VZSidebar/VisualEditor/colorUtils.ts +14 -0
  36. package/src/client/VZSidebar/VoiceChatModal.tsx +1 -1
  37. package/src/client/VZSidebar/index.tsx +25 -22
  38. package/src/client/VZSidebar/styles.scss +99 -98
  39. package/src/client/main.jsx +1 -0
  40. package/src/client/standalone.scss +6 -0
  41. package/src/client/ui.scss +317 -0
  42. package/src/client/ui.tsx +323 -0
  43. package/src/client/useOpenDirectories.ts +0 -1
  44. package/src/llm-streaming-server/README.md +5 -3
  45. package/src/llm-streaming-ui/README.md +44 -42
  46. package/src/llm-streaming-ui/components/ChatInput.tsx +31 -67
  47. package/src/llm-streaming-ui/components/DiffView.scss +1 -1
  48. package/src/llm-streaming-ui/components/DiffView.tsx +6 -24
  49. package/src/llm-streaming-ui/components/FileEditingIndicator.tsx +1 -1
  50. package/src/llm-streaming-ui/components/Message.tsx +11 -27
  51. package/src/llm-streaming-ui/components/MessageList.tsx +15 -29
  52. package/src/llm-streaming-ui/components/Spinner.scss +37 -0
  53. package/src/llm-streaming-ui/components/Spinner.tsx +59 -0
  54. package/src/llm-streaming-ui/components/icons.tsx +68 -0
  55. package/src/llm-streaming-ui/components/index.tsx +34 -30
  56. package/src/llm-streaming-ui/components/styles.scss +127 -75
  57. package/src/llm-streaming-ui/index.ts +13 -0
  58. package/src/llm-streaming-ui/props.ts +137 -0
  59. package/src/ot.ts +221 -4
  60. package/src/server/createServer.ts +413 -0
  61. package/src/server/index.ts +8 -333
  62. package/dist/assets/bootstrap-icons-BeopsB42.woff +0 -0
  63. package/dist/assets/bootstrap-icons-mSm7cUeB.woff2 +0 -0
  64. package/dist/assets/buildWorker-DylWm2VX.js +0 -687
  65. package/dist/assets/index-Dyt9tpmu.css +0 -1
  66. package/dist/assets/index-rg2Zvfo_.js +0 -364
  67. package/dist/assets/worker-b9bkZkXK.js +0 -116
  68. package/src/client/AIAssist/AIAssistCodeMirrorKeyMap.ts +0 -42
  69. package/src/client/AIAssist/generateFilesContext.ts +0 -25
  70. package/src/client/AIAssist/index.ts +0 -2
  71. package/src/client/CodeEditor/InteractiveWidgets/highlightWidgets.ts +0 -79
  72. package/src/client/bootstrap.ts +0 -26
  73. /package/src/{client → llm-streaming-ui}/hooks/useAutoScroll.ts +0 -0
  74. /package/src/{client → llm-streaming-ui}/utils/scrollUtils.ts +0 -0
@@ -1,31 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import WebSocketJSONStream from '@teamwork/websocket-json-stream';
3
- import bodyParser from 'body-parser';
4
- import express from 'express';
5
- import fs from 'fs';
6
- import http from 'http';
7
2
  import open from 'open';
8
- import path from 'path';
9
- import ShareDB from 'sharedb';
10
- import { fileURLToPath } from 'url';
11
- import { WebSocketServer } from 'ws';
12
- import { json1Presence } from '../ot.js';
13
- import { computeInitialDocument } from './computeInitialDocument.js';
14
- import { handleAIAssist } from './handleAIAssist.js';
15
- import { handleAICopilot } from './handleAICopilot.js';
16
- import { handleAIChatMessage } from './handleAIChatMessage.js';
17
- import { isDirectory } from './isDirectory.js';
18
- import { createToken } from './livekit.js';
19
- import './setupEnv.js';
20
- // Import the image file utility
21
- const isImageFile = (fileName) => {
22
- return (fileName.match(/\.(png|jpg|jpeg|gif|bmp|svg|webp)$/i) !== null);
23
- };
24
- // The time in milliseconds by which auto-saving is debounced.
25
- const autoSaveDebounceTimeMS = 800;
26
- // The time in milliseconds by which auto-saving is throttled
27
- // when the user is interacting with the widgets in the editor.
28
- const throttleTimeMS = 100;
3
+ import { createVZCodeServer } from './createServer.js';
29
4
  // Helper function to get the port from command line arguments or use default.
30
5
  function getPortFromArgs(defaultPort = 3030) {
31
6
  const portArg = process.argv.find((arg) => arg.startsWith('--port='));
@@ -36,252 +11,14 @@ function getPortFromArgs(defaultPort = 3030) {
36
11
  }
37
12
  // Server port.
38
13
  const port = getPortFromArgs();
39
- const initialDocument = computeInitialDocument({
40
- // Use the current working directory to look for files.
41
- fullPath: process.cwd(),
14
+ const { ready, listen } = createVZCodeServer();
15
+ ready.catch((error) => {
16
+ console.error('Failed to initialize ShareDB document:', error);
42
17
  });
43
- // Register our custom OT type,
44
- // because it does not ship with ShareDB.
45
- ShareDB.types.register(json1Presence.type);
46
- const app = express();
47
- // Use ShareDB over WebSocket
48
- const shareDBBackend = new ShareDB({
49
- // Enable presence
50
- // See https://github.com/share/sharedb/blob/master/examples/rich-text-presence/server.js#L9
51
- presence: true,
52
- doNotForwardSendPresenceErrorsToClient: true,
53
- });
54
- const server = http.createServer(app);
55
- const wss = new WebSocketServer({ server });
56
- wss.on('connection', (ws) => {
57
- const clientStream = new WebSocketJSONStream(ws);
58
- shareDBBackend.listen(clientStream);
59
- // Prevent server crashes on errors.
60
- clientStream.on('error', (error) => {
61
- console.log('clientStream error: ' + error.message);
62
- });
63
- // Handle errors
64
- ws.on('error', (error) => {
65
- console.log('ws error: ' + error.message);
66
- });
67
- // Handle disconnections
68
- ws.on('close', () => {
69
- clientStream.end();
70
- });
71
- });
72
- // Serve static files
73
- const filename = fileURLToPath(import.meta.url);
74
- const dirname = path.dirname(filename);
75
- const dir = path.join(dirname, '..', '..', 'dist');
76
- app.use(express.static(dir));
77
- // Create the initial "document",
78
- // which is a representation of files on disk.
79
- const shareDBConnection = shareDBBackend.connect();
80
- const shareDBDoc = shareDBConnection.get('documents', '1');
81
- shareDBDoc.create(initialDocument, json1Presence.type.uri);
82
- // Handle AI Assist requests.
83
- app.post('/ai-assist', bodyParser.json(), handleAIAssist(shareDBDoc));
84
- // Handle AI Copilot requests.
85
- app.post('/ai-copilot', bodyParser.json(), handleAICopilot());
86
- // Handle AI Chat Message requests.
87
- app.post('/ai-chat-message', bodyParser.json(), handleAIChatMessage({
88
- shareDBDoc,
89
- onCreditDeduction: undefined,
90
- }));
91
- // Livekit Token Generator
92
- app.get('/livekit-token', async (req, res) => {
93
- const { room, username } = req.query;
94
- res.send(await createToken(room, username));
95
- });
96
- // The state of the document when files were last auto-saved.
97
- let previousDocument = initialDocument;
98
- // Saves the files that changed.
99
- const save = () => {
100
- const currentDocument = shareDBDoc.data;
101
- // Take a look at each file (key) previously and currently.
102
- const allKeys = Object.keys({
103
- ...currentDocument.files,
104
- ...previousDocument.files,
105
- });
106
- const directoriesToDelete = [];
107
- for (const key of allKeys) {
108
- const previous = previousDocument.files[key];
109
- const current = currentDocument.files[key];
110
- // If this file was neither created nor deleted...
111
- if (previous && current) {
112
- // Handle changing of text content.
113
- if (previous.text !== current.text) {
114
- if (isImageFile(current.name)) {
115
- // Write image files as binary from base64
116
- const buffer = Buffer.from(current.text, 'base64');
117
- fs.writeFileSync(current.name, buffer);
118
- }
119
- else {
120
- // Write non-image files as text
121
- fs.writeFileSync(current.name, current.text);
122
- }
123
- }
124
- // // Handle renaming files.
125
- // if (previous.name !== current.name) {
126
- // const previousPath = previous.name.split('/');
127
- // const currentPath = current.name.split('/');
128
- // // - If the path is length 1 for previous and current,
129
- // // then this should be true.
130
- // // - If the path length is the sane for previous and current,
131
- // // AND all the entries leading up to the last one are the same
132
- // // between previous and current, AND the last entry in the arrays
133
- // // (the file name itself) is different between previous and current
134
- // const onlyFileNameChanged =
135
- // (previousPath.length === 1 &&
136
- // currentPath.length === 1) ||
137
- // (previousPath.length === currentPath.length &&
138
- // previousPath
139
- // .slice(0, -1)
140
- // .every(
141
- // (val, index) => val === currentPath[index],
142
- // ) &&
143
- // previousPath.at(-1) !== currentPath.at(-1));
144
- // // This logic works if only the file name itself changes.
145
- // if (onlyFileNameChanged) {
146
- // fs.renameSync(previous.name, current.name);
147
- // }
148
- // {
149
- // // If we get here, then the directory may have been renamed,
150
- // // or the file has been moved between directories.
151
- // // If we get here, then the directory may have been renamed,
152
- // // or the file has been moved between directories.
153
- // const newDir = path.dirname(current.name);
154
- // // Check if the new directory exists, if not, create it
155
- // if (!fs.existsSync(newDir)) {
156
- // fs.mkdirSync(newDir, { recursive: true });
157
- // }
158
- // // Move the file to the new directory
159
- // fs.renameSync(previous.name, current.name);
160
- // }
161
- // }
162
- // Handle renaming files.
163
- if (previous.name !== current.name) {
164
- if (isDirectory(previous.name)) {
165
- // If the directory itself is being renamed,
166
- // Phase I: Ignore it, and get the files moved
167
- // Phase II: Keep track of these, and delete them after
168
- // all the files moved.
169
- // directoriesToDelete.push(previous.name)
170
- directoriesToDelete.push(previous.name);
171
- }
172
- else {
173
- const newDir = path.dirname(current.name);
174
- // Check if the new directory exists, if not, create it
175
- if (!fs.existsSync(newDir)) {
176
- fs.mkdirSync(newDir, { recursive: true });
177
- }
178
- // Move the file to the new directory
179
- fs.renameSync(previous.name, current.name);
180
- }
181
- }
182
- }
183
- // handle deleting files and directories.
184
- if (previous && !current) {
185
- const stats = fs.statSync(previous.name);
186
- //Check if the file path we are trying to delete is a directory
187
- if (!stats.isDirectory()) {
188
- fs.unlinkSync(previous.name);
189
- }
190
- else {
191
- //Performs directory deletion.
192
- fs.rm(previous.name, {
193
- recursive: true, //Makes sure that all files in directory are deleted.
194
- }, (error) => {
195
- if (error) {
196
- console.log(error);
197
- }
198
- });
199
- }
200
- }
201
- // Handle creating files and Directories.
202
- if (!previous && current) {
203
- //File Creation
204
- if (!isDirectory(current.name)) {
205
- if (isImageFile(current.name)) {
206
- // Write image files as binary from base64
207
- const buffer = Buffer.from(current.text, 'base64');
208
- fs.writeFileSync(current.name, buffer);
209
- }
210
- else {
211
- // Write non-image files as text
212
- fs.writeFileSync(current.name, current.text);
213
- }
214
- }
215
- else {
216
- fs.mkdirSync(current.name, { recursive: true });
217
- }
218
- }
219
- }
220
- // TODO deleted all directories under directoriesToDelete
221
- for (const dir of directoriesToDelete) {
222
- //Performs directory deletion.
223
- fs.rm(dir, {
224
- recursive: true, //Makes sure that all files in directory are deleted.
225
- }, (error) => {
226
- if (error) {
227
- console.log(error);
228
- }
229
- });
230
- }
231
- previousDocument = currentDocument;
232
- };
233
- // // Listen for when users modify files.
234
- // // Files get written to disk after `autoSaveDebounceTimeMS`
235
- // // milliseconds of inactivity.
236
- // let timeout;
237
- // shareDBDoc.subscribe(() => {
238
- // shareDBDoc.on('op', () => {
239
- // // console.log(shareDBDoc.data.isInteracting);
240
- // clearTimeout(timeout);
241
- // timeout = setTimeout(save, autoSaveDebounceTimeMS);
242
- // });
243
- // });
244
- let lastExecutedTime = Date.now();
245
- let lastChangeTimeout; // This timeout ensures the last change is saved
246
- // Function to throttle the saving
247
- function throttleSave() {
248
- const now = Date.now();
249
- const timeSinceLastExecution = now - lastExecutedTime;
250
- if (timeSinceLastExecution > throttleTimeMS) {
251
- save();
252
- lastExecutedTime = now;
253
- }
254
- else {
255
- // Clear the previous timeout and set a new one to save the last change
256
- clearTimeout(lastChangeTimeout);
257
- lastChangeTimeout = setTimeout(() => {
258
- save();
259
- lastExecutedTime = now;
260
- }, throttleTimeMS - timeSinceLastExecution);
261
- }
262
- }
263
- // Function to debounce the saving
264
- let debounceTimeout;
265
- function debounceSave() {
266
- clearTimeout(debounceTimeout);
267
- debounceTimeout = setTimeout(save, autoSaveDebounceTimeMS);
268
- }
269
- // Subscribe to listen for modifications
270
- shareDBDoc.subscribe(() => {
271
- shareDBDoc.on('op', () => {
272
- if (shareDBDoc.data.isInteracting) {
273
- throttleSave();
274
- }
275
- else {
276
- debounceSave();
277
- }
278
- });
279
- });
280
- server.listen(port, async () => {
281
- // Note: ngrok support can be added when the package is properly installed
18
+ listen(port).then((actualPort) => {
282
19
  // Sets the port to the one specified in the environment
283
20
  // variable (for development) or the default port.
284
- const livePort = process.env.EDITOR_PORT || port;
21
+ const livePort = process.env.EDITOR_PORT || actualPort;
285
22
  console.log(`EDITOR_PORT: ${process.env.EDITOR_PORT}`);
286
23
  console.log(`Editor is live at http://localhost:${livePort}`);
287
24
  open(`http://localhost:${livePort}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vzcode",
3
- "version": "2.35.0",
3
+ "version": "3.0.0",
4
4
  "description": "Multiplayer code editor system",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
@@ -13,6 +13,9 @@
13
13
  ],
14
14
  "scripts": {
15
15
  "test": "vitest run",
16
+ "test:e2e": "vitest run test/serverE2E.test.ts",
17
+ "e2e": "playwright test",
18
+ "e2e:headed": "playwright test --headed",
16
19
  "test-interactive": "cd test/sampleDirectories/playground && tsx ../../../src/server/index.ts",
17
20
  "prettier": "prettier {*.*,**/*.*} --write",
18
21
  "typecheck": "tsc --noEmit",
@@ -113,17 +116,22 @@
113
116
  "homepage": "https://github.com/vizhub-core/vzcode#readme",
114
117
  "dependencies": {
115
118
  "@codemirror/autocomplete": "^6.20.0",
119
+ "@codemirror/commands": "^6.11.1",
116
120
  "@codemirror/lang-css": "^6.3.1",
117
121
  "@codemirror/lang-html": "^6.4.11",
118
122
  "@codemirror/lang-javascript": "^6.2.4",
119
123
  "@codemirror/lang-json": "^6.0.2",
120
124
  "@codemirror/lang-markdown": "^6.5.0",
125
+ "@codemirror/language": "^6.13.1",
121
126
  "@codemirror/lint": "^6.9.2",
127
+ "@codemirror/search": "^6.7.2",
122
128
  "@codemirror/state": "^6.5.3",
123
129
  "@codemirror/theme-one-dark": "^6.1.3",
124
130
  "@codemirror/view": "^6.39.8",
131
+ "@dmsnell/diff-match-patch": "^1.1.0",
125
132
  "@langchain/core": "^1.1.8",
126
133
  "@langchain/openai": "^1.2.0",
134
+ "@lezer/common": "^1.5.4",
127
135
  "@lezer/highlight": "^1.2.3",
128
136
  "@livekit/components-react": "^2.9.17",
129
137
  "@replit/codemirror-indentation-markers": "^6.5.3",
@@ -146,7 +154,6 @@
146
154
  "@vizhub/viz-types": "^0.5.0",
147
155
  "@vizhub/viz-utils": "^1.5.0",
148
156
  "body-parser": "^2.2.1",
149
- "bootstrap-icons": "^1.13.1",
150
157
  "codemirror": "^6.0.2",
151
158
  "codemirror-copilot": "^0.0.7",
152
159
  "codemirror-ot": "^5.8.0",
@@ -155,7 +162,6 @@
155
162
  "d3-array": "^3.2.4",
156
163
  "d3-color": "^3.1.0",
157
164
  "diff": "^8.0.2",
158
- "@dmsnell/diff-match-patch": "^1.1.0",
159
165
  "diff2html": "3.4.52",
160
166
  "dotenv": "^17.2.3",
161
167
  "editcodewithai": "^2.4.0",
@@ -167,11 +173,10 @@
167
173
  "livekit-server-sdk": "^2.15.0",
168
174
  "llm-code-format": "^3.1.0",
169
175
  "lucide-react": "^0.562.0",
170
- "npm": "^11.7.0",
171
176
  "open": "^11.0.0",
177
+ "openai": "^6.9.1",
172
178
  "prettier-plugin-svelte": "^3.4.1",
173
179
  "react": "^18",
174
- "react-bootstrap": "^2.10.10",
175
180
  "react-dom": "^18",
176
181
  "react-markdown": "^10.1.0",
177
182
  "react-router-dom": "^7.11.0",
@@ -179,13 +184,14 @@
179
184
  "sharedb": "^5.2.2",
180
185
  "sharedb-client-browser": "^5.2.2",
181
186
  "uuid": "^13.0.0",
182
- "vizhub-ui": "^3.24.0",
183
187
  "ws": "^8.18.3"
184
188
  },
185
189
  "devDependencies": {
186
190
  "@eslint/js": "^9.39.2",
191
+ "@playwright/test": "^1.57.0",
187
192
  "@tauri-apps/cli": "^2.9.6",
188
193
  "@types/d3-color": "^3.1.3",
194
+ "@types/node": "^22.20.5",
189
195
  "@types/react": "^18",
190
196
  "@types/react-dom": "^18",
191
197
  "@typescript-eslint/eslint-plugin": "^8.51.0",
@@ -198,9 +204,11 @@
198
204
  "eslint-plugin-react": "^7.37.5",
199
205
  "eslint-plugin-react-hooks": "^7.0.1",
200
206
  "globals": "^17.0.0",
207
+ "livekit-client": "^2.16.0",
201
208
  "npm-check-updates": "^19.2.0",
202
209
  "prettier": "^3.7.4",
203
210
  "sass": "^1.97.1",
211
+ "svelte": "^5.20.1",
204
212
  "ts-node": "^10.9.2",
205
213
  "tsx": "^4.21.0",
206
214
  "typescript": "^5.9.3",
@@ -1,5 +1,5 @@
1
1
  import { useCallback, useContext, useState } from 'react';
2
- import { OverlayTrigger, Tooltip } from '../../bootstrap';
2
+ import { OverlayTrigger, Tooltip } from '../../ui';
3
3
  import { PaneId, TabState } from '../../../types';
4
4
  import { VizFileId } from '@vizhub/viz-types';
5
5
  import { VZCodeContext } from '../../VZCodeContext';
@@ -133,7 +133,7 @@ export const AIAssistWidget = ({
133
133
  }
134
134
  >
135
135
  <i
136
- className="icon-button icon-button-dark"
136
+ className="vz-icon-button"
137
137
  onClick={aiAssistClickOverride || handleClick}
138
138
  >
139
139
  <SparklesSVG />
@@ -4,10 +4,10 @@
4
4
  // right: 32px;
5
5
  bottom: 16px;
6
6
  right: 16px;
7
- color: var(--vh-color-caution-01);
7
+ color: var(--vz-color-caution-01);
8
8
  }
9
9
 
10
- .vh-spinner {
10
+ .vz-spinner {
11
11
  display: flex;
12
12
  height: 100%;
13
13
  flex-direction: column;
@@ -18,11 +18,11 @@
18
18
 
19
19
  /* Fade in after a delay */
20
20
  /* https://stackoverflow.com/questions/29846224/css-animation-with-delay-and-opacity */
21
- .vh-spinner.fade-in svg {
22
- animation: 1s linear 0s normal forwards 1 fadein;
21
+ .vz-spinner.fade-in svg {
22
+ animation: 1s linear 0s normal forwards 1 vz-assist-fadein;
23
23
  }
24
24
 
25
- @keyframes fadein {
25
+ @keyframes vz-assist-fadein {
26
26
  0% {
27
27
  opacity: 0;
28
28
  }
@@ -36,11 +36,11 @@
36
36
 
37
37
  /* Infinite rotation */
38
38
  /* https://stackoverflow.com/questions/6410730/css-endless-rotation-animation */
39
- .vh-spinner-dots {
40
- animation: rotate 3s linear infinite;
39
+ .vz-spinner-dots {
40
+ animation: vz-assist-rotate 3s linear infinite;
41
41
  }
42
42
 
43
- @keyframes rotate {
43
+ @keyframes vz-assist-rotate {
44
44
  to {
45
45
  transform: rotate(360deg);
46
46
  }
@@ -50,7 +50,7 @@ export const Spinner = ({
50
50
  return (
51
51
  show && (
52
52
  <div
53
- className={`vh-spinner${fadeIn ? ' fade-in' : ''}`}
53
+ className={`vz-spinner${fadeIn ? ' fade-in' : ''}`}
54
54
  >
55
55
  <svg
56
56
  height={height}
@@ -58,7 +58,7 @@ export const Spinner = ({
58
58
  style={{ opacity: 1 }}
59
59
  >
60
60
  <g transform="translate(50, 50)" fill={fill}>
61
- <g className="vh-spinner-dots">
61
+ <g className="vz-spinner-dots">
62
62
  {dots.map(({ x, y, r }, i) => (
63
63
  <circle
64
64
  key={i}
@@ -4,11 +4,11 @@
4
4
  @import url('https://fonts.googleapis.com/css2?family=Ubuntu+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap');
5
5
  @import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');
6
6
  @import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&display=swap');
7
- :root {
7
+ .app {
8
8
  // --vzcode-font-family: ui-monospace, SFMono-Regular,
9
9
  // 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace !important;
10
10
 
11
- --vzcode-font-family: 'Roboto Mono', monospace !important;
11
+ --vzcode-font-family: 'Roboto Mono', monospace;
12
12
  --vzcode-font-size: 16px;
13
13
 
14
14
  /* Variable for the background color */
@@ -20,27 +20,24 @@
20
20
  }
21
21
 
22
22
  /* Scrollbar Styles */
23
- ::-webkit-scrollbar {
23
+ .app ::-webkit-scrollbar {
24
24
  width: 16px;
25
25
  height: 16px;
26
26
  }
27
27
 
28
- // ::-webkit-scrollbar-track {
28
+ // .app ::-webkit-scrollbar-track {
29
29
  // background: rgb(255, 255, 255, 0.1);
30
30
  // }
31
31
 
32
- ::-webkit-scrollbar-thumb {
32
+ .app ::-webkit-scrollbar-thumb {
33
33
  background: rgb(255, 255, 255, 0.3);
34
34
  }
35
35
 
36
- ::-webkit-scrollbar-thumb:hover {
36
+ .app ::-webkit-scrollbar-thumb:hover {
37
37
  background: #555;
38
38
  }
39
39
 
40
40
  /* Layout Styles */
41
- html,
42
- body,
43
- #root,
44
41
  .app {
45
42
  height: 100%;
46
43
  }
@@ -384,22 +384,8 @@ export const getOrCreateEditor = async ({
384
384
  widgets({ onInteract, customInteractRules }),
385
385
  );
386
386
 
387
- // TODO fix the bugginess in this one where
388
- // the highlight persists after the mouse leaves.
389
- // extensions.push(highlightWidgets);
390
-
391
387
  extensions.push(rotationIndicator);
392
388
 
393
- // extensions.push(
394
- // AIAssistCodeMirrorKeyMap({
395
- // shareDBDoc,
396
- // fileId,
397
- // tabList,
398
- // aiAssistEndpoint,
399
- // aiAssistOptions,
400
- // }),
401
- // );
402
-
403
389
  // Add the extension that provides indentation markers.
404
390
  extensions.push(
405
391
  indentationMarkers({
@@ -492,7 +478,7 @@ export const getOrCreateEditor = async ({
492
478
  wrap.style.display = 'inline-flex'; // prevent block expansion
493
479
  wrap.style.alignItems = 'center';
494
480
  wrap.style.justifyContent = 'center';
495
- wrap.className = 'icon-button icon-button-dark';
481
+ wrap.className = 'vz-icon-button';
496
482
  wrap.style.cursor = 'pointer';
497
483
 
498
484
  // Handle click directly on the wrapper element
@@ -74,33 +74,33 @@
74
74
  .cm-panel.cm-search {
75
75
  padding: 5px;
76
76
  position: relative;
77
- background-color: var(--vh-color-neutral-01);
77
+ background-color: var(--vz-color-neutral-01);
78
78
  border-radius: 6px;
79
- color: var(--vh-color-neutral-04);
79
+ color: var(--vz-color-neutral-04);
80
80
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
81
81
  }
82
82
 
83
83
  .cm-panels {
84
84
  background-color: #333338;
85
- color: var(--vh-color-neutral-04);
86
- border: 2px solid var(--vh-color-neutral-02);
85
+ color: var(--vz-color-neutral-04);
86
+ border: 2px solid var(--vz-color-neutral-02);
87
87
  border-radius: 6px;
88
88
  }
89
89
 
90
90
  .cm-textfield {
91
- background-color: var(--vh-color-neutral-01);
91
+ background-color: var(--vz-color-neutral-01);
92
92
  color: #efe7dc;
93
- border: 1px solid var(--vh-color-neutral-04);
93
+ border: 1px solid var(--vz-color-neutral-04);
94
94
  padding: 8px;
95
95
  border-radius: 6px;
96
96
  font-size: 14px;
97
97
  }
98
98
 
99
99
  .cm-button {
100
- background-color: var(--vh-color-neutral-01);
100
+ background-color: var(--vz-color-neutral-01);
101
101
  border: 1px solid #193350;
102
- color: var(--vh-color-neutral-04);
103
- border: 1px solid var(--vh-color-neutral-04);
102
+ color: var(--vz-color-neutral-04);
103
+ border: 1px solid var(--vz-color-neutral-04);
104
104
  border-radius: 5px;
105
105
  padding: 6px 12px;
106
106
  font-weight: bold;
@@ -133,8 +133,8 @@
133
133
  position: absolute;
134
134
  top: 0;
135
135
  right: 4px;
136
- background-color: var(--vh-color-neutral-01);
137
- color: var(--vh-color-neutral-04);
136
+ background-color: var(--vz-color-neutral-01);
137
+ color: var(--vz-color-neutral-04);
138
138
  border: none;
139
139
  font: inherit;
140
140
  padding: 4px 8px;
@@ -145,12 +145,12 @@
145
145
  }
146
146
 
147
147
  .cm-panel.cm-search [name='close']:hover {
148
- background-color: var(--vh-color-caution-01);
148
+ background-color: var(--vz-color-caution-01);
149
149
  color: #ffffff;
150
150
  }
151
151
 
152
152
  .cm-panel.cm-search [name='close']:active {
153
- background-color: var(--vh-color-caution-02);
153
+ background-color: var(--vz-color-caution-02);
154
154
  transform: scale(0.95);
155
155
  }
156
156
  }
@@ -66,7 +66,7 @@ export const CodeErrorOverlay = ({
66
66
  <pre>{errorMessage}</pre>
67
67
  {enableErrorDismiss ? (
68
68
  <i
69
- className="icon-button icon-button-dark error-dismiss-button"
69
+ className="vz-icon-button error-dismiss-button"
70
70
  onClick={handleCloseClick}
71
71
  >
72
72
  <CloseSVG />
@@ -1,8 +1,8 @@
1
1
  .vz-code-error-overlay {
2
- color: var(--vh-color-neutral-04);
3
- background: var(--vh-color-neutral-01);
2
+ color: var(--vz-color-neutral-04);
3
+ background: var(--vz-color-neutral-01);
4
4
  opacity: 0.9;
5
- border-left: 4px solid var(--vh-color-warning-01);
5
+ border-left: 4px solid var(--vz-color-warning-01);
6
6
  position: absolute;
7
7
  bottom: 0;
8
8
  left: 0;
@@ -3,14 +3,14 @@
3
3
  width: 100%;
4
4
  display: flex;
5
5
  flex-direction: column;
6
- background-color: var(--bs-body-bg);
7
- color: var(--bs-body-color);
6
+ background-color: var(--vz-bg-color);
7
+ color: var(--vz-color-neutral-04);
8
8
  }
9
9
 
10
10
  .image-viewer-header {
11
11
  padding: 12px 16px;
12
- border-bottom: 1px solid var(--bs-border-color);
13
- background-color: var(--bs-tertiary-bg);
12
+ border-bottom: 1px solid var(--vz-color-neutral-03);
13
+ background-color: var(--vz-color-neutral-02);
14
14
  }
15
15
 
16
16
  .image-viewer-content {
@@ -35,7 +35,7 @@
35
35
  align-items: center;
36
36
  justify-content: center;
37
37
  height: 100%;
38
- color: var(--bs-text-muted);
39
- font-family: var(--bs-font-monospace);
38
+ color: var(--vz-color-neutral-03);
39
+ font-family: var(--vzcode-font-family);
40
40
  font-size: 14px;
41
41
  }