@flowgram.ai/free-layout-core 0.4.15 → 0.4.17

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/index.d.mts CHANGED
@@ -2,10 +2,8 @@ import { PlaygroundConfigEntity, CommandService, PlaygroundDragEvent, EntityData
2
2
  export { bindConfigEntity, useConfigEntity, useEntities, useEntityDataFromContext, useEntityFromContext, useListenEvents, usePlayground, usePlaygroundContainer, usePlaygroundContext, useRefresh, useService } from '@flowgram.ai/core';
3
3
  import { NodeFormProps } from '@flowgram.ai/node';
4
4
  import { FlowOperationBaseService, FlowNodeType, FlowOperationBaseServiceImpl, FlowNodeEntityOrId, FlowNodeEntity } from '@flowgram.ai/document';
5
- import { W as WorkflowHoverService, a as WorkflowDocument, b as WorkflowLinesManager, c as WorkflowSelectService, d as WorkflowDocumentOptions, L as LineEventProps, N as NodesDragEvent, e as WorkflowNodeJSON, f as WorkflowPortEntity, g as WorkflowLineEntity, O as OnDragLineEnd, h as WorkflowJSON, i as LineCenterPoint, j as WorkflowPorts, k as WorkflowPortType, l as LinePoint, m as WorkflowPort, n as LineRenderType, o as WorkflowLineRenderContribution, p as LinePosition } from './workflow-line-entity-IbhMSbBs.mjs';
6
- export { R as HoverPosition, F as LINE_HOVER_DISTANCE, y as LineColor, z as LineColors, x as LinePointLocation, w as LineType, C as NodesDragEndEvent, B as NodesDragStartEvent, D as NodesDraggingEvent, P as POINT_RADIUS, K as PORT_SIZE, r as WORKFLOW_LINE_ENTITY, S as WorkfloEntityHoverable, u as WorkflowContentChangeEvent, t as WorkflowContentChangeType, U as WorkflowDocumentOptionsDefault, T as WorkflowDocumentProvider, Q as WorkflowEntityHoverable, H as WorkflowLineEntityOpts, I as WorkflowLineInfo, G as WorkflowLinePortInfo, A as WorkflowLineRenderContributionFactory, J as WorkflowLineUIState, v as WorkflowNodeMeta, M as WorkflowPortEntityOpts, s as domReactToBounds, q as getPortEntityId, E as onDragLineEndParams } from './workflow-line-entity-IbhMSbBs.mjs';
7
- import { W as WorkflowNodeEntity } from './workflow-sub-canvas-IQzlYvPD.mjs';
8
- export { a as WorkflowSubCanvas } from './workflow-sub-canvas-IQzlYvPD.mjs';
5
+ import { W as WorkflowHoverService, a as WorkflowDocument, b as WorkflowLinesManager, c as WorkflowSelectService, d as WorkflowDocumentOptions, L as LineEventProps, N as NodesDragEvent, e as WorkflowNodeJSON, f as WorkflowNodeEntity, g as WorkflowPortEntity, h as WorkflowLineEntity, O as OnDragLineEnd, i as LineRenderType, j as WorkflowLineRenderContribution, k as LinePosition, l as LineCenterPoint, m as WorkflowJSON } from './workflow-node-entity-DtPEYn6-.mjs';
6
+ export { X as HoverPosition, F as LINE_HOVER_DISTANCE, x as LineColor, y as LineColors, w as LinePoint, v as LinePointLocation, u as LineType, C as NodesDragEndEvent, B as NodesDragStartEvent, D as NodesDraggingEvent, P as POINT_RADIUS, K as PORT_SIZE, p as WORKFLOW_LINE_ENTITY, Y as WorkfloEntityHoverable, s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, _ as WorkflowDocumentOptionsDefault, Z as WorkflowDocumentProvider, V as WorkflowEntityHoverable, H as WorkflowLineEntityOpts, I as WorkflowLineInfo, G as WorkflowLinePortInfo, z as WorkflowLineRenderContributionFactory, J as WorkflowLineUIState, T as WorkflowNodeLines, U as WorkflowNodeLinesData, t as WorkflowNodeMeta, S as WorkflowNodePortsData, M as WorkflowPort, R as WorkflowPortEntityOpts, n as WorkflowPortType, Q as WorkflowPorts, A as WorkflowSubCanvas, q as domReactToBounds, o as getPortEntityId, E as onDragLineEndParams } from './workflow-node-entity-DtPEYn6-.mjs';
9
7
  import * as _flowgram_ai_utils from '@flowgram.ai/utils';
10
8
  import { DisposableCollection, IPoint, Disposable, Rectangle } from '@flowgram.ai/utils';
11
9
  export { compose, composeAsync, delay } from '@flowgram.ai/utils';
@@ -116,6 +114,10 @@ declare class WorkflowDragService {
116
114
  private clearDrop;
117
115
  private setLineColor;
118
116
  private handleDragOnNode;
117
+ /**
118
+ * 容器内子节点总体位置重置为0
119
+ */
120
+ private resetContainerInternalPosition;
119
121
  private childrenOfContainer;
120
122
  /**
121
123
  * 绘制线条
@@ -191,6 +193,46 @@ declare class WorkflowOperationBaseServiceImpl extends FlowOperationBaseServiceI
191
193
  updateNodePosition(nodeOrId: FlowNodeEntityOrId, position: IPoint): void;
192
194
  }
193
195
 
196
+ /**
197
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
198
+ * SPDX-License-Identifier: MIT
199
+ */
200
+
201
+ interface WorkflowLineRenderDataSchema {
202
+ version: string;
203
+ contributions: Map<LineRenderType, WorkflowLineRenderContribution>;
204
+ position: LinePosition;
205
+ }
206
+ declare class WorkflowLineRenderData extends EntityData<WorkflowLineRenderDataSchema> {
207
+ static type: string;
208
+ entity: WorkflowLineEntity;
209
+ constructor(entity: WorkflowLineEntity);
210
+ getDefaultData(): WorkflowLineRenderDataSchema;
211
+ get renderVersion(): string;
212
+ get position(): LinePosition;
213
+ get path(): string;
214
+ calcDistance(pos: IPoint): number;
215
+ get bounds(): Rectangle;
216
+ /**
217
+ * 更新数据
218
+ * WARNING: 这个方法,必须在 requestAnimationFrame / useLayoutEffect 中调用,否则会引起浏览器强制重排
219
+ */
220
+ update(): void;
221
+ private get lineType();
222
+ /**
223
+ * 获取 center 位置
224
+ */
225
+ get center(): LineCenterPoint;
226
+ /**
227
+ * 更新版本
228
+ * WARNING: 这个方法,必须在 requestAnimationFrame / useLayoutEffect 中调用,否则会引起浏览器强制重排
229
+ */
230
+ private updatePosition;
231
+ private get currentLine();
232
+ private syncContributions;
233
+ private registerContribution;
234
+ }
235
+
194
236
  /**
195
237
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
196
238
  * SPDX-License-Identifier: MIT
@@ -377,184 +419,6 @@ declare enum InteractiveType {
377
419
  PAD = "PAD"
378
420
  }
379
421
 
380
- /**
381
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
382
- * SPDX-License-Identifier: MIT
383
- */
384
-
385
- /**
386
- * 节点的点位信息
387
- * portsData 只监听点位的数目和类型,不监听点位的 position 变化
388
- */
389
- declare class WorkflowNodePortsData extends EntityData {
390
- static readonly type = "WorkflowNodePortsData";
391
- readonly entity: WorkflowNodeEntity;
392
- /** 静态的 ports 数据 */
393
- protected _staticPorts: WorkflowPorts;
394
- /** 存储 port 实体的 id,用于判断 port 是否存在 */
395
- protected _portIDSet: Set<string>;
396
- /** 上一次的 ports 数据,用于判断 ports 是否发生变化 */
397
- protected _prePorts: WorkflowPorts;
398
- constructor(entity: WorkflowNodeEntity);
399
- getDefaultData(): any;
400
- /**
401
- * Update all ports data, includes static ports and dynamic ports
402
- * @param ports
403
- */
404
- updateAllPorts(ports?: WorkflowPorts): void;
405
- /**
406
- * @deprecated use `updateAllPorts` instead
407
- */
408
- updateStaticPorts(ports: WorkflowPorts): void;
409
- /**
410
- * 动态计算点位,通过 dom 的 data-port-key
411
- */
412
- updateDynamicPorts(): void;
413
- /**
414
- * 根据 key 获取 port 实体
415
- */
416
- getPortEntityByKey(portType: WorkflowPortType, portKey?: string | number): WorkflowPortEntity;
417
- /**
418
- * 更新 ports 数据
419
- */
420
- protected updatePorts(ports: WorkflowPorts): void;
421
- /**
422
- * 获取所有 port entities
423
- */
424
- get allPorts(): WorkflowPortEntity[];
425
- /**
426
- * 获取输入点位
427
- */
428
- get inputPorts(): WorkflowPortEntity[];
429
- /**
430
- * 获取输出点位
431
- */
432
- get outputPorts(): WorkflowPortEntity[];
433
- /**
434
- * 获取输入点位置
435
- */
436
- get inputPoints(): LinePoint[];
437
- /**
438
- * 获取输出点位置
439
- */
440
- get outputPoints(): LinePoint[];
441
- /**
442
- * 根据 key 获取 输入点位置
443
- */
444
- getInputPoint(key?: string | number): LinePoint;
445
- /**
446
- * 根据 key 获取输出点位置
447
- */
448
- getOutputPoint(key?: string | number): LinePoint;
449
- /**
450
- * 获取 port 实体
451
- */
452
- protected getPortEntity(portId: string): WorkflowPortEntity | undefined;
453
- /**
454
- * 拼接 port 实体的 id
455
- */
456
- protected getPortId(portType: WorkflowPortType, portKey?: string | number): string;
457
- /**
458
- * 创建 port 实体
459
- */
460
- protected createPortEntity(portInfo: WorkflowPort): WorkflowPortEntity;
461
- /**
462
- * 获取或创建 port 实体
463
- */
464
- protected getOrCreatePortEntity(portInfo: WorkflowPort): WorkflowPortEntity;
465
- /**
466
- * 更新 port 实体
467
- */
468
- protected updatePortEntity(portInfo: WorkflowPort): WorkflowPortEntity;
469
- }
470
-
471
- /**
472
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
473
- * SPDX-License-Identifier: MIT
474
- */
475
-
476
- interface WorkflowNodeLines {
477
- inputLines: WorkflowLineEntity[];
478
- outputLines: WorkflowLineEntity[];
479
- }
480
- /**
481
- * 节点的关联的线条
482
- */
483
- declare class WorkflowNodeLinesData extends EntityData<WorkflowNodeLines> {
484
- static type: string;
485
- entity: WorkflowNodeEntity;
486
- getDefaultData(): WorkflowNodeLines;
487
- constructor(entity: WorkflowNodeEntity);
488
- /**
489
- * 输入线条
490
- */
491
- get inputLines(): WorkflowLineEntity[];
492
- /**
493
- * 输出线条
494
- */
495
- get outputLines(): WorkflowLineEntity[];
496
- get allLines(): WorkflowLineEntity[];
497
- get availableLines(): WorkflowLineEntity[];
498
- /**
499
- * 输入节点
500
- */
501
- get inputNodes(): WorkflowNodeEntity[];
502
- /**
503
- * 所有输入节点
504
- */
505
- get allInputNodes(): WorkflowNodeEntity[];
506
- /**
507
- * 输出节点
508
- */
509
- get outputNodes(): WorkflowNodeEntity[];
510
- /**
511
- * 输入输出节点
512
- */
513
- get allOutputNodes(): WorkflowNodeEntity[];
514
- addLine(line: WorkflowLineEntity): void;
515
- removeLine(line: WorkflowLineEntity): void;
516
- }
517
-
518
- /**
519
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
520
- * SPDX-License-Identifier: MIT
521
- */
522
-
523
- interface WorkflowLineRenderDataSchema {
524
- version: string;
525
- contributions: Map<LineRenderType, WorkflowLineRenderContribution>;
526
- position: LinePosition;
527
- }
528
- declare class WorkflowLineRenderData extends EntityData<WorkflowLineRenderDataSchema> {
529
- static type: string;
530
- entity: WorkflowLineEntity;
531
- constructor(entity: WorkflowLineEntity);
532
- getDefaultData(): WorkflowLineRenderDataSchema;
533
- get renderVersion(): string;
534
- get position(): LinePosition;
535
- get path(): string;
536
- calcDistance(pos: IPoint): number;
537
- get bounds(): Rectangle;
538
- /**
539
- * 更新数据
540
- * WARNING: 这个方法,必须在 requestAnimationFrame / useLayoutEffect 中调用,否则会引起浏览器强制重排
541
- */
542
- update(): void;
543
- private get lineType();
544
- /**
545
- * 获取 center 位置
546
- */
547
- get center(): LineCenterPoint;
548
- /**
549
- * 更新版本
550
- * WARNING: 这个方法,必须在 requestAnimationFrame / useLayoutEffect 中调用,否则会引起浏览器强制重排
551
- */
552
- private updatePosition;
553
- private get currentLine();
554
- private syncContributions;
555
- private registerContribution;
556
- }
557
-
558
422
  /**
559
423
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
560
424
  * SPDX-License-Identifier: MIT
@@ -562,4 +426,4 @@ declare class WorkflowLineRenderData extends EntityData<WorkflowLineRenderDataSc
562
426
 
563
427
  declare const WorkflowDocumentContainerModule: ContainerModule;
564
428
 
565
- export { EditorCursorState, InteractiveType, LineCenterPoint, LineEventProps, LinePoint, LinePosition, LineRenderType, NodePostionUpdateEvent, type NodeRenderReturnType, NodesDragEvent, OnDragLineEnd, type PositionMap, WorkflowCommands, WorkflowDocument, WorkflowDocumentContainerModule, WorkflowDocumentOptions, WorkflowDragService, WorkflowHoverService, WorkflowJSON, WorkflowLineEntity, WorkflowLineRenderContribution, WorkflowLineRenderData, type WorkflowLineRenderDataSchema, WorkflowLinesManager, WorkflowNodeEntity, WorkflowNodeJSON, type WorkflowNodeLines, WorkflowNodeLinesData, WorkflowNodePortsData, WorkflowOperationBaseService, WorkflowOperationBaseServiceImpl, WorkflowPort, WorkflowPortEntity, WorkflowPortType, WorkflowPorts, WorkflowResetLayoutService, WorkflowSelectService, buildGroupJSON, fitView, getAntiOverlapPosition, getLineCenter, nanoid, useCurrentDomNode, useCurrentEntity, useNodeRender, usePlaygroundReadonlyState, useWorkflowDocument };
429
+ export { EditorCursorState, InteractiveType, LineCenterPoint, LineEventProps, LinePosition, LineRenderType, NodePostionUpdateEvent, type NodeRenderReturnType, NodesDragEvent, OnDragLineEnd, type PositionMap, WorkflowCommands, WorkflowDocument, WorkflowDocumentContainerModule, WorkflowDocumentOptions, WorkflowDragService, WorkflowHoverService, WorkflowJSON, WorkflowLineEntity, WorkflowLineRenderContribution, WorkflowLineRenderData, type WorkflowLineRenderDataSchema, WorkflowLinesManager, WorkflowNodeEntity, WorkflowNodeJSON, WorkflowOperationBaseService, WorkflowOperationBaseServiceImpl, WorkflowPortEntity, WorkflowResetLayoutService, WorkflowSelectService, buildGroupJSON, fitView, getAntiOverlapPosition, getLineCenter, nanoid, useCurrentDomNode, useCurrentEntity, useNodeRender, usePlaygroundReadonlyState, useWorkflowDocument };
package/dist/index.d.ts CHANGED
@@ -2,10 +2,8 @@ import { PlaygroundConfigEntity, CommandService, PlaygroundDragEvent, EntityData
2
2
  export { bindConfigEntity, useConfigEntity, useEntities, useEntityDataFromContext, useEntityFromContext, useListenEvents, usePlayground, usePlaygroundContainer, usePlaygroundContext, useRefresh, useService } from '@flowgram.ai/core';
3
3
  import { NodeFormProps } from '@flowgram.ai/node';
4
4
  import { FlowOperationBaseService, FlowNodeType, FlowOperationBaseServiceImpl, FlowNodeEntityOrId, FlowNodeEntity } from '@flowgram.ai/document';
5
- import { W as WorkflowHoverService, a as WorkflowDocument, b as WorkflowLinesManager, c as WorkflowSelectService, d as WorkflowDocumentOptions, L as LineEventProps, N as NodesDragEvent, e as WorkflowNodeJSON, f as WorkflowPortEntity, g as WorkflowLineEntity, O as OnDragLineEnd, h as WorkflowJSON, i as LineCenterPoint, j as WorkflowPorts, k as WorkflowPortType, l as LinePoint, m as WorkflowPort, n as LineRenderType, o as WorkflowLineRenderContribution, p as LinePosition } from './workflow-line-entity-DcecHiNc.js';
6
- export { R as HoverPosition, F as LINE_HOVER_DISTANCE, y as LineColor, z as LineColors, x as LinePointLocation, w as LineType, C as NodesDragEndEvent, B as NodesDragStartEvent, D as NodesDraggingEvent, P as POINT_RADIUS, K as PORT_SIZE, r as WORKFLOW_LINE_ENTITY, S as WorkfloEntityHoverable, u as WorkflowContentChangeEvent, t as WorkflowContentChangeType, U as WorkflowDocumentOptionsDefault, T as WorkflowDocumentProvider, Q as WorkflowEntityHoverable, H as WorkflowLineEntityOpts, I as WorkflowLineInfo, G as WorkflowLinePortInfo, A as WorkflowLineRenderContributionFactory, J as WorkflowLineUIState, v as WorkflowNodeMeta, M as WorkflowPortEntityOpts, s as domReactToBounds, q as getPortEntityId, E as onDragLineEndParams } from './workflow-line-entity-DcecHiNc.js';
7
- import { W as WorkflowNodeEntity } from './workflow-sub-canvas-IQzlYvPD.js';
8
- export { a as WorkflowSubCanvas } from './workflow-sub-canvas-IQzlYvPD.js';
5
+ import { W as WorkflowHoverService, a as WorkflowDocument, b as WorkflowLinesManager, c as WorkflowSelectService, d as WorkflowDocumentOptions, L as LineEventProps, N as NodesDragEvent, e as WorkflowNodeJSON, f as WorkflowNodeEntity, g as WorkflowPortEntity, h as WorkflowLineEntity, O as OnDragLineEnd, i as LineRenderType, j as WorkflowLineRenderContribution, k as LinePosition, l as LineCenterPoint, m as WorkflowJSON } from './workflow-node-entity-GyY_PHY6.js';
6
+ export { X as HoverPosition, F as LINE_HOVER_DISTANCE, x as LineColor, y as LineColors, w as LinePoint, v as LinePointLocation, u as LineType, C as NodesDragEndEvent, B as NodesDragStartEvent, D as NodesDraggingEvent, P as POINT_RADIUS, K as PORT_SIZE, p as WORKFLOW_LINE_ENTITY, Y as WorkfloEntityHoverable, s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, _ as WorkflowDocumentOptionsDefault, Z as WorkflowDocumentProvider, V as WorkflowEntityHoverable, H as WorkflowLineEntityOpts, I as WorkflowLineInfo, G as WorkflowLinePortInfo, z as WorkflowLineRenderContributionFactory, J as WorkflowLineUIState, T as WorkflowNodeLines, U as WorkflowNodeLinesData, t as WorkflowNodeMeta, S as WorkflowNodePortsData, M as WorkflowPort, R as WorkflowPortEntityOpts, n as WorkflowPortType, Q as WorkflowPorts, A as WorkflowSubCanvas, q as domReactToBounds, o as getPortEntityId, E as onDragLineEndParams } from './workflow-node-entity-GyY_PHY6.js';
9
7
  import * as _flowgram_ai_utils from '@flowgram.ai/utils';
10
8
  import { DisposableCollection, IPoint, Disposable, Rectangle } from '@flowgram.ai/utils';
11
9
  export { compose, composeAsync, delay } from '@flowgram.ai/utils';
@@ -116,6 +114,10 @@ declare class WorkflowDragService {
116
114
  private clearDrop;
117
115
  private setLineColor;
118
116
  private handleDragOnNode;
117
+ /**
118
+ * 容器内子节点总体位置重置为0
119
+ */
120
+ private resetContainerInternalPosition;
119
121
  private childrenOfContainer;
120
122
  /**
121
123
  * 绘制线条
@@ -191,6 +193,46 @@ declare class WorkflowOperationBaseServiceImpl extends FlowOperationBaseServiceI
191
193
  updateNodePosition(nodeOrId: FlowNodeEntityOrId, position: IPoint): void;
192
194
  }
193
195
 
196
+ /**
197
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
198
+ * SPDX-License-Identifier: MIT
199
+ */
200
+
201
+ interface WorkflowLineRenderDataSchema {
202
+ version: string;
203
+ contributions: Map<LineRenderType, WorkflowLineRenderContribution>;
204
+ position: LinePosition;
205
+ }
206
+ declare class WorkflowLineRenderData extends EntityData<WorkflowLineRenderDataSchema> {
207
+ static type: string;
208
+ entity: WorkflowLineEntity;
209
+ constructor(entity: WorkflowLineEntity);
210
+ getDefaultData(): WorkflowLineRenderDataSchema;
211
+ get renderVersion(): string;
212
+ get position(): LinePosition;
213
+ get path(): string;
214
+ calcDistance(pos: IPoint): number;
215
+ get bounds(): Rectangle;
216
+ /**
217
+ * 更新数据
218
+ * WARNING: 这个方法,必须在 requestAnimationFrame / useLayoutEffect 中调用,否则会引起浏览器强制重排
219
+ */
220
+ update(): void;
221
+ private get lineType();
222
+ /**
223
+ * 获取 center 位置
224
+ */
225
+ get center(): LineCenterPoint;
226
+ /**
227
+ * 更新版本
228
+ * WARNING: 这个方法,必须在 requestAnimationFrame / useLayoutEffect 中调用,否则会引起浏览器强制重排
229
+ */
230
+ private updatePosition;
231
+ private get currentLine();
232
+ private syncContributions;
233
+ private registerContribution;
234
+ }
235
+
194
236
  /**
195
237
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
196
238
  * SPDX-License-Identifier: MIT
@@ -377,184 +419,6 @@ declare enum InteractiveType {
377
419
  PAD = "PAD"
378
420
  }
379
421
 
380
- /**
381
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
382
- * SPDX-License-Identifier: MIT
383
- */
384
-
385
- /**
386
- * 节点的点位信息
387
- * portsData 只监听点位的数目和类型,不监听点位的 position 变化
388
- */
389
- declare class WorkflowNodePortsData extends EntityData {
390
- static readonly type = "WorkflowNodePortsData";
391
- readonly entity: WorkflowNodeEntity;
392
- /** 静态的 ports 数据 */
393
- protected _staticPorts: WorkflowPorts;
394
- /** 存储 port 实体的 id,用于判断 port 是否存在 */
395
- protected _portIDSet: Set<string>;
396
- /** 上一次的 ports 数据,用于判断 ports 是否发生变化 */
397
- protected _prePorts: WorkflowPorts;
398
- constructor(entity: WorkflowNodeEntity);
399
- getDefaultData(): any;
400
- /**
401
- * Update all ports data, includes static ports and dynamic ports
402
- * @param ports
403
- */
404
- updateAllPorts(ports?: WorkflowPorts): void;
405
- /**
406
- * @deprecated use `updateAllPorts` instead
407
- */
408
- updateStaticPorts(ports: WorkflowPorts): void;
409
- /**
410
- * 动态计算点位,通过 dom 的 data-port-key
411
- */
412
- updateDynamicPorts(): void;
413
- /**
414
- * 根据 key 获取 port 实体
415
- */
416
- getPortEntityByKey(portType: WorkflowPortType, portKey?: string | number): WorkflowPortEntity;
417
- /**
418
- * 更新 ports 数据
419
- */
420
- protected updatePorts(ports: WorkflowPorts): void;
421
- /**
422
- * 获取所有 port entities
423
- */
424
- get allPorts(): WorkflowPortEntity[];
425
- /**
426
- * 获取输入点位
427
- */
428
- get inputPorts(): WorkflowPortEntity[];
429
- /**
430
- * 获取输出点位
431
- */
432
- get outputPorts(): WorkflowPortEntity[];
433
- /**
434
- * 获取输入点位置
435
- */
436
- get inputPoints(): LinePoint[];
437
- /**
438
- * 获取输出点位置
439
- */
440
- get outputPoints(): LinePoint[];
441
- /**
442
- * 根据 key 获取 输入点位置
443
- */
444
- getInputPoint(key?: string | number): LinePoint;
445
- /**
446
- * 根据 key 获取输出点位置
447
- */
448
- getOutputPoint(key?: string | number): LinePoint;
449
- /**
450
- * 获取 port 实体
451
- */
452
- protected getPortEntity(portId: string): WorkflowPortEntity | undefined;
453
- /**
454
- * 拼接 port 实体的 id
455
- */
456
- protected getPortId(portType: WorkflowPortType, portKey?: string | number): string;
457
- /**
458
- * 创建 port 实体
459
- */
460
- protected createPortEntity(portInfo: WorkflowPort): WorkflowPortEntity;
461
- /**
462
- * 获取或创建 port 实体
463
- */
464
- protected getOrCreatePortEntity(portInfo: WorkflowPort): WorkflowPortEntity;
465
- /**
466
- * 更新 port 实体
467
- */
468
- protected updatePortEntity(portInfo: WorkflowPort): WorkflowPortEntity;
469
- }
470
-
471
- /**
472
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
473
- * SPDX-License-Identifier: MIT
474
- */
475
-
476
- interface WorkflowNodeLines {
477
- inputLines: WorkflowLineEntity[];
478
- outputLines: WorkflowLineEntity[];
479
- }
480
- /**
481
- * 节点的关联的线条
482
- */
483
- declare class WorkflowNodeLinesData extends EntityData<WorkflowNodeLines> {
484
- static type: string;
485
- entity: WorkflowNodeEntity;
486
- getDefaultData(): WorkflowNodeLines;
487
- constructor(entity: WorkflowNodeEntity);
488
- /**
489
- * 输入线条
490
- */
491
- get inputLines(): WorkflowLineEntity[];
492
- /**
493
- * 输出线条
494
- */
495
- get outputLines(): WorkflowLineEntity[];
496
- get allLines(): WorkflowLineEntity[];
497
- get availableLines(): WorkflowLineEntity[];
498
- /**
499
- * 输入节点
500
- */
501
- get inputNodes(): WorkflowNodeEntity[];
502
- /**
503
- * 所有输入节点
504
- */
505
- get allInputNodes(): WorkflowNodeEntity[];
506
- /**
507
- * 输出节点
508
- */
509
- get outputNodes(): WorkflowNodeEntity[];
510
- /**
511
- * 输入输出节点
512
- */
513
- get allOutputNodes(): WorkflowNodeEntity[];
514
- addLine(line: WorkflowLineEntity): void;
515
- removeLine(line: WorkflowLineEntity): void;
516
- }
517
-
518
- /**
519
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
520
- * SPDX-License-Identifier: MIT
521
- */
522
-
523
- interface WorkflowLineRenderDataSchema {
524
- version: string;
525
- contributions: Map<LineRenderType, WorkflowLineRenderContribution>;
526
- position: LinePosition;
527
- }
528
- declare class WorkflowLineRenderData extends EntityData<WorkflowLineRenderDataSchema> {
529
- static type: string;
530
- entity: WorkflowLineEntity;
531
- constructor(entity: WorkflowLineEntity);
532
- getDefaultData(): WorkflowLineRenderDataSchema;
533
- get renderVersion(): string;
534
- get position(): LinePosition;
535
- get path(): string;
536
- calcDistance(pos: IPoint): number;
537
- get bounds(): Rectangle;
538
- /**
539
- * 更新数据
540
- * WARNING: 这个方法,必须在 requestAnimationFrame / useLayoutEffect 中调用,否则会引起浏览器强制重排
541
- */
542
- update(): void;
543
- private get lineType();
544
- /**
545
- * 获取 center 位置
546
- */
547
- get center(): LineCenterPoint;
548
- /**
549
- * 更新版本
550
- * WARNING: 这个方法,必须在 requestAnimationFrame / useLayoutEffect 中调用,否则会引起浏览器强制重排
551
- */
552
- private updatePosition;
553
- private get currentLine();
554
- private syncContributions;
555
- private registerContribution;
556
- }
557
-
558
422
  /**
559
423
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
560
424
  * SPDX-License-Identifier: MIT
@@ -562,4 +426,4 @@ declare class WorkflowLineRenderData extends EntityData<WorkflowLineRenderDataSc
562
426
 
563
427
  declare const WorkflowDocumentContainerModule: ContainerModule;
564
428
 
565
- export { EditorCursorState, InteractiveType, LineCenterPoint, LineEventProps, LinePoint, LinePosition, LineRenderType, NodePostionUpdateEvent, type NodeRenderReturnType, NodesDragEvent, OnDragLineEnd, type PositionMap, WorkflowCommands, WorkflowDocument, WorkflowDocumentContainerModule, WorkflowDocumentOptions, WorkflowDragService, WorkflowHoverService, WorkflowJSON, WorkflowLineEntity, WorkflowLineRenderContribution, WorkflowLineRenderData, type WorkflowLineRenderDataSchema, WorkflowLinesManager, WorkflowNodeEntity, WorkflowNodeJSON, type WorkflowNodeLines, WorkflowNodeLinesData, WorkflowNodePortsData, WorkflowOperationBaseService, WorkflowOperationBaseServiceImpl, WorkflowPort, WorkflowPortEntity, WorkflowPortType, WorkflowPorts, WorkflowResetLayoutService, WorkflowSelectService, buildGroupJSON, fitView, getAntiOverlapPosition, getLineCenter, nanoid, useCurrentDomNode, useCurrentEntity, useNodeRender, usePlaygroundReadonlyState, useWorkflowDocument };
429
+ export { EditorCursorState, InteractiveType, LineCenterPoint, LineEventProps, LinePosition, LineRenderType, NodePostionUpdateEvent, type NodeRenderReturnType, NodesDragEvent, OnDragLineEnd, type PositionMap, WorkflowCommands, WorkflowDocument, WorkflowDocumentContainerModule, WorkflowDocumentOptions, WorkflowDragService, WorkflowHoverService, WorkflowJSON, WorkflowLineEntity, WorkflowLineRenderContribution, WorkflowLineRenderData, type WorkflowLineRenderDataSchema, WorkflowLinesManager, WorkflowNodeEntity, WorkflowNodeJSON, WorkflowOperationBaseService, WorkflowOperationBaseServiceImpl, WorkflowPortEntity, WorkflowResetLayoutService, WorkflowSelectService, buildGroupJSON, fitView, getAntiOverlapPosition, getLineCenter, nanoid, useCurrentDomNode, useCurrentEntity, useNodeRender, usePlaygroundReadonlyState, useWorkflowDocument };