@flowgram.ai/free-layout-core 0.4.3 → 0.4.5

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.
@@ -1,4 +1,4 @@
1
- export { x as LineColor, y as LineColors, L as LineEventProps, k as LinePoint, w as LinePointLocation, o as LinePosition, m as LineRenderType, v as LineType, B as NodesDragEndEvent, N as NodesDragEvent, A as NodesDragStartEvent, C as NodesDraggingEvent, O as OnDragLineEnd, t as WorkflowContentChangeEvent, s as WorkflowContentChangeType, h as WorkflowJSON, n as WorkflowLineRenderContribution, z as WorkflowLineRenderContributionFactory, e as WorkflowNodeJSON, u as WorkflowNodeMeta, D as onDragLineEndParams } from '../workflow-line-entity-CauIz5GH.mjs';
1
+ export { i as LineCenterPoint, y as LineColor, z as LineColors, L as LineEventProps, l as LinePoint, x as LinePointLocation, p as LinePosition, n as LineRenderType, w as LineType, C as NodesDragEndEvent, N as NodesDragEvent, B as NodesDragStartEvent, D as NodesDraggingEvent, O as OnDragLineEnd, u as WorkflowContentChangeEvent, t as WorkflowContentChangeType, h as WorkflowJSON, o as WorkflowLineRenderContribution, A as WorkflowLineRenderContributionFactory, e as WorkflowNodeJSON, v as WorkflowNodeMeta, E as onDragLineEndParams } from '../workflow-line-entity-CX-IYcAX.mjs';
2
2
  export { WorkflowEdgeJSON } from './workflow-edge.mjs';
3
3
  export { WorkflowNodeFormMeta, WorkflowNodeRegistry, WorkflowNodeRenderProps } from './workflow-registry.mjs';
4
4
  export { a as WorkflowSubCanvas } from '../workflow-sub-canvas-IQzlYvPD.mjs';
@@ -1,4 +1,4 @@
1
- export { x as LineColor, y as LineColors, L as LineEventProps, k as LinePoint, w as LinePointLocation, o as LinePosition, m as LineRenderType, v as LineType, B as NodesDragEndEvent, N as NodesDragEvent, A as NodesDragStartEvent, C as NodesDraggingEvent, O as OnDragLineEnd, t as WorkflowContentChangeEvent, s as WorkflowContentChangeType, h as WorkflowJSON, n as WorkflowLineRenderContribution, z as WorkflowLineRenderContributionFactory, e as WorkflowNodeJSON, u as WorkflowNodeMeta, D as onDragLineEndParams } from '../workflow-line-entity-DqPb9Odw.js';
1
+ export { i as LineCenterPoint, y as LineColor, z as LineColors, L as LineEventProps, l as LinePoint, x as LinePointLocation, p as LinePosition, n as LineRenderType, w as LineType, C as NodesDragEndEvent, N as NodesDragEvent, B as NodesDragStartEvent, D as NodesDraggingEvent, O as OnDragLineEnd, u as WorkflowContentChangeEvent, t as WorkflowContentChangeType, h as WorkflowJSON, o as WorkflowLineRenderContribution, A as WorkflowLineRenderContributionFactory, e as WorkflowNodeJSON, v as WorkflowNodeMeta, E as onDragLineEndParams } from '../workflow-line-entity-DEns_IoW.js';
2
2
  export { WorkflowEdgeJSON } from './workflow-edge.js';
3
3
  export { WorkflowNodeFormMeta, WorkflowNodeRegistry, WorkflowNodeRenderProps } from './workflow-registry.js';
4
4
  export { a as WorkflowSubCanvas } from '../workflow-sub-canvas-IQzlYvPD.js';
@@ -45,6 +45,7 @@ var WorkflowContentChangeType = /* @__PURE__ */ ((WorkflowContentChangeType2) =>
45
45
  var LineType = /* @__PURE__ */ ((LineType2) => {
46
46
  LineType2[LineType2["BEZIER"] = 0] = "BEZIER";
47
47
  LineType2[LineType2["LINE_CHART"] = 1] = "LINE_CHART";
48
+ LineType2[LineType2["STRAIGHT"] = 2] = "STRAIGHT";
48
49
  return LineType2;
49
50
  })(LineType || {});
50
51
  var LineColors = /* @__PURE__ */ ((LineColors2) => {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/typings/index.ts","../../src/typings/workflow-json.ts","../../src/typings/workflow-line.ts","../../src/typings/workflow-operation.ts"],"sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport * from './workflow-json';\nexport * from './workflow-edge';\nexport * from './workflow-node';\nexport * from './workflow-registry';\nexport * from './workflow-line';\nexport * from './workflow-sub-canvas';\nexport * from './workflow-operation';\nexport * from './workflow-drag';\n\nexport const URLParams = Symbol('');\n\nexport interface URLParams {\n [key: string]: string;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { type WorkflowLineEntity, type WorkflowNodeEntity } from '../entities';\nimport { type WorkflowNodeJSON } from './workflow-node';\nimport { type WorkflowEdgeJSON } from './workflow-edge';\n\nexport interface WorkflowJSON {\n nodes: WorkflowNodeJSON[];\n edges: WorkflowEdgeJSON[];\n}\n\nexport enum WorkflowContentChangeType {\n /**\n * 添加节点\n */\n ADD_NODE = 'ADD_NODE',\n /**\n * 删除节点\n */\n DELETE_NODE = 'DELETE_NODE',\n /**\n * 移动节点\n */\n MOVE_NODE = 'MOVE_NODE',\n /**\n * 节点数据更新 (表单引擎数据 或者 extInfo 数据)\n */\n NODE_DATA_CHANGE = 'NODE_DATA_CHANGE',\n /**\n * 添加线条\n */\n ADD_LINE = 'ADD_LINE',\n /**\n * 删除线条\n */\n DELETE_LINE = 'DELETE_LINE',\n /**\n * 线条数据修改\n */\n LINE_DATA_CHANGE = 'LINE_DATA_CHANGE',\n /**\n * 节点Meta信息变更\n */\n META_CHANGE = 'META_CHANGE',\n}\n\nexport interface WorkflowContentChangeEvent {\n type: WorkflowContentChangeType;\n /**\n * 当前触发的元素的json数据,toJSON 需要主动触发\n */\n toJSON: () => any;\n /**\n * oldValue\n */\n oldValue?: any;\n /*\n * 当前的事件的 entity\n */\n entity: WorkflowNodeEntity | WorkflowLineEntity;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport type { Rectangle, IPoint } from '@flowgram.ai/utils';\n\nimport { type WorkflowLineEntity } from '../entities';\n\nexport enum LineType {\n BEZIER, // 贝塞尔曲线\n LINE_CHART, // 折叠线\n}\n\nexport type LineRenderType = LineType | string;\n\nexport type LinePointLocation = 'left' | 'top' | 'right' | 'bottom';\n\nexport interface LinePoint {\n x: number;\n y: number;\n location: LinePointLocation;\n}\nexport interface LinePosition {\n from: LinePoint;\n to: LinePoint;\n}\n\nexport interface LineColor {\n hidden: string;\n default: string;\n drawing: string;\n hovered: string;\n selected: string;\n error: string;\n flowing: string;\n}\n\nexport enum LineColors {\n HIDDEN = 'var(--g-workflow-line-color-hidden,transparent)', // 隐藏线条\n DEFUALT = 'var(--g-workflow-line-color-default,#4d53e8)',\n DRAWING = 'var(--g-workflow-line-color-drawing, #5DD6E3)', // '#b5bbf8', // '#9197F1',\n HOVER = 'var(--g-workflow-line-color-hover,#37d0ff)',\n SELECTED = 'var(--g-workflow-line-color-selected,#37d0ff)',\n ERROR = 'var(--g-workflow-line-color-error,red)',\n FLOWING = 'var(--g-workflow-line-color-flowing,#4d53e8)', // 流动线条,默认使用主题色\n}\n\nexport interface WorkflowLineRenderContribution {\n entity: WorkflowLineEntity;\n path: string;\n bounds: Rectangle;\n update: (params: { fromPos: LinePoint; toPos: LinePoint }) => void;\n calcDistance: (pos: IPoint) => number;\n}\n\nexport type WorkflowLineRenderContributionFactory = (new (\n entity: WorkflowLineEntity\n) => WorkflowLineRenderContribution) & {\n type: LineRenderType;\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { IPoint, Event } from '@flowgram.ai/utils';\nimport {\n FlowNodeEntity,\n FlowNodeEntityOrId,\n FlowOperationBaseService,\n} from '@flowgram.ai/document';\n\nexport interface NodePostionUpdateEvent {\n node: FlowNodeEntity;\n oldPosition: IPoint;\n newPosition: IPoint;\n}\n\nexport interface WorkflowOperationBaseService extends FlowOperationBaseService {\n /**\n * 节点位置更新事件\n */\n readonly onNodePostionUpdate: Event<NodePostionUpdateEvent>;\n /**\n * 更新节点位置\n * @param nodeOrId\n * @param position\n * @returns\n */\n updateNodePosition(nodeOrId: FlowNodeEntityOrId, position: IPoint): void;\n}\n\nexport const WorkflowOperationBaseService = Symbol('WorkflowOperationBaseService');\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACcO,IAAK,4BAAL,kBAAKA,+BAAL;AAIL,EAAAA,2BAAA,cAAW;AAIX,EAAAA,2BAAA,iBAAc;AAId,EAAAA,2BAAA,eAAY;AAIZ,EAAAA,2BAAA,sBAAmB;AAInB,EAAAA,2BAAA,cAAW;AAIX,EAAAA,2BAAA,iBAAc;AAId,EAAAA,2BAAA,sBAAmB;AAInB,EAAAA,2BAAA,iBAAc;AAhCJ,SAAAA;AAAA,GAAA;;;ACLL,IAAK,WAAL,kBAAKC,cAAL;AACL,EAAAA,oBAAA;AACA,EAAAA,oBAAA;AAFU,SAAAA;AAAA,GAAA;AA6BL,IAAK,aAAL,kBAAKC,gBAAL;AACL,EAAAA,YAAA,YAAS;AACT,EAAAA,YAAA,aAAU;AACV,EAAAA,YAAA,aAAU;AACV,EAAAA,YAAA,WAAQ;AACR,EAAAA,YAAA,cAAW;AACX,EAAAA,YAAA,WAAQ;AACR,EAAAA,YAAA,aAAU;AAPA,SAAAA;AAAA,GAAA;;;ACNL,IAAM,+BAA+B,OAAO,8BAA8B;;;AHlB1E,IAAM,YAAY,OAAO,EAAE;","names":["WorkflowContentChangeType","LineType","LineColors"]}
1
+ {"version":3,"sources":["../../src/typings/index.ts","../../src/typings/workflow-json.ts","../../src/typings/workflow-line.ts","../../src/typings/workflow-operation.ts"],"sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport * from './workflow-json';\nexport * from './workflow-edge';\nexport * from './workflow-node';\nexport * from './workflow-registry';\nexport * from './workflow-line';\nexport * from './workflow-sub-canvas';\nexport * from './workflow-operation';\nexport * from './workflow-drag';\n\nexport const URLParams = Symbol('');\n\nexport interface URLParams {\n [key: string]: string;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { type WorkflowLineEntity, type WorkflowNodeEntity } from '../entities';\nimport { type WorkflowNodeJSON } from './workflow-node';\nimport { type WorkflowEdgeJSON } from './workflow-edge';\n\nexport interface WorkflowJSON {\n nodes: WorkflowNodeJSON[];\n edges: WorkflowEdgeJSON[];\n}\n\nexport enum WorkflowContentChangeType {\n /**\n * 添加节点\n */\n ADD_NODE = 'ADD_NODE',\n /**\n * 删除节点\n */\n DELETE_NODE = 'DELETE_NODE',\n /**\n * 移动节点\n */\n MOVE_NODE = 'MOVE_NODE',\n /**\n * 节点数据更新 (表单引擎数据 或者 extInfo 数据)\n */\n NODE_DATA_CHANGE = 'NODE_DATA_CHANGE',\n /**\n * 添加线条\n */\n ADD_LINE = 'ADD_LINE',\n /**\n * 删除线条\n */\n DELETE_LINE = 'DELETE_LINE',\n /**\n * 线条数据修改\n */\n LINE_DATA_CHANGE = 'LINE_DATA_CHANGE',\n /**\n * 节点Meta信息变更\n */\n META_CHANGE = 'META_CHANGE',\n}\n\nexport interface WorkflowContentChangeEvent {\n type: WorkflowContentChangeType;\n /**\n * 当前触发的元素的json数据,toJSON 需要主动触发\n */\n toJSON: () => any;\n /**\n * oldValue\n */\n oldValue?: any;\n /*\n * 当前的事件的 entity\n */\n entity: WorkflowNodeEntity | WorkflowLineEntity;\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport type { Rectangle, IPoint } from '@flowgram.ai/utils';\n\nimport { type WorkflowLineEntity } from '../entities';\n\nexport enum LineType {\n BEZIER, // 贝塞尔曲线\n LINE_CHART, // 折叠线\n STRAIGHT, // 直线\n}\n\nexport type LineRenderType = LineType | string;\n\nexport type LinePointLocation = 'left' | 'top' | 'right' | 'bottom';\n\nexport interface LinePoint {\n x: number;\n y: number;\n location: LinePointLocation;\n}\n\nexport interface LinePosition {\n from: LinePoint;\n to: LinePoint;\n}\n\nexport interface LineColor {\n hidden: string;\n default: string;\n drawing: string;\n hovered: string;\n selected: string;\n error: string;\n flowing: string;\n}\n\nexport enum LineColors {\n HIDDEN = 'var(--g-workflow-line-color-hidden,transparent)', // 隐藏线条\n DEFUALT = 'var(--g-workflow-line-color-default,#4d53e8)',\n DRAWING = 'var(--g-workflow-line-color-drawing, #5DD6E3)', // '#b5bbf8', // '#9197F1',\n HOVER = 'var(--g-workflow-line-color-hover,#37d0ff)',\n SELECTED = 'var(--g-workflow-line-color-selected,#37d0ff)',\n ERROR = 'var(--g-workflow-line-color-error,red)',\n FLOWING = 'var(--g-workflow-line-color-flowing,#4d53e8)', // 流动线条,默认使用主题色\n}\n\nexport interface LineCenterPoint {\n x: number;\n y: number;\n labelX: number; // Relative to where the line begins\n labelY: number; // Relative to where the line begins\n}\n\nexport interface WorkflowLineRenderContribution {\n entity: WorkflowLineEntity;\n path: string;\n center?: LineCenterPoint;\n bounds: Rectangle;\n update: (params: { fromPos: LinePoint; toPos: LinePoint }) => void;\n calcDistance: (pos: IPoint) => number;\n}\n\nexport type WorkflowLineRenderContributionFactory = (new (\n entity: WorkflowLineEntity\n) => WorkflowLineRenderContribution) & {\n type: LineRenderType;\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { IPoint, Event } from '@flowgram.ai/utils';\nimport {\n FlowNodeEntity,\n FlowNodeEntityOrId,\n FlowOperationBaseService,\n} from '@flowgram.ai/document';\n\nexport interface NodePostionUpdateEvent {\n node: FlowNodeEntity;\n oldPosition: IPoint;\n newPosition: IPoint;\n}\n\nexport interface WorkflowOperationBaseService extends FlowOperationBaseService {\n /**\n * 节点位置更新事件\n */\n readonly onNodePostionUpdate: Event<NodePostionUpdateEvent>;\n /**\n * 更新节点位置\n * @param nodeOrId\n * @param position\n * @returns\n */\n updateNodePosition(nodeOrId: FlowNodeEntityOrId, position: IPoint): void;\n}\n\nexport const WorkflowOperationBaseService = Symbol('WorkflowOperationBaseService');\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACcO,IAAK,4BAAL,kBAAKA,+BAAL;AAIL,EAAAA,2BAAA,cAAW;AAIX,EAAAA,2BAAA,iBAAc;AAId,EAAAA,2BAAA,eAAY;AAIZ,EAAAA,2BAAA,sBAAmB;AAInB,EAAAA,2BAAA,cAAW;AAIX,EAAAA,2BAAA,iBAAc;AAId,EAAAA,2BAAA,sBAAmB;AAInB,EAAAA,2BAAA,iBAAc;AAhCJ,SAAAA;AAAA,GAAA;;;ACLL,IAAK,WAAL,kBAAKC,cAAL;AACL,EAAAA,oBAAA;AACA,EAAAA,oBAAA;AACA,EAAAA,oBAAA;AAHU,SAAAA;AAAA,GAAA;AA+BL,IAAK,aAAL,kBAAKC,gBAAL;AACL,EAAAA,YAAA,YAAS;AACT,EAAAA,YAAA,aAAU;AACV,EAAAA,YAAA,aAAU;AACV,EAAAA,YAAA,WAAQ;AACR,EAAAA,YAAA,cAAW;AACX,EAAAA,YAAA,WAAQ;AACR,EAAAA,YAAA,aAAU;AAPA,SAAAA;AAAA,GAAA;;;ACRL,IAAM,+BAA+B,OAAO,8BAA8B;;;AHlB1E,IAAM,YAAY,OAAO,EAAE;","names":["WorkflowContentChangeType","LineType","LineColors"]}
@@ -2,7 +2,7 @@ import 'react';
2
2
  import '@flowgram.ai/utils';
3
3
  import '@flowgram.ai/document';
4
4
  import '@flowgram.ai/core';
5
- export { L as LineEventProps, B as NodesDragEndEvent, N as NodesDragEvent, A as NodesDragStartEvent, C as NodesDraggingEvent, O as OnDragLineEnd, D as onDragLineEndParams } from '../workflow-line-entity-CauIz5GH.mjs';
5
+ export { L as LineEventProps, C as NodesDragEndEvent, N as NodesDragEvent, B as NodesDragStartEvent, D as NodesDraggingEvent, O as OnDragLineEnd, E as onDragLineEndParams } from '../workflow-line-entity-CX-IYcAX.mjs';
6
6
  import '../workflow-sub-canvas-IQzlYvPD.mjs';
7
7
  import '@flowgram.ai/form-core';
8
8
  import './workflow-edge.mjs';
@@ -2,7 +2,7 @@ import 'react';
2
2
  import '@flowgram.ai/utils';
3
3
  import '@flowgram.ai/document';
4
4
  import '@flowgram.ai/core';
5
- export { L as LineEventProps, B as NodesDragEndEvent, N as NodesDragEvent, A as NodesDragStartEvent, C as NodesDraggingEvent, O as OnDragLineEnd, D as onDragLineEndParams } from '../workflow-line-entity-DqPb9Odw.js';
5
+ export { L as LineEventProps, C as NodesDragEndEvent, N as NodesDragEvent, B as NodesDragStartEvent, D as NodesDraggingEvent, O as OnDragLineEnd, E as onDragLineEndParams } from '../workflow-line-entity-DEns_IoW.js';
6
6
  import '../workflow-sub-canvas-IQzlYvPD.js';
7
7
  import '@flowgram.ai/form-core';
8
8
  import './workflow-edge.js';
@@ -1,5 +1,5 @@
1
1
  import '../workflow-sub-canvas-IQzlYvPD.mjs';
2
- export { t as WorkflowContentChangeEvent, s as WorkflowContentChangeType, h as WorkflowJSON } from '../workflow-line-entity-CauIz5GH.mjs';
2
+ export { u as WorkflowContentChangeEvent, t as WorkflowContentChangeType, h as WorkflowJSON } from '../workflow-line-entity-CX-IYcAX.mjs';
3
3
  import './workflow-edge.mjs';
4
4
  import '@flowgram.ai/document';
5
5
  import '@flowgram.ai/utils';
@@ -1,5 +1,5 @@
1
1
  import '../workflow-sub-canvas-IQzlYvPD.js';
2
- export { t as WorkflowContentChangeEvent, s as WorkflowContentChangeType, h as WorkflowJSON } from '../workflow-line-entity-DqPb9Odw.js';
2
+ export { u as WorkflowContentChangeEvent, t as WorkflowContentChangeType, h as WorkflowJSON } from '../workflow-line-entity-DEns_IoW.js';
3
3
  import './workflow-edge.js';
4
4
  import '@flowgram.ai/document';
5
5
  import '@flowgram.ai/utils';
@@ -1,5 +1,5 @@
1
1
  import '@flowgram.ai/utils';
2
- export { x as LineColor, y as LineColors, k as LinePoint, w as LinePointLocation, o as LinePosition, m as LineRenderType, v as LineType, n as WorkflowLineRenderContribution, z as WorkflowLineRenderContributionFactory } from '../workflow-line-entity-CauIz5GH.mjs';
2
+ export { i as LineCenterPoint, y as LineColor, z as LineColors, l as LinePoint, x as LinePointLocation, p as LinePosition, n as LineRenderType, w as LineType, o as WorkflowLineRenderContribution, A as WorkflowLineRenderContributionFactory } from '../workflow-line-entity-CX-IYcAX.mjs';
3
3
  import '@flowgram.ai/core';
4
4
  import '@flowgram.ai/document';
5
5
  import '../workflow-sub-canvas-IQzlYvPD.mjs';
@@ -1,5 +1,5 @@
1
1
  import '@flowgram.ai/utils';
2
- export { x as LineColor, y as LineColors, k as LinePoint, w as LinePointLocation, o as LinePosition, m as LineRenderType, v as LineType, n as WorkflowLineRenderContribution, z as WorkflowLineRenderContributionFactory } from '../workflow-line-entity-DqPb9Odw.js';
2
+ export { i as LineCenterPoint, y as LineColor, z as LineColors, l as LinePoint, x as LinePointLocation, p as LinePosition, n as LineRenderType, w as LineType, o as WorkflowLineRenderContribution, A as WorkflowLineRenderContributionFactory } from '../workflow-line-entity-DEns_IoW.js';
3
3
  import '@flowgram.ai/core';
4
4
  import '@flowgram.ai/document';
5
5
  import '../workflow-sub-canvas-IQzlYvPD.js';
@@ -27,6 +27,7 @@ module.exports = __toCommonJS(workflow_line_exports);
27
27
  var LineType = /* @__PURE__ */ ((LineType2) => {
28
28
  LineType2[LineType2["BEZIER"] = 0] = "BEZIER";
29
29
  LineType2[LineType2["LINE_CHART"] = 1] = "LINE_CHART";
30
+ LineType2[LineType2["STRAIGHT"] = 2] = "STRAIGHT";
30
31
  return LineType2;
31
32
  })(LineType || {});
32
33
  var LineColors = /* @__PURE__ */ ((LineColors2) => {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/typings/workflow-line.ts"],"sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport type { Rectangle, IPoint } from '@flowgram.ai/utils';\n\nimport { type WorkflowLineEntity } from '../entities';\n\nexport enum LineType {\n BEZIER, // 贝塞尔曲线\n LINE_CHART, // 折叠线\n}\n\nexport type LineRenderType = LineType | string;\n\nexport type LinePointLocation = 'left' | 'top' | 'right' | 'bottom';\n\nexport interface LinePoint {\n x: number;\n y: number;\n location: LinePointLocation;\n}\nexport interface LinePosition {\n from: LinePoint;\n to: LinePoint;\n}\n\nexport interface LineColor {\n hidden: string;\n default: string;\n drawing: string;\n hovered: string;\n selected: string;\n error: string;\n flowing: string;\n}\n\nexport enum LineColors {\n HIDDEN = 'var(--g-workflow-line-color-hidden,transparent)', // 隐藏线条\n DEFUALT = 'var(--g-workflow-line-color-default,#4d53e8)',\n DRAWING = 'var(--g-workflow-line-color-drawing, #5DD6E3)', // '#b5bbf8', // '#9197F1',\n HOVER = 'var(--g-workflow-line-color-hover,#37d0ff)',\n SELECTED = 'var(--g-workflow-line-color-selected,#37d0ff)',\n ERROR = 'var(--g-workflow-line-color-error,red)',\n FLOWING = 'var(--g-workflow-line-color-flowing,#4d53e8)', // 流动线条,默认使用主题色\n}\n\nexport interface WorkflowLineRenderContribution {\n entity: WorkflowLineEntity;\n path: string;\n bounds: Rectangle;\n update: (params: { fromPos: LinePoint; toPos: LinePoint }) => void;\n calcDistance: (pos: IPoint) => number;\n}\n\nexport type WorkflowLineRenderContributionFactory = (new (\n entity: WorkflowLineEntity\n) => WorkflowLineRenderContribution) & {\n type: LineRenderType;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASO,IAAK,WAAL,kBAAKA,cAAL;AACL,EAAAA,oBAAA;AACA,EAAAA,oBAAA;AAFU,SAAAA;AAAA,GAAA;AA6BL,IAAK,aAAL,kBAAKC,gBAAL;AACL,EAAAA,YAAA,YAAS;AACT,EAAAA,YAAA,aAAU;AACV,EAAAA,YAAA,aAAU;AACV,EAAAA,YAAA,WAAQ;AACR,EAAAA,YAAA,cAAW;AACX,EAAAA,YAAA,WAAQ;AACR,EAAAA,YAAA,aAAU;AAPA,SAAAA;AAAA,GAAA;","names":["LineType","LineColors"]}
1
+ {"version":3,"sources":["../../src/typings/workflow-line.ts"],"sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport type { Rectangle, IPoint } from '@flowgram.ai/utils';\n\nimport { type WorkflowLineEntity } from '../entities';\n\nexport enum LineType {\n BEZIER, // 贝塞尔曲线\n LINE_CHART, // 折叠线\n STRAIGHT, // 直线\n}\n\nexport type LineRenderType = LineType | string;\n\nexport type LinePointLocation = 'left' | 'top' | 'right' | 'bottom';\n\nexport interface LinePoint {\n x: number;\n y: number;\n location: LinePointLocation;\n}\n\nexport interface LinePosition {\n from: LinePoint;\n to: LinePoint;\n}\n\nexport interface LineColor {\n hidden: string;\n default: string;\n drawing: string;\n hovered: string;\n selected: string;\n error: string;\n flowing: string;\n}\n\nexport enum LineColors {\n HIDDEN = 'var(--g-workflow-line-color-hidden,transparent)', // 隐藏线条\n DEFUALT = 'var(--g-workflow-line-color-default,#4d53e8)',\n DRAWING = 'var(--g-workflow-line-color-drawing, #5DD6E3)', // '#b5bbf8', // '#9197F1',\n HOVER = 'var(--g-workflow-line-color-hover,#37d0ff)',\n SELECTED = 'var(--g-workflow-line-color-selected,#37d0ff)',\n ERROR = 'var(--g-workflow-line-color-error,red)',\n FLOWING = 'var(--g-workflow-line-color-flowing,#4d53e8)', // 流动线条,默认使用主题色\n}\n\nexport interface LineCenterPoint {\n x: number;\n y: number;\n labelX: number; // Relative to where the line begins\n labelY: number; // Relative to where the line begins\n}\n\nexport interface WorkflowLineRenderContribution {\n entity: WorkflowLineEntity;\n path: string;\n center?: LineCenterPoint;\n bounds: Rectangle;\n update: (params: { fromPos: LinePoint; toPos: LinePoint }) => void;\n calcDistance: (pos: IPoint) => number;\n}\n\nexport type WorkflowLineRenderContributionFactory = (new (\n entity: WorkflowLineEntity\n) => WorkflowLineRenderContribution) & {\n type: LineRenderType;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASO,IAAK,WAAL,kBAAKA,cAAL;AACL,EAAAA,oBAAA;AACA,EAAAA,oBAAA;AACA,EAAAA,oBAAA;AAHU,SAAAA;AAAA,GAAA;AA+BL,IAAK,aAAL,kBAAKC,gBAAL;AACL,EAAAA,YAAA,YAAS;AACT,EAAAA,YAAA,aAAU;AACV,EAAAA,YAAA,aAAU;AACV,EAAAA,YAAA,WAAQ;AACR,EAAAA,YAAA,cAAW;AACX,EAAAA,YAAA,WAAQ;AACR,EAAAA,YAAA,aAAU;AAPA,SAAAA;AAAA,GAAA;","names":["LineType","LineColors"]}
@@ -1,7 +1,7 @@
1
1
  import '@flowgram.ai/utils';
2
2
  import '@flowgram.ai/document';
3
3
  import '../workflow-sub-canvas-IQzlYvPD.mjs';
4
- export { e as WorkflowNodeJSON, u as WorkflowNodeMeta } from '../workflow-line-entity-CauIz5GH.mjs';
4
+ export { e as WorkflowNodeJSON, v as WorkflowNodeMeta } from '../workflow-line-entity-CX-IYcAX.mjs';
5
5
  import './workflow-edge.mjs';
6
6
  import '@flowgram.ai/core';
7
7
  import '@flowgram.ai/form-core';
@@ -1,7 +1,7 @@
1
1
  import '@flowgram.ai/utils';
2
2
  import '@flowgram.ai/document';
3
3
  import '../workflow-sub-canvas-IQzlYvPD.js';
4
- export { e as WorkflowNodeJSON, u as WorkflowNodeMeta } from '../workflow-line-entity-DqPb9Odw.js';
4
+ export { e as WorkflowNodeJSON, v as WorkflowNodeMeta } from '../workflow-line-entity-DEns_IoW.js';
5
5
  import './workflow-edge.js';
6
6
  import '@flowgram.ai/core';
7
7
  import '@flowgram.ai/form-core';
@@ -2,7 +2,7 @@ import { FormMeta } from '@flowgram.ai/node';
2
2
  import { FormMetaOrFormMetaGenerator } from '@flowgram.ai/form-core';
3
3
  import { FlowNodeRegistry } from '@flowgram.ai/document';
4
4
  import { W as WorkflowNodeEntity } from '../workflow-sub-canvas-IQzlYvPD.mjs';
5
- import { u as WorkflowNodeMeta, f as WorkflowPortEntity, b as WorkflowLinesManager } from '../workflow-line-entity-CauIz5GH.mjs';
5
+ import { v as WorkflowNodeMeta, f as WorkflowPortEntity, b as WorkflowLinesManager } from '../workflow-line-entity-CX-IYcAX.mjs';
6
6
  import '@flowgram.ai/utils';
7
7
  import '@flowgram.ai/core';
8
8
  import './workflow-edge.mjs';
@@ -2,7 +2,7 @@ import { FormMeta } from '@flowgram.ai/node';
2
2
  import { FormMetaOrFormMetaGenerator } from '@flowgram.ai/form-core';
3
3
  import { FlowNodeRegistry } from '@flowgram.ai/document';
4
4
  import { W as WorkflowNodeEntity } from '../workflow-sub-canvas-IQzlYvPD.js';
5
- import { u as WorkflowNodeMeta, f as WorkflowPortEntity, b as WorkflowLinesManager } from '../workflow-line-entity-DqPb9Odw.js';
5
+ import { v as WorkflowNodeMeta, f as WorkflowPortEntity, b as WorkflowLinesManager } from '../workflow-line-entity-DEns_IoW.js';
6
6
  import '@flowgram.ai/utils';
7
7
  import '@flowgram.ai/core';
8
8
  import './workflow-edge.js';
@@ -114,7 +114,8 @@ interface WorkflowContentChangeEvent {
114
114
 
115
115
  declare enum LineType {
116
116
  BEZIER = 0,// 贝塞尔曲线
117
- LINE_CHART = 1
117
+ LINE_CHART = 1,// 折叠线
118
+ STRAIGHT = 2
118
119
  }
119
120
  type LineRenderType = LineType | string;
120
121
  type LinePointLocation = 'left' | 'top' | 'right' | 'bottom';
@@ -145,9 +146,16 @@ declare enum LineColors {
145
146
  ERROR = "var(--g-workflow-line-color-error,red)",
146
147
  FLOWING = "var(--g-workflow-line-color-flowing,#4d53e8)"
147
148
  }
149
+ interface LineCenterPoint {
150
+ x: number;
151
+ y: number;
152
+ labelX: number;
153
+ labelY: number;
154
+ }
148
155
  interface WorkflowLineRenderContribution {
149
156
  entity: WorkflowLineEntity;
150
157
  path: string;
158
+ center?: LineCenterPoint;
151
159
  bounds: Rectangle;
152
160
  update: (params: {
153
161
  fromPos: LinePoint;
@@ -875,6 +883,7 @@ declare class WorkflowLineEntity extends Entity<WorkflowLineEntityOpts> {
875
883
  * 获取线条的边框位置大小
876
884
  */
877
885
  get bounds(): Rectangle;
886
+ get center(): LineCenterPoint;
878
887
  /**
879
888
  * 获取点和线最接近的距离
880
889
  */
@@ -920,4 +929,4 @@ declare class WorkflowLineEntity extends Entity<WorkflowLineEntityOpts> {
920
929
  fireRender(): void;
921
930
  }
922
931
 
923
- export { type NodesDragStartEvent as A, type NodesDragEndEvent as B, type NodesDraggingEvent as C, type onDragLineEndParams as D, LINE_HOVER_DISTANCE as E, type WorkflowLinePortInfo as F, type WorkflowLineEntityOpts as G, type WorkflowLineInfo as H, type WorkflowLineUIState as I, PORT_SIZE as J, type WorkflowPortEntityOpts as K, type LineEventProps as L, type WorkflowEntityHoverable as M, type NodesDragEvent as N, type OnDragLineEnd as O, POINT_RADIUS as P, type HoverPosition as Q, type WorkfloEntityHoverable as R, WorkflowDocumentProvider as S, WorkflowDocumentOptionsDefault as T, WorkflowHoverService as W, WorkflowDocument as a, WorkflowLinesManager as b, WorkflowSelectService as c, WorkflowDocumentOptions as d, type WorkflowNodeJSON as e, WorkflowPortEntity as f, WorkflowLineEntity as g, type WorkflowJSON as h, type WorkflowPorts as i, type WorkflowPortType as j, type LinePoint as k, type WorkflowPort as l, type LineRenderType as m, type WorkflowLineRenderContribution as n, type LinePosition as o, getPortEntityId as p, WORKFLOW_LINE_ENTITY as q, domReactToBounds as r, WorkflowContentChangeType as s, type WorkflowContentChangeEvent as t, type WorkflowNodeMeta as u, LineType as v, type LinePointLocation as w, type LineColor as x, LineColors as y, type WorkflowLineRenderContributionFactory as z };
932
+ export { type WorkflowLineRenderContributionFactory as A, type NodesDragStartEvent as B, type NodesDragEndEvent as C, type NodesDraggingEvent as D, type onDragLineEndParams as E, LINE_HOVER_DISTANCE as F, type WorkflowLinePortInfo as G, type WorkflowLineEntityOpts as H, type WorkflowLineInfo as I, type WorkflowLineUIState as J, PORT_SIZE as K, type LineEventProps as L, type WorkflowPortEntityOpts as M, type NodesDragEvent as N, type OnDragLineEnd as O, POINT_RADIUS as P, type WorkflowEntityHoverable as Q, type HoverPosition as R, type WorkfloEntityHoverable as S, WorkflowDocumentProvider as T, WorkflowDocumentOptionsDefault as U, WorkflowHoverService as W, WorkflowDocument as a, WorkflowLinesManager as b, WorkflowSelectService as c, WorkflowDocumentOptions as d, type WorkflowNodeJSON as e, WorkflowPortEntity as f, WorkflowLineEntity as g, type WorkflowJSON as h, type LineCenterPoint as i, type WorkflowPorts as j, type WorkflowPortType as k, type LinePoint as l, type WorkflowPort as m, type LineRenderType as n, type WorkflowLineRenderContribution as o, type LinePosition as p, getPortEntityId as q, WORKFLOW_LINE_ENTITY as r, domReactToBounds as s, WorkflowContentChangeType as t, type WorkflowContentChangeEvent as u, type WorkflowNodeMeta as v, LineType as w, type LinePointLocation as x, type LineColor as y, LineColors as z };
@@ -114,7 +114,8 @@ interface WorkflowContentChangeEvent {
114
114
 
115
115
  declare enum LineType {
116
116
  BEZIER = 0,// 贝塞尔曲线
117
- LINE_CHART = 1
117
+ LINE_CHART = 1,// 折叠线
118
+ STRAIGHT = 2
118
119
  }
119
120
  type LineRenderType = LineType | string;
120
121
  type LinePointLocation = 'left' | 'top' | 'right' | 'bottom';
@@ -145,9 +146,16 @@ declare enum LineColors {
145
146
  ERROR = "var(--g-workflow-line-color-error,red)",
146
147
  FLOWING = "var(--g-workflow-line-color-flowing,#4d53e8)"
147
148
  }
149
+ interface LineCenterPoint {
150
+ x: number;
151
+ y: number;
152
+ labelX: number;
153
+ labelY: number;
154
+ }
148
155
  interface WorkflowLineRenderContribution {
149
156
  entity: WorkflowLineEntity;
150
157
  path: string;
158
+ center?: LineCenterPoint;
151
159
  bounds: Rectangle;
152
160
  update: (params: {
153
161
  fromPos: LinePoint;
@@ -875,6 +883,7 @@ declare class WorkflowLineEntity extends Entity<WorkflowLineEntityOpts> {
875
883
  * 获取线条的边框位置大小
876
884
  */
877
885
  get bounds(): Rectangle;
886
+ get center(): LineCenterPoint;
878
887
  /**
879
888
  * 获取点和线最接近的距离
880
889
  */
@@ -920,4 +929,4 @@ declare class WorkflowLineEntity extends Entity<WorkflowLineEntityOpts> {
920
929
  fireRender(): void;
921
930
  }
922
931
 
923
- export { type NodesDragStartEvent as A, type NodesDragEndEvent as B, type NodesDraggingEvent as C, type onDragLineEndParams as D, LINE_HOVER_DISTANCE as E, type WorkflowLinePortInfo as F, type WorkflowLineEntityOpts as G, type WorkflowLineInfo as H, type WorkflowLineUIState as I, PORT_SIZE as J, type WorkflowPortEntityOpts as K, type LineEventProps as L, type WorkflowEntityHoverable as M, type NodesDragEvent as N, type OnDragLineEnd as O, POINT_RADIUS as P, type HoverPosition as Q, type WorkfloEntityHoverable as R, WorkflowDocumentProvider as S, WorkflowDocumentOptionsDefault as T, WorkflowHoverService as W, WorkflowDocument as a, WorkflowLinesManager as b, WorkflowSelectService as c, WorkflowDocumentOptions as d, type WorkflowNodeJSON as e, WorkflowPortEntity as f, WorkflowLineEntity as g, type WorkflowJSON as h, type WorkflowPorts as i, type WorkflowPortType as j, type LinePoint as k, type WorkflowPort as l, type LineRenderType as m, type WorkflowLineRenderContribution as n, type LinePosition as o, getPortEntityId as p, WORKFLOW_LINE_ENTITY as q, domReactToBounds as r, WorkflowContentChangeType as s, type WorkflowContentChangeEvent as t, type WorkflowNodeMeta as u, LineType as v, type LinePointLocation as w, type LineColor as x, LineColors as y, type WorkflowLineRenderContributionFactory as z };
932
+ export { type WorkflowLineRenderContributionFactory as A, type NodesDragStartEvent as B, type NodesDragEndEvent as C, type NodesDraggingEvent as D, type onDragLineEndParams as E, LINE_HOVER_DISTANCE as F, type WorkflowLinePortInfo as G, type WorkflowLineEntityOpts as H, type WorkflowLineInfo as I, type WorkflowLineUIState as J, PORT_SIZE as K, type LineEventProps as L, type WorkflowPortEntityOpts as M, type NodesDragEvent as N, type OnDragLineEnd as O, POINT_RADIUS as P, type WorkflowEntityHoverable as Q, type HoverPosition as R, type WorkfloEntityHoverable as S, WorkflowDocumentProvider as T, WorkflowDocumentOptionsDefault as U, WorkflowHoverService as W, WorkflowDocument as a, WorkflowLinesManager as b, WorkflowSelectService as c, WorkflowDocumentOptions as d, type WorkflowNodeJSON as e, WorkflowPortEntity as f, WorkflowLineEntity as g, type WorkflowJSON as h, type LineCenterPoint as i, type WorkflowPorts as j, type WorkflowPortType as k, type LinePoint as l, type WorkflowPort as m, type LineRenderType as n, type WorkflowLineRenderContribution as o, type LinePosition as p, getPortEntityId as q, WORKFLOW_LINE_ENTITY as r, domReactToBounds as s, WorkflowContentChangeType as t, type WorkflowContentChangeEvent as u, type WorkflowNodeMeta as v, LineType as w, type LinePointLocation as x, type LineColor as y, LineColors as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowgram.ai/free-layout-core",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "homepage": "https://flowgram.ai/",
5
5
  "repository": "https://github.com/bytedance/flowgram.ai",
6
6
  "license": "MIT",
@@ -34,12 +34,12 @@
34
34
  "reflect-metadata": "~0.2.2",
35
35
  "lodash-es": "^4.17.21",
36
36
  "nanoid": "^4.0.2",
37
- "@flowgram.ai/core": "0.4.3",
38
- "@flowgram.ai/document": "0.4.3",
39
- "@flowgram.ai/node": "0.4.3",
40
- "@flowgram.ai/form-core": "0.4.3",
41
- "@flowgram.ai/utils": "0.4.3",
42
- "@flowgram.ai/reactive": "0.4.3"
37
+ "@flowgram.ai/core": "0.4.5",
38
+ "@flowgram.ai/document": "0.4.5",
39
+ "@flowgram.ai/form-core": "0.4.5",
40
+ "@flowgram.ai/node": "0.4.5",
41
+ "@flowgram.ai/utils": "0.4.5",
42
+ "@flowgram.ai/reactive": "0.4.5"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@testing-library/react": "^12",
@@ -53,8 +53,8 @@
53
53
  "tsup": "^8.0.1",
54
54
  "typescript": "^5.8.3",
55
55
  "vitest": "^0.34.6",
56
- "@flowgram.ai/eslint-config": "0.4.3",
57
- "@flowgram.ai/ts-config": "0.4.3"
56
+ "@flowgram.ai/eslint-config": "0.4.5",
57
+ "@flowgram.ai/ts-config": "0.4.5"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "react": ">=16.8",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/typings/workflow-line.ts"],"sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport type { Rectangle, IPoint } from '@flowgram.ai/utils';\n\nimport { type WorkflowLineEntity } from '../entities';\n\nexport enum LineType {\n BEZIER, // 贝塞尔曲线\n LINE_CHART, // 折叠线\n}\n\nexport type LineRenderType = LineType | string;\n\nexport type LinePointLocation = 'left' | 'top' | 'right' | 'bottom';\n\nexport interface LinePoint {\n x: number;\n y: number;\n location: LinePointLocation;\n}\nexport interface LinePosition {\n from: LinePoint;\n to: LinePoint;\n}\n\nexport interface LineColor {\n hidden: string;\n default: string;\n drawing: string;\n hovered: string;\n selected: string;\n error: string;\n flowing: string;\n}\n\nexport enum LineColors {\n HIDDEN = 'var(--g-workflow-line-color-hidden,transparent)', // 隐藏线条\n DEFUALT = 'var(--g-workflow-line-color-default,#4d53e8)',\n DRAWING = 'var(--g-workflow-line-color-drawing, #5DD6E3)', // '#b5bbf8', // '#9197F1',\n HOVER = 'var(--g-workflow-line-color-hover,#37d0ff)',\n SELECTED = 'var(--g-workflow-line-color-selected,#37d0ff)',\n ERROR = 'var(--g-workflow-line-color-error,red)',\n FLOWING = 'var(--g-workflow-line-color-flowing,#4d53e8)', // 流动线条,默认使用主题色\n}\n\nexport interface WorkflowLineRenderContribution {\n entity: WorkflowLineEntity;\n path: string;\n bounds: Rectangle;\n update: (params: { fromPos: LinePoint; toPos: LinePoint }) => void;\n calcDistance: (pos: IPoint) => number;\n}\n\nexport type WorkflowLineRenderContributionFactory = (new (\n entity: WorkflowLineEntity\n) => WorkflowLineRenderContribution) & {\n type: LineRenderType;\n};\n"],"mappings":";AASO,IAAK,WAAL,kBAAKA,cAAL;AACL,EAAAA,oBAAA;AACA,EAAAA,oBAAA;AAFU,SAAAA;AAAA,GAAA;AA6BL,IAAK,aAAL,kBAAKC,gBAAL;AACL,EAAAA,YAAA,YAAS;AACT,EAAAA,YAAA,aAAU;AACV,EAAAA,YAAA,aAAU;AACV,EAAAA,YAAA,WAAQ;AACR,EAAAA,YAAA,cAAW;AACX,EAAAA,YAAA,WAAQ;AACR,EAAAA,YAAA,aAAU;AAPA,SAAAA;AAAA,GAAA;","names":["LineType","LineColors"]}