@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/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 declare type ScrollStorageState = {
3
+ export type ScrollStorageState = {
4
4
  scrollTop: number;
5
5
  };
6
- export declare type ScrollStorage = Storage<ScrollStorageState>;
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 declare type AppEmitterEvent<T = any> = {
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 declare type RegisterEventData = {
57
+ export type RegisterEventData = {
58
58
  appId: string;
59
59
  };
60
- export declare type RegisterEvents<SetupResult = any> = {
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 declare type RegisterParams<AppOptions = any, SetupResult = any, Attributes extends Record<string, any> = any> = {
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 declare type AppListenerKeys = keyof AppEmitterEvent;
79
- export declare type ApplianceIcons = Partial<Record<`${ApplianceNames}` | string, string>>;
80
- export declare type Writeable<T> = {
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 declare type ManagerViewMode = `${ViewMode}` | "scroll";
84
- export declare type MoveCameraParams = Partial<Camera> & {
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.76",
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.5",
28
+ "@netless/app-docs-viewer": "1.0.0-canary.6",
29
29
  "@netless/app-plyr": "^0.2.4",
30
- "@playwright/test": "^1.28.1",
31
- "@rollup/plugin-commonjs": "^23.0.4",
32
- "@rollup/plugin-node-resolve": "^15.0.1",
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.2",
35
- "@tsconfig/svelte": "^3.0.0",
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/uuid": "^9.0.0",
41
- "@typescript-eslint/eslint-plugin": "^5.46.1",
42
- "@typescript-eslint/parser": "^5.46.1",
43
- "@vitest/ui": "^0.25.7",
44
- "cypress": "^8.7.0",
45
- "dotenv": "^10.0.0",
46
- "eslint": "^8.29.0",
47
- "eslint-config-prettier": "^8.3.0",
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": "^19.0.0",
49
+ "jsdom": "^22.0.0",
50
50
  "less": "^4.1.3",
51
- "prettier": "^2.8.1",
52
- "prettier-plugin-svelte": "^2.9.0",
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.54.0",
56
- "typescript": "^4.9.4",
57
- "vite": "^4.0.3",
58
- "vite-plugin-dts": "^1.7.1",
59
- "vitest": "^0.25.7",
60
- "white-web-sdk": "^2.16.40"
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
- return roomMembers?.find(member => member.payload?.uid === uid);
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
- }
package/dist/shim.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /// <reference types="svelte" />
2
- /// <reference types="vite/client" />
3
-
4
- declare const __APP_VERSION__: string;
5
- declare const __APP_DEPENDENCIES__: Record<string, string>;