@netless/window-manager 1.0.0-canary.14 → 1.0.0-canary.15
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 +2 -1
- package/dist/App/WhiteboardView.d.ts +3 -2
- package/dist/index.cjs.js +8 -8
- package/dist/index.es.js +20 -12
- package/dist/index.umd.js +7 -7
- package/package.json +2 -2
- package/pnpm-lock.yaml +4 -4
- package/src/App/AppContext.ts +6 -0
- package/src/App/AppProxy.ts +3 -2
- package/src/App/WhiteboardView.ts +21 -12
package/dist/index.es.js
CHANGED
@@ -19,7 +19,7 @@ var __spreadValues = (a2, b2) => {
|
|
19
19
|
var __spreadProps = (a2, b2) => __defProps(a2, __getOwnPropDescs(b2));
|
20
20
|
import pRetry from "p-retry";
|
21
21
|
import Emittery from "emittery";
|
22
|
-
import { debounce, isEqual, omit, isObject, has, get, size as size$1, mapValues, noop as noop$1, isNumber, throttle, delay,
|
22
|
+
import { debounce, isEqual, omit, isObject, has, get, size as size$1, mapValues, noop as noop$1, pick, isNumber, throttle, delay, isInteger, orderBy, isEmpty, isFunction, isNull } from "lodash";
|
23
23
|
import { ScenePathType, UpdateEventKind, listenUpdated, unlistenUpdated, reaction, WhiteVersion, autorun, toJS, listenDisposed, unlistenDisposed, AnimationMode, isPlayer, isRoom, ApplianceNames, RoomPhase, InvisiblePlugin, ViewMode } from "white-web-sdk";
|
24
24
|
import { v4 } from "uuid";
|
25
25
|
import { genUID, SideEffectManager } from "side-effect-manager";
|
@@ -947,16 +947,16 @@ class WhiteBoardView {
|
|
947
947
|
};
|
948
948
|
const pageState$ = new Val(appProxy.pageState);
|
949
949
|
this.pageState$ = pageState$;
|
950
|
-
appProxy.appEmitter.on("pageStateChange", (pageState) => {
|
950
|
+
this.appProxy.sideEffectManager.add(() => appProxy.appEmitter.on("pageStateChange", (pageState) => {
|
951
951
|
pageState$.setValue(pageState);
|
952
|
-
});
|
953
|
-
const camera$ = new Val(this.view.camera);
|
952
|
+
}));
|
953
|
+
const camera$ = new Val(pick(this.view.camera, ["centerX", "centerY"]));
|
954
954
|
this.camera$ = camera$;
|
955
|
-
appProxy.camera$.subscribe((camera) => {
|
955
|
+
this.appProxy.sideEffectManager.add(() => appProxy.camera$.subscribe((camera) => {
|
956
956
|
if (camera) {
|
957
|
-
camera$.setValue(camera,
|
957
|
+
camera$.setValue(pick(camera, ["centerX", "centerY"]));
|
958
958
|
}
|
959
|
-
});
|
959
|
+
}));
|
960
960
|
view.disableCameraTransform = true;
|
961
961
|
}
|
962
962
|
get pageState() {
|
@@ -1059,6 +1059,13 @@ class AppContext {
|
|
1059
1059
|
this.ensurePageSize(size2);
|
1060
1060
|
}
|
1061
1061
|
this.whiteBoardView = new WhiteBoardView(view, this, this.appProxy, removeViewWrapper, this.ensurePageSize);
|
1062
|
+
this.appProxy.sideEffectManager.add(() => {
|
1063
|
+
return () => {
|
1064
|
+
var _a2;
|
1065
|
+
(_a2 = this.whiteBoardView) == null ? void 0 : _a2.destroy();
|
1066
|
+
this.whiteBoardView = void 0;
|
1067
|
+
};
|
1068
|
+
});
|
1062
1069
|
return this.whiteBoardView;
|
1063
1070
|
};
|
1064
1071
|
this.ensurePageSize = (size2) => {
|
@@ -1663,8 +1670,9 @@ class AppProxy {
|
|
1663
1670
|
if (!this.camera$.value) {
|
1664
1671
|
return;
|
1665
1672
|
}
|
1666
|
-
const nextCamera = __spreadValues(__spreadValues({}, this.camera$.value), camera);
|
1673
|
+
const nextCamera = __spreadProps(__spreadValues(__spreadValues({}, this.camera$.value), camera), { id: this.uid });
|
1667
1674
|
this.storeCamera(nextCamera);
|
1675
|
+
this.camera$.setValue(nextCamera);
|
1668
1676
|
};
|
1669
1677
|
this.addCameraReaction = () => {
|
1670
1678
|
this.sideEffectManager.add(() => this.manager.refresher.add(`${this.id}-camera`, () => reaction(() => {
|
@@ -4234,7 +4242,7 @@ class Y$3 {
|
|
4234
4242
|
if (!this.$stage) {
|
4235
4243
|
const e4 = document.createElement("div");
|
4236
4244
|
this.$stage = e4, e4.className = this.wrapClassName("content-stage"), this._sideEffect.addDisposer(this._contentStageRect$.subscribe((t4) => {
|
4237
|
-
|
4245
|
+
e4.style.top = t4.y + "px", e4.style.left = t4.x + "px", e4.style.width = t4.width + "px", e4.style.height = t4.height + "px";
|
4238
4246
|
}), "content-stage-rect"), r2.appendChild(e4);
|
4239
4247
|
}
|
4240
4248
|
this.$stage.parentElement || r2.appendChild(this.$stage), this.$stage.appendChild(t3);
|
@@ -15547,14 +15555,14 @@ const reconnectRefresher = new ReconnectRefresher({ emitter });
|
|
15547
15555
|
const _WindowManager = class extends InvisiblePlugin {
|
15548
15556
|
constructor(context) {
|
15549
15557
|
super(context);
|
15550
|
-
this.version = "1.0.0-canary.
|
15551
|
-
this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "1.0.0-alpha.
|
15558
|
+
this.version = "1.0.0-canary.15";
|
15559
|
+
this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "1.0.0-alpha.17", "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" } };
|
15552
15560
|
this.emitter = callbacks$1;
|
15553
15561
|
this.viewMode = ViewMode.Broadcaster;
|
15554
15562
|
this.isReplay = isPlayer(this.displayer);
|
15555
15563
|
this.containerSizeRatio = _WindowManager.containerSizeRatio;
|
15556
15564
|
_WindowManager.displayer = context.displayer;
|
15557
|
-
window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "1.0.0-alpha.
|
15565
|
+
window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "1.0.0-alpha.17", "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" } };
|
15558
15566
|
}
|
15559
15567
|
static async mount(params) {
|
15560
15568
|
var _a;
|