@netless/window-manager 1.0.0-canary.76 → 1.0.0-canary.77
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/App/AppContext.d.ts +1 -1
- package/dist/App/AppPageStateImpl.d.ts +1 -1
- package/dist/App/AppProxy.d.ts +1 -1
- package/dist/App/MagixEvent/index.d.ts +7 -7
- package/dist/App/WhiteboardView.d.ts +2 -2
- package/dist/App/type.d.ts +1 -1
- package/dist/AttributesDelegate.d.ts +7 -7
- package/dist/BoxEmitter.d.ts +7 -7
- package/dist/BoxManager.d.ts +8 -8
- package/dist/Cursor/Cursor.d.ts +1 -1
- package/dist/Cursor/Cursor.svelte.d.ts +1 -0
- package/dist/Cursor/index.d.ts +2 -2
- package/dist/Helper.d.ts +1 -1
- package/dist/InternalEmitter.d.ts +3 -3
- package/dist/Page/PageController.d.ts +2 -2
- package/dist/ReconnectRefresher.d.ts +1 -1
- package/dist/RedoUndo.d.ts +1 -1
- package/dist/Register/index.d.ts +3 -3
- package/dist/Register/storage.d.ts +1 -1
- package/dist/Utils/AppCreateQueue.d.ts +1 -1
- package/dist/View/CameraSynchronizer.d.ts +1 -1
- package/dist/View/ScrollMode.d.ts +1 -1
- package/dist/View/ViewSync.d.ts +1 -1
- package/dist/callback.d.ts +2 -2
- package/dist/index.d.ts +11 -11
- package/dist/index.js +663 -291
- package/dist/index.mjs +659 -291
- package/dist/index.umd.js +661 -293
- package/dist/storage.d.ts +2 -2
- package/dist/typings.d.ts +9 -9
- package/package.json +26 -26
- package/src/Helper.ts +10 -2
- package/dist/image.d.ts +0 -19
- package/dist/shim.d.ts +0 -5
package/dist/storage.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Storage } from "@netless/synced-store";
|
2
2
|
import type { AppManager } from "./AppManager";
|
3
|
-
export
|
3
|
+
export type ScrollStorageState = {
|
4
4
|
scrollTop: number;
|
5
5
|
};
|
6
|
-
export
|
6
|
+
export type ScrollStorage = Storage<ScrollStorageState>;
|
7
7
|
export declare const createScrollStorage: (manager: AppManager) => Storage<ScrollStorageState>;
|
package/dist/typings.d.ts
CHANGED
@@ -22,7 +22,7 @@ export interface NetlessApp<Attributes extends Record<string, any> = any, MagixE
|
|
22
22
|
};
|
23
23
|
setup: (context: AppContext<Attributes, MagixEventPayloads, AppOptions>) => SetupResult;
|
24
24
|
}
|
25
|
-
export
|
25
|
+
export type AppEmitterEvent<T = any> = {
|
26
26
|
/**
|
27
27
|
* before plugin destroyed
|
28
28
|
*/
|
@@ -54,17 +54,17 @@ export declare type AppEmitterEvent<T = any> = {
|
|
54
54
|
pageStateChange: PageState;
|
55
55
|
roomMembersChange: Member[];
|
56
56
|
};
|
57
|
-
export
|
57
|
+
export type RegisterEventData = {
|
58
58
|
appId: string;
|
59
59
|
};
|
60
|
-
export
|
60
|
+
export type RegisterEvents<SetupResult = any> = {
|
61
61
|
created: RegisterEventData & {
|
62
62
|
result: SetupResult;
|
63
63
|
};
|
64
64
|
destroy: RegisterEventData;
|
65
65
|
focus: RegisterEventData;
|
66
66
|
};
|
67
|
-
export
|
67
|
+
export type RegisterParams<AppOptions = any, SetupResult = any, Attributes extends Record<string, any> = any> = {
|
68
68
|
kind: string;
|
69
69
|
src: NetlessApp<Attributes, SetupResult> | string | (() => Promise<NetlessApp<Attributes, SetupResult>>) | (() => Promise<{
|
70
70
|
default: NetlessApp<Attributes, SetupResult>;
|
@@ -75,13 +75,13 @@ export declare type RegisterParams<AppOptions = any, SetupResult = any, Attribut
|
|
75
75
|
name?: string;
|
76
76
|
contentStyles?: string;
|
77
77
|
};
|
78
|
-
export
|
79
|
-
export
|
80
|
-
export
|
78
|
+
export type AppListenerKeys = keyof AppEmitterEvent;
|
79
|
+
export type ApplianceIcons = Partial<Record<`${ApplianceNames}` | string, string>>;
|
80
|
+
export type Writeable<T> = {
|
81
81
|
-readonly [P in keyof T]: T[P];
|
82
82
|
};
|
83
|
-
export
|
84
|
-
export
|
83
|
+
export type ManagerViewMode = `${ViewMode}` | "scroll";
|
84
|
+
export type MoveCameraParams = Partial<Camera> & {
|
85
85
|
animationMode?: AnimationMode;
|
86
86
|
};
|
87
87
|
export type { AppContext } from "./App/AppContext";
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@netless/window-manager",
|
3
|
-
"version": "1.0.0-canary.
|
3
|
+
"version": "1.0.0-canary.77",
|
4
4
|
"description": "",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"module": "dist/index.mjs",
|
@@ -25,39 +25,39 @@
|
|
25
25
|
"value-enhancer": "^1.3.2"
|
26
26
|
},
|
27
27
|
"devDependencies": {
|
28
|
-
"@netless/app-docs-viewer": "1.0.0-canary.
|
28
|
+
"@netless/app-docs-viewer": "1.0.0-canary.6",
|
29
29
|
"@netless/app-plyr": "^0.2.4",
|
30
|
-
"@playwright/test": "^1.
|
31
|
-
"@rollup/plugin-commonjs": "^
|
32
|
-
"@rollup/plugin-node-resolve": "^15.0.
|
30
|
+
"@playwright/test": "^1.33.0",
|
31
|
+
"@rollup/plugin-commonjs": "^24.1.0",
|
32
|
+
"@rollup/plugin-node-resolve": "^15.0.2",
|
33
33
|
"@rollup/plugin-url": "^8.0.1",
|
34
|
-
"@sveltejs/vite-plugin-svelte": "^2.0
|
35
|
-
"@tsconfig/svelte": "^
|
34
|
+
"@sveltejs/vite-plugin-svelte": "^2.2.0",
|
35
|
+
"@tsconfig/svelte": "^4.0.1",
|
36
36
|
"@types/debug": "^4.1.7",
|
37
|
-
"@types/lodash": "^4.14.182",
|
38
|
-
"@types/lodash-es": "^4.17.6",
|
39
37
|
"@types/node": "^18.0.3",
|
40
|
-
"@types/
|
41
|
-
"@
|
42
|
-
"@
|
43
|
-
"@
|
44
|
-
"
|
45
|
-
"
|
46
|
-
"
|
47
|
-
"
|
38
|
+
"@types/lodash": "^4.14.194",
|
39
|
+
"@types/lodash-es": "^4.17.7",
|
40
|
+
"@types/uuid": "^9.0.1",
|
41
|
+
"@typescript-eslint/eslint-plugin": "^5.59.5",
|
42
|
+
"@typescript-eslint/parser": "^5.59.5",
|
43
|
+
"@vitest/ui": "^0.31.0",
|
44
|
+
"cypress": "^12.12.0",
|
45
|
+
"dotenv": "^16.0.3",
|
46
|
+
"eslint": "^8.40.0",
|
47
|
+
"eslint-config-prettier": "^8.8.0",
|
48
48
|
"eslint-plugin-svelte3": "^4.0.0",
|
49
|
-
"jsdom": "^
|
49
|
+
"jsdom": "^22.0.0",
|
50
50
|
"less": "^4.1.3",
|
51
|
-
"prettier": "^2.8.
|
52
|
-
"prettier-plugin-svelte": "^2.
|
51
|
+
"prettier": "^2.8.8",
|
52
|
+
"prettier-plugin-svelte": "^2.10.0",
|
53
53
|
"rollup-plugin-analyzer": "^4.0.0",
|
54
54
|
"rollup-plugin-styles": "^4.0.0",
|
55
|
-
"svelte": "^3.
|
56
|
-
"typescript": "^
|
57
|
-
"vite": "^4.
|
58
|
-
"vite-plugin-dts": "^
|
59
|
-
"vitest": "^0.
|
60
|
-
"white-web-sdk": "^2.16.
|
55
|
+
"svelte": "^3.59.1",
|
56
|
+
"typescript": "^5.0.4",
|
57
|
+
"vite": "^4.3.5",
|
58
|
+
"vite-plugin-dts": "^2.3.0",
|
59
|
+
"vitest": "^0.31.0",
|
60
|
+
"white-web-sdk": "^2.16.42"
|
61
61
|
},
|
62
62
|
"scripts": {
|
63
63
|
"prettier": "prettier --write .",
|
package/src/Helper.ts
CHANGED
@@ -32,8 +32,16 @@ export const checkVersion = () => {
|
|
32
32
|
};
|
33
33
|
|
34
34
|
export const findMemberByUid = (room: Room | undefined, uid: string) => {
|
35
|
-
const roomMembers = room?.state.roomMembers;
|
36
|
-
|
35
|
+
const roomMembers = room?.state.roomMembers || [];
|
36
|
+
let maxMemberId = -1; // 第一个进入房间的用户 memberId 是 0
|
37
|
+
let result: RoomMember | undefined = undefined;
|
38
|
+
for (const member of roomMembers) {
|
39
|
+
if (member.payload?.uid === uid && maxMemberId < member.memberId) {
|
40
|
+
maxMemberId = member.memberId;
|
41
|
+
result = member;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
return result;
|
37
45
|
};
|
38
46
|
|
39
47
|
export type Member = RoomMember & { uid: string };
|
package/dist/image.d.ts
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
declare module "*.svg" {
|
2
|
-
const content: string;
|
3
|
-
export default content;
|
4
|
-
}
|
5
|
-
|
6
|
-
declare module "*.jpg" {
|
7
|
-
const content: string;
|
8
|
-
export default content;
|
9
|
-
}
|
10
|
-
|
11
|
-
declare module "*.png" {
|
12
|
-
const content: string;
|
13
|
-
export default content;
|
14
|
-
}
|
15
|
-
|
16
|
-
declare module "*.gif" {
|
17
|
-
const content: string;
|
18
|
-
export default content;
|
19
|
-
}
|