@netless/window-manager 1.0.0-canary.16 → 1.0.0-canary.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/dist/App/AppContext.d.ts +1 -1
- package/dist/index.cjs.js +9 -9
- package/dist/index.d.ts +5 -0
- package/dist/index.es.js +41 -12
- package/dist/index.umd.js +10 -10
- package/package.json +1 -1
- package/src/App/AppContext.ts +1 -1
- package/src/App/AppProxy.ts +2 -0
- package/src/AppManager.ts +0 -1
- package/src/ReconnectRefresher.ts +1 -1
- package/src/Utils/RoomHacker.ts +3 -0
- package/src/View/MainView.ts +9 -1
- package/src/View/ViewSync.ts +13 -15
- package/src/index.ts +18 -0
package/dist/index.d.ts
CHANGED
@@ -243,6 +243,11 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
|
|
243
243
|
/** @inner */
|
244
244
|
_refresh(): void;
|
245
245
|
setContainerSizeRatio(ratio: number): void;
|
246
|
+
createPPTHandler(): {
|
247
|
+
onPageJumpTo: (_pptUUID: string, index: number) => void;
|
248
|
+
onPageToNext: () => void;
|
249
|
+
onPageToPrev: () => void;
|
250
|
+
};
|
246
251
|
private isDynamicPPT;
|
247
252
|
private ensureAttributes;
|
248
253
|
}
|
package/dist/index.es.js
CHANGED
@@ -1324,16 +1324,13 @@ class ViewSync {
|
|
1324
1324
|
this.synchronizer.onRemoteSizeUpdate(size2);
|
1325
1325
|
}
|
1326
1326
|
}));
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
}
|
1333
|
-
}));
|
1334
|
-
}
|
1327
|
+
this.sem.add(() => this.context.stageRect$.reaction((rect) => {
|
1328
|
+
if (rect) {
|
1329
|
+
this.synchronizer.setRect(rect);
|
1330
|
+
}
|
1331
|
+
}));
|
1335
1332
|
const camera$size$ = combine([this.context.camera$, this.context.size$]);
|
1336
|
-
camera$size$.
|
1333
|
+
camera$size$.reaction(([camera, size2]) => {
|
1337
1334
|
if (camera && size2) {
|
1338
1335
|
this.synchronizer.onRemoteUpdate(camera, size2);
|
1339
1336
|
camera$size$.destroy();
|
@@ -2091,6 +2088,8 @@ class AppProxy {
|
|
2091
2088
|
this.manager.refresher.remove(this.id);
|
2092
2089
|
this.manager.refresher.remove(this.stateKey);
|
2093
2090
|
this.manager.refresher.remove(`${this.id}-fullPath`);
|
2091
|
+
this.manager.refresher.remove(`${this.id}-camera`);
|
2092
|
+
this.manager.refresher.remove(`${this.id}-size`);
|
2094
2093
|
this.valManager.destroy();
|
2095
2094
|
}
|
2096
2095
|
close() {
|
@@ -2248,6 +2247,14 @@ class MainViewProxy {
|
|
2248
2247
|
})
|
2249
2248
|
]);
|
2250
2249
|
this.createViewSync();
|
2250
|
+
this.sideEffectManager.add(() => emitter.on("focusedChange", ({ focused }) => {
|
2251
|
+
if (focused === void 0) {
|
2252
|
+
const scenePath = this.store.getMainViewScenePath();
|
2253
|
+
if (scenePath) {
|
2254
|
+
setScenePath(this.manager.room, scenePath);
|
2255
|
+
}
|
2256
|
+
}
|
2257
|
+
}));
|
2251
2258
|
}
|
2252
2259
|
ensureCameraAndSize() {
|
2253
2260
|
var _a;
|
@@ -2677,7 +2684,6 @@ class AppManager {
|
|
2677
2684
|
if (sceneState) {
|
2678
2685
|
const scenePath = sceneState.scenePath;
|
2679
2686
|
this.appProxies.forEach((appProxy) => {
|
2680
|
-
console.log("scenePath", scenePath, appProxy.scenePath);
|
2681
2687
|
if (appProxy.scenePath && scenePath.startsWith(appProxy.scenePath)) {
|
2682
2688
|
appProxy.emitAppSceneStateChange(sceneState);
|
2683
2689
|
appProxy.setFullPath(scenePath);
|
@@ -5928,7 +5934,7 @@ class ReconnectRefresher {
|
|
5928
5934
|
};
|
5929
5935
|
this.onReconnected = debounce(() => {
|
5930
5936
|
this._onReconnected();
|
5931
|
-
},
|
5937
|
+
}, 1e3);
|
5932
5938
|
this._onReconnected = () => {
|
5933
5939
|
log("onReconnected refresh reactors");
|
5934
5940
|
this.releaseDisposers();
|
@@ -6048,6 +6054,9 @@ const replaceRoomFunction = (room, manager) => {
|
|
6048
6054
|
room.lockImage = (...args) => manager.lockImage(...args);
|
6049
6055
|
room.lockImages = (...args) => manager.lockImages(...args);
|
6050
6056
|
delegateRemoveScenes(room, manager);
|
6057
|
+
if (!room.dynamicPpt.slideStateAdapter.pptHandler) {
|
6058
|
+
room.dynamicPpt.slideStateAdapter.pptHandler = manager.createPPTHandler();
|
6059
|
+
}
|
6051
6060
|
}
|
6052
6061
|
};
|
6053
6062
|
const delegateRemoveScenes = (room, manager) => {
|
@@ -15602,7 +15611,7 @@ const reconnectRefresher = new ReconnectRefresher({ emitter });
|
|
15602
15611
|
const _WindowManager = class extends InvisiblePlugin {
|
15603
15612
|
constructor(context) {
|
15604
15613
|
super(context);
|
15605
|
-
this.version = "1.0.0-canary.
|
15614
|
+
this.version = "1.0.0-canary.17";
|
15606
15615
|
this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "1.0.0-alpha.17", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "side-effect-manager": "^1.1.0", "uuid": "^7.0.3", "value-enhancer": "^1.3.0", "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" } };
|
15607
15616
|
this.emitter = callbacks$1;
|
15608
15617
|
this.viewMode = ViewMode.Broadcaster;
|
@@ -16242,6 +16251,26 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
16242
16251
|
this.containerSizeRatio = ratio;
|
16243
16252
|
emitter.emit("containerSizeRatioUpdate", ratio);
|
16244
16253
|
}
|
16254
|
+
createPPTHandler() {
|
16255
|
+
return {
|
16256
|
+
onPageJumpTo: (_pptUUID, index2) => {
|
16257
|
+
var _a, _b, _c, _d;
|
16258
|
+
(_d = (_c = (_b = (_a = this.appManager) == null ? void 0 : _a.focusApp) == null ? void 0 : _b.appContext) == null ? void 0 : _c.whiteBoardView) == null ? void 0 : _d.jumpPage(index2);
|
16259
|
+
},
|
16260
|
+
onPageToNext: () => {
|
16261
|
+
var _a, _b, _c, _d;
|
16262
|
+
if (this.focused) {
|
16263
|
+
(_d = (_c = (_b = (_a = this.appManager) == null ? void 0 : _a.focusApp) == null ? void 0 : _b.appContext) == null ? void 0 : _c.whiteBoardView) == null ? void 0 : _d.nextPage();
|
16264
|
+
}
|
16265
|
+
},
|
16266
|
+
onPageToPrev: () => {
|
16267
|
+
var _a, _b, _c, _d;
|
16268
|
+
if (this.focused) {
|
16269
|
+
(_d = (_c = (_b = (_a = this.appManager) == null ? void 0 : _a.focusApp) == null ? void 0 : _b.appContext) == null ? void 0 : _c.whiteBoardView) == null ? void 0 : _d.prevPage();
|
16270
|
+
}
|
16271
|
+
}
|
16272
|
+
};
|
16273
|
+
}
|
16245
16274
|
isDynamicPPT(scenes) {
|
16246
16275
|
var _a, _b;
|
16247
16276
|
const sceneSrc = (_b = (_a = scenes[0]) == null ? void 0 : _a.ppt) == null ? void 0 : _b.src;
|