@netless/window-manager 0.4.0-canary.2 → 0.4.0-canary.20
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 +29 -1
- package/README.md +1 -0
- package/dist/App/MagixEvent/index.d.ts +29 -0
- package/dist/App/Storage/StorageEvent.d.ts +8 -0
- package/dist/App/Storage/index.d.ts +39 -0
- package/dist/App/Storage/typings.d.ts +22 -0
- package/dist/App/Storage/utils.d.ts +5 -0
- package/dist/AppContext.d.ts +40 -16
- package/dist/AppListener.d.ts +1 -1
- package/dist/AppManager.d.ts +15 -11
- package/dist/AppProxy.d.ts +6 -5
- package/dist/AttributesDelegate.d.ts +2 -2
- package/dist/BoxManager.d.ts +6 -3
- package/dist/BuiltinApps.d.ts +5 -0
- package/dist/ContainerResizeObserver.d.ts +10 -0
- package/dist/Cursor/Cursor.d.ts +8 -11
- package/dist/Cursor/index.d.ts +5 -16
- package/dist/Helper.d.ts +6 -0
- package/dist/ReconnectRefresher.d.ts +0 -1
- package/dist/Register/storage.d.ts +5 -1
- package/dist/Utils/Common.d.ts +7 -2
- package/dist/Utils/Reactive.d.ts +1 -1
- package/dist/Utils/RoomHacker.d.ts +1 -1
- package/dist/{MainView.d.ts → View/MainView.d.ts} +5 -6
- package/dist/View/ViewManager.d.ts +13 -0
- package/dist/constants.d.ts +3 -7
- package/dist/index.d.ts +25 -10
- 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 +3 -2
- package/docs/api.md +36 -6
- package/docs/concept.md +9 -0
- package/package.json +7 -6
- package/src/App/MagixEvent/index.ts +68 -0
- package/src/App/Storage/StorageEvent.ts +21 -0
- package/src/App/Storage/index.ts +289 -0
- package/src/App/Storage/typings.ts +23 -0
- package/src/App/Storage/utils.ts +17 -0
- package/src/AppContext.ts +66 -24
- package/src/AppListener.ts +15 -14
- package/src/AppManager.ts +141 -63
- package/src/AppProxy.ts +50 -52
- package/src/AttributesDelegate.ts +2 -2
- package/src/BoxManager.ts +40 -24
- package/src/BuiltinApps.ts +23 -0
- package/src/ContainerResizeObserver.ts +62 -0
- package/src/Cursor/Cursor.ts +22 -36
- package/src/Cursor/index.ts +33 -139
- package/src/Helper.ts +30 -0
- package/src/ReconnectRefresher.ts +0 -5
- package/src/Register/index.ts +25 -16
- package/src/Register/loader.ts +1 -1
- package/src/Register/storage.ts +6 -1
- package/src/Utils/Common.ts +66 -13
- package/src/Utils/Reactive.ts +9 -3
- package/src/Utils/RoomHacker.ts +42 -13
- package/src/{MainView.ts → View/MainView.ts} +25 -36
- package/src/View/ViewManager.ts +52 -0
- package/src/constants.ts +3 -4
- package/src/index.ts +96 -72
- package/src/shim.d.ts +5 -0
- package/src/style.css +7 -1
- package/src/typings.ts +3 -2
- package/vite.config.js +8 -2
- package/dist/Base/Context.d.ts +0 -13
- package/dist/Base/index.d.ts +0 -7
- package/dist/Utils/CameraStore.d.ts +0 -15
- package/dist/ViewManager.d.ts +0 -29
- package/dist/sdk.d.ts +0 -14
- package/src/Base/Context.ts +0 -49
- package/src/Base/index.ts +0 -10
- package/src/Utils/CameraStore.ts +0 -72
- package/src/sdk.ts +0 -39
- package/src/viewManager.ts +0 -177
@@ -1,13 +1,12 @@
|
|
1
|
-
import { Base } from "./Base";
|
2
1
|
import type { Camera, Size, View } from "white-web-sdk";
|
3
|
-
import type { AppManager } from "
|
4
|
-
export declare class MainViewProxy
|
2
|
+
import type { AppManager } from "../AppManager";
|
3
|
+
export declare class MainViewProxy {
|
4
|
+
private manager;
|
5
5
|
private scale?;
|
6
|
-
private cameraStore;
|
7
6
|
private started;
|
8
7
|
private mainViewIsAddListener;
|
9
8
|
private mainView;
|
10
|
-
private
|
9
|
+
private store;
|
11
10
|
private sideEffectManager;
|
12
11
|
constructor(manager: AppManager);
|
13
12
|
private get mainViewCamera();
|
@@ -26,6 +25,7 @@ export declare class MainViewProxy extends Base {
|
|
26
25
|
scale: number;
|
27
26
|
};
|
28
27
|
createMainView(): View;
|
28
|
+
onReconnect(): void;
|
29
29
|
private onCameraUpdatedByDevice;
|
30
30
|
addMainViewListener(): void;
|
31
31
|
removeMainViewListener(): void;
|
@@ -35,7 +35,6 @@ export declare class MainViewProxy extends Base {
|
|
35
35
|
private addCameraListener;
|
36
36
|
private removeCameraListener;
|
37
37
|
private onCameraOrSizeUpdated;
|
38
|
-
switchViewModeToWriter(): void;
|
39
38
|
moveCameraToContian(size: Size): void;
|
40
39
|
moveCamera(camera: Camera): void;
|
41
40
|
stop(): void;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import type { View, Displayer } from "white-web-sdk";
|
2
|
+
export declare class ViewManager {
|
3
|
+
private displayer;
|
4
|
+
views: Map<string, View>;
|
5
|
+
constructor(displayer: Displayer);
|
6
|
+
createView(id: string): View;
|
7
|
+
getView(id: string): View | undefined;
|
8
|
+
destroyView(id: string): void;
|
9
|
+
setViewScenePath(id: string, scenePath: string): void;
|
10
|
+
destroy(): void;
|
11
|
+
}
|
12
|
+
export declare const createView: (displayer: Displayer) => View;
|
13
|
+
export declare const setDefaultCameraBound: (view: View) => void;
|
package/dist/constants.d.ts
CHANGED
@@ -10,7 +10,8 @@ export declare enum Events {
|
|
10
10
|
SetMainViewScenePath = "SetMainViewScenePath",
|
11
11
|
SetMainViewSceneIndex = "SetMainViewSceneIndex",
|
12
12
|
SwitchViewsToFreedom = "SwitchViewsToFreedom",
|
13
|
-
MoveCameraToContain = "MoveCameraToContain"
|
13
|
+
MoveCameraToContain = "MoveCameraToContain",
|
14
|
+
CursorMove = "CursorMove"
|
14
15
|
}
|
15
16
|
export declare const MagixEventName = "__WindowManger";
|
16
17
|
export declare enum AppAttributes {
|
@@ -31,13 +32,8 @@ export declare enum CursorState {
|
|
31
32
|
Leave = "leave",
|
32
33
|
Normal = "normal"
|
33
34
|
}
|
34
|
-
export declare const REQUIRE_VERSION = "2.
|
35
|
+
export declare const REQUIRE_VERSION = "2.16.1";
|
35
36
|
export declare const MIN_WIDTH: number;
|
36
37
|
export declare const MIN_HEIGHT: number;
|
37
38
|
export declare const SET_SCENEPATH_DELAY = 100;
|
38
|
-
export declare const DEFAULT_COLLECTOR_STYLE: {
|
39
|
-
right: string;
|
40
|
-
bottom: string;
|
41
|
-
position: string;
|
42
|
-
};
|
43
39
|
export declare const DEFAULT_CONTAINER_RATIO: number;
|
package/dist/index.d.ts
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
import Emittery from "emittery";
|
2
2
|
import { AppManager } from "./AppManager";
|
3
3
|
import { CursorManager } from "./Cursor";
|
4
|
+
import { ReconnectRefresher } from "./ReconnectRefresher";
|
4
5
|
import "./style.css";
|
5
6
|
import "@netless/telebox-insider/dist/style.css";
|
6
7
|
import type { TELE_BOX_STATE } from "./BoxManager";
|
7
|
-
import type { Apps } from "./AttributesDelegate";
|
8
|
+
import type { Apps, Position } from "./AttributesDelegate";
|
8
9
|
import { InvisiblePlugin, ViewMode } from "white-web-sdk";
|
9
10
|
import type { Displayer, SceneDefinition, View, Room, InvisiblePluginContext, Camera, AnimationMode, CameraBound, Point, Rectangle, ViewVisionMode, CameraState } from "white-web-sdk";
|
10
11
|
import type { AppListeners } from "./AppListener";
|
@@ -64,6 +65,11 @@ export declare type AppInitState = {
|
|
64
65
|
boxState?: TeleBoxState;
|
65
66
|
zIndex?: number;
|
66
67
|
};
|
68
|
+
export declare type CursorMovePayload = {
|
69
|
+
uid: string;
|
70
|
+
state?: "leave";
|
71
|
+
position: Position;
|
72
|
+
};
|
67
73
|
export declare type EmitterEvent = {
|
68
74
|
onCreated: undefined;
|
69
75
|
InitReplay: AppInitState;
|
@@ -92,6 +98,8 @@ export declare type EmitterEvent = {
|
|
92
98
|
boxStateChange: string;
|
93
99
|
playgroundSizeChange: DOMRect;
|
94
100
|
onReconnected: void;
|
101
|
+
removeScenes: string;
|
102
|
+
cursorMove: CursorMovePayload;
|
95
103
|
};
|
96
104
|
export declare type EmitterType = Emittery<EmitterEvent>;
|
97
105
|
export declare const emitter: EmitterType;
|
@@ -101,6 +109,9 @@ export declare type PublicEvent = {
|
|
101
109
|
darkModeChange: boolean;
|
102
110
|
prefersColorSchemeChange: TeleBoxColorScheme;
|
103
111
|
cameraStateChange: CameraState;
|
112
|
+
mainViewScenePathChange: string;
|
113
|
+
mainViewSceneIndexChange: number;
|
114
|
+
focusedChange: string | undefined;
|
104
115
|
};
|
105
116
|
export declare type MountParams = {
|
106
117
|
room: Room;
|
@@ -119,6 +130,7 @@ export declare type MountParams = {
|
|
119
130
|
};
|
120
131
|
export declare type CallbacksType = Emittery<PublicEvent>;
|
121
132
|
export declare const callbacks: CallbacksType;
|
133
|
+
export declare const reconnectRefresher: ReconnectRefresher;
|
122
134
|
export declare class WindowManager extends InvisiblePlugin<WindowMangerAttributes> {
|
123
135
|
static kind: string;
|
124
136
|
static displayer: Displayer;
|
@@ -129,6 +141,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
129
141
|
static containerSizeRatio: number;
|
130
142
|
private static isCreated;
|
131
143
|
version: string;
|
144
|
+
dependencies: Record<string, string>;
|
132
145
|
appListeners?: AppListeners;
|
133
146
|
readonly?: boolean;
|
134
147
|
emitter: Emittery<PublicEvent>;
|
@@ -138,6 +151,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
138
151
|
isReplay: boolean;
|
139
152
|
private boxManager?;
|
140
153
|
private static params?;
|
154
|
+
private containerResizeObserver?;
|
141
155
|
constructor(context: InvisiblePluginContext);
|
142
156
|
static mount(params: MountParams): Promise<WindowManager>;
|
143
157
|
private static initManager;
|
@@ -164,7 +178,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
164
178
|
/**
|
165
179
|
* 返回 mainView 的 ScenePath
|
166
180
|
*/
|
167
|
-
getMainViewScenePath(): string;
|
181
|
+
getMainViewScenePath(): string | undefined;
|
168
182
|
/**
|
169
183
|
* 返回 mainView 的 SceneIndex
|
170
184
|
*/
|
@@ -185,6 +199,9 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
185
199
|
* 设置 ViewMode
|
186
200
|
*/
|
187
201
|
setViewMode(mode: ViewMode): void;
|
202
|
+
setBoxState(boxState: TeleBoxState): void;
|
203
|
+
setMaximized(maximized: boolean): void;
|
204
|
+
setMinimized(minimized: boolean): void;
|
188
205
|
get mainView(): View;
|
189
206
|
get camera(): Camera;
|
190
207
|
get cameraState(): CameraState;
|
@@ -192,6 +209,10 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
192
209
|
get boxState(): TeleBoxState | undefined;
|
193
210
|
get darkMode(): boolean;
|
194
211
|
get prefersColorScheme(): TeleBoxColorScheme | undefined;
|
212
|
+
get focused(): string | undefined;
|
213
|
+
get mainViewSceneIndex(): number;
|
214
|
+
get mainViewSceneDir(): string;
|
215
|
+
get topApp(): string | undefined;
|
195
216
|
/**
|
196
217
|
* 查询所有的 App
|
197
218
|
*/
|
@@ -224,13 +245,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
224
245
|
private isDynamicPPT;
|
225
246
|
private static checkVersion;
|
226
247
|
private ensureAttributes;
|
227
|
-
private
|
228
|
-
private observePlaygroundSize;
|
229
|
-
private updateSizer;
|
248
|
+
private _removeScenes;
|
230
249
|
}
|
231
|
-
export declare const BuiltinApps: {
|
232
|
-
DocsViewer: string;
|
233
|
-
MediaPlayer: string;
|
234
|
-
};
|
235
250
|
export * from "./typings";
|
236
|
-
export {
|
251
|
+
export { BuiltinApps } from "./BuiltinApps";
|