@netless/window-manager 1.0.0-canary.6 → 1.0.0-canary.7
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/View/CameraSynchronizer.d.ts +2 -2
- package/dist/index.cjs.js +5 -5
- package/dist/index.es.js +20 -18
- package/dist/index.umd.js +7 -7
- package/package.json +2 -2
- package/pnpm-lock.yaml +4 -4
- package/src/App/AppProxy.ts +2 -0
- package/src/App/AppViewSync.ts +2 -2
- package/src/View/CameraSynchronizer.ts +2 -2
package/dist/index.es.js
CHANGED
@@ -1300,11 +1300,11 @@ class AppViewSync {
|
|
1300
1300
|
}
|
1301
1301
|
}));
|
1302
1302
|
}
|
1303
|
-
combine([this.appProxy.camera$, this.appProxy.size$]).subscribe(([camera, size2]) => {
|
1303
|
+
this.sem.add(() => combine([this.appProxy.camera$, this.appProxy.size$]).subscribe(([camera, size2]) => {
|
1304
1304
|
if (camera && size2) {
|
1305
1305
|
this.synchronizer.onRemoteUpdate(camera, size2);
|
1306
1306
|
}
|
1307
|
-
});
|
1307
|
+
}));
|
1308
1308
|
}
|
1309
1309
|
destroy() {
|
1310
1310
|
this.sem.flushAll();
|
@@ -1662,6 +1662,7 @@ class AppProxy {
|
|
1662
1662
|
scale: 1,
|
1663
1663
|
id: this.uid
|
1664
1664
|
});
|
1665
|
+
this.camera$.setValue(toJS(this.appAttributes.camera));
|
1665
1666
|
}
|
1666
1667
|
if (!this.size$.value && box.contentStageRect) {
|
1667
1668
|
this.storeSize({
|
@@ -1669,6 +1670,7 @@ class AppProxy {
|
|
1669
1670
|
width: (_a2 = box.contentStageRect) == null ? void 0 : _a2.width,
|
1670
1671
|
height: (_b = box.contentStageRect) == null ? void 0 : _b.height
|
1671
1672
|
});
|
1673
|
+
this.size$.setValue(toJS(this.appAttributes.size));
|
1672
1674
|
}
|
1673
1675
|
this.appViewSync = new AppViewSync(this);
|
1674
1676
|
this.sideEffectManager.add(() => () => {
|
@@ -4016,10 +4018,10 @@ class Y$3 {
|
|
4016
4018
|
this._sideEffect.addDisposer(re2.reaction((e3, t3) => {
|
4017
4019
|
le2.setValue({ width: Math.max(a2, e3.width), height: Math.max(n2, e3.height) }, t3);
|
4018
4020
|
}));
|
4019
|
-
const de2 = new Val({ x: l2, y: $ }, { compare: shallowequal }), ce2 = combine([le2, O2], ([e3, t3]) => ({ width: t3.width * e3.width, height: t3.height * e3.height }), { compare: shallowequal }), me2 = combine([de2, O2], ([e3, t3]) => ({ x: e3.x * t3.width + t3.x, y: e3.y * t3.height + t3.y }), { compare: shallowequal }), ue2 = new Val(R2), ge2 = combine([ue2, F2], ([e3, t3]) => e3 != null ? e3 : t3),
|
4021
|
+
const de2 = new Val({ x: l2, y: $ }, { compare: shallowequal }), ce2 = combine([le2, O2], ([e3, t3]) => ({ width: t3.width * e3.width, height: t3.height * e3.height }), { compare: shallowequal }), me2 = combine([de2, O2], ([e3, t3]) => ({ x: e3.x * t3.width + t3.x, y: e3.y * t3.height + t3.y }), { compare: shallowequal }), ue2 = new Val(R2), ge2 = combine([ue2, F2], ([e3, t3]) => e3 != null ? e3 : t3), pe2 = new Val(null), xe2 = new Val(P2.value, { compare: shallowequal }), fe2 = new Val(_2), $e2 = new A$2({ namespace: i2, root$: pe2, rootRect$: xe2, ratio$: combine([fe2, j2], ([e3, t3]) => e3 != null ? e3 : t3), highlightStage$: ge2 });
|
4020
4022
|
this._sideEffect.addDisposer(() => $e2.destroy());
|
4021
4023
|
withReadonlyValueEnhancer(this, { darkMode: D2, fence: T2, minimized: V2, maximized: W2, readonly: Y2, rootRect: P2, managerStageRect: O2, collectorRect: Z2 });
|
4022
|
-
const be2 = { zIndex: ee2, focus: te2, $userContent: ie2, $userStage: se2, $userFooter: ae2, $userStyles: ne2, state: oe2, minSize: re2, pxMinSize: he2, intrinsicSize: le2, intrinsicCoord: de2, pxIntrinsicSize: ce2, pxIntrinsicCoord: me2, highlightStage: ge2, boxHighlightStage: ue2, contentRect:
|
4024
|
+
const be2 = { zIndex: ee2, focus: te2, $userContent: ie2, $userStage: se2, $userFooter: ae2, $userStyles: ne2, state: oe2, minSize: re2, pxMinSize: he2, intrinsicSize: le2, intrinsicCoord: de2, pxIntrinsicSize: ce2, pxIntrinsicCoord: me2, highlightStage: ge2, boxHighlightStage: ue2, contentRect: xe2, contentStageRect: $e2.stageRect$ };
|
4023
4025
|
withReadonlyValueEnhancer(this, be2, G2);
|
4024
4026
|
withValueEnhancer(this, { title: J2, visible: q2, resizable: Q2, draggable: K2, ratio: U2, stageRatio: fe2 }, G2), this.titleBar = B2 || new H$3({ readonly$: Y2, state$: oe2, title$: J2, namespace: this.namespace, onDragStart: (e3) => {
|
4025
4027
|
var t3;
|
@@ -4028,7 +4030,7 @@ class Y$3 {
|
|
4028
4030
|
e3 > 0 && this.transform(me2.value.x, me2.value.y, ce2.value.width, ce2.value.height, true);
|
4029
4031
|
})), this._sideEffect.addDisposer(T2.subscribe((e3) => {
|
4030
4032
|
e3 && this.move(me2.value.x, me2.value.y, true);
|
4031
|
-
})), this.$box = this.render(),
|
4033
|
+
})), this.$box = this.render(), pe2.setValue(this.$content.parentElement);
|
4032
4034
|
const ve2 = (e3, t3) => {
|
4033
4035
|
this._sideEffect.addDisposer(e3.reaction((e4, i3) => {
|
4034
4036
|
i3 || this.events.emit(t3, e4);
|
@@ -4162,7 +4164,7 @@ class Y$3 {
|
|
4162
4164
|
r2.className = this.wrapClassName("content") + " tele-fancy-scrollbar", this.$content = r2, this._sideEffect.add(() => {
|
4163
4165
|
const e3 = new W$3(() => {
|
4164
4166
|
const e4 = r2.getBoundingClientRect();
|
4165
|
-
this._contentRect$.setValue({ x:
|
4167
|
+
this._contentRect$.setValue({ x: 0, y: 0, width: e4.width, height: e4.height });
|
4166
4168
|
});
|
4167
4169
|
return e3.observe(r2), () => e3.disconnect();
|
4168
4170
|
}), this._sideEffect.add(() => {
|
@@ -4214,13 +4216,13 @@ class Y$3 {
|
|
4214
4216
|
let { pageX: t3, pageY: i3 } = R$3(e3);
|
4215
4217
|
i3 < this.rootRect.y && (i3 = this.rootRect.y);
|
4216
4218
|
const s3 = t3 - l2, c2 = i3 - d2;
|
4217
|
-
let { x: m3, y: u3 } = this.pxIntrinsicCoord, { width: g2, height:
|
4219
|
+
let { x: m3, y: u3 } = this.pxIntrinsicCoord, { width: g2, height: p2 } = this.pxIntrinsicSize;
|
4218
4220
|
switch (a2) {
|
4219
4221
|
case N$3.North:
|
4220
|
-
u3 = o2 + c2,
|
4222
|
+
u3 = o2 + c2, p2 = h - c2;
|
4221
4223
|
break;
|
4222
4224
|
case N$3.South:
|
4223
|
-
|
4225
|
+
p2 = h + c2;
|
4224
4226
|
break;
|
4225
4227
|
case N$3.West:
|
4226
4228
|
m3 = n2 + s3, g2 = r2 - s3;
|
@@ -4229,21 +4231,21 @@ class Y$3 {
|
|
4229
4231
|
g2 = r2 + s3;
|
4230
4232
|
break;
|
4231
4233
|
case N$3.NorthWest:
|
4232
|
-
m3 = n2 + s3, u3 = o2 + c2, g2 = r2 - s3,
|
4234
|
+
m3 = n2 + s3, u3 = o2 + c2, g2 = r2 - s3, p2 = h - c2;
|
4233
4235
|
break;
|
4234
4236
|
case N$3.NorthEast:
|
4235
|
-
u3 = o2 + c2, g2 = r2 + s3,
|
4237
|
+
u3 = o2 + c2, g2 = r2 + s3, p2 = h - c2;
|
4236
4238
|
break;
|
4237
4239
|
case N$3.SouthEast:
|
4238
|
-
g2 = r2 + s3,
|
4240
|
+
g2 = r2 + s3, p2 = h + c2;
|
4239
4241
|
break;
|
4240
4242
|
case N$3.SouthWest:
|
4241
|
-
m3 = n2 + s3, g2 = r2 - s3,
|
4243
|
+
m3 = n2 + s3, g2 = r2 - s3, p2 = h + c2;
|
4242
4244
|
break;
|
4243
4245
|
default:
|
4244
4246
|
return void this.move(n2 + s3, o2 + c2);
|
4245
4247
|
}
|
4246
|
-
this.transform(m3, u3, g2,
|
4248
|
+
this.transform(m3, u3, g2, p2);
|
4247
4249
|
}, m2 = (e3) => {
|
4248
4250
|
a2 = void 0, s2 && (k$1(e3), this.$box.classList.toggle(i2, false), this._sideEffect.flush(t2), s2.remove());
|
4249
4251
|
}, u2 = (e3) => {
|
@@ -4379,7 +4381,7 @@ class F$3 {
|
|
4379
4381
|
};
|
4380
4382
|
const t3 = new Z$3(() => {
|
4381
4383
|
const t4 = e3.getBoundingClientRect();
|
4382
|
-
I2.setValue({ x:
|
4384
|
+
I2.setValue({ x: 0, y: 0, width: t4.width, height: t4.height });
|
4383
4385
|
});
|
4384
4386
|
return t3.observe(e3), () => t3.disconnect();
|
4385
4387
|
}, "calc-root-rect");
|
@@ -15495,14 +15497,14 @@ const reconnectRefresher = new ReconnectRefresher({ emitter });
|
|
15495
15497
|
const _WindowManager = class extends InvisiblePlugin {
|
15496
15498
|
constructor(context) {
|
15497
15499
|
super(context);
|
15498
|
-
this.version = "1.0.0-canary.
|
15499
|
-
this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "1.0.0-alpha.
|
15500
|
+
this.version = "1.0.0-canary.7";
|
15501
|
+
this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "1.0.0-alpha.14", "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.2.1", "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" } };
|
15500
15502
|
this.emitter = callbacks$1;
|
15501
15503
|
this.viewMode = ViewMode.Broadcaster;
|
15502
15504
|
this.isReplay = isPlayer(this.displayer);
|
15503
15505
|
this.containerSizeRatio = _WindowManager.containerSizeRatio;
|
15504
15506
|
_WindowManager.displayer = context.displayer;
|
15505
|
-
window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "1.0.0-alpha.
|
15507
|
+
window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "1.0.0-alpha.14", "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.2.1", "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" } };
|
15506
15508
|
}
|
15507
15509
|
static async mount(params) {
|
15508
15510
|
var _a;
|