@netless/window-manager 1.0.0-canary.71 → 1.0.0-canary.73
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/{src/App → App}/AppContext.d.ts +1 -1
- package/dist/{src/App → App}/AppPageStateImpl.d.ts +0 -0
- package/dist/{src/App → App}/AppProxy.d.ts +0 -0
- package/dist/{src/App → App}/MagixEvent/index.d.ts +0 -0
- package/dist/{src/App → App}/WhiteboardView.d.ts +2 -2
- package/dist/{src/App → App}/index.d.ts +0 -0
- package/dist/{src/App → App}/type.d.ts +0 -0
- package/dist/{src/AppListener.d.ts → AppListener.d.ts} +0 -0
- package/dist/{src/AppManager.d.ts → AppManager.d.ts} +0 -0
- package/dist/{src/AttributesDelegate.d.ts → AttributesDelegate.d.ts} +0 -0
- package/dist/{src/BoxEmitter.d.ts → BoxEmitter.d.ts} +0 -0
- package/dist/{src/BoxManager.d.ts → BoxManager.d.ts} +2 -1
- package/dist/{src/BuiltinApps.d.ts → BuiltinApps.d.ts} +0 -0
- package/dist/{src/Cursor → Cursor}/Cursor.d.ts +0 -0
- package/dist/{src/Cursor → Cursor}/icons.d.ts +0 -0
- package/dist/{src/Cursor → Cursor}/index.d.ts +3 -1
- package/dist/{src/Helper.d.ts → Helper.d.ts} +0 -0
- package/dist/{src/InternalEmitter.d.ts → InternalEmitter.d.ts} +0 -0
- package/dist/{src/Page → Page}/PageController.d.ts +0 -0
- package/dist/{src/Page → Page}/index.d.ts +0 -0
- package/dist/{src/PageState.d.ts → PageState.d.ts} +0 -0
- package/dist/{src/ReconnectRefresher.d.ts → ReconnectRefresher.d.ts} +0 -0
- package/dist/{src/RedoUndo.d.ts → RedoUndo.d.ts} +0 -0
- package/dist/{src/Register → Register}/index.d.ts +0 -0
- package/dist/{src/Register → Register}/loader.d.ts +1 -1
- package/dist/{src/Register → Register}/storage.d.ts +0 -0
- package/dist/{src/Utils → Utils}/AppCreateQueue.d.ts +0 -0
- package/dist/{src/Utils → Utils}/Common.d.ts +2 -2
- package/dist/{src/Utils → Utils}/Reactive.d.ts +0 -0
- package/dist/{src/Utils → Utils}/RoomHacker.d.ts +0 -0
- package/dist/{src/Utils → Utils}/error.d.ts +0 -0
- package/dist/{src/Utils → Utils}/log.d.ts +0 -0
- package/dist/{src/View → View}/CameraSynchronizer.d.ts +0 -0
- package/dist/{src/View → View}/MainView.d.ts +0 -0
- package/dist/{src/View → View}/ScrollMode.d.ts +0 -0
- package/dist/{src/View → View}/ViewManager.d.ts +0 -0
- package/dist/{src/View → View}/ViewSync.d.ts +1 -1
- package/dist/{src/callback.d.ts → callback.d.ts} +0 -0
- package/dist/{src/constants.d.ts → constants.d.ts} +0 -0
- package/dist/{src/image.d.ts → image.d.ts} +0 -0
- package/dist/{src/index.d.ts → index.d.ts} +0 -0
- package/dist/index.js +2236 -2750
- package/dist/index.mjs +2209 -2738
- package/dist/index.umd.js +2197 -2729
- package/dist/{src/shim.d.ts → shim.d.ts} +0 -0
- package/dist/{src/storage.d.ts → storage.d.ts} +0 -0
- package/dist/{src/typings.d.ts → typings.d.ts} +0 -0
- package/package.json +40 -39
- package/src/BoxManager.ts +2 -1
- package/src/Cursor/index.ts +7 -2
- package/src/Utils/AppCreateQueue.ts +1 -1
- 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.
|
3
|
+
"version": "1.0.0-canary.73",
|
4
4
|
"description": "",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"module": "dist/index.mjs",
|
7
|
-
"types": "dist/
|
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.
|
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": "^
|
22
|
+
"p-retry": "^5.1.2",
|
33
23
|
"side-effect-manager": "^1.2.1",
|
34
|
-
"uuid": "^
|
24
|
+
"uuid": "^9.0.0",
|
35
25
|
"value-enhancer": "^1.3.2"
|
36
26
|
},
|
37
27
|
"devDependencies": {
|
38
|
-
"@netless/app-docs-viewer": "
|
28
|
+
"@netless/app-docs-viewer": "1.0.0-canary.5",
|
39
29
|
"@netless/app-plyr": "^0.2.4",
|
40
|
-
"@playwright/test": "^1.
|
41
|
-
"@rollup/plugin-commonjs": "^
|
42
|
-
"@rollup/plugin-node-resolve": "^
|
43
|
-
"@rollup/plugin-url": "^
|
44
|
-
"@sveltejs/vite-plugin-svelte": "^
|
45
|
-
"@tsconfig/svelte": "^
|
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": "^
|
51
|
-
"@typescript-eslint/eslint-plugin": "^
|
52
|
-
"@typescript-eslint/parser": "^
|
53
|
-
"@vitest/ui": "^0.
|
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": "^
|
46
|
+
"eslint": "^8.29.0",
|
57
47
|
"eslint-config-prettier": "^8.3.0",
|
58
|
-
"eslint-plugin-svelte3": "^
|
48
|
+
"eslint-plugin-svelte3": "^4.0.0",
|
59
49
|
"jsdom": "^19.0.0",
|
60
50
|
"less": "^4.1.3",
|
61
|
-
"prettier": "^2.
|
62
|
-
"prettier-plugin-svelte": "^2.
|
51
|
+
"prettier": "^2.8.1",
|
52
|
+
"prettier-plugin-svelte": "^2.9.0",
|
63
53
|
"rollup-plugin-analyzer": "^4.0.0",
|
64
|
-
"rollup-plugin-styles": "^
|
65
|
-
"svelte": "^3.
|
66
|
-
"typescript": "^4.
|
67
|
-
"vite": "^
|
68
|
-
"vite-plugin-dts": "^1.
|
69
|
-
"vitest": "^0.
|
70
|
-
"white-web-sdk": "^2.16.
|
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"
|
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
|
|
package/src/Cursor/index.ts
CHANGED
@@ -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
|
|
@@ -116,9 +117,13 @@ export class CursorManager {
|
|
116
117
|
this.updateCursor(this.getType(event), event.clientX, event.clientY);
|
117
118
|
}, 48);
|
118
119
|
|
120
|
+
private shouldBroadcast() {
|
121
|
+
return this.manager.canOperate && this.manager.room?.disableDeviceInputs === false;
|
122
|
+
}
|
123
|
+
|
119
124
|
private updateCursor(event: EventType, clientX: number, clientY: number) {
|
120
125
|
const self = findMemberByUid(this.manager.room, this.manager.uid);
|
121
|
-
if (this.wrapperRect && this.
|
126
|
+
if (this.wrapperRect && this.shouldBroadcast() && this.canMoveCursor(self)) {
|
122
127
|
const view = event.type === "main" ? this.manager.mainView : this.focusView;
|
123
128
|
const point = this.getPoint(view, clientX, clientY);
|
124
129
|
if (point) {
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import path from "path";
|
2
|
-
import dts from
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import { dependencies, peerDependencies, version, devDependencies } from "./package.json"
|
6
|
-
import
|
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,
|
23
|
+
dependencies,
|
24
|
+
peerDependencies,
|
25
|
+
devDependencies,
|
26
26
|
}),
|
27
27
|
},
|
28
28
|
plugins: [
|
29
29
|
svelte({
|
30
30
|
emitCss: false,
|
31
|
-
|
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
|
+
});
|