vzcode 0.83.0 → 0.84.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/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-CnHJy69d.js"></script>
23
+ <script type="module" crossorigin src="/assets/index-9InCi-kT.js"></script>
24
24
  <link rel="stylesheet" crossorigin href="/assets/index-J8-kRnnE.css">
25
25
  </head>
26
26
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vzcode",
3
- "version": "0.83.0",
3
+ "version": "0.84.0",
4
4
  "description": "Multiplayer code editor system",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
@@ -55,6 +55,10 @@
55
55
  {
56
56
  "name": "Evan Whymark",
57
57
  "url": "https://github.com/EvWhymark"
58
+ },
59
+ {
60
+ "name": "Ethan Nuessle",
61
+ "url": "https://github.com/enuessle"
58
62
  }
59
63
  ],
60
64
  "license": "MIT",
@@ -71,7 +75,7 @@
71
75
  "@codemirror/lang-markdown": "^6.2.4",
72
76
  "@codemirror/state": "^6.4.1",
73
77
  "@codemirror/theme-one-dark": "^6.1.2",
74
- "@codemirror/view": "^6.26.0",
78
+ "@codemirror/view": "^6.26.1",
75
79
  "@lezer/highlight": "^1.2.0",
76
80
  "@replit/codemirror-indentation-markers": "^6.5.1",
77
81
  "@replit/codemirror-interact": "^6.3.1",
@@ -100,26 +104,26 @@
100
104
  "json0-ot-diff": "^1.1.2",
101
105
  "ngrok": "^4.3.3",
102
106
  "open": "^10.1.0",
103
- "openai": "^4.29.2",
107
+ "openai": "^4.31.0",
104
108
  "prettier-plugin-svelte": "^3.2.2",
105
109
  "react": "^18.2.0",
106
110
  "react-bootstrap": "^2.10.2",
107
111
  "react-dom": "^18.2.0",
108
112
  "react-router-dom": "^6.22.3",
109
- "sharedb": "^4.1.2",
113
+ "sharedb": "^4.1.3",
110
114
  "sharedb-client-browser": "^4.4.0",
111
115
  "vizhub-ui": "^3.21.0",
112
116
  "ws": "^8.16.0"
113
117
  },
114
118
  "devDependencies": {
115
- "@types/react": "^18.2.72",
116
- "@types/react-dom": "^18.2.22",
119
+ "@types/react": "^18.2.73",
120
+ "@types/react-dom": "^18.2.23",
117
121
  "@vitejs/plugin-react": "^4.2.1",
118
122
  "concurrently": "^8.2.2",
119
123
  "prettier": "^3.2.5",
120
124
  "sass": "^1.72.0",
121
125
  "typescript": "^5.4.3",
122
- "vite": "^5.2.6",
126
+ "vite": "^5.2.7",
123
127
  "vitest": "^1.4.0"
124
128
  }
125
129
  }
@@ -49,6 +49,7 @@ export const CreateFileModal = ({
49
49
  (e) => {
50
50
  if (
51
51
  e.key === 'Enter' &&
52
+ validateFileName(newName) &&
52
53
  (e.ctrlKey ||
53
54
  e.shiftKey ||
54
55
  (!e.altKey && !e.metaKey))
@@ -56,7 +57,7 @@ export const CreateFileModal = ({
56
57
  onCreateClick();
57
58
  }
58
59
  },
59
- [onCreateClick],
60
+ [onCreateClick, validateFileName, newName],
60
61
  );
61
62
 
62
63
  return isCreateFileModalOpen ? (
@@ -29,6 +29,7 @@ import {
29
29
  GOLDENROD,
30
30
  PANIC,
31
31
  } from './colors';
32
+ import { EditorView } from 'codemirror';
32
33
 
33
34
  // Use semi-bold weight for keywords and other important things
34
35
  // const boldWeight = 'bold';
@@ -57,116 +58,142 @@ function vizhubThemeInit(
57
58
  settings = {},
58
59
  styles = [],
59
60
  } = options || {};
60
- return createTheme({
61
- theme: theme,
62
- settings: {
63
- ...defaultSettingsVizhubTheme,
64
- ...settings,
65
- },
66
- styles: [
67
- {
68
- tag: [
69
- t.keyword,
70
- t.operatorKeyword,
71
- t.modifier,
72
- t.color,
73
- t.constant(t.name),
74
- t.standard(t.name),
75
- t.standard(t.tagName),
76
- t.special(t.brace),
77
- t.atom,
78
- t.bool,
79
- t.special(t.variableName),
80
- ],
81
- color: MINT,
82
- },
83
- {
84
- tag: [t.controlKeyword, t.moduleKeyword],
85
- color: MINT,
61
+ return [
62
+ createTheme({
63
+ theme: theme,
64
+ settings: {
65
+ ...defaultSettingsVizhubTheme,
66
+ ...settings,
86
67
  },
87
- {
88
- tag: [
89
- t.name,
90
- t.deleted,
91
- t.character,
92
- t.macroName,
68
+ styles: [
69
+ {
70
+ tag: [
71
+ t.keyword,
72
+ t.operatorKeyword,
73
+ t.modifier,
74
+ t.color,
75
+ t.constant(t.name),
76
+ t.standard(t.name),
77
+ t.standard(t.tagName),
78
+ t.special(t.brace),
79
+ t.atom,
80
+ t.bool,
81
+ t.special(t.variableName),
82
+ ],
83
+ color: MINT,
84
+ },
85
+ {
86
+ tag: [t.controlKeyword, t.moduleKeyword],
87
+ color: MINT,
88
+ },
89
+ {
90
+ tag: [
91
+ t.name,
92
+ t.deleted,
93
+ t.character,
94
+ t.macroName,
93
95
 
94
- t.variableName,
95
- t.labelName,
96
- t.definition(t.name),
97
- ],
98
- color: AQUA,
99
- },
100
- {
101
- tag: [t.propertyName],
102
- color: GOLDENROD,
103
- },
104
- {
105
- tag: t.heading,
106
- fontWeight: boldWeight,
107
- color: SKY,
108
- },
109
- {
110
- tag: [
111
- t.typeName,
112
- t.className,
113
- t.tagName,
114
- t.number,
115
- t.changed,
116
- t.annotation,
117
- t.self,
118
- t.namespace,
119
- ],
120
- color: AQUA,
121
- },
122
- {
123
- tag: [
124
- t.function(t.variableName),
125
- t.function(t.propertyName),
126
- ],
127
- color: AQUA,
128
- },
129
- { tag: [t.number], color: SALMON },
130
- {
131
- tag: [
132
- t.operator,
133
- t.punctuation,
134
- t.separator,
135
- t.url,
136
- t.escape,
137
- t.regexp,
138
- ],
139
- color: light,
140
- },
141
- {
142
- tag: [t.regexp],
143
- color: LAVENDER,
144
- },
145
- {
146
- tag: [t.special(t.string), t.string, t.inserted],
147
- color: LAVENDER,
148
- },
149
- {
150
- tag: [t.processingInstruction],
151
- color: AQUA,
152
- },
153
- { tag: [t.angleBracket], color: AQUA },
154
- { tag: t.strong, fontWeight: boldWeight },
155
- { tag: t.emphasis, fontStyle: 'italic' },
156
- {
157
- tag: t.strikethrough,
158
- textDecoration: 'line-through',
159
- },
160
- { tag: [t.meta, t.comment], color: dark },
96
+ t.variableName,
97
+ t.labelName,
98
+ t.definition(t.name),
99
+ ],
100
+ color: AQUA,
101
+ },
102
+ {
103
+ tag: [t.propertyName],
104
+ color: GOLDENROD,
105
+ },
106
+ {
107
+ tag: t.heading,
108
+ fontWeight: boldWeight,
109
+ color: SKY,
110
+ },
111
+ {
112
+ tag: [
113
+ t.typeName,
114
+ t.className,
115
+ t.tagName,
116
+ t.number,
117
+ t.changed,
118
+ t.annotation,
119
+ t.self,
120
+ t.namespace,
121
+ ],
122
+ color: AQUA,
123
+ },
124
+ {
125
+ tag: [
126
+ t.function(t.variableName),
127
+ t.function(t.propertyName),
128
+ ],
129
+ color: AQUA,
130
+ },
131
+ { tag: [t.number], color: SALMON },
132
+ {
133
+ tag: [
134
+ t.operator,
135
+ t.punctuation,
136
+ t.separator,
137
+ t.url,
138
+ t.escape,
139
+ t.regexp,
140
+ ],
141
+ color: light,
142
+ },
143
+ {
144
+ tag: [t.regexp],
145
+ color: LAVENDER,
146
+ },
147
+ {
148
+ tag: [t.special(t.string), t.string, t.inserted],
149
+ color: LAVENDER,
150
+ },
151
+ {
152
+ tag: [t.processingInstruction],
153
+ color: AQUA,
154
+ },
155
+ { tag: [t.angleBracket], color: AQUA },
156
+ { tag: t.strong, fontWeight: boldWeight },
157
+ { tag: t.emphasis, fontStyle: 'italic' },
158
+ {
159
+ tag: t.strikethrough,
160
+ textDecoration: 'line-through',
161
+ },
162
+ { tag: [t.meta, t.comment], color: dark },
163
+ {
164
+ tag: t.link,
165
+ color: GOLDENROD,
166
+ textDecoration: 'underline',
167
+ },
168
+ { tag: t.invalid, color: PANIC },
169
+ // {
170
+ // class: 'cm-nonmatchingBracket',
171
+ // // color: "rede",
172
+ // backgroundColor: 'red', // Optional: set background color for matching brackets
173
+ // },
174
+ // {
175
+ // tag: t.nonmatchingBracket,
176
+ // color: nonMatchingBracketColor,
177
+ // backgroundColor: 'transparent', // Optional: set background color for non-matching brackets
178
+ // },
179
+ ...styles,
180
+ ],
181
+ }),
182
+ // Theme matching and non-matching brackets.
183
+ EditorView.theme(
161
184
  {
162
- tag: t.link,
163
- color: GOLDENROD,
164
- textDecoration: 'underline',
185
+ '&.cm-focused .cm-matchingBracket': {
186
+ backgroundColor: 'transparent',
187
+ outline: '1px solid #888888',
188
+ },
189
+ '&.cm-focused .cm-nonmatchingBracket': {
190
+ backgroundColor: 'transparent',
191
+ outline: '1px solid #ff2222',
192
+ },
165
193
  },
166
- { tag: t.invalid, color: PANIC },
167
- ...styles,
168
- ],
169
- });
194
+ { dark: true },
195
+ ),
196
+ ];
170
197
  }
171
198
 
172
199
  export const vizhubTheme = vizhubThemeInit();
@@ -60,8 +60,8 @@ export const useURLSync = ({
60
60
  isInitialized.current = true;
61
61
 
62
62
  // Update the state.
63
- setActiveFileId(activeFileId);
64
63
  tabList.forEach(openTab);
64
+ setActiveFileId(activeFileId);
65
65
  }, [
66
66
  content,
67
67
  searchParams,