vzcode 0.25.0 → 0.26.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-284b7339.js +111 -0
- package/dist/assets/index-e160f758.css +1 -0
- package/dist/index.html +2 -6
- package/package.json +5 -5
- package/src/client/App.tsx +45 -225
- package/src/client/CodeEditor/index.tsx +36 -6
- package/src/client/CodeEditor/{json1PresenceBroadcast.js → json1PresenceBroadcast.ts} +5 -3
- package/src/client/CodeEditor/{json1PresenceDisplay.js → json1PresenceDisplay.ts} +9 -3
- package/src/client/PresenceNotifications/index.tsx +0 -2
- package/src/client/TabList/Tab.tsx +56 -0
- package/src/client/TabList/index.tsx +11 -62
- package/src/client/TabList/style.scss +21 -9
- package/src/client/{Settings.tsx → VZSettings.tsx} +1 -1
- package/src/client/{Sidebar → VZSidebar}/FileListing.tsx +3 -0
- package/src/client/{Sidebar → VZSidebar}/Item.tsx +7 -4
- package/src/client/{Sidebar → VZSidebar}/Listing.tsx +3 -0
- package/src/client/{Sidebar → VZSidebar}/index.tsx +5 -6
- package/src/client/{Sidebar → VZSidebar}/styles.scss +17 -12
- package/src/client/bootstrap.ts +3 -0
- package/src/client/style.scss +5 -2
- package/src/client/useActions.ts +74 -0
- package/src/client/useFileCRUD.ts +101 -0
- package/src/client/useOpenDirectories.ts +25 -7
- package/src/client/useSubmitOperation.ts +25 -0
- package/src/client/{reducer.ts → vzReducer.ts} +42 -43
- package/src/index.ts +34 -0
- package/src/server/index.js +13 -2
- package/dist/assets/index-8628ebab.js +0 -111
- package/dist/assets/index-cf19de3b.css +0 -1
- /package/src/client/{Sidebar → VZSidebar}/ConfirmationBox.tsx +0 -0
- /package/src/client/{Sidebar → VZSidebar}/DirectoryArrowSVG.jsx +0 -0
- /package/src/client/{Sidebar → VZSidebar}/DirectoryListing.tsx +0 -0
package/src/index.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type {
|
|
2
|
+
FileId,
|
|
3
|
+
Files,
|
|
4
|
+
File,
|
|
5
|
+
FileTree,
|
|
6
|
+
FileTreeFile,
|
|
7
|
+
ShareDBDoc,
|
|
8
|
+
VZCodeContent,
|
|
9
|
+
} from './types';
|
|
10
|
+
export type { EditorCache } from './client/useEditorCache';
|
|
11
|
+
export type {
|
|
12
|
+
ThemeLabel,
|
|
13
|
+
ThemeOption,
|
|
14
|
+
} from './client/themes';
|
|
15
|
+
|
|
16
|
+
export { VZSidebar } from './client/VZSidebar';
|
|
17
|
+
export { VZSettings } from './client/VZSettings';
|
|
18
|
+
export { SplitPaneResizeContext } from './client/SplitPaneResizeContext';
|
|
19
|
+
export { Resizer } from './client/Resizer';
|
|
20
|
+
export { TabList } from './client/TabList';
|
|
21
|
+
export { CodeEditor } from './client/CodeEditor';
|
|
22
|
+
export { usePrettier } from './client/usePrettier';
|
|
23
|
+
export { PrettierErrorOverlay } from './client/PrettierErrorOverlay';
|
|
24
|
+
export { PresenceNotifications } from './client/PresenceNotifications';
|
|
25
|
+
export { useFileCRUD } from './client/useFileCRUD';
|
|
26
|
+
export { useSubmitOperation } from './client/useSubmitOperation';
|
|
27
|
+
export { vzReducer } from './client/vzReducer';
|
|
28
|
+
export { useActions } from './client/useActions';
|
|
29
|
+
export { useOpenDirectories } from './client/useOpenDirectories';
|
|
30
|
+
export {
|
|
31
|
+
defaultTheme,
|
|
32
|
+
useDynamicTheme,
|
|
33
|
+
} from './client/themes';
|
|
34
|
+
export { useEditorCache } from './client/useEditorCache';
|
package/src/server/index.js
CHANGED
|
@@ -22,8 +22,19 @@ const autoSaveDebounceTimeMS = 800;
|
|
|
22
22
|
// when the user is interacting with the widgets in the editor.
|
|
23
23
|
const throttleTimeMS = 100;
|
|
24
24
|
|
|
25
|
+
// Helper function to get the port from command line arguments or use default.
|
|
26
|
+
function getPortFromArgs(defaultPort = 3030) {
|
|
27
|
+
const portArg = process.argv.find((arg) =>
|
|
28
|
+
arg.startsWith('--port='),
|
|
29
|
+
);
|
|
30
|
+
if (portArg) {
|
|
31
|
+
return parseInt(portArg.split('=')[1], 10);
|
|
32
|
+
}
|
|
33
|
+
return defaultPort;
|
|
34
|
+
}
|
|
35
|
+
|
|
25
36
|
// Server port.
|
|
26
|
-
const port =
|
|
37
|
+
const port = getPortFromArgs();
|
|
27
38
|
|
|
28
39
|
const initialDocument = computeInitialDocument({
|
|
29
40
|
// Use the current working directory to look for files.
|
|
@@ -109,7 +120,7 @@ const save = () => {
|
|
|
109
120
|
|
|
110
121
|
// Handle renaming files.
|
|
111
122
|
if (previous.name !== current.name) {
|
|
112
|
-
fs.
|
|
123
|
+
fs.renameSync(previous.name, current.name);
|
|
113
124
|
}
|
|
114
125
|
}
|
|
115
126
|
|