vzcode 0.51.0 → 0.53.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-jYtAJn79.css → index-7PozlhVS.css} +1 -1
- package/dist/assets/index-wDsdDSEj.js +147 -0
- package/dist/assets/worker-y75r0vyN.js +232 -0
- package/dist/index.html +2 -2
- package/package.json +14 -13
- package/src/client/CodeEditor/getOrCreateEditor.ts +5 -3
- package/src/client/TabList/Tab.tsx +2 -2
- package/src/client/VZCodeContext.tsx +11 -19
- package/src/client/tabsSearchParameters.test.ts +54 -78
- package/src/client/tabsSearchParameters.ts +121 -60
- package/src/client/useURLSync.ts +134 -0
- package/src/client/vzReducer/createInitialState.ts +4 -11
- package/src/client/vzReducer/index.ts +3 -3
- package/dist/assets/index-yk4vJ5U-.js +0 -147
- package/dist/assets/worker-fboacSft.js +0 -234
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { VZState } from '.';
|
|
2
|
+
import { Username } from '../../types';
|
|
3
3
|
import { ThemeLabel } from '../themes';
|
|
4
4
|
|
|
5
5
|
export const createInitialState = ({
|
|
6
6
|
defaultTheme,
|
|
7
7
|
initialUsername = 'Anonymous',
|
|
8
|
-
initialTabList = [],
|
|
9
|
-
initialActiveFileId = null,
|
|
10
8
|
}: {
|
|
11
9
|
defaultTheme: ThemeLabel;
|
|
12
10
|
initialUsername?: Username;
|
|
13
|
-
initialTabList?: TabState[];
|
|
14
|
-
initialActiveFileId?: FileId;
|
|
15
11
|
}): VZState => ({
|
|
16
|
-
tabList:
|
|
17
|
-
activeFileId:
|
|
18
|
-
initialActiveFileId ??
|
|
19
|
-
initialTabList[0]?.fileId ??
|
|
20
|
-
null,
|
|
12
|
+
tabList: [],
|
|
13
|
+
activeFileId: null,
|
|
21
14
|
theme: defaultTheme,
|
|
22
15
|
isSettingsOpen: false,
|
|
23
16
|
editorWantsFocus: false,
|
|
@@ -44,7 +44,7 @@ export type VZAction =
|
|
|
44
44
|
| {
|
|
45
45
|
type: 'open_tab';
|
|
46
46
|
fileId: FileId;
|
|
47
|
-
isTransient
|
|
47
|
+
isTransient?: boolean;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
// `close_tabs`
|
|
@@ -79,11 +79,11 @@ export type TabState = {
|
|
|
79
79
|
// appears as italic, and it will be automatically
|
|
80
80
|
// closed when the user switches to another file.
|
|
81
81
|
// If `true` and the tab is opened, the editor will not focus.
|
|
82
|
-
// * `false` if the tab is persistent, meaning its text
|
|
82
|
+
// * `false` or `undefined` if the tab is persistent, meaning its text
|
|
83
83
|
// appears as normal, and it will not be automatically
|
|
84
84
|
// closed when the user switches to another file.
|
|
85
85
|
// If `false` and the tab is opened, the editor will focus.
|
|
86
|
-
isTransient
|
|
86
|
+
isTransient?: boolean;
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
const reducers = [
|