@netless/window-manager 1.0.0-canary.69 → 1.0.0-canary.70

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.js CHANGED
@@ -799,6 +799,12 @@ class BindContainerRoomPhaseInvalidError extends Error {
799
799
  this.message = "[WindowManager]: room phase only Connected can be bindContainer";
800
800
  }
801
801
  }
802
+ class InvalidViewModeError extends Error {
803
+ constructor() {
804
+ super(...arguments);
805
+ this.message = "[WindowManager]: scroll mode cannot be switched to other viewMode";
806
+ }
807
+ }
802
808
  var __async$8 = (__this, __arguments, generator) => {
803
809
  return new Promise((resolve, reject) => {
804
810
  var fulfilled = (value) => {
@@ -2588,7 +2594,9 @@ class MainViewProxy {
2588
2594
  releaseView(this.mainView);
2589
2595
  })
2590
2596
  ]);
2591
- this.createViewSync();
2597
+ if (manager.windowManger.viewMode$.value !== "scroll") {
2598
+ this.createViewSync();
2599
+ }
2592
2600
  this.sideEffectManager.add(() => emitter.on("focusedChange", ({ focused }) => {
2593
2601
  if (focused === void 0) {
2594
2602
  const scenePath = this.store.getMainViewScenePath();
@@ -12798,7 +12806,7 @@ const reconnectRefresher = new ReconnectRefresher({ emitter });
12798
12806
  const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
12799
12807
  constructor(context) {
12800
12808
  super(context);
12801
- this.version = "1.0.0-canary.69";
12809
+ this.version = "1.0.0-canary.70";
12802
12810
  this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/synced-store": "^2.0.7", "@netless/telebox-insider": "1.0.0-alpha.37", "emittery": "^0.11.0", "lodash": "^4.17.21", "p-retry": "^4.6.2", "side-effect-manager": "^1.2.1", "uuid": "^7.0.3", "value-enhancer": "^1.3.2" }, "peerDependencies": { "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "^1.0.0-canary.3", "@netless/app-plyr": "^0.2.4", "@playwright/test": "^1.23.2", "@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.49", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.6", "@types/node": "^18.0.3", "@types/uuid": "^8.3.4", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.2", "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.3", "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": "^3.1.3", "vite-plugin-dts": "^1.5.0", "vitest": "^0.23.4", "white-web-sdk": "^2.16.35" } };
12803
12811
  this.emitter = callbacks;
12804
12812
  this.viewMode$ = new valueEnhancer.Val(whiteWebSdk.ViewMode.Broadcaster);
@@ -13194,6 +13202,9 @@ const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
13194
13202
  setViewMode(mode) {
13195
13203
  var _a2;
13196
13204
  log("setViewMode", mode);
13205
+ if (this.viewMode$.value === "scroll" && mode !== "scroll") {
13206
+ throw new InvalidViewModeError();
13207
+ }
13197
13208
  const mainViewProxy = (_a2 = this.appManager) == null ? void 0 : _a2.mainViewProxy;
13198
13209
  if (mode === whiteWebSdk.ViewMode.Broadcaster || mode === whiteWebSdk.ViewMode.Follower) {
13199
13210
  if (this.canOperate && mode === whiteWebSdk.ViewMode.Broadcaster) {
@@ -13606,6 +13617,7 @@ exports.BoxNotCreatedError = BoxNotCreatedError;
13606
13617
  exports.BuiltinApps = BuiltinApps;
13607
13618
  exports.BuiltinAppsMap = BuiltinAppsMap;
13608
13619
  exports.InvalidScenePath = InvalidScenePath;
13620
+ exports.InvalidViewModeError = InvalidViewModeError;
13609
13621
  exports.ParamsInvalidError = ParamsInvalidError;
13610
13622
  exports.WhiteWebSDKInvalidError = WhiteWebSDKInvalidError;
13611
13623
  exports.WindowManager = WindowManager;
package/dist/index.mjs CHANGED
@@ -794,6 +794,12 @@ class BindContainerRoomPhaseInvalidError extends Error {
794
794
  this.message = "[WindowManager]: room phase only Connected can be bindContainer";
795
795
  }
796
796
  }
797
+ class InvalidViewModeError extends Error {
798
+ constructor() {
799
+ super(...arguments);
800
+ this.message = "[WindowManager]: scroll mode cannot be switched to other viewMode";
801
+ }
802
+ }
797
803
  var __async$8 = (__this, __arguments, generator) => {
798
804
  return new Promise((resolve, reject) => {
799
805
  var fulfilled = (value) => {
@@ -2583,7 +2589,9 @@ class MainViewProxy {
2583
2589
  releaseView(this.mainView);
2584
2590
  })
2585
2591
  ]);
2586
- this.createViewSync();
2592
+ if (manager.windowManger.viewMode$.value !== "scroll") {
2593
+ this.createViewSync();
2594
+ }
2587
2595
  this.sideEffectManager.add(() => emitter.on("focusedChange", ({ focused }) => {
2588
2596
  if (focused === void 0) {
2589
2597
  const scenePath = this.store.getMainViewScenePath();
@@ -12793,7 +12801,7 @@ const reconnectRefresher = new ReconnectRefresher({ emitter });
12793
12801
  const _WindowManager = class extends InvisiblePlugin {
12794
12802
  constructor(context) {
12795
12803
  super(context);
12796
- this.version = "1.0.0-canary.69";
12804
+ this.version = "1.0.0-canary.70";
12797
12805
  this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/synced-store": "^2.0.7", "@netless/telebox-insider": "1.0.0-alpha.37", "emittery": "^0.11.0", "lodash": "^4.17.21", "p-retry": "^4.6.2", "side-effect-manager": "^1.2.1", "uuid": "^7.0.3", "value-enhancer": "^1.3.2" }, "peerDependencies": { "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "^1.0.0-canary.3", "@netless/app-plyr": "^0.2.4", "@playwright/test": "^1.23.2", "@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.49", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.6", "@types/node": "^18.0.3", "@types/uuid": "^8.3.4", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.2", "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.3", "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": "^3.1.3", "vite-plugin-dts": "^1.5.0", "vitest": "^0.23.4", "white-web-sdk": "^2.16.35" } };
12798
12806
  this.emitter = callbacks;
12799
12807
  this.viewMode$ = new Val(ViewMode.Broadcaster);
@@ -13189,6 +13197,9 @@ const _WindowManager = class extends InvisiblePlugin {
13189
13197
  setViewMode(mode) {
13190
13198
  var _a2;
13191
13199
  log("setViewMode", mode);
13200
+ if (this.viewMode$.value === "scroll" && mode !== "scroll") {
13201
+ throw new InvalidViewModeError();
13202
+ }
13192
13203
  const mainViewProxy = (_a2 = this.appManager) == null ? void 0 : _a2.mainViewProxy;
13193
13204
  if (mode === ViewMode.Broadcaster || mode === ViewMode.Follower) {
13194
13205
  if (this.canOperate && mode === ViewMode.Broadcaster) {
@@ -13602,6 +13613,7 @@ export {
13602
13613
  BuiltinApps,
13603
13614
  BuiltinAppsMap,
13604
13615
  InvalidScenePath,
13616
+ InvalidViewModeError,
13605
13617
  ParamsInvalidError,
13606
13618
  WhiteWebSDKInvalidError,
13607
13619
  WindowManager,
package/dist/index.umd.js CHANGED
@@ -792,6 +792,12 @@
792
792
  this.message = "[WindowManager]: room phase only Connected can be bindContainer";
793
793
  }
794
794
  }
795
+ class InvalidViewModeError extends Error {
796
+ constructor() {
797
+ super(...arguments);
798
+ this.message = "[WindowManager]: scroll mode cannot be switched to other viewMode";
799
+ }
800
+ }
795
801
  var __async$8 = (__this, __arguments, generator) => {
796
802
  return new Promise((resolve, reject) => {
797
803
  var fulfilled = (value) => {
@@ -2581,7 +2587,9 @@
2581
2587
  releaseView(this.mainView);
2582
2588
  })
2583
2589
  ]);
2584
- this.createViewSync();
2590
+ if (manager.windowManger.viewMode$.value !== "scroll") {
2591
+ this.createViewSync();
2592
+ }
2585
2593
  this.sideEffectManager.add(() => emitter.on("focusedChange", ({ focused }) => {
2586
2594
  if (focused === void 0) {
2587
2595
  const scenePath = this.store.getMainViewScenePath();
@@ -12791,7 +12799,7 @@
12791
12799
  const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
12792
12800
  constructor(context) {
12793
12801
  super(context);
12794
- this.version = "1.0.0-canary.69";
12802
+ this.version = "1.0.0-canary.70";
12795
12803
  this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/synced-store": "^2.0.7", "@netless/telebox-insider": "1.0.0-alpha.37", "emittery": "^0.11.0", "lodash": "^4.17.21", "p-retry": "^4.6.2", "side-effect-manager": "^1.2.1", "uuid": "^7.0.3", "value-enhancer": "^1.3.2" }, "peerDependencies": { "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "^1.0.0-canary.3", "@netless/app-plyr": "^0.2.4", "@playwright/test": "^1.23.2", "@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.49", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.6", "@types/node": "^18.0.3", "@types/uuid": "^8.3.4", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.2", "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.3", "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": "^3.1.3", "vite-plugin-dts": "^1.5.0", "vitest": "^0.23.4", "white-web-sdk": "^2.16.35" } };
12796
12804
  this.emitter = callbacks;
12797
12805
  this.viewMode$ = new valueEnhancer.Val(whiteWebSdk.ViewMode.Broadcaster);
@@ -13187,6 +13195,9 @@
13187
13195
  setViewMode(mode) {
13188
13196
  var _a2;
13189
13197
  log("setViewMode", mode);
13198
+ if (this.viewMode$.value === "scroll" && mode !== "scroll") {
13199
+ throw new InvalidViewModeError();
13200
+ }
13190
13201
  const mainViewProxy = (_a2 = this.appManager) == null ? void 0 : _a2.mainViewProxy;
13191
13202
  if (mode === whiteWebSdk.ViewMode.Broadcaster || mode === whiteWebSdk.ViewMode.Follower) {
13192
13203
  if (this.canOperate && mode === whiteWebSdk.ViewMode.Broadcaster) {
@@ -13599,6 +13610,7 @@
13599
13610
  exports2.BuiltinApps = BuiltinApps;
13600
13611
  exports2.BuiltinAppsMap = BuiltinAppsMap;
13601
13612
  exports2.InvalidScenePath = InvalidScenePath;
13613
+ exports2.InvalidViewModeError = InvalidViewModeError;
13602
13614
  exports2.ParamsInvalidError = ParamsInvalidError;
13603
13615
  exports2.WhiteWebSDKInvalidError = WhiteWebSDKInvalidError;
13604
13616
  exports2.WindowManager = WindowManager;
@@ -25,3 +25,6 @@ export declare class BoxManagerNotInitializeError extends Error {
25
25
  export declare class BindContainerRoomPhaseInvalidError extends Error {
26
26
  message: string;
27
27
  }
28
+ export declare class InvalidViewModeError extends Error {
29
+ message: string;
30
+ }
package/package.json CHANGED
@@ -1,11 +1,22 @@
1
1
  {
2
2
  "name": "@netless/window-manager",
3
- "version": "1.0.0-canary.69",
3
+ "version": "1.0.0-canary.70",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/src/index.d.ts",
8
8
  "repository": "netless-io/window-manager",
9
+ "scripts": {
10
+ "prettier": "prettier --write .",
11
+ "dev": "vite build --watch",
12
+ "build": "vite build",
13
+ "type-gen": "tsc --emitDeclarationOnly",
14
+ "predev": "yarn type-gen",
15
+ "build:lib:types": "tsc --emitDeclarationOnly",
16
+ "lint": "eslint --ext .ts,.tsx,.svelte . && prettier --check .",
17
+ "test": "vitest",
18
+ "e2e": "playwright test"
19
+ },
9
20
  "keywords": [],
10
21
  "author": "",
11
22
  "license": "ISC",
@@ -57,16 +68,5 @@
57
68
  "vite-plugin-dts": "^1.5.0",
58
69
  "vitest": "^0.23.4",
59
70
  "white-web-sdk": "^2.16.35"
60
- },
61
- "scripts": {
62
- "prettier": "prettier --write .",
63
- "dev": "vite build --watch",
64
- "build": "vite build",
65
- "type-gen": "tsc --emitDeclarationOnly",
66
- "predev": "yarn type-gen",
67
- "build:lib:types": "tsc --emitDeclarationOnly",
68
- "lint": "eslint --ext .ts,.tsx,.svelte . && prettier --check .",
69
- "test": "vitest",
70
- "e2e": "playwright test"
71
71
  }
72
- }
72
+ }
@@ -38,3 +38,7 @@ export class BoxManagerNotInitializeError extends Error {
38
38
  export class BindContainerRoomPhaseInvalidError extends Error {
39
39
  override message = "[WindowManager]: room phase only Connected can be bindContainer";
40
40
  }
41
+
42
+ export class InvalidViewModeError extends Error {
43
+ override message = "[WindowManager]: scroll mode cannot be switched to other viewMode";
44
+ }
@@ -42,7 +42,9 @@ export class MainViewProxy {
42
42
  releaseView(this.mainView);
43
43
  }),
44
44
  ]);
45
- this.createViewSync();
45
+ if (manager.windowManger.viewMode$.value !== 'scroll') {
46
+ this.createViewSync();
47
+ }
46
48
  this.sideEffectManager.add(() => emitter.on("focusedChange", ({ focused }) => {
47
49
  if (focused === undefined) {
48
50
  const scenePath = this.store.getMainViewScenePath();
package/src/index.ts CHANGED
@@ -626,6 +626,9 @@ export class WindowManager extends InvisiblePlugin<WindowMangerAttributes, any>
626
626
  */
627
627
  public setViewMode(mode: ManagerViewMode): void {
628
628
  log("setViewMode", mode);
629
+ if (this.viewMode$.value === 'scroll' && mode !== 'scroll') {
630
+ throw new Errors.InvalidViewModeError();
631
+ }
629
632
  const mainViewProxy = this.appManager?.mainViewProxy;
630
633
  if (mode === ViewMode.Broadcaster || mode === ViewMode.Follower) {
631
634
  if (this.canOperate && mode === ViewMode.Broadcaster) {