@netless/window-manager 0.4.0-canary.9 → 0.4.2
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 +43 -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/index.d.ts +5 -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 +32 -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 +53 -0
- package/docs/api.md +79 -6
- package/docs/concept.md +9 -0
- package/docs/replay.md +40 -0
- package/package.json +8 -9
- 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 +32 -17
- package/src/Register/loader.ts +28 -13
- 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 +150 -33
- package/src/shim.d.ts +2 -1
- package/src/style.css +6 -1
- package/src/typings.ts +2 -2
- package/vite.config.js +7 -4
- 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/View/MainView.d.ts
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
import { Base } from "../Base";
|
2
1
|
import type { Camera, Size, View } from "white-web-sdk";
|
3
2
|
import type { AppManager } from "../AppManager";
|
4
|
-
export declare class MainViewProxy
|
3
|
+
export declare class MainViewProxy {
|
4
|
+
private manager;
|
5
5
|
private scale?;
|
6
6
|
private started;
|
7
7
|
private mainViewIsAddListener;
|
8
8
|
private mainView;
|
9
|
-
private
|
9
|
+
private store;
|
10
10
|
private sideEffectManager;
|
11
11
|
constructor(manager: AppManager);
|
12
12
|
private get mainViewCamera();
|
@@ -25,6 +25,7 @@ export declare class MainViewProxy extends Base {
|
|
25
25
|
scale: number;
|
26
26
|
};
|
27
27
|
createMainView(): View;
|
28
|
+
onReconnect(): void;
|
28
29
|
private onCameraUpdatedByDevice;
|
29
30
|
addMainViewListener(): void;
|
30
31
|
removeMainViewListener(): void;
|
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,14 @@
|
|
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";
|
8
|
+
import type { LoadAppEvent } from "./Register";
|
7
9
|
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";
|
10
|
+
import type { Apps, Position } from "./AttributesDelegate";
|
11
|
+
import type { Displayer, SceneDefinition, View, Room, InvisiblePluginContext, Camera, AnimationMode, CameraBound, Point, Rectangle, ViewVisionMode, CameraState, Player } from "white-web-sdk";
|
11
12
|
import type { AppListeners } from "./AppListener";
|
12
13
|
import type { NetlessApp, RegisterParams } from "./typings";
|
13
14
|
import type { TeleBoxColorScheme, TeleBoxState } from "@netless/telebox-insider";
|
@@ -65,6 +66,11 @@ export declare type AppInitState = {
|
|
65
66
|
boxState?: TeleBoxState;
|
66
67
|
zIndex?: number;
|
67
68
|
};
|
69
|
+
export declare type CursorMovePayload = {
|
70
|
+
uid: string;
|
71
|
+
state?: "leave";
|
72
|
+
position: Position;
|
73
|
+
};
|
68
74
|
export declare type EmitterEvent = {
|
69
75
|
onCreated: undefined;
|
70
76
|
InitReplay: AppInitState;
|
@@ -93,6 +99,8 @@ export declare type EmitterEvent = {
|
|
93
99
|
boxStateChange: string;
|
94
100
|
playgroundSizeChange: DOMRect;
|
95
101
|
onReconnected: void;
|
102
|
+
removeScenes: string;
|
103
|
+
cursorMove: CursorMovePayload;
|
96
104
|
};
|
97
105
|
export declare type EmitterType = Emittery<EmitterEvent>;
|
98
106
|
export declare const emitter: EmitterType;
|
@@ -104,9 +112,14 @@ export declare type PublicEvent = {
|
|
104
112
|
cameraStateChange: CameraState;
|
105
113
|
mainViewScenePathChange: string;
|
106
114
|
mainViewSceneIndexChange: number;
|
115
|
+
focusedChange: string | undefined;
|
116
|
+
mainViewScenesLengthChange: number;
|
117
|
+
canRedoStepsChange: number;
|
118
|
+
canUndoStepsChange: number;
|
119
|
+
loadApp: LoadAppEvent;
|
107
120
|
};
|
108
121
|
export declare type MountParams = {
|
109
|
-
room: Room;
|
122
|
+
room: Room | Player;
|
110
123
|
container?: HTMLElement;
|
111
124
|
/** 白板高宽比例, 默认为 9 / 16 */
|
112
125
|
containerSizeRatio?: number;
|
@@ -133,6 +146,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
133
146
|
static containerSizeRatio: number;
|
134
147
|
private static isCreated;
|
135
148
|
version: string;
|
149
|
+
dependencies: Record<string, string>;
|
136
150
|
appListeners?: AppListeners;
|
137
151
|
readonly?: boolean;
|
138
152
|
emitter: Emittery<PublicEvent>;
|
@@ -169,7 +183,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
169
183
|
/**
|
170
184
|
* 返回 mainView 的 ScenePath
|
171
185
|
*/
|
172
|
-
getMainViewScenePath(): string;
|
186
|
+
getMainViewScenePath(): string | undefined;
|
173
187
|
/**
|
174
188
|
* 返回 mainView 的 SceneIndex
|
175
189
|
*/
|
@@ -190,6 +204,9 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
190
204
|
* 设置 ViewMode
|
191
205
|
*/
|
192
206
|
setViewMode(mode: ViewMode): void;
|
207
|
+
setBoxState(boxState: TeleBoxState): void;
|
208
|
+
setMaximized(maximized: boolean): void;
|
209
|
+
setMinimized(minimized: boolean): void;
|
193
210
|
get mainView(): View;
|
194
211
|
get camera(): Camera;
|
195
212
|
get cameraState(): CameraState;
|
@@ -197,6 +214,13 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
197
214
|
get boxState(): TeleBoxState | undefined;
|
198
215
|
get darkMode(): boolean;
|
199
216
|
get prefersColorScheme(): TeleBoxColorScheme | undefined;
|
217
|
+
get focused(): string | undefined;
|
218
|
+
get mainViewSceneIndex(): number;
|
219
|
+
get mainViewSceneDir(): string;
|
220
|
+
get topApp(): string | undefined;
|
221
|
+
get mainViewScenesLength(): number;
|
222
|
+
get canRedoSteps(): number;
|
223
|
+
get canUndoSteps(): number;
|
200
224
|
/**
|
201
225
|
* 查询所有的 App
|
202
226
|
*/
|
@@ -226,8 +250,10 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
226
250
|
safeSetAttributes(attributes: any): void;
|
227
251
|
safeUpdateAttributes(keys: string[], value: any): void;
|
228
252
|
setPrefersColorScheme(scheme: TeleBoxColorScheme): void;
|
253
|
+
cleanCurrentScene(): void;
|
254
|
+
redo(): number;
|
255
|
+
undo(): number;
|
229
256
|
private isDynamicPPT;
|
230
|
-
private static checkVersion;
|
231
257
|
private ensureAttributes;
|
232
258
|
}
|
233
259
|
export * from "./typings";
|