vzcode 0.56.0 → 0.57.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 +3 -1
- package/dist/assets/{index-pF--hgc_.js → index-C_w_ZF1t.js} +48 -48
- package/dist/assets/{index-mTosxc8C.css → index-lCpRU622.css} +1 -1
- package/dist/index.html +2 -2
- package/package.json +7 -6
- package/src/client/AIAssist/AIAssistWidget/style.scss +1 -1
- package/src/client/Icons/Close.tsx +18 -16
- package/src/client/Icons/Edit.tsx +18 -15
- package/src/client/Icons/Gear.tsx +24 -15
- package/src/client/Icons/New.tsx +17 -15
- package/src/client/Icons/Trash.tsx +18 -16
- package/src/client/Icons/index.tsx +2 -1
- package/src/client/TabList/style.scss +1 -1
- package/src/client/VZSidebar/Item.tsx +12 -13
- package/src/client/VZSidebar/index.tsx +14 -0
- package/src/client/VZSidebar/styles.scss +37 -8
- package/src/server/index.js +4 -4
package/dist/index.html
CHANGED
|
@@ -24,8 +24,8 @@
|
|
|
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" crossorigin href="/assets/index-
|
|
27
|
+
<script type="module" crossorigin src="/assets/index-C_w_ZF1t.js"></script>
|
|
28
|
+
<link rel="stylesheet" crossorigin href="/assets/index-lCpRU622.css">
|
|
29
29
|
</head>
|
|
30
30
|
<body>
|
|
31
31
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vzcode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.57.0",
|
|
4
4
|
"description": "Multiplayer code editor system",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
13
13
|
"test": "vitest run",
|
|
14
|
-
"test-interactive": "
|
|
14
|
+
"test-interactive": "cd test/sampleDirectories/kitchenSink && node ../../../src/server/index.js",
|
|
15
15
|
"prettier": "prettier {*.*,**/*.*} --write",
|
|
16
16
|
"tsc": "tsc --noEmit",
|
|
17
|
-
"dev": "vite",
|
|
17
|
+
"dev": "concurrently \"npm run test-interactive\" \"vite\"",
|
|
18
18
|
"build": "vite build",
|
|
19
19
|
"build-release": "vite build --mode release",
|
|
20
20
|
"preview": "vite preview",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"diff-match-patch": "^1.0.5",
|
|
97
97
|
"dotenv": "^16.4.1",
|
|
98
98
|
"express": "^4.18.2",
|
|
99
|
-
"ignore": "^5.3.
|
|
99
|
+
"ignore": "^5.3.1",
|
|
100
100
|
"json0-ot-diff": "^1.1.2",
|
|
101
101
|
"ngrok": "^4.3.3",
|
|
102
102
|
"open": "^10.0.3",
|
|
@@ -105,16 +105,17 @@
|
|
|
105
105
|
"react": "^18.2.0",
|
|
106
106
|
"react-bootstrap": "^2.10.0",
|
|
107
107
|
"react-dom": "^18.2.0",
|
|
108
|
-
"react-router-dom": "^6.
|
|
108
|
+
"react-router-dom": "^6.22.0",
|
|
109
109
|
"sharedb": "^4.1.2",
|
|
110
110
|
"sharedb-client-browser": "^4.4.0",
|
|
111
111
|
"vizhub-ui": "^3.18.0",
|
|
112
112
|
"ws": "^8.16.0"
|
|
113
113
|
},
|
|
114
114
|
"devDependencies": {
|
|
115
|
-
"@types/react": "^18.2.
|
|
115
|
+
"@types/react": "^18.2.52",
|
|
116
116
|
"@types/react-dom": "^18.2.18",
|
|
117
117
|
"@vitejs/plugin-react": "^4.2.1",
|
|
118
|
+
"concurrently": "^8.2.2",
|
|
118
119
|
"prettier": "^3.2.4",
|
|
119
120
|
"sass": "^1.70.0",
|
|
120
121
|
"typescript": "^5.3.3",
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
export const Close = () => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
return (
|
|
3
|
+
<svg
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
width="24"
|
|
6
|
+
height="24"
|
|
7
|
+
viewBox="0 0 24 24"
|
|
8
|
+
fill="none"
|
|
9
|
+
>
|
|
10
|
+
<path
|
|
11
|
+
d="M6 18L18 6M6 6L18 18"
|
|
12
|
+
stroke="#576786"
|
|
13
|
+
strokeWidth="1.5"
|
|
14
|
+
strokeLinecap="round"
|
|
15
|
+
strokeLinejoin="round"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
export const Edit = () => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
return (
|
|
3
|
+
<svg
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
width="24"
|
|
6
|
+
height="24"
|
|
7
|
+
viewBox="0 0 24 24"
|
|
8
|
+
>
|
|
9
|
+
<path
|
|
10
|
+
fill="none"
|
|
11
|
+
stroke="currentColor"
|
|
12
|
+
strokeLinecap="round"
|
|
13
|
+
strokeLinejoin="round"
|
|
14
|
+
strokeWidth="1.5"
|
|
15
|
+
d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
export const Gear = () => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
return (
|
|
3
|
+
<svg
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
width="24"
|
|
6
|
+
height="24"
|
|
7
|
+
fill="none"
|
|
8
|
+
>
|
|
9
|
+
<path
|
|
10
|
+
stroke="#E0E8FF"
|
|
11
|
+
strokeLinecap="round"
|
|
12
|
+
strokeLinejoin="round"
|
|
13
|
+
strokeWidth="1.5"
|
|
14
|
+
d="M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 0 1 0 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 0 1 0-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281Z"
|
|
15
|
+
/>
|
|
16
|
+
<path
|
|
17
|
+
stroke="#E0E8FF"
|
|
18
|
+
strokeLinecap="round"
|
|
19
|
+
strokeLinejoin="round"
|
|
20
|
+
strokeWidth="1.5"
|
|
21
|
+
d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"
|
|
22
|
+
/>
|
|
23
|
+
</svg>
|
|
24
|
+
);
|
|
25
|
+
};
|
package/src/client/Icons/New.tsx
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
export const New = () => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
return (
|
|
3
|
+
<svg
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
width="24"
|
|
6
|
+
height="24"
|
|
7
|
+
fill="none"
|
|
8
|
+
>
|
|
9
|
+
<path
|
|
10
|
+
stroke="#E0E8FF"
|
|
11
|
+
strokeLinecap="round"
|
|
12
|
+
strokeLinejoin="round"
|
|
13
|
+
strokeWidth="1.5"
|
|
14
|
+
d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m3.75 9v6m3-3H9m1.5-12H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"
|
|
15
|
+
/>
|
|
16
|
+
</svg>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
export const Trash = () => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
return (
|
|
3
|
+
<svg
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
width="24"
|
|
6
|
+
height="24"
|
|
7
|
+
viewBox="0 0 24 24"
|
|
8
|
+
>
|
|
9
|
+
<path
|
|
10
|
+
fill="none"
|
|
11
|
+
stroke="currentColor"
|
|
12
|
+
d="M14.7404 9L14.3942 18M9.60577 18L9.25962 9M19.2276 5.79057C19.5696 5.84221 19.9104 5.89747 20.25 5.95629M19.2276 5.79057L18.1598 19.6726C18.0696 20.8448 17.0921 21.75 15.9164 21.75H8.08357C6.90786 21.75 5.93037 20.8448 5.8402 19.6726L4.77235 5.79057M19.2276 5.79057C18.0812 5.61744 16.9215 5.48485 15.75 5.39432M3.75 5.95629C4.08957 5.89747 4.43037 5.84221 4.77235 5.79057M4.77235 5.79057C5.91878 5.61744 7.07849 5.48485 8.25 5.39432M15.75 5.39432V4.47819C15.75 3.29882 14.8393 2.31423 13.6606 2.27652C13.1092 2.25889 12.5556 2.25 12 2.25C11.4444 2.25 10.8908 2.25889 10.3394 2.27652C9.16065 2.31423 8.25 3.29882 8.25 4.47819V5.39432M15.75 5.39432C14.5126 5.2987 13.262 5.25 12 5.25C10.738 5.25 9.48744 5.2987 8.25 5.39432"
|
|
13
|
+
strokeWidth="1.5"
|
|
14
|
+
strokeLinecap="round"
|
|
15
|
+
strokeLinejoin="round"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
useRef,
|
|
5
5
|
useEffect,
|
|
6
6
|
} from 'react';
|
|
7
|
+
import { Edit, Trash } from '../Icons';
|
|
7
8
|
|
|
8
9
|
// TODO consider moving this up to a higher level of the component tree
|
|
9
10
|
import { DeleteConfirmationModal } from './DeleteConfirmationModal';
|
|
@@ -125,7 +126,7 @@ export const Item = ({
|
|
|
125
126
|
|
|
126
127
|
return (
|
|
127
128
|
<div
|
|
128
|
-
className={`
|
|
129
|
+
className={`file-or-directory user-select-none ${
|
|
129
130
|
isActive ? 'active-file' : ''
|
|
130
131
|
}`}
|
|
131
132
|
onClick={isRenaming ? null : handleClick}
|
|
@@ -153,20 +154,18 @@ export const Item = ({
|
|
|
153
154
|
)}
|
|
154
155
|
</div>
|
|
155
156
|
{isHovered && !isRenaming ? (
|
|
156
|
-
<div
|
|
157
|
+
<div
|
|
158
|
+
className="utils"
|
|
159
|
+
style={{ position: 'relative' }}
|
|
160
|
+
>
|
|
157
161
|
{(isDirectory ? enableRenameDirectory : true) ? (
|
|
158
|
-
<i
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
onClick={handleRenameIconClick}
|
|
162
|
-
></i>
|
|
162
|
+
<i onClick={handleRenameIconClick}>
|
|
163
|
+
<Edit />
|
|
164
|
+
</i>
|
|
163
165
|
) : null}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
style={{ color: '#ff006b' }}
|
|
168
|
-
onClick={handleModalOpen}
|
|
169
|
-
></i>
|
|
166
|
+
<i onClick={handleModalOpen}>
|
|
167
|
+
<Trash />
|
|
168
|
+
</i>
|
|
170
169
|
</div>
|
|
171
170
|
) : null}
|
|
172
171
|
|
|
@@ -20,6 +20,11 @@ import { Listing } from './Listing';
|
|
|
20
20
|
import { CreateFileModal } from './CreateFileModal';
|
|
21
21
|
import './styles.scss';
|
|
22
22
|
|
|
23
|
+
// TODO turn this UI back on when we are actually detecting
|
|
24
|
+
// the connection status.
|
|
25
|
+
// See https://github.com/vizhub-core/vzcode/issues/456
|
|
26
|
+
const enableConnectionStatus = false;
|
|
27
|
+
|
|
23
28
|
const CreateFileButton = ({ handleCreateFile }) => {
|
|
24
29
|
return (
|
|
25
30
|
<i
|
|
@@ -197,6 +202,15 @@ export const VZSidebar = ({
|
|
|
197
202
|
Editor Settings
|
|
198
203
|
</div>
|
|
199
204
|
)}
|
|
205
|
+
{enableConnectionStatus && (
|
|
206
|
+
<div className="connection-status">
|
|
207
|
+
Connection Status
|
|
208
|
+
<div className="connection">
|
|
209
|
+
Saved
|
|
210
|
+
<div className="saved" />
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
)}
|
|
200
214
|
<CreateFileModal
|
|
201
215
|
show={isModalOpen}
|
|
202
216
|
onClose={handleCloseModal}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
.vz-sidebar {
|
|
2
2
|
height: 100%;
|
|
3
3
|
color: #d6d9de;
|
|
4
|
-
background: #
|
|
4
|
+
background: #1f2022;
|
|
5
5
|
display: flex;
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
justify-content: space-between;
|
|
8
8
|
|
|
9
9
|
.full-box {
|
|
10
|
-
padding:
|
|
10
|
+
padding: 4px;
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: row;
|
|
13
13
|
align-items: center;
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
justify-content: space-between;
|
|
29
29
|
cursor: pointer;
|
|
30
30
|
margin: 0 10px;
|
|
31
|
+
padding: 0 2px 0 8px;
|
|
31
32
|
border-radius: 4px;
|
|
32
33
|
font-family: var(--vzcode-font-family);
|
|
33
34
|
font-weight: 500;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
.sidebar-section-hint {
|
|
37
|
-
// margin-top: 30px;
|
|
38
38
|
margin-left: 10px;
|
|
39
39
|
font-size: 12px;
|
|
40
40
|
color: #99a0ad;
|
|
@@ -48,10 +48,19 @@
|
|
|
48
48
|
|
|
49
49
|
.utils {
|
|
50
50
|
display: flex;
|
|
51
|
-
gap:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
gap: 2px;
|
|
52
|
+
|
|
53
|
+
i {
|
|
54
|
+
padding: 2px;
|
|
55
|
+
border-radius: 4px;
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
justify-content: center;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
i:hover {
|
|
62
|
+
background-color: rgba(255, 255, 255, 0.2);
|
|
63
|
+
}
|
|
55
64
|
}
|
|
56
65
|
|
|
57
66
|
.file-or-directory:hover,
|
|
@@ -61,7 +70,7 @@
|
|
|
61
70
|
|
|
62
71
|
.active-file,
|
|
63
72
|
.active-file:hover {
|
|
64
|
-
background-color: #
|
|
73
|
+
background-color: #264399;
|
|
65
74
|
}
|
|
66
75
|
|
|
67
76
|
.name {
|
|
@@ -69,6 +78,7 @@
|
|
|
69
78
|
text-overflow: ellipsis;
|
|
70
79
|
white-space: nowrap;
|
|
71
80
|
overflow: hidden;
|
|
81
|
+
padding: 4px 0;
|
|
72
82
|
}
|
|
73
83
|
|
|
74
84
|
.indentation {
|
|
@@ -107,4 +117,23 @@
|
|
|
107
117
|
margin-bottom: 10px;
|
|
108
118
|
font-size: 14px;
|
|
109
119
|
}
|
|
120
|
+
|
|
121
|
+
.connection-status {
|
|
122
|
+
display: flex;
|
|
123
|
+
justify-content: space-between;
|
|
124
|
+
padding: 10px;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.connection {
|
|
128
|
+
display: flex;
|
|
129
|
+
gap: 6px;
|
|
130
|
+
align-items: center;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.saved {
|
|
134
|
+
width: 16px;
|
|
135
|
+
height: 16px;
|
|
136
|
+
border-radius: 99px;
|
|
137
|
+
background-color: #34eb52;
|
|
138
|
+
}
|
|
110
139
|
}
|
package/src/server/index.js
CHANGED
|
@@ -272,9 +272,9 @@ server.listen(port, async () => {
|
|
|
272
272
|
open(url);
|
|
273
273
|
})();
|
|
274
274
|
} else {
|
|
275
|
-
console.log(
|
|
276
|
-
|
|
277
|
-
);
|
|
278
|
-
open(`http://localhost:${port}`);
|
|
275
|
+
// console.log(
|
|
276
|
+
// `Editor is live at http://localhost:${port}`,
|
|
277
|
+
// );
|
|
278
|
+
// open(`http://localhost:${port}`);
|
|
279
279
|
}
|
|
280
280
|
});
|