@netless/appliance-plugin 1.1.2 → 1.1.3-4.beta.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/READMA.zh-CN.md +993 -0
- package/README.md +963 -176
- package/cdn/cdn.js +1 -1
- package/cdn/fullWorker-Dwf7nY.js +486 -0
- package/cdn/subWorker-DXBnNm.js +486 -0
- package/dist/ObserverMap-BudneEfB.mjs +58 -0
- package/dist/ObserverMap-DTz9zucn.js +1 -0
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +27 -18
- package/dist/cdn.d.ts +2 -2
- package/dist/collector/base.d.ts +3 -1
- package/dist/collector/collector.d.ts +57 -14
- package/dist/collector/index.d.ts +4 -4
- package/dist/collector/types.d.ts +49 -10
- package/dist/component/autoDraw/index.d.ts +0 -0
- package/dist/component/miniMap/index.d.ts +1 -0
- package/dist/component/miniMap/manager.d.ts +37 -0
- package/dist/component/miniMap/view.d.ts +14 -0
- package/dist/component/svg/base.d.ts +30 -0
- package/dist/component/svg/manager.d.ts +44 -0
- package/dist/component/svg/markmap.d.ts +41 -0
- package/dist/component/svg/mermaid-check.d.ts +18 -0
- package/dist/component/svg/mermaid-loader.d.ts +29 -0
- package/dist/component/svg/mermaid.d.ts +109 -0
- package/dist/component/svg/snapshot.d.ts +31 -0
- package/dist/component/svg/svgElemt.d.ts +43 -0
- package/dist/component/svg/svgToImageLoader.d.ts +25 -0
- package/dist/component/svg/types.d.ts +10 -0
- package/dist/component/svg/utils.d.ts +9 -0
- package/dist/component/svg/vNodeManager.d.ts +28 -0
- package/dist/component/textEditor/index.d.ts +2 -2
- package/dist/component/textEditor/manager.d.ts +22 -3
- package/dist/component/textEditor/types.d.ts +5 -4
- package/dist/component/textEditor/utils.d.ts +1 -0
- package/dist/component/textEditor/view.d.ts +28 -48
- package/dist/core/autoShape/index.d.ts +12 -0
- package/dist/core/autoShape/mapper.d.ts +3 -0
- package/dist/core/autoShape/recognizer.d.ts +8 -0
- package/dist/core/autoShape/registry.d.ts +2 -0
- package/dist/core/autoShape/templates.d.ts +2 -0
- package/dist/core/autoShape/types.d.ts +78 -0
- package/dist/core/backGroundThread/index.d.ts +35 -0
- package/dist/core/backGroundThread/types.d.ts +12 -0
- package/dist/core/enum.d.ts +74 -13
- package/dist/core/index.d.ts +3 -3
- package/dist/core/mainEngine.d.ts +101 -27
- package/dist/core/mainThread/base.d.ts +10 -6
- package/dist/core/mainThread/index.d.ts +2 -2
- package/dist/core/mainThread/snapshotThread.d.ts +8 -4
- package/dist/core/mainThread/subLocalThread.d.ts +21 -16
- package/dist/core/mainThread/subServiceThread.d.ts +2 -2
- package/dist/core/mainThread/subTopThread.d.ts +2 -2
- package/dist/core/msgEvent/base.d.ts +1 -0
- package/dist/core/msgEvent/baseForBackgroundThread.d.ts +9 -0
- package/dist/core/msgEvent/baseForWorker.d.ts +2 -1
- package/dist/core/msgEvent/copyNode/forBackgroundThread.d.ts +8 -0
- package/dist/core/msgEvent/copyNode/forMain.d.ts +2 -2
- package/dist/core/msgEvent/forBackgroundThread.d.ts +12 -0
- package/dist/core/msgEvent/forMainThread.d.ts +4 -4
- package/dist/core/msgEvent/forWorker.d.ts +4 -4
- package/dist/core/msgEvent/index.d.ts +4 -4
- package/dist/core/msgEvent/rotateNode/forMain.d.ts +2 -2
- package/dist/core/msgEvent/scaleNode/forMain.d.ts +2 -2
- package/dist/core/msgEvent/setColor/forMain.d.ts +2 -2
- package/dist/core/msgEvent/setPoint/forMain.d.ts +2 -2
- package/dist/core/msgEvent/setZIndex/forMain.d.ts +7 -0
- package/dist/core/msgEvent/translateNode/forMain.d.ts +2 -2
- package/dist/core/plugin.d.ts +49 -0
- package/dist/core/renderCotrol.d.ts +12 -11
- package/dist/core/tools/arrow.d.ts +10 -22
- package/dist/core/tools/base.d.ts +52 -9
- package/dist/core/tools/ellipse.d.ts +10 -22
- package/dist/core/tools/image.d.ts +9 -7
- package/dist/core/tools/index.d.ts +14 -13
- package/dist/core/tools/laserPen.d.ts +1 -1
- package/dist/core/tools/pencil.d.ts +18 -8
- package/dist/core/tools/pencilEraser.d.ts +36 -41
- package/dist/core/tools/pencilEraserBitMap.d.ts +20 -27
- package/dist/core/tools/polygon.d.ts +10 -22
- package/dist/core/tools/rectangle.d.ts +10 -22
- package/dist/core/tools/selector.d.ts +42 -24
- package/dist/core/tools/shadowSvg.d.ts +36 -0
- package/dist/core/tools/speechBalloon.d.ts +10 -22
- package/dist/core/tools/star.d.ts +10 -22
- package/dist/core/tools/straight.d.ts +10 -22
- package/dist/core/tools/text.d.ts +2 -1
- package/dist/core/tools/utils.d.ts +11 -12
- package/dist/core/types.d.ts +98 -18
- package/dist/core/utils/ObserverMap.d.ts +19 -0
- package/dist/core/utils/clipper.d.ts +8 -0
- package/dist/core/utils/getSvgPathFromPoints.d.ts +1 -1
- package/dist/core/utils/index.d.ts +6 -5
- package/dist/core/utils/indexDB.d.ts +17 -0
- package/dist/core/utils/math.d.ts +1 -0
- package/dist/core/utils/polygonUtils.d.ts +8 -0
- package/dist/core/utils/primitives/Box2d.d.ts +4 -4
- package/dist/core/utils/proxy.d.ts +3 -4
- package/dist/core/utils/spriteNode.d.ts +8 -1
- package/dist/core/vNodeManager.d.ts +13 -9
- package/dist/core/worker/base.d.ts +43 -21
- package/dist/core/worker/fullWorkerLocal.d.ts +29 -25
- package/dist/core/worker/fullWorkerService.d.ts +9 -9
- package/dist/core/worker/simpleWorker.d.ts +28 -0
- package/dist/core/worker/snapshotWork.d.ts +27 -0
- package/dist/core/worker/subWorkerLocal.d.ts +2 -3
- package/dist/core/worker/subWorkerTopLayer.d.ts +2 -2
- package/dist/core/worker/workerManager.d.ts +52 -36
- package/dist/cursors/index.d.ts +9 -11
- package/dist/displayer/const.d.ts +1 -0
- package/dist/displayer/cursor/index.d.ts +1 -0
- package/dist/displayer/floatBar/dragBox/index.d.ts +9 -3
- package/dist/displayer/floatBar/index.d.ts +2 -1
- package/dist/displayer/floatBtns/index.d.ts +2 -0
- package/dist/displayer/utils.d.ts +1 -0
- package/dist/extend.d.ts +1 -0
- package/dist/fullWorker.js +242 -195
- package/dist/index-BCI9ZJly.mjs +9884 -0
- package/dist/index-CRWsZj1z.mjs +16601 -0
- package/dist/index-D2XqHUO-.js +1 -0
- package/dist/index-Dfujq78k.js +3 -0
- package/dist/index-TQPJgovl.mjs +1263 -0
- package/dist/index-ZvQrVWzu.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/plugin/applianceMultiPlugin.d.ts +2 -3
- package/dist/plugin/applianceSinglePlugin.d.ts +3 -4
- package/dist/plugin/baseApplianceManager.d.ts +58 -13
- package/dist/plugin/baseViewContainerManager.d.ts +72 -73
- package/dist/plugin/const.d.ts +2 -22
- package/dist/plugin/displayerView.d.ts +18 -4
- package/dist/plugin/index.d.ts +1 -0
- package/dist/plugin/multi/applianceMultiManager.d.ts +0 -1
- package/dist/plugin/multi/containerManager.d.ts +8 -1
- package/dist/plugin/multi/displayer/appViewDisplayerManager.d.ts +3 -2
- package/dist/plugin/multi/displayer/mainViewDisplayerManager.d.ts +4 -2
- package/dist/plugin/single/displayer/mainViewDisplayerManager.d.ts +4 -3
- package/dist/plugin/types.d.ts +393 -32
- package/dist/style.css +1 -1
- package/dist/subWorker.js +242 -195
- package/dist/svgToImageLoader-DPRAAhwW.js +1 -0
- package/dist/svgToImageLoader-mXH53h-l.mjs +18 -0
- package/dist/undo/index.d.ts +25 -31
- package/dist/undo/proxyArray.d.ts +37 -0
- package/package.json +31 -9
- package/cdn/fullWorker-DMz46H.js +0 -439
- package/cdn/subWorker-B_zAQR.js +0 -439
- package/dist/collector/eventCollector.d.ts +0 -31
- package/dist/collector/magixEventCollector.d.ts +0 -31
- package/dist/core/mainThread/workerMainThread.d.ts +0 -99
- package/dist/core/msgEvent/deleteNode/forMainThread.d.ts +0 -6
- package/dist/core/msgEvent/deleteNode/forWorker.d.ts +0 -6
- package/dist/index-B-Nowr4E.mjs +0 -14865
- package/dist/index-BDVvqw7g.js +0 -1
- package/dist/index-DwakKeHT.mjs +0 -2497
- package/dist/index-cRE5FY5s.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var l=Object.create;var i=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var c=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;var b=(e,t,o,g)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of m(t))!d.call(e,r)&&r!==o&&i(e,r,{get:()=>t[r],enumerable:!(g=u(t,r))||g.enumerable});return e};var s=(e,t,o)=>(o=e!=null?l(c(e)):{},b(t||!e||!e.__esModule?i(o,"default",{value:e,enumerable:!0}):o,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let a=null,n=null;async function T(){return a||n||(n=(async()=>{try{const e=await import("dom-to-image");return a=e.default||e,a}catch(e){throw n=null,e}})(),n)}function f(){return a}exports.getSvgToImageLib=f;exports.loadSvgToImageLib=T;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
let t = null, r = null;
|
|
2
|
+
async function n() {
|
|
3
|
+
return t || r || (r = (async () => {
|
|
4
|
+
try {
|
|
5
|
+
const e = await import("dom-to-image");
|
|
6
|
+
return t = e.default || e, t;
|
|
7
|
+
} catch (e) {
|
|
8
|
+
throw r = null, e;
|
|
9
|
+
}
|
|
10
|
+
})(), r);
|
|
11
|
+
}
|
|
12
|
+
function o() {
|
|
13
|
+
return t;
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
o as getSvgToImageLib,
|
|
17
|
+
n as loadSvgToImageLib
|
|
18
|
+
};
|
package/dist/undo/index.d.ts
CHANGED
|
@@ -1,34 +1,19 @@
|
|
|
1
1
|
import EventEmitter2 from "eventemitter2";
|
|
2
|
-
import { BaseCollectorReducerAction } from "../collector";
|
|
2
|
+
import { BaseCollectorReducerAction, ISerializableUndoDataType, ISerializableUndoRedoStackData, ISerializableUndoStackId, ISerializableUndoStackItemData, WorkId } from "../collector";
|
|
3
3
|
import type { Room } from "../plugin/types";
|
|
4
4
|
import { BaseSubWorkModuleProps, ApplianceManagerLike } from "../plugin/types";
|
|
5
5
|
import { MasterController } from "../core/mainEngine";
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
plugin = 2,
|
|
9
|
-
both = 3
|
|
6
|
+
export interface ILocalStorageDataItem extends ISerializableUndoDataType {
|
|
7
|
+
key: WorkId;
|
|
10
8
|
}
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export interface IUndoStackItem {
|
|
17
|
-
type: EUndoType;
|
|
18
|
-
id?: number;
|
|
19
|
-
sdkStep?: number;
|
|
20
|
-
data?: Set<ILocalStorageDataItem>;
|
|
21
|
-
scenePath: string;
|
|
22
|
-
tickStartStorerCache?: Map<string, BaseCollectorReducerAction | undefined>;
|
|
23
|
-
}
|
|
24
|
-
export interface ILocalStorageDataItem {
|
|
25
|
-
dataType: EUndoDataType;
|
|
26
|
-
key: string;
|
|
27
|
-
data: BaseCollectorReducerAction | [BaseCollectorReducerAction, BaseCollectorReducerAction];
|
|
28
|
-
}
|
|
29
|
-
export interface UndoRedoMethodProps extends BaseSubWorkModuleProps {
|
|
9
|
+
export type IUndoStackItem = Omit<ISerializableUndoStackItemData, "data"> & {
|
|
10
|
+
id: ISerializableUndoStackId;
|
|
11
|
+
data: Set<ILocalStorageDataItem>;
|
|
12
|
+
};
|
|
13
|
+
export type UndoRedoMethodProps = Omit<BaseSubWorkModuleProps, "publicMsgEmitter"> & {
|
|
30
14
|
viewId: string;
|
|
31
|
-
|
|
15
|
+
enableGlobal: boolean;
|
|
16
|
+
};
|
|
32
17
|
export declare class UndoRedoMethod {
|
|
33
18
|
static sdkCallBack: <NAME extends string>(name: NAME, listener: any) => void;
|
|
34
19
|
static MaxStackLength: number;
|
|
@@ -36,20 +21,28 @@ export declare class UndoRedoMethod {
|
|
|
36
21
|
emitter: EventEmitter2;
|
|
37
22
|
undoStack: IUndoStackItem[];
|
|
38
23
|
redoStack: IUndoStackItem[];
|
|
39
|
-
worker: MasterController;
|
|
40
|
-
control: ApplianceManagerLike;
|
|
41
|
-
room: Room;
|
|
24
|
+
readonly worker: MasterController;
|
|
25
|
+
readonly control: ApplianceManagerLike;
|
|
26
|
+
readonly room: Room;
|
|
27
|
+
readonly viewId: string;
|
|
28
|
+
readonly enableGlobal: boolean;
|
|
42
29
|
private isTicking;
|
|
43
|
-
private
|
|
44
|
-
private viewId;
|
|
30
|
+
private _undoTickerId?;
|
|
45
31
|
private scenePath?;
|
|
46
32
|
private tickStartStorerCache?;
|
|
47
33
|
private excludeIds;
|
|
48
34
|
constructor(props: UndoRedoMethodProps);
|
|
35
|
+
private handleArrayChange;
|
|
49
36
|
get collector(): import("../collector").Collector | undefined;
|
|
37
|
+
get undoTickerId(): number | undefined;
|
|
38
|
+
get tmpTickStartStorerCache(): Map<string, BaseCollectorReducerAction | undefined> | undefined;
|
|
39
|
+
get uid(): string;
|
|
50
40
|
addExcludeIds(ids: string[]): void;
|
|
51
41
|
undoTickerStart(id: number, scenePath: string): void;
|
|
52
|
-
|
|
42
|
+
undoTickerEnd(id: number, scenePath: string): void;
|
|
43
|
+
undoTickerEndSync(id: number, viewId: string, scenePath: string, isEmit?: boolean): void;
|
|
44
|
+
private transformToUndoStackItem;
|
|
45
|
+
pullServiceData(serviceData?: ISerializableUndoRedoStackData): void;
|
|
53
46
|
undo(scenePath: string): number;
|
|
54
47
|
redo(scenePath: string): number;
|
|
55
48
|
clear(): void;
|
|
@@ -59,6 +52,7 @@ export declare class UndoRedoMethod {
|
|
|
59
52
|
canRedo(): boolean;
|
|
60
53
|
onChangeScene: import("lodash").DebouncedFunc<() => void>;
|
|
61
54
|
onFocusView(): void;
|
|
55
|
+
private especialDiff;
|
|
62
56
|
private diffFun;
|
|
63
57
|
private isDrawEffectiveScene;
|
|
64
58
|
private isDeleteEffectiveScene;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare enum EProxyArrayType {
|
|
2
|
+
Undo = "undo",
|
|
3
|
+
Redo = "redo"
|
|
4
|
+
}
|
|
5
|
+
export type EProxyArrayOperationType = "delete" | "add";
|
|
6
|
+
export type ProxyArrayChangeCallback<T> = (params: {
|
|
7
|
+
operation: EProxyArrayOperationType;
|
|
8
|
+
index?: number;
|
|
9
|
+
oldValue?: T;
|
|
10
|
+
newValue?: T;
|
|
11
|
+
arrayType: EProxyArrayType;
|
|
12
|
+
}) => void;
|
|
13
|
+
export declare class ProxyArray<T> {
|
|
14
|
+
static proxyToRaw: WeakMap<WeakKey, any>;
|
|
15
|
+
static proxyCallbacks: WeakMap<WeakKey, any>;
|
|
16
|
+
static interceptors: {
|
|
17
|
+
entries(...arg: any[]): any;
|
|
18
|
+
forEach(...arg: any[]): any;
|
|
19
|
+
map(...arg: any[]): any;
|
|
20
|
+
filter(...arg: any[]): any;
|
|
21
|
+
find(...arg: any[]): any;
|
|
22
|
+
findIndex(...arg: any[]): any;
|
|
23
|
+
includes(...arg: any[]): any;
|
|
24
|
+
indexOf(...arg: any[]): any;
|
|
25
|
+
slice(...arg: any[]): any;
|
|
26
|
+
concat(...arg: any[]): any;
|
|
27
|
+
push(...arg: any[]): any;
|
|
28
|
+
customPush(...arg: any[]): any;
|
|
29
|
+
pop(): any;
|
|
30
|
+
shift(): any;
|
|
31
|
+
unshift(...arg: any[]): any;
|
|
32
|
+
splice(start: number, deleteCount?: number, ...items: any[]): any;
|
|
33
|
+
customSplice(start: number, deleteCount?: number, ...items: any[]): any;
|
|
34
|
+
length: number;
|
|
35
|
+
};
|
|
36
|
+
createProxy(array: T[], callback: ProxyArrayChangeCallback<T>, arrayType: EProxyArrayType): T[];
|
|
37
|
+
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netless/appliance-plugin",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.34.beta.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
|
-
"cdn"
|
|
6
|
+
"cdn",
|
|
7
|
+
"README.md",
|
|
8
|
+
"READMA.zh-CN.md"
|
|
7
9
|
],
|
|
8
10
|
"main": "./dist/appliance-plugin.js",
|
|
9
11
|
"module": "./dist/appliance-plugin.mjs",
|
|
10
12
|
"types": "./dist/index.d.ts",
|
|
11
13
|
"scripts": {
|
|
12
14
|
"dev": "vite --force",
|
|
15
|
+
"lint": "eslint . --ignore-pattern '**/*.test.ts' --ignore-pattern '**/*.md' && prettier --check . --ignore-path .prettierignore",
|
|
16
|
+
"example:lint": "pnpm --dir example lint",
|
|
17
|
+
"example:typecheck": "pnpm exec tsc --noEmit -p example/tsconfig.json",
|
|
18
|
+
"sync:fastboard-docs": "node scripts/sync-fastboard-docs.mjs",
|
|
19
|
+
"ci:check": "pnpm lint && pnpm test:auto-shape && pnpm build && pnpm example:typecheck",
|
|
20
|
+
"test:auto-shape": "tsx test/autoShape.test.ts",
|
|
13
21
|
"types:bundler": "tsc --emitDeclarationOnly",
|
|
14
22
|
"build:bundler": "vite build --config vite.config.bundler.js && yarn types:bundler",
|
|
15
23
|
"types:worker": "tsc --noEmit",
|
|
@@ -19,37 +27,51 @@
|
|
|
19
27
|
},
|
|
20
28
|
"devDependencies": {
|
|
21
29
|
"@babel/core": "^7.24.7",
|
|
30
|
+
"@babel/plugin-transform-class-properties": "^7.27.1",
|
|
31
|
+
"@babel/plugin-transform-object-rest-spread": "^7.28.4",
|
|
22
32
|
"@babel/preset-env": "^7.24.7",
|
|
33
|
+
"@netless/window-manager": "^1.0.11",
|
|
23
34
|
"@rollup/plugin-babel": "^6.0.4",
|
|
35
|
+
"@types/dom-to-image": "^2.6.7",
|
|
24
36
|
"@types/lodash": "^4.14.202",
|
|
25
37
|
"@types/react": "*",
|
|
26
38
|
"@types/react-dom": "*",
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "^8.39.0",
|
|
40
|
+
"@typescript-eslint/parser": "^8.39.0",
|
|
27
41
|
"cross-env": "^7.0.3",
|
|
42
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
43
|
+
"eslint-plugin-react-refresh": "^0.4.20",
|
|
28
44
|
"less": "^4.2.0",
|
|
45
|
+
"prettier": "^3.6.2",
|
|
46
|
+
"tsx": "^4.21.0",
|
|
29
47
|
"typescript": "^5.2.2",
|
|
30
48
|
"vite": "^5.0.0",
|
|
31
|
-
"
|
|
32
|
-
"white-web-sdk": "^2.16.51"
|
|
49
|
+
"white-web-sdk": "^2.16.53"
|
|
33
50
|
},
|
|
34
51
|
"peerDependencies": {
|
|
35
|
-
"@netless/window-manager": ">=0
|
|
36
|
-
"white-web-sdk": ">= 2.16"
|
|
52
|
+
"@netless/window-manager": ">=1.0",
|
|
53
|
+
"white-web-sdk": ">= 2.16.52"
|
|
37
54
|
},
|
|
38
55
|
"dependencies": {
|
|
56
|
+
"clipper-lib": "^6.4.2",
|
|
57
|
+
"dom-to-image": "^2.6.0",
|
|
39
58
|
"eventemitter2": "^6.4.9",
|
|
40
59
|
"lineclip": "^1.1.5",
|
|
41
60
|
"lodash": "^4.17.21",
|
|
42
61
|
"lz-string": "^1.5.0",
|
|
62
|
+
"markmap-lib": "^0.18.12",
|
|
63
|
+
"markmap-view": "^0.18.12",
|
|
64
|
+
"mermaid": "^11.12.2",
|
|
43
65
|
"re-resizable": "^6.9.11",
|
|
44
66
|
"react": "^16.8.0",
|
|
45
67
|
"react-dom": "^16.8.0",
|
|
46
68
|
"react-draggable": "^4.4.6",
|
|
47
|
-
"spritejs": "^3.8.3"
|
|
69
|
+
"spritejs": "^3.8.3",
|
|
70
|
+
"xss": "^1.0.15"
|
|
48
71
|
},
|
|
49
|
-
"description": "",
|
|
50
72
|
"directories": {
|
|
51
73
|
"example": "example"
|
|
52
74
|
},
|
|
53
75
|
"author": "hqer",
|
|
54
|
-
"license": "
|
|
76
|
+
"license": "MIT"
|
|
55
77
|
}
|