@netless/window-manager 1.0.0-canary.28 → 1.0.0-canary.30
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/index.cjs.js +49 -22
- package/dist/index.es.js +42 -27
- package/dist/index.umd.js +49 -22
- package/dist/src/App/AppProxy.d.ts +1 -0
- package/dist/src/AppManager.d.ts +2 -1
- package/dist/src/Helper.d.ts +1 -7
- package/dist/src/InternalEmitter.d.ts +0 -2
- package/dist/src/View/CameraSynchronizer.d.ts +1 -0
- package/dist/src/constants.d.ts +2 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/pnpm-lock.yaml +4 -4
- package/src/App/AppContext.ts +2 -2
- package/src/App/AppProxy.ts +11 -6
- package/src/AppListener.ts +4 -0
- package/src/AppManager.ts +16 -11
- package/src/AttributesDelegate.ts +1 -1
- package/src/Helper.ts +2 -2
- package/src/InternalEmitter.ts +0 -2
- package/src/View/CameraSynchronizer.ts +6 -3
- package/src/View/ViewSync.ts +1 -1
- package/src/constants.ts +1 -0
- package/src/index.ts +2 -0
package/src/Helper.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { getVersionNumber, wait } from "./Utils/Common";
|
2
2
|
import { log } from "./Utils/log";
|
3
3
|
import { REQUIRE_VERSION } from "./constants";
|
4
|
-
import { WhiteVersion } from "white-web-sdk";
|
4
|
+
import { toJS, WhiteVersion } from "white-web-sdk";
|
5
5
|
import { WhiteWebSDKInvalidError } from "./Utils/error";
|
6
6
|
import { WindowManager } from "./index";
|
7
7
|
import type { Room, RoomMember } from "white-web-sdk";
|
@@ -41,7 +41,7 @@ export type Member = RoomMember & { uid: string };
|
|
41
41
|
export const serializeRoomMembers = (members: readonly RoomMember[]) => {
|
42
42
|
return members.map(member => ({
|
43
43
|
uid: member.payload?.uid || "",
|
44
|
-
...member,
|
44
|
+
...toJS(member),
|
45
45
|
}));
|
46
46
|
};
|
47
47
|
|
package/src/InternalEmitter.ts
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
import Emittery from "emittery";
|
2
2
|
import type { TeleBoxRect } from "@netless/telebox-insider";
|
3
3
|
import type { CursorMovePayload } from "./index";
|
4
|
-
import type { Member } from "./Helper";
|
5
4
|
import type { MemberState } from "white-web-sdk";
|
6
5
|
|
7
6
|
export type RemoveSceneParams = {
|
@@ -30,7 +29,6 @@ export type EmitterEvent = {
|
|
30
29
|
changePageState: undefined;
|
31
30
|
writableChange: boolean;
|
32
31
|
containerSizeRatioUpdate: number;
|
33
|
-
roomMembersChange: Member[];
|
34
32
|
memberStateChange: MemberState;
|
35
33
|
};
|
36
34
|
|
@@ -43,7 +43,7 @@ export class CameraSynchronizer {
|
|
43
43
|
if (camera.centerY !== null) {
|
44
44
|
config.centerY = camera.centerY;
|
45
45
|
}
|
46
|
-
this.
|
46
|
+
this.moveCamera(config);
|
47
47
|
}
|
48
48
|
}, 10);
|
49
49
|
|
@@ -53,9 +53,8 @@ export class CameraSynchronizer {
|
|
53
53
|
if (this.rect && this.remoteCamera && needMoveCamera) {
|
54
54
|
const scale = this.rect.width / size.width;
|
55
55
|
const nextScale = this.remoteCamera.scale * scale;
|
56
|
-
this.
|
56
|
+
this.moveCamera({
|
57
57
|
scale: nextScale,
|
58
|
-
animationMode: AnimationMode.Continuous,
|
59
58
|
})
|
60
59
|
}
|
61
60
|
}
|
@@ -64,4 +63,8 @@ export class CameraSynchronizer {
|
|
64
63
|
this.saveCamera(camera);
|
65
64
|
this.remoteCamera = camera;
|
66
65
|
}
|
66
|
+
|
67
|
+
private moveCamera(camera: Partial<Camera>) {
|
68
|
+
this.view?.moveCamera({ ...camera, animationMode: AnimationMode.Continuous });
|
69
|
+
}
|
67
70
|
}
|
package/src/View/ViewSync.ts
CHANGED
package/src/constants.ts
CHANGED
package/src/index.ts
CHANGED
@@ -105,6 +105,7 @@ export type AppSyncAttributes = {
|
|
105
105
|
createdAt?: number;
|
106
106
|
camera?: ICamera;
|
107
107
|
size?: ISize;
|
108
|
+
setup: boolean;
|
108
109
|
};
|
109
110
|
|
110
111
|
export type AppInitState = {
|
@@ -1007,3 +1008,4 @@ export * from "./typings";
|
|
1007
1008
|
|
1008
1009
|
export { BuiltinApps, BuiltinAppsMap } from "./BuiltinApps";
|
1009
1010
|
export type { PublicEvent } from "./callback";
|
1011
|
+
export type { Member } from "./Helper";
|