@netless/window-manager 1.0.0-canary.38 → 1.0.0-canary.40
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.cjs.js +8 -8
- package/dist/index.es.js +62 -45
- package/dist/index.umd.js +8 -8
- package/dist/src/Utils/error.d.ts +1 -1
- package/dist/src/callback.d.ts +3 -2
- package/dist/src/index.d.ts +4 -3
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/pnpm-lock.yaml +4 -4
- package/src/App/AppProxy.ts +2 -2
- package/src/BoxManager.ts +6 -2
- package/src/Utils/error.ts +2 -2
- package/src/callback.ts +4 -3
- package/src/index.ts +19 -63
package/dist/index.es.js
CHANGED
@@ -689,10 +689,10 @@ class InvalidScenePath extends Error {
|
|
689
689
|
this.message = `[WindowManager]: ScenePath should start with "/"`;
|
690
690
|
}
|
691
691
|
}
|
692
|
-
class
|
692
|
+
class BoxManagerNotInitializeError extends Error {
|
693
693
|
constructor() {
|
694
694
|
super(...arguments);
|
695
|
-
this.message = "[WindowManager]: boxManager
|
695
|
+
this.message = "[WindowManager]: boxManager need initialize";
|
696
696
|
}
|
697
697
|
}
|
698
698
|
class BindContainerRoomPhaseInvalidError extends Error {
|
@@ -1947,7 +1947,7 @@ class AppProxy {
|
|
1947
1947
|
var _a;
|
1948
1948
|
log("setupApp", appId, app, options);
|
1949
1949
|
if (!this.boxManager) {
|
1950
|
-
throw new
|
1950
|
+
throw new BoxManagerNotInitializeError();
|
1951
1951
|
}
|
1952
1952
|
const context = new AppContext(this.manager, appId, this, appOptions);
|
1953
1953
|
this.appContext = context;
|
@@ -5111,8 +5111,8 @@ class MaxTitleBar extends DefaultTitleBar {
|
|
5111
5111
|
const $titleBar = super.render();
|
5112
5112
|
$titleBar.classList.add(this.wrapClassName("max-titlebar"));
|
5113
5113
|
this.sideEffect.addDisposer([
|
5114
|
-
this.state
|
5115
|
-
$titleBar.classList.toggle(this.wrapClassName("max-titlebar-
|
5114
|
+
combine$1([this.boxes$, this.state$]).subscribe(([boxes, state]) => {
|
5115
|
+
$titleBar.classList.toggle(this.wrapClassName("max-titlebar-active"), state === TELE_BOX_STATE.Maximized && boxes.length > 0);
|
5116
5116
|
}),
|
5117
5117
|
this.readonly$.subscribe((readonly) => {
|
5118
5118
|
$titleBar.classList.toggle(this.wrapClassName("readonly"), readonly);
|
@@ -5814,6 +5814,9 @@ class BoxManager {
|
|
5814
5814
|
}),
|
5815
5815
|
emitter2.on("containerSizeRatioUpdate", (ratio) => {
|
5816
5816
|
this.teleBoxManager._stageRatio$.setValue(ratio);
|
5817
|
+
}),
|
5818
|
+
this.teleBoxManager._fullscreen$.reaction((fullscreen) => {
|
5819
|
+
callbacks2.emit("fullscreenChange", fullscreen);
|
5817
5820
|
})
|
5818
5821
|
]);
|
5819
5822
|
}
|
@@ -12905,15 +12908,51 @@ const reconnectRefresher = new ReconnectRefresher({ emitter });
|
|
12905
12908
|
const _WindowManager = class extends InvisiblePlugin {
|
12906
12909
|
constructor(context) {
|
12907
12910
|
super(context);
|
12908
|
-
this.version = "1.0.0-canary.
|
12909
|
-
this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "1.0.0-alpha.
|
12911
|
+
this.version = "1.0.0-canary.40";
|
12912
|
+
this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "1.0.0-alpha.34", "emittery": "^0.11.0", "lodash": "^4.17.21", "p-retry": "^4.6.2", "side-effect-manager": "^1.1.1", "uuid": "^7.0.3", "value-enhancer": "^1.3.2" }, "peerDependencies": { "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "^0.3.0", "@netless/app-plyr": "0.2.0", "@playwright/test": "^1.23.2", "@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.49", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.6", "@types/node": "^18.0.3", "@types/uuid": "^8.3.4", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.2", "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.3", "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", "vite-plugin-dts": "^1.2.1", "vitest": "^0.18.0", "white-web-sdk": "2.16.26" } };
|
12910
12913
|
this.emitter = callbacks;
|
12911
12914
|
this.viewMode = ViewMode.Broadcaster;
|
12912
12915
|
this.viewMode$ = new Val$1(ViewMode.Broadcaster);
|
12913
12916
|
this.isReplay = isPlayer(this.displayer);
|
12914
12917
|
this.containerSizeRatio = _WindowManager.containerSizeRatio;
|
12918
|
+
this.moveCamera = debounce((camera) => {
|
12919
|
+
var _a;
|
12920
|
+
const mainViewCamera = __spreadValues({}, this.mainView.camera);
|
12921
|
+
const nextCamera = __spreadValues(__spreadValues({}, mainViewCamera), camera);
|
12922
|
+
if (isEqual(nextCamera, mainViewCamera))
|
12923
|
+
return;
|
12924
|
+
if (!this.appManager)
|
12925
|
+
return;
|
12926
|
+
if (camera.animationMode === AnimationMode.Immediately) {
|
12927
|
+
this.appManager.mainViewProxy.storeCamera(__spreadValues({
|
12928
|
+
id: this.appManager.uid
|
12929
|
+
}, nextCamera));
|
12930
|
+
} else {
|
12931
|
+
const remoteCamera = this.appManager.mainViewProxy.size$.value;
|
12932
|
+
const currentSize = (_a = this.boxManager) == null ? void 0 : _a.stageRect;
|
12933
|
+
let nextScale;
|
12934
|
+
if (camera.scale && remoteCamera && currentSize) {
|
12935
|
+
nextScale = camera.scale * computedMinScale(remoteCamera, currentSize);
|
12936
|
+
}
|
12937
|
+
if (nextScale) {
|
12938
|
+
this.mainView.moveCamera(__spreadProps(__spreadValues({}, camera), {
|
12939
|
+
scale: nextScale
|
12940
|
+
}));
|
12941
|
+
} else {
|
12942
|
+
this.mainView.moveCamera(camera);
|
12943
|
+
}
|
12944
|
+
this.appManager.dispatchInternalEvent(Events.MoveCamera, camera);
|
12945
|
+
setTimeout(() => {
|
12946
|
+
if (!this.appManager)
|
12947
|
+
return;
|
12948
|
+
this.appManager.mainViewProxy.storeCamera(__spreadValues({
|
12949
|
+
id: this.appManager.uid
|
12950
|
+
}, nextCamera));
|
12951
|
+
}, 200);
|
12952
|
+
}
|
12953
|
+
}, 200);
|
12915
12954
|
_WindowManager.displayer = context.displayer;
|
12916
|
-
window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "1.0.0-alpha.
|
12955
|
+
window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "1.0.0-alpha.34", "emittery": "^0.11.0", "lodash": "^4.17.21", "p-retry": "^4.6.2", "side-effect-manager": "^1.1.1", "uuid": "^7.0.3", "value-enhancer": "^1.3.2" }, "peerDependencies": { "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "^0.3.0", "@netless/app-plyr": "0.2.0", "@playwright/test": "^1.23.2", "@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.49", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.6", "@types/node": "^18.0.3", "@types/uuid": "^8.3.4", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.2", "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.3", "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", "vite-plugin-dts": "^1.2.1", "vitest": "^0.18.0", "white-web-sdk": "2.16.26" } };
|
12917
12956
|
}
|
12918
12957
|
static async mount(params) {
|
12919
12958
|
var _a;
|
@@ -13412,6 +13451,12 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
13412
13451
|
throw new AppManagerNotInitError();
|
13413
13452
|
}
|
13414
13453
|
}
|
13454
|
+
get teleboxManager() {
|
13455
|
+
if (!this.boxManager) {
|
13456
|
+
throw new BoxManagerNotInitializeError();
|
13457
|
+
}
|
13458
|
+
return this.boxManager.teleBoxManager;
|
13459
|
+
}
|
13415
13460
|
queryAll() {
|
13416
13461
|
var _a;
|
13417
13462
|
return Array.from(((_a = this.appManager) == null ? void 0 : _a.appProxies.values()) || []);
|
@@ -13424,42 +13469,6 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
13424
13469
|
var _a;
|
13425
13470
|
return (_a = this.appManager) == null ? void 0 : _a.closeApp(appId);
|
13426
13471
|
}
|
13427
|
-
moveCamera(camera) {
|
13428
|
-
var _a;
|
13429
|
-
const mainViewCamera = __spreadValues({}, this.mainView.camera);
|
13430
|
-
const nextCamera = __spreadValues(__spreadValues({}, mainViewCamera), camera);
|
13431
|
-
if (isEqual(nextCamera, mainViewCamera))
|
13432
|
-
return;
|
13433
|
-
if (!this.appManager)
|
13434
|
-
return;
|
13435
|
-
if (camera.animationMode === AnimationMode.Immediately) {
|
13436
|
-
this.appManager.mainViewProxy.storeCamera(__spreadValues({
|
13437
|
-
id: this.appManager.uid
|
13438
|
-
}, nextCamera));
|
13439
|
-
} else {
|
13440
|
-
const remoteCamera = this.appManager.mainViewProxy.size$.value;
|
13441
|
-
const currentSize = (_a = this.boxManager) == null ? void 0 : _a.stageRect;
|
13442
|
-
let nextScale;
|
13443
|
-
if (camera.scale && remoteCamera && currentSize) {
|
13444
|
-
nextScale = camera.scale * computedMinScale(remoteCamera, currentSize);
|
13445
|
-
}
|
13446
|
-
if (nextScale) {
|
13447
|
-
this.mainView.moveCamera(__spreadProps(__spreadValues({}, camera), {
|
13448
|
-
scale: nextScale
|
13449
|
-
}));
|
13450
|
-
} else {
|
13451
|
-
this.mainView.moveCamera(camera);
|
13452
|
-
}
|
13453
|
-
this.appManager.dispatchInternalEvent(Events.MoveCamera, camera);
|
13454
|
-
setTimeout(() => {
|
13455
|
-
if (!this.appManager)
|
13456
|
-
return;
|
13457
|
-
this.appManager.mainViewProxy.storeCamera(__spreadValues({
|
13458
|
-
id: this.appManager.uid
|
13459
|
-
}, nextCamera));
|
13460
|
-
}, 200);
|
13461
|
-
}
|
13462
|
-
}
|
13463
13472
|
convertToPointInWorld(point) {
|
13464
13473
|
return this.mainView.convertToPointInWorld(point);
|
13465
13474
|
}
|
@@ -13599,6 +13608,14 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
13599
13608
|
setBaseSize(size2) {
|
13600
13609
|
var _a;
|
13601
13610
|
(_a = this.appManager) == null ? void 0 : _a.mainViewProxy.setMainViewSize(size2);
|
13611
|
+
setTimeout(() => {
|
13612
|
+
if (!this.appManager || !this.appManager.mainViewProxy.camera$.value)
|
13613
|
+
return;
|
13614
|
+
this.appManager.mainViewProxy.storeCamera(__spreadProps(__spreadValues({}, this.appManager.mainViewProxy.camera$.value), {
|
13615
|
+
id: this.appManager.uid,
|
13616
|
+
scale: 1
|
13617
|
+
}));
|
13618
|
+
}, 500);
|
13602
13619
|
}
|
13603
13620
|
createPPTHandler() {
|
13604
13621
|
return {
|
@@ -13654,4 +13671,4 @@ WindowManager.debug = false;
|
|
13654
13671
|
WindowManager.containerSizeRatio = DEFAULT_CONTAINER_RATIO;
|
13655
13672
|
WindowManager.isCreated = false;
|
13656
13673
|
setupBuiltin();
|
13657
|
-
export { AppCreateError, AppManagerNotInitError, AppNotRegisterError, BindContainerRoomPhaseInvalidError,
|
13674
|
+
export { AppCreateError, AppManagerNotInitError, AppNotRegisterError, BindContainerRoomPhaseInvalidError, BoxManagerNotInitializeError, BoxNotCreatedError, BuiltinApps, BuiltinAppsMap, InvalidScenePath, ParamsInvalidError, WhiteWebSDKInvalidError, WindowManager, calculateNextIndex, reconnectRefresher };
|