@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,58 @@
|
|
|
1
|
+
var o = Object.defineProperty;
|
|
2
|
+
var h = (r, e, s) => e in r ? o(r, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[e] = s;
|
|
3
|
+
var a = (r, e, s) => h(r, typeof e != "symbol" ? e + "" : e, s);
|
|
4
|
+
class p {
|
|
5
|
+
constructor(e) {
|
|
6
|
+
a(this, "_map");
|
|
7
|
+
a(this, "_observers", /* @__PURE__ */ new Set());
|
|
8
|
+
this._map = new Map(e);
|
|
9
|
+
}
|
|
10
|
+
notifyObservers(e, s, t) {
|
|
11
|
+
for (const i of this._observers)
|
|
12
|
+
i(e, s, t);
|
|
13
|
+
}
|
|
14
|
+
observe(e) {
|
|
15
|
+
this._observers.add(e);
|
|
16
|
+
}
|
|
17
|
+
unobserve(e) {
|
|
18
|
+
this._observers.delete(e);
|
|
19
|
+
}
|
|
20
|
+
get(e) {
|
|
21
|
+
return this._map.get(e);
|
|
22
|
+
}
|
|
23
|
+
set(e, s, t = !0) {
|
|
24
|
+
const i = this._map.has(e) ? "update" : "add";
|
|
25
|
+
return this._map.set(e, s), t && this.notifyObservers(i, e, s), this;
|
|
26
|
+
}
|
|
27
|
+
has(e) {
|
|
28
|
+
return this._map.has(e);
|
|
29
|
+
}
|
|
30
|
+
delete(e, s = !0) {
|
|
31
|
+
const t = this._map.get(e), i = this._map.delete(e);
|
|
32
|
+
return s && t && this.notifyObservers("delete", e, t), i;
|
|
33
|
+
}
|
|
34
|
+
clear(e = !0) {
|
|
35
|
+
const s = this._map.keys();
|
|
36
|
+
if (this._map.clear(), e)
|
|
37
|
+
for (const t of s)
|
|
38
|
+
this.notifyObservers("clear", t, void 0);
|
|
39
|
+
}
|
|
40
|
+
get size() {
|
|
41
|
+
return this._map.size;
|
|
42
|
+
}
|
|
43
|
+
keys() {
|
|
44
|
+
return this._map.keys();
|
|
45
|
+
}
|
|
46
|
+
values() {
|
|
47
|
+
return this._map.values();
|
|
48
|
+
}
|
|
49
|
+
entries() {
|
|
50
|
+
return this._map.entries();
|
|
51
|
+
}
|
|
52
|
+
forEach(e, s) {
|
|
53
|
+
this._map.forEach(e, s);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
p as O
|
|
58
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var o=Object.defineProperty;var h=(r,e,s)=>e in r?o(r,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[e]=s;var a=(r,e,s)=>h(r,typeof e!="symbol"?e+"":e,s);class n{constructor(e){a(this,"_map");a(this,"_observers",new Set);this._map=new Map(e)}notifyObservers(e,s,t){for(const i of this._observers)i(e,s,t)}observe(e){this._observers.add(e)}unobserve(e){this._observers.delete(e)}get(e){return this._map.get(e)}set(e,s,t=!0){const i=this._map.has(e)?"update":"add";return this._map.set(e,s),t&&this.notifyObservers(i,e,s),this}has(e){return this._map.has(e)}delete(e,s=!0){const t=this._map.get(e),i=this._map.delete(e);return s&&t&&this.notifyObservers("delete",e,t),i}clear(e=!0){const s=this._map.keys();if(this._map.clear(),e)for(const t of s)this.notifyObservers("clear",t,void 0)}get size(){return this._map.size}keys(){return this._map.keys()}values(){return this._map.values()}entries(){return this._map.entries()}forEach(e,s){this._map.forEach(e,s)}}exports.ObserverMap=n;
|
package/dist/appliance-plugin.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-D2XqHUO-.js");exports.ActiveContainerType=e.ActiveContainerType;exports.ApplianceMultiPlugin=e.ApplianceMultiPlugin;exports.ApplianceNames=e.ApplianceNames;exports.ApplianceSigleWrapper=e.ApplianceSigleWrapper;exports.ApplianceSinglePlugin=e.ApplianceSinglePlugin;exports.Cursor_Hover_Id=e.Cursor_Hover_Id;exports.ECanvasShowType=e.ECanvasShowType;exports.EDataType=e.EDataType;exports.EForceStopReason=e.EForceStopReason;exports.EImageType=e.EImageType;exports.EMatrixrRelationType=e.EMatrixrRelationType;exports.EOperationType=e.EOperationType;exports.EPostMessageType=e.EPostMessageType;exports.ERenderFilterType=e.ERenderFilterType;exports.ESVGType=e.ESVGType;exports.EScaleType=e.EScaleType;exports.EStrokeType=e.EStrokeType;exports.EToolsKey=e.EToolsKey;exports.ElayerType=e.ElayerType;exports.EmitEventType=e.EmitEventType;exports.EventMessageType=e.EventMessageType;exports.EventWorkState=e.EventWorkState;exports.EvevtWorkState=e.EventWorkState;exports.InternalMsgEmitterType=e.InternalMsgEmitterType;exports.Main_View_Id=e.Main_View_Id;exports.Plugin=e.Plugin;exports.ShapeType=e.ShapeType;exports.Task_Time_Interval=e.Task_Time_Interval;exports.fullWorkerUrl=e.fullWorker;exports.subWorkerUrl=e.subWorker;
|
|
@@ -1,24 +1,33 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { af as s, a9 as p, ac as r, ab as t, aa as i, a4 as l, Z as n, b as E, ag as o, t as T, j as y, aj as v, a as g, ak as S, d as c, u, w as k, c as m, ai as M, E as _, ah as d, v as A, v as I, ae as W, Y as P, al as b, ad as f, a6 as h, a7 as w, a8 as C } from "./index-CRWsZj1z.mjs";
|
|
2
2
|
export {
|
|
3
3
|
s as ActiveContainerType,
|
|
4
4
|
p as ApplianceMultiPlugin,
|
|
5
5
|
r as ApplianceNames,
|
|
6
6
|
t as ApplianceSigleWrapper,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
T as
|
|
13
|
-
|
|
14
|
-
v as
|
|
15
|
-
g as
|
|
16
|
-
S as
|
|
17
|
-
c as
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
M as
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
i as ApplianceSinglePlugin,
|
|
8
|
+
l as Cursor_Hover_Id,
|
|
9
|
+
n as ECanvasShowType,
|
|
10
|
+
E as EDataType,
|
|
11
|
+
o as EForceStopReason,
|
|
12
|
+
T as EImageType,
|
|
13
|
+
y as EMatrixrRelationType,
|
|
14
|
+
v as EOperationType,
|
|
15
|
+
g as EPostMessageType,
|
|
16
|
+
S as ERenderFilterType,
|
|
17
|
+
c as ESVGType,
|
|
18
|
+
u as EScaleType,
|
|
19
|
+
k as EStrokeType,
|
|
20
|
+
m as EToolsKey,
|
|
21
|
+
M as ElayerType,
|
|
22
|
+
_ as EmitEventType,
|
|
23
|
+
d as EventMessageType,
|
|
24
|
+
A as EventWorkState,
|
|
25
|
+
I as EvevtWorkState,
|
|
26
|
+
W as InternalMsgEmitterType,
|
|
27
|
+
P as Main_View_Id,
|
|
28
|
+
b as Plugin,
|
|
29
|
+
f as ShapeType,
|
|
30
|
+
h as Task_Time_Interval,
|
|
31
|
+
w as fullWorkerUrl,
|
|
32
|
+
C as subWorkerUrl
|
|
24
33
|
};
|
package/dist/cdn.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import fullWorkerUrl from
|
|
2
|
-
import subWorkerUrl from
|
|
1
|
+
import fullWorkerUrl from "./core/worker/fullWorker.ts?worker&url";
|
|
2
|
+
import subWorkerUrl from "./core/worker/subWorker.ts?worker&url";
|
|
3
3
|
export { fullWorkerUrl, subWorkerUrl };
|
package/dist/collector/base.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AppliancePluginLike } from "../plugin/types";
|
|
2
2
|
import { IworkId } from "../core";
|
|
3
3
|
import { BaseApplianceManager } from "../plugin/baseApplianceManager";
|
|
4
|
-
import { ISerializableAuthData } from "./types";
|
|
4
|
+
import { ISerializableAuthData, ISerializableUndoRedoStackViewData } from "./types";
|
|
5
5
|
export declare abstract class BaseCollector<T> {
|
|
6
6
|
plugin: AppliancePluginLike;
|
|
7
7
|
uid: string;
|
|
@@ -9,10 +9,12 @@ export declare abstract class BaseCollector<T> {
|
|
|
9
9
|
abstract storage: T;
|
|
10
10
|
protected abstract namespace: string;
|
|
11
11
|
protected abstract authSpace: string;
|
|
12
|
+
protected abstract globalUndoRedoStackSpace: string;
|
|
12
13
|
readonly control: BaseApplianceManager;
|
|
13
14
|
constructor(control: BaseApplianceManager, plugin: AppliancePluginLike);
|
|
14
15
|
getNamespaceData(): T;
|
|
15
16
|
getAuthSpaceData(): ISerializableAuthData;
|
|
17
|
+
getGlobalUndoRedoStackData(): ISerializableUndoRedoStackViewData;
|
|
16
18
|
getUidFromKey(key: string): string;
|
|
17
19
|
isLocalId(key: string): boolean;
|
|
18
20
|
getLocalId(key: string): string;
|
|
@@ -1,28 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BaseCollectorReducerAction, Diff, DiffAuthPage, DiffAuthRender, ISerializableAuthData,
|
|
1
|
+
import { EOperationType, ERenderFilterType } from "../core/enum";
|
|
2
|
+
import { BaseCollectorReducerAction, Diff, DiffAuthPage, DiffAuthRender, ISerializableAuthData, ISerializableStorageData, ISerializableStorageViewData, ISerializableUndoRedoStackViewData, ISerializableUndoStackId, ScenePath, Uid, ViewId, WorkId, DiffGlobalUndoRedoStack } from "./types";
|
|
3
3
|
import { BaseCollector } from "./base";
|
|
4
|
-
import type { AppliancePluginLike } from "../plugin/types";
|
|
4
|
+
import type { _SetTrue, AppliancePluginLike } from "../plugin/types";
|
|
5
5
|
import { BaseApplianceManager } from "../plugin/baseApplianceManager";
|
|
6
|
+
import { IUndoStackItem } from "../undo";
|
|
7
|
+
import { EProxyArrayOperationType } from "../undo/proxyArray";
|
|
6
8
|
/**
|
|
7
9
|
* 服务端事件/状态同步收集器
|
|
8
10
|
*/
|
|
9
11
|
export declare class Collector extends BaseCollector<ISerializableStorageViewData> {
|
|
10
|
-
protected authSpace: string;
|
|
11
|
-
protected namespace: string;
|
|
12
12
|
static namespace: string;
|
|
13
13
|
static authSpace: string;
|
|
14
|
-
static
|
|
14
|
+
static globalUndoRedoStackSpace: string;
|
|
15
|
+
protected namespace: string;
|
|
16
|
+
protected authSpace: string;
|
|
17
|
+
protected globalUndoRedoStackSpace: string;
|
|
18
|
+
static componentsLimits: number[];
|
|
15
19
|
serviceStorage: ISerializableStorageViewData;
|
|
16
20
|
storage: ISerializableStorageViewData;
|
|
17
21
|
authStorage: ISerializableAuthData;
|
|
22
|
+
globalUndoRedoStackStorage: ISerializableUndoRedoStackViewData;
|
|
18
23
|
private stateDisposer;
|
|
19
24
|
private authDisposer;
|
|
20
25
|
private asyncClockState;
|
|
21
|
-
|
|
26
|
+
private limitNums;
|
|
27
|
+
private syncInterval;
|
|
28
|
+
constructor(control: BaseApplianceManager, plugin: AppliancePluginLike, syncInterval: number);
|
|
29
|
+
hasId(viewId: string, scenePath: string, key: string): boolean;
|
|
30
|
+
private getLimitNum;
|
|
31
|
+
private getLimitNums;
|
|
22
32
|
getViewIdBySecenPath(scenePath: string): string | undefined;
|
|
23
33
|
getScenePathData(scenePath: string): ISerializableStorageData | undefined;
|
|
34
|
+
hasTargetDataByViewId(viewId: string, key: string): true | undefined;
|
|
35
|
+
getTargetDataByViewId(viewId: string, key: string): {
|
|
36
|
+
data: BaseCollectorReducerAction | undefined;
|
|
37
|
+
scenePath: string | undefined;
|
|
38
|
+
};
|
|
24
39
|
getStorageData(viewId: string, scenePath: string): ISerializableStorageData | undefined;
|
|
25
40
|
hasSelector(viewId: string, scenePath: string): boolean;
|
|
41
|
+
hasIncludeSelector(targetKey: string, targetViewId?: string, targetScenePath?: string): boolean;
|
|
26
42
|
addStorageStateListener(callBack: (diff: Diff) => void): void;
|
|
27
43
|
removeStorageStateListener(): void;
|
|
28
44
|
private diffFunByView;
|
|
@@ -42,7 +58,7 @@ export declare class Collector extends BaseCollector<ISerializableStorageViewDat
|
|
|
42
58
|
viewId: string;
|
|
43
59
|
scenePath: string;
|
|
44
60
|
isSync?: boolean;
|
|
45
|
-
|
|
61
|
+
storage?: ISerializableStorageViewData;
|
|
46
62
|
}): void;
|
|
47
63
|
private runSyncService;
|
|
48
64
|
private syncSerivice;
|
|
@@ -56,15 +72,42 @@ export declare class Collector extends BaseCollector<ISerializableStorageViewDat
|
|
|
56
72
|
private syncStorageKey;
|
|
57
73
|
keyTransformWorkId(key: string): string;
|
|
58
74
|
destroy(): void;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
75
|
+
private transformToSerializableUndoStackItemData;
|
|
76
|
+
dispatchUndoTicker(action: {
|
|
77
|
+
operation: EOperationType;
|
|
78
|
+
syncType: EProxyArrayOperationType;
|
|
79
|
+
viewId: ViewId;
|
|
80
|
+
undoTickerId: ISerializableUndoStackId;
|
|
81
|
+
data: IUndoStackItem;
|
|
82
|
+
}): void;
|
|
83
|
+
addGlobalUndoRedoStackListener(callBack: (diffGlobalUndoRedoStack: DiffGlobalUndoRedoStack) => void): void;
|
|
84
|
+
private diffGlobalUndoRedoStackFun;
|
|
85
|
+
dispatchPageAuth(action: {
|
|
86
|
+
operation: EOperationType;
|
|
87
|
+
viewId: ViewId;
|
|
88
|
+
scenePath?: ScenePath;
|
|
89
|
+
pageId?: Uid;
|
|
90
|
+
pageData?: {
|
|
91
|
+
render?: Uid;
|
|
92
|
+
elementIds?: Set<WorkId>;
|
|
93
|
+
elementId?: WorkId;
|
|
94
|
+
};
|
|
95
|
+
}, isSync?: boolean): void;
|
|
96
|
+
dispatchRenderAuth(action: {
|
|
97
|
+
operation: ERenderFilterType;
|
|
98
|
+
viewId: ViewId;
|
|
99
|
+
uid?: Uid;
|
|
100
|
+
isClear?: boolean;
|
|
101
|
+
renderData?: {
|
|
102
|
+
render?: _SetTrue;
|
|
103
|
+
hide?: _SetTrue;
|
|
104
|
+
clear?: _SetTrue;
|
|
105
|
+
};
|
|
65
106
|
}, isSync?: boolean): void;
|
|
66
107
|
addAuthStateListener(callBack: (diffAuthRender?: DiffAuthRender, diffAuthPage?: DiffAuthPage) => void): void;
|
|
67
108
|
removeAuthStateListener(): void;
|
|
68
109
|
private diffAuthFun;
|
|
69
110
|
private diffAuthPageFun;
|
|
111
|
+
private limitComponents;
|
|
112
|
+
private clearLimitComponents;
|
|
70
113
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
1
|
+
export * from "./const";
|
|
2
|
+
export * from "./base";
|
|
3
|
+
export * from "./collector";
|
|
4
|
+
export * from "./types";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EPostMessageType, EToolsKey, EventMessageType } from "../core/enum";
|
|
2
|
-
import { ShapeOptions } from "../core/tools";
|
|
3
|
-
import { IUpdateNodeOpt, IworkId } from "../core/types";
|
|
4
|
-
import {
|
|
1
|
+
import type { EPostMessageType, EToolsKey, EventMessageType } from "../core/enum";
|
|
2
|
+
import type { ShapeOptions } from "../core/tools";
|
|
3
|
+
import type { IUpdateNodeOpt, IworkId } from "../core/types";
|
|
4
|
+
import type { _ObjectTrue, EmitEventType } from "../plugin/types";
|
|
5
5
|
export declare type DiffOneView<ISerializableStorageViewData> = {
|
|
6
6
|
oldValue?: ISerializableStorageViewData;
|
|
7
7
|
newValue?: ISerializableStorageViewData;
|
|
@@ -54,11 +54,12 @@ export interface INormalPushMsg {
|
|
|
54
54
|
viewId?: string;
|
|
55
55
|
scenePath?: string;
|
|
56
56
|
isActive?: string;
|
|
57
|
+
needUndoTicker?: number;
|
|
57
58
|
}
|
|
58
59
|
export interface INormalStorageData {
|
|
59
60
|
[key: string]: IStorageValueItem | undefined;
|
|
60
61
|
}
|
|
61
|
-
export type BaseCollectorReducerAction = INormalPushMsg & Pick<INormalPushMsg,
|
|
62
|
+
export type BaseCollectorReducerAction = INormalPushMsg & Pick<INormalPushMsg, "type">;
|
|
62
63
|
export interface ISerializableStorageData {
|
|
63
64
|
[key: string]: BaseCollectorReducerAction | undefined;
|
|
64
65
|
}
|
|
@@ -66,7 +67,42 @@ export type PageId = string;
|
|
|
66
67
|
export type ViewId = string;
|
|
67
68
|
export type WorkId = string;
|
|
68
69
|
export type ScenePath = string;
|
|
69
|
-
export type Uid = string |
|
|
70
|
+
export type Uid = string | "localSelf";
|
|
71
|
+
export type UndoStackId = number;
|
|
72
|
+
export type ISerializableUndoStackId = `${UndoStackId}-${Uid}`;
|
|
73
|
+
export declare enum EUndoDataType {
|
|
74
|
+
Draw = 1,
|
|
75
|
+
Delete = 2,
|
|
76
|
+
Update = 3
|
|
77
|
+
}
|
|
78
|
+
export interface ISerializableUndoDataType {
|
|
79
|
+
dataType: EUndoDataType;
|
|
80
|
+
data: BaseCollectorReducerAction | [BaseCollectorReducerAction, BaseCollectorReducerAction];
|
|
81
|
+
}
|
|
82
|
+
export declare type DiffGlobalUndoRedoStack = {
|
|
83
|
+
[K in keyof ISerializableUndoRedoStackViewData]?: DiffViewGlobalUndoRedoData;
|
|
84
|
+
};
|
|
85
|
+
export declare type DiffViewGlobalUndoRedoData = {
|
|
86
|
+
oldValue?: ISerializableUndoRedoStackData;
|
|
87
|
+
newValue?: ISerializableUndoRedoStackData;
|
|
88
|
+
};
|
|
89
|
+
export type ISerializableUndoStackItemDataType = {
|
|
90
|
+
[key: WorkId]: ISerializableUndoDataType;
|
|
91
|
+
};
|
|
92
|
+
export type ISerializableUndoStackItemData = {
|
|
93
|
+
data: ISerializableUndoStackItemDataType;
|
|
94
|
+
scenePath: string;
|
|
95
|
+
};
|
|
96
|
+
export type ISerializableUndoStackType = {
|
|
97
|
+
[key: ISerializableUndoStackId]: ISerializableUndoStackItemData;
|
|
98
|
+
};
|
|
99
|
+
export type ISerializableUndoRedoStackData = {
|
|
100
|
+
undoStack: ISerializableUndoStackType;
|
|
101
|
+
redoStack: ISerializableUndoStackType;
|
|
102
|
+
};
|
|
103
|
+
export type ISerializableUndoRedoStackViewData = {
|
|
104
|
+
[key: ViewId]: ISerializableUndoRedoStackData;
|
|
105
|
+
};
|
|
70
106
|
export interface BaseEventCollectorReducerAction {
|
|
71
107
|
type?: EventMessageType;
|
|
72
108
|
uid?: string;
|
|
@@ -87,11 +123,11 @@ export interface ISerializableStorageScenePathData {
|
|
|
87
123
|
}
|
|
88
124
|
export type ISerializableAuthRenderItemType = {
|
|
89
125
|
/** 可读用户组, 如果是true, 则为所有用户笔记可渲染 */
|
|
90
|
-
render?:
|
|
126
|
+
render?: _ObjectTrue;
|
|
91
127
|
/** 可隐藏用户组 如果是true, 则为所有用户笔记可隐藏 */
|
|
92
|
-
hide?:
|
|
128
|
+
hide?: _ObjectTrue;
|
|
93
129
|
/** 可移除笔记用户组 如果是true, 则为所有用户笔记可移除 */
|
|
94
|
-
clear?:
|
|
130
|
+
clear?: _ObjectTrue;
|
|
95
131
|
};
|
|
96
132
|
export type ISerializableAuthRenderDataType = {
|
|
97
133
|
[key: ViewId]: ISerializableAuthRenderItemType;
|
|
@@ -121,7 +157,10 @@ export type ISerializableStorageRenderPagesData = {
|
|
|
121
157
|
pages: ISerializableStorageRenderElementIdsData;
|
|
122
158
|
};
|
|
123
159
|
export type ISerializableStorageRenderElementIdsData = {
|
|
124
|
-
[key: PageId]:
|
|
160
|
+
[key: PageId]: ISerializableStorageRenderElementIdData;
|
|
161
|
+
};
|
|
162
|
+
export type ISerializableStorageRenderElementIdData = {
|
|
163
|
+
[key: WorkId]: true;
|
|
125
164
|
};
|
|
126
165
|
export declare type DiffAuthPage = {
|
|
127
166
|
[K in keyof ISerializableStorageRenderViewsData]?: DiffOnePage;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./manager";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type EventEmitter2 from "eventemitter2";
|
|
2
|
+
import { ViewId } from "../../collector";
|
|
3
|
+
import { BaseApplianceManager } from "../../plugin/baseApplianceManager";
|
|
4
|
+
import type { BaseSubWorkModuleProps } from "../../plugin/types";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { ICameraOpt } from "../../core";
|
|
7
|
+
export interface MiniMapsState {
|
|
8
|
+
contianer: HTMLElement;
|
|
9
|
+
miniMapCanvas: React.RefObject<HTMLCanvasElement>;
|
|
10
|
+
miniMapCamera: ICameraOpt;
|
|
11
|
+
viewCamera: ICameraOpt;
|
|
12
|
+
}
|
|
13
|
+
export interface MiniMapManager {
|
|
14
|
+
getMiniMapCamera(viewId: string): Promise<ICameraOpt | undefined>;
|
|
15
|
+
createMiniMap(viewId: string, contianer: HTMLElement, miniMapCamera: ICameraOpt): Promise<boolean>;
|
|
16
|
+
updateViewCamera(viewId: string, viewCamera: ICameraOpt): void;
|
|
17
|
+
updateMiniMapCamera(viewId: string, miniMapCamera: ICameraOpt): void;
|
|
18
|
+
}
|
|
19
|
+
export declare class MiniMapManagerImpl implements MiniMapManager {
|
|
20
|
+
readonly internalMsgEmitter: EventEmitter2;
|
|
21
|
+
readonly control: BaseApplianceManager;
|
|
22
|
+
readonly maps: Map<ViewId, MiniMapsState>;
|
|
23
|
+
private showId?;
|
|
24
|
+
private color;
|
|
25
|
+
private timer?;
|
|
26
|
+
constructor(props: BaseSubWorkModuleProps);
|
|
27
|
+
get listener(): EventEmitter2;
|
|
28
|
+
get activeViewId(): string | undefined;
|
|
29
|
+
get highlightColor(): string;
|
|
30
|
+
setHighlightColor(color: string): void;
|
|
31
|
+
createMiniMap(viewId: string, contianer: HTMLElement, miniMapCamera: ICameraOpt): Promise<boolean>;
|
|
32
|
+
getMiniMapCamera(viewId: string): Promise<ICameraOpt | undefined>;
|
|
33
|
+
getMiniMapCanvas(viewId: string): HTMLCanvasElement | null;
|
|
34
|
+
updateViewCamera(viewId: string, viewCamera: ICameraOpt): void;
|
|
35
|
+
updateMiniMapCamera: import("lodash").DebouncedFunc<(viewId: string) => Promise<void>>;
|
|
36
|
+
destroyMiniMap(viewId?: string): void;
|
|
37
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MiniMapManagerImpl, MiniMapsState } from "./manager";
|
|
3
|
+
export type MapViewProps = Omit<MiniMapsState, "viewCamera" | "miniMapCamera"> & {
|
|
4
|
+
viewId: string;
|
|
5
|
+
highlightColor: string;
|
|
6
|
+
miniMapManager: MiniMapManagerImpl;
|
|
7
|
+
};
|
|
8
|
+
export declare const MapView: (props: MapViewProps) => React.JSX.Element;
|
|
9
|
+
export interface MapViewContainerProps {
|
|
10
|
+
className: string;
|
|
11
|
+
miniMapManager: MiniMapManagerImpl;
|
|
12
|
+
active?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const MiniMapViewContainer: (props: MapViewContainerProps) => React.JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { EToolsKey } from "../../core/enum";
|
|
2
|
+
import { BaseShapeToolProps } from "../../core/tools";
|
|
3
|
+
import { ISVGOptions } from "../../core/types";
|
|
4
|
+
import { VNodeManager } from "../../core/vNodeManager";
|
|
5
|
+
import { VBackgroundNodeManager } from "./vNodeManager";
|
|
6
|
+
import { ISvgElement } from "./svgElemt";
|
|
7
|
+
import { BackgroundThreadEngineImpl } from "./manager";
|
|
8
|
+
import { BackgroundSnapshotThreadImpl } from "./snapshot";
|
|
9
|
+
export interface IActiveBackgroundToolsDataType {
|
|
10
|
+
toolsType: EToolsKey.BackgroundSVG;
|
|
11
|
+
toolsOpt: ISVGOptions;
|
|
12
|
+
combineUnitTime?: number;
|
|
13
|
+
maxCombineEraserTime?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface ISVGShapeToolProps extends Omit<BaseShapeToolProps, "vNodes"> {
|
|
16
|
+
vNodes: VBackgroundNodeManager;
|
|
17
|
+
toolsOpt: ISVGOptions;
|
|
18
|
+
}
|
|
19
|
+
export interface ISVGShadowShapeToolProps extends BaseShapeToolProps {
|
|
20
|
+
vNodes?: VNodeManager;
|
|
21
|
+
toolsOpt: ISVGOptions;
|
|
22
|
+
}
|
|
23
|
+
export declare function getShapeToolsForBackgroundThread(toolsType: EToolsKey): typeof ISvgElement | undefined;
|
|
24
|
+
export declare function getShapeInstanceForBackgroundThread(param: {
|
|
25
|
+
workId: string;
|
|
26
|
+
toolsType: EToolsKey;
|
|
27
|
+
toolsOpt: ISVGOptions;
|
|
28
|
+
vNodes: VBackgroundNodeManager;
|
|
29
|
+
manager: BackgroundThreadEngineImpl | BackgroundSnapshotThreadImpl;
|
|
30
|
+
}): ISvgElement | undefined;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { IMarkmapOptions } from "markmap-view";
|
|
2
|
+
import { ICameraOpt, IWorkerMessage } from "../../core";
|
|
3
|
+
import { IBackgroundThreadInitOption } from "../../core/backGroundThread";
|
|
4
|
+
import { MasterControlForWorker } from "../../core/mainEngine";
|
|
5
|
+
import { View } from "../../plugin";
|
|
6
|
+
import { VBackgroundNodeManager } from "./vNodeManager";
|
|
7
|
+
export interface BackgroundThreadEngine {
|
|
8
|
+
readonly viewId: string;
|
|
9
|
+
readonly fullLayer: HTMLDivElement;
|
|
10
|
+
readonly vNodes: VBackgroundNodeManager;
|
|
11
|
+
readonly master: MasterControlForWorker;
|
|
12
|
+
setCameraOpt(cameraOpt: ICameraOpt): Promise<void>;
|
|
13
|
+
on(msg: IWorkerMessage): Promise<void>;
|
|
14
|
+
destroy(): void;
|
|
15
|
+
}
|
|
16
|
+
export declare class BackgroundThreadEngineImpl implements BackgroundThreadEngine {
|
|
17
|
+
opt: IBackgroundThreadInitOption;
|
|
18
|
+
viewId: string;
|
|
19
|
+
fullLayer: HTMLDivElement;
|
|
20
|
+
vNodes: VBackgroundNodeManager;
|
|
21
|
+
master: MasterControlForWorker;
|
|
22
|
+
private cameraOpt?;
|
|
23
|
+
private methodBuilder;
|
|
24
|
+
constructor(viewId: string, opt: IBackgroundThreadInitOption);
|
|
25
|
+
get camera(): ICameraOpt;
|
|
26
|
+
get view(): View | undefined;
|
|
27
|
+
get markmapOptions(): Partial<IMarkmapOptions> | undefined;
|
|
28
|
+
getPagePoint(x: number, y: number): {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
};
|
|
32
|
+
setCameraOpt(cameraOpt: ICameraOpt): Promise<void>;
|
|
33
|
+
private clearAll;
|
|
34
|
+
private canUseFullLayer;
|
|
35
|
+
consumeFull(msg: IWorkerMessage): Promise<void>;
|
|
36
|
+
private setFullWork;
|
|
37
|
+
private createWorkShapeNode;
|
|
38
|
+
private removeWork;
|
|
39
|
+
private removeNode;
|
|
40
|
+
on(msg: IWorkerMessage): Promise<void>;
|
|
41
|
+
private toggleFullLayer;
|
|
42
|
+
private updateCamera;
|
|
43
|
+
destroy(): void;
|
|
44
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as markmap from "markmap-view";
|
|
2
|
+
import type { IMarkmapOptions } from "markmap-view";
|
|
3
|
+
import { type ITransformPlugin, Transformer } from "markmap-lib";
|
|
4
|
+
export interface IMermaidTransformerOptions extends Array<ITransformPlugin | (() => ITransformPlugin)> {
|
|
5
|
+
}
|
|
6
|
+
declare class MermaidTransformer extends Transformer {
|
|
7
|
+
private currentWorkId;
|
|
8
|
+
constructor(options?: IMermaidTransformerOptions);
|
|
9
|
+
/**
|
|
10
|
+
* 设置当前工作 ID(用于命名空间隔离)
|
|
11
|
+
* @param workId 工作 ID
|
|
12
|
+
*/
|
|
13
|
+
setWorkId(workId: string): void;
|
|
14
|
+
transform(content: string, fallbackParserOptions?: any): import("markmap-lib").ITransformResult;
|
|
15
|
+
/**
|
|
16
|
+
* 将 markdown 内容中的 katex 公式转换为普通文本
|
|
17
|
+
* 处理 $...$ 和 $$...$$ 格式的公式
|
|
18
|
+
* 由于 Safari 对 katex 的兼容性问题,将公式转换为普通文本显示
|
|
19
|
+
* @param content markdown 内容
|
|
20
|
+
* @returns 处理后的内容
|
|
21
|
+
*/
|
|
22
|
+
private convertKatexToText;
|
|
23
|
+
/**
|
|
24
|
+
* 处理转换结果中的 katex HTML,将其转换为普通文本
|
|
25
|
+
* 递归处理节点树,查找包含 katex 的内容并转换
|
|
26
|
+
* 由于 Safari 对 katex 的兼容性问题,将 katex HTML 转换为普通文本显示
|
|
27
|
+
* @param node markmap 节点
|
|
28
|
+
*/
|
|
29
|
+
private processKatexInRoot;
|
|
30
|
+
/**
|
|
31
|
+
* 等待 markmap foreignObject 内所有图片加载完成
|
|
32
|
+
* 用于在调用 fit() 之前确保所有图片都已加载,以便正确计算尺寸
|
|
33
|
+
* @param svgElement SVG 元素
|
|
34
|
+
* @param timeout 超时时间(毫秒),默认 10 秒
|
|
35
|
+
* @returns Promise<void> 当所有图片加载完成时 resolve
|
|
36
|
+
*/
|
|
37
|
+
static waitForImagesInForeignObjects(svgElement: SVGSVGElement, timeout?: number): Promise<void>;
|
|
38
|
+
}
|
|
39
|
+
export declare const transformer: MermaidTransformer;
|
|
40
|
+
declare const Markmap: typeof markmap.Markmap;
|
|
41
|
+
export { IMarkmapOptions, markmap, Transformer, Markmap, MermaidTransformer };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mermaid 检查和验证工具
|
|
3
|
+
* 用于验证 mermaid.js 是否正确引入和加载
|
|
4
|
+
*
|
|
5
|
+
* 注意:此文件已废弃,请使用 mermaid-loader.ts 中的按需加载功能
|
|
6
|
+
*/
|
|
7
|
+
export declare function checkMermaidAvailability(): Promise<{
|
|
8
|
+
available: boolean;
|
|
9
|
+
version?: string;
|
|
10
|
+
hasInitialize?: boolean;
|
|
11
|
+
hasRender?: boolean;
|
|
12
|
+
error?: string;
|
|
13
|
+
}>;
|
|
14
|
+
export declare function testMermaidRender(): Promise<{
|
|
15
|
+
success: boolean;
|
|
16
|
+
svg?: string;
|
|
17
|
+
error?: string;
|
|
18
|
+
}>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mermaid.js 按需加载管理器
|
|
3
|
+
* 只在检测到 markdown 中有 mermaid 代码块时才加载 mermaid.js
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 检查 markdown 中是否包含 mermaid 代码块
|
|
7
|
+
*/
|
|
8
|
+
export declare function hasMermaidCodeBlock(markdown: string): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* 动态加载 mermaid.js
|
|
11
|
+
* @returns Promise<mermaid 模块>
|
|
12
|
+
*/
|
|
13
|
+
export declare function loadMermaid(): Promise<typeof import("mermaid")>;
|
|
14
|
+
/**
|
|
15
|
+
* 初始化 mermaid(如果还未初始化)
|
|
16
|
+
*/
|
|
17
|
+
export declare function ensureMermaidInitialized(): Promise<typeof import("mermaid")>;
|
|
18
|
+
/**
|
|
19
|
+
* 获取 mermaid 实例(需要先调用 ensureMermaidInitialized)
|
|
20
|
+
*/
|
|
21
|
+
export declare function getMermaid(): (typeof import("mermaid"))["default"] | null;
|
|
22
|
+
/**
|
|
23
|
+
* 检查 mermaid 是否已加载
|
|
24
|
+
*/
|
|
25
|
+
export declare function isMermaidLoaded(): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* 重置状态(主要用于测试)
|
|
28
|
+
*/
|
|
29
|
+
export declare function resetMermaidLoader(): void;
|