@flowgram.ai/document 0.1.0-alpha.7 → 0.1.0-alpha.9
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/index.js +493 -434
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +70 -32
- package/dist/index.d.ts +70 -32
- package/dist/index.js +492 -433
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -9,6 +9,7 @@ import { ContainerModule } from 'inversify';
|
|
|
9
9
|
*/
|
|
10
10
|
declare class FlowVirtualTree<T extends {
|
|
11
11
|
id: string;
|
|
12
|
+
flowNodeType?: FlowNodeType;
|
|
12
13
|
}> implements Disposable {
|
|
13
14
|
readonly root: T;
|
|
14
15
|
protected onTreeChangeEmitter: Emitter<void>;
|
|
@@ -45,7 +46,7 @@ declare class FlowVirtualTree<T extends {
|
|
|
45
46
|
*/
|
|
46
47
|
fireTreeChange(): void;
|
|
47
48
|
get size(): number;
|
|
48
|
-
toString(): string;
|
|
49
|
+
toString(showType?: boolean): string;
|
|
49
50
|
}
|
|
50
51
|
declare namespace FlowVirtualTree {
|
|
51
52
|
interface NodeInfo<T> {
|
|
@@ -119,7 +120,7 @@ interface FlowDocumentOptions {
|
|
|
119
120
|
*/
|
|
120
121
|
allNodesDefaultExpanded?: boolean;
|
|
121
122
|
toNodeJSON?(node: FlowNodeEntity): FlowNodeJSON;
|
|
122
|
-
fromNodeJSON?(node: FlowNodeEntity, json: FlowNodeJSON): void;
|
|
123
|
+
fromNodeJSON?(node: FlowNodeEntity, json: FlowNodeJSON, isFirstCreate: boolean): void;
|
|
123
124
|
constants?: Record<string, any>;
|
|
124
125
|
formatNodeLines?: (node: FlowNodeEntity, lines: FlowTransitionLine[]) => FlowTransitionLine[];
|
|
125
126
|
formatNodeLabels?: (node: FlowNodeEntity, lines: FlowTransitionLabel[]) => FlowTransitionLabel[];
|
|
@@ -217,11 +218,21 @@ declare class FlowDocument<T = FlowDocumentJSON> implements Disposable {
|
|
|
217
218
|
protected currentLayoutKey: string;
|
|
218
219
|
protected onNodeUpdateEmitter: Emitter<{
|
|
219
220
|
node: FlowNodeEntity;
|
|
221
|
+
/**
|
|
222
|
+
* use 'json' instead
|
|
223
|
+
* @deprecated
|
|
224
|
+
*/
|
|
220
225
|
data: FlowNodeJSON;
|
|
226
|
+
json: FlowNodeJSON;
|
|
221
227
|
}>;
|
|
222
228
|
protected onNodeCreateEmitter: Emitter<{
|
|
223
229
|
node: FlowNodeEntity;
|
|
230
|
+
/**
|
|
231
|
+
* use 'json' instead
|
|
232
|
+
* @deprecated
|
|
233
|
+
*/
|
|
224
234
|
data: FlowNodeJSON;
|
|
235
|
+
json: FlowNodeJSON;
|
|
225
236
|
}>;
|
|
226
237
|
protected onNodeDisposeEmitter: Emitter<{
|
|
227
238
|
node: FlowNodeEntity;
|
|
@@ -229,16 +240,27 @@ declare class FlowDocument<T = FlowDocumentJSON> implements Disposable {
|
|
|
229
240
|
protected onLayoutChangeEmitter: Emitter<FlowLayout>;
|
|
230
241
|
readonly onNodeUpdate: _flowgram_ai_utils.Event<{
|
|
231
242
|
node: FlowNodeEntity;
|
|
243
|
+
/**
|
|
244
|
+
* use 'json' instead
|
|
245
|
+
* @deprecated
|
|
246
|
+
*/
|
|
232
247
|
data: FlowNodeJSON;
|
|
248
|
+
json: FlowNodeJSON;
|
|
233
249
|
}>;
|
|
234
250
|
readonly onNodeCreate: _flowgram_ai_utils.Event<{
|
|
235
251
|
node: FlowNodeEntity;
|
|
252
|
+
/**
|
|
253
|
+
* use 'json' instead
|
|
254
|
+
* @deprecated
|
|
255
|
+
*/
|
|
236
256
|
data: FlowNodeJSON;
|
|
257
|
+
json: FlowNodeJSON;
|
|
237
258
|
}>;
|
|
238
259
|
readonly onNodeDispose: _flowgram_ai_utils.Event<{
|
|
239
260
|
node: FlowNodeEntity;
|
|
240
261
|
}>;
|
|
241
262
|
readonly onLayoutChange: _flowgram_ai_utils.Event<FlowLayout>;
|
|
263
|
+
private _disposed;
|
|
242
264
|
root: FlowNodeEntity;
|
|
243
265
|
/**
|
|
244
266
|
* 原始的 tree 结构
|
|
@@ -253,6 +275,10 @@ declare class FlowDocument<T = FlowDocumentJSON> implements Disposable {
|
|
|
253
275
|
* 渲染后的 tree 结构
|
|
254
276
|
*/
|
|
255
277
|
renderTree: FlowRenderTree<FlowNodeEntity>;
|
|
278
|
+
/**
|
|
279
|
+
*
|
|
280
|
+
*/
|
|
281
|
+
get disposed(): boolean;
|
|
256
282
|
init(): void;
|
|
257
283
|
/**
|
|
258
284
|
* 从数据初始化 O(n)
|
|
@@ -283,7 +309,7 @@ declare class FlowDocument<T = FlowDocumentJSON> implements Disposable {
|
|
|
283
309
|
* @param data
|
|
284
310
|
* @param addedNodes
|
|
285
311
|
*/
|
|
286
|
-
addNode(data: AddNodeData, addedNodes?: FlowNodeEntity[]
|
|
312
|
+
addNode(data: AddNodeData, addedNodes?: FlowNodeEntity[]): FlowNodeEntity;
|
|
287
313
|
addBlocksAsChildren(parent: FlowNodeEntity, blocks: FlowNodeJSON[], addedNodes?: FlowNodeEntity[]): void;
|
|
288
314
|
/**
|
|
289
315
|
* block 格式:
|
|
@@ -317,6 +343,12 @@ declare class FlowDocument<T = FlowDocumentJSON> implements Disposable {
|
|
|
317
343
|
* @param registries
|
|
318
344
|
*/
|
|
319
345
|
registerFlowNodes<T extends FlowNodeRegistry<any>>(...registries: T[]): void;
|
|
346
|
+
/**
|
|
347
|
+
* Check node extend
|
|
348
|
+
* @param currentType
|
|
349
|
+
* @param parentType
|
|
350
|
+
*/
|
|
351
|
+
isExtend(currentType: FlowNodeType, parentType: FlowNodeType): boolean;
|
|
320
352
|
/**
|
|
321
353
|
* 导出数据,可以重载
|
|
322
354
|
*/
|
|
@@ -364,7 +396,7 @@ declare class FlowDocument<T = FlowDocumentJSON> implements Disposable {
|
|
|
364
396
|
get size(): number;
|
|
365
397
|
hasNode(nodeId: string): boolean;
|
|
366
398
|
getAllNodes(): FlowNodeEntity[];
|
|
367
|
-
toString(): string;
|
|
399
|
+
toString(showType?: boolean): string;
|
|
368
400
|
/**
|
|
369
401
|
* 返回需要渲染的数据
|
|
370
402
|
*/
|
|
@@ -625,7 +657,9 @@ declare class FlowNodeEntity extends Entity<FlowNodeEntityConfig> {
|
|
|
625
657
|
get pre(): FlowNodeEntity | undefined;
|
|
626
658
|
get next(): FlowNodeEntity | undefined;
|
|
627
659
|
get parent(): FlowNodeEntity | undefined;
|
|
628
|
-
getNodeRegistry<M extends FlowNodeRegistry = FlowNodeRegistry
|
|
660
|
+
getNodeRegistry<M extends FlowNodeRegistry = FlowNodeRegistry & {
|
|
661
|
+
meta: FlowNodeMeta;
|
|
662
|
+
}>(): M;
|
|
629
663
|
/**
|
|
630
664
|
* @deprecated
|
|
631
665
|
* use getNodeRegistry instead
|
|
@@ -802,9 +836,11 @@ interface FlowTransitionLine {
|
|
|
802
836
|
arrow?: boolean;
|
|
803
837
|
renderKey?: string;
|
|
804
838
|
isHorizontal?: boolean;
|
|
839
|
+
isDraggingLine?: boolean;
|
|
805
840
|
activated?: boolean;
|
|
806
841
|
side?: LABEL_SIDE_TYPE;
|
|
807
842
|
style?: React.CSSProperties;
|
|
843
|
+
lineId?: string;
|
|
808
844
|
}
|
|
809
845
|
declare enum FlowTransitionLabelEnum {
|
|
810
846
|
ADDER_LABEL = 0,
|
|
@@ -821,6 +857,7 @@ interface FlowTransitionLabel {
|
|
|
821
857
|
width?: number;
|
|
822
858
|
rotate?: string;
|
|
823
859
|
props?: Record<string, any>;
|
|
860
|
+
labelId?: string;
|
|
824
861
|
}
|
|
825
862
|
interface AdderProps {
|
|
826
863
|
node: FlowNodeEntity;
|
|
@@ -1090,6 +1127,7 @@ interface FlowNodeRegistry<M extends FlowNodeMeta = FlowNodeMeta> {
|
|
|
1090
1127
|
*/
|
|
1091
1128
|
extendChildRegistries?: FlowNodeRegistry[];
|
|
1092
1129
|
/**
|
|
1130
|
+
* @deprecated
|
|
1093
1131
|
* 自定义子节点添加逻辑
|
|
1094
1132
|
* @param node 节点
|
|
1095
1133
|
* @param json 添加的节点 JSON
|
|
@@ -1100,12 +1138,17 @@ interface FlowNodeRegistry<M extends FlowNodeMeta = FlowNodeMeta> {
|
|
|
1100
1138
|
hidden?: boolean;
|
|
1101
1139
|
index?: number;
|
|
1102
1140
|
}) => FlowNodeEntity;
|
|
1141
|
+
/**
|
|
1142
|
+
* 内部用于继承逻辑判断,不要使用
|
|
1143
|
+
*/
|
|
1144
|
+
__extends__?: FlowNodeType[];
|
|
1103
1145
|
/**
|
|
1104
1146
|
* 扩展注册器
|
|
1105
1147
|
*/
|
|
1106
1148
|
[key: string]: any;
|
|
1107
1149
|
}
|
|
1108
1150
|
declare namespace FlowNodeRegistry {
|
|
1151
|
+
function mergeChildRegistries(r1?: FlowNodeRegistry[], r2?: FlowNodeRegistry[]): FlowNodeRegistry[];
|
|
1109
1152
|
function merge(registry1: FlowNodeRegistry, registry2: FlowNodeRegistry, finalType: FlowNodeType): FlowNodeRegistry;
|
|
1110
1153
|
function extend(registry: FlowNodeRegistry, extendRegistries: FlowNodeRegistry[]): FlowNodeRegistry;
|
|
1111
1154
|
}
|
|
@@ -1135,10 +1178,16 @@ declare enum FlowNodeBaseType {
|
|
|
1135
1178
|
BLOCK_ORDER_ICON = "blockOrderIcon",
|
|
1136
1179
|
GROUP = "group",
|
|
1137
1180
|
END = "end",
|
|
1181
|
+
BREAK = "break",
|
|
1138
1182
|
CONDITION = "condition",
|
|
1139
|
-
SUB_CANVAS = "subCanvas"
|
|
1183
|
+
SUB_CANVAS = "subCanvas",
|
|
1184
|
+
MULTI_INPUTS = "multiInputs",
|
|
1185
|
+
MULTI_OUTPUTS = "multiOutputs",
|
|
1186
|
+
INPUT = "input",
|
|
1187
|
+
OUTPUT = "output"
|
|
1140
1188
|
}
|
|
1141
1189
|
declare enum FlowNodeSplitType {
|
|
1190
|
+
SIMPLE_SPLIT = "simpleSplit",
|
|
1142
1191
|
DYNAMIC_SPLIT = "dynamicSplit",
|
|
1143
1192
|
STATIC_SPLIT = "staticSplit"
|
|
1144
1193
|
}
|
|
@@ -1494,21 +1543,6 @@ declare class FlowOperationBaseServiceImpl implements FlowOperationBaseService {
|
|
|
1494
1543
|
protected doMoveNode(node: FlowNodeEntity, newParent: FlowNodeEntity, index: number): void;
|
|
1495
1544
|
}
|
|
1496
1545
|
|
|
1497
|
-
declare class FlowGroupService {
|
|
1498
|
-
readonly entityManager: EntityManager;
|
|
1499
|
-
readonly operationService: FlowOperationBaseService;
|
|
1500
|
-
/** 创建分组节点 */
|
|
1501
|
-
createGroup(nodes: FlowNodeEntity[]): FlowNodeEntity | undefined;
|
|
1502
|
-
/** 删除分组 */
|
|
1503
|
-
deleteGroup(groupNode: FlowNodeEntity): void;
|
|
1504
|
-
/** 取消分组 */
|
|
1505
|
-
ungroup(groupNode: FlowNodeEntity): void;
|
|
1506
|
-
/** 返回所有分组节点 */
|
|
1507
|
-
getAllGroups(): FlowGroupController[];
|
|
1508
|
-
/** 获取分组控制器*/
|
|
1509
|
-
groupController(group: FlowNodeEntity): FlowGroupController | undefined;
|
|
1510
|
-
static validate(nodes: FlowNodeEntity[]): boolean;
|
|
1511
|
-
}
|
|
1512
1546
|
/** 分组控制器 */
|
|
1513
1547
|
declare class FlowGroupController {
|
|
1514
1548
|
readonly groupNode: FlowNodeEntity;
|
|
@@ -1532,18 +1566,22 @@ declare class FlowGroupController {
|
|
|
1532
1566
|
set hovered(hovered: boolean);
|
|
1533
1567
|
get hovered(): boolean;
|
|
1534
1568
|
static create(groupNode?: FlowNodeEntity): FlowGroupController | undefined;
|
|
1535
|
-
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
declare class FlowGroupService {
|
|
1572
|
+
readonly entityManager: EntityManager;
|
|
1573
|
+
readonly operationService: FlowOperationBaseService;
|
|
1574
|
+
/** 创建分组节点 */
|
|
1575
|
+
createGroup(nodes: FlowNodeEntity[]): FlowNodeEntity | undefined;
|
|
1576
|
+
/** 删除分组 */
|
|
1577
|
+
deleteGroup(groupNode: FlowNodeEntity): void;
|
|
1578
|
+
/** 取消分组 */
|
|
1579
|
+
ungroup(groupNode: FlowNodeEntity): void;
|
|
1580
|
+
/** 返回所有分组节点 */
|
|
1581
|
+
getAllGroups(): FlowGroupController[];
|
|
1582
|
+
/** 获取分组控制器*/
|
|
1583
|
+
groupController(group: FlowNodeEntity): FlowGroupController | undefined;
|
|
1536
1584
|
static validate(nodes: FlowNodeEntity[]): boolean;
|
|
1537
|
-
/** 获取节点分组控制 */
|
|
1538
|
-
static getNodeGroupController(node?: FlowNodeEntity): FlowGroupController | undefined;
|
|
1539
|
-
/** 向上递归查找分组递归控制 */
|
|
1540
|
-
static getNodeRecursionGroupController(node?: FlowNodeEntity): FlowGroupController | undefined;
|
|
1541
|
-
/** 是否分组节点 */
|
|
1542
|
-
static isGroupNode(group: FlowNodeEntity): boolean;
|
|
1543
|
-
/** 找到节点所有上级 */
|
|
1544
|
-
private static findNodeParents;
|
|
1545
|
-
/** 节点是否处于分组中 */
|
|
1546
|
-
private static isNodeInGroup;
|
|
1547
1585
|
}
|
|
1548
1586
|
|
|
1549
1587
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { ContainerModule } from 'inversify';
|
|
|
9
9
|
*/
|
|
10
10
|
declare class FlowVirtualTree<T extends {
|
|
11
11
|
id: string;
|
|
12
|
+
flowNodeType?: FlowNodeType;
|
|
12
13
|
}> implements Disposable {
|
|
13
14
|
readonly root: T;
|
|
14
15
|
protected onTreeChangeEmitter: Emitter<void>;
|
|
@@ -45,7 +46,7 @@ declare class FlowVirtualTree<T extends {
|
|
|
45
46
|
*/
|
|
46
47
|
fireTreeChange(): void;
|
|
47
48
|
get size(): number;
|
|
48
|
-
toString(): string;
|
|
49
|
+
toString(showType?: boolean): string;
|
|
49
50
|
}
|
|
50
51
|
declare namespace FlowVirtualTree {
|
|
51
52
|
interface NodeInfo<T> {
|
|
@@ -119,7 +120,7 @@ interface FlowDocumentOptions {
|
|
|
119
120
|
*/
|
|
120
121
|
allNodesDefaultExpanded?: boolean;
|
|
121
122
|
toNodeJSON?(node: FlowNodeEntity): FlowNodeJSON;
|
|
122
|
-
fromNodeJSON?(node: FlowNodeEntity, json: FlowNodeJSON): void;
|
|
123
|
+
fromNodeJSON?(node: FlowNodeEntity, json: FlowNodeJSON, isFirstCreate: boolean): void;
|
|
123
124
|
constants?: Record<string, any>;
|
|
124
125
|
formatNodeLines?: (node: FlowNodeEntity, lines: FlowTransitionLine[]) => FlowTransitionLine[];
|
|
125
126
|
formatNodeLabels?: (node: FlowNodeEntity, lines: FlowTransitionLabel[]) => FlowTransitionLabel[];
|
|
@@ -217,11 +218,21 @@ declare class FlowDocument<T = FlowDocumentJSON> implements Disposable {
|
|
|
217
218
|
protected currentLayoutKey: string;
|
|
218
219
|
protected onNodeUpdateEmitter: Emitter<{
|
|
219
220
|
node: FlowNodeEntity;
|
|
221
|
+
/**
|
|
222
|
+
* use 'json' instead
|
|
223
|
+
* @deprecated
|
|
224
|
+
*/
|
|
220
225
|
data: FlowNodeJSON;
|
|
226
|
+
json: FlowNodeJSON;
|
|
221
227
|
}>;
|
|
222
228
|
protected onNodeCreateEmitter: Emitter<{
|
|
223
229
|
node: FlowNodeEntity;
|
|
230
|
+
/**
|
|
231
|
+
* use 'json' instead
|
|
232
|
+
* @deprecated
|
|
233
|
+
*/
|
|
224
234
|
data: FlowNodeJSON;
|
|
235
|
+
json: FlowNodeJSON;
|
|
225
236
|
}>;
|
|
226
237
|
protected onNodeDisposeEmitter: Emitter<{
|
|
227
238
|
node: FlowNodeEntity;
|
|
@@ -229,16 +240,27 @@ declare class FlowDocument<T = FlowDocumentJSON> implements Disposable {
|
|
|
229
240
|
protected onLayoutChangeEmitter: Emitter<FlowLayout>;
|
|
230
241
|
readonly onNodeUpdate: _flowgram_ai_utils.Event<{
|
|
231
242
|
node: FlowNodeEntity;
|
|
243
|
+
/**
|
|
244
|
+
* use 'json' instead
|
|
245
|
+
* @deprecated
|
|
246
|
+
*/
|
|
232
247
|
data: FlowNodeJSON;
|
|
248
|
+
json: FlowNodeJSON;
|
|
233
249
|
}>;
|
|
234
250
|
readonly onNodeCreate: _flowgram_ai_utils.Event<{
|
|
235
251
|
node: FlowNodeEntity;
|
|
252
|
+
/**
|
|
253
|
+
* use 'json' instead
|
|
254
|
+
* @deprecated
|
|
255
|
+
*/
|
|
236
256
|
data: FlowNodeJSON;
|
|
257
|
+
json: FlowNodeJSON;
|
|
237
258
|
}>;
|
|
238
259
|
readonly onNodeDispose: _flowgram_ai_utils.Event<{
|
|
239
260
|
node: FlowNodeEntity;
|
|
240
261
|
}>;
|
|
241
262
|
readonly onLayoutChange: _flowgram_ai_utils.Event<FlowLayout>;
|
|
263
|
+
private _disposed;
|
|
242
264
|
root: FlowNodeEntity;
|
|
243
265
|
/**
|
|
244
266
|
* 原始的 tree 结构
|
|
@@ -253,6 +275,10 @@ declare class FlowDocument<T = FlowDocumentJSON> implements Disposable {
|
|
|
253
275
|
* 渲染后的 tree 结构
|
|
254
276
|
*/
|
|
255
277
|
renderTree: FlowRenderTree<FlowNodeEntity>;
|
|
278
|
+
/**
|
|
279
|
+
*
|
|
280
|
+
*/
|
|
281
|
+
get disposed(): boolean;
|
|
256
282
|
init(): void;
|
|
257
283
|
/**
|
|
258
284
|
* 从数据初始化 O(n)
|
|
@@ -283,7 +309,7 @@ declare class FlowDocument<T = FlowDocumentJSON> implements Disposable {
|
|
|
283
309
|
* @param data
|
|
284
310
|
* @param addedNodes
|
|
285
311
|
*/
|
|
286
|
-
addNode(data: AddNodeData, addedNodes?: FlowNodeEntity[]
|
|
312
|
+
addNode(data: AddNodeData, addedNodes?: FlowNodeEntity[]): FlowNodeEntity;
|
|
287
313
|
addBlocksAsChildren(parent: FlowNodeEntity, blocks: FlowNodeJSON[], addedNodes?: FlowNodeEntity[]): void;
|
|
288
314
|
/**
|
|
289
315
|
* block 格式:
|
|
@@ -317,6 +343,12 @@ declare class FlowDocument<T = FlowDocumentJSON> implements Disposable {
|
|
|
317
343
|
* @param registries
|
|
318
344
|
*/
|
|
319
345
|
registerFlowNodes<T extends FlowNodeRegistry<any>>(...registries: T[]): void;
|
|
346
|
+
/**
|
|
347
|
+
* Check node extend
|
|
348
|
+
* @param currentType
|
|
349
|
+
* @param parentType
|
|
350
|
+
*/
|
|
351
|
+
isExtend(currentType: FlowNodeType, parentType: FlowNodeType): boolean;
|
|
320
352
|
/**
|
|
321
353
|
* 导出数据,可以重载
|
|
322
354
|
*/
|
|
@@ -364,7 +396,7 @@ declare class FlowDocument<T = FlowDocumentJSON> implements Disposable {
|
|
|
364
396
|
get size(): number;
|
|
365
397
|
hasNode(nodeId: string): boolean;
|
|
366
398
|
getAllNodes(): FlowNodeEntity[];
|
|
367
|
-
toString(): string;
|
|
399
|
+
toString(showType?: boolean): string;
|
|
368
400
|
/**
|
|
369
401
|
* 返回需要渲染的数据
|
|
370
402
|
*/
|
|
@@ -625,7 +657,9 @@ declare class FlowNodeEntity extends Entity<FlowNodeEntityConfig> {
|
|
|
625
657
|
get pre(): FlowNodeEntity | undefined;
|
|
626
658
|
get next(): FlowNodeEntity | undefined;
|
|
627
659
|
get parent(): FlowNodeEntity | undefined;
|
|
628
|
-
getNodeRegistry<M extends FlowNodeRegistry = FlowNodeRegistry
|
|
660
|
+
getNodeRegistry<M extends FlowNodeRegistry = FlowNodeRegistry & {
|
|
661
|
+
meta: FlowNodeMeta;
|
|
662
|
+
}>(): M;
|
|
629
663
|
/**
|
|
630
664
|
* @deprecated
|
|
631
665
|
* use getNodeRegistry instead
|
|
@@ -802,9 +836,11 @@ interface FlowTransitionLine {
|
|
|
802
836
|
arrow?: boolean;
|
|
803
837
|
renderKey?: string;
|
|
804
838
|
isHorizontal?: boolean;
|
|
839
|
+
isDraggingLine?: boolean;
|
|
805
840
|
activated?: boolean;
|
|
806
841
|
side?: LABEL_SIDE_TYPE;
|
|
807
842
|
style?: React.CSSProperties;
|
|
843
|
+
lineId?: string;
|
|
808
844
|
}
|
|
809
845
|
declare enum FlowTransitionLabelEnum {
|
|
810
846
|
ADDER_LABEL = 0,
|
|
@@ -821,6 +857,7 @@ interface FlowTransitionLabel {
|
|
|
821
857
|
width?: number;
|
|
822
858
|
rotate?: string;
|
|
823
859
|
props?: Record<string, any>;
|
|
860
|
+
labelId?: string;
|
|
824
861
|
}
|
|
825
862
|
interface AdderProps {
|
|
826
863
|
node: FlowNodeEntity;
|
|
@@ -1090,6 +1127,7 @@ interface FlowNodeRegistry<M extends FlowNodeMeta = FlowNodeMeta> {
|
|
|
1090
1127
|
*/
|
|
1091
1128
|
extendChildRegistries?: FlowNodeRegistry[];
|
|
1092
1129
|
/**
|
|
1130
|
+
* @deprecated
|
|
1093
1131
|
* 自定义子节点添加逻辑
|
|
1094
1132
|
* @param node 节点
|
|
1095
1133
|
* @param json 添加的节点 JSON
|
|
@@ -1100,12 +1138,17 @@ interface FlowNodeRegistry<M extends FlowNodeMeta = FlowNodeMeta> {
|
|
|
1100
1138
|
hidden?: boolean;
|
|
1101
1139
|
index?: number;
|
|
1102
1140
|
}) => FlowNodeEntity;
|
|
1141
|
+
/**
|
|
1142
|
+
* 内部用于继承逻辑判断,不要使用
|
|
1143
|
+
*/
|
|
1144
|
+
__extends__?: FlowNodeType[];
|
|
1103
1145
|
/**
|
|
1104
1146
|
* 扩展注册器
|
|
1105
1147
|
*/
|
|
1106
1148
|
[key: string]: any;
|
|
1107
1149
|
}
|
|
1108
1150
|
declare namespace FlowNodeRegistry {
|
|
1151
|
+
function mergeChildRegistries(r1?: FlowNodeRegistry[], r2?: FlowNodeRegistry[]): FlowNodeRegistry[];
|
|
1109
1152
|
function merge(registry1: FlowNodeRegistry, registry2: FlowNodeRegistry, finalType: FlowNodeType): FlowNodeRegistry;
|
|
1110
1153
|
function extend(registry: FlowNodeRegistry, extendRegistries: FlowNodeRegistry[]): FlowNodeRegistry;
|
|
1111
1154
|
}
|
|
@@ -1135,10 +1178,16 @@ declare enum FlowNodeBaseType {
|
|
|
1135
1178
|
BLOCK_ORDER_ICON = "blockOrderIcon",
|
|
1136
1179
|
GROUP = "group",
|
|
1137
1180
|
END = "end",
|
|
1181
|
+
BREAK = "break",
|
|
1138
1182
|
CONDITION = "condition",
|
|
1139
|
-
SUB_CANVAS = "subCanvas"
|
|
1183
|
+
SUB_CANVAS = "subCanvas",
|
|
1184
|
+
MULTI_INPUTS = "multiInputs",
|
|
1185
|
+
MULTI_OUTPUTS = "multiOutputs",
|
|
1186
|
+
INPUT = "input",
|
|
1187
|
+
OUTPUT = "output"
|
|
1140
1188
|
}
|
|
1141
1189
|
declare enum FlowNodeSplitType {
|
|
1190
|
+
SIMPLE_SPLIT = "simpleSplit",
|
|
1142
1191
|
DYNAMIC_SPLIT = "dynamicSplit",
|
|
1143
1192
|
STATIC_SPLIT = "staticSplit"
|
|
1144
1193
|
}
|
|
@@ -1494,21 +1543,6 @@ declare class FlowOperationBaseServiceImpl implements FlowOperationBaseService {
|
|
|
1494
1543
|
protected doMoveNode(node: FlowNodeEntity, newParent: FlowNodeEntity, index: number): void;
|
|
1495
1544
|
}
|
|
1496
1545
|
|
|
1497
|
-
declare class FlowGroupService {
|
|
1498
|
-
readonly entityManager: EntityManager;
|
|
1499
|
-
readonly operationService: FlowOperationBaseService;
|
|
1500
|
-
/** 创建分组节点 */
|
|
1501
|
-
createGroup(nodes: FlowNodeEntity[]): FlowNodeEntity | undefined;
|
|
1502
|
-
/** 删除分组 */
|
|
1503
|
-
deleteGroup(groupNode: FlowNodeEntity): void;
|
|
1504
|
-
/** 取消分组 */
|
|
1505
|
-
ungroup(groupNode: FlowNodeEntity): void;
|
|
1506
|
-
/** 返回所有分组节点 */
|
|
1507
|
-
getAllGroups(): FlowGroupController[];
|
|
1508
|
-
/** 获取分组控制器*/
|
|
1509
|
-
groupController(group: FlowNodeEntity): FlowGroupController | undefined;
|
|
1510
|
-
static validate(nodes: FlowNodeEntity[]): boolean;
|
|
1511
|
-
}
|
|
1512
1546
|
/** 分组控制器 */
|
|
1513
1547
|
declare class FlowGroupController {
|
|
1514
1548
|
readonly groupNode: FlowNodeEntity;
|
|
@@ -1532,18 +1566,22 @@ declare class FlowGroupController {
|
|
|
1532
1566
|
set hovered(hovered: boolean);
|
|
1533
1567
|
get hovered(): boolean;
|
|
1534
1568
|
static create(groupNode?: FlowNodeEntity): FlowGroupController | undefined;
|
|
1535
|
-
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
declare class FlowGroupService {
|
|
1572
|
+
readonly entityManager: EntityManager;
|
|
1573
|
+
readonly operationService: FlowOperationBaseService;
|
|
1574
|
+
/** 创建分组节点 */
|
|
1575
|
+
createGroup(nodes: FlowNodeEntity[]): FlowNodeEntity | undefined;
|
|
1576
|
+
/** 删除分组 */
|
|
1577
|
+
deleteGroup(groupNode: FlowNodeEntity): void;
|
|
1578
|
+
/** 取消分组 */
|
|
1579
|
+
ungroup(groupNode: FlowNodeEntity): void;
|
|
1580
|
+
/** 返回所有分组节点 */
|
|
1581
|
+
getAllGroups(): FlowGroupController[];
|
|
1582
|
+
/** 获取分组控制器*/
|
|
1583
|
+
groupController(group: FlowNodeEntity): FlowGroupController | undefined;
|
|
1536
1584
|
static validate(nodes: FlowNodeEntity[]): boolean;
|
|
1537
|
-
/** 获取节点分组控制 */
|
|
1538
|
-
static getNodeGroupController(node?: FlowNodeEntity): FlowGroupController | undefined;
|
|
1539
|
-
/** 向上递归查找分组递归控制 */
|
|
1540
|
-
static getNodeRecursionGroupController(node?: FlowNodeEntity): FlowGroupController | undefined;
|
|
1541
|
-
/** 是否分组节点 */
|
|
1542
|
-
static isGroupNode(group: FlowNodeEntity): boolean;
|
|
1543
|
-
/** 找到节点所有上级 */
|
|
1544
|
-
private static findNodeParents;
|
|
1545
|
-
/** 节点是否处于分组中 */
|
|
1546
|
-
private static isNodeInGroup;
|
|
1547
1585
|
}
|
|
1548
1586
|
|
|
1549
1587
|
/**
|