vzcode 0.30.0 → 0.32.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-c3a6c525.js → index-4jXg5R0X.js} +54 -54
- package/dist/assets/worker-SEtSh7_R.js +366 -0
- package/dist/assets/worker-hNl6wfTa.js +237 -0
- package/dist/index.html +2 -3
- package/package.json +6 -6
- package/src/client/VZSidebar/DeleteConfirmationModal.tsx +42 -31
- package/src/client/VZSidebar/Item.tsx +5 -2
- package/src/client/useTypeScript/worker.ts +1 -1
- package/src/server/handleAIAssist.js +3 -1
- package/dist/assets/worker-b775ddff.js +0 -237
- package/dist/assets/worker-ed0e2778.js +0 -366
- /package/dist/assets/{index-836bdce7.css → index-esdlTXtH.css} +0 -0
package/dist/index.html
CHANGED
|
@@ -24,11 +24,10 @@
|
|
|
24
24
|
href="https://unpkg.com/boxicons@2.0.7/css/boxicons.min.css"
|
|
25
25
|
rel="stylesheet"
|
|
26
26
|
/>
|
|
27
|
-
<script type="module" crossorigin src="/assets/index-
|
|
28
|
-
<link rel="stylesheet" href="/assets/index-
|
|
27
|
+
<script type="module" crossorigin src="/assets/index-4jXg5R0X.js"></script>
|
|
28
|
+
<link rel="stylesheet" crossorigin href="/assets/index-esdlTXtH.css">
|
|
29
29
|
</head>
|
|
30
30
|
<body>
|
|
31
31
|
<div id="root"></div>
|
|
32
|
-
|
|
33
32
|
</body>
|
|
34
33
|
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vzcode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"description": "Multiplayer code editor system",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@codemirror/state": "^6.3.1",
|
|
55
55
|
"@codemirror/theme-one-dark": "^6.1.2",
|
|
56
56
|
"@codemirror/view": "^6.22.0",
|
|
57
|
-
"@lezer/highlight": "^1.
|
|
57
|
+
"@lezer/highlight": "^1.2.0",
|
|
58
58
|
"@replit/codemirror-interact": "^6.3.0",
|
|
59
59
|
"@teamwork/websocket-json-stream": "^2.0.0",
|
|
60
60
|
"@typescript/vfs": "^1.5.0",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"json0-ot-diff": "^1.1.2",
|
|
79
79
|
"ngrok": "^4.3.3",
|
|
80
80
|
"open": "^9.1.0",
|
|
81
|
-
"openai": "^4.
|
|
81
|
+
"openai": "^4.19.0",
|
|
82
82
|
"ot-json1": "^1.0.2",
|
|
83
83
|
"react": "^18.2.0",
|
|
84
84
|
"react-bootstrap": "^2.9.1",
|
|
@@ -91,11 +91,11 @@
|
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@types/react": "^18.2.37",
|
|
93
93
|
"@types/react-dom": "^18.2.15",
|
|
94
|
-
"@vitejs/plugin-react": "^4.
|
|
95
|
-
"prettier": "^3.0
|
|
94
|
+
"@vitejs/plugin-react": "^4.2.0",
|
|
95
|
+
"prettier": "^3.1.0",
|
|
96
96
|
"sass": "^1.69.5",
|
|
97
97
|
"typescript": "^5.2.2",
|
|
98
|
-
"vite": "^
|
|
98
|
+
"vite": "^5.0.0",
|
|
99
99
|
"vitest": "^0.34.6"
|
|
100
100
|
}
|
|
101
101
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Button, Modal } from '../bootstrap';
|
|
2
|
-
import { useCallback } from 'react';
|
|
2
|
+
import { useCallback, useEffect } from 'react';
|
|
3
3
|
|
|
4
4
|
// Confirmation modal for deleting a file or directory.
|
|
5
5
|
// Inspired by https://react-bootstrap.netlify.app/docs/components/modal/#live-demo
|
|
@@ -11,44 +11,55 @@ export const DeleteConfirmationModal = ({
|
|
|
11
11
|
isDirectory,
|
|
12
12
|
name,
|
|
13
13
|
}) => {
|
|
14
|
-
const
|
|
15
|
-
(event) => {
|
|
16
|
-
event.
|
|
17
|
-
|
|
14
|
+
const handleEnterKey = useCallback(
|
|
15
|
+
(event: KeyboardEvent) => {
|
|
16
|
+
if (event.key === 'Enter') {
|
|
17
|
+
onConfirm();
|
|
18
|
+
}
|
|
18
19
|
},
|
|
19
20
|
[onConfirm],
|
|
20
21
|
);
|
|
21
22
|
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (show) {
|
|
25
|
+
window.addEventListener('keydown', handleEnterKey);
|
|
26
|
+
} else {
|
|
27
|
+
window.removeEventListener('keydown', handleEnterKey);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return () => {
|
|
31
|
+
window.removeEventListener('keydown', handleEnterKey);
|
|
32
|
+
};
|
|
33
|
+
}, [show, handleEnterKey]);
|
|
34
|
+
|
|
22
35
|
return (
|
|
23
36
|
<Modal show={show} onHide={onClose} centered>
|
|
24
|
-
<
|
|
25
|
-
<Modal.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
</Modal.Header>
|
|
37
|
+
<Modal.Header closeButton onClick={onClose}>
|
|
38
|
+
<Modal.Title>
|
|
39
|
+
Delete {isDirectory ? 'Directory' : 'File'}
|
|
40
|
+
</Modal.Title>
|
|
41
|
+
</Modal.Header>
|
|
30
42
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
43
|
+
<Modal.Body>
|
|
44
|
+
<p>
|
|
45
|
+
This will delete the{' '}
|
|
46
|
+
{isDirectory ? 'directory' : 'file'}{' '}
|
|
47
|
+
<strong>{name}</strong>.
|
|
48
|
+
</p>
|
|
49
|
+
</Modal.Body>
|
|
38
50
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
</form>
|
|
51
|
+
<Modal.Footer>
|
|
52
|
+
<Button
|
|
53
|
+
variant="secondary"
|
|
54
|
+
type="button"
|
|
55
|
+
onClick={onClose}
|
|
56
|
+
>
|
|
57
|
+
Cancel
|
|
58
|
+
</Button>
|
|
59
|
+
<Button variant="primary" onClick={onConfirm}>
|
|
60
|
+
Delete
|
|
61
|
+
</Button>
|
|
62
|
+
</Modal.Footer>
|
|
52
63
|
</Modal>
|
|
53
64
|
);
|
|
54
65
|
};
|
|
@@ -100,8 +100,11 @@ export const Item = ({
|
|
|
100
100
|
|
|
101
101
|
// Function to handle confirmation on modal
|
|
102
102
|
const handleConfirmModal = useCallback(
|
|
103
|
-
(event: React.MouseEvent) => {
|
|
104
|
-
|
|
103
|
+
(event: React.MouseEvent | undefined) => {
|
|
104
|
+
// TODO clean this up.
|
|
105
|
+
// This was added to prevent parent listeners from firing
|
|
106
|
+
// when the modal is confirmed.
|
|
107
|
+
event?.stopPropagation();
|
|
105
108
|
setShowModal(false);
|
|
106
109
|
handleDeleteClick();
|
|
107
110
|
},
|
|
@@ -195,7 +195,7 @@ onmessage = async ({ data }) => {
|
|
|
195
195
|
linterRequest;
|
|
196
196
|
|
|
197
197
|
const tsFileName = getTSFileName(fileName);
|
|
198
|
-
let tsErrors =
|
|
198
|
+
let tsErrors = [];
|
|
199
199
|
// Since we are also updating the server when we autocomplete we do not need to update
|
|
200
200
|
if (isTS(tsFileName)) {
|
|
201
201
|
setFile(tsFileName, fileContent);
|