@netless/window-manager 0.4.27 → 0.4.28

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/docs/advanced.md CHANGED
@@ -122,7 +122,16 @@ if (manager.boxState === "maximized") {
122
122
  const app = manager.queryOne(manager.focused)
123
123
  // 有 view 的 app 才可以插入图片, 像是 视频,音频之类的 app 是没有 view 的
124
124
  if (app.view) {
125
- app.view.insertImage()
125
+ var imageInformation = {
126
+ uuid: uuid,
127
+ centerX: centerX,
128
+ centerY: centerY,
129
+ width: width,
130
+ height: height,
131
+ locked: false,
132
+ };
133
+ app.view.insertImage(imageInformation);
134
+ app.view.completeImageUpload(uuid, src);
126
135
  }
127
136
  }
128
137
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netless/window-manager",
3
- "version": "0.4.27",
3
+ "version": "0.4.28",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
package/src/AppManager.ts CHANGED
@@ -6,7 +6,7 @@ import { appRegister } from "./Register";
6
6
  import { autorun, isPlayer, isRoom, ScenePathType } from "white-web-sdk";
7
7
  import { callbacks } from "./callback";
8
8
  import { debounce, get, isInteger, orderBy } from "lodash";
9
- import { emitter, RemoveSceneParams } from "./InternalEmitter";
9
+ import { emitter } from "./InternalEmitter";
10
10
  import { Fields, store } from "./AttributesDelegate";
11
11
  import { log } from "./Utils/log";
12
12
  import { MainViewProxy } from "./View/MainView";
@@ -16,7 +16,7 @@ import { RedoUndo } from "./RedoUndo";
16
16
  import { SideEffectManager } from "side-effect-manager";
17
17
  import { ViewManager } from "./View/ViewManager";
18
18
  import type { SyncRegisterAppPayload } from "./Register";
19
- import type { EmitterEvent } from "./InternalEmitter";
19
+ import type { EmitterEvent , RemoveSceneParams } from "./InternalEmitter";
20
20
  import {
21
21
  entireScenes,
22
22
  genAppId,
package/src/index.ts CHANGED
@@ -539,6 +539,10 @@ export class WindowManager extends InvisiblePlugin<WindowMangerAttributes> imple
539
539
 
540
540
  public async removePage(index: number): Promise<boolean> {
541
541
  if (this.appManager) {
542
+ if (this.pageState.length === 1) {
543
+ console.warn(`[WindowManager]: can not remove the last page`);
544
+ return false;
545
+ }
542
546
  if (index < 0 || index >= this.pageState.length) {
543
547
  console.warn(`[WindowManager]: index ${index} out of range`);
544
548
  return false;