vzcode 1.0.0 → 1.2.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 +1 -1
- package/dist/assets/{index-DacyImKg.js → index-Blj_0vZF.js} +50 -50
- package/dist/assets/{index-C4h28erw.js → index-BmJyUPq5.js} +19 -19
- package/dist/assets/worker-DtIkBAuN.js +282 -0
- package/dist/index.html +1 -1
- package/package.json +28 -24
- package/src/client/CodeEditor/index.tsx +7 -2
- package/src/client/CodeEditor/json1PresenceDisplay.ts +3 -1
- package/src/client/useEditorCache.ts +1 -0
- package/src/server/index.js +4 -4
- package/dist/assets/worker-BIf7QrAH.js +0 -282
package/dist/index.html
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
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-
|
|
23
|
+
<script type="module" crossorigin src="/assets/index-Blj_0vZF.js"></script>
|
|
24
24
|
<link rel="stylesheet" crossorigin href="/assets/index-CWMOj-be.css">
|
|
25
25
|
</head>
|
|
26
26
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vzcode",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Multiplayer code editor system",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
},
|
|
88
88
|
"homepage": "https://github.com/vizhub-core/vzcode#readme",
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@codemirror/autocomplete": "^6.16.
|
|
90
|
+
"@codemirror/autocomplete": "^6.16.2",
|
|
91
91
|
"@codemirror/lang-css": "^6.2.1",
|
|
92
92
|
"@codemirror/lang-html": "^6.4.9",
|
|
93
93
|
"@codemirror/lang-javascript": "^6.2.2",
|
|
@@ -95,23 +95,23 @@
|
|
|
95
95
|
"@codemirror/lang-markdown": "^6.2.5",
|
|
96
96
|
"@codemirror/state": "^6.4.1",
|
|
97
97
|
"@codemirror/theme-one-dark": "^6.1.2",
|
|
98
|
-
"@codemirror/view": "^6.
|
|
98
|
+
"@codemirror/view": "^6.27.0",
|
|
99
99
|
"@lezer/highlight": "^1.2.0",
|
|
100
|
-
"@replit/codemirror-indentation-markers": "^6.5.
|
|
100
|
+
"@replit/codemirror-indentation-markers": "^6.5.2",
|
|
101
101
|
"@replit/codemirror-interact": "^6.3.1",
|
|
102
102
|
"@replit/codemirror-lang-svelte": "^6.0.0",
|
|
103
103
|
"@replit/codemirror-vscode-keymap": "^6.0.2",
|
|
104
104
|
"@teamwork/websocket-json-stream": "^2.0.0",
|
|
105
|
-
"@typescript/vfs": "^1.5.
|
|
106
|
-
"@uiw/codemirror-theme-abcdef": "^4.22.
|
|
107
|
-
"@uiw/codemirror-theme-dracula": "^4.22.
|
|
108
|
-
"@uiw/codemirror-theme-eclipse": "^4.22.
|
|
109
|
-
"@uiw/codemirror-theme-github": "^4.22.
|
|
110
|
-
"@uiw/codemirror-theme-material": "^4.22.
|
|
111
|
-
"@uiw/codemirror-theme-nord": "^4.22.
|
|
112
|
-
"@uiw/codemirror-theme-okaidia": "^4.22.
|
|
113
|
-
"@uiw/codemirror-theme-xcode": "^4.22.
|
|
114
|
-
"@uiw/codemirror-themes": "^4.22.
|
|
105
|
+
"@typescript/vfs": "^1.5.2",
|
|
106
|
+
"@uiw/codemirror-theme-abcdef": "^4.22.1",
|
|
107
|
+
"@uiw/codemirror-theme-dracula": "^4.22.1",
|
|
108
|
+
"@uiw/codemirror-theme-eclipse": "^4.22.1",
|
|
109
|
+
"@uiw/codemirror-theme-github": "^4.22.1",
|
|
110
|
+
"@uiw/codemirror-theme-material": "^4.22.1",
|
|
111
|
+
"@uiw/codemirror-theme-nord": "^4.22.1",
|
|
112
|
+
"@uiw/codemirror-theme-okaidia": "^4.22.1",
|
|
113
|
+
"@uiw/codemirror-theme-xcode": "^4.22.1",
|
|
114
|
+
"@uiw/codemirror-themes": "^4.22.1",
|
|
115
115
|
"body-parser": "^1.20.2",
|
|
116
116
|
"codemirror": "^6.0.1",
|
|
117
117
|
"codemirror-ot": "^4.4.0",
|
|
@@ -124,26 +124,30 @@
|
|
|
124
124
|
"json0-ot-diff": "^1.1.2",
|
|
125
125
|
"ngrok": "^4.3.3",
|
|
126
126
|
"open": "^10.1.0",
|
|
127
|
-
"openai": "^4.
|
|
127
|
+
"openai": "^4.48.2",
|
|
128
128
|
"prettier-plugin-svelte": "^3.2.3",
|
|
129
129
|
"react": "^18.3.1",
|
|
130
130
|
"react-bootstrap": "^2.10.2",
|
|
131
131
|
"react-dom": "^18.3.1",
|
|
132
|
-
"react-router-dom": "^6.23.
|
|
133
|
-
"sharedb": "^
|
|
134
|
-
"sharedb-client-browser": "^
|
|
132
|
+
"react-router-dom": "^6.23.1",
|
|
133
|
+
"sharedb": "^5.0.1",
|
|
134
|
+
"sharedb-client-browser": "^5.0.1",
|
|
135
135
|
"vizhub-ui": "^3.23.0",
|
|
136
136
|
"ws": "^8.17.0"
|
|
137
137
|
},
|
|
138
138
|
"devDependencies": {
|
|
139
|
-
"@types/react": "^18.3.
|
|
139
|
+
"@types/react": "^18.3.3",
|
|
140
140
|
"@types/react-dom": "^18.3.0",
|
|
141
|
-
"@vitejs/plugin-react": "^4.
|
|
141
|
+
"@vitejs/plugin-react": "^4.3.0",
|
|
142
142
|
"concurrently": "^8.2.2",
|
|
143
|
-
"prettier": "^3.
|
|
144
|
-
"sass": "^1.
|
|
143
|
+
"prettier": "^3.3.1",
|
|
144
|
+
"sass": "^1.77.4",
|
|
145
145
|
"typescript": "^5.4.5",
|
|
146
|
-
"vite": "^5.2.
|
|
147
|
-
"vitest": "^1.
|
|
146
|
+
"vite": "^5.2.12",
|
|
147
|
+
"vitest": "^1.6.0"
|
|
148
|
+
},
|
|
149
|
+
"optionalDependencies": {
|
|
150
|
+
"@rollup/rollup-win32-x64-msvc": "^4.18.0",
|
|
151
|
+
"@rollup/rollup-darwin-arm64": "^4.18.0"
|
|
148
152
|
}
|
|
149
153
|
}
|
|
@@ -111,12 +111,17 @@ export const CodeEditor = ({
|
|
|
111
111
|
if (!ref.current) return;
|
|
112
112
|
if (!content) return;
|
|
113
113
|
|
|
114
|
-
// Add the editor to the DOM.
|
|
114
|
+
// Add the editor and apply the prior scroll position to the DOM.
|
|
115
115
|
ref.current.appendChild(editorCacheValue.editor.dom);
|
|
116
|
+
editorCacheValue.editor.scrollDOM.scrollTo({
|
|
117
|
+
top: editorCacheValue.scrollPosition ?? 0,
|
|
118
|
+
});
|
|
116
119
|
|
|
117
120
|
return () => {
|
|
118
|
-
// Remove the old editor from the DOM.
|
|
121
|
+
// Remove the old editor from the DOM and store the current scroll position.
|
|
119
122
|
// This happens every time `activeFileId` changes.
|
|
123
|
+
editorCacheValue.scrollPosition =
|
|
124
|
+
editorCacheValue.editor.scrollDOM.scrollTop;
|
|
120
125
|
ref.current.removeChild(editorCacheValue.editor.dom);
|
|
121
126
|
};
|
|
122
127
|
}, [shareDBDoc, editorCacheValue]);
|
|
@@ -56,7 +56,9 @@ export const json1PresenceDisplay = ({
|
|
|
56
56
|
const { start, end } = presence;
|
|
57
57
|
const from = start[start.length - 1];
|
|
58
58
|
const to = end[end.length - 1];
|
|
59
|
-
const userColor = new ColorHash(
|
|
59
|
+
const userColor = new ColorHash({
|
|
60
|
+
lightness: 0.75,
|
|
61
|
+
}).rgb(id);
|
|
60
62
|
const { username } = presence;
|
|
61
63
|
|
|
62
64
|
presenceDecorations.push({
|
package/src/server/index.js
CHANGED
|
@@ -310,9 +310,9 @@ server.listen(port, async () => {
|
|
|
310
310
|
open(url);
|
|
311
311
|
})();
|
|
312
312
|
} else {
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
313
|
+
console.log(
|
|
314
|
+
`Editor is live at http://localhost:${port}`,
|
|
315
|
+
);
|
|
316
|
+
open(`http://localhost:${port}`);
|
|
317
317
|
}
|
|
318
318
|
});
|