@netless/window-manager 1.0.0-canary.9 → 1.0.0
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/LICENSE.txt +21 -0
- package/README.md +90 -64
- package/README.zh-cn.md +224 -0
- package/dist/index.d.ts +1133 -40
- package/dist/index.js +62 -0
- package/dist/index.js.map +1 -0
- package/dist/{index.es.js → index.mjs} +9480 -6984
- package/dist/index.mjs.map +1 -0
- package/dist/style.css +1 -1
- package/docs/advanced.md +55 -55
- package/docs/api.md +124 -113
- package/docs/app-context.md +248 -209
- package/docs/basic.md +25 -26
- package/docs/camera.md +19 -20
- package/docs/cn/advanced.md +137 -0
- package/docs/cn/api.md +309 -0
- package/docs/cn/app-context.md +369 -0
- package/docs/cn/basic.md +64 -0
- package/docs/cn/camera.md +53 -0
- package/docs/cn/concept.md +9 -0
- package/docs/cn/custom-max-bar.md +31 -0
- package/docs/cn/develop-app.md +94 -0
- package/docs/cn/export-pdf.md +48 -0
- package/docs/cn/migrate.md +60 -0
- package/docs/cn/replay.md +40 -0
- package/docs/concept.md +6 -5
- package/docs/custom-max-bar.md +31 -0
- package/docs/develop-app.md +22 -19
- package/docs/export-pdf.md +48 -0
- package/docs/migrate.md +25 -27
- package/docs/quickstart.md +50 -0
- package/docs/replay.md +20 -20
- package/package.json +32 -22
- package/src/App/AppContext.ts +105 -73
- package/src/App/AppPageStateImpl.ts +6 -25
- package/src/App/AppProxy.ts +41 -166
- package/src/App/MagixEvent/index.ts +38 -38
- package/src/App/Storage/StorageEvent.ts +13 -13
- package/src/App/Storage/index.ts +269 -245
- package/src/App/Storage/typings.ts +4 -2
- package/src/App/Storage/utils.ts +3 -3
- package/src/App/index.ts +0 -1
- package/src/AppListener.ts +8 -8
- package/src/AppManager.ts +88 -77
- package/src/AttributesDelegate.ts +42 -22
- package/src/BoxEmitter.ts +12 -6
- package/src/BoxManager.ts +128 -108
- package/src/ContainerResizeObserver.ts +75 -0
- package/src/Cursor/Cursor.svelte +16 -5
- package/src/Cursor/Cursor.svelte.d.ts +21 -0
- package/src/Cursor/Cursor.ts +77 -13
- package/src/Cursor/icons.ts +6 -0
- package/src/Cursor/icons2.ts +66 -0
- package/src/Cursor/index.ts +127 -26
- package/src/Helper.ts +94 -14
- package/src/InternalEmitter.ts +2 -7
- package/src/Page/index.ts +1 -1
- package/src/PageState.ts +6 -5
- package/src/ReconnectRefresher.ts +9 -4
- package/src/RedoUndo.ts +3 -3
- package/src/Register/index.ts +22 -17
- package/src/Register/loader.ts +26 -22
- package/src/Register/storage.ts +13 -13
- package/src/Utils/Common.ts +18 -14
- package/src/Utils/Reactive.ts +26 -25
- package/src/Utils/RoomHacker.ts +4 -4
- package/src/Utils/error.ts +0 -1
- package/src/View/IframeBridge.ts +680 -0
- package/src/View/MainView.ts +127 -53
- package/src/callback.ts +21 -1
- package/src/constants.ts +0 -2
- package/src/image/pencil-eraser-1.svg +3 -0
- package/src/image/pencil-eraser-2.svg +3 -0
- package/src/image/pencil-eraser-3.svg +3 -0
- package/src/index.ts +220 -83
- package/src/style.css +27 -10
- package/src/typings.ts +20 -10
- package/.prettierignore +0 -7
- package/.prettierrc.json +0 -9
- package/CHANGELOG.md +0 -196
- package/__mocks__/white-web-sdk.ts +0 -50
- package/dist/App/AppContext.d.ts +0 -76
- package/dist/App/AppPageStateImpl.d.ts +0 -21
- package/dist/App/AppProxy.d.ts +0 -86
- package/dist/App/AppViewSync.d.ts +0 -11
- package/dist/App/MagixEvent/index.d.ts +0 -29
- package/dist/App/Storage/StorageEvent.d.ts +0 -8
- package/dist/App/Storage/index.d.ts +0 -39
- package/dist/App/Storage/typings.d.ts +0 -22
- package/dist/App/Storage/utils.d.ts +0 -5
- package/dist/App/WhiteboardView.d.ts +0 -22
- package/dist/App/index.d.ts +0 -3
- package/dist/AppListener.d.ts +0 -21
- package/dist/AppManager.d.ts +0 -107
- package/dist/AttributesDelegate.d.ts +0 -80
- package/dist/BoxEmitter.d.ts +0 -34
- package/dist/BoxManager.d.ts +0 -99
- package/dist/BuiltinApps.d.ts +0 -5
- package/dist/Cursor/Cursor.d.ts +0 -39
- package/dist/Cursor/icons.d.ts +0 -3
- package/dist/Cursor/index.d.ts +0 -46
- package/dist/Helper.d.ts +0 -17
- package/dist/InternalEmitter.d.ts +0 -39
- package/dist/Page/PageController.d.ts +0 -21
- package/dist/Page/index.d.ts +0 -3
- package/dist/PageState.d.ts +0 -9
- package/dist/ReconnectRefresher.d.ts +0 -24
- package/dist/RedoUndo.d.ts +0 -18
- package/dist/Register/index.d.ts +0 -28
- package/dist/Register/loader.d.ts +0 -4
- package/dist/Register/storage.d.ts +0 -8
- package/dist/Utils/AppCreateQueue.d.ts +0 -15
- package/dist/Utils/Common.d.ts +0 -23
- package/dist/Utils/Reactive.d.ts +0 -6
- package/dist/Utils/RoomHacker.d.ts +0 -3
- package/dist/Utils/error.d.ts +0 -27
- package/dist/Utils/log.d.ts +0 -1
- package/dist/View/CameraSynchronizer.d.ts +0 -16
- package/dist/View/MainView.d.ts +0 -47
- package/dist/View/ViewManager.d.ts +0 -13
- package/dist/callback.d.ts +0 -24
- package/dist/constants.d.ts +0 -49
- package/dist/index.cjs.js +0 -46
- package/dist/index.umd.js +0 -46
- package/dist/typings.d.ts +0 -82
- package/jest.config.js +0 -27
- package/pnpm-lock.yaml +0 -6302
- package/src/App/AppViewSync.ts +0 -68
- package/src/App/WhiteboardView.ts +0 -83
- package/src/View/CameraSynchronizer.ts +0 -56
- package/vite.config.js +0 -51
- /package/docs/{qickstart.md → cn/quickstart.md} +0 -0
package/dist/typings.d.ts
DELETED
@@ -1,82 +0,0 @@
|
|
1
|
-
import type Emittery from "emittery";
|
2
|
-
import type { AnimationMode, ApplianceNames, Displayer, DisplayerState, Player, Room, SceneDefinition, SceneState, View } from "white-web-sdk";
|
3
|
-
import type { AppContext } from "./App";
|
4
|
-
import type { ReadonlyTeleBox, TeleBoxRect } from "@netless/telebox-insider";
|
5
|
-
import type { PageState } from "./Page";
|
6
|
-
import type { Member } from "./Helper";
|
7
|
-
export interface NetlessApp<Attributes = any, MagixEventPayloads = any, AppOptions = any, SetupResult = any> {
|
8
|
-
kind: string;
|
9
|
-
config?: {
|
10
|
-
/** Box width relative to whiteboard. 0~1. Default 0.5. */
|
11
|
-
width?: number;
|
12
|
-
/** Box height relative to whiteboard. 0~1. Default 0.5. */
|
13
|
-
height?: number;
|
14
|
-
/** Minimum box width relative to whiteboard. 0~1. Default 340 / 720. */
|
15
|
-
minwidth?: number;
|
16
|
-
/** Minimum box height relative to whiteboard. 0~1. Default 340 / 720. */
|
17
|
-
minheight?: number;
|
18
|
-
/** App only single instance. */
|
19
|
-
singleton?: boolean;
|
20
|
-
};
|
21
|
-
setup: (context: AppContext<Attributes, MagixEventPayloads, AppOptions>) => SetupResult;
|
22
|
-
}
|
23
|
-
export declare type AppEmitterEvent<T = any> = {
|
24
|
-
/**
|
25
|
-
* before plugin destroyed
|
26
|
-
*/
|
27
|
-
destroy: {
|
28
|
-
error?: Error;
|
29
|
-
};
|
30
|
-
attributesUpdate: T | undefined;
|
31
|
-
/**
|
32
|
-
* room isWritable change or box blur
|
33
|
-
*/
|
34
|
-
writableChange: boolean;
|
35
|
-
sceneStateChange: SceneState;
|
36
|
-
setBoxSize: {
|
37
|
-
width: number;
|
38
|
-
height: number;
|
39
|
-
};
|
40
|
-
setBoxMinSize: {
|
41
|
-
minwidth: number;
|
42
|
-
minheight: number;
|
43
|
-
};
|
44
|
-
setBoxTitle: {
|
45
|
-
title: string;
|
46
|
-
};
|
47
|
-
containerRectUpdate: TeleBoxRect;
|
48
|
-
roomStateChange: Partial<DisplayerState>;
|
49
|
-
focus: boolean;
|
50
|
-
reconnected: void;
|
51
|
-
seek: number;
|
52
|
-
pageStateChange: PageState;
|
53
|
-
roomMembersChange: Member[];
|
54
|
-
};
|
55
|
-
export declare type RegisterEventData = {
|
56
|
-
appId: string;
|
57
|
-
};
|
58
|
-
export declare type RegisterEvents<SetupResult = any> = {
|
59
|
-
created: RegisterEventData & {
|
60
|
-
result: SetupResult;
|
61
|
-
};
|
62
|
-
destroy: RegisterEventData;
|
63
|
-
focus: RegisterEventData;
|
64
|
-
};
|
65
|
-
export declare type RegisterParams<AppOptions = any, SetupResult = any, Attributes = any> = {
|
66
|
-
kind: string;
|
67
|
-
src: NetlessApp<Attributes, SetupResult> | string | (() => Promise<NetlessApp<Attributes, SetupResult>>);
|
68
|
-
appOptions?: AppOptions | (() => AppOptions);
|
69
|
-
addHooks?: (emitter: Emittery<RegisterEvents<SetupResult>>) => void;
|
70
|
-
/** dynamic load app package name */
|
71
|
-
name?: string;
|
72
|
-
};
|
73
|
-
export declare type AppListenerKeys = keyof AppEmitterEvent;
|
74
|
-
export declare type ApplianceIcons = Partial<Record<ApplianceNames, string>>;
|
75
|
-
export type { AppContext } from "./App/AppContext";
|
76
|
-
export type { WhiteBoardView } from "./App";
|
77
|
-
export type { ReadonlyTeleBox, TeleBoxRect };
|
78
|
-
export type { SceneState, SceneDefinition, View, AnimationMode, Displayer, Room, Player };
|
79
|
-
export type { Storage, StorageStateChangedEvent, StorageStateChangedListener } from "./App/Storage";
|
80
|
-
export * from "./Page";
|
81
|
-
export * from "./Utils/error";
|
82
|
-
export type { Member } from "./Helper";
|
package/jest.config.js
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
/* eslint-env node */
|
2
|
-
|
3
|
-
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
|
4
|
-
module.exports = {
|
5
|
-
preset: "ts-jest",
|
6
|
-
testEnvironment: "jsdom",
|
7
|
-
globals: {
|
8
|
-
"ts-jest": {
|
9
|
-
tsconfig: "./test/tsconfig.json",
|
10
|
-
},
|
11
|
-
},
|
12
|
-
testMatch: ["<rootDir>/test/*.ts", "**/test/**/*.test.ts", "test/**.test.ts"],
|
13
|
-
setupFiles: ["jest-canvas-mock", "jest-fetch-mock"],
|
14
|
-
transform: {
|
15
|
-
'^.+\\.svelte$': [
|
16
|
-
'svelte-jester',
|
17
|
-
{
|
18
|
-
"preprocess": true
|
19
|
-
}
|
20
|
-
],
|
21
|
-
".+\\.(css|svg|styl|less|sass|scss|png|jpg|ttf|woff|woff2|inline)$": "jest-transform-stub",
|
22
|
-
|
23
|
-
},
|
24
|
-
moduleNameMapper: {
|
25
|
-
"^.+.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2|inline)$": "jest-transform-stub"
|
26
|
-
},
|
27
|
-
};
|