vzcode 1.9.0 → 1.11.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-BRLn2sA_.js → index-BSuijdti.js} +56 -56
- package/dist/index.html +1 -1
- package/package.json +7 -7
- package/src/client/CodeEditor/getOrCreateEditor.ts +50 -13
- package/src/client/CodeEditor/index.tsx +2 -0
- package/src/client/CodeEditor/json1PresenceDisplay.ts +128 -90
- package/src/client/Icons/index.tsx +0 -1
- package/src/client/VZCodeContext.tsx +3 -7
- package/src/client/VZSidebar/FileListing.tsx +38 -4
- package/src/client/VZSidebar/Item.tsx +2 -1
- package/src/client/VZSidebar/Search.tsx +4 -40
- package/src/types.ts +7 -70
- package/src/client/Icons/SearchFileSVG.tsx +0 -19
package/src/types.ts
CHANGED
|
@@ -115,57 +115,6 @@ export type ShareDBDoc<T> = {
|
|
|
115
115
|
// Generated by the client.
|
|
116
116
|
export type AIStreamId = string;
|
|
117
117
|
|
|
118
|
-
// // TODO define this interface.
|
|
119
|
-
// export type AIStreamStatus = {
|
|
120
|
-
// // This field is managed by the client.
|
|
121
|
-
// // * `true` if the client wants the server to start the generation.
|
|
122
|
-
// // * `false` if the client does not want the server to start the generation.
|
|
123
|
-
// clientWantsToStart: boolean;
|
|
124
|
-
|
|
125
|
-
// // This field is managed by the server.
|
|
126
|
-
// // * `true` if the server is running the generation.
|
|
127
|
-
// // * `false` if the server is not running the generation.
|
|
128
|
-
// serverIsRunning: boolean;
|
|
129
|
-
|
|
130
|
-
// text: string;
|
|
131
|
-
|
|
132
|
-
// startingInsertionCursor: number;
|
|
133
|
-
// fileId: FileId;
|
|
134
|
-
// };
|
|
135
|
-
|
|
136
|
-
/// Alternative universe
|
|
137
|
-
|
|
138
|
-
// // // If the generation started yet or not
|
|
139
|
-
// // // * If not, the server will start it.
|
|
140
|
-
// // started: boolean;
|
|
141
|
-
|
|
142
|
-
// // Required?
|
|
143
|
-
// // aiStreamId: AIStreamId
|
|
144
|
-
|
|
145
|
-
// // The generation status
|
|
146
|
-
// // * "running" if the generation is running
|
|
147
|
-
// // * "finished" if the generation is finished
|
|
148
|
-
// // * "error" if the generation errored
|
|
149
|
-
// // * "stopped" if the generation was stopped
|
|
150
|
-
// status:
|
|
151
|
-
// | 'unstarted'
|
|
152
|
-
// | 'running'
|
|
153
|
-
// | 'finished'
|
|
154
|
-
// | 'error'
|
|
155
|
-
// | 'stopped';
|
|
156
|
-
|
|
157
|
-
// // Possible states:
|
|
158
|
-
// // * { started: 'unstarted' } - client added this,
|
|
159
|
-
// // It should trigger the server to start the generation.
|
|
160
|
-
// // * { status: 'running' } - server added this,
|
|
161
|
-
// // It indicates that the generation is running.
|
|
162
|
-
// // * { status: 'finished' } - server added this,
|
|
163
|
-
// // It indicates that the generation is finished.
|
|
164
|
-
// // * { status: 'stopped' } - server added this,
|
|
165
|
-
// // It indicates that the generation was stopped.
|
|
166
|
-
// //
|
|
167
|
-
// // After `status` transitions to `finished` or `stopped`,
|
|
168
|
-
|
|
169
118
|
// The ShareDB document type for VZCode.
|
|
170
119
|
export type VZCodeContent = {
|
|
171
120
|
// `files`
|
|
@@ -179,25 +128,13 @@ export type VZCodeContent = {
|
|
|
179
128
|
// * `false` or `undefined` when they are not (e.g. normal typing)
|
|
180
129
|
// * Hot reloading is debounced when this is `false`.
|
|
181
130
|
isInteracting?: boolean;
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
// client and server.
|
|
190
|
-
// * This can power the transition of the icon from
|
|
191
|
-
// lightning bolt to stop sign and back (when stream finishes)
|
|
192
|
-
// aiStreams?: {
|
|
193
|
-
// // These need to be removed at some point?
|
|
194
|
-
// [aiStreamId: AIStreamId]: {
|
|
195
|
-
// AIStreamStatus: AIStreamStatus;
|
|
196
|
-
// };
|
|
197
|
-
// };
|
|
198
|
-
|
|
199
|
-
// TODO consider is there a way to replace the HTTP request to
|
|
200
|
-
// the AIAssist endpoint with a manipulation of the ShareDB document?
|
|
131
|
+
};
|
|
132
|
+
// Example Presence object, from ShareDB:
|
|
133
|
+
// {"start":["files","69064344","text",183],"end":["files","69064344","text",183],"username":"Jim"}
|
|
134
|
+
export type Presence = {
|
|
135
|
+
start: Array<string | number>;
|
|
136
|
+
end: Array<string | number>;
|
|
137
|
+
username: Username;
|
|
201
138
|
};
|
|
202
139
|
|
|
203
140
|
// An id used for presence.
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export const SearchFileSVG = () => {
|
|
2
|
-
return (
|
|
3
|
-
<svg
|
|
4
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
-
width="24"
|
|
6
|
-
height="24"
|
|
7
|
-
fill="none"
|
|
8
|
-
viewBox="0 0 24 24"
|
|
9
|
-
>
|
|
10
|
-
<path
|
|
11
|
-
stroke="currentColor"
|
|
12
|
-
strokeLinecap="round"
|
|
13
|
-
strokeLinejoin="round"
|
|
14
|
-
strokeWidth="1.5"
|
|
15
|
-
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.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.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"
|
|
16
|
-
/>
|
|
17
|
-
</svg>
|
|
18
|
-
);
|
|
19
|
-
};
|