@netless/window-manager 0.4.61 → 0.4.62

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.mjs CHANGED
@@ -1019,6 +1019,14 @@ class AppContext {
1019
1019
  this.appProxy.setSceneIndex(nextIndex);
1020
1020
  return true;
1021
1021
  };
1022
+ this.jumpPage = async (index2) => {
1023
+ if (!(0 <= index2 && index2 < this.pageState.length)) {
1024
+ console.warn("[WindowManager] nextPage: index out of range");
1025
+ return false;
1026
+ }
1027
+ this.appProxy.setSceneIndex(index2);
1028
+ return true;
1029
+ };
1022
1030
  this.prevPage = async () => {
1023
1031
  const nextIndex = this.pageState.index - 1;
1024
1032
  if (nextIndex < 0) {
@@ -2671,7 +2679,7 @@ class AppManager {
2671
2679
  const success = this.setMainViewFocusPath(scenePath);
2672
2680
  if (success) {
2673
2681
  this.store.setMainViewScenePath(scenePath);
2674
- this.safeSetAttributes({ _mainSceneIndex: index2 });
2682
+ this.store.setMainViewSceneIndex(index2);
2675
2683
  this.dispatchSetMainViewScenePath(scenePath);
2676
2684
  }
2677
2685
  } else {
@@ -2681,6 +2689,7 @@ class AppManager {
2681
2689
  }
2682
2690
  dispatchSetMainViewScenePath(scenePath) {
2683
2691
  this.dispatchInternalEvent(Events.SetMainViewScenePath, { nextScenePath: scenePath });
2692
+ callbacks$1.emit("mainViewScenePathChange", scenePath);
2684
2693
  setScenePath(this.room, scenePath);
2685
2694
  }
2686
2695
  getAppInitPath(appId) {
@@ -10004,6 +10013,11 @@ class StaticDocsViewer {
10004
10013
  this.whiteboardView.callbacks.on("onCameraUpdated", handleCameraUpdate);
10005
10014
  return () => this.whiteboardView.callbacks.off("onCameraUpdated", handleCameraUpdate);
10006
10015
  });
10016
+ this.sideEffect.add(() => {
10017
+ const { updateUserScroll } = this;
10018
+ this.whiteboardView.callbacks.on("onCameraUpdatedByDevice", updateUserScroll);
10019
+ return () => this.whiteboardView.callbacks.off("onCameraUpdatedByDevice", updateUserScroll);
10020
+ });
10007
10021
  this.sideEffect.add(() => {
10008
10022
  const handleSizeUpdate = ({ width: wbWidth, height: wbHeight }) => {
10009
10023
  if (wbWidth <= 0 || wbHeight <= 0) {
@@ -17443,14 +17457,14 @@ const reconnectRefresher = new ReconnectRefresher({ emitter });
17443
17457
  const _WindowManager = class extends InvisiblePlugin {
17444
17458
  constructor(context) {
17445
17459
  super(context);
17446
- this.version = "0.4.61";
17447
- this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.2.27", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "side-effect-manager": "^0.1.5", "uuid": "^7.0.3", "video.js": ">=7" }, "peerDependencies": { "jspdf": "2.5.1", "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "^0.2.15", "@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", "jspdf": "^2.5.1", "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.43" } };
17460
+ this.version = "0.4.62";
17461
+ this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.2.27", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "side-effect-manager": "^0.1.5", "uuid": "^7.0.3", "video.js": ">=7" }, "peerDependencies": { "jspdf": "2.5.1", "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "^0.2.16", "@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", "jspdf": "^2.5.1", "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.43" } };
17448
17462
  this.emitter = callbacks$1;
17449
17463
  this.viewMode = ViewMode.Broadcaster;
17450
17464
  this.isReplay = isPlayer(this.displayer);
17451
17465
  this.containerSizeRatio = _WindowManager.containerSizeRatio;
17452
17466
  _WindowManager.displayer = context.displayer;
17453
- window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.2.27", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "side-effect-manager": "^0.1.5", "uuid": "^7.0.3", "video.js": ">=7" }, "peerDependencies": { "jspdf": "2.5.1", "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "^0.2.15", "@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", "jspdf": "^2.5.1", "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.43" } };
17467
+ window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.2.27", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "side-effect-manager": "^0.1.5", "uuid": "^7.0.3", "video.js": ">=7" }, "peerDependencies": { "jspdf": "2.5.1", "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "^0.2.16", "@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", "jspdf": "^2.5.1", "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.43" } };
17454
17468
  }
17455
17469
  static async mount(params) {
17456
17470
  const room = params.room;
@@ -17731,6 +17745,18 @@ const _WindowManager = class extends InvisiblePlugin {
17731
17745
  return false;
17732
17746
  }
17733
17747
  }
17748
+ async jumpPage(index2) {
17749
+ if (this.appManager) {
17750
+ if (index2 < 0 || index2 >= this.pageState.length) {
17751
+ console.warn(`[WindowManager]: index ${index2} out of range`);
17752
+ return false;
17753
+ }
17754
+ await this.appManager.setMainViewSceneIndex(index2);
17755
+ return true;
17756
+ } else {
17757
+ return false;
17758
+ }
17759
+ }
17734
17760
  async addPage(params) {
17735
17761
  if (this.appManager) {
17736
17762
  const after = params == null ? void 0 : params.after;