@netless/window-manager 1.0.0-canary.18 → 1.0.0-canary.19
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/AppProxy.d.ts +8 -3
- package/dist/App/WhiteboardView.d.ts +3 -2
- package/dist/AttributesDelegate.d.ts +5 -2
- package/dist/View/CameraSynchronizer.d.ts +6 -6
- package/dist/View/MainView.d.ts +6 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +16 -14
- package/dist/index.umd.js +2 -2
- package/docs/mirgrate-to-1.0.md +28 -0
- package/package.json +1 -1
- package/src/App/AppContext.ts +1 -1
- package/src/App/AppProxy.ts +4 -4
- package/src/App/WhiteboardView.ts +3 -2
- package/src/AttributesDelegate.ts +5 -2
- package/src/View/CameraSynchronizer.ts +14 -9
- package/src/View/ViewSync.ts +4 -8
- package/src/index.ts +2 -0
package/dist/index.d.ts
CHANGED
@@ -81,6 +81,8 @@ export declare type MountParams = {
|
|
81
81
|
container?: HTMLElement;
|
82
82
|
/** 白板高宽比例, 默认为 9 / 16 */
|
83
83
|
containerSizeRatio?: number;
|
84
|
+
/** @deprecated */
|
85
|
+
chessboard?: boolean;
|
84
86
|
/** 是否高亮显示同步区域, 默认为 true */
|
85
87
|
highlightStage?: boolean;
|
86
88
|
collectorContainer?: HTMLElement;
|
package/dist/index.es.js
CHANGED
@@ -1070,7 +1070,7 @@ class AppContext {
|
|
1070
1070
|
(_a = this.room) == null ? void 0 : _a.putScenes(this.appProxy.scenePath, scenes);
|
1071
1071
|
};
|
1072
1072
|
this.getInitScenePath = () => {
|
1073
|
-
return this.
|
1073
|
+
return this.appProxy.scenePath;
|
1074
1074
|
};
|
1075
1075
|
this.setAttributes = (attributes) => {
|
1076
1076
|
this.manager.safeSetAttributes({ [this.appId]: attributes });
|
@@ -1228,12 +1228,17 @@ class CameraSynchronizer {
|
|
1228
1228
|
const nextScale = camera.scale * scale2;
|
1229
1229
|
const moveCamera = () => {
|
1230
1230
|
var _a;
|
1231
|
-
|
1232
|
-
centerX: camera.centerX,
|
1233
|
-
centerY: camera.centerY,
|
1231
|
+
const config = {
|
1234
1232
|
scale: nextScale,
|
1235
1233
|
animationMode: AnimationMode.Immediately
|
1236
|
-
}
|
1234
|
+
};
|
1235
|
+
if (camera.centerX !== null) {
|
1236
|
+
config.centerX = camera.centerX;
|
1237
|
+
}
|
1238
|
+
if (camera.centerY !== null) {
|
1239
|
+
config.centerY = camera.centerY;
|
1240
|
+
}
|
1241
|
+
(_a = this.view) == null ? void 0 : _a.moveCamera(config);
|
1237
1242
|
};
|
1238
1243
|
moveCamera();
|
1239
1244
|
delay(moveCamera, 50);
|
@@ -1280,7 +1285,7 @@ class ViewSync {
|
|
1280
1285
|
}, "view");
|
1281
1286
|
};
|
1282
1287
|
this.onCameraUpdatedByDevice = (camera) => {
|
1283
|
-
this.synchronizer.onLocalCameraUpdate(camera);
|
1288
|
+
this.synchronizer.onLocalCameraUpdate(Object.assign(camera, { id: this.context.uid }));
|
1284
1289
|
const stage = this.context.stageRect$.value;
|
1285
1290
|
if (stage) {
|
1286
1291
|
const size2 = { width: stage.width, height: stage.height, id: this.context.uid };
|
@@ -1290,15 +1295,12 @@ class ViewSync {
|
|
1290
1295
|
}
|
1291
1296
|
};
|
1292
1297
|
this.synchronizer = new CameraSynchronizer((camera) => {
|
1293
|
-
|
1294
|
-
id: this.context.uid
|
1295
|
-
}, camera);
|
1296
|
-
this.context.camera$.setValue(iCamera, true);
|
1298
|
+
this.context.camera$.setValue(camera, true);
|
1297
1299
|
const notStoreCamera = this.context.viewMode$ && this.context.viewMode$.value === ViewMode.Freedom;
|
1298
1300
|
if (notStoreCamera) {
|
1299
1301
|
return;
|
1300
1302
|
} else {
|
1301
|
-
this.context.storeCamera(
|
1303
|
+
this.context.storeCamera(camera);
|
1302
1304
|
}
|
1303
1305
|
});
|
1304
1306
|
this.bindView(this.context.view$.value);
|
@@ -1742,8 +1744,8 @@ class AppProxy {
|
|
1742
1744
|
if (box && view) {
|
1743
1745
|
if (!this.camera$.value) {
|
1744
1746
|
this.storeCamera({
|
1745
|
-
centerX:
|
1746
|
-
centerY:
|
1747
|
+
centerX: null,
|
1748
|
+
centerY: null,
|
1747
1749
|
scale: 1,
|
1748
1750
|
id: this.uid
|
1749
1751
|
});
|
@@ -15619,7 +15621,7 @@ const reconnectRefresher = new ReconnectRefresher({ emitter });
|
|
15619
15621
|
const _WindowManager = class extends InvisiblePlugin {
|
15620
15622
|
constructor(context) {
|
15621
15623
|
super(context);
|
15622
|
-
this.version = "1.0.0-canary.
|
15624
|
+
this.version = "1.0.0-canary.19";
|
15623
15625
|
this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "1.0.0-alpha.18", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "side-effect-manager": "^1.1.0", "uuid": "^7.0.3", "value-enhancer": "^1.3.0", "video.js": ">=7" }, "peerDependencies": { "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "^0.2.9", "@netless/app-media-player": "0.1.0-beta.5", "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-node-resolve": "^13.0.4", "@rollup/plugin-url": "^6.1.0", "@sveltejs/vite-plugin-svelte": "^1.0.0-next.22", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.4", "@types/uuid": "^8.3.1", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.1", "cypress": "^8.7.0", "dotenv": "^10.0.0", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-svelte3": "^3.2.0", "jsdom": "^19.0.0", "less": "^4.1.1", "prettier": "^2.3.2", "prettier-plugin-svelte": "^2.4.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-styles": "^3.14.1", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^2.5.3", "vitest": "^0.14.1", "white-web-sdk": "2.16.10" } };
|
15624
15626
|
this.emitter = callbacks$1;
|
15625
15627
|
this.viewMode = ViewMode.Broadcaster;
|