@netless/appliance-plugin 1.1.0 → 1.1.1-7.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.
Files changed (73) hide show
  1. package/README.md +107 -9
  2. package/cdn/cdn.js +1 -1
  3. package/cdn/fullWorker-DXT06v.js +441 -0
  4. package/cdn/subWorker-caziyz.js +441 -0
  5. package/dist/appliance-plugin.js +1 -1
  6. package/dist/appliance-plugin.mjs +23 -19
  7. package/dist/collector/base.d.ts +3 -0
  8. package/dist/collector/collector.d.ts +40 -3
  9. package/dist/collector/enum.d.ts +0 -3
  10. package/dist/collector/eventCollector.d.ts +1 -0
  11. package/dist/collector/magixEventCollector.d.ts +1 -0
  12. package/dist/collector/types.d.ts +61 -15
  13. package/dist/component/autoDraw/index.d.ts +54 -0
  14. package/dist/component/miniMap/index.d.ts +1 -0
  15. package/dist/component/miniMap/manager.d.ts +37 -0
  16. package/dist/component/miniMap/view.d.ts +14 -0
  17. package/dist/core/enum.d.ts +56 -6
  18. package/dist/core/mainEngine.d.ts +36 -15
  19. package/dist/core/mainThread/base.d.ts +4 -0
  20. package/dist/core/mainThread/snapshotThread.d.ts +4 -1
  21. package/dist/core/mainThread/subLocalThread.d.ts +6 -6
  22. package/dist/core/mainThread/subServiceThread.d.ts +1 -1
  23. package/dist/core/mainThread/subTopThread.d.ts +2 -2
  24. package/dist/core/mainThread/workerMainThread.d.ts +3 -2
  25. package/dist/core/plugin.d.ts +49 -0
  26. package/dist/core/renderCotrol.d.ts +108 -0
  27. package/dist/core/tools/arrow.d.ts +3 -2
  28. package/dist/core/tools/base.d.ts +39 -5
  29. package/dist/core/tools/ellipse.d.ts +3 -2
  30. package/dist/core/tools/eraser.d.ts +1 -1
  31. package/dist/core/tools/image.d.ts +9 -7
  32. package/dist/core/tools/pencil.d.ts +4 -3
  33. package/dist/core/tools/pencilEraser.d.ts +1 -1
  34. package/dist/core/tools/pencilEraserBitMap.d.ts +21 -6
  35. package/dist/core/tools/polygon.d.ts +3 -2
  36. package/dist/core/tools/rectangle.d.ts +3 -2
  37. package/dist/core/tools/selector.d.ts +2 -2
  38. package/dist/core/tools/speechBalloon.d.ts +3 -2
  39. package/dist/core/tools/star.d.ts +3 -2
  40. package/dist/core/tools/straight.d.ts +3 -2
  41. package/dist/core/tools/utils.d.ts +4 -3
  42. package/dist/core/types.d.ts +16 -11
  43. package/dist/core/utils/math.d.ts +1 -0
  44. package/dist/core/utils/spriteNode.d.ts +9 -3
  45. package/dist/core/vNodeManager.d.ts +14 -3
  46. package/dist/core/worker/base.d.ts +19 -9
  47. package/dist/core/worker/fullWorkerLocal.d.ts +9 -4
  48. package/dist/core/worker/subWorkerTopLayer.d.ts +2 -2
  49. package/dist/core/worker/workerManager.d.ts +2 -2
  50. package/dist/displayer/floatBar/index.d.ts +1 -0
  51. package/dist/extend.d.ts +2 -0
  52. package/dist/fullWorker.js +158 -156
  53. package/dist/{index-C4KNxHht.mjs → index-16eeAu4_.mjs} +874 -862
  54. package/dist/index-BgMemNid.mjs +16918 -0
  55. package/dist/index-Bpx1RNLY.js +1 -0
  56. package/dist/index-D0mDu2PZ.js +1 -0
  57. package/dist/index.d.ts +1 -0
  58. package/dist/members/index.d.ts +1 -0
  59. package/dist/plugin/baseApplianceManager.d.ts +29 -2
  60. package/dist/plugin/baseViewContainerManager.d.ts +3 -2
  61. package/dist/plugin/const.d.ts +6 -4
  62. package/dist/plugin/displayerView.d.ts +2 -0
  63. package/dist/plugin/multi/applianceMultiManager.d.ts +0 -1
  64. package/dist/plugin/types.d.ts +116 -7
  65. package/dist/style.css +1 -1
  66. package/dist/subWorker.js +158 -156
  67. package/dist/undo/index.d.ts +2 -2
  68. package/package.json +6 -7
  69. package/cdn/fullWorker-CjGKnN.js +0 -439
  70. package/cdn/subWorker-DUJqv_.js +0 -439
  71. package/dist/index-C29o_HLi.js +0 -1
  72. package/dist/index-CIJP6_Qj.mjs +0 -14190
  73. package/dist/index-DmfRoAiB.js +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DmfRoAiB.js");exports.ActiveContainerType=e.ActiveContainerType;exports.ApplianceMultiPlugin=e.ApplianceMultiPlugin;exports.ApplianceNames=e.ApplianceNames;exports.ApplianceSigleWrapper=e.ApplianceSigleWrapper;exports.ApplianceSinglePlugin=e.ApplianceSinglePlugin;exports.ECanvasContextType=e.ECanvasContextType;exports.ECanvasShowType=e.ECanvasShowType;exports.EDataType=e.EDataType;exports.EMatrixrRelationType=e.EMatrixrRelationType;exports.EPostMessageType=e.EPostMessageType;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.EvevtWorkState=e.EvevtWorkState;exports.EvevtWorkType=e.EvevtWorkType;exports.InternalMsgEmitterType=e.InternalMsgEmitterType;exports.ShapeType=e.ShapeType;exports.fullWorkerUrl=e.fullWorker;exports.subWorkerUrl=e.subWorker;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-Bpx1RNLY.js");exports.ActiveContainerType=e.ActiveContainerType;exports.ApplianceMultiPlugin=e.ApplianceMultiPlugin;exports.ApplianceNames=e.ApplianceNames;exports.ApplianceSigleWrapper=e.ApplianceSigleWrapper;exports.ApplianceSinglePlugin=e.ApplianceSinglePlugin;exports.AutoDrawPlugin=e.AutoDrawPlugin;exports.ECanvasShowType=e.ECanvasShowType;exports.EDataType=e.EDataType;exports.EImageType=e.EImageType;exports.EMatrixrRelationType=e.EMatrixrRelationType;exports.EOperationType=e.EOperationType;exports.EPostMessageType=e.EPostMessageType;exports.ERenderFilterType=e.ERenderFilterType;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.EvevtWorkState=e.EvevtWorkState;exports.EvevtWorkType=e.EvevtWorkType;exports.InternalMsgEmitterType=e.InternalMsgEmitterType;exports.Plugin=e.Plugin;exports.ShapeType=e.ShapeType;exports.fullWorkerUrl=e.fullWorker;exports.subWorkerUrl=e.subWorker;
@@ -1,25 +1,29 @@
1
- import { H as s, A as p, B as t, z as r, y as l, J as n, K as y, h as E, r as i, k as T, O as o, F as v, E as g, N as S, p as c, L as k, a as A, P as u, I as M, G as W, w as m, x } from "./index-CIJP6_Qj.mjs";
1
+ import { F as s, A as p, y as r, x as t, w as l, Q as i, G as n, b as y, k as E, m as T, N as o, c as g, O as u, K as v, z as c, a as A, J as S, j as k, H as m, E as P, L as M, I as W, P as w, B as x, u as I, v as b } from "./index-BgMemNid.mjs";
2
2
  export {
3
3
  s as ActiveContainerType,
4
4
  p as ApplianceMultiPlugin,
5
- t as ApplianceNames,
6
- r as ApplianceSigleWrapper,
5
+ r as ApplianceNames,
6
+ t as ApplianceSigleWrapper,
7
7
  l as ApplianceSinglePlugin,
8
- n as ECanvasContextType,
9
- y as ECanvasShowType,
10
- E as EDataType,
11
- i as EMatrixrRelationType,
12
- T as EPostMessageType,
13
- o as EScaleType,
14
- v as EStrokeType,
15
- g as EToolsKey,
8
+ i as AutoDrawPlugin,
9
+ n as ECanvasShowType,
10
+ y as EDataType,
11
+ E as EImageType,
12
+ T as EMatrixrRelationType,
13
+ o as EOperationType,
14
+ g as EPostMessageType,
15
+ u as ERenderFilterType,
16
+ v as EScaleType,
17
+ c as EStrokeType,
18
+ A as EToolsKey,
16
19
  S as ElayerType,
17
- c as EmitEventType,
18
- k as EventMessageType,
19
- A as EvevtWorkState,
20
- u as EvevtWorkType,
21
- M as InternalMsgEmitterType,
22
- W as ShapeType,
23
- m as fullWorkerUrl,
24
- x as subWorkerUrl
20
+ k as EmitEventType,
21
+ m as EventMessageType,
22
+ P as EvevtWorkState,
23
+ M as EvevtWorkType,
24
+ W as InternalMsgEmitterType,
25
+ w as Plugin,
26
+ x as ShapeType,
27
+ I as fullWorkerUrl,
28
+ b as subWorkerUrl
25
29
  };
@@ -1,15 +1,18 @@
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
5
  export declare abstract class BaseCollector<T> {
5
6
  plugin: AppliancePluginLike;
6
7
  uid: string;
7
8
  abstract serviceStorage: T;
8
9
  abstract storage: T;
9
10
  protected abstract namespace: string;
11
+ protected abstract authSpace: string;
10
12
  readonly control: BaseApplianceManager;
11
13
  constructor(control: BaseApplianceManager, plugin: AppliancePluginLike);
12
14
  getNamespaceData(): T;
15
+ getAuthSpaceData(): ISerializableAuthData;
13
16
  getUidFromKey(key: string): string;
14
17
  isLocalId(key: string): boolean;
15
18
  getLocalId(key: string): string;
@@ -1,19 +1,28 @@
1
- import { BaseCollectorReducerAction, Diff, ISerializableStorageData, ISerializableStorageViewData } from "./types";
1
+ import { EOperationType, ERenderFilterType } from "../core/enum";
2
+ import { BaseCollectorReducerAction, Diff, DiffAuthPage, DiffAuthRender, ISerializableAuthData, ISerializableStorageData, ISerializableStorageViewData, ScenePath, Uid, ViewId, WorkId } from "./types";
2
3
  import { BaseCollector } from "./base";
3
- import type { AppliancePluginLike } from "../plugin/types";
4
+ import type { _SetTrue, AppliancePluginLike } from "../plugin/types";
4
5
  import { BaseApplianceManager } from "../plugin/baseApplianceManager";
5
6
  /**
6
7
  * 服务端事件/状态同步收集器
7
8
  */
8
9
  export declare class Collector extends BaseCollector<ISerializableStorageViewData> {
10
+ protected authSpace: string;
9
11
  protected namespace: string;
10
12
  static namespace: string;
13
+ static authSpace: string;
11
14
  static syncInterval: number;
15
+ static componentsLimits: number[];
12
16
  serviceStorage: ISerializableStorageViewData;
13
17
  storage: ISerializableStorageViewData;
18
+ authStorage: ISerializableAuthData;
14
19
  private stateDisposer;
20
+ private authDisposer;
15
21
  private asyncClockState;
22
+ private limitNums;
16
23
  constructor(control: BaseApplianceManager, plugin: AppliancePluginLike, syncInterval?: number);
24
+ private getLimitNum;
25
+ private getLimitNums;
17
26
  getViewIdBySecenPath(scenePath: string): string | undefined;
18
27
  getScenePathData(scenePath: string): ISerializableStorageData | undefined;
19
28
  getStorageData(viewId: string, scenePath: string): ISerializableStorageData | undefined;
@@ -37,7 +46,7 @@ export declare class Collector extends BaseCollector<ISerializableStorageViewDat
37
46
  viewId: string;
38
47
  scenePath: string;
39
48
  isSync?: boolean;
40
- isAfterUpdate?: boolean;
49
+ storage?: ISerializableStorageViewData;
41
50
  }): void;
42
51
  private runSyncService;
43
52
  private syncSerivice;
@@ -51,4 +60,32 @@ export declare class Collector extends BaseCollector<ISerializableStorageViewDat
51
60
  private syncStorageKey;
52
61
  keyTransformWorkId(key: string): string;
53
62
  destroy(): void;
63
+ dispatchPageAuth(action: {
64
+ operation: EOperationType;
65
+ viewId: ViewId;
66
+ scenePath?: ScenePath;
67
+ pageId?: Uid;
68
+ pageData?: {
69
+ render?: Uid;
70
+ elementIds?: Set<WorkId>;
71
+ elementId?: WorkId;
72
+ };
73
+ }, isSync?: boolean): void;
74
+ dispatchRenderAuth(action: {
75
+ operation: ERenderFilterType;
76
+ viewId: ViewId;
77
+ uid?: Uid;
78
+ isClear?: boolean;
79
+ renderData?: {
80
+ render?: _SetTrue;
81
+ hide?: _SetTrue;
82
+ clear?: _SetTrue;
83
+ };
84
+ }, isSync?: boolean): void;
85
+ addAuthStateListener(callBack: (diffAuthRender?: DiffAuthRender, diffAuthPage?: DiffAuthPage) => void): void;
86
+ removeAuthStateListener(): void;
87
+ private diffAuthFun;
88
+ private diffAuthPageFun;
89
+ private limitComponents;
90
+ private clearLimitComponents;
54
91
  }
@@ -1,7 +1,4 @@
1
1
  /** 同步事件类型 */
2
- export declare enum EEventDataKey {
3
- GetPoint = "getPoint"
4
- }
5
2
  /** 同步类型 */
6
3
  export declare enum SyncedType {
7
4
  State = 0,
@@ -6,6 +6,7 @@ import { BaseApplianceManager } from "../plugin/baseApplianceManager";
6
6
  * 服务端事件/状态同步收集器
7
7
  */
8
8
  export declare class EventCollector extends BaseCollector<ISerializableEventData> {
9
+ protected authSpace: string;
9
10
  static syncInterval: number;
10
11
  static namespace: string;
11
12
  serviceStorage: ISerializableEventData;
@@ -6,6 +6,7 @@ import { BaseApplianceManager } from "../plugin/baseApplianceManager";
6
6
  * 服务端事件/状态同步收集器
7
7
  */
8
8
  export declare class magixEventCollector extends BaseCollector<ISerializableEventData> {
9
+ protected authSpace: string;
9
10
  static syncInterval: number;
10
11
  static namespace: string;
11
12
  serviceStorage: ISerializableEventData;
@@ -1,8 +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 { EmitEventType } from "../plugin/types";
5
- import { EEventDataKey } from "./enum";
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";
6
5
  export declare type DiffOneView<ISerializableStorageViewData> = {
7
6
  oldValue?: ISerializableStorageViewData;
8
7
  newValue?: ISerializableStorageViewData;
@@ -32,12 +31,6 @@ export declare type Diff = {
32
31
  diffScenePath?: DiffScenePath<ISerializableStorageScenePathData>;
33
32
  diffView?: DiffView<ISerializableStorageViewData>;
34
33
  };
35
- export type SyncEventData = {
36
- [key in EEventDataKey]: {
37
- workId?: number;
38
- key: string;
39
- };
40
- };
41
34
  export type IStorageValueItem = Partial<INormalPushMsg>;
42
35
  export interface INormalPushMsg {
43
36
  workId?: IworkId;
@@ -69,6 +62,11 @@ export type BaseCollectorReducerAction = INormalPushMsg & Pick<INormalPushMsg, '
69
62
  export interface ISerializableStorageData {
70
63
  [key: string]: BaseCollectorReducerAction | undefined;
71
64
  }
65
+ export type PageId = string;
66
+ export type ViewId = string;
67
+ export type WorkId = string;
68
+ export type ScenePath = string;
69
+ export type Uid = string | 'localSelf';
72
70
  export interface BaseEventCollectorReducerAction {
73
71
  type?: EventMessageType;
74
72
  uid?: string;
@@ -76,14 +74,62 @@ export interface BaseEventCollectorReducerAction {
76
74
  op?: Array<number | undefined>;
77
75
  isHide?: boolean;
78
76
  isSync?: boolean;
79
- viewId?: string;
77
+ viewId?: ViewId;
80
78
  }
81
79
  export interface ISerializableEventData {
82
- [key: string]: Array<BaseEventCollectorReducerAction | undefined> | undefined;
80
+ [key: WorkId]: Array<BaseEventCollectorReducerAction | undefined> | undefined;
83
81
  }
84
82
  export interface ISerializableStorageViewData {
85
- [key: string]: ISerializableStorageScenePathData;
83
+ [key: ViewId]: ISerializableStorageScenePathData;
86
84
  }
87
85
  export interface ISerializableStorageScenePathData {
88
- [key: string]: ISerializableStorageData;
86
+ [key: ScenePath]: ISerializableStorageData;
89
87
  }
88
+ export type ISerializableAuthRenderItemType = {
89
+ /** 可读用户组, 如果是true, 则为所有用户笔记可渲染 */
90
+ render?: _ObjectTrue;
91
+ /** 可隐藏用户组 如果是true, 则为所有用户笔记可隐藏 */
92
+ hide?: _ObjectTrue;
93
+ /** 可移除笔记用户组 如果是true, 则为所有用户笔记可移除 */
94
+ clear?: _ObjectTrue;
95
+ };
96
+ export type ISerializableAuthRenderDataType = {
97
+ [key: ViewId]: ISerializableAuthRenderItemType;
98
+ };
99
+ export type ISerializableAuthData = {
100
+ /** viewid区分,用户显示笔记权限 */
101
+ renderAuth?: ISerializableAuthRenderDataType;
102
+ /** viewid区分,用户显示笔记权限 */
103
+ pageAuth?: ISerializableStorageRenderViewsData;
104
+ };
105
+ export type ISerializableAuthRenderItemTypeKey = keyof ISerializableAuthRenderItemType;
106
+ export declare type DiffAuthRender = {
107
+ [K in keyof ISerializableAuthRenderDataType]?: DiffOneRender;
108
+ };
109
+ export declare type DiffOneRender = {
110
+ oldValue?: ISerializableAuthRenderItemType;
111
+ newValue?: ISerializableAuthRenderItemType;
112
+ };
113
+ export type ISerializableStorageRenderViewsData = {
114
+ [key: ViewId]: ISerializableStorageRenderScenesData;
115
+ };
116
+ export type ISerializableStorageRenderScenesData = {
117
+ [key: ScenePath]: ISerializableStorageRenderPagesData;
118
+ };
119
+ export type ISerializableStorageRenderPagesData = {
120
+ render: Uid;
121
+ pages: ISerializableStorageRenderElementIdsData;
122
+ };
123
+ export type ISerializableStorageRenderElementIdsData = {
124
+ [key: PageId]: ISerializableStorageRenderElementIdData;
125
+ };
126
+ export type ISerializableStorageRenderElementIdData = {
127
+ [key: WorkId]: true;
128
+ };
129
+ export declare type DiffAuthPage = {
130
+ [K in keyof ISerializableStorageRenderViewsData]?: DiffOnePage;
131
+ };
132
+ export declare type DiffOnePage = {
133
+ oldValue?: ISerializableStorageRenderScenesData;
134
+ newValue?: ISerializableStorageRenderScenesData;
135
+ };
@@ -0,0 +1,54 @@
1
+ import { Plugin } from "../../core/plugin";
2
+ export type autdrawRect = {
3
+ centerX: number;
4
+ centerY: number;
5
+ width: number;
6
+ height: number;
7
+ };
8
+ export type PointX = number;
9
+ export type PointY = number;
10
+ export type PointTimer = number;
11
+ export type AutdrawInk = [Array<PointX>, Array<PointY>, Array<PointTimer>];
12
+ export type BatchDrawInfo = {
13
+ rect: {
14
+ centerX: number;
15
+ centerY: number;
16
+ width: number;
17
+ height: number;
18
+ };
19
+ ink: AutdrawInk[];
20
+ };
21
+ export type AutoDrawOptions = {
22
+ hostServer: string;
23
+ container: HTMLDivElement;
24
+ delay?: number;
25
+ };
26
+ export declare class AutoDrawPlugin extends Plugin {
27
+ readonly kind = "autoDraw";
28
+ private localStorage;
29
+ private excludeStorage;
30
+ private timer?;
31
+ private hostServer;
32
+ private iconsContainer;
33
+ private icons;
34
+ private iconRect?;
35
+ private isActive;
36
+ private viewId;
37
+ private scenePath?;
38
+ private delay;
39
+ constructor(options: AutoDrawOptions);
40
+ get collector(): import("../../collector").Collector | undefined;
41
+ onDestroy(): void;
42
+ onCreate(): void;
43
+ private onSetToolkey;
44
+ private syncStorage;
45
+ private getOwnStorage;
46
+ private batchLocalDraw;
47
+ private computAutoDraw;
48
+ private buildHTML;
49
+ private onClickIcon;
50
+ private sceneChange;
51
+ private localEvent;
52
+ mount(): void;
53
+ unMount(): void;
54
+ }
@@ -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;
@@ -105,13 +105,21 @@ export declare enum EPostMessageType {
105
105
  /** 优先激活worker */
106
106
  PriorityMainThreadWorker = 22,
107
107
  /** 获取图片位图 */
108
- GetImageBitMap = 23
109
- }
110
- export declare enum ECanvasContextType {
111
- Webgl2 = "webgl2",
112
- Webgl = "webgl",
113
- Canvas2d = "2d"
108
+ GetImageBitMap = 23,
109
+ /** 授权可写权限 */
110
+ AuthWriter = 24,
111
+ /** 授权可显示笔记权限 */
112
+ AuthReader = 25,
113
+ /** 授权可以删除笔记权限 */
114
+ AuthClear = 26,
115
+ /** 授权可以操作page权限 */
116
+ AuthPage = 27,
117
+ /** 获取vNode信息 */
118
+ GetVNodeInfo = 28,
119
+ /** 变更dpr */
120
+ UpdateDpr = 29
114
121
  }
122
+ export type ECanvasContextType = "webgl2" | "webgl" | "2d";
115
123
  export declare enum ECanvasShowType {
116
124
  None = 0,
117
125
  /** 背景画布 */
@@ -152,7 +160,49 @@ export declare enum EvevtWorkType {
152
160
  Unwritable = 4
153
161
  }
154
162
  export declare enum EMatrixrRelationType {
163
+ /** 在内部, 无边界碰撞 */
155
164
  inside = 0,
165
+ /** 在外部 */
156
166
  outside = 1,
167
+ /** 有边界碰撞 */
157
168
  intersect = 2
158
169
  }
170
+ /**
171
+ * 分屏 操作类型
172
+ * view => scenes => pages => elements
173
+ */
174
+ export declare enum EOperationType {
175
+ /** 设置同步视口页面 */
176
+ renderPage = "renderPage",
177
+ /** 新增页面 */
178
+ addPage = "addPage",
179
+ /** 删除页面 */
180
+ deletePage = "deletePage",
181
+ /** 新增笔记 */
182
+ addElement = "addElement",
183
+ /** 删除笔记 */
184
+ deleteElement = "deleteElement",
185
+ /** 清空页面中的所有笔记 */
186
+ clearPage = "clearPage",
187
+ /** 清空场景下的所有页面*/
188
+ clearViewScenePath = "clearViewScenePath",
189
+ /** 清空view */
190
+ clearView = "clearView"
191
+ }
192
+ /**
193
+ * 笔记过滤 操作类型
194
+ */
195
+ export declare enum ERenderFilterType {
196
+ /** 设置全量权限 */
197
+ setAuth = "setAuth",
198
+ /** 设置可显权限 */
199
+ setShow = "addShow",
200
+ /** 设置可隐藏权限 */
201
+ setHide = "setHide",
202
+ /** 设置可删除权限 */
203
+ setClear = "setClear"
204
+ }
205
+ export declare enum EImageType {
206
+ Image = "image",
207
+ Iconify = "iconify"
208
+ }
@@ -1,9 +1,9 @@
1
- import EventEmitter2 from "eventemitter2";
1
+ import type EventEmitter2 from "eventemitter2";
2
2
  import { BaseCollectorReducerAction, DiffOneData } from "../collector";
3
3
  import { BaseApplianceManager } from "../plugin/baseApplianceManager";
4
- import { IActiveToolsDataType, IActiveWorkDataType, ICameraOpt, IMainMessage, IRectType, IUpdateNodeOpt, IWorkerMessage, IqueryTask, IworkId, ViewWorkerOptions } from "./types";
4
+ import { BaseNodeMapItem, IActiveToolsDataType, IActiveWorkDataType, ICameraOpt, IMainMessage, IRectType, IUpdateNodeOpt, IWorkerMessage, IqueryTask, IworkId, ViewWorkerOptions } from "./types";
5
5
  import { BaseSubWorkModuleProps } from "../plugin/types";
6
- import type { ImageInformation, PriorityType } from "../plugin/types";
6
+ import type { IconifyInformation, ImageInformation, PriorityType, _SetTrue } from "../plugin/types";
7
7
  import { MethodBuilderMain } from "./msgEvent";
8
8
  import { EvevtWorkState } from "./enum";
9
9
  import { BaseShapeOptions } from "./tools";
@@ -66,7 +66,7 @@ export declare abstract class MasterController {
66
66
  /** 更新已有node配置 */
67
67
  abstract updateNode(workId: IworkId, updateNodeOpt: IUpdateNodeOpt, viewId: string, scenePath: string): void;
68
68
  /** 清空指定的view场景路径下的所有数据 */
69
- abstract clearViewScenePath(viewId: string, justLocal?: boolean): Promise<void>;
69
+ abstract clearViewScenePath(viewId: string, justLocal?: boolean, isFiter?: boolean): Promise<void>;
70
70
  /** 更新指定view场景路径下的相机参数 */
71
71
  abstract updateCamera(viewId: string, cameraOpt: ICameraOpt): void;
72
72
  /** 创建一个新的viewWorker */
@@ -78,9 +78,12 @@ export declare abstract class MasterController {
78
78
  abstract getSnapshot(scenePath: string, width?: number, height?: number, camera?: Pick<ICameraOpt, "centerX" | "centerY" | "scale">): Promise<ImageBitmap> | undefined;
79
79
  /** 根据查询条件查询事件任务处理批量池中任务 */
80
80
  abstract queryTaskBatchData(query: IqueryTask): IWorkerMessage[];
81
- abstract insertImage(imageInfo: ImageInformation): void;
82
- abstract lockImage(uuid: string, locked: boolean): void;
83
- abstract completeImageUpload(uuid: string, src: string): void;
81
+ abstract insertImage(viewId: string, imageInfo: ImageInformation): void;
82
+ abstract insertIconify(viewId: string, iconifyInfo: IconifyInformation & {
83
+ strokeColor?: string;
84
+ }): void;
85
+ abstract lockImage(viewId: string, uuid: string, locked: boolean): void;
86
+ abstract completeImageUpload(viewId: string, uuid: string, src: string): void;
84
87
  abstract getImagesInformation(scenePath: string): ImageInformation[];
85
88
  /** 移除正在绘制的流程 */
86
89
  abstract removeDrawingWork(viewId: string): void;
@@ -102,8 +105,10 @@ export declare class MasterControlForWorker extends MasterController {
102
105
  private zIndexNodeMethod?;
103
106
  /** master\fullwoker\subworker 三者高频绘制时队列化参数 */
104
107
  private subWorkerDrawCount;
105
- private wokerDrawCount;
108
+ private fullWorkerDrawCount;
106
109
  private maxDrawCount;
110
+ private _consumeCount;
111
+ private _postCount;
107
112
  private reRenders;
108
113
  private localWorkViewId?;
109
114
  protected localPointsBatchData: Map<IworkId, {
@@ -132,8 +137,13 @@ export declare class MasterControlForWorker extends MasterController {
132
137
  private willSelectorWorkId?;
133
138
  private isLockSentEventCursor;
134
139
  private subMainThreadWorker?;
140
+ private getVNodeInfoResolveMap;
135
141
  constructor(props: BaseSubWorkModuleProps);
136
142
  destroy(): void;
143
+ private get consumeCount();
144
+ private set consumeCount(value);
145
+ private get postCount();
146
+ private set postCount(value);
137
147
  private get viewContainerManager();
138
148
  private get collector();
139
149
  private get isRunSubWork();
@@ -141,6 +151,8 @@ export declare class MasterControlForWorker extends MasterController {
141
151
  private get isUseZIndex();
142
152
  private get isCanRecordUndoRedo();
143
153
  private get isCanSentCursor();
154
+ private get isPostCountType();
155
+ private get isCanPostDraw();
144
156
  private get isCanStartEventConsum();
145
157
  init(): Promise<void>;
146
158
  private useMainThread;
@@ -151,11 +163,10 @@ export declare class MasterControlForWorker extends MasterController {
151
163
  setLockSentEventCursor(bol: boolean): void;
152
164
  getTasksqueueState(): EvevtWorkState.Doing | EvevtWorkState.Done;
153
165
  setMaxDrawCount(num: number): void;
154
- getWorkDrawCount(): number;
155
- getSubWorkerDrawCount(): number;
166
+ getFullWorkDrawCount(): number;
156
167
  getMaxDrawCount(): number;
157
- setWorkDrawCount(num: number): void;
158
168
  setSubWorkerDrawCount(num: number): void;
169
+ setConsumeCount(num: number): void;
159
170
  setWorkerTasksqueueCount(num: number): void;
160
171
  collectorSyncData(sp: IMainMessage[]): void;
161
172
  private collectorAsyncData;
@@ -195,26 +206,36 @@ export declare class MasterControlForWorker extends MasterController {
195
206
  post(msg: Set<IWorkerMessage>): void;
196
207
  updateNode(workId: IworkId, updateNodeOpt: IUpdateNodeOpt, viewId: string, scenePath: string): void;
197
208
  destroyTaskQueue(): void;
209
+ updateDpr(viewId: string, dpr: number): void;
198
210
  updateCamera(viewId: string, cameraOpt: ICameraOpt): void;
199
211
  private updateCameraDone;
200
212
  private consumeQueue;
201
- clearViewScenePath(viewId: string, justLocal?: boolean | undefined): Promise<void>;
213
+ clearViewScenePath(viewId: string, justLocal?: boolean | undefined, isFiter?: boolean): Promise<void>;
202
214
  private internalMsgEmitterListener;
203
215
  private setZIndex;
204
216
  checkDrawingWork(vId: string): void;
205
217
  removeDrawingWork(vId: string): void;
218
+ removeNodes(viewId: string, removeIds: string[]): void;
206
219
  hoverCursor(point: [number, number], viewId: string): void;
207
220
  blurCursor(viewId: string): void;
208
221
  sendCursorEvent(p: [number | undefined, number | undefined], viewId: string): void;
209
222
  getBoundingRect(scenePath: string): Promise<IRectType> | undefined;
210
223
  getSnapshot(scenePath: string, width?: number, height?: number, camera?: Pick<ICameraOpt, "centerX" | "centerY" | "scale">): Promise<ImageBitmap> | undefined;
211
224
  queryTaskBatchData(query: IqueryTask): IWorkerMessage[];
212
- insertImage(imageInfo: ImageInformation): void;
213
- lockImage(uuid: string, locked: boolean): void;
214
- completeImageUpload(uuid: string, src: string): void;
225
+ insertIconify(viewId: string, iconifyInfo: IconifyInformation & {
226
+ strokeColor?: string;
227
+ }): void;
228
+ insertImage(viewId: string, imageInfo: ImageInformation): void;
229
+ lockImage(viewId: string, uuid: string, locked: boolean): void;
230
+ completeImageUpload(viewId: string, uuid: string, src: string): void;
215
231
  getImagesInformation(scenePath: string): ImageInformation[];
216
232
  setShapeSelectorByWorkId(workId: string, viewId: string): void;
217
233
  blurSelector(viewId: string, scenePath: string, workId?: string): void;
218
234
  consoleWorkerInfo(): void;
219
235
  setPriority(priority: PriorityType): void;
236
+ sendClearUids(viewId: string, clearUids?: _SetTrue): void;
237
+ getVNodeInfo(uuid: string, viewId: string, workIds: string[]): Promise<{
238
+ uuid: string;
239
+ vInfo?: BaseNodeMapItem[];
240
+ } | undefined>;
220
241
  }
@@ -67,10 +67,14 @@ export declare class MainThreadEngineImpl implements MainThreadEngine {
67
67
  private imageResolveMap;
68
68
  constructor(viewId: string, opt: IMainThreadInitOption);
69
69
  getCachedImages(imageSrc: string): ImageBitmap | undefined;
70
+ getCachedImagesByWorkId(workId: string): ImageBitmap | undefined;
71
+ deleteCachedImagesByWorkId(workId: string): void;
70
72
  clearCacheImages(): void;
71
73
  clearImageResolveMap(): void;
72
74
  post(msg: Omit<IBatchMainMessage, 'render'>): void;
75
+ updateDpr(dpr: number): void;
73
76
  on(msg: IWorkerMessage): Promise<void>;
77
+ private getIconSize;
74
78
  loadImageBitMap(msg: Pick<IWorkerMessage, 'toolsType' | 'opt' | 'workId'>): Promise<ImageBitmap | undefined>;
75
79
  private removeNode;
76
80
  consumeFull(type: EDataType, data: IWorkerMessage): Promise<void>;
@@ -18,14 +18,17 @@ export declare class SnapshotThreadImpl {
18
18
  private imageResolveMap;
19
19
  constructor(viewId: string, opt: IMainThreadInitOption);
20
20
  getCachedImages(imageSrc: string): ImageBitmap | undefined;
21
+ getCachedImagesByWorkId(workId: string): ImageBitmap | undefined;
22
+ deleteCachedImagesByWorkId(workId: string): void;
21
23
  clearCacheImages(): void;
22
24
  clearImageResolveMap(): void;
23
25
  post(msg: Omit<IBatchMainMessage, 'render'>): void;
24
26
  on(msg: IWorkerMessage): Promise<void>;
27
+ private getIconSize;
25
28
  loadImageBitMap(msg: Pick<IWorkerMessage, 'toolsType' | 'opt' | 'workId'>): Promise<ImageBitmap | undefined>;
26
29
  createWorkShapeNode(opt: IActiveToolsDataType & {
27
30
  workId: string;
28
- }): import("../tools").PencilShape | import("../tools").LaserPenShape | import("../tools").EraserShape | import("../tools").StarShape | TextShape | import("../tools").SelectorShape | ImageShape | import("../tools").ArrowShape | import("../tools/straight").StraightShape | import("../tools").EllipseShape | import("../tools").PolygonShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | import("../tools/pencilEraserBitMap").BitMapEraserShape | import("../tools/pencilEraser").PencilEraserShape | undefined;
31
+ }): import("../tools").ArrowShape | import("../tools").PencilShape | import("../tools/straight").StraightShape | import("../tools").EllipseShape | import("../tools").PolygonShape | import("../tools").StarShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | TextShape | import("../tools").LaserPenShape | import("../tools").EraserShape | import("../tools/pencilEraser").PencilEraserShape | import("../tools/pencilEraserBitMap").BitMapEraserShape | import("../tools").SelectorShape | ImageShape | undefined;
29
32
  setFullWork(data: Pick<IWorkerMessage, 'workId' | 'opt' | 'toolsType'>): BaseShapeTool | undefined;
30
33
  runFullWork(data: IWorkerMessage): Promise<IRectType | undefined>;
31
34
  private getSnapshot;