@netless/window-manager 0.2.15 → 0.2.19-canary.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/AppContext.d.ts +1 -1
- package/dist/AppListener.d.ts +1 -5
- package/dist/AppManager.d.ts +4 -3
- package/dist/AppProxy.d.ts +4 -2
- package/dist/AttributesDelegate.d.ts +18 -6
- package/dist/Base/index.d.ts +7 -0
- package/dist/BoxManager.d.ts +1 -0
- package/dist/Cursor/Cursor.d.ts +0 -1
- package/dist/Cursor/index.d.ts +10 -11
- package/dist/MainView.d.ts +12 -3
- package/dist/ViewManager.d.ts +4 -16
- package/dist/constants.d.ts +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/AppContext.ts +2 -2
- package/src/AppListener.ts +0 -4
- package/src/AppManager.ts +55 -42
- package/src/AppProxy.ts +33 -14
- package/src/AttributesDelegate.ts +21 -13
- package/src/Base/index.ts +7 -0
- package/src/BoxManager.ts +26 -19
- package/src/Cursor/Cursor.ts +0 -4
- package/src/Cursor/index.ts +66 -77
- package/src/MainView.ts +86 -18
- package/src/Utils/RoomHacker.ts +1 -1
- package/src/constants.ts +1 -1
- package/src/index.ts +18 -35
- package/src/sdk.ts +4 -0
- package/src/viewManager.ts +25 -109
package/dist/AppContext.d.ts
CHANGED
@@ -23,7 +23,7 @@ export declare class AppContext<TAttrs extends Record<string, any>, AppOptions =
|
|
23
23
|
unlistenDisposed: typeof unlistenDisposed;
|
24
24
|
};
|
25
25
|
private boxManager;
|
26
|
-
private
|
26
|
+
private store;
|
27
27
|
readonly isAddApp: boolean;
|
28
28
|
constructor(manager: AppManager, appId: string, appProxy: AppProxy, appOptions?: AppOptions | (() => AppOptions) | undefined);
|
29
29
|
getDisplayer(): import("white-web-sdk").Displayer<import("white-web-sdk").DisplayerCallbacks>;
|
package/dist/AppListener.d.ts
CHANGED
@@ -1,15 +1,11 @@
|
|
1
|
-
import type { ViewManager } from "./ViewManager";
|
2
1
|
import type { AppProxy } from "./AppProxy";
|
3
2
|
import type { AppManager } from "./AppManager";
|
4
|
-
import type { WindowManager } from "./index";
|
5
3
|
export declare class AppListeners {
|
6
4
|
private manager;
|
7
|
-
private windowManager;
|
8
|
-
private viewManager;
|
9
5
|
private appProxies;
|
10
6
|
private displayer;
|
11
7
|
private boxManager;
|
12
|
-
constructor(manager: AppManager,
|
8
|
+
constructor(manager: AppManager, appProxies: Map<string, AppProxy>);
|
13
9
|
addListeners(): void;
|
14
10
|
removeListeners(): void;
|
15
11
|
private mainMagixEventListener;
|
package/dist/AppManager.d.ts
CHANGED
@@ -17,7 +17,7 @@ export declare class AppManager {
|
|
17
17
|
viewManager: ViewManager;
|
18
18
|
appProxies: Map<string, AppProxy>;
|
19
19
|
appStatus: Map<string, AppStatus>;
|
20
|
-
|
20
|
+
store: AttributesDelegate;
|
21
21
|
mainViewProxy: MainViewProxy;
|
22
22
|
refresher?: ReconnectRefresher;
|
23
23
|
private appListeners;
|
@@ -31,6 +31,7 @@ export declare class AppManager {
|
|
31
31
|
*/
|
32
32
|
attributesUpdateCallback(apps: any): Promise<void>;
|
33
33
|
private onAppDelete;
|
34
|
+
bindMainView(divElement: HTMLDivElement, disableCameraTransform: boolean): void;
|
34
35
|
addApp(params: AddAppParams, isDynamicPPT: boolean): Promise<string | undefined>;
|
35
36
|
private beforeAddApp;
|
36
37
|
private afterAddApp;
|
@@ -46,9 +47,9 @@ export declare class AppManager {
|
|
46
47
|
get focusApp(): AppProxy | undefined;
|
47
48
|
safeSetAttributes(attributes: any): void;
|
48
49
|
safeUpdateAttributes(keys: string[], value: any): void;
|
49
|
-
setMainViewScenePath(scenePath: string): void
|
50
|
+
setMainViewScenePath(scenePath: string): Promise<void>;
|
50
51
|
private _setMainViewScenePath;
|
51
|
-
setMainViewSceneIndex(index: number): void
|
52
|
+
setMainViewSceneIndex(index: number): Promise<void>;
|
52
53
|
getAppInitPath(appId: string): string | undefined;
|
53
54
|
safeDispatchMagixEvent(event: string, payload: any): void;
|
54
55
|
private boxEventListener;
|
package/dist/AppProxy.d.ts
CHANGED
@@ -4,9 +4,9 @@ import type { SceneState, View, SceneDefinition } from "white-web-sdk";
|
|
4
4
|
import type { AppManager } from "./AppManager";
|
5
5
|
import type { NetlessApp } from "./typings";
|
6
6
|
import type { ReadonlyTeleBox } from "@netless/telebox-insider";
|
7
|
-
|
7
|
+
import { Base } from './Base';
|
8
|
+
export declare class AppProxy extends Base {
|
8
9
|
private params;
|
9
|
-
private manager;
|
10
10
|
id: string;
|
11
11
|
scenePath?: string;
|
12
12
|
appEmitter: Emittery<AppEmitterEvent>;
|
@@ -32,6 +32,8 @@ export declare class AppProxy {
|
|
32
32
|
get box(): ReadonlyTeleBox | undefined;
|
33
33
|
focusBox(): void;
|
34
34
|
private setupApp;
|
35
|
+
onSeek(time: number): void;
|
36
|
+
onReconnected(): Promise<void>;
|
35
37
|
switchToWritable(): void;
|
36
38
|
getAppInitState: (id: string) => AppInitState | undefined;
|
37
39
|
emitAppSceneStateChange(sceneState: SceneState): void;
|
@@ -2,6 +2,7 @@ import { AppAttributes } from "./constants";
|
|
2
2
|
import type { AddAppParams, AppSyncAttributes } from "./index";
|
3
3
|
import type { Camera, Size } from "white-web-sdk";
|
4
4
|
import type { AppManager } from "./AppManager";
|
5
|
+
import type { Cursor } from "./Cursor/Cursor";
|
5
6
|
export declare enum Fields {
|
6
7
|
Apps = "apps",
|
7
8
|
Focus = "focus",
|
@@ -29,14 +30,13 @@ export declare class AttributesDelegate {
|
|
29
30
|
private manager;
|
30
31
|
constructor(manager: AppManager);
|
31
32
|
apps(): Apps;
|
32
|
-
get focus():
|
33
|
+
get focus(): string | undefined;
|
33
34
|
getAppAttributes(id: string): AppSyncAttributes;
|
34
35
|
getAppState(id: string): any;
|
35
36
|
setupAppAttributes(params: AddAppParams, id: string, isDynamicPPT: boolean): void;
|
36
37
|
updateAppState(appId: string, stateName: AppAttributes, state: any): void;
|
37
38
|
cleanAppAttributes(id: string): void;
|
38
39
|
cleanFocus(): void;
|
39
|
-
cleanAttributes(): void;
|
40
40
|
getAppSceneIndex(id: string): any;
|
41
41
|
getAppScenePath(id: string): any;
|
42
42
|
getMainViewScenePath(): any;
|
@@ -44,10 +44,8 @@ export declare class AttributesDelegate {
|
|
44
44
|
getBoxState(): import("@netless/telebox-insider").TELE_BOX_STATE;
|
45
45
|
setMainViewScenePath(scenePath: string): void;
|
46
46
|
setMainViewSceneIndex(index: number): void;
|
47
|
-
getMainViewCamera():
|
48
|
-
getMainViewSize():
|
49
|
-
id: number;
|
50
|
-
} | undefined;
|
47
|
+
getMainViewCamera(): MainViewCamera;
|
48
|
+
getMainViewSize(): MainViewSize;
|
51
49
|
setMainViewCamera(camera: Camera & {
|
52
50
|
id: number;
|
53
51
|
} | undefined): void;
|
@@ -61,3 +59,17 @@ export declare class AttributesDelegate {
|
|
61
59
|
cleanCursor(observerId: string): void;
|
62
60
|
setMainViewFocusPath(): void;
|
63
61
|
}
|
62
|
+
export declare type MainViewSize = {
|
63
|
+
id: number;
|
64
|
+
width: number;
|
65
|
+
height: number;
|
66
|
+
};
|
67
|
+
export declare type MainViewCamera = {
|
68
|
+
id: number;
|
69
|
+
centerX: number;
|
70
|
+
centerY: number;
|
71
|
+
scale: number;
|
72
|
+
};
|
73
|
+
export declare type Cursors = {
|
74
|
+
[key: number]: Cursor;
|
75
|
+
};
|
package/dist/BoxManager.d.ts
CHANGED
@@ -44,6 +44,7 @@ export declare class BoxManager {
|
|
44
44
|
private appProxies;
|
45
45
|
teleBoxManager: TeleBoxManager;
|
46
46
|
appBoxMap: Map<string, string>;
|
47
|
+
private store;
|
47
48
|
constructor(manager: AppManager, mainView: View, appProxies: Map<string, AppProxy>, collectorConfig?: CreateCollectorConfig);
|
48
49
|
get boxState(): string;
|
49
50
|
createBox(params: CreateBoxParams): void;
|
package/dist/Cursor/Cursor.d.ts
CHANGED
@@ -30,7 +30,6 @@ export declare class Cursor {
|
|
30
30
|
private get memberOpacity();
|
31
31
|
get cursorState(): CursorState | undefined;
|
32
32
|
get cursorPosition(): Position | undefined;
|
33
|
-
getFocusBox(): import("@netless/telebox-insider/dist/TeleBox").ReadonlyTeleBox | undefined;
|
34
33
|
private autoHidden;
|
35
34
|
private createCursor;
|
36
35
|
private initProps;
|
package/dist/Cursor/index.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
import { Cursor } from
|
2
|
-
import { WindowManager } from
|
3
|
-
import type { PositionType } from
|
4
|
-
import type { RoomMember } from "white-web-sdk";
|
1
|
+
import { Cursor } from "./Cursor";
|
2
|
+
import { WindowManager } from "../index";
|
3
|
+
import type { PositionType } from "../AttributesDelegate";
|
4
|
+
import type { RoomMember, View } from "white-web-sdk";
|
5
5
|
import type { AppManager } from "../AppManager";
|
6
6
|
export declare type EventType = {
|
7
7
|
type: PositionType;
|
@@ -16,7 +16,7 @@ export declare class CursorManager {
|
|
16
16
|
cursorInstances: Map<string, Cursor>;
|
17
17
|
roomMembers?: readonly RoomMember[];
|
18
18
|
private mainViewElement?;
|
19
|
-
private
|
19
|
+
private store;
|
20
20
|
constructor(manager: WindowManager, appManager: AppManager);
|
21
21
|
setMainViewDivElement(div: HTMLDivElement): void;
|
22
22
|
private startReaction;
|
@@ -24,17 +24,16 @@ export declare class CursorManager {
|
|
24
24
|
private get observerId();
|
25
25
|
get cursors(): any;
|
26
26
|
get boxState(): import("@netless/telebox-insider").TELE_BOX_STATE;
|
27
|
-
get
|
28
|
-
|
27
|
+
get focusView(): View | undefined;
|
28
|
+
private mouseMoveListener;
|
29
|
+
private touchMoveListener;
|
30
|
+
private updateCursor;
|
31
|
+
private getPoint;
|
29
32
|
/**
|
30
33
|
* 因为窗口内框在不同分辨率下的大小不一样,所以这里通过来鼠标事件的 target 来判断是在主白板还是在 APP 中
|
31
34
|
*/
|
32
35
|
private getType;
|
33
|
-
private mouseMoveListener;
|
34
|
-
private touchMoveListener;
|
35
36
|
private initCursorAttributes;
|
36
|
-
getFocusBox(): import("@netless/telebox-insider/dist/TeleBox").ReadonlyTeleBox | undefined;
|
37
|
-
private updateCursor;
|
38
37
|
private setNormalCursorState;
|
39
38
|
private mouseLeaveListener;
|
40
39
|
updateContainerRect(): void;
|
package/dist/MainView.d.ts
CHANGED
@@ -3,20 +3,29 @@ import type { AppManager } from "./AppManager";
|
|
3
3
|
export declare class MainViewProxy {
|
4
4
|
private manager;
|
5
5
|
private scale?;
|
6
|
-
private
|
6
|
+
private store;
|
7
7
|
private started;
|
8
|
-
private
|
8
|
+
private mainViewIsAddListener;
|
9
|
+
private mainView;
|
9
10
|
constructor(manager: AppManager);
|
11
|
+
start(): void;
|
12
|
+
private get observerId();
|
10
13
|
private cameraReaction;
|
11
14
|
private sizeReaction;
|
12
15
|
get view(): View;
|
16
|
+
createMainView(): View;
|
13
17
|
private cameraListener;
|
18
|
+
addMainViewListener(): void;
|
19
|
+
removeMainViewListener(): void;
|
20
|
+
private mainViewClickListener;
|
21
|
+
mainViewClickHandler(): Promise<void>;
|
14
22
|
private sizeListener;
|
15
23
|
setMainViewSize: import("lodash").DebouncedFunc<(size: any) => void>;
|
16
24
|
private addCameraListener;
|
17
25
|
private removeCameraListener;
|
26
|
+
private mainViewCameraListener;
|
27
|
+
switchViewModeToWriter(): void;
|
18
28
|
moveCameraToContian(size: Size): void;
|
19
29
|
moveCamera(camera: Camera): void;
|
20
|
-
start(): void;
|
21
30
|
stop(): void;
|
22
31
|
}
|
package/dist/ViewManager.d.ts
CHANGED
@@ -1,32 +1,20 @@
|
|
1
|
+
import { Base } from './Base';
|
1
2
|
import type { Displayer, View } from "white-web-sdk";
|
2
3
|
import type { AppManager } from "./AppManager";
|
3
4
|
import type { CameraStore } from "./Utils/CameraStore";
|
4
|
-
export declare class ViewManager {
|
5
|
+
export declare class ViewManager extends Base {
|
5
6
|
private displayer;
|
6
|
-
private manager;
|
7
7
|
private cameraStore;
|
8
|
-
mainView: View;
|
9
8
|
private views;
|
10
|
-
private mainViewIsAddListener;
|
11
|
-
private delegate;
|
12
9
|
private timer?;
|
10
|
+
private mainViewProxy;
|
13
11
|
constructor(displayer: Displayer, manager: AppManager, cameraStore: CameraStore);
|
14
12
|
get currentScenePath(): string;
|
15
|
-
|
16
|
-
setMainViewSize: import("lodash").DebouncedFunc<(size: any) => void>;
|
13
|
+
get mainView(): View;
|
17
14
|
createView(appId: string): View;
|
18
15
|
destroyView(appId: string): void;
|
19
16
|
private releaseView;
|
20
17
|
getView(appId: string): View | undefined;
|
21
|
-
private addMainViewCameraListener;
|
22
|
-
private removeMainViewCameraListener;
|
23
|
-
switchMainViewToFreedom(): void;
|
24
|
-
switchMainViewModeToWriter(): void;
|
25
|
-
addMainViewListener(): void;
|
26
|
-
removeMainViewListener(): void;
|
27
|
-
private mainViewClickListener;
|
28
|
-
mainViewClickHandler(): Promise<void>;
|
29
|
-
private mainViewCameraListener;
|
30
18
|
switchMainViewToWriter(): Promise<boolean> | undefined;
|
31
19
|
refreshViews(): void;
|
32
20
|
setMainViewFocusScenePath(): void;
|
package/dist/constants.d.ts
CHANGED
@@ -35,7 +35,7 @@ export declare enum CursorState {
|
|
35
35
|
export declare const REQUIRE_VERSION = "2.13.16";
|
36
36
|
export declare const MIN_WIDTH: number;
|
37
37
|
export declare const MIN_HEIGHT: number;
|
38
|
-
export declare const SET_SCENEPATH_DELAY =
|
38
|
+
export declare const SET_SCENEPATH_DELAY = 100;
|
39
39
|
export declare const DEFAULT_COLLECTOR_STYLE: {
|
40
40
|
right: string;
|
41
41
|
bottom: string;
|
package/dist/index.d.ts
CHANGED
@@ -4,8 +4,8 @@ import { CursorManager } from './Cursor';
|
|
4
4
|
import './style.css';
|
5
5
|
import '@netless/telebox-insider/dist/style.css';
|
6
6
|
import type { Apps } from "./AttributesDelegate";
|
7
|
-
import { InvisiblePlugin, ViewMode
|
8
|
-
import type { Displayer, SceneDefinition, View, Room, InvisiblePluginContext, Camera, AnimationMode, CameraBound, Point, Rectangle } from "white-web-sdk";
|
7
|
+
import { InvisiblePlugin, ViewMode } from "white-web-sdk";
|
8
|
+
import type { Displayer, SceneDefinition, View, Room, InvisiblePluginContext, Camera, AnimationMode, CameraBound, Point, Rectangle, ViewVisionMode } from "white-web-sdk";
|
9
9
|
import type { AppListeners } from "./AppListener";
|
10
10
|
import type { NetlessApp, RegisterParams } from "./typings";
|
11
11
|
import type { TELE_BOX_STATE } from "./BoxManager";
|
@@ -120,6 +120,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
120
120
|
static debug: boolean;
|
121
121
|
static containerSizeRatio: number;
|
122
122
|
private static isCreated;
|
123
|
+
version: string;
|
123
124
|
appListeners?: AppListeners;
|
124
125
|
readonly?: boolean;
|
125
126
|
emitter: Emittery<PublicEvent>;
|
@@ -152,11 +153,11 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
152
153
|
/**
|
153
154
|
* 设置 mainView 的 ScenePath, 并且切换白板为可写状态
|
154
155
|
*/
|
155
|
-
setMainViewScenePath(scenePath: string): void
|
156
|
+
setMainViewScenePath(scenePath: string): Promise<void>;
|
156
157
|
/**
|
157
158
|
* 设置 mainView 的 SceneIndex, 并且切换白板为可写状态
|
158
159
|
*/
|
159
|
-
setMainViewSceneIndex(index: number): void
|
160
|
+
setMainViewSceneIndex(index: number): Promise<void>;
|
160
161
|
/**
|
161
162
|
* 返回 mainView 的 ScenePath
|
162
163
|
*/
|
@@ -213,7 +214,6 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
213
214
|
get room(): Room;
|
214
215
|
safeSetAttributes(attributes: any): void;
|
215
216
|
safeUpdateAttributes(keys: string[], value: any): void;
|
216
|
-
private safeDispatchMagixEvent;
|
217
217
|
private isDynamicPPT;
|
218
218
|
private static checkVersion;
|
219
219
|
private ensureAttributes;
|