@netless/window-manager 1.0.0-canary.12 → 1.0.0-canary.13

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.es.js CHANGED
@@ -950,6 +950,7 @@ class WhiteBoardView {
950
950
  appProxy.appEmitter.on("pageStateChange", (pageState) => {
951
951
  pageState$.setValue(pageState);
952
952
  });
953
+ view.disableCameraTransform = true;
953
954
  }
954
955
  get pageState() {
955
956
  return this.pageState$.value;
@@ -1212,7 +1213,7 @@ class CameraSynchronizer {
1212
1213
  if (this.remoteCamera && this.remoteSize) {
1213
1214
  this.onRemoteUpdate(this.remoteCamera, this.remoteSize);
1214
1215
  }
1215
- }, 50);
1216
+ }, 10);
1216
1217
  this.onRemoteUpdate = throttle((camera, size2) => {
1217
1218
  this.remoteCamera = camera;
1218
1219
  this.remoteSize = size2;
@@ -1233,9 +1234,10 @@ class CameraSynchronizer {
1233
1234
  animationMode: AnimationMode.Immediately
1234
1235
  });
1235
1236
  };
1237
+ moveCamera();
1236
1238
  delay(moveCamera, 50);
1237
1239
  }
1238
- }, 50);
1240
+ }, 10);
1239
1241
  }
1240
1242
  setView(view) {
1241
1243
  this.view = view;
@@ -1682,6 +1684,9 @@ class AppProxy {
1682
1684
  }
1683
1685
  })), "size");
1684
1686
  };
1687
+ this.onFocus = () => {
1688
+ this.setScenePath();
1689
+ };
1685
1690
  this.kind = params.kind;
1686
1691
  this.id = appId;
1687
1692
  this.appScenePath = `/${this.id}-app-dir`;
@@ -2020,6 +2025,7 @@ class AppProxy {
2020
2025
  const fullPath = this._pageState.getFullPath(index2);
2021
2026
  if (fullPath) {
2022
2027
  this.setFullPath(fullPath);
2028
+ setScenePath(this.manager.room, fullPath);
2023
2029
  }
2024
2030
  }
2025
2031
  }
@@ -2561,6 +2567,7 @@ class AppManager {
2561
2567
  setTimeout(() => {
2562
2568
  const appProxy = this.appProxies.get(focused);
2563
2569
  if (appProxy) {
2570
+ appProxy.onFocus();
2564
2571
  appRegister.notifyApp(appProxy.kind, "focus", { appId: focused });
2565
2572
  }
2566
2573
  }, 0);
@@ -2611,6 +2618,7 @@ class AppManager {
2611
2618
  if (sceneState) {
2612
2619
  const scenePath = sceneState.scenePath;
2613
2620
  this.appProxies.forEach((appProxy) => {
2621
+ console.log("scenePath", scenePath, appProxy.scenePath);
2614
2622
  if (appProxy.scenePath && scenePath.startsWith(appProxy.scenePath)) {
2615
2623
  appProxy.emitAppSceneStateChange(sceneState);
2616
2624
  appProxy.setFullPath(scenePath);
@@ -4309,33 +4317,33 @@ class Y$3 {
4309
4317
  }
4310
4318
  var X$3, P$3;
4311
4319
  class O$3 {
4312
- constructor({ minimized$: e2, readonly$: t2, darkMode$: i2, rootRect$: s2, namespace: a2 = "telebox", styles: n2 = {}, root$: o2 }) {
4313
- this._sideEffect = new SideEffectManager(), this.namespace = a2;
4314
- const r2 = new ValManager();
4315
- this._sideEffect.addDisposer(() => r2.destroy());
4316
- const h = new Val(void 0), l2 = derive(e2), d2 = new Val(n2), m2 = new Val(document.createElement("button"));
4317
- withValueEnhancer(this, { styles: d2, $collector: m2 }, r2);
4318
- withReadonlyValueEnhancer(this, { root: o2 });
4319
- withReadonlyValueEnhancer(this, { rect: h, visible: l2 }, r2), m2.value.className = this.wrapClassName("collector"), m2.value.style.backgroundImage = "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOCAxNiI+CiAgICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxwYXRoIHN0cm9rZT0iIzdCODhBMCIgc3Ryb2tlLXdpZHRoPSIxLjQiIGQ9Ik0uNyAxLjJoMTYuNnYxMy42SC43eiIgLz4KICAgICAgICA8cGF0aCBmaWxsPSIjN0I4OEEwIiBkPSJNNCA1LjVoNnYxLjRINHpNNCA5LjVoMTB2MS40SDR6IiAvPgogICAgPC9nPgo8L3N2Zz4K')", this._sideEffect.addDisposer(m2.subscribe((a3) => {
4320
- this._sideEffect.addEventListener(a3, "click", () => {
4320
+ constructor({ minimized$: e2, readonly$: t2, darkMode$: i2, namespace: s2 = "telebox", styles: a2 = {}, root$: n2 }) {
4321
+ this._sideEffect = new SideEffectManager(), this.namespace = s2;
4322
+ const o2 = new ValManager();
4323
+ this._sideEffect.addDisposer(() => o2.destroy());
4324
+ const r2 = new Val(void 0), h = derive(e2), l2 = new Val(a2), d2 = new Val(document.createElement("button"));
4325
+ withValueEnhancer(this, { styles: l2, $collector: d2 }, o2);
4326
+ withReadonlyValueEnhancer(this, { root: n2 });
4327
+ withReadonlyValueEnhancer(this, { rect: r2, visible: h }, o2), d2.value.className = this.wrapClassName("collector"), d2.value.style.backgroundImage = "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOCAxNiI+CiAgICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxwYXRoIHN0cm9rZT0iIzdCODhBMCIgc3Ryb2tlLXdpZHRoPSIxLjQiIGQ9Ik0uNyAxLjJoMTYuNnYxMy42SC43eiIgLz4KICAgICAgICA8cGF0aCBmaWxsPSIjN0I4OEEwIiBkPSJNNCA1LjVoNnYxLjRINHpNNCA5LjVoMTB2MS40SDR6IiAvPgogICAgPC9nPgo8L3N2Zz4K')", this._sideEffect.addDisposer(d2.subscribe((s3) => {
4328
+ this._sideEffect.addEventListener(s3, "click", () => {
4321
4329
  t2.value || e2.setValue(false);
4322
- }, {}, "telebox-collector-click"), this._sideEffect.addDisposer([l2.subscribe((e3) => {
4323
- a3.classList.toggle(this.wrapClassName("collector-visible"), e3);
4330
+ }, {}, "telebox-collector-click"), this._sideEffect.addDisposer([h.subscribe((e3) => {
4331
+ s3.classList.toggle(this.wrapClassName("collector-visible"), e3);
4324
4332
  }), t2.subscribe((e3) => {
4325
- a3.classList.toggle(this.wrapClassName("collector-readonly"), e3);
4333
+ s3.classList.toggle(this.wrapClassName("collector-readonly"), e3);
4326
4334
  }), i2.subscribe((e3) => {
4327
- a3.classList.toggle(this.wrapClassName("color-scheme-dark"), e3), a3.classList.toggle(this.wrapClassName("color-scheme-light"), !e3);
4328
- }), d2.subscribe((e3) => {
4335
+ s3.classList.toggle(this.wrapClassName("color-scheme-dark"), e3), s3.classList.toggle(this.wrapClassName("color-scheme-light"), !e3);
4336
+ }), l2.subscribe((e3) => {
4329
4337
  Object.keys(e3).forEach((t3) => {
4330
4338
  const i3 = e3[t3];
4331
- i3 != null && (a3.style[t3] = i3);
4339
+ i3 != null && (s3.style[t3] = i3);
4332
4340
  });
4333
- }), o2.subscribe((e3) => {
4334
- e3 && e3.appendChild(a3);
4335
- }), combine([e2, s2, o2]).subscribe(([e3, t3, i3]) => {
4336
- if (e3 && i3) {
4337
- const { x: e4, y: i4, width: s3, height: n3 } = a3.getBoundingClientRect();
4338
- h.setValue({ x: e4 - t3.x, y: i4 - t3.y, width: s3, height: n3 });
4341
+ }), n2.subscribe((e3) => {
4342
+ e3 && e3.appendChild(s3);
4343
+ }), combine([e2, n2]).subscribe(([e3, t3]) => {
4344
+ if (e3 && t3) {
4345
+ const { x: e4, y: i3, width: a3, height: n3 } = s3.getBoundingClientRect(), o3 = t3.getBoundingClientRect();
4346
+ r2.setValue({ x: e4 - o3.x, y: i3 - o3.y, width: a3, height: n3 });
4339
4347
  }
4340
4348
  })], "telebox-collector-el");
4341
4349
  }));
@@ -4437,7 +4445,7 @@ class F$3 {
4437
4445
  t3 || this.events.emit(X$3.PrefersColorScheme, e3);
4438
4446
  }));
4439
4447
  const L2 = combine([R2, D2], ([e3, t3]) => t3 === "auto" ? e3 : t3 === "dark"), T2 = combine([z2, B2], ([e3, t3]) => e3 ? C$3.Minimized : t3 ? C$3.Maximized : C$3.Normal);
4440
- this.collector = n2 != null ? n2 : new O$3({ minimized$: z2, readonly$: y2, darkMode$: L2, namespace: o2, root$: w2, rootRect$: I2 });
4448
+ this.collector = n2 != null ? n2 : new O$3({ minimized$: z2, readonly$: y2, darkMode$: L2, namespace: o2, root$: w2 });
4441
4449
  const V2 = new A$2({ namespace: o2, rootRect$: I2, ratio$: S2, root$: w2, highlightStage$: combine([M2, B2, z2], ([e3, t3, i3]) => e3 && (i3 || !t3)) });
4442
4450
  this._sideEffect.addDisposer(() => V2.destroy());
4443
4451
  const H2 = { darkMode: L2, state: T2, root: w2, rootRect: I2, stageRect: V2.stageRect$ };
@@ -4658,17 +4666,17 @@ class BoxManager {
4658
4666
  const { emitter: emitter2, callbacks: callbacks2, boxEmitter: boxEmitter2 } = context;
4659
4667
  this.teleBoxManager = this.setupBoxManager(createTeleBoxManagerConfig);
4660
4668
  this.sideEffectManager.add(() => [
4661
- this.teleBoxManager._state$.reaction((state) => {
4669
+ this.teleBoxManager.onValChanged("state", (state) => {
4662
4670
  callbacks2.emit("boxStateChange", state);
4663
4671
  emitter2.emit("boxStateChange", state);
4664
4672
  }),
4665
- this.teleBoxManager._darkMode$.reaction((darkMode) => {
4673
+ this.teleBoxManager.onValChanged("darkMode", (darkMode) => {
4666
4674
  callbacks2.emit("darkModeChange", darkMode);
4667
4675
  }),
4668
- this.teleBoxManager._prefersColorScheme$.reaction((colorScheme) => {
4676
+ this.teleBoxManager.onValChanged("prefersColorScheme", (colorScheme) => {
4669
4677
  callbacks2.emit("prefersColorSchemeChange", colorScheme);
4670
4678
  }),
4671
- this.teleBoxManager._minimized$.reaction((minimized, skipUpdate) => {
4679
+ this.teleBoxManager.onValChanged("minimized", (minimized, skipUpdate) => {
4672
4680
  if (skipUpdate) {
4673
4681
  return;
4674
4682
  }
@@ -4684,7 +4692,7 @@ class BoxManager {
4684
4692
  }
4685
4693
  }
4686
4694
  }),
4687
- this.teleBoxManager._maximized$.reaction((maximized, skipUpdate) => {
4695
+ this.teleBoxManager.onValChanged("maximized", (maximized, skipUpdate) => {
4688
4696
  if (skipUpdate) {
4689
4697
  return;
4690
4698
  }
@@ -4696,7 +4704,11 @@ class BoxManager {
4696
4704
  });
4697
4705
  }),
4698
4706
  this.teleBoxManager.events.on("intrinsic_move", debounce((box) => {
4699
- boxEmitter2.emit("move", { appId: box.id, x: box.intrinsicX, y: box.intrinsicY });
4707
+ boxEmitter2.emit("move", {
4708
+ appId: box.id,
4709
+ x: box.intrinsicX,
4710
+ y: box.intrinsicY
4711
+ });
4700
4712
  }, 50)),
4701
4713
  this.teleBoxManager.events.on("intrinsic_resize", debounce((box) => {
4702
4714
  boxEmitter2.emit("resize", {
@@ -15527,14 +15539,14 @@ const reconnectRefresher = new ReconnectRefresher({ emitter });
15527
15539
  const _WindowManager = class extends InvisiblePlugin {
15528
15540
  constructor(context) {
15529
15541
  super(context);
15530
- this.version = "1.0.0-canary.12";
15531
- this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "1.0.0-alpha.15", "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" } };
15542
+ this.version = "1.0.0-canary.13";
15543
+ this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "1.0.0-alpha.16", "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" } };
15532
15544
  this.emitter = callbacks$1;
15533
15545
  this.viewMode = ViewMode.Broadcaster;
15534
15546
  this.isReplay = isPlayer(this.displayer);
15535
15547
  this.containerSizeRatio = _WindowManager.containerSizeRatio;
15536
15548
  _WindowManager.displayer = context.displayer;
15537
- window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "1.0.0-alpha.15", "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" } };
15549
+ window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "1.0.0-alpha.16", "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" } };
15538
15550
  }
15539
15551
  static async mount(params) {
15540
15552
  var _a;
@@ -16148,12 +16160,12 @@ const _WindowManager = class extends InvisiblePlugin {
16148
16160
  (_a = this.appManager) == null ? void 0 : _a.dispatchInternalEvent(Events.Refresh);
16149
16161
  }
16150
16162
  _refresh() {
16151
- var _a, _b, _c;
16163
+ var _a, _b;
16152
16164
  (_a = this.appManager) == null ? void 0 : _a.mainViewProxy.rebind();
16153
16165
  if (_WindowManager.container) {
16154
16166
  this.bindContainer(_WindowManager.container);
16155
16167
  }
16156
- (_c = (_b = this.appManager) == null ? void 0 : _b.refresher) == null ? void 0 : _c.refresh();
16168
+ (_b = this.appManager) == null ? void 0 : _b.refresher.refresh();
16157
16169
  }
16158
16170
  setContainerSizeRatio(ratio) {
16159
16171
  if (!isNumber(ratio)) {