@flowgram.ai/free-layout-core 0.1.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/dist/esm/chunk-CGOMTQ3G.js +1 -0
- package/dist/esm/chunk-CGOMTQ3G.js.map +1 -0
- package/dist/esm/chunk-DDJTYHXN.js +1 -0
- package/dist/esm/chunk-DDJTYHXN.js.map +1 -0
- package/dist/esm/chunk-DE4324TR.js +7 -0
- package/dist/esm/chunk-DE4324TR.js.map +1 -0
- package/dist/esm/chunk-EUXUH3YW.js +15 -0
- package/dist/esm/chunk-EUXUH3YW.js.map +1 -0
- package/dist/esm/chunk-J5FVRRUV.js +16 -0
- package/dist/esm/chunk-J5FVRRUV.js.map +1 -0
- package/dist/esm/chunk-KAL7YCC2.js +20 -0
- package/dist/esm/chunk-KAL7YCC2.js.map +1 -0
- package/dist/esm/chunk-KNYZRMIO.js +1 -0
- package/dist/esm/chunk-KNYZRMIO.js.map +1 -0
- package/dist/esm/chunk-NU6G5HF4.js +1 -0
- package/dist/esm/chunk-NU6G5HF4.js.map +1 -0
- package/dist/esm/index.js +3432 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/typings/index.js +22 -0
- package/dist/esm/typings/index.js.map +1 -0
- package/dist/esm/typings/workflow-edge.js +2 -0
- package/dist/esm/typings/workflow-edge.js.map +1 -0
- package/dist/esm/typings/workflow-json.js +8 -0
- package/dist/esm/typings/workflow-json.js.map +1 -0
- package/dist/esm/typings/workflow-line.js +10 -0
- package/dist/esm/typings/workflow-line.js.map +1 -0
- package/dist/esm/typings/workflow-node.js +2 -0
- package/dist/esm/typings/workflow-node.js.map +1 -0
- package/dist/esm/typings/workflow-registry.js +2 -0
- package/dist/esm/typings/workflow-registry.js.map +1 -0
- package/dist/esm/typings/workflow-sub-canvas.js +2 -0
- package/dist/esm/typings/workflow-sub-canvas.js.map +1 -0
- package/dist/index.d.mts +463 -0
- package/dist/index.d.ts +463 -0
- package/dist/index.js +3483 -0
- package/dist/index.js.map +1 -0
- package/dist/typings/index.d.mts +18 -0
- package/dist/typings/index.d.ts +18 -0
- package/dist/typings/index.js +66 -0
- package/dist/typings/index.js.map +1 -0
- package/dist/typings/workflow-edge.d.mts +11 -0
- package/dist/typings/workflow-edge.d.ts +11 -0
- package/dist/typings/workflow-edge.js +19 -0
- package/dist/typings/workflow-edge.js.map +1 -0
- package/dist/typings/workflow-json.d.mts +9 -0
- package/dist/typings/workflow-json.d.ts +9 -0
- package/dist/typings/workflow-json.js +40 -0
- package/dist/typings/workflow-json.js.map +1 -0
- package/dist/typings/workflow-line.d.mts +27 -0
- package/dist/typings/workflow-line.d.ts +27 -0
- package/dist/typings/workflow-line.js +45 -0
- package/dist/typings/workflow-line.js.map +1 -0
- package/dist/typings/workflow-node.d.mts +9 -0
- package/dist/typings/workflow-node.d.ts +9 -0
- package/dist/typings/workflow-node.js +19 -0
- package/dist/typings/workflow-node.js.map +1 -0
- package/dist/typings/workflow-registry.d.mts +26 -0
- package/dist/typings/workflow-registry.d.ts +26 -0
- package/dist/typings/workflow-registry.js +19 -0
- package/dist/typings/workflow-registry.js.map +1 -0
- package/dist/typings/workflow-sub-canvas.d.mts +2 -0
- package/dist/typings/workflow-sub-canvas.d.ts +2 -0
- package/dist/typings/workflow-sub-canvas.js +19 -0
- package/dist/typings/workflow-sub-canvas.js.map +1 -0
- package/dist/workflow-line-entity-1qT4aXVU.d.mts +619 -0
- package/dist/workflow-line-entity-CG_8mknJ.d.ts +619 -0
- package/dist/workflow-sub-canvas-DOVla1mw.d.mts +15 -0
- package/dist/workflow-sub-canvas-DOVla1mw.d.ts +15 -0
- package/package.json +72 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
import { PlaygroundConfigEntity, CommandService, PlaygroundDragEvent, EntityData } from '@flowgram.ai/core';
|
|
2
|
+
export { bindConfigEntity, useConfigEntity, useEntities, useEntityDataFromContext, useEntityFromContext, useListenEvents, usePlayground, usePlaygroundContainer, usePlaygroundContext, usePlaygroundLatest, useRefresh, useService } from '@flowgram.ai/core';
|
|
3
|
+
import { NodeFormProps } from '@flowgram.ai/node';
|
|
4
|
+
import { FlowOperationBaseService, FlowNodeEntity } from '@flowgram.ai/document';
|
|
5
|
+
import { W as WorkflowHoverService, a as WorkflowDocument, b as WorkflowLinesManager, c as WorkflowSelectService, d as WorkflowNodeJSON, e as WorkflowPortEntity, f as WorkflowLineEntity, g as WorkflowPorts, h as WorkflowPortType, i as WorkflowPort } from './workflow-line-entity-CG_8mknJ.js';
|
|
6
|
+
export { B as BezierLine, L as LINE_HOVER_DISTANCE, P as POINT_RADIUS, t as PORT_SIZE, k as WORKFLOW_LINE_ENTITY, v as WorkfloEntityHoverable, o as WorkflowContentChangeEvent, n as WorkflowContentChangeType, x as WorkflowDocumentOptions, y as WorkflowDocumentOptionsDefault, w as WorkflowDocumentProvider, m as WorkflowJSON, r as WorkflowLineEntityOpts, s as WorkflowLineInfo, q as WorkflowLinePortInfo, p as WorkflowNodeMeta, u as WorkflowPortEntityOpts, l as domReactToBounds, j as getPortEntityId } from './workflow-line-entity-CG_8mknJ.js';
|
|
7
|
+
import { W as WorkflowNodeEntity } from './workflow-sub-canvas-DOVla1mw.js';
|
|
8
|
+
export { a as WorkflowSubCanvas } from './workflow-sub-canvas-DOVla1mw.js';
|
|
9
|
+
import * as _flowgram_ai_utils from '@flowgram.ai/utils';
|
|
10
|
+
import { DisposableCollection, IPoint, Disposable, PositionSchema, Rectangle } from '@flowgram.ai/utils';
|
|
11
|
+
export { compose, composeAsync, delay } from '@flowgram.ai/utils';
|
|
12
|
+
export { URLParams } from './typings/index.js';
|
|
13
|
+
import React$1 from 'react';
|
|
14
|
+
import { ContainerModule } from 'inversify';
|
|
15
|
+
export { WorkflowEdgeJSON } from './typings/workflow-edge.js';
|
|
16
|
+
export { WorkflowNodeFormMeta, WorkflowNodeRegistry, WorkflowNodeRenderProps } from './typings/workflow-registry.js';
|
|
17
|
+
export { LineColor, LineColors, LinePosition, LineType } from './typings/workflow-line.js';
|
|
18
|
+
import 'bezier-js';
|
|
19
|
+
import '@flowgram.ai/form-core';
|
|
20
|
+
|
|
21
|
+
declare enum WorkflowCommands {
|
|
22
|
+
DELETE_NODES = "DELETE_NODES",
|
|
23
|
+
COPY_NODES = "COPY_NODES",
|
|
24
|
+
PASTE_NODES = "PASTE_NODES",
|
|
25
|
+
ZOOM_IN = "ZOOM_IN",
|
|
26
|
+
ZOOM_OUT = "ZOOM_OUT",
|
|
27
|
+
UNDO = "UNDO",
|
|
28
|
+
REDO = "REDO"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface LineEventProps {
|
|
32
|
+
type: 'onDrag' | 'onDragEnd';
|
|
33
|
+
onDragNodeId?: string;
|
|
34
|
+
event?: MouseEvent;
|
|
35
|
+
}
|
|
36
|
+
interface INodesDragEvent {
|
|
37
|
+
type: string;
|
|
38
|
+
nodes: FlowNodeEntity[];
|
|
39
|
+
startPositions: IPoint[];
|
|
40
|
+
altKey: boolean;
|
|
41
|
+
}
|
|
42
|
+
interface NodesDragEndEvent extends INodesDragEvent {
|
|
43
|
+
type: 'onDragEnd';
|
|
44
|
+
}
|
|
45
|
+
type NodesDragEvent = NodesDragEndEvent;
|
|
46
|
+
type OnDragNodeEnd = (params: {
|
|
47
|
+
fromPort: WorkflowPortEntity;
|
|
48
|
+
toPort?: WorkflowPortEntity;
|
|
49
|
+
mousePos: PositionSchema;
|
|
50
|
+
line?: WorkflowLineEntity;
|
|
51
|
+
originLine?: WorkflowLineEntity;
|
|
52
|
+
event: PlaygroundDragEvent;
|
|
53
|
+
}) => Promise<void>;
|
|
54
|
+
declare class WorkflowDragService {
|
|
55
|
+
protected playgroundConfig: PlaygroundConfigEntity;
|
|
56
|
+
protected hoverService: WorkflowHoverService;
|
|
57
|
+
protected document: WorkflowDocument;
|
|
58
|
+
protected linesManager: WorkflowLinesManager;
|
|
59
|
+
protected commandService: CommandService;
|
|
60
|
+
protected selectService: WorkflowSelectService;
|
|
61
|
+
protected operationService: FlowOperationBaseService;
|
|
62
|
+
private _onDragLineEventEmitter;
|
|
63
|
+
readonly onDragLineEventChange: _flowgram_ai_utils.Event<LineEventProps>;
|
|
64
|
+
isDragging: boolean;
|
|
65
|
+
private _nodesDragEmitter;
|
|
66
|
+
readonly onNodesDrag: _flowgram_ai_utils.Event<NodesDragEndEvent>;
|
|
67
|
+
protected _toDispose: DisposableCollection;
|
|
68
|
+
private _droppableTransforms;
|
|
69
|
+
private _dropNode?;
|
|
70
|
+
private posAdjusters;
|
|
71
|
+
private _onDragLineEndCallbacks;
|
|
72
|
+
init(): void;
|
|
73
|
+
dispose(): void;
|
|
74
|
+
/**
|
|
75
|
+
* 拖拽选中节点
|
|
76
|
+
* @param event
|
|
77
|
+
*/
|
|
78
|
+
startDragSelectedNodes(event: MouseEvent | React$1.MouseEvent): Promise<boolean>;
|
|
79
|
+
/**
|
|
80
|
+
* 通过拖入卡片添加
|
|
81
|
+
* @param type
|
|
82
|
+
* @param event
|
|
83
|
+
* @param data 节点数据
|
|
84
|
+
*/
|
|
85
|
+
dropCard(type: string, event: {
|
|
86
|
+
clientX: number;
|
|
87
|
+
clientY: number;
|
|
88
|
+
}, data?: Partial<WorkflowNodeJSON>, parent?: WorkflowNodeEntity): Promise<WorkflowNodeEntity | undefined>;
|
|
89
|
+
/**
|
|
90
|
+
* 拖拽卡片到画布
|
|
91
|
+
* 返回创建结果
|
|
92
|
+
* @param type
|
|
93
|
+
* @param event
|
|
94
|
+
*/
|
|
95
|
+
startDragCard(type: string, event: React$1.MouseEvent, data: Partial<WorkflowNodeJSON>, cloneNode?: (e: PlaygroundDragEvent) => HTMLDivElement): Promise<WorkflowNodeEntity | undefined>;
|
|
96
|
+
/**
|
|
97
|
+
* 如果存在容器节点,且传入鼠标坐标,需要用容器的坐标减去传入的鼠标坐标
|
|
98
|
+
*/
|
|
99
|
+
adjustSubNodePosition(subNodeType?: string, containerNode?: WorkflowNodeEntity, mousePos?: IPoint, resetEmptyPos?: boolean): IPoint;
|
|
100
|
+
/**
|
|
101
|
+
* 注册位置调整
|
|
102
|
+
*/
|
|
103
|
+
registerPosAdjuster(adjuster: (params: {
|
|
104
|
+
selectedNodes: WorkflowNodeEntity[];
|
|
105
|
+
position: IPoint;
|
|
106
|
+
}) => IPoint): {
|
|
107
|
+
dispose: () => boolean;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* 获取拖拽偏移
|
|
111
|
+
*/
|
|
112
|
+
private getDragPosOffset;
|
|
113
|
+
private updateDroppableTransforms;
|
|
114
|
+
/**
|
|
115
|
+
* 获取节点整体位置
|
|
116
|
+
*/
|
|
117
|
+
private getNodesPosition;
|
|
118
|
+
private nodeSelectable;
|
|
119
|
+
private updateDropNode;
|
|
120
|
+
private clearDrop;
|
|
121
|
+
private setLineColor;
|
|
122
|
+
private handleDragOnNode;
|
|
123
|
+
private childrenOfContainer;
|
|
124
|
+
/**
|
|
125
|
+
* 绘制线条
|
|
126
|
+
* @param opts
|
|
127
|
+
* @param event
|
|
128
|
+
*/
|
|
129
|
+
startDrawingLine(fromPort: WorkflowPortEntity, event: {
|
|
130
|
+
clientX: number;
|
|
131
|
+
clientY: number;
|
|
132
|
+
}, originLine?: WorkflowLineEntity): Promise<{
|
|
133
|
+
dragSuccess?: boolean;
|
|
134
|
+
newLine?: WorkflowLineEntity;
|
|
135
|
+
}>;
|
|
136
|
+
/**
|
|
137
|
+
* 重新连接线条
|
|
138
|
+
* @param line
|
|
139
|
+
* @param e
|
|
140
|
+
*/
|
|
141
|
+
resetLine(line: WorkflowLineEntity, e: MouseEvent): Promise<void>;
|
|
142
|
+
/** 线条拖拽结束 */
|
|
143
|
+
onDragLineEnd(callback: OnDragNodeEnd): Disposable;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
type PositionMap = Record<string, IPoint>;
|
|
147
|
+
/**
|
|
148
|
+
* 重置布局服务
|
|
149
|
+
*/
|
|
150
|
+
declare class WorkflowResetLayoutService {
|
|
151
|
+
private _config;
|
|
152
|
+
private _document;
|
|
153
|
+
private _entityManager;
|
|
154
|
+
private _resetLayoutEmitter;
|
|
155
|
+
/**
|
|
156
|
+
* reset layout事件
|
|
157
|
+
*/
|
|
158
|
+
readonly onResetLayout: _flowgram_ai_utils.Event<{
|
|
159
|
+
nodeIds: string[];
|
|
160
|
+
positionMap: PositionMap;
|
|
161
|
+
oldPositionMap: PositionMap;
|
|
162
|
+
}>;
|
|
163
|
+
private _toDispose;
|
|
164
|
+
/**
|
|
165
|
+
* 初始化
|
|
166
|
+
*/
|
|
167
|
+
init(): void;
|
|
168
|
+
/**
|
|
169
|
+
* 触发重置布局
|
|
170
|
+
* @param nodeIds 节点id
|
|
171
|
+
* @param positionMap 新布局数据
|
|
172
|
+
* @param oldPositionMap 老布局数据
|
|
173
|
+
*/
|
|
174
|
+
fireResetLayout(nodeIds: string[], positionMap: PositionMap, oldPositionMap: PositionMap): void;
|
|
175
|
+
/**
|
|
176
|
+
* 根据数据重新布局
|
|
177
|
+
* @param positionMap
|
|
178
|
+
* @returns
|
|
179
|
+
*/
|
|
180
|
+
layoutToPositions(nodeIds: string[], positionMap: PositionMap): Promise<Record<string, IPoint>>;
|
|
181
|
+
/**
|
|
182
|
+
* 销毁
|
|
183
|
+
*/
|
|
184
|
+
dispose(): void;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
interface NodeRenderReturnType {
|
|
188
|
+
/**
|
|
189
|
+
* 当前节点
|
|
190
|
+
*/
|
|
191
|
+
node: FlowNodeEntity;
|
|
192
|
+
/**
|
|
193
|
+
* 节点选中
|
|
194
|
+
*/
|
|
195
|
+
selected: boolean;
|
|
196
|
+
/**
|
|
197
|
+
* 节点激活
|
|
198
|
+
*/
|
|
199
|
+
activated: boolean;
|
|
200
|
+
/**
|
|
201
|
+
* 节点展开
|
|
202
|
+
*/
|
|
203
|
+
expanded: boolean;
|
|
204
|
+
/**
|
|
205
|
+
* 触发拖拽
|
|
206
|
+
* @param e
|
|
207
|
+
*/
|
|
208
|
+
startDrag: (e: React.MouseEvent) => void;
|
|
209
|
+
/**
|
|
210
|
+
* 当前节点的点位信息
|
|
211
|
+
*/
|
|
212
|
+
ports: WorkflowPortEntity[];
|
|
213
|
+
/**
|
|
214
|
+
* 删除节点
|
|
215
|
+
*/
|
|
216
|
+
deleteNode: () => void;
|
|
217
|
+
/**
|
|
218
|
+
* 选中节点
|
|
219
|
+
* @param e
|
|
220
|
+
*/
|
|
221
|
+
selectNode: (e: React.MouseEvent) => void;
|
|
222
|
+
/**
|
|
223
|
+
* 全局 readonly 状态
|
|
224
|
+
*/
|
|
225
|
+
readonly: boolean;
|
|
226
|
+
/**
|
|
227
|
+
* 拖拽线条的目标 node id
|
|
228
|
+
*/
|
|
229
|
+
linkingNodeId: string;
|
|
230
|
+
/**
|
|
231
|
+
* 节点 ref
|
|
232
|
+
*/
|
|
233
|
+
nodeRef: React.MutableRefObject<HTMLDivElement | null>;
|
|
234
|
+
/**
|
|
235
|
+
* 节点 focus 事件
|
|
236
|
+
*/
|
|
237
|
+
onFocus: () => void;
|
|
238
|
+
/**
|
|
239
|
+
* 节点 blur 事件
|
|
240
|
+
*/
|
|
241
|
+
onBlur: () => void;
|
|
242
|
+
/**
|
|
243
|
+
* 渲染表单,只有节点引擎开启才能使用
|
|
244
|
+
*/
|
|
245
|
+
form: NodeFormProps<any> | undefined;
|
|
246
|
+
/**
|
|
247
|
+
* 获取节点的扩展数据
|
|
248
|
+
*/
|
|
249
|
+
getExtInfo<T = any>(): T;
|
|
250
|
+
/**
|
|
251
|
+
* 更新节点的扩展数据
|
|
252
|
+
* @param extInfo
|
|
253
|
+
*/
|
|
254
|
+
updateExtInfo<T = any>(extInfo: T): void;
|
|
255
|
+
/**
|
|
256
|
+
* 展开/收起节点
|
|
257
|
+
* @param expanded
|
|
258
|
+
*/
|
|
259
|
+
toggleExpand(): void;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
declare function useNodeRender(nodeFromProps?: WorkflowNodeEntity): NodeRenderReturnType;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* 获取当前渲染的 dom 节点
|
|
266
|
+
*/
|
|
267
|
+
declare function useCurrentDomNode(): HTMLDivElement;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* 获取当前节点
|
|
271
|
+
*/
|
|
272
|
+
declare function useCurrentEntity(): WorkflowNodeEntity;
|
|
273
|
+
|
|
274
|
+
declare function useWorkflowDocument(): WorkflowDocument;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* 获取 readonly 状态
|
|
278
|
+
*/
|
|
279
|
+
declare function usePlaygroundReadonlyState(listenChange?: boolean): boolean;
|
|
280
|
+
|
|
281
|
+
declare namespace FoldLine {
|
|
282
|
+
function getPoints({ source, target }: {
|
|
283
|
+
source: IPoint;
|
|
284
|
+
target: IPoint;
|
|
285
|
+
}): IPoint[];
|
|
286
|
+
/**
|
|
287
|
+
* 实现 reactFlow 原本的折叠线交互
|
|
288
|
+
*/
|
|
289
|
+
function getSmoothStepPath(points: IPoint[]): string;
|
|
290
|
+
function getBounds(points: IPoint[]): Rectangle;
|
|
291
|
+
/**
|
|
292
|
+
* 折叠线和点的距离
|
|
293
|
+
* @param linePosition
|
|
294
|
+
* @param pos
|
|
295
|
+
*/
|
|
296
|
+
function getFoldLineToPointDistance(points: IPoint[], pos: IPoint): number;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
declare enum BezierControlType {
|
|
300
|
+
RIGHT_TOP = 0,
|
|
301
|
+
RIGHT_BOTTOM = 1,
|
|
302
|
+
LEFT_TOP = 2,
|
|
303
|
+
LEFT_BOTTOM = 3
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* 获取贝塞尔曲线横向的控制节点
|
|
307
|
+
* @param fromPos
|
|
308
|
+
* @param toPos
|
|
309
|
+
*/
|
|
310
|
+
declare function getBezierHorizontalControlPoints(fromPos: IPoint, toPos: IPoint): IPoint[];
|
|
311
|
+
/**
|
|
312
|
+
* 获取贝塞尔曲线垂直方向的控制节点
|
|
313
|
+
* @param fromPos 起始点
|
|
314
|
+
* @param toPos 终点
|
|
315
|
+
*/
|
|
316
|
+
declare function getBezierVerticalControlPoints(fromPos: IPoint, toPos: IPoint): IPoint[];
|
|
317
|
+
|
|
318
|
+
declare function nanoid(n?: number): string;
|
|
319
|
+
|
|
320
|
+
declare const fitView: (doc: WorkflowDocument, playgroundConfig: PlaygroundConfigEntity, easing?: boolean) => Promise<void>;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* 获取没有碰撞的位置
|
|
324
|
+
* 距离很小时,xy 各偏移 30
|
|
325
|
+
* @param position
|
|
326
|
+
*/
|
|
327
|
+
declare function getAntiOverlapPosition(doc: WorkflowDocument, position: IPoint, containerNode?: WorkflowNodeEntity): IPoint;
|
|
328
|
+
|
|
329
|
+
declare enum EditorCursorState {
|
|
330
|
+
GRAB = "GRAB",
|
|
331
|
+
SELECT = "SELECT"
|
|
332
|
+
}
|
|
333
|
+
declare enum InteractiveType {
|
|
334
|
+
/** 鼠标优先交互模式 */
|
|
335
|
+
MOUSE = "MOUSE",
|
|
336
|
+
/** 触控板优先交互模式 */
|
|
337
|
+
PAD = "PAD"
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* 节点的点位信息
|
|
342
|
+
* portsData 只监听点位的数目和类型,不监听点位的 position 变化
|
|
343
|
+
*/
|
|
344
|
+
declare class WorkflowNodePortsData extends EntityData {
|
|
345
|
+
static readonly type = "WorkflowNodePortsData";
|
|
346
|
+
readonly entity: WorkflowNodeEntity;
|
|
347
|
+
/** 静态的 ports 数据 */
|
|
348
|
+
protected _staticPorts: WorkflowPorts;
|
|
349
|
+
/** 存储 port 实体的 id,用于判断 port 是否存在 */
|
|
350
|
+
protected _portIDSet: Set<string>;
|
|
351
|
+
/** 上一次的 ports 数据,用于判断 ports 是否发生变化 */
|
|
352
|
+
protected _prePorts: WorkflowPorts;
|
|
353
|
+
constructor(entity: WorkflowNodeEntity);
|
|
354
|
+
getDefaultData(): any;
|
|
355
|
+
/**
|
|
356
|
+
* 更新静态的 ports 数据
|
|
357
|
+
*/
|
|
358
|
+
updateStaticPorts(ports: WorkflowPorts): void;
|
|
359
|
+
/**
|
|
360
|
+
* 动态计算点位,通过 dom 的 data-port-key
|
|
361
|
+
*/
|
|
362
|
+
updateDynamicPorts(): void;
|
|
363
|
+
/**
|
|
364
|
+
* 根据 key 获取 port 实体
|
|
365
|
+
*/
|
|
366
|
+
getPortEntityByKey(portType: WorkflowPortType, portKey?: string | number): WorkflowPortEntity;
|
|
367
|
+
/**
|
|
368
|
+
* 更新 ports 数据
|
|
369
|
+
*/
|
|
370
|
+
updatePorts(ports: WorkflowPorts): void;
|
|
371
|
+
/**
|
|
372
|
+
* 获取所有 port entities
|
|
373
|
+
*/
|
|
374
|
+
get allPorts(): WorkflowPortEntity[];
|
|
375
|
+
/**
|
|
376
|
+
* 获取输入点位
|
|
377
|
+
*/
|
|
378
|
+
get inputPorts(): WorkflowPortEntity[];
|
|
379
|
+
/**
|
|
380
|
+
* 获取输出点位
|
|
381
|
+
*/
|
|
382
|
+
get outputPorts(): WorkflowPortEntity[];
|
|
383
|
+
/**
|
|
384
|
+
* 获取输入点位置
|
|
385
|
+
*/
|
|
386
|
+
get inputPoints(): IPoint[];
|
|
387
|
+
/**
|
|
388
|
+
* 获取输出点位置
|
|
389
|
+
*/
|
|
390
|
+
get outputPoints(): IPoint[];
|
|
391
|
+
/**
|
|
392
|
+
* 根据 key 获取 输入点位置
|
|
393
|
+
*/
|
|
394
|
+
getInputPoint(key?: string | number): IPoint;
|
|
395
|
+
/**
|
|
396
|
+
* 根据 key 获取输出点位置
|
|
397
|
+
*/
|
|
398
|
+
getOutputPoint(key?: string | number): IPoint;
|
|
399
|
+
/**
|
|
400
|
+
* 获取 port 实体
|
|
401
|
+
*/
|
|
402
|
+
protected getPortEntity(portId: string): WorkflowPortEntity | undefined;
|
|
403
|
+
/**
|
|
404
|
+
* 拼接 port 实体的 id
|
|
405
|
+
*/
|
|
406
|
+
protected getPortId(portType: WorkflowPortType, portKey?: string | number): string;
|
|
407
|
+
/**
|
|
408
|
+
* 创建 port 实体
|
|
409
|
+
*/
|
|
410
|
+
protected createPortEntity(portInfo: WorkflowPort): WorkflowPortEntity;
|
|
411
|
+
/**
|
|
412
|
+
* 获取或创建 port 实体
|
|
413
|
+
*/
|
|
414
|
+
protected getOrCreatePortEntity(portInfo: WorkflowPort): WorkflowPortEntity;
|
|
415
|
+
/**
|
|
416
|
+
* 更新 port 实体
|
|
417
|
+
*/
|
|
418
|
+
protected updatePortEntity(portInfo: WorkflowPort): WorkflowPortEntity;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
interface WorkflowNodeLines {
|
|
422
|
+
inputLines: WorkflowLineEntity[];
|
|
423
|
+
outputLines: WorkflowLineEntity[];
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* 节点的关联的线条
|
|
427
|
+
*/
|
|
428
|
+
declare class WorkflowNodeLinesData extends EntityData<WorkflowNodeLines> {
|
|
429
|
+
static type: string;
|
|
430
|
+
entity: WorkflowNodeEntity;
|
|
431
|
+
getDefaultData(): WorkflowNodeLines;
|
|
432
|
+
constructor(entity: WorkflowNodeEntity);
|
|
433
|
+
/**
|
|
434
|
+
* 输入线条
|
|
435
|
+
*/
|
|
436
|
+
get inputLines(): WorkflowLineEntity[];
|
|
437
|
+
/**
|
|
438
|
+
* 输出线条
|
|
439
|
+
*/
|
|
440
|
+
get outputLines(): WorkflowLineEntity[];
|
|
441
|
+
/**
|
|
442
|
+
* 输入节点
|
|
443
|
+
*/
|
|
444
|
+
get inputNodes(): WorkflowNodeEntity[];
|
|
445
|
+
/**
|
|
446
|
+
* 所有输入节点
|
|
447
|
+
*/
|
|
448
|
+
get allInputNodes(): WorkflowNodeEntity[];
|
|
449
|
+
/**
|
|
450
|
+
* 输出节点
|
|
451
|
+
*/
|
|
452
|
+
get outputNodes(): WorkflowNodeEntity[];
|
|
453
|
+
/**
|
|
454
|
+
* 输入输出节点
|
|
455
|
+
*/
|
|
456
|
+
get allOutputNodes(): WorkflowNodeEntity[];
|
|
457
|
+
addLine(line: WorkflowLineEntity): void;
|
|
458
|
+
removeLine(line: WorkflowLineEntity): void;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
declare const WorkflowDocumentContainerModule: ContainerModule;
|
|
462
|
+
|
|
463
|
+
export { BezierControlType, EditorCursorState, FoldLine, InteractiveType, type NodeRenderReturnType, type NodesDragEndEvent, type NodesDragEvent, type PositionMap, WorkflowCommands, WorkflowDocument, WorkflowDocumentContainerModule, WorkflowDragService, WorkflowHoverService, WorkflowLineEntity, WorkflowLinesManager, WorkflowNodeEntity, WorkflowNodeJSON, type WorkflowNodeLines, WorkflowNodeLinesData, WorkflowNodePortsData, WorkflowPort, WorkflowPortEntity, WorkflowPortType, WorkflowPorts, WorkflowResetLayoutService, WorkflowSelectService, fitView, getAntiOverlapPosition, getBezierHorizontalControlPoints, getBezierVerticalControlPoints, nanoid, useCurrentDomNode, useCurrentEntity, useNodeRender, usePlaygroundReadonlyState, useWorkflowDocument };
|