vzcode 0.88.0 → 1.0.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 +0 -1
- package/dist/assets/{index-DubfLBmh.js → index-C4h28erw.js} +57 -57
- package/dist/assets/index-CWMOj-be.css +1 -0
- package/dist/assets/index-DacyImKg.js +155 -0
- package/dist/assets/{worker-1Ck54dGO.js → worker-BIf7QrAH.js} +19 -19
- package/dist/index.html +2 -2
- package/package.json +47 -27
- package/src/client/Icons/QuestionMarkSVG.tsx +18 -0
- package/src/client/Icons/index.tsx +1 -0
- package/src/client/RunCodeWidget/index.tsx +8 -2
- package/src/client/RunCodeWidget/style.scss +13 -1
- package/src/client/SplitPaneResizeContext.tsx +1 -1
- package/src/client/VZCodeContext.tsx +11 -0
- package/src/client/VZKeyboardShortcutsDoc.tsx +121 -0
- package/src/client/VZLeft.tsx +4 -0
- package/src/client/VZSettings.tsx +23 -43
- package/src/client/VZSidebar/CreateDirModal.tsx +14 -2
- package/src/client/VZSidebar/CreateFileModal.tsx +14 -2
- package/src/client/VZSidebar/index.tsx +49 -37
- package/src/client/index.ts +1 -0
- package/src/client/useActions.ts +16 -0
- package/src/client/vzReducer/createInitialState.ts +1 -0
- package/src/client/vzReducer/index.ts +5 -0
- package/src/client/vzReducer/setIsDocOpenReducer.ts +9 -0
- package/dist/assets/index-9yhZQKtK.css +0 -1
- package/dist/assets/index-Dx3HipqX.js +0 -155
- package/src/client/featureFlags.js +0 -4
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useCallback,
|
|
3
|
-
useContext,
|
|
4
|
-
useEffect,
|
|
5
|
-
useMemo,
|
|
6
|
-
} from 'react';
|
|
1
|
+
import { useCallback, useContext, useMemo } from 'react';
|
|
7
2
|
import {
|
|
8
3
|
FileId,
|
|
9
4
|
FileTree,
|
|
@@ -12,11 +7,16 @@ import {
|
|
|
12
7
|
import { Tooltip, OverlayTrigger } from '../bootstrap';
|
|
13
8
|
import { getFileTree } from '../getFileTree';
|
|
14
9
|
import { sortFileTree } from '../sortFileTree';
|
|
15
|
-
import { disableSettings } from '../featureFlags';
|
|
16
10
|
import { SplitPaneResizeContext } from '../SplitPaneResizeContext';
|
|
17
|
-
import {
|
|
18
|
-
|
|
11
|
+
import {
|
|
12
|
+
BugSVG,
|
|
13
|
+
GearSVG,
|
|
14
|
+
NewSVG,
|
|
15
|
+
FileSVG,
|
|
16
|
+
QuestionMarkSVG,
|
|
17
|
+
} from '../Icons';
|
|
19
18
|
import { VZCodeContext } from '../VZCodeContext';
|
|
19
|
+
import { Listing } from './Listing';
|
|
20
20
|
import { useDragAndDrop } from './useDragAndDrop';
|
|
21
21
|
import './styles.scss';
|
|
22
22
|
|
|
@@ -29,24 +29,20 @@ export const VZSidebar = ({
|
|
|
29
29
|
createFileTooltipText = 'New File',
|
|
30
30
|
createDirTooltipText = 'New Directory',
|
|
31
31
|
openSettingsTooltipText = 'Open Settings',
|
|
32
|
+
openKeyboardShortcuts = 'Keyboard Shortcuts',
|
|
32
33
|
reportBugTooltipText = 'Report Bug',
|
|
33
34
|
}: {
|
|
34
35
|
createFileTooltipText?: string;
|
|
35
36
|
createDirTooltipText?: string;
|
|
36
37
|
openSettingsTooltipText?: string;
|
|
37
38
|
reportBugTooltipText?: string;
|
|
39
|
+
openKeyboardShortcuts?: string;
|
|
38
40
|
}) => {
|
|
39
41
|
const {
|
|
40
42
|
files,
|
|
41
|
-
renameFile,
|
|
42
|
-
deleteFile,
|
|
43
|
-
renameDirectory,
|
|
44
|
-
deleteDirectory,
|
|
45
|
-
activeFileId,
|
|
46
43
|
openTab,
|
|
47
44
|
setIsSettingsOpen,
|
|
48
|
-
|
|
49
|
-
toggleDirectory,
|
|
45
|
+
setIsDocOpen,
|
|
50
46
|
handleOpenCreateFileModal,
|
|
51
47
|
handleOpenCreateDirModal,
|
|
52
48
|
connected,
|
|
@@ -56,7 +52,9 @@ export const VZSidebar = ({
|
|
|
56
52
|
() => (files ? sortFileTree(getFileTree(files)) : null),
|
|
57
53
|
[files],
|
|
58
54
|
);
|
|
59
|
-
|
|
55
|
+
const handleQuestionMarkClick = useCallback(() => {
|
|
56
|
+
setIsDocOpen(true);
|
|
57
|
+
}, []);
|
|
60
58
|
const handleSettingsClick = useCallback(() => {
|
|
61
59
|
setIsSettingsOpen(true);
|
|
62
60
|
}, []);
|
|
@@ -106,12 +104,26 @@ export const VZSidebar = ({
|
|
|
106
104
|
>
|
|
107
105
|
<div className="files">
|
|
108
106
|
<div className="full-box">
|
|
109
|
-
<div className="sidebar-section-hint">
|
|
110
|
-
Project Files
|
|
111
|
-
</div>
|
|
107
|
+
<div className="sidebar-section-hint">Files</div>
|
|
112
108
|
<div className="sidebar-section-buttons">
|
|
113
109
|
<OverlayTrigger
|
|
114
|
-
placement="
|
|
110
|
+
placement="right"
|
|
111
|
+
overlay={
|
|
112
|
+
<Tooltip id="open-keyboard-shortcuts">
|
|
113
|
+
{openKeyboardShortcuts}
|
|
114
|
+
</Tooltip>
|
|
115
|
+
}
|
|
116
|
+
>
|
|
117
|
+
<i
|
|
118
|
+
onClick={handleQuestionMarkClick}
|
|
119
|
+
className="icon-button icon-button-dark"
|
|
120
|
+
>
|
|
121
|
+
<QuestionMarkSVG />
|
|
122
|
+
</i>
|
|
123
|
+
</OverlayTrigger>
|
|
124
|
+
|
|
125
|
+
<OverlayTrigger
|
|
126
|
+
placement="right"
|
|
115
127
|
overlay={
|
|
116
128
|
<Tooltip id="report-bug-tooltip">
|
|
117
129
|
{reportBugTooltipText}
|
|
@@ -128,23 +140,23 @@ export const VZSidebar = ({
|
|
|
128
140
|
</i>
|
|
129
141
|
</a>
|
|
130
142
|
</OverlayTrigger>
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
143
|
+
|
|
144
|
+
<OverlayTrigger
|
|
145
|
+
placement="left"
|
|
146
|
+
overlay={
|
|
147
|
+
<Tooltip id="open-settings-tooltip">
|
|
148
|
+
{openSettingsTooltipText}
|
|
149
|
+
</Tooltip>
|
|
150
|
+
}
|
|
151
|
+
>
|
|
152
|
+
<i
|
|
153
|
+
onClick={handleSettingsClick}
|
|
154
|
+
className="icon-button icon-button-dark"
|
|
139
155
|
>
|
|
140
|
-
<
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
<GearSVG />
|
|
145
|
-
</i>
|
|
146
|
-
</OverlayTrigger>
|
|
147
|
-
)}
|
|
156
|
+
<GearSVG />
|
|
157
|
+
</i>
|
|
158
|
+
</OverlayTrigger>
|
|
159
|
+
|
|
148
160
|
<OverlayTrigger
|
|
149
161
|
placement="left"
|
|
150
162
|
overlay={
|
package/src/client/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ export type { EditorCache } from './useEditorCache';
|
|
|
4
4
|
export { VZCodeProvider } from './VZCodeContext';
|
|
5
5
|
export { VZSidebar } from './VZSidebar';
|
|
6
6
|
export { VZSettings } from './VZSettings';
|
|
7
|
+
export { VZKeyboardShortcutsDoc } from './VZKeyboardShortcutsDoc';
|
|
7
8
|
export { VZResizer } from './VZResizer';
|
|
8
9
|
export { VZLeft } from './VZLeft';
|
|
9
10
|
export { VZMiddle } from './VZMiddle';
|
package/src/client/useActions.ts
CHANGED
|
@@ -68,10 +68,24 @@ export const useActions = (
|
|
|
68
68
|
[dispatch],
|
|
69
69
|
);
|
|
70
70
|
|
|
71
|
+
const setIsDocOpen = useCallback(
|
|
72
|
+
(value: boolean) => {
|
|
73
|
+
dispatch({
|
|
74
|
+
type: 'set_is_doc_open',
|
|
75
|
+
value: value,
|
|
76
|
+
});
|
|
77
|
+
},
|
|
78
|
+
[dispatch],
|
|
79
|
+
);
|
|
80
|
+
|
|
71
81
|
const closeSettings = useCallback(() => {
|
|
72
82
|
setIsSettingsOpen(false);
|
|
73
83
|
}, [setIsSettingsOpen]);
|
|
74
84
|
|
|
85
|
+
const closeDoc = useCallback(() => {
|
|
86
|
+
setIsDocOpen(false);
|
|
87
|
+
}, [setIsDocOpen]);
|
|
88
|
+
|
|
75
89
|
const editorNoLongerWantsFocus = useCallback(() => {
|
|
76
90
|
dispatch({
|
|
77
91
|
type: 'editor_no_longer_wants_focus',
|
|
@@ -96,7 +110,9 @@ export const useActions = (
|
|
|
96
110
|
closeTabs,
|
|
97
111
|
setTheme,
|
|
98
112
|
setIsSettingsOpen,
|
|
113
|
+
setIsDocOpen,
|
|
99
114
|
closeSettings,
|
|
115
|
+
closeDoc,
|
|
100
116
|
editorNoLongerWantsFocus,
|
|
101
117
|
setUsername,
|
|
102
118
|
};
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
setActiveFileRightReducer,
|
|
9
9
|
} from './setActiveFileLeftRightReducer';
|
|
10
10
|
import { setIsSettingsOpenReducer } from './setIsSettingsOpenReducer';
|
|
11
|
+
import { setIsDocOpenReducer } from './setIsDocOpenReducer';
|
|
11
12
|
import { setThemeReducer } from './setThemeReducer';
|
|
12
13
|
import { editorNoLongerWantsFocusReducer } from './editorNoLongerWantsFocusReducer';
|
|
13
14
|
import { setUsernameReducer } from './setUsernameReducer';
|
|
@@ -29,6 +30,8 @@ export type VZState = {
|
|
|
29
30
|
// True to show the settings modal.
|
|
30
31
|
isSettingsOpen: boolean;
|
|
31
32
|
|
|
33
|
+
isDocOpen: boolean;
|
|
34
|
+
|
|
32
35
|
// True if the editor should focus on the next render.
|
|
33
36
|
editorWantsFocus: boolean;
|
|
34
37
|
|
|
@@ -68,6 +71,7 @@ export type VZAction =
|
|
|
68
71
|
// `set_is_settings_open`
|
|
69
72
|
// * Sets whether the settings modal is open.
|
|
70
73
|
| { type: 'set_is_settings_open'; value: boolean }
|
|
74
|
+
| { type: 'set_is_doc_open'; value: boolean }
|
|
71
75
|
|
|
72
76
|
// `editor_no_longer_wants_focus`
|
|
73
77
|
// * Sets `editorWantsFocus` to `false`.
|
|
@@ -104,6 +108,7 @@ const reducers = [
|
|
|
104
108
|
closeTabsReducer,
|
|
105
109
|
setThemeReducer,
|
|
106
110
|
setIsSettingsOpenReducer,
|
|
111
|
+
setIsDocOpenReducer,
|
|
107
112
|
editorNoLongerWantsFocusReducer,
|
|
108
113
|
setUsernameReducer,
|
|
109
114
|
];
|