@netless/window-manager 0.4.23 → 0.4.26
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/CHANGELOG.md +13 -0
- package/__mocks__/white-web-sdk.ts +41 -0
- package/dist/App/AppProxy.d.ts +1 -0
- package/dist/ContainerResizeObserver.d.ts +2 -1
- package/dist/InternalEmitter.d.ts +3 -1
- package/dist/View/MainView.d.ts +3 -1
- package/dist/index.cjs.js +47 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +57 -12
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +10 -10
- package/dist/index.umd.js.map +1 -1
- package/docs/advanced.md +12 -4
- package/docs/api.md +9 -0
- package/package.json +6 -10
- package/pnpm-lock.yaml +793 -2690
- package/src/App/AppProxy.ts +6 -1
- package/src/ContainerResizeObserver.ts +12 -1
- package/src/InternalEmitter.ts +3 -1
- package/src/ReconnectRefresher.ts +4 -1
- package/src/View/MainView.ts +33 -8
- package/src/index.ts +10 -1
- package/vite.config.js +10 -2
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
## 0.4.26
|
2
|
+
|
3
|
+
1. 修复 `app` 中 `pageStateChange` 事件被多次触发的问题
|
4
|
+
2. 修复重连之后 `mainView` 显示错误的内容的问题
|
5
|
+
|
6
|
+
## 0.4.25
|
7
|
+
|
8
|
+
1. 添加 `setContainerSizeRatio` 方法, 用于初始化后更新 `containerSizeRatio`
|
9
|
+
|
10
|
+
## 0.4.24
|
11
|
+
|
12
|
+
1. `package.json` `main` 指定为 `cjs` 格式
|
13
|
+
|
1
14
|
## 0.4.23
|
2
15
|
|
3
16
|
1. 修复可写进入立即切换成只读造成初始化 camera 失败的问题
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import { vi } from "vitest";
|
2
|
+
|
3
|
+
class InvisiblePlugin {
|
4
|
+
attributes: any = {};
|
5
|
+
setAttributes (attrs: any) {
|
6
|
+
this.attributes = { ...this.attributes, ...attrs };
|
7
|
+
}
|
8
|
+
}
|
9
|
+
|
10
|
+
const UpdateEventKind = {
|
11
|
+
Inserted: 0,
|
12
|
+
Updated: 1,
|
13
|
+
Removed: 2,
|
14
|
+
}
|
15
|
+
|
16
|
+
enum ApplianceNames {
|
17
|
+
selector = "selector",
|
18
|
+
clicker = "clicker",
|
19
|
+
laserPointer = "laserPointer",
|
20
|
+
pencil = "pencil",
|
21
|
+
rectangle = "rectangle",
|
22
|
+
ellipse = "ellipse",
|
23
|
+
shape = "shape",
|
24
|
+
eraser = "eraser",
|
25
|
+
text = "text",
|
26
|
+
straight = "straight",
|
27
|
+
arrow = "arrow",
|
28
|
+
hand = "hand",
|
29
|
+
}
|
30
|
+
|
31
|
+
enum ViewMode {
|
32
|
+
Freedom = "freedom",
|
33
|
+
Follower = "follower",
|
34
|
+
Broadcaster = "broadcaster",
|
35
|
+
}
|
36
|
+
|
37
|
+
const isPlayer = vi.fn(() => false);
|
38
|
+
|
39
|
+
export {
|
40
|
+
InvisiblePlugin, UpdateEventKind, ApplianceNames, ViewMode, isPlayer
|
41
|
+
}
|
package/dist/App/AppProxy.d.ts
CHANGED
@@ -24,6 +24,7 @@ export declare class AppProxy {
|
|
24
24
|
private status;
|
25
25
|
private stateKey;
|
26
26
|
private _pageState;
|
27
|
+
private _prevFullPath;
|
27
28
|
appResult?: NetlessApp<any>;
|
28
29
|
appContext?: AppContext<any, any>;
|
29
30
|
constructor(params: BaseInsertParams, manager: AppManager, appId: string, isAddApp: boolean);
|
@@ -2,9 +2,10 @@ import type { EmitterType } from "./InternalEmitter";
|
|
2
2
|
export declare class ContainerResizeObserver {
|
3
3
|
private emitter;
|
4
4
|
private containerResizeObserver?;
|
5
|
+
private disposer?;
|
5
6
|
constructor(emitter: EmitterType);
|
6
7
|
static create(container: HTMLElement, sizer: HTMLElement, wrapper: HTMLDivElement, emitter: EmitterType): ContainerResizeObserver;
|
7
8
|
observePlaygroundSize(container: HTMLElement, sizer: HTMLElement, wrapper: HTMLDivElement): void;
|
8
|
-
|
9
|
+
updateSizer({ width, height }: DOMRectReadOnly, sizer: HTMLElement, wrapper: HTMLDivElement): void;
|
9
10
|
disconnect(): void;
|
10
11
|
}
|
@@ -28,7 +28,8 @@ export declare type EmitterEvent = {
|
|
28
28
|
observerIdChange: number;
|
29
29
|
boxStateChange: string;
|
30
30
|
playgroundSizeChange: DOMRect;
|
31
|
-
|
31
|
+
startReconnect: undefined;
|
32
|
+
onReconnected: undefined;
|
32
33
|
removeScenes: string;
|
33
34
|
cursorMove: CursorMovePayload;
|
34
35
|
updateManagerRect: undefined;
|
@@ -40,6 +41,7 @@ export declare type EmitterEvent = {
|
|
40
41
|
setReadonly: boolean;
|
41
42
|
changePageState: undefined;
|
42
43
|
writableChange: boolean;
|
44
|
+
containerSizeRatioUpdate: number;
|
43
45
|
};
|
44
46
|
export declare type EmitterType = Emittery<EmitterEvent>;
|
45
47
|
export declare const emitter: EmitterType;
|
package/dist/View/MainView.d.ts
CHANGED
@@ -13,12 +13,14 @@ export declare class MainViewProxy {
|
|
13
13
|
ensureCameraAndSize(): void;
|
14
14
|
private get mainViewCamera();
|
15
15
|
private get mainViewSize();
|
16
|
+
private get didRelease();
|
16
17
|
private moveCameraSizeByAttributes;
|
17
18
|
start(): void;
|
18
19
|
addCameraReaction: () => void;
|
19
20
|
setCameraAndSize(): void;
|
20
21
|
private cameraReaction;
|
21
|
-
|
22
|
+
sizeChangeHandler: import("lodash").DebouncedFunc<(size: Size) => void>;
|
23
|
+
onUpdateContainerSizeRatio: () => void;
|
22
24
|
get view(): View;
|
23
25
|
get cameraState(): {
|
24
26
|
width: number;
|