@netless/window-manager 0.1.69-canary.2 → 0.2.3-canary.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/style.css CHANGED
@@ -1 +1 @@
1
- .netless-window-manager-playground{width:100%;height:100%;position:relative;z-index:1;overflow:hidden}.netless-window-manager-sizer{position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;overflow:hidden;display:flex}.netless-window-manager-sizer-horizontal{flex-direction:column}.netless-window-manager-sizer:before,.netless-window-manager-sizer:after{flex:1;content:"";display:block}.netless-window-manager-chess-sizer:before,.netless-window-manager-chess-sizer:after{background-image:linear-gradient(45deg,#b0b0b0 25%,transparent 25%),linear-gradient(-45deg,#b0b0b0 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#b0b0b0 75%),linear-gradient(-45deg,transparent 75%,#b0b0b0 75%);background-color:#fff;background-size:20px 20px;background-position:0 0,0 10px,10px -10px,-10px 0px}.netless-window-manager-wrapper{position:relative;z-index:1;width:100%;height:100%;overflow:hidden}.netless-window-manager-main-view{width:100%;height:100%}.cursor-box{color:#fff;padding:4px;border-radius:2px;width:100%;height:100%;position:absolute}.cursor-pencil-image{width:26px;height:26px}.cursor-selector-image{width:24px;height:24px}.cursor-selector-avatar{border-radius:50%;border-style:solid;border-width:2px;border-color:#fff;margin-bottom:2px}.cursor-selector-avatar img{width:12px}.cursor-inner{border-radius:4px;display:flex;align-items:center;justify-content:center;flex-direction:row;padding-left:4px;padding-right:4px;font-size:12px}.cursor-inner-mellow{height:32px;border-radius:16px;display:flex;align-items:center;justify-content:center;flex-direction:row;padding-left:16px;padding-right:16px}.cursor-tag-name{font-size:12px;margin-left:4px;padding:2px 8px;border-radius:4px}.netless-window-manager-cursor-mid{display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;width:26px;height:26px;z-index:2000;left:0;top:0;will-change:transform;transition:transform .05s;transform-origin:0 0;user-select:none}.cursor-pencil-offset{margin-left:-20px}.cursor-selector-offset{margin-left:-22px;margin-top:56px}.cursor-text-offset{margin-left:-30px;margin-top:18px}.cursor-shape-offset{display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;width:180px;height:64px;margin-left:-30px;margin-top:12px}.netless-window-manager-cursor-name{width:100%;height:48px;display:flex;align-items:center;justify-content:center;position:absolute;top:-40px}.cursor-image-wrapper{display:flex;justify-content:center}.tele-fancy-scrollbar{overscroll-behavior:contain;overflow:auto;overflow-y:scroll;overflow-y:overlay;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;scrollbar-width:auto}.tele-fancy-scrollbar::-webkit-scrollbar{height:8px;width:8px}.tele-fancy-scrollbar::-webkit-scrollbar-track{background-color:transparent}.tele-fancy-scrollbar::-webkit-scrollbar-thumb{background-color:#444e601a;background-color:transparent;border-radius:4px;transition:background-color .4s}.tele-fancy-scrollbar:hover::-webkit-scrollbar-thumb{background-color:#444e601a}.tele-fancy-scrollbar::-webkit-scrollbar-thumb:hover{background-color:#444e6033}.tele-fancy-scrollbar::-webkit-scrollbar-thumb:active{background-color:#444e6033}.tele-fancy-scrollbar::-webkit-scrollbar-thumb:vertical{min-height:50px}.tele-fancy-scrollbar::-webkit-scrollbar-thumb:horizontal{min-width:50px}.telebox-box{position:absolute;top:0;left:0;z-index:100;will-change:transform;transition:width .4s cubic-bezier(.4,.9,.71,1.02),height .4s cubic-bezier(.55,.82,.63,.95),opacity .6s cubic-bezier(.7,0,.84,0),transform .4s ease}.telebox-box-main{position:relative;width:100%;height:100%;display:flex;flex-direction:column;overflow:hidden;background:#f9f9fc;box-shadow:0 4px 10px #2f419226;border-radius:6px;border:1px solid #e3e3ec}.telebox-titlebar-wrap{flex-shrink:0;position:relative;z-index:1}.telebox-content-wrap{flex:1;width:100%;overflow:hidden;display:flex;justify-content:center;align-items:center}.telebox-content{width:100%;height:100%;position:relative}.telebox-footer-wrap{flex-shrink:0;display:flex;flex-direction:column}.telebox-footer-wrap:before{content:"";display:block;flex:1}.telebox-resize-handle{position:absolute;z-index:2147483647}.telebox-n{width:100%;height:5px;left:0;top:-5px;cursor:n-resize}.telebox-s{width:100%;height:5px;left:0;bottom:-5px;cursor:s-resize}.telebox-w{width:5px;height:100%;left:-5px;top:0;cursor:w-resize}.telebox-e{width:5px;height:100%;right:-5px;top:0;cursor:e-resize}.telebox-nw{width:15px;height:15px;top:-5px;left:-5px;cursor:nw-resize}.telebox-ne{width:15px;height:15px;top:-5px;right:-5px;cursor:ne-resize}.telebox-se{width:15px;height:15px;bottom:-5px;right:-5px;cursor:se-resize}.telebox-sw{width:15px;height:15px;bottom:-5px;left:-5px;cursor:sw-resize}.telebox-track-mask{position:fixed;top:0;left:0;z-index:2147483647;width:100%;height:100%;background:rgba(0,0,0,.0001);cursor:move}.telebox-cursor-n{cursor:n-resize}.telebox-cursor-s{cursor:s-resize}.telebox-cursor-w{cursor:w-resize}.telebox-cursor-e{cursor:e-resize}.telebox-cursor-nw{cursor:nw-resize}.telebox-cursor-ne{cursor:ne-resize}.telebox-cursor-se{cursor:se-resize}.telebox-cursor-sw{cursor:sw-resize}.telebox-maximized .telebox-resize-handles,.telebox-no-resize .telebox-resize-handles{display:none}.telebox-maximized{box-shadow:none;transition:none}.telebox-minimized{will-change:transform;transition:width 50ms cubic-bezier(.4,.9,.71,1.02),height 50ms cubic-bezier(.55,.82,.63,.95),opacity .6s cubic-bezier(.7,0,.84,0),transform .6s ease;opacity:0;pointer-events:none;user-select:none}.telebox-transforming{will-change:transform;transition:opacity .6s cubic-bezier(.7,0,.84,0)}.telebox-readonly .telebox-resize-handle{cursor:initial!important;pointer-events:none!important}.telebox-titlebar{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;background:#fff;user-select:none;border-bottom:1px solid #eeeef7}.telebox-title{overflow:hidden;margin:0 24px 0 0;padding:0;font-size:14px;font-weight:400;font-family:PingFangSC-Regular,PingFang SC;white-space:nowrap;word-break:keep-all;text-overflow:ellipsis;color:#191919}.telebox-titlebar-btns{white-space:nowrap;word-break:keep-all;margin-left:auto;font-size:0}.telebox-titlebar-btn{width:22px;height:22px;padding:0;outline:0;border:none;background:0 0;cursor:pointer}.telebox-titlebar-btn~.telebox-titlebar-btn{margin-left:10px}.telebox-titlebar-btn-icon{width:22px;height:22px}.telebox-readonly .telebox-titlebar-btn{cursor:not-allowed}.telebox-collector{visibility:hidden;display:block;position:absolute;z-index:200;width:40px;height:40px;margin:0;padding:0;border:none;outline:0;font-size:0;border-radius:50%;background:#fff;box-shadow:0 2px 6px #2f419226;cursor:pointer;user-select:none;pointer-events:none}.telebox-collector-icon{width:18px;height:16px}.telebox-collector-visible{visibility:visible;pointer-events:initial}.telebox-max-titlebar{display:none;position:absolute;top:0;left:0;z-index:50000;user-select:none}.telebox-max-titlebar-maximized{display:flex}.telebox-titles{flex:1;height:100%;margin:0 16px 0 -16px;overflow-y:hidden;overflow-x:scroll;overflow-x:overlay;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;scrollbar-width:auto}.telebox-titles::-webkit-scrollbar{height:8px;width:8px}.telebox-titles::-webkit-scrollbar-track{background-color:transparent}.telebox-titles::-webkit-scrollbar-thumb{background-color:#eeeef7cc;background-color:transparent;border-radius:4px;transition:background-color .4s}.telebox-titles:hover::-webkit-scrollbar-thumb{background-color:#eeeef7cc}.telebox-titles::-webkit-scrollbar-thumb:hover{background-color:#eeeef7}.telebox-titles::-webkit-scrollbar-thumb:active{background-color:#eeeef7}.telebox-titles::-webkit-scrollbar-thumb:vertical{min-height:50px}.telebox-titles::-webkit-scrollbar-thumb:horizontal{min-width:50px}.telebox-titles-content{height:100%;display:flex;flex-wrap:nowrap;align-items:center;padding:0}.telebox-titles-tab{overflow:hidden;max-width:182px;min-width:50px;padding:0 26px 0 16px;outline:0;font-size:13px;font-family:PingFangSC-Regular,PingFang SC;font-weight:400;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all;border:none;border-right:1px solid #e5e5f0;color:#7b88a0;background:0 0;cursor:pointer}.telebox-titles-tab~.telebox-titles-tab{margin-left:2px}.telebox-titles-tab-focus{color:#357bf6}.telebox-readonly .telebox-titles-tab{cursor:not-allowed}
1
+ .netless-window-manager-playground{width:100%;height:100%;position:relative;z-index:1;overflow:hidden}.netless-window-manager-sizer{position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;overflow:hidden;display:flex}.netless-window-manager-sizer-horizontal{flex-direction:column}.netless-window-manager-sizer:before,.netless-window-manager-sizer:after{flex:1;content:"";display:block}.netless-window-manager-chess-sizer:before,.netless-window-manager-chess-sizer:after{background-image:linear-gradient(45deg,#b0b0b0 25%,transparent 25%),linear-gradient(-45deg,#b0b0b0 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#b0b0b0 75%),linear-gradient(-45deg,transparent 75%,#b0b0b0 75%);background-color:#fff;background-size:20px 20px;background-position:0 0,0 10px,10px -10px,-10px 0px}.netless-window-manager-wrapper{position:relative;z-index:1;width:100%;height:100%;overflow:hidden}.netless-window-manager-main-view{width:100%;height:100%}.netless-window-manager-cursor-pencil-image{width:26px;height:26px}.netless-window-manager-cursor-selector-image{width:24px;height:24px}.netless-window-manager-cursor-selector-avatar{border-radius:50%;border-style:solid;border-width:2px;border-color:#fff;margin-bottom:2px}.netless-window-manager-cursor-selector-avatar img{width:12px}.netless-window-manager-cursor-inner{border-radius:4px;display:flex;align-items:center;justify-content:center;flex-direction:row;padding-left:4px;padding-right:4px;font-size:12px}.netless-window-manager-cursor-inner-mellow{height:32px;border-radius:16px;display:flex;align-items:center;justify-content:center;flex-direction:row;padding-left:16px;padding-right:16px}.netless-window-manager-cursor-tag-name{font-size:12px;margin-left:4px;padding:2px 8px;border-radius:4px}.netless-window-manager-cursor-mid{display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;width:26px;height:26px;z-index:2000;left:0;top:0;will-change:transform;transition:transform .05s;transform-origin:0 0;user-select:none}.netless-window-manager-cursor-pencil-offset{margin-left:-20px}.netless-window-manager-cursor-selector-offset{margin-left:-22px;margin-top:56px}.netless-window-manager-cursor-text-offset{margin-left:-30px;margin-top:18px}.netless-window-manager-cursor-shape-offset{display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;width:180px;height:64px;margin-left:-30px;margin-top:12px}.netless-window-manager-cursor-name{width:100%;height:48px;display:flex;align-items:center;justify-content:center;position:absolute;top:-40px}.cursor-image-wrapper{display:flex;justify-content:center}.tele-fancy-scrollbar{overscroll-behavior:contain;overflow:auto;overflow-y:scroll;overflow-y:overlay;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;scrollbar-width:auto}.tele-fancy-scrollbar::-webkit-scrollbar{height:8px;width:8px}.tele-fancy-scrollbar::-webkit-scrollbar-track{background-color:transparent}.tele-fancy-scrollbar::-webkit-scrollbar-thumb{background-color:#444e601a;background-color:transparent;border-radius:4px;transition:background-color .4s}.tele-fancy-scrollbar:hover::-webkit-scrollbar-thumb{background-color:#444e601a}.tele-fancy-scrollbar::-webkit-scrollbar-thumb:hover{background-color:#444e6033}.tele-fancy-scrollbar::-webkit-scrollbar-thumb:active{background-color:#444e6033}.tele-fancy-scrollbar::-webkit-scrollbar-thumb:vertical{min-height:50px}.tele-fancy-scrollbar::-webkit-scrollbar-thumb:horizontal{min-width:50px}.telebox-box{position:absolute;top:0;left:0;z-index:100;will-change:transform;transition:width .4s cubic-bezier(.4,.9,.71,1.02),height .4s cubic-bezier(.55,.82,.63,.95),opacity .6s cubic-bezier(.7,0,.84,0),transform .4s ease}.telebox-box-main{position:relative;width:100%;height:100%;display:flex;flex-direction:column;overflow:hidden;background:#f9f9fc;box-shadow:0 4px 10px #2f419226;border-radius:6px;border:1px solid #e3e3ec}.telebox-titlebar-wrap{flex-shrink:0;position:relative;z-index:1}.telebox-content-wrap{flex:1;width:100%;overflow:hidden;display:flex;justify-content:center;align-items:center}.telebox-content{width:100%;height:100%;position:relative}.telebox-footer-wrap{flex-shrink:0;display:flex;flex-direction:column}.telebox-footer-wrap:before{content:"";display:block;flex:1}.telebox-resize-handle{position:absolute;z-index:2147483647}.telebox-n{width:100%;height:5px;left:0;top:-5px;cursor:n-resize}.telebox-s{width:100%;height:5px;left:0;bottom:-5px;cursor:s-resize}.telebox-w{width:5px;height:100%;left:-5px;top:0;cursor:w-resize}.telebox-e{width:5px;height:100%;right:-5px;top:0;cursor:e-resize}.telebox-nw{width:15px;height:15px;top:-5px;left:-5px;cursor:nw-resize}.telebox-ne{width:15px;height:15px;top:-5px;right:-5px;cursor:ne-resize}.telebox-se{width:15px;height:15px;bottom:-5px;right:-5px;cursor:se-resize}.telebox-sw{width:15px;height:15px;bottom:-5px;left:-5px;cursor:sw-resize}.telebox-track-mask{position:fixed;top:0;left:0;z-index:2147483647;width:100%;height:100%;background:rgba(0,0,0,.0001);cursor:move}.telebox-cursor-n{cursor:n-resize}.telebox-cursor-s{cursor:s-resize}.telebox-cursor-w{cursor:w-resize}.telebox-cursor-e{cursor:e-resize}.telebox-cursor-nw{cursor:nw-resize}.telebox-cursor-ne{cursor:ne-resize}.telebox-cursor-se{cursor:se-resize}.telebox-cursor-sw{cursor:sw-resize}.telebox-maximized .telebox-resize-handles,.telebox-no-resize .telebox-resize-handles{display:none}.telebox-maximized{box-shadow:none;transition:none}.telebox-minimized{will-change:transform;transition:width 50ms cubic-bezier(.4,.9,.71,1.02),height 50ms cubic-bezier(.55,.82,.63,.95),opacity .6s cubic-bezier(.7,0,.84,0),transform .6s ease;opacity:0;pointer-events:none;user-select:none}.telebox-transforming{will-change:transform;transition:opacity .6s cubic-bezier(.7,0,.84,0)}.telebox-readonly .telebox-resize-handle{cursor:initial!important;pointer-events:none!important}.telebox-titlebar{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;background:#fff;user-select:none;border-bottom:1px solid #eeeef7}.telebox-title{overflow:hidden;margin:0 24px 0 0;padding:0;font-size:14px;font-weight:400;font-family:PingFangSC-Regular,PingFang SC;white-space:nowrap;word-break:keep-all;text-overflow:ellipsis;color:#191919}.telebox-titlebar-btns{white-space:nowrap;word-break:keep-all;margin-left:auto;font-size:0}.telebox-titlebar-btn{width:22px;height:22px;padding:0;outline:0;border:none;background:0 0;cursor:pointer}.telebox-titlebar-btn~.telebox-titlebar-btn{margin-left:10px}.telebox-titlebar-btn-icon{width:22px;height:22px}.telebox-readonly .telebox-titlebar-btn{cursor:not-allowed}.telebox-collector{visibility:hidden;display:block;position:absolute;z-index:200;width:40px;height:40px;margin:0;padding:0;border:none;outline:0;font-size:0;border-radius:50%;background:#fff;box-shadow:0 2px 6px #2f419226;cursor:pointer;user-select:none;pointer-events:none}.telebox-collector-icon{width:18px;height:16px}.telebox-collector-visible{visibility:visible;pointer-events:initial}.telebox-max-titlebar{display:none;position:absolute;top:0;left:0;z-index:50000;user-select:none}.telebox-max-titlebar-maximized{display:flex}.telebox-titles{flex:1;height:100%;margin:0 16px 0 -16px;overflow-y:hidden;overflow-x:scroll;overflow-x:overlay;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;scrollbar-width:auto}.telebox-titles::-webkit-scrollbar{height:8px;width:8px}.telebox-titles::-webkit-scrollbar-track{background-color:transparent}.telebox-titles::-webkit-scrollbar-thumb{background-color:#eeeef7cc;background-color:transparent;border-radius:4px;transition:background-color .4s}.telebox-titles:hover::-webkit-scrollbar-thumb{background-color:#eeeef7cc}.telebox-titles::-webkit-scrollbar-thumb:hover{background-color:#eeeef7}.telebox-titles::-webkit-scrollbar-thumb:active{background-color:#eeeef7}.telebox-titles::-webkit-scrollbar-thumb:vertical{min-height:50px}.telebox-titles::-webkit-scrollbar-thumb:horizontal{min-width:50px}.telebox-titles-content{height:100%;display:flex;flex-wrap:nowrap;align-items:center;padding:0}.telebox-titles-tab{overflow:hidden;max-width:182px;min-width:50px;padding:0 26px 0 16px;outline:0;font-size:13px;font-family:PingFangSC-Regular,PingFang SC;font-weight:400;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all;border:none;border-right:1px solid #e5e5f0;color:#7b88a0;background:0 0;cursor:pointer}.telebox-titles-tab~.telebox-titles-tab{margin-left:2px}.telebox-titles-tab-focus{color:#357bf6}.telebox-readonly .telebox-titles-tab{cursor:not-allowed}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netless/window-manager",
3
- "version": "0.1.69-canary.2",
3
+ "version": "0.2.3-canary.0",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "module": "dist/index.es.js",
@@ -28,7 +28,7 @@
28
28
  "emittery": "^0.9.2",
29
29
  "lodash": "^4.17.21",
30
30
  "p-retry": "^4.6.1",
31
- "uuid": "^8.3.2",
31
+ "uuid": "^7.0.3",
32
32
  "video.js": ">=7"
33
33
  },
34
34
  "devDependencies": {
@@ -55,6 +55,6 @@
55
55
  "typescript": "^4.3.5",
56
56
  "video.js": "^7.14.3",
57
57
  "vite": "^2.5.3",
58
- "white-web-sdk": "^2.14.3"
58
+ "white-web-sdk": "2.14.3"
59
59
  }
60
60
  }
package/src/AppContext.ts CHANGED
@@ -36,7 +36,6 @@ export class AppContext<TAttrs extends Record<string, any>, AppOptions = any> {
36
36
  private manager: AppManager,
37
37
  public appId: string,
38
38
  private appProxy: AppProxy,
39
- public setScenes: (scenes: SceneDefinition[]) => void,
40
39
  private appOptions?: AppOptions | (() => AppOptions),
41
40
  ) {
42
41
  this.emitter = appProxy.appEmitter;
package/src/AppManager.ts CHANGED
@@ -167,9 +167,7 @@ export class AppManager {
167
167
  this.appProxies.forEach(appProxy => {
168
168
  if (appProxy.scenePath && scenePath.startsWith(appProxy.scenePath)) {
169
169
  appProxy.emitAppSceneStateChange(sceneState);
170
- if (sceneState.index !== appProxy.sceneIndex) {
171
- appProxy.setSceneIndex(sceneState.index);
172
- }
170
+ appProxy.setFullPath(scenePath);
173
171
  }
174
172
  });
175
173
  this.viewManager.refreshViews();
package/src/AppProxy.ts CHANGED
@@ -1,16 +1,17 @@
1
- import Emittery from "emittery";
2
- import { AppAttributes, AppEvents, Events } from "./constants";
3
- import { AppContext } from "./AppContext";
4
- import { appRegister } from "./Register";
5
- import { autorun, ViewVisionMode } from "white-web-sdk";
6
- import { log } from "./Utils/log";
1
+ import Emittery from 'emittery';
2
+ import { AppAttributes, AppEvents, Events } from './constants';
3
+ import { AppContext } from './AppContext';
4
+ import { appRegister } from './Register';
5
+ import { autorun, ViewVisionMode } from 'white-web-sdk';
6
+ import { callbacks, emitter } from './index';
7
+ import { Fields } from './AttributesDelegate';
8
+ import { log } from './Utils/log';
7
9
  import {
8
10
  notifyMainViewModeChange,
9
11
  setScenePath,
10
12
  setViewFocusScenePath,
11
13
  setViewMode,
12
14
  } from "./Utils/Common";
13
- import { callbacks, emitter } from "./index";
14
15
  import type {
15
16
  AppEmitterEvent,
16
17
  AppInitState,
@@ -18,7 +19,7 @@ import type {
18
19
  setAppOptions,
19
20
  AppListenerKeys,
20
21
  } from "./index";
21
- import type { Camera, SceneDefinition, SceneState, View } from "white-web-sdk";
22
+ import type { Camera, SceneState, View, SceneDefinition } from "white-web-sdk";
22
23
  import type { AppManager } from "./AppManager";
23
24
  import type { NetlessApp } from "./typings";
24
25
  import type { ReadonlyTeleBox } from "@netless/telebox-insider";
@@ -59,6 +60,7 @@ export class AppProxy {
59
60
  this.scenes = options.scenes;
60
61
  }
61
62
  }
63
+
62
64
  if (this.params.options?.scenePath) {
63
65
  // 只有传入了 scenePath 的 App 才会创建 View
64
66
  this.createView();
@@ -67,14 +69,6 @@ export class AppProxy {
67
69
  this.isAddApp = isAddApp;
68
70
  }
69
71
 
70
- public get sceneIndex(): number {
71
- return this.manager.delegate.getAppSceneIndex(this.id);
72
- }
73
-
74
- public setSceneIndex(index: number): void {
75
- return this.manager.delegate.updateAppState(this.id, AppAttributes.SceneIndex, index);
76
- }
77
-
78
72
  public get view(): View | undefined {
79
73
  return this.manager.viewManager.getView(this.id);
80
74
  }
@@ -87,20 +81,14 @@ export class AppProxy {
87
81
  return this.manager.attributes[this.id];
88
82
  }
89
83
 
90
- public getSceneName(): string | undefined {
91
- if (this.sceneIndex !== undefined) {
92
- return this.scenes?.[this.sceneIndex]?.name;
93
- }
94
- }
95
-
96
84
  public getFullScenePath(): string | undefined {
97
- if (this.scenePath && this.getSceneName()) {
98
- return `${this.scenePath}/${this.getSceneName()}`;
85
+ if (this.scenePath) {
86
+ return this.manager.delegate.getAppAttributes(this.id)[Fields.FullPath] || this.scenePath;
99
87
  }
100
88
  }
101
89
 
102
- public setScenes(scenes: SceneDefinition[]): void {
103
- this.scenes = scenes;
90
+ public setFullPath(path: string) {
91
+ this.manager.safeUpdateAttributes(["apps", this.id, Fields.FullPath], path);
104
92
  }
105
93
 
106
94
  public async baseInsertApp(focus?: boolean): Promise<{ appId: string; app: NetlessApp }> {
@@ -138,7 +126,7 @@ export class AppProxy {
138
126
 
139
127
  private async setupApp(appId: string, app: NetlessApp, options?: setAppOptions, appOptions?: any) {
140
128
  log("setupApp", appId, app, options);
141
- const context = new AppContext(this.manager, appId, this, this.setScenes, appOptions);
129
+ const context = new AppContext(this.manager, appId, this, appOptions);
142
130
  try {
143
131
  emitter.once(`${appId}${Events.WindowCreated}`).then(async () => {
144
132
  const boxInitState = this.getAppInitState(appId);
@@ -16,6 +16,7 @@ export enum Fields {
16
16
  Cursors = "cursors",
17
17
  Position = "position",
18
18
  CursorState = "cursorState",
19
+ FullPath = "fullPath"
19
20
  }
20
21
 
21
22
  export type Apps = {
@@ -44,21 +44,21 @@
44
44
  >
45
45
  {#if hasAvatar}
46
46
  <img
47
- class="cursor-selector-avatar"
47
+ class="netless-window-manager-cursor-selector-avatar"
48
48
  style={computedAvatarStyle()}
49
49
  src={avatar}
50
50
  alt="avatar"
51
51
  />
52
52
  {/if}
53
- {cursorName}
53
+ <span style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;max-width: 80px">{cursorName}</span>
54
54
  {#if hasTagName}
55
- <span class="cursor-tag-name" style="background-color: {cursorTagBackgroundColor}">
55
+ <span class="netless-window-manager-cursor-tag-name" style="background-color: {cursorTagBackgroundColor}">
56
56
  {tagName}
57
57
  </span>
58
58
  {/if}
59
59
  </div>
60
60
  </div>
61
61
  <div class="cursor-image-wrapper">
62
- <img class="cursor-{appliance}-image" {src} alt={appliance} />
62
+ <img class="netless-window-manager-cursor-{appliance}-image" {src} alt={appliance} />
63
63
  </div>
64
64
  </div>
@@ -80,9 +80,9 @@ export class Cursor {
80
80
 
81
81
  private get memberTheme() {
82
82
  if (this.payload?.theme) {
83
- return "cursor-inner-mellow";
83
+ return "netless-window-manager-cursor-inner-mellow";
84
84
  } else {
85
- return "cursor-inner";
85
+ return "netless-window-manager-cursor-inner";
86
86
  }
87
87
  }
88
88
 
@@ -59,6 +59,18 @@ export const makeValidScenePath = (displayer: Displayer, scenePath: string) => {
59
59
  }
60
60
  };
61
61
 
62
+ export const isValidScenePath = (scenePath: string) => {
63
+ return scenePath.startsWith("/");
64
+ }
65
+
66
+ export const ensureValidScenePath = (scenePath: string) => {
67
+ if (scenePath.endsWith("/")) {
68
+ return scenePath.slice(0, -1);
69
+ } else {
70
+ return scenePath;
71
+ }
72
+ }
73
+
62
74
  export const getVersionNumber = (version: string) => {
63
75
  const versionString = version.split(".").map(s => s.padStart(2, "0")).join("");
64
76
  return parseInt(versionString);
@@ -25,3 +25,7 @@ export class ParamsInvalidError extends Error {
25
25
  export class BoxNotCreatedError extends Error {
26
26
  override message = "[WindowManager]: box need created";
27
27
  }
28
+
29
+ export class InvalidScenePath extends Error {
30
+ override message = `[WindowManager]: ScenePath should start with "/"`;
31
+ }
package/src/index.ts CHANGED
@@ -5,6 +5,7 @@ import { isNull, isObject } from "lodash";
5
5
  import {
6
6
  AppCreateError,
7
7
  AppManagerNotInitError,
8
+ InvalidScenePath,
8
9
  ParamsInvalidError,
9
10
  WhiteWebSDKInvalidError,
10
11
  } from "./Utils/error";
@@ -13,7 +14,7 @@ import { appRegister } from "./Register";
13
14
  import { CursorManager } from "./Cursor";
14
15
  import type { Apps } from "./AttributesDelegate";
15
16
  import { Fields } from "./AttributesDelegate";
16
- import { getVersionNumber, wait } from "./Utils/Common";
17
+ import { ensureValidScenePath, getVersionNumber, isValidScenePath, wait } from "./Utils/Common";
17
18
  import {
18
19
  InvisiblePlugin,
19
20
  isRoom,
@@ -89,6 +90,7 @@ export type AppSyncAttributes = {
89
90
  options: any;
90
91
  state?: any;
91
92
  isDynamicPPT?: boolean;
93
+ fullPath?: string;
92
94
  };
93
95
 
94
96
  export type AppInitState = {
@@ -213,8 +215,10 @@ export class WindowManager extends InvisiblePlugin<WindowMangerAttributes> {
213
215
  }
214
216
 
215
217
  this.checkVersion();
216
- if (room.phase !== RoomPhase.Connected) {
217
- throw new Error("[WindowManager]: Room only Connected can be mount");
218
+ if (isRoom(room)) {
219
+ if (room.phase !== RoomPhase.Connected) {
220
+ throw new Error("[WindowManager]: Room only Connected can be mount");
221
+ }
218
222
  }
219
223
  if (!container) {
220
224
  throw new Error("[WindowManager]: Container must provide");
@@ -227,7 +231,7 @@ export class WindowManager extends InvisiblePlugin<WindowMangerAttributes> {
227
231
  if (this.debug) {
228
232
  setOptions({ verbose: true });
229
233
  }
230
- log("[WindowManager]: Already insert room", manager);
234
+ log("Already insert room", manager);
231
235
  if (containerSizeRatio) {
232
236
  WindowManager.containerSizeRatio = containerSizeRatio;
233
237
  }
@@ -322,6 +326,9 @@ export class WindowManager extends InvisiblePlugin<WindowMangerAttributes> {
322
326
  if (isDynamicPPT === undefined) {
323
327
  return;
324
328
  }
329
+ if (params?.options?.scenePath) {
330
+ params.options.scenePath = ensureValidScenePath(params.options.scenePath);
331
+ }
325
332
  const appId = await this.appManager.addApp(params, Boolean(isDynamicPPT));
326
333
  return appId;
327
334
  } else {
@@ -334,10 +341,13 @@ export class WindowManager extends InvisiblePlugin<WindowMangerAttributes> {
334
341
  if (params.options) {
335
342
  const { scenePath, scenes } = params.options;
336
343
  if (scenePath) {
344
+ if (!isValidScenePath(scenePath)) {
345
+ throw new InvalidScenePath();
346
+ }
337
347
  for (const appId in this.apps) {
338
348
  const appScenePath = appManager.delegate.getAppScenePath(appId);
339
349
  if (appScenePath && appScenePath === scenePath) {
340
- console.warn(`ScenePath ${scenePath} Already opened`);
350
+ console.warn(`[WindowManager]: ScenePath ${scenePath} Already opened`);
341
351
  return;
342
352
  }
343
353
  }
@@ -354,6 +364,9 @@ export class WindowManager extends InvisiblePlugin<WindowMangerAttributes> {
354
364
  }
355
365
  }
356
366
  }
367
+ if (scenePath && scenes === undefined) {
368
+ this.room?.putScenes(scenePath, [{}])
369
+ }
357
370
  }
358
371
  return isDynamicPPT;
359
372
  }
package/src/style.css CHANGED
@@ -52,26 +52,18 @@
52
52
  height: 100%;
53
53
  }
54
54
 
55
- .cursor-box {
56
- color: white;
57
- padding: 4px;
58
- border-radius: 2px;
59
- width: 100%;
60
- height: 100%;
61
- position: absolute;
62
- }
63
55
 
64
- .cursor-pencil-image {
56
+ .netless-window-manager-cursor-pencil-image {
65
57
  width: 26px;
66
58
  height: 26px;
67
59
  }
68
60
 
69
- .cursor-selector-image {
61
+ .netless-window-manager-cursor-selector-image {
70
62
  width: 24px;
71
63
  height: 24px;
72
64
  }
73
65
 
74
- .cursor-selector-avatar {
66
+ .netless-window-manager-cursor-selector-avatar {
75
67
  border-radius: 50%;
76
68
  border-style: solid;
77
69
  border-width: 2px;
@@ -79,11 +71,11 @@
79
71
  margin-bottom: 2px;
80
72
  }
81
73
 
82
- .cursor-selector-avatar img {
74
+ .netless-window-manager-cursor-selector-avatar img {
83
75
  width: 12px;
84
76
  }
85
77
 
86
- .cursor-inner {
78
+ .netless-window-manager-cursor-inner {
87
79
  border-radius: 4px;
88
80
  display: flex;
89
81
  align-items: center;
@@ -94,7 +86,7 @@
94
86
  font-size: 12px;
95
87
  }
96
88
 
97
- .cursor-inner-mellow {
89
+ .netless-window-manager-cursor-inner-mellow {
98
90
  height: 32px;
99
91
  border-radius: 16px;
100
92
  display: flex;
@@ -105,7 +97,7 @@
105
97
  padding-right: 16px;
106
98
  }
107
99
 
108
- .cursor-tag-name {
100
+ .netless-window-manager-cursor-tag-name {
109
101
  font-size: 12px;
110
102
  margin-left: 4px;
111
103
  padding: 2px 8px;
@@ -129,21 +121,21 @@
129
121
  user-select: none;
130
122
  }
131
123
 
132
- .cursor-pencil-offset {
124
+ .netless-window-manager-cursor-pencil-offset {
133
125
  margin-left: -20px;
134
126
  }
135
127
 
136
- .cursor-selector-offset {
128
+ .netless-window-manager-cursor-selector-offset {
137
129
  margin-left: -22px;
138
130
  margin-top: 56px;
139
131
  }
140
132
 
141
- .cursor-text-offset {
133
+ .netless-window-manager-cursor-text-offset {
142
134
  margin-left: -30px;
143
135
  margin-top: 18px;
144
136
  }
145
137
 
146
- .cursor-shape-offset {
138
+ .netless-window-manager-cursor-shape-offset {
147
139
  display: flex;
148
140
  flex-direction: column;
149
141
  align-items: center;