@netless/window-manager 1.0.0-canary.70 → 1.0.0-canary.72

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.
Files changed (53) hide show
  1. package/dist/{src/App → App}/AppContext.d.ts +1 -1
  2. package/dist/{src/App → App}/AppPageStateImpl.d.ts +0 -0
  3. package/dist/{src/App → App}/AppProxy.d.ts +0 -0
  4. package/dist/{src/App → App}/MagixEvent/index.d.ts +0 -0
  5. package/dist/{src/App → App}/WhiteboardView.d.ts +2 -2
  6. package/dist/{src/App → App}/index.d.ts +0 -0
  7. package/dist/{src/App → App}/type.d.ts +0 -0
  8. package/dist/{src/AppListener.d.ts → AppListener.d.ts} +0 -0
  9. package/dist/{src/AppManager.d.ts → AppManager.d.ts} +0 -0
  10. package/dist/{src/AttributesDelegate.d.ts → AttributesDelegate.d.ts} +0 -0
  11. package/dist/{src/BoxEmitter.d.ts → BoxEmitter.d.ts} +0 -0
  12. package/dist/{src/BoxManager.d.ts → BoxManager.d.ts} +2 -1
  13. package/dist/{src/BuiltinApps.d.ts → BuiltinApps.d.ts} +0 -0
  14. package/dist/{src/Cursor → Cursor}/Cursor.d.ts +0 -0
  15. package/dist/{src/Cursor → Cursor}/icons.d.ts +0 -0
  16. package/dist/{src/Cursor → Cursor}/index.d.ts +2 -1
  17. package/dist/{src/Helper.d.ts → Helper.d.ts} +0 -0
  18. package/dist/{src/InternalEmitter.d.ts → InternalEmitter.d.ts} +0 -0
  19. package/dist/{src/Page → Page}/PageController.d.ts +0 -0
  20. package/dist/{src/Page → Page}/index.d.ts +0 -0
  21. package/dist/{src/PageState.d.ts → PageState.d.ts} +0 -0
  22. package/dist/{src/ReconnectRefresher.d.ts → ReconnectRefresher.d.ts} +0 -0
  23. package/dist/{src/RedoUndo.d.ts → RedoUndo.d.ts} +0 -0
  24. package/dist/{src/Register → Register}/index.d.ts +0 -0
  25. package/dist/{src/Register → Register}/loader.d.ts +1 -1
  26. package/dist/{src/Register → Register}/storage.d.ts +0 -0
  27. package/dist/{src/Utils → Utils}/AppCreateQueue.d.ts +0 -0
  28. package/dist/{src/Utils → Utils}/Common.d.ts +2 -2
  29. package/dist/{src/Utils → Utils}/Reactive.d.ts +0 -0
  30. package/dist/{src/Utils → Utils}/RoomHacker.d.ts +0 -0
  31. package/dist/{src/Utils → Utils}/error.d.ts +0 -0
  32. package/dist/{src/Utils → Utils}/log.d.ts +0 -0
  33. package/dist/{src/View → View}/CameraSynchronizer.d.ts +0 -0
  34. package/dist/{src/View → View}/MainView.d.ts +0 -0
  35. package/dist/{src/View → View}/ScrollMode.d.ts +0 -0
  36. package/dist/{src/View → View}/ViewManager.d.ts +0 -0
  37. package/dist/{src/View → View}/ViewSync.d.ts +1 -1
  38. package/dist/{src/callback.d.ts → callback.d.ts} +0 -0
  39. package/dist/{src/constants.d.ts → constants.d.ts} +0 -0
  40. package/dist/{src/image.d.ts → image.d.ts} +0 -0
  41. package/dist/{src/index.d.ts → index.d.ts} +0 -0
  42. package/dist/index.js +2234 -2752
  43. package/dist/index.mjs +2207 -2740
  44. package/dist/index.umd.js +2195 -2731
  45. package/dist/{src/shim.d.ts → shim.d.ts} +0 -0
  46. package/dist/{src/storage.d.ts → storage.d.ts} +0 -0
  47. package/dist/{src/typings.d.ts → typings.d.ts} +0 -0
  48. package/package.json +40 -39
  49. package/src/BoxManager.ts +2 -1
  50. package/src/Cursor/index.ts +2 -1
  51. package/src/Utils/AppCreateQueue.ts +1 -1
  52. package/src/View/MainView.ts +3 -3
  53. package/{vite.config.js → vite.config.mjs} +13 -16
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,22 +1,11 @@
1
1
  {
2
2
  "name": "@netless/window-manager",
3
- "version": "1.0.0-canary.70",
3
+ "version": "1.0.0-canary.72",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
- "types": "dist/src/index.d.ts",
7
+ "types": "dist/index.d.ts",
8
8
  "repository": "netless-io/window-manager",
9
- "scripts": {
10
- "prettier": "prettier --write .",
11
- "dev": "vite build --watch",
12
- "build": "vite build",
13
- "type-gen": "tsc --emitDeclarationOnly",
14
- "predev": "yarn type-gen",
15
- "build:lib:types": "tsc --emitDeclarationOnly",
16
- "lint": "eslint --ext .ts,.tsx,.svelte . && prettier --check .",
17
- "test": "vitest",
18
- "e2e": "playwright test"
19
- },
20
9
  "keywords": [],
21
10
  "author": "",
22
11
  "license": "ISC",
@@ -24,49 +13,61 @@
24
13
  "white-web-sdk": "^2.16.0"
25
14
  },
26
15
  "dependencies": {
27
- "@juggle/resize-observer": "^3.3.1",
16
+ "@juggle/resize-observer": "^3.4.0",
28
17
  "@netless/synced-store": "^2.0.7",
29
18
  "@netless/telebox-insider": "1.0.0-alpha.37",
30
19
  "emittery": "^0.11.0",
20
+ "jspdf": "^2.5.1",
31
21
  "lodash": "^4.17.21",
32
- "p-retry": "^4.6.2",
22
+ "p-retry": "^5.1.2",
33
23
  "side-effect-manager": "^1.2.1",
34
- "uuid": "^7.0.3",
24
+ "uuid": "^9.0.0",
35
25
  "value-enhancer": "^1.3.2"
36
26
  },
37
27
  "devDependencies": {
38
- "@netless/app-docs-viewer": "^1.0.0-canary.3",
28
+ "@netless/app-docs-viewer": "1.0.0-canary.5",
39
29
  "@netless/app-plyr": "^0.2.4",
40
- "@playwright/test": "^1.23.2",
41
- "@rollup/plugin-commonjs": "^20.0.0",
42
- "@rollup/plugin-node-resolve": "^13.0.4",
43
- "@rollup/plugin-url": "^6.1.0",
44
- "@sveltejs/vite-plugin-svelte": "^1.0.0-next.49",
45
- "@tsconfig/svelte": "^2.0.1",
30
+ "@playwright/test": "^1.28.1",
31
+ "@rollup/plugin-commonjs": "^23.0.4",
32
+ "@rollup/plugin-node-resolve": "^15.0.1",
33
+ "@rollup/plugin-url": "^8.0.1",
34
+ "@sveltejs/vite-plugin-svelte": "^2.0.2",
35
+ "@tsconfig/svelte": "^3.0.0",
46
36
  "@types/debug": "^4.1.7",
47
37
  "@types/lodash": "^4.14.182",
48
38
  "@types/lodash-es": "^4.17.6",
49
39
  "@types/node": "^18.0.3",
50
- "@types/uuid": "^8.3.4",
51
- "@typescript-eslint/eslint-plugin": "^4.30.0",
52
- "@typescript-eslint/parser": "^4.30.0",
53
- "@vitest/ui": "^0.14.2",
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",
54
44
  "cypress": "^8.7.0",
55
45
  "dotenv": "^10.0.0",
56
- "eslint": "^7.32.0",
46
+ "eslint": "^8.29.0",
57
47
  "eslint-config-prettier": "^8.3.0",
58
- "eslint-plugin-svelte3": "^3.2.0",
48
+ "eslint-plugin-svelte3": "^4.0.0",
59
49
  "jsdom": "^19.0.0",
60
50
  "less": "^4.1.3",
61
- "prettier": "^2.3.2",
62
- "prettier-plugin-svelte": "^2.4.0",
51
+ "prettier": "^2.8.1",
52
+ "prettier-plugin-svelte": "^2.9.0",
63
53
  "rollup-plugin-analyzer": "^4.0.0",
64
- "rollup-plugin-styles": "^3.14.1",
65
- "svelte": "^3.42.4",
66
- "typescript": "^4.5.5",
67
- "vite": "^3.1.3",
68
- "vite-plugin-dts": "^1.5.0",
69
- "vitest": "^0.23.4",
70
- "white-web-sdk": "^2.16.35"
54
+ "rollup-plugin-styles": "^4.0.0",
55
+ "svelte": "^3.54.0",
56
+ "typescript": "^4.9.4",
57
+ "vite": "^4.0.1",
58
+ "vite-plugin-dts": "^1.7.1",
59
+ "vitest": "^0.25.7",
60
+ "white-web-sdk": "^2.16.40"
61
+ },
62
+ "scripts": {
63
+ "prettier": "prettier --write .",
64
+ "dev": "vite build --watch",
65
+ "build": "vite build",
66
+ "type-gen": "tsc --emitDeclarationOnly",
67
+ "predev": "yarn type-gen",
68
+ "build:lib:types": "tsc --emitDeclarationOnly",
69
+ "lint": "eslint --ext .ts,.tsx,.svelte . && prettier --check .",
70
+ "test": "vitest",
71
+ "e2e": "playwright test"
71
72
  }
72
- }
73
+ }
package/src/BoxManager.ts CHANGED
@@ -23,6 +23,7 @@ import type { View } from "white-web-sdk";
23
23
  import type { CallbacksType } from "./callback";
24
24
  import type { EmitterType } from "./InternalEmitter";
25
25
  import type { AppState } from "./App/type";
26
+ import { ReadonlyVal } from "value-enhancer";
26
27
 
27
28
  export { TELE_BOX_STATE };
28
29
 
@@ -218,7 +219,7 @@ export class BoxManager {
218
219
  return this.teleBoxManager.stageRect;
219
220
  }
220
221
 
221
- public get stageRect$() {
222
+ public get stageRect$(): ReadonlyVal<TeleBoxRect, any> {
222
223
  return this.teleBoxManager._stageRect$;
223
224
  }
224
225
 
@@ -11,6 +11,7 @@ import type { Point, RoomMember, View } from "white-web-sdk";
11
11
  import type { AppManager } from "../AppManager";
12
12
  import { ApplianceMap } from "./icons";
13
13
  import { findMemberByUid } from "../Helper";
14
+ import { Val } from "value-enhancer";
14
15
 
15
16
  export type EventType = {
16
17
  type: PositionType;
@@ -33,7 +34,7 @@ export class CursorManager {
33
34
  private store = this.manager.store;
34
35
  public applianceIcons: ApplianceIcons = ApplianceMap;
35
36
 
36
- public get playground$() {
37
+ public get playground$(): Val<HTMLElement | undefined, any> {
37
38
  return this.manager.windowManger.playground$;
38
39
  }
39
40
 
@@ -10,7 +10,7 @@ export class AppCreateQueue {
10
10
  public isEmit = false;
11
11
 
12
12
  private initInterval() {
13
- return setInterval(() => {
13
+ return window.setInterval(() => {
14
14
  this.invoke();
15
15
  }, 50);
16
16
  }
@@ -42,9 +42,7 @@ export class MainViewProxy {
42
42
  releaseView(this.mainView);
43
43
  }),
44
44
  ]);
45
- if (manager.windowManger.viewMode$.value !== 'scroll') {
46
- this.createViewSync();
47
- }
45
+ this.createViewSync();
48
46
  this.sideEffectManager.add(() => emitter.on("focusedChange", ({ focused }) => {
49
47
  if (focused === undefined) {
50
48
  const scenePath = this.store.getMainViewScenePath();
@@ -61,6 +59,8 @@ export class MainViewProxy {
61
59
  }
62
60
 
63
61
  public createViewSync = () => {
62
+ // 滚动模式下,不需要同步
63
+ if (this.manager.windowManger.viewMode$.value === 'scroll') return
64
64
  if (this.manager.boxManager && !this.viewSync) {
65
65
  this.viewSync = new ViewSync({
66
66
  uid: this.manager.uid,
@@ -1,9 +1,9 @@
1
1
  import path from "path";
2
- import dts from 'vite-plugin-dts'
3
- import { defineConfig } from 'vitest/config'
4
- import { svelte } from "@sveltejs/vite-plugin-svelte";
5
- import { dependencies, peerDependencies, version, devDependencies } from "./package.json"
6
- import { omit } from "lodash";
2
+ import dts from "vite-plugin-dts";
3
+ import { svelte, vitePreprocess } from "@sveltejs/vite-plugin-svelte";
4
+ import { defineConfig } from "vitest/config";
5
+ import { dependencies, peerDependencies, version, devDependencies } from "./package.json";
6
+ import lodash from "lodash";
7
7
 
8
8
  export default defineConfig(() => {
9
9
  // const isProd = mode === "production";
@@ -12,9 +12,7 @@ export default defineConfig(() => {
12
12
  test: {
13
13
  environment: "jsdom",
14
14
  deps: {
15
- inline: [
16
- "@juggle/resize-observer"
17
- ]
15
+ inline: ["@juggle/resize-observer"],
18
16
  },
19
17
  setupFiles: "./test/setup.ts",
20
18
  include: ["test/**/*.test.ts"],
@@ -22,15 +20,15 @@ export default defineConfig(() => {
22
20
  define: {
23
21
  __APP_VERSION__: JSON.stringify(version),
24
22
  __APP_DEPENDENCIES__: JSON.stringify({
25
- dependencies, peerDependencies, devDependencies
23
+ dependencies,
24
+ peerDependencies,
25
+ devDependencies,
26
26
  }),
27
27
  },
28
28
  plugins: [
29
29
  svelte({
30
30
  emitCss: false,
31
- experimental: {
32
- useVitePreprocess: true,
33
- },
31
+ preprocess: vitePreprocess(),
34
32
  }),
35
33
  dts(),
36
34
  ],
@@ -41,16 +39,15 @@ export default defineConfig(() => {
41
39
  formats: ["es", "umd", "cjs"],
42
40
  name: "WindowManager",
43
41
  fileName: "index",
44
-
45
42
  },
46
43
  outDir: "dist",
47
44
  rollupOptions: {
48
45
  external: Object.keys({
49
- ...omit(dependencies, ["@netless/telebox-insider"]),
46
+ ...lodash.omit(dependencies, ["@netless/telebox-insider"]),
50
47
  ...peerDependencies,
51
48
  }),
52
49
  },
53
- minify: false
50
+ minify: false,
54
51
  },
55
52
  };
56
- })
53
+ });