@netless/window-manager 1.0.7-beta.9 → 1.0.9-beta.0
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/index.d.ts +1 -2
- package/dist/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -37
- package/dist/index.mjs.map +1 -1
- package/docs/api.md +3 -2
- package/docs/cn/api.md +1 -0
- package/package.json +1 -1
- package/src/AppListener.ts +19 -19
- package/src/AppManager.ts +11 -13
- package/src/index.ts +5 -2
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import pRetry from "p-retry";
|
|
2
2
|
import Emittery from "emittery";
|
|
3
|
-
import { debounce,
|
|
3
|
+
import { debounce, isObject, has, get, size as size$1, mapValues, noop as noop$2, isEmpty, omit, pick, isEqual, isInteger, orderBy, isFunction, isNumber, isNull } from "lodash";
|
|
4
4
|
import { ScenePathType, UpdateEventKind, listenUpdated, unlistenUpdated, reaction, autorun, toJS, listenDisposed, unlistenDisposed, WhiteVersion, ApplianceNames, isRoom, ViewMode, AnimationMode, isPlayer, RoomPhase, PlayerPhase, InvisiblePlugin } from "white-web-sdk";
|
|
5
5
|
import { v4 } from "uuid";
|
|
6
6
|
import { ResizeObserver as ResizeObserver$3 } from "@juggle/resize-observer";
|
|
@@ -466,14 +466,6 @@ class AppListeners {
|
|
|
466
466
|
this.setMainViewScenePathHandler(data.payload);
|
|
467
467
|
break;
|
|
468
468
|
}
|
|
469
|
-
case Events.MoveCamera: {
|
|
470
|
-
this.moveCameraHandler(data.payload);
|
|
471
|
-
break;
|
|
472
|
-
}
|
|
473
|
-
case Events.MoveCameraToContain: {
|
|
474
|
-
this.moveCameraToContainHandler(data.payload);
|
|
475
|
-
break;
|
|
476
|
-
}
|
|
477
469
|
case Events.CursorMove: {
|
|
478
470
|
this.cursorMoveHandler(data.payload);
|
|
479
471
|
break;
|
|
@@ -513,14 +505,6 @@ class AppListeners {
|
|
|
513
505
|
setViewFocusScenePath(this.manager.mainView, nextScenePath);
|
|
514
506
|
callbacks$1.emit("mainViewScenePathChange", nextScenePath);
|
|
515
507
|
};
|
|
516
|
-
this.moveCameraHandler = (payload) => {
|
|
517
|
-
if (isEqual(omit(payload, ["animationMode"]), { ...this.manager.mainView.camera }))
|
|
518
|
-
return;
|
|
519
|
-
this.manager.mainView.moveCamera(payload);
|
|
520
|
-
};
|
|
521
|
-
this.moveCameraToContainHandler = (payload) => {
|
|
522
|
-
this.manager.mainView.moveCameraToContain(payload);
|
|
523
|
-
};
|
|
524
508
|
this.cursorMoveHandler = (payload) => {
|
|
525
509
|
internalEmitter.emit("cursorMove", payload);
|
|
526
510
|
};
|
|
@@ -8517,15 +8501,12 @@ class AppManager {
|
|
|
8517
8501
|
var _a;
|
|
8518
8502
|
if (Object.keys(this.attributes.apps).length && this.store.focus) {
|
|
8519
8503
|
this._focusAppId = this.store.focus;
|
|
8520
|
-
console.log("onCreated===>", this._focusAppId);
|
|
8521
8504
|
await new Promise((resolve) => {
|
|
8522
8505
|
this._focusAppCreatedResolve = resolve;
|
|
8523
8506
|
this._resolveTimer = setTimeout(() => {
|
|
8524
|
-
console.log("onCreated===>3333", this._focusAppId);
|
|
8525
8507
|
resolve(this.appProxies.get(this._focusAppId || ""));
|
|
8526
8508
|
}, 500);
|
|
8527
8509
|
}).then(() => {
|
|
8528
|
-
console.log("onCreated===>2222", this._focusAppId);
|
|
8529
8510
|
this.focusByAttributes(this.attributes.apps);
|
|
8530
8511
|
});
|
|
8531
8512
|
}
|
|
@@ -8581,14 +8562,16 @@ class AppManager {
|
|
|
8581
8562
|
this.displayerWritableListener(!((_a = this.room) == null ? void 0 : _a.isWritable));
|
|
8582
8563
|
this.displayer.callbacks.on("onEnableWriteNowChanged", this.displayerWritableListener);
|
|
8583
8564
|
this._prevFocused = this.attributes.focus;
|
|
8584
|
-
|
|
8585
|
-
|
|
8586
|
-
|
|
8587
|
-
|
|
8588
|
-
|
|
8565
|
+
if (!WindowManager.supportAppliancePlugin) {
|
|
8566
|
+
this.sideEffectManager.add(() => {
|
|
8567
|
+
const redoUndo = new RedoUndo({
|
|
8568
|
+
mainView: () => this.mainViewProxy.view,
|
|
8569
|
+
focus: () => this.attributes.focus,
|
|
8570
|
+
getAppProxy: (id2) => this.appProxies.get(id2)
|
|
8571
|
+
});
|
|
8572
|
+
return () => redoUndo.destroy();
|
|
8589
8573
|
});
|
|
8590
|
-
|
|
8591
|
-
});
|
|
8574
|
+
}
|
|
8592
8575
|
}
|
|
8593
8576
|
notifyAppsChange(appIds) {
|
|
8594
8577
|
if (this._appIds.length !== appIds.length || !this._appIds.every((id2) => appIds.includes(id2))) {
|
|
@@ -8637,7 +8620,6 @@ class AppManager {
|
|
|
8637
8620
|
false
|
|
8638
8621
|
);
|
|
8639
8622
|
if (appProxy && this._focusAppId === id2 && this._focusAppCreatedResolve) {
|
|
8640
|
-
console.log("onCreated===>4444", this._focusAppId);
|
|
8641
8623
|
if (this._resolveTimer) {
|
|
8642
8624
|
clearTimeout(this._resolveTimer);
|
|
8643
8625
|
}
|
|
@@ -19657,7 +19639,7 @@ const reconnectRefresher = new ReconnectRefresher({ emitter: internalEmitter });
|
|
|
19657
19639
|
const _WindowManager = class extends InvisiblePlugin {
|
|
19658
19640
|
constructor(context) {
|
|
19659
19641
|
super(context);
|
|
19660
|
-
this.version = "1.0.
|
|
19642
|
+
this.version = "1.0.9-beta.0";
|
|
19661
19643
|
this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.3.0-beta.14", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "uuid": "^7.0.3", "video.js": ">=7" }, "peerDependencies": { "jspdf": "2.5.1", "white-web-sdk": "^2.16.52" }, "devDependencies": { "@hyrious/dts": "^0.2.2", "@netless/app-docs-viewer": "^0.2.19", "@netless/app-media-player": "0.1.4", "@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.30", "@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", "jspdf": "^2.5.1", "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", "side-effect-manager": "0.1.5", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^2.9.9", "vitest": "^0.14.1", "white-web-sdk": "^2.16.52" } };
|
|
19662
19644
|
this.emitter = callbacks$1;
|
|
19663
19645
|
this.viewMode = ViewMode.Broadcaster;
|
|
@@ -20270,25 +20252,21 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
|
20270
20252
|
}
|
|
20271
20253
|
}
|
|
20272
20254
|
moveCamera(camera) {
|
|
20273
|
-
var _a;
|
|
20274
20255
|
const pureCamera = omit(camera, ["animationMode"]);
|
|
20275
20256
|
const mainViewCamera = { ...this.mainView.camera };
|
|
20276
20257
|
if (isEqual({ ...mainViewCamera, ...pureCamera }, mainViewCamera))
|
|
20277
20258
|
return;
|
|
20278
20259
|
this.mainView.moveCamera(camera);
|
|
20279
|
-
(_a = this.appManager) == null ? void 0 : _a.dispatchInternalEvent(Events.MoveCamera, camera);
|
|
20280
20260
|
setTimeout(() => {
|
|
20281
|
-
var
|
|
20282
|
-
(
|
|
20261
|
+
var _a;
|
|
20262
|
+
(_a = this.appManager) == null ? void 0 : _a.mainViewProxy.setCameraAndSize();
|
|
20283
20263
|
}, 500);
|
|
20284
20264
|
}
|
|
20285
20265
|
moveCameraToContain(rectangle) {
|
|
20286
|
-
var _a;
|
|
20287
20266
|
this.mainView.moveCameraToContain(rectangle);
|
|
20288
|
-
(_a = this.appManager) == null ? void 0 : _a.dispatchInternalEvent(Events.MoveCameraToContain, rectangle);
|
|
20289
20267
|
setTimeout(() => {
|
|
20290
|
-
var
|
|
20291
|
-
(
|
|
20268
|
+
var _a;
|
|
20269
|
+
(_a = this.appManager) == null ? void 0 : _a.mainViewProxy.setCameraAndSize();
|
|
20292
20270
|
}, 500);
|
|
20293
20271
|
}
|
|
20294
20272
|
convertToPointInWorld(point) {
|