@netless/window-manager 1.0.0-canary.41 → 1.0.0-canary.44
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 +20 -16
- package/dist/index.umd.js +8 -8
- package/dist/src/index.d.ts +6 -6
- package/docs/mirgrate-to-1.0.md +34 -5
- package/package.json +2 -2
- package/pnpm-lock.yaml +4 -4
- package/src/index.ts +8 -8
package/dist/index.es.js
CHANGED
@@ -5181,7 +5181,7 @@ class TeleBoxManager {
|
|
5181
5181
|
stageStyle = "",
|
5182
5182
|
defaultBoxBodyStyle = null,
|
5183
5183
|
defaultBoxStageStyle = null,
|
5184
|
-
theme =
|
5184
|
+
theme = null
|
5185
5185
|
} = {}) {
|
5186
5186
|
this.events = new Emittery();
|
5187
5187
|
this._sideEffect = new SideEffectManager();
|
@@ -5260,6 +5260,9 @@ class TeleBoxManager {
|
|
5260
5260
|
}));
|
5261
5261
|
const darkMode$ = combine$1([prefersDark$, prefersColorScheme$], ([prefersDark, prefersColorScheme2]) => prefersColorScheme2 === "auto" ? prefersDark : prefersColorScheme2 === "dark");
|
5262
5262
|
const state$ = combine$1([minimized$, maximized$], ([minimized2, maximized2]) => minimized2 ? TELE_BOX_STATE.Minimized : maximized2 ? TELE_BOX_STATE.Maximized : TELE_BOX_STATE.Normal);
|
5263
|
+
const theme$ = new Val$1(theme, {
|
5264
|
+
compare: shallowequal
|
5265
|
+
});
|
5263
5266
|
const readonlyValConfig = {
|
5264
5267
|
darkMode: darkMode$,
|
5265
5268
|
state: state$,
|
@@ -5279,7 +5282,8 @@ class TeleBoxManager {
|
|
5279
5282
|
containerStyle: containerStyle$,
|
5280
5283
|
stageStyle: stageStyle$,
|
5281
5284
|
defaultBoxBodyStyle: defaultBoxBodyStyle$,
|
5282
|
-
defaultBoxStageStyle: defaultBoxStageStyle
|
5285
|
+
defaultBoxStageStyle: defaultBoxStageStyle$,
|
5286
|
+
theme: theme$
|
5283
5287
|
};
|
5284
5288
|
withValueEnhancer$1(this, valConfig, valManager);
|
5285
5289
|
const closeBtnClassName = this.wrapClassName("titlebar-icon-close");
|
@@ -5331,8 +5335,14 @@ class TeleBoxManager {
|
|
5331
5335
|
minimized$.subscribe((minimized2) => {
|
5332
5336
|
this.$container.classList.toggle(this.wrapClassName("is-minimized"), minimized2);
|
5333
5337
|
}),
|
5334
|
-
containerStyle
|
5338
|
+
combine$1([containerStyle$, theme$]).subscribe(([containerStyle2, theme2]) => {
|
5335
5339
|
this.$container.style.cssText = containerStyle2;
|
5340
|
+
if (theme2) {
|
5341
|
+
Object.keys(theme2).forEach((key) => {
|
5342
|
+
var _a;
|
5343
|
+
this.$container.style.setProperty(`--tele-${key}`, (_a = theme2[key]) != null ? _a : null);
|
5344
|
+
});
|
5345
|
+
}
|
5336
5346
|
}),
|
5337
5347
|
stageStyle$.subscribe((stageStyle2) => {
|
5338
5348
|
this.$stage.style.cssText = stageStyle2;
|
@@ -5548,12 +5558,6 @@ class TeleBoxManager {
|
|
5548
5558
|
}
|
5549
5559
|
return deletedBoxes;
|
5550
5560
|
}
|
5551
|
-
setTheme(theme) {
|
5552
|
-
Object.keys(theme).forEach((key) => {
|
5553
|
-
var _a;
|
5554
|
-
this.$container.style.setProperty(`--tele-${key}`, (_a = theme[key]) != null ? _a : null);
|
5555
|
-
});
|
5556
|
-
}
|
5557
5561
|
mount(root) {
|
5558
5562
|
this._root$.setValue(root);
|
5559
5563
|
}
|
@@ -12908,17 +12912,16 @@ const reconnectRefresher = new ReconnectRefresher({ emitter });
|
|
12908
12912
|
const _WindowManager = class extends InvisiblePlugin {
|
12909
12913
|
constructor(context) {
|
12910
12914
|
super(context);
|
12911
|
-
this.version = "1.0.0-canary.
|
12912
|
-
this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "1.0.0-alpha.
|
12915
|
+
this.version = "1.0.0-canary.44";
|
12916
|
+
this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "1.0.0-alpha.35", "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" } };
|
12913
12917
|
this.emitter = callbacks;
|
12914
12918
|
this.viewMode = ViewMode.Broadcaster;
|
12915
12919
|
this.viewMode$ = new Val$1(ViewMode.Broadcaster);
|
12916
12920
|
this.isReplay = isPlayer(this.displayer);
|
12917
12921
|
this.cameraUpdating = 0;
|
12918
12922
|
this.containerSizeRatio = _WindowManager.containerSizeRatio;
|
12919
|
-
this.moveCamera =
|
12923
|
+
this.moveCamera = (camera) => {
|
12920
12924
|
var _a;
|
12921
|
-
console.log("moveCamera", performance.now());
|
12922
12925
|
const mainViewCamera = __spreadValues({}, this.mainView.camera);
|
12923
12926
|
const nextCamera = __spreadValues(__spreadValues({}, mainViewCamera), camera);
|
12924
12927
|
if (isEqual(nextCamera, mainViewCamera))
|
@@ -12962,9 +12965,9 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
12962
12965
|
this.mainView.callbacks.off("onCameraUpdated", onCameraUpdated);
|
12963
12966
|
this.mainView.callbacks.on("onCameraUpdated", onCameraUpdated);
|
12964
12967
|
}
|
12965
|
-
}
|
12968
|
+
};
|
12966
12969
|
_WindowManager.displayer = context.displayer;
|
12967
|
-
window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "1.0.0-alpha.
|
12970
|
+
window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "1.0.0-alpha.35", "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" } };
|
12968
12971
|
}
|
12969
12972
|
static async mount(params) {
|
12970
12973
|
var _a;
|
@@ -13021,7 +13024,8 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
13021
13024
|
stageRatio: _WindowManager.containerSizeRatio,
|
13022
13025
|
containerStyle: params.containerStyle,
|
13023
13026
|
stageStyle: params.stageStyle,
|
13024
|
-
fullscreen: params.fullscreen
|
13027
|
+
fullscreen: params.fullscreen,
|
13028
|
+
theme: params.theme
|
13025
13029
|
});
|
13026
13030
|
(_a = manager.appManager) == null ? void 0 : _a.setBoxManager(manager.boxManager);
|
13027
13031
|
if (params.container) {
|