@netless/window-manager 1.0.7-beta.7 → 1.0.7-beta.8
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 +7 -1
- package/dist/index.js +14 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +61 -44
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/App/AppContext.ts +1 -0
- package/src/App/AppProxy.ts +1 -0
- package/src/AppManager.ts +1 -0
- package/src/AttributesDelegate.ts +1 -0
- package/src/BoxManager.ts +1 -0
- package/src/Cursor/index.ts +1 -0
- package/src/Utils/extendClass.ts +23 -19
- package/src/index.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netless/window-manager",
|
|
3
|
-
"version": "1.0.7-beta.
|
|
3
|
+
"version": "1.0.7-beta.8",
|
|
4
4
|
"description": "Multi-window mode for Netless Whiteboard",
|
|
5
5
|
"author": "l1shen <lishen1635@gmail.com> (https://github.com/l1shen)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@juggle/resize-observer": "^3.3.1",
|
|
35
|
-
"@netless/telebox-insider": "0.3.0-beta.
|
|
35
|
+
"@netless/telebox-insider": "0.3.0-beta.14",
|
|
36
36
|
"emittery": "^0.9.2",
|
|
37
37
|
"lodash": "^4.17.21",
|
|
38
38
|
"p-retry": "^4.6.1",
|
package/src/App/AppContext.ts
CHANGED
|
@@ -34,6 +34,7 @@ import { callbacks } from "../callback";
|
|
|
34
34
|
export class AppContext<TAttributes extends {} = any, TMagixEventPayloads = any, TAppOptions = any>
|
|
35
35
|
implements PageController
|
|
36
36
|
{
|
|
37
|
+
static readonly kind = "AppContext";
|
|
37
38
|
public readonly emitter: Emittery<AppEmitterEvent<TAttributes>>;
|
|
38
39
|
public readonly mobxUtils = {
|
|
39
40
|
autorun,
|
package/src/App/AppProxy.ts
CHANGED
|
@@ -38,6 +38,7 @@ import { getExtendClass } from "../Utils/extendClass";
|
|
|
38
38
|
export type AppEmitter = Emittery<AppEmitterEvent>;
|
|
39
39
|
|
|
40
40
|
export class AppProxy implements PageRemoveService {
|
|
41
|
+
static readonly kind = "AppProxy";
|
|
41
42
|
public kind: string;
|
|
42
43
|
public id: string;
|
|
43
44
|
public scenePath?: string;
|
package/src/AppManager.ts
CHANGED
|
@@ -53,6 +53,7 @@ import { getExtendClass } from "./Utils/extendClass";
|
|
|
53
53
|
import type { TeleBoxState } from "@netless/telebox-insider";
|
|
54
54
|
|
|
55
55
|
export class AppManager {
|
|
56
|
+
static readonly kind = "AppManager";
|
|
56
57
|
public displayer: Displayer;
|
|
57
58
|
public viewManager: ViewManager;
|
|
58
59
|
public appProxies: Map<string, AppProxy> = new Map();
|
|
@@ -53,6 +53,7 @@ export type ICamera = Camera & { id: string };
|
|
|
53
53
|
export type ISize = Size & { id: string };
|
|
54
54
|
|
|
55
55
|
export class AttributesDelegate {
|
|
56
|
+
static readonly kind = "AttributesDelegate";
|
|
56
57
|
constructor(private context: StoreContext) {}
|
|
57
58
|
|
|
58
59
|
public setContext(context: StoreContext) {
|
package/src/BoxManager.ts
CHANGED
package/src/Cursor/index.ts
CHANGED
|
@@ -26,6 +26,7 @@ export type MoveCursorParams = {
|
|
|
26
26
|
const LocalCursorSideEffectId = "local-cursor";
|
|
27
27
|
|
|
28
28
|
export class CursorManager {
|
|
29
|
+
static readonly kind = "CursorManager";
|
|
29
30
|
public containerRect?: DOMRect;
|
|
30
31
|
public wrapperRect?: DOMRect;
|
|
31
32
|
public cursorInstances: Map<string, Cursor> = new Map();
|
package/src/Utils/extendClass.ts
CHANGED
|
@@ -36,24 +36,28 @@ export function getExtendClass<T extends ExtendClassAble>(
|
|
|
36
36
|
baseClass: T,
|
|
37
37
|
extendClass?: ExtendClass
|
|
38
38
|
): T {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
39
|
+
if (baseClass.kind && extendClass && Object.keys(extendClass).includes(baseClass.kind)) {
|
|
40
|
+
switch (baseClass.kind) {
|
|
41
|
+
case "AppManager":
|
|
42
|
+
return (extendClass?.AppManager || AppManager) as T;
|
|
43
|
+
case "BoxManager":
|
|
44
|
+
return (extendClass?.BoxManager || BoxManager) as T;
|
|
45
|
+
case "AttributesDelegate":
|
|
46
|
+
return (extendClass?.AttributesDelegate || AttributesDelegate) as T;
|
|
47
|
+
case "CursorManager":
|
|
48
|
+
return (extendClass?.CursorManager || CursorManager) as T;
|
|
49
|
+
case "AppProxy":
|
|
50
|
+
return (extendClass?.AppProxy || AppProxy) as T;
|
|
51
|
+
case "AppContext":
|
|
52
|
+
return (extendClass?.AppContext || AppContext) as T;
|
|
53
|
+
case "TeleBoxManager":
|
|
54
|
+
return (extendClass?.TeleBoxManager || TeleBoxManager) as T;
|
|
55
|
+
case "TeleBoxCollector":
|
|
56
|
+
return (extendClass?.TeleBoxCollector || TeleBoxCollector) as T;
|
|
57
|
+
default:
|
|
58
|
+
return baseClass;
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
return baseClass;
|
|
58
62
|
}
|
|
59
63
|
}
|
package/src/index.ts
CHANGED
|
@@ -202,7 +202,7 @@ export class WindowManager
|
|
|
202
202
|
extends InvisiblePlugin<WindowMangerAttributes, any>
|
|
203
203
|
implements PageController
|
|
204
204
|
{
|
|
205
|
-
public static kind = "WindowManager";
|
|
205
|
+
public static readonly kind = "WindowManager";
|
|
206
206
|
public static displayer: Displayer;
|
|
207
207
|
public static wrapper?: HTMLElement;
|
|
208
208
|
public static sizer?: HTMLElement;
|