@netless/window-manager 0.4.0-canary.9 → 0.4.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/.idea/inspectionProfiles/Project_Default.xml +7 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/.idea/window-manager.iml +12 -0
- package/.vscode/settings.json +1 -0
- package/CHANGELOG.md +39 -2
- package/README.md +3 -0
- package/dist/App/MagixEvent/index.d.ts +29 -0
- package/dist/App/Storage/index.d.ts +19 -6
- package/dist/App/Storage/typings.d.ts +1 -0
- package/dist/AppContext.d.ts +39 -17
- package/dist/AppListener.d.ts +2 -0
- package/dist/AppManager.d.ts +22 -8
- package/dist/AppProxy.d.ts +5 -5
- package/dist/AttributesDelegate.d.ts +2 -2
- package/dist/BoxManager.d.ts +6 -4
- package/dist/BuiltinApps.d.ts +0 -1
- package/dist/Cursor/Cursor.d.ts +10 -12
- package/dist/Cursor/index.d.ts +6 -16
- package/dist/Helper.d.ts +1 -0
- package/dist/Register/storage.d.ts +5 -1
- package/dist/Utils/AppCreateQueue.d.ts +11 -0
- package/dist/Utils/Common.d.ts +4 -1
- package/dist/Utils/RoomHacker.d.ts +3 -3
- package/dist/View/MainView.d.ts +4 -3
- package/dist/constants.d.ts +5 -2
- package/dist/index.d.ts +30 -6
- package/dist/index.es.js +41 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +41 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/typings.d.ts +2 -2
- package/docs/advanced.md +39 -0
- package/docs/api.md +69 -6
- package/docs/concept.md +9 -0
- package/docs/replay.md +40 -0
- package/package.json +7 -6
- package/src/App/MagixEvent/index.ts +68 -0
- package/src/App/Storage/index.ts +89 -43
- package/src/App/Storage/typings.ts +4 -2
- package/src/AppContext.ts +61 -24
- package/src/AppListener.ts +27 -8
- package/src/AppManager.ts +231 -70
- package/src/AppProxy.ts +40 -29
- package/src/AttributesDelegate.ts +2 -2
- package/src/BoxManager.ts +33 -19
- package/src/BuiltinApps.ts +0 -1
- package/src/ContainerResizeObserver.ts +3 -3
- package/src/Cursor/Cursor.svelte +25 -21
- package/src/Cursor/Cursor.ts +25 -38
- package/src/Cursor/icons.ts +2 -0
- package/src/Cursor/index.ts +45 -139
- package/src/Helper.ts +12 -1
- package/src/Register/index.ts +25 -16
- package/src/Register/loader.ts +2 -2
- package/src/Register/storage.ts +6 -1
- package/src/Utils/AppCreateQueue.ts +54 -0
- package/src/Utils/Common.ts +35 -2
- package/src/Utils/RoomHacker.ts +33 -18
- package/src/View/MainView.ts +19 -12
- package/src/View/ViewManager.ts +1 -2
- package/src/constants.ts +6 -2
- package/src/image/laser-pointer-cursor.svg +17 -0
- package/src/index.ts +148 -33
- package/src/shim.d.ts +2 -1
- package/src/style.css +6 -1
- package/src/typings.ts +2 -2
- package/vite.config.js +5 -2
- package/dist/Base/Context.d.ts +0 -12
- package/dist/Base/index.d.ts +0 -7
- package/src/Base/Context.ts +0 -45
- package/src/Base/index.ts +0 -10
package/dist/constants.d.ts
CHANGED
@@ -10,7 +10,9 @@ export declare enum Events {
|
|
10
10
|
SetMainViewScenePath = "SetMainViewScenePath",
|
11
11
|
SetMainViewSceneIndex = "SetMainViewSceneIndex",
|
12
12
|
SwitchViewsToFreedom = "SwitchViewsToFreedom",
|
13
|
-
|
13
|
+
MoveCamera = "MoveCamera",
|
14
|
+
MoveCameraToContain = "MoveCameraToContain",
|
15
|
+
CursorMove = "CursorMove"
|
14
16
|
}
|
15
17
|
export declare const MagixEventName = "__WindowManger";
|
16
18
|
export declare enum AppAttributes {
|
@@ -31,8 +33,9 @@ export declare enum CursorState {
|
|
31
33
|
Leave = "leave",
|
32
34
|
Normal = "normal"
|
33
35
|
}
|
34
|
-
export declare const REQUIRE_VERSION = "2.16.
|
36
|
+
export declare const REQUIRE_VERSION = "2.16.1";
|
35
37
|
export declare const MIN_WIDTH: number;
|
36
38
|
export declare const MIN_HEIGHT: number;
|
37
39
|
export declare const SET_SCENEPATH_DELAY = 100;
|
38
40
|
export declare const DEFAULT_CONTAINER_RATIO: number;
|
41
|
+
export declare const ROOT_DIR = "/";
|
package/dist/index.d.ts
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
import Emittery from "emittery";
|
2
2
|
import { AppManager } from "./AppManager";
|
3
3
|
import { CursorManager } from "./Cursor";
|
4
|
+
import { InvisiblePlugin, ViewMode } from "white-web-sdk";
|
4
5
|
import { ReconnectRefresher } from "./ReconnectRefresher";
|
5
6
|
import "./style.css";
|
6
7
|
import "@netless/telebox-insider/dist/style.css";
|
7
8
|
import type { TELE_BOX_STATE } from "./BoxManager";
|
8
|
-
import type { Apps } from "./AttributesDelegate";
|
9
|
-
import {
|
10
|
-
import type { Displayer, SceneDefinition, View, Room, InvisiblePluginContext, Camera, AnimationMode, CameraBound, Point, Rectangle, ViewVisionMode, CameraState } from "white-web-sdk";
|
9
|
+
import type { Apps, Position } from "./AttributesDelegate";
|
10
|
+
import type { Displayer, SceneDefinition, View, Room, InvisiblePluginContext, Camera, AnimationMode, CameraBound, Point, Rectangle, ViewVisionMode, CameraState, Player } from "white-web-sdk";
|
11
11
|
import type { AppListeners } from "./AppListener";
|
12
12
|
import type { NetlessApp, RegisterParams } from "./typings";
|
13
13
|
import type { TeleBoxColorScheme, TeleBoxState } from "@netless/telebox-insider";
|
@@ -65,6 +65,11 @@ export declare type AppInitState = {
|
|
65
65
|
boxState?: TeleBoxState;
|
66
66
|
zIndex?: number;
|
67
67
|
};
|
68
|
+
export declare type CursorMovePayload = {
|
69
|
+
uid: string;
|
70
|
+
state?: "leave";
|
71
|
+
position: Position;
|
72
|
+
};
|
68
73
|
export declare type EmitterEvent = {
|
69
74
|
onCreated: undefined;
|
70
75
|
InitReplay: AppInitState;
|
@@ -93,6 +98,8 @@ export declare type EmitterEvent = {
|
|
93
98
|
boxStateChange: string;
|
94
99
|
playgroundSizeChange: DOMRect;
|
95
100
|
onReconnected: void;
|
101
|
+
removeScenes: string;
|
102
|
+
cursorMove: CursorMovePayload;
|
96
103
|
};
|
97
104
|
export declare type EmitterType = Emittery<EmitterEvent>;
|
98
105
|
export declare const emitter: EmitterType;
|
@@ -104,9 +111,13 @@ export declare type PublicEvent = {
|
|
104
111
|
cameraStateChange: CameraState;
|
105
112
|
mainViewScenePathChange: string;
|
106
113
|
mainViewSceneIndexChange: number;
|
114
|
+
focusedChange: string | undefined;
|
115
|
+
mainViewScenesLengthChange: number;
|
116
|
+
canRedoStepsChange: number;
|
117
|
+
canUndoStepsChange: number;
|
107
118
|
};
|
108
119
|
export declare type MountParams = {
|
109
|
-
room: Room;
|
120
|
+
room: Room | Player;
|
110
121
|
container?: HTMLElement;
|
111
122
|
/** 白板高宽比例, 默认为 9 / 16 */
|
112
123
|
containerSizeRatio?: number;
|
@@ -133,6 +144,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
133
144
|
static containerSizeRatio: number;
|
134
145
|
private static isCreated;
|
135
146
|
version: string;
|
147
|
+
dependencies: Record<string, string>;
|
136
148
|
appListeners?: AppListeners;
|
137
149
|
readonly?: boolean;
|
138
150
|
emitter: Emittery<PublicEvent>;
|
@@ -169,7 +181,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
169
181
|
/**
|
170
182
|
* 返回 mainView 的 ScenePath
|
171
183
|
*/
|
172
|
-
getMainViewScenePath(): string;
|
184
|
+
getMainViewScenePath(): string | undefined;
|
173
185
|
/**
|
174
186
|
* 返回 mainView 的 SceneIndex
|
175
187
|
*/
|
@@ -190,6 +202,9 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
190
202
|
* 设置 ViewMode
|
191
203
|
*/
|
192
204
|
setViewMode(mode: ViewMode): void;
|
205
|
+
setBoxState(boxState: TeleBoxState): void;
|
206
|
+
setMaximized(maximized: boolean): void;
|
207
|
+
setMinimized(minimized: boolean): void;
|
193
208
|
get mainView(): View;
|
194
209
|
get camera(): Camera;
|
195
210
|
get cameraState(): CameraState;
|
@@ -197,6 +212,13 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
197
212
|
get boxState(): TeleBoxState | undefined;
|
198
213
|
get darkMode(): boolean;
|
199
214
|
get prefersColorScheme(): TeleBoxColorScheme | undefined;
|
215
|
+
get focused(): string | undefined;
|
216
|
+
get mainViewSceneIndex(): number;
|
217
|
+
get mainViewSceneDir(): string;
|
218
|
+
get topApp(): string | undefined;
|
219
|
+
get mainViewScenesLength(): number;
|
220
|
+
get canRedoSteps(): number;
|
221
|
+
get canUndoSteps(): number;
|
200
222
|
/**
|
201
223
|
* 查询所有的 App
|
202
224
|
*/
|
@@ -226,8 +248,10 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
226
248
|
safeSetAttributes(attributes: any): void;
|
227
249
|
safeUpdateAttributes(keys: string[], value: any): void;
|
228
250
|
setPrefersColorScheme(scheme: TeleBoxColorScheme): void;
|
251
|
+
cleanCurrentScene(): void;
|
252
|
+
redo(): number;
|
253
|
+
undo(): number;
|
229
254
|
private isDynamicPPT;
|
230
|
-
private static checkVersion;
|
231
255
|
private ensureAttributes;
|
232
256
|
}
|
233
257
|
export * from "./typings";
|