@flowgram.ai/document 0.1.0-alpha.6 → 0.1.0-alpha.8
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 +604 -503
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +68 -32
- package/dist/index.d.ts +68 -32
- package/dist/index.js +603 -502
- 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[], ignoreCreateAndUpdateEvent?: boolean, ignoreBlocks?: boolean): 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
|
*/
|
|
@@ -802,9 +834,11 @@ interface FlowTransitionLine {
|
|
|
802
834
|
arrow?: boolean;
|
|
803
835
|
renderKey?: string;
|
|
804
836
|
isHorizontal?: boolean;
|
|
837
|
+
isDraggingLine?: boolean;
|
|
805
838
|
activated?: boolean;
|
|
806
839
|
side?: LABEL_SIDE_TYPE;
|
|
807
840
|
style?: React.CSSProperties;
|
|
841
|
+
lineId?: string;
|
|
808
842
|
}
|
|
809
843
|
declare enum FlowTransitionLabelEnum {
|
|
810
844
|
ADDER_LABEL = 0,
|
|
@@ -821,6 +855,7 @@ interface FlowTransitionLabel {
|
|
|
821
855
|
width?: number;
|
|
822
856
|
rotate?: string;
|
|
823
857
|
props?: Record<string, any>;
|
|
858
|
+
labelId?: string;
|
|
824
859
|
}
|
|
825
860
|
interface AdderProps {
|
|
826
861
|
node: FlowNodeEntity;
|
|
@@ -1090,6 +1125,7 @@ interface FlowNodeRegistry<M extends FlowNodeMeta = FlowNodeMeta> {
|
|
|
1090
1125
|
*/
|
|
1091
1126
|
extendChildRegistries?: FlowNodeRegistry[];
|
|
1092
1127
|
/**
|
|
1128
|
+
* @deprecated
|
|
1093
1129
|
* 自定义子节点添加逻辑
|
|
1094
1130
|
* @param node 节点
|
|
1095
1131
|
* @param json 添加的节点 JSON
|
|
@@ -1100,12 +1136,17 @@ interface FlowNodeRegistry<M extends FlowNodeMeta = FlowNodeMeta> {
|
|
|
1100
1136
|
hidden?: boolean;
|
|
1101
1137
|
index?: number;
|
|
1102
1138
|
}) => FlowNodeEntity;
|
|
1139
|
+
/**
|
|
1140
|
+
* 内部用于继承逻辑判断,不要使用
|
|
1141
|
+
*/
|
|
1142
|
+
__extends__?: FlowNodeType[];
|
|
1103
1143
|
/**
|
|
1104
1144
|
* 扩展注册器
|
|
1105
1145
|
*/
|
|
1106
1146
|
[key: string]: any;
|
|
1107
1147
|
}
|
|
1108
1148
|
declare namespace FlowNodeRegistry {
|
|
1149
|
+
function mergeChildRegistries(r1?: FlowNodeRegistry[], r2?: FlowNodeRegistry[]): FlowNodeRegistry[];
|
|
1109
1150
|
function merge(registry1: FlowNodeRegistry, registry2: FlowNodeRegistry, finalType: FlowNodeType): FlowNodeRegistry;
|
|
1110
1151
|
function extend(registry: FlowNodeRegistry, extendRegistries: FlowNodeRegistry[]): FlowNodeRegistry;
|
|
1111
1152
|
}
|
|
@@ -1116,7 +1157,7 @@ type FlowNodeType = string | number;
|
|
|
1116
1157
|
*/
|
|
1117
1158
|
interface FlowNodeJSON {
|
|
1118
1159
|
id: string;
|
|
1119
|
-
type?: FlowNodeType;
|
|
1160
|
+
type?: FlowNodeBaseType | FlowNodeSplitType | FlowNodeType;
|
|
1120
1161
|
data?: Record<string, any>;
|
|
1121
1162
|
meta?: FlowNodeMeta;
|
|
1122
1163
|
blocks?: FlowNodeJSON[];
|
|
@@ -1135,10 +1176,16 @@ declare enum FlowNodeBaseType {
|
|
|
1135
1176
|
BLOCK_ORDER_ICON = "blockOrderIcon",
|
|
1136
1177
|
GROUP = "group",
|
|
1137
1178
|
END = "end",
|
|
1179
|
+
BREAK = "break",
|
|
1138
1180
|
CONDITION = "condition",
|
|
1139
|
-
SUB_CANVAS = "subCanvas"
|
|
1181
|
+
SUB_CANVAS = "subCanvas",
|
|
1182
|
+
MULTI_INPUTS = "multiInputs",
|
|
1183
|
+
MULTI_OUTPUTS = "multiOutputs",
|
|
1184
|
+
INPUT = "input",
|
|
1185
|
+
OUTPUT = "output"
|
|
1140
1186
|
}
|
|
1141
1187
|
declare enum FlowNodeSplitType {
|
|
1188
|
+
SIMPLE_SPLIT = "simpleSplit",
|
|
1142
1189
|
DYNAMIC_SPLIT = "dynamicSplit",
|
|
1143
1190
|
STATIC_SPLIT = "staticSplit"
|
|
1144
1191
|
}
|
|
@@ -1494,21 +1541,6 @@ declare class FlowOperationBaseServiceImpl implements FlowOperationBaseService {
|
|
|
1494
1541
|
protected doMoveNode(node: FlowNodeEntity, newParent: FlowNodeEntity, index: number): void;
|
|
1495
1542
|
}
|
|
1496
1543
|
|
|
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
1544
|
/** 分组控制器 */
|
|
1513
1545
|
declare class FlowGroupController {
|
|
1514
1546
|
readonly groupNode: FlowNodeEntity;
|
|
@@ -1532,18 +1564,22 @@ declare class FlowGroupController {
|
|
|
1532
1564
|
set hovered(hovered: boolean);
|
|
1533
1565
|
get hovered(): boolean;
|
|
1534
1566
|
static create(groupNode?: FlowNodeEntity): FlowGroupController | undefined;
|
|
1535
|
-
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
declare class FlowGroupService {
|
|
1570
|
+
readonly entityManager: EntityManager;
|
|
1571
|
+
readonly operationService: FlowOperationBaseService;
|
|
1572
|
+
/** 创建分组节点 */
|
|
1573
|
+
createGroup(nodes: FlowNodeEntity[]): FlowNodeEntity | undefined;
|
|
1574
|
+
/** 删除分组 */
|
|
1575
|
+
deleteGroup(groupNode: FlowNodeEntity): void;
|
|
1576
|
+
/** 取消分组 */
|
|
1577
|
+
ungroup(groupNode: FlowNodeEntity): void;
|
|
1578
|
+
/** 返回所有分组节点 */
|
|
1579
|
+
getAllGroups(): FlowGroupController[];
|
|
1580
|
+
/** 获取分组控制器*/
|
|
1581
|
+
groupController(group: FlowNodeEntity): FlowGroupController | undefined;
|
|
1536
1582
|
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
1583
|
}
|
|
1548
1584
|
|
|
1549
1585
|
/**
|
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[], ignoreCreateAndUpdateEvent?: boolean, ignoreBlocks?: boolean): 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
|
*/
|
|
@@ -802,9 +834,11 @@ interface FlowTransitionLine {
|
|
|
802
834
|
arrow?: boolean;
|
|
803
835
|
renderKey?: string;
|
|
804
836
|
isHorizontal?: boolean;
|
|
837
|
+
isDraggingLine?: boolean;
|
|
805
838
|
activated?: boolean;
|
|
806
839
|
side?: LABEL_SIDE_TYPE;
|
|
807
840
|
style?: React.CSSProperties;
|
|
841
|
+
lineId?: string;
|
|
808
842
|
}
|
|
809
843
|
declare enum FlowTransitionLabelEnum {
|
|
810
844
|
ADDER_LABEL = 0,
|
|
@@ -821,6 +855,7 @@ interface FlowTransitionLabel {
|
|
|
821
855
|
width?: number;
|
|
822
856
|
rotate?: string;
|
|
823
857
|
props?: Record<string, any>;
|
|
858
|
+
labelId?: string;
|
|
824
859
|
}
|
|
825
860
|
interface AdderProps {
|
|
826
861
|
node: FlowNodeEntity;
|
|
@@ -1090,6 +1125,7 @@ interface FlowNodeRegistry<M extends FlowNodeMeta = FlowNodeMeta> {
|
|
|
1090
1125
|
*/
|
|
1091
1126
|
extendChildRegistries?: FlowNodeRegistry[];
|
|
1092
1127
|
/**
|
|
1128
|
+
* @deprecated
|
|
1093
1129
|
* 自定义子节点添加逻辑
|
|
1094
1130
|
* @param node 节点
|
|
1095
1131
|
* @param json 添加的节点 JSON
|
|
@@ -1100,12 +1136,17 @@ interface FlowNodeRegistry<M extends FlowNodeMeta = FlowNodeMeta> {
|
|
|
1100
1136
|
hidden?: boolean;
|
|
1101
1137
|
index?: number;
|
|
1102
1138
|
}) => FlowNodeEntity;
|
|
1139
|
+
/**
|
|
1140
|
+
* 内部用于继承逻辑判断,不要使用
|
|
1141
|
+
*/
|
|
1142
|
+
__extends__?: FlowNodeType[];
|
|
1103
1143
|
/**
|
|
1104
1144
|
* 扩展注册器
|
|
1105
1145
|
*/
|
|
1106
1146
|
[key: string]: any;
|
|
1107
1147
|
}
|
|
1108
1148
|
declare namespace FlowNodeRegistry {
|
|
1149
|
+
function mergeChildRegistries(r1?: FlowNodeRegistry[], r2?: FlowNodeRegistry[]): FlowNodeRegistry[];
|
|
1109
1150
|
function merge(registry1: FlowNodeRegistry, registry2: FlowNodeRegistry, finalType: FlowNodeType): FlowNodeRegistry;
|
|
1110
1151
|
function extend(registry: FlowNodeRegistry, extendRegistries: FlowNodeRegistry[]): FlowNodeRegistry;
|
|
1111
1152
|
}
|
|
@@ -1116,7 +1157,7 @@ type FlowNodeType = string | number;
|
|
|
1116
1157
|
*/
|
|
1117
1158
|
interface FlowNodeJSON {
|
|
1118
1159
|
id: string;
|
|
1119
|
-
type?: FlowNodeType;
|
|
1160
|
+
type?: FlowNodeBaseType | FlowNodeSplitType | FlowNodeType;
|
|
1120
1161
|
data?: Record<string, any>;
|
|
1121
1162
|
meta?: FlowNodeMeta;
|
|
1122
1163
|
blocks?: FlowNodeJSON[];
|
|
@@ -1135,10 +1176,16 @@ declare enum FlowNodeBaseType {
|
|
|
1135
1176
|
BLOCK_ORDER_ICON = "blockOrderIcon",
|
|
1136
1177
|
GROUP = "group",
|
|
1137
1178
|
END = "end",
|
|
1179
|
+
BREAK = "break",
|
|
1138
1180
|
CONDITION = "condition",
|
|
1139
|
-
SUB_CANVAS = "subCanvas"
|
|
1181
|
+
SUB_CANVAS = "subCanvas",
|
|
1182
|
+
MULTI_INPUTS = "multiInputs",
|
|
1183
|
+
MULTI_OUTPUTS = "multiOutputs",
|
|
1184
|
+
INPUT = "input",
|
|
1185
|
+
OUTPUT = "output"
|
|
1140
1186
|
}
|
|
1141
1187
|
declare enum FlowNodeSplitType {
|
|
1188
|
+
SIMPLE_SPLIT = "simpleSplit",
|
|
1142
1189
|
DYNAMIC_SPLIT = "dynamicSplit",
|
|
1143
1190
|
STATIC_SPLIT = "staticSplit"
|
|
1144
1191
|
}
|
|
@@ -1494,21 +1541,6 @@ declare class FlowOperationBaseServiceImpl implements FlowOperationBaseService {
|
|
|
1494
1541
|
protected doMoveNode(node: FlowNodeEntity, newParent: FlowNodeEntity, index: number): void;
|
|
1495
1542
|
}
|
|
1496
1543
|
|
|
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
1544
|
/** 分组控制器 */
|
|
1513
1545
|
declare class FlowGroupController {
|
|
1514
1546
|
readonly groupNode: FlowNodeEntity;
|
|
@@ -1532,18 +1564,22 @@ declare class FlowGroupController {
|
|
|
1532
1564
|
set hovered(hovered: boolean);
|
|
1533
1565
|
get hovered(): boolean;
|
|
1534
1566
|
static create(groupNode?: FlowNodeEntity): FlowGroupController | undefined;
|
|
1535
|
-
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
declare class FlowGroupService {
|
|
1570
|
+
readonly entityManager: EntityManager;
|
|
1571
|
+
readonly operationService: FlowOperationBaseService;
|
|
1572
|
+
/** 创建分组节点 */
|
|
1573
|
+
createGroup(nodes: FlowNodeEntity[]): FlowNodeEntity | undefined;
|
|
1574
|
+
/** 删除分组 */
|
|
1575
|
+
deleteGroup(groupNode: FlowNodeEntity): void;
|
|
1576
|
+
/** 取消分组 */
|
|
1577
|
+
ungroup(groupNode: FlowNodeEntity): void;
|
|
1578
|
+
/** 返回所有分组节点 */
|
|
1579
|
+
getAllGroups(): FlowGroupController[];
|
|
1580
|
+
/** 获取分组控制器*/
|
|
1581
|
+
groupController(group: FlowNodeEntity): FlowGroupController | undefined;
|
|
1536
1582
|
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
1583
|
}
|
|
1548
1584
|
|
|
1549
1585
|
/**
|