@netless/window-manager 1.0.0-canary.15 → 1.0.0-canary.18
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/App/AppContext.d.ts +2 -4
- package/dist/App/AppProxy.d.ts +1 -1
- package/dist/App/WhiteboardView.d.ts +1 -3
- package/dist/BoxManager.d.ts +1 -0
- package/dist/View/MainView.d.ts +13 -6
- package/dist/View/ViewSync.d.ts +24 -0
- package/dist/index.cjs.js +10 -10
- package/dist/index.d.ts +7 -0
- package/dist/index.es.js +216 -128
- package/dist/index.umd.js +12 -12
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/pnpm-lock.yaml +4 -4
- package/src/App/AppContext.ts +3 -10
- package/src/App/AppProxy.ts +28 -16
- package/src/App/WhiteboardView.ts +0 -7
- package/src/AppManager.ts +1 -1
- package/src/BoxManager.ts +4 -0
- package/src/ReconnectRefresher.ts +1 -1
- package/src/Utils/RoomHacker.ts +3 -0
- package/src/View/CameraSynchronizer.ts +7 -5
- package/src/View/MainView.ts +95 -53
- package/src/View/ViewSync.ts +119 -0
- package/src/index.ts +28 -5
- package/src/style.css +0 -1
- package/dist/App/AppViewSync.d.ts +0 -11
- package/src/App/AppViewSync.ts +0 -73
package/dist/App/AppContext.d.ts
CHANGED
@@ -3,7 +3,6 @@ import { autorun, listenDisposed, listenUpdated, reaction, unlistenDisposed, unl
|
|
3
3
|
import type { Room, SceneDefinition, View } from "white-web-sdk";
|
4
4
|
import type { ReadonlyTeleBox } from "@netless/telebox-insider";
|
5
5
|
import type Emittery from "emittery";
|
6
|
-
import type { BoxManager } from "../BoxManager";
|
7
6
|
import type { AppEmitterEvent, Member } from "../index";
|
8
7
|
import type { AppManager } from "../AppManager";
|
9
8
|
import type { AppProxy } from "./AppProxy";
|
@@ -11,7 +10,6 @@ import type { MagixEventAddListener, MagixEventDispatcher, MagixEventRemoveListe
|
|
11
10
|
import { WhiteBoardView } from "./WhiteboardView";
|
12
11
|
export declare class AppContext<TAttributes = any, TMagixEventPayloads = any, TAppOptions = any> {
|
13
12
|
private manager;
|
14
|
-
private boxManager;
|
15
13
|
appId: string;
|
16
14
|
private appProxy;
|
17
15
|
private appOptions?;
|
@@ -30,9 +28,9 @@ export declare class AppContext<TAttributes = any, TMagixEventPayloads = any, TA
|
|
30
28
|
private store;
|
31
29
|
readonly isAddApp: boolean;
|
32
30
|
readonly isReplay: boolean;
|
33
|
-
|
31
|
+
whiteBoardView?: WhiteBoardView;
|
34
32
|
_viewWrapper?: HTMLElement;
|
35
|
-
constructor(manager: AppManager,
|
33
|
+
constructor(manager: AppManager, appId: string, appProxy: AppProxy, appOptions?: TAppOptions | (() => TAppOptions) | undefined);
|
36
34
|
get displayer(): import("white-web-sdk").Displayer<import("white-web-sdk").DisplayerCallbacks>;
|
37
35
|
get destroyed(): boolean;
|
38
36
|
/** @deprecated Use context.storage.state instead. */
|
package/dist/App/AppProxy.d.ts
CHANGED
@@ -35,7 +35,7 @@ export declare class AppProxy implements PageRemoveService {
|
|
35
35
|
sideEffectManager: SideEffectManager;
|
36
36
|
private valManager;
|
37
37
|
private fullPath$;
|
38
|
-
private
|
38
|
+
private viewSync?;
|
39
39
|
camera$: Val<ICamera | undefined, any>;
|
40
40
|
size$: Val<ISize | undefined, any>;
|
41
41
|
box$: Val<ReadonlyTeleBox | undefined, any>;
|
@@ -9,11 +9,10 @@ export declare class WhiteBoardView implements PageController {
|
|
9
9
|
view: View;
|
10
10
|
protected appContext: AppContext;
|
11
11
|
protected appProxy: AppProxy;
|
12
|
-
private removeViewWrapper;
|
13
12
|
ensureSize: (size: number) => void;
|
14
13
|
readonly pageState$: ReadonlyVal<PageState>;
|
15
14
|
readonly camera$: ReadonlyVal<WhiteBoardViewCamera>;
|
16
|
-
constructor(view: View, appContext: AppContext, appProxy: AppProxy,
|
15
|
+
constructor(view: View, appContext: AppContext, appProxy: AppProxy, ensureSize: (size: number) => void);
|
17
16
|
get pageState(): PageState;
|
18
17
|
moveCamera(camera: Partial<WhiteBoardViewCamera>): void;
|
19
18
|
nextPage: () => Promise<boolean>;
|
@@ -22,5 +21,4 @@ export declare class WhiteBoardView implements PageController {
|
|
22
21
|
addPage: (params?: AddPageParams | undefined) => Promise<void>;
|
23
22
|
removePage: (index?: number | undefined) => Promise<boolean>;
|
24
23
|
setRect(rect: Omit<TeleBoxRect, "x" | "y">): void;
|
25
|
-
destroy(): void;
|
26
24
|
}
|
package/dist/BoxManager.d.ts
CHANGED
@@ -71,6 +71,7 @@ export declare class BoxManager {
|
|
71
71
|
get prefersColorScheme(): TeleBoxColorScheme;
|
72
72
|
get boxSize(): number;
|
73
73
|
get stageRect(): TeleBoxRect;
|
74
|
+
get stageRect$(): import("value-enhancer").ReadonlyVal<TeleBoxRect, any>;
|
74
75
|
createBox(params: CreateBoxParams): ReadonlyTeleBox | undefined;
|
75
76
|
setupBoxManager(createTeleBoxManagerConfig?: CreateTeleBoxManagerConfig): TeleBoxManager;
|
76
77
|
getBox(appId: string): ReadonlyTeleBox | undefined;
|
package/dist/View/MainView.d.ts
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
import { Val } from "value-enhancer";
|
2
|
+
import { ViewSync } from "./ViewSync";
|
3
|
+
import type { ICamera, ISize } from "../AttributesDelegate";
|
1
4
|
import type { Size, View } from "white-web-sdk";
|
2
5
|
import type { AppManager } from "../AppManager";
|
3
6
|
export declare class MainViewProxy {
|
@@ -6,20 +9,26 @@ export declare class MainViewProxy {
|
|
6
9
|
private mainViewIsAddListener;
|
7
10
|
private mainView;
|
8
11
|
private store;
|
9
|
-
private synchronizer;
|
10
12
|
private sideEffectManager;
|
13
|
+
camera$: Val<ICamera | undefined, any>;
|
14
|
+
size$: Val<ISize | undefined, any>;
|
15
|
+
view$: Val<View | undefined, any>;
|
16
|
+
viewSync?: ViewSync;
|
11
17
|
constructor(manager: AppManager);
|
18
|
+
createViewSync: () => void;
|
12
19
|
private startListenWritableChange;
|
13
20
|
ensureCameraAndSize(): void;
|
14
21
|
private get mainViewCamera();
|
15
22
|
private get mainViewSize();
|
16
23
|
private get didRelease();
|
17
|
-
private moveCameraSizeByAttributes;
|
18
24
|
start(): void;
|
19
25
|
addCameraReaction: () => void;
|
20
|
-
|
26
|
+
storeCurrentCamera: () => void;
|
27
|
+
storeCurrentSize: () => void;
|
28
|
+
storeCamera: (camera: ICamera) => void;
|
29
|
+
storeSize: (size: ISize) => void;
|
21
30
|
private cameraReaction;
|
22
|
-
|
31
|
+
private sizeReaction;
|
23
32
|
get view(): View;
|
24
33
|
get cameraState(): {
|
25
34
|
width: number;
|
@@ -32,8 +41,6 @@ export declare class MainViewProxy {
|
|
32
41
|
onReconnect(): void;
|
33
42
|
setFocusScenePath(path: string | undefined): View | undefined;
|
34
43
|
rebind(): void;
|
35
|
-
private onCameraUpdatedByDevice;
|
36
|
-
private getStageSize;
|
37
44
|
addMainViewListener(): void;
|
38
45
|
removeMainViewListener(): void;
|
39
46
|
private mainViewClickListener;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { ViewMode } from "white-web-sdk";
|
2
|
+
import type { View } from "white-web-sdk";
|
3
|
+
import type { Val, ReadonlyVal } from "value-enhancer";
|
4
|
+
import type { ICamera, ISize } from "../AttributesDelegate";
|
5
|
+
import type { TeleBoxRect } from "@netless/telebox-insider";
|
6
|
+
export declare type ViewSyncContext = {
|
7
|
+
uid: string;
|
8
|
+
camera$: Val<ICamera | undefined, boolean>;
|
9
|
+
size$: Val<ISize | undefined>;
|
10
|
+
stageRect$: ReadonlyVal<TeleBoxRect>;
|
11
|
+
viewMode$?: Val<ViewMode>;
|
12
|
+
storeCamera: (camera: ICamera) => void;
|
13
|
+
storeSize: (size: ISize) => void;
|
14
|
+
view$: Val<View | undefined>;
|
15
|
+
};
|
16
|
+
export declare class ViewSync {
|
17
|
+
private context;
|
18
|
+
private sem;
|
19
|
+
private synchronizer;
|
20
|
+
constructor(context: ViewSyncContext);
|
21
|
+
bindView: (view?: View | undefined) => void;
|
22
|
+
private onCameraUpdatedByDevice;
|
23
|
+
destroy(): void;
|
24
|
+
}
|