@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/CHANGELOG.md +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +5 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/docs/advanced.md +10 -1
- package/package.json +1 -1
- package/src/AppManager.ts +2 -2
- package/src/index.ts +4 -0
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
|
-
|
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
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
|
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;
|