@netless/window-manager 0.4.16 → 0.4.17
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 +5 -1
- package/dist/AppManager.d.ts +1 -0
- package/dist/index.es.js +3 -3
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +3 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/AppManager.ts +5 -4
- package/src/InternalEmitter.ts +1 -1
- package/src/Utils/RoomHacker.ts +6 -2
- package/.eslintignore +0 -4
- package/.eslintrc.js +0 -28
- package/.idea/inspectionProfiles/Project_Default.xml +0 -7
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/.idea/window-manager.iml +0 -12
- package/.vscode/settings.json +0 -22
package/package.json
CHANGED
package/src/AppManager.ts
CHANGED
@@ -130,9 +130,7 @@ export class AppManager {
|
|
130
130
|
* 所以需要关掉所有开启了 view 的 app
|
131
131
|
*/
|
132
132
|
public async onRootDirRemoved(needClose = true) {
|
133
|
-
this.rootDirRemoving = true;
|
134
133
|
this.setMainViewScenePath(INIT_DIR);
|
135
|
-
|
136
134
|
this.createRootDirScenesCallback();
|
137
135
|
|
138
136
|
for (const [id, appProxy] of this.appProxies.entries()) {
|
@@ -142,9 +140,8 @@ export class AppManager {
|
|
142
140
|
}
|
143
141
|
// 删除了根目录的 scenes 之后 mainview 需要重新绑定, 否则主白板会不能渲染
|
144
142
|
this.mainViewProxy.rebind();
|
145
|
-
|
146
143
|
emitter.emit("rootDirRemoved");
|
147
|
-
this.
|
144
|
+
this.updateRootDirRemoving(false);
|
148
145
|
}
|
149
146
|
|
150
147
|
private onReadonlyChanged = () => {
|
@@ -732,6 +729,10 @@ export class AppManager {
|
|
732
729
|
});
|
733
730
|
}
|
734
731
|
|
732
|
+
public updateRootDirRemoving = (removing: boolean) => {
|
733
|
+
this.rootDirRemoving = removing;
|
734
|
+
}
|
735
|
+
|
735
736
|
public dispatchInternalEvent(event: Events, payload?: any) {
|
736
737
|
this.safeDispatchMagixEvent(MagixEventName, {
|
737
738
|
eventName: event,
|
package/src/InternalEmitter.ts
CHANGED
package/src/Utils/RoomHacker.ts
CHANGED
@@ -2,6 +2,7 @@ import { emitter } from "../InternalEmitter";
|
|
2
2
|
import { isPlayer } from "white-web-sdk";
|
3
3
|
import type { WindowManager } from "../index";
|
4
4
|
import type { Camera, Room, Player, PlayerSeekingResult } from "white-web-sdk";
|
5
|
+
import { ROOT_DIR } from "../constants";
|
5
6
|
|
6
7
|
// 修改多窗口状态下一些失效的方法实现到 manager 的 mainview 上, 降低迁移成本
|
7
8
|
export const replaceRoomFunction = (room: Room | Player, manager: WindowManager) => {
|
@@ -54,13 +55,16 @@ export const replaceRoomFunction = (room: Room | Player, manager: WindowManager)
|
|
54
55
|
room.lockImage = (...args) => manager.lockImage(...args);
|
55
56
|
room.lockImages = (...args) => manager.lockImages(...args);
|
56
57
|
|
57
|
-
delegateRemoveScenes(room);
|
58
|
+
delegateRemoveScenes(room, manager);
|
58
59
|
}
|
59
60
|
};
|
60
61
|
|
61
|
-
const delegateRemoveScenes = (room: Room) => {
|
62
|
+
const delegateRemoveScenes = (room: Room, manager: WindowManager) => {
|
62
63
|
const originRemoveScenes = room.removeScenes;
|
63
64
|
room.removeScenes = (scenePath: string) => {
|
65
|
+
if (scenePath === ROOT_DIR) {
|
66
|
+
manager.appManager?.updateRootDirRemoving(true);
|
67
|
+
}
|
64
68
|
const result = originRemoveScenes.call(room, scenePath);
|
65
69
|
emitter.emit("removeScenes", scenePath);
|
66
70
|
return result;
|
package/.eslintignore
DELETED
package/.eslintrc.js
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
/** @type {import("eslint").Linter.Config */
|
2
|
-
const config = {
|
3
|
-
root: true,
|
4
|
-
env: {
|
5
|
-
browser: true,
|
6
|
-
},
|
7
|
-
parser: "@typescript-eslint/parser",
|
8
|
-
plugins: ["svelte3", "@typescript-eslint"],
|
9
|
-
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
|
10
|
-
rules: {
|
11
|
-
"@typescript-eslint/consistent-type-imports": ["warn"],
|
12
|
-
"@typescript-eslint/no-empty-interface": "off",
|
13
|
-
"@typescript-eslint/no-explicit-any": "off",
|
14
|
-
"@typescript-eslint/explicit-module-boundary-types": "off",
|
15
|
-
},
|
16
|
-
overrides: [
|
17
|
-
{
|
18
|
-
files: ["*.svelte"],
|
19
|
-
processor: "svelte3/svelte3",
|
20
|
-
},
|
21
|
-
],
|
22
|
-
settings: {
|
23
|
-
"svelte3/typescript": true,
|
24
|
-
},
|
25
|
-
};
|
26
|
-
|
27
|
-
// eslint-disable-next-line no-undef
|
28
|
-
module.exports = config;
|
@@ -1,7 +0,0 @@
|
|
1
|
-
<component name="InspectionProjectProfileManager">
|
2
|
-
<profile version="1.0">
|
3
|
-
<option name="myName" value="Project Default" />
|
4
|
-
<inspection_tool class="ES6UnusedImports" enabled="false" level="WARNING" enabled_by_default="false" />
|
5
|
-
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
6
|
-
</profile>
|
7
|
-
</component>
|
package/.idea/modules.xml
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<project version="4">
|
3
|
-
<component name="ProjectModuleManager">
|
4
|
-
<modules>
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/window-manager.iml" filepath="$PROJECT_DIR$/.idea/window-manager.iml" />
|
6
|
-
</modules>
|
7
|
-
</component>
|
8
|
-
</project>
|
package/.idea/vcs.xml
DELETED
package/.idea/window-manager.iml
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<module type="WEB_MODULE" version="4">
|
3
|
-
<component name="NewModuleRootManager">
|
4
|
-
<content url="file://$MODULE_DIR$">
|
5
|
-
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
6
|
-
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
7
|
-
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
8
|
-
</content>
|
9
|
-
<orderEntry type="inheritedJdk" />
|
10
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
11
|
-
</component>
|
12
|
-
</module>
|
package/.vscode/settings.json
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"cSpell.words": [
|
3
|
-
"autorun",
|
4
|
-
"Contian",
|
5
|
-
"Dexie",
|
6
|
-
"Displayer",
|
7
|
-
"Emittery",
|
8
|
-
"esbuild",
|
9
|
-
"loadjs",
|
10
|
-
"localforge",
|
11
|
-
"Magix",
|
12
|
-
"mainview",
|
13
|
-
"minheight",
|
14
|
-
"minwidth",
|
15
|
-
"predev",
|
16
|
-
"SCENEPATH",
|
17
|
-
"sveltejs",
|
18
|
-
"telebox",
|
19
|
-
"titlebar",
|
20
|
-
"vite"
|
21
|
-
]
|
22
|
-
}
|