@flowgram.ai/free-layout-core 0.1.0-alpha.11 → 0.1.0-alpha.13

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 (35) hide show
  1. package/dist/esm/{chunk-CTGO4RKX.js → chunk-E7ZUQ7LV.js} +1 -1
  2. package/dist/esm/chunk-E7ZUQ7LV.js.map +1 -0
  3. package/dist/esm/{chunk-242F2JCI.js → chunk-U2XMPOSL.js} +2 -1
  4. package/dist/esm/{chunk-242F2JCI.js.map → chunk-U2XMPOSL.js.map} +1 -1
  5. package/dist/esm/index.js +294 -99
  6. package/dist/esm/index.js.map +1 -1
  7. package/dist/esm/typings/index.js +2 -2
  8. package/dist/esm/typings/workflow-json.js +1 -1
  9. package/dist/esm/typings/workflow-line.js +1 -1
  10. package/dist/index.d.mts +22 -9
  11. package/dist/index.d.ts +22 -9
  12. package/dist/index.js +313 -116
  13. package/dist/index.js.map +1 -1
  14. package/dist/typings/index.d.mts +1 -1
  15. package/dist/typings/index.d.ts +1 -1
  16. package/dist/typings/index.js +1 -0
  17. package/dist/typings/index.js.map +1 -1
  18. package/dist/typings/workflow-drag.d.mts +1 -1
  19. package/dist/typings/workflow-drag.d.ts +1 -1
  20. package/dist/typings/workflow-json.d.mts +1 -1
  21. package/dist/typings/workflow-json.d.ts +1 -1
  22. package/dist/typings/workflow-json.js +1 -0
  23. package/dist/typings/workflow-json.js.map +1 -1
  24. package/dist/typings/workflow-line.d.mts +1 -1
  25. package/dist/typings/workflow-line.d.ts +1 -1
  26. package/dist/typings/workflow-line.js.map +1 -1
  27. package/dist/typings/workflow-node.d.mts +1 -1
  28. package/dist/typings/workflow-node.d.ts +1 -1
  29. package/dist/typings/workflow-registry.d.mts +2 -1
  30. package/dist/typings/workflow-registry.d.ts +2 -1
  31. package/dist/typings/workflow-registry.js.map +1 -1
  32. package/dist/{workflow-line-entity-SJhFU8K_.d.mts → workflow-line-entity-DSC3qPV1.d.mts} +128 -39
  33. package/dist/{workflow-line-entity-Z4omkx2m.d.ts → workflow-line-entity-I_VrhJ_t.d.ts} +128 -39
  34. package/package.json +9 -9
  35. package/dist/esm/chunk-CTGO4RKX.js.map +0 -1
@@ -7,11 +7,11 @@ import "../chunk-TQLT57GW.js";
7
7
  import "../chunk-CGOMTQ3G.js";
8
8
  import {
9
9
  WorkflowContentChangeType
10
- } from "../chunk-242F2JCI.js";
10
+ } from "../chunk-U2XMPOSL.js";
11
11
  import {
12
12
  LineColors,
13
13
  LineType
14
- } from "../chunk-CTGO4RKX.js";
14
+ } from "../chunk-E7ZUQ7LV.js";
15
15
  import "../chunk-DDJTYHXN.js";
16
16
  import {
17
17
  WorkflowOperationBaseService
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  WorkflowContentChangeType
3
- } from "../chunk-242F2JCI.js";
3
+ } from "../chunk-U2XMPOSL.js";
4
4
  import "../chunk-EUXUH3YW.js";
5
5
  export {
6
6
  WorkflowContentChangeType
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  LineColors,
3
3
  LineType
4
- } from "../chunk-CTGO4RKX.js";
4
+ } from "../chunk-E7ZUQ7LV.js";
5
5
  import "../chunk-EUXUH3YW.js";
6
6
  export {
7
7
  LineColors,
package/dist/index.d.mts CHANGED
@@ -2,8 +2,8 @@ import { PlaygroundConfigEntity, CommandService, PlaygroundDragEvent, EntityData
2
2
  export { bindConfigEntity, useConfigEntity, useEntities, useEntityDataFromContext, useEntityFromContext, useListenEvents, usePlayground, usePlaygroundContainer, usePlaygroundContext, usePlaygroundLatest, 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 WorkflowPorts, i as WorkflowPortType, j as WorkflowPort, k as LineRenderType, l as WorkflowLineRenderContribution, m as LinePosition } from './workflow-line-entity-SJhFU8K_.mjs';
6
- export { K as HoverPosition, C as LINE_HOVER_DISTANCE, v as LineColor, w as LineColors, u as LineType, z as NodesDragEndEvent, y as NodesDragStartEvent, A as NodesDraggingEvent, P as POINT_RADIUS, H as PORT_SIZE, o as WORKFLOW_LINE_ENTITY, M as WorkfloEntityHoverable, s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, R as WorkflowDocumentOptionsDefault, Q as WorkflowDocumentProvider, J as WorkflowEntityHoverable, q as WorkflowJSON, E as WorkflowLineEntityOpts, F as WorkflowLineInfo, D as WorkflowLinePortInfo, x as WorkflowLineRenderContributionFactory, G as WorkflowLineUIState, t as WorkflowNodeMeta, I as WorkflowPortEntityOpts, p as domReactToBounds, n as getPortEntityId, B as onDragLineEndParams } from './workflow-line-entity-SJhFU8K_.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 WorkflowPortEntity, g as WorkflowLineEntity, O as OnDragLineEnd, h as WorkflowJSON, i as WorkflowPorts, j as WorkflowPortType, k as LinePoint, l as WorkflowPort, m as LineRenderType, n as WorkflowLineRenderContribution, o as LinePosition } from './workflow-line-entity-DSC3qPV1.mjs';
6
+ export { Q as HoverPosition, E as LINE_HOVER_DISTANCE, x as LineColor, y as LineColors, w as LinePointLocation, v as LineType, B as NodesDragEndEvent, A as NodesDragStartEvent, C as NodesDraggingEvent, P as POINT_RADIUS, J as PORT_SIZE, q as WORKFLOW_LINE_ENTITY, R as WorkfloEntityHoverable, t as WorkflowContentChangeEvent, s as WorkflowContentChangeType, T as WorkflowDocumentOptionsDefault, S as WorkflowDocumentProvider, M as WorkflowEntityHoverable, G as WorkflowLineEntityOpts, H as WorkflowLineInfo, F as WorkflowLinePortInfo, z as WorkflowLineRenderContributionFactory, I as WorkflowLineUIState, u as WorkflowNodeMeta, K as WorkflowPortEntityOpts, r as domReactToBounds, p as getPortEntityId, D as onDragLineEndParams } from './workflow-line-entity-DSC3qPV1.mjs';
7
7
  import { W as WorkflowNodeEntity } from './workflow-sub-canvas-IQzlYvPD.mjs';
8
8
  export { a as WorkflowSubCanvas } from './workflow-sub-canvas-IQzlYvPD.mjs';
9
9
  import * as _flowgram_ai_utils from '@flowgram.ai/utils';
@@ -323,6 +323,13 @@ declare function useWorkflowDocument(): WorkflowDocument;
323
323
  */
324
324
  declare function usePlaygroundReadonlyState(listenChange?: boolean): boolean;
325
325
 
326
+ /**
327
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
328
+ * SPDX-License-Identifier: MIT
329
+ */
330
+
331
+ declare const buildGroupJSON: (json: WorkflowJSON) => WorkflowJSON;
332
+
326
333
  /**
327
334
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
328
335
  * SPDX-License-Identifier: MIT
@@ -384,7 +391,12 @@ declare class WorkflowNodePortsData extends EntityData {
384
391
  constructor(entity: WorkflowNodeEntity);
385
392
  getDefaultData(): any;
386
393
  /**
387
- * 更新静态的 ports 数据
394
+ * Update all ports data, includes static ports and dynamic ports
395
+ * @param ports
396
+ */
397
+ updateAllPorts(ports?: WorkflowPorts): void;
398
+ /**
399
+ * @deprecated use `updateAllPorts` instead
388
400
  */
389
401
  updateStaticPorts(ports: WorkflowPorts): void;
390
402
  /**
@@ -398,7 +410,7 @@ declare class WorkflowNodePortsData extends EntityData {
398
410
  /**
399
411
  * 更新 ports 数据
400
412
  */
401
- updatePorts(ports: WorkflowPorts): void;
413
+ protected updatePorts(ports: WorkflowPorts): void;
402
414
  /**
403
415
  * 获取所有 port entities
404
416
  */
@@ -414,19 +426,19 @@ declare class WorkflowNodePortsData extends EntityData {
414
426
  /**
415
427
  * 获取输入点位置
416
428
  */
417
- get inputPoints(): IPoint[];
429
+ get inputPoints(): LinePoint[];
418
430
  /**
419
431
  * 获取输出点位置
420
432
  */
421
- get outputPoints(): IPoint[];
433
+ get outputPoints(): LinePoint[];
422
434
  /**
423
435
  * 根据 key 获取 输入点位置
424
436
  */
425
- getInputPoint(key?: string | number): IPoint;
437
+ getInputPoint(key?: string | number): LinePoint;
426
438
  /**
427
439
  * 根据 key 获取输出点位置
428
440
  */
429
- getOutputPoint(key?: string | number): IPoint;
441
+ getOutputPoint(key?: string | number): LinePoint;
430
442
  /**
431
443
  * 获取 port 实体
432
444
  */
@@ -474,6 +486,7 @@ declare class WorkflowNodeLinesData extends EntityData<WorkflowNodeLines> {
474
486
  * 输出线条
475
487
  */
476
488
  get outputLines(): WorkflowLineEntity[];
489
+ get allLines(): WorkflowLineEntity[];
477
490
  /**
478
491
  * 输入节点
479
492
  */
@@ -562,4 +575,4 @@ declare class WorkflowSimpleLineContribution implements WorkflowLineRenderContri
562
575
  private projectPointOnLine;
563
576
  }
564
577
 
565
- export { EditorCursorState, InteractiveType, LineEventProps, LinePosition, LineRenderType, NodePostionUpdateEvent, type NodeRenderReturnType, NodesDragEvent, OnDragLineEnd, type PositionMap, type StraightData, WorkflowCommands, WorkflowDocument, WorkflowDocumentContainerModule, WorkflowDocumentOptions, WorkflowDragService, WorkflowHoverService, WorkflowLineEntity, WorkflowLineRenderContribution, WorkflowLineRenderData, type WorkflowLineRenderDataSchema, WorkflowLinesManager, WorkflowNodeEntity, WorkflowNodeJSON, type WorkflowNodeLines, WorkflowNodeLinesData, WorkflowNodePortsData, WorkflowOperationBaseService, WorkflowOperationBaseServiceImpl, WorkflowPort, WorkflowPortEntity, WorkflowPortType, WorkflowPorts, WorkflowResetLayoutService, WorkflowSelectService, WorkflowSimpleLineContribution, fitView, getAntiOverlapPosition, nanoid, useCurrentDomNode, useCurrentEntity, useNodeRender, usePlaygroundReadonlyState, useWorkflowDocument };
578
+ export { EditorCursorState, InteractiveType, LineEventProps, LinePoint, LinePosition, LineRenderType, NodePostionUpdateEvent, type NodeRenderReturnType, NodesDragEvent, OnDragLineEnd, type PositionMap, type StraightData, 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, WorkflowSimpleLineContribution, buildGroupJSON, fitView, getAntiOverlapPosition, nanoid, useCurrentDomNode, useCurrentEntity, useNodeRender, usePlaygroundReadonlyState, useWorkflowDocument };
package/dist/index.d.ts CHANGED
@@ -2,8 +2,8 @@ import { PlaygroundConfigEntity, CommandService, PlaygroundDragEvent, EntityData
2
2
  export { bindConfigEntity, useConfigEntity, useEntities, useEntityDataFromContext, useEntityFromContext, useListenEvents, usePlayground, usePlaygroundContainer, usePlaygroundContext, usePlaygroundLatest, 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 WorkflowPorts, i as WorkflowPortType, j as WorkflowPort, k as LineRenderType, l as WorkflowLineRenderContribution, m as LinePosition } from './workflow-line-entity-Z4omkx2m.js';
6
- export { K as HoverPosition, C as LINE_HOVER_DISTANCE, v as LineColor, w as LineColors, u as LineType, z as NodesDragEndEvent, y as NodesDragStartEvent, A as NodesDraggingEvent, P as POINT_RADIUS, H as PORT_SIZE, o as WORKFLOW_LINE_ENTITY, M as WorkfloEntityHoverable, s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, R as WorkflowDocumentOptionsDefault, Q as WorkflowDocumentProvider, J as WorkflowEntityHoverable, q as WorkflowJSON, E as WorkflowLineEntityOpts, F as WorkflowLineInfo, D as WorkflowLinePortInfo, x as WorkflowLineRenderContributionFactory, G as WorkflowLineUIState, t as WorkflowNodeMeta, I as WorkflowPortEntityOpts, p as domReactToBounds, n as getPortEntityId, B as onDragLineEndParams } from './workflow-line-entity-Z4omkx2m.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 WorkflowPortEntity, g as WorkflowLineEntity, O as OnDragLineEnd, h as WorkflowJSON, i as WorkflowPorts, j as WorkflowPortType, k as LinePoint, l as WorkflowPort, m as LineRenderType, n as WorkflowLineRenderContribution, o as LinePosition } from './workflow-line-entity-I_VrhJ_t.js';
6
+ export { Q as HoverPosition, E as LINE_HOVER_DISTANCE, x as LineColor, y as LineColors, w as LinePointLocation, v as LineType, B as NodesDragEndEvent, A as NodesDragStartEvent, C as NodesDraggingEvent, P as POINT_RADIUS, J as PORT_SIZE, q as WORKFLOW_LINE_ENTITY, R as WorkfloEntityHoverable, t as WorkflowContentChangeEvent, s as WorkflowContentChangeType, T as WorkflowDocumentOptionsDefault, S as WorkflowDocumentProvider, M as WorkflowEntityHoverable, G as WorkflowLineEntityOpts, H as WorkflowLineInfo, F as WorkflowLinePortInfo, z as WorkflowLineRenderContributionFactory, I as WorkflowLineUIState, u as WorkflowNodeMeta, K as WorkflowPortEntityOpts, r as domReactToBounds, p as getPortEntityId, D as onDragLineEndParams } from './workflow-line-entity-I_VrhJ_t.js';
7
7
  import { W as WorkflowNodeEntity } from './workflow-sub-canvas-IQzlYvPD.js';
8
8
  export { a as WorkflowSubCanvas } from './workflow-sub-canvas-IQzlYvPD.js';
9
9
  import * as _flowgram_ai_utils from '@flowgram.ai/utils';
@@ -323,6 +323,13 @@ declare function useWorkflowDocument(): WorkflowDocument;
323
323
  */
324
324
  declare function usePlaygroundReadonlyState(listenChange?: boolean): boolean;
325
325
 
326
+ /**
327
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
328
+ * SPDX-License-Identifier: MIT
329
+ */
330
+
331
+ declare const buildGroupJSON: (json: WorkflowJSON) => WorkflowJSON;
332
+
326
333
  /**
327
334
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
328
335
  * SPDX-License-Identifier: MIT
@@ -384,7 +391,12 @@ declare class WorkflowNodePortsData extends EntityData {
384
391
  constructor(entity: WorkflowNodeEntity);
385
392
  getDefaultData(): any;
386
393
  /**
387
- * 更新静态的 ports 数据
394
+ * Update all ports data, includes static ports and dynamic ports
395
+ * @param ports
396
+ */
397
+ updateAllPorts(ports?: WorkflowPorts): void;
398
+ /**
399
+ * @deprecated use `updateAllPorts` instead
388
400
  */
389
401
  updateStaticPorts(ports: WorkflowPorts): void;
390
402
  /**
@@ -398,7 +410,7 @@ declare class WorkflowNodePortsData extends EntityData {
398
410
  /**
399
411
  * 更新 ports 数据
400
412
  */
401
- updatePorts(ports: WorkflowPorts): void;
413
+ protected updatePorts(ports: WorkflowPorts): void;
402
414
  /**
403
415
  * 获取所有 port entities
404
416
  */
@@ -414,19 +426,19 @@ declare class WorkflowNodePortsData extends EntityData {
414
426
  /**
415
427
  * 获取输入点位置
416
428
  */
417
- get inputPoints(): IPoint[];
429
+ get inputPoints(): LinePoint[];
418
430
  /**
419
431
  * 获取输出点位置
420
432
  */
421
- get outputPoints(): IPoint[];
433
+ get outputPoints(): LinePoint[];
422
434
  /**
423
435
  * 根据 key 获取 输入点位置
424
436
  */
425
- getInputPoint(key?: string | number): IPoint;
437
+ getInputPoint(key?: string | number): LinePoint;
426
438
  /**
427
439
  * 根据 key 获取输出点位置
428
440
  */
429
- getOutputPoint(key?: string | number): IPoint;
441
+ getOutputPoint(key?: string | number): LinePoint;
430
442
  /**
431
443
  * 获取 port 实体
432
444
  */
@@ -474,6 +486,7 @@ declare class WorkflowNodeLinesData extends EntityData<WorkflowNodeLines> {
474
486
  * 输出线条
475
487
  */
476
488
  get outputLines(): WorkflowLineEntity[];
489
+ get allLines(): WorkflowLineEntity[];
477
490
  /**
478
491
  * 输入节点
479
492
  */
@@ -562,4 +575,4 @@ declare class WorkflowSimpleLineContribution implements WorkflowLineRenderContri
562
575
  private projectPointOnLine;
563
576
  }
564
577
 
565
- export { EditorCursorState, InteractiveType, LineEventProps, LinePosition, LineRenderType, NodePostionUpdateEvent, type NodeRenderReturnType, NodesDragEvent, OnDragLineEnd, type PositionMap, type StraightData, WorkflowCommands, WorkflowDocument, WorkflowDocumentContainerModule, WorkflowDocumentOptions, WorkflowDragService, WorkflowHoverService, WorkflowLineEntity, WorkflowLineRenderContribution, WorkflowLineRenderData, type WorkflowLineRenderDataSchema, WorkflowLinesManager, WorkflowNodeEntity, WorkflowNodeJSON, type WorkflowNodeLines, WorkflowNodeLinesData, WorkflowNodePortsData, WorkflowOperationBaseService, WorkflowOperationBaseServiceImpl, WorkflowPort, WorkflowPortEntity, WorkflowPortType, WorkflowPorts, WorkflowResetLayoutService, WorkflowSelectService, WorkflowSimpleLineContribution, fitView, getAntiOverlapPosition, nanoid, useCurrentDomNode, useCurrentEntity, useNodeRender, usePlaygroundReadonlyState, useWorkflowDocument };
578
+ export { EditorCursorState, InteractiveType, LineEventProps, LinePoint, LinePosition, LineRenderType, NodePostionUpdateEvent, type NodeRenderReturnType, NodesDragEvent, OnDragLineEnd, type PositionMap, type StraightData, 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, WorkflowSimpleLineContribution, buildGroupJSON, fitView, getAntiOverlapPosition, nanoid, useCurrentDomNode, useCurrentEntity, useNodeRender, usePlaygroundReadonlyState, useWorkflowDocument };