@netless/window-manager 0.4.32 → 0.4.35
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 +15 -0
- package/dist/Helper.d.ts +2 -0
- package/dist/index.cjs.js +12 -12
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +32 -17
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +12 -12
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/App/AppProxy.ts +4 -0
- package/src/AppManager.ts +1 -8
- package/src/Cursor/index.ts +1 -1
- package/src/Helper.ts +17 -1
- package/src/ReconnectRefresher.ts +9 -3
- package/src/index.ts +6 -12
- package/src/style.css +1 -1
package/dist/index.es.js
CHANGED
@@ -1471,6 +1471,10 @@ class AppProxy {
|
|
1471
1471
|
});
|
1472
1472
|
if (this.isAddApp && this.box) {
|
1473
1473
|
this.store.updateAppState(appId, AppAttributes.ZIndex, this.box.zIndex);
|
1474
|
+
this.store.updateAppState(appId, AppAttributes.Size, {
|
1475
|
+
width: this.box.intrinsicWidth,
|
1476
|
+
height: this.box.intrinsicHeight
|
1477
|
+
});
|
1474
1478
|
this.boxManager.focusBox({ appId }, false);
|
1475
1479
|
}
|
1476
1480
|
} catch (error) {
|
@@ -2281,14 +2285,6 @@ class AppManager {
|
|
2281
2285
|
this.appProxies.forEach((appProxy) => {
|
2282
2286
|
appProxy.emitAppIsWritableChange();
|
2283
2287
|
});
|
2284
|
-
if (isWritable === true) {
|
2285
|
-
this.mainView.disableCameraTransform = false;
|
2286
|
-
if (this.room && this.room.disableSerialization === true) {
|
2287
|
-
this.room.disableSerialization = false;
|
2288
|
-
}
|
2289
|
-
} else {
|
2290
|
-
this.mainView.disableCameraTransform = true;
|
2291
|
-
}
|
2292
2288
|
emitter.emit("writableChange", isWritable);
|
2293
2289
|
};
|
2294
2290
|
this.updateSceneIndex = () => {
|
@@ -2656,6 +2652,7 @@ class AppManager {
|
|
2656
2652
|
}
|
2657
2653
|
}
|
2658
2654
|
async onReconnected() {
|
2655
|
+
this.attributesUpdateCallback(this.attributes.apps);
|
2659
2656
|
const appProxies = Array.from(this.appProxies.values());
|
2660
2657
|
const reconnected = appProxies.map((appProxy) => {
|
2661
2658
|
return appProxy.onReconnected();
|
@@ -2720,6 +2717,19 @@ const findMemberByUid = (room, uid) => {
|
|
2720
2717
|
return ((_a = member.payload) == null ? void 0 : _a.uid) === uid;
|
2721
2718
|
});
|
2722
2719
|
};
|
2720
|
+
const createInvisiblePlugin = async (room) => {
|
2721
|
+
try {
|
2722
|
+
const manager = await room.createInvisiblePlugin(WindowManager, {});
|
2723
|
+
return manager;
|
2724
|
+
} catch (error) {
|
2725
|
+
if (error.message === `invisible plugin "WindowManager" exits`) {
|
2726
|
+
await wait(200);
|
2727
|
+
return room.getInvisiblePlugin(WindowManager.kind);
|
2728
|
+
} else {
|
2729
|
+
log("createInvisiblePlugin failed", error);
|
2730
|
+
}
|
2731
|
+
}
|
2732
|
+
};
|
2723
2733
|
const ResizeObserver$2 = window.ResizeObserver || ResizeObserver$3;
|
2724
2734
|
class ContainerResizeObserver {
|
2725
2735
|
constructor(emitter2) {
|
@@ -5610,7 +5620,7 @@ class CursorManager {
|
|
5610
5620
|
return;
|
5611
5621
|
}
|
5612
5622
|
this.updateCursor(this.getType(event), event.clientX, event.clientY);
|
5613
|
-
},
|
5623
|
+
}, 48);
|
5614
5624
|
this.getPoint = (view, clientX, clientY) => {
|
5615
5625
|
var _a2;
|
5616
5626
|
const rect = (_a2 = view == null ? void 0 : view.divElement) == null ? void 0 : _a2.getBoundingClientRect();
|
@@ -5755,19 +5765,24 @@ class ReconnectRefresher {
|
|
5755
5765
|
this.ctx = ctx;
|
5756
5766
|
this.reactors = /* @__PURE__ */ new Map();
|
5757
5767
|
this.disposers = /* @__PURE__ */ new Map();
|
5758
|
-
this.onPhaseChanged = (phase) => {
|
5759
|
-
var _a;
|
5768
|
+
this.onPhaseChanged = async (phase) => {
|
5769
|
+
var _a, _b;
|
5760
5770
|
if (phase === RoomPhase.Reconnecting) {
|
5761
5771
|
this.ctx.emitter.emit("startReconnect");
|
5762
5772
|
}
|
5763
5773
|
if (phase === RoomPhase.Connected && this.phase === RoomPhase.Reconnecting) {
|
5764
|
-
(_a = this.room) == null ? void 0 : _a.
|
5774
|
+
if ((_a = this.room) == null ? void 0 : _a.isWritable) {
|
5775
|
+
(_b = this.room) == null ? void 0 : _b.dispatchMagixEvent(EnsureReconnectEvent, {});
|
5776
|
+
} else {
|
5777
|
+
await wait(500);
|
5778
|
+
this.onReconnected();
|
5779
|
+
}
|
5765
5780
|
}
|
5766
5781
|
this.phase = phase;
|
5767
5782
|
};
|
5768
5783
|
this.onReconnected = debounce(() => {
|
5769
5784
|
this._onReconnected();
|
5770
|
-
},
|
5785
|
+
}, 1e3);
|
5771
5786
|
this._onReconnected = () => {
|
5772
5787
|
log("onReconnected refresh reactors");
|
5773
5788
|
this.releaseDisposers();
|
@@ -15079,7 +15094,7 @@ const reconnectRefresher = new ReconnectRefresher({ emitter });
|
|
15079
15094
|
const _WindowManager = class extends InvisiblePlugin {
|
15080
15095
|
constructor(context) {
|
15081
15096
|
super(context);
|
15082
|
-
this.version = "0.4.
|
15097
|
+
this.version = "0.4.35";
|
15083
15098
|
this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.2.26", "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": { "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "^0.2.9", "@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", "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.10" } };
|
15084
15099
|
this.emitter = callbacks$1;
|
15085
15100
|
this.viewMode = ViewMode.Broadcaster;
|
@@ -15162,12 +15177,12 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
15162
15177
|
} catch (error) {
|
15163
15178
|
throw new Error("[WindowManger]: room must be switched to be writable");
|
15164
15179
|
}
|
15165
|
-
manager = await
|
15166
|
-
manager.ensureAttributes();
|
15180
|
+
manager = await createInvisiblePlugin(room);
|
15181
|
+
manager == null ? void 0 : manager.ensureAttributes();
|
15167
15182
|
await wait(500);
|
15168
15183
|
await room.setWritable(false);
|
15169
15184
|
} else {
|
15170
|
-
manager = await
|
15185
|
+
manager = await createInvisiblePlugin(room);
|
15171
15186
|
}
|
15172
15187
|
}
|
15173
15188
|
}
|