@flowgram.ai/free-layout-core 0.5.1 → 0.5.3
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/{chunk-O4WKIIW2.js → chunk-3UW6BHP2.js} +1 -1
- package/dist/esm/chunk-3UW6BHP2.js.map +1 -0
- package/dist/esm/index.js +111 -31
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/typings/index.js +1 -1
- package/dist/esm/typings/workflow-operation.js +1 -1
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +110 -30
- package/dist/index.js.map +1 -1
- package/dist/typings/index.d.mts +1 -1
- package/dist/typings/index.d.ts +1 -1
- package/dist/typings/index.js.map +1 -1
- package/dist/typings/workflow-drag.d.mts +1 -1
- package/dist/typings/workflow-drag.d.ts +1 -1
- package/dist/typings/workflow-json.d.mts +1 -1
- package/dist/typings/workflow-json.d.ts +1 -1
- package/dist/typings/workflow-line.d.mts +1 -1
- package/dist/typings/workflow-line.d.ts +1 -1
- package/dist/typings/workflow-node.d.mts +1 -1
- package/dist/typings/workflow-node.d.ts +1 -1
- package/dist/typings/workflow-operation.d.mts +9 -0
- package/dist/typings/workflow-operation.d.ts +9 -0
- package/dist/typings/workflow-operation.js.map +1 -1
- package/dist/typings/workflow-registry.d.mts +1 -1
- package/dist/typings/workflow-registry.d.ts +1 -1
- package/dist/typings/workflow-sub-canvas.d.mts +1 -1
- package/dist/typings/workflow-sub-canvas.d.ts +1 -1
- package/dist/{workflow-node-entity-lKu00Aj4.d.mts → workflow-node-entity-DgQT-wl9.d.mts} +16 -3
- package/dist/{workflow-node-entity-Cnte2phX.d.ts → workflow-node-entity-kGsp2Roz.d.ts} +16 -3
- package/package.json +9 -9
- package/dist/esm/chunk-O4WKIIW2.js.map +0 -1
package/dist/typings/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { L as LineCenterPoint, x as LineColor, y as LineColors, g as LineEventProps, w as LinePoint, v as LinePointLocation, m as LinePosition, k as LineRenderType, u as LineType, C as NodesDragEndEvent, N as NodesDragEvent, B as NodesDragStartEvent, D as NodesDraggingEvent, O as OnDragLineEnd, s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, W as WorkflowJSON, l as WorkflowLineRenderContribution, z as WorkflowLineRenderContributionFactory, h as WorkflowNodeJSON, t as WorkflowNodeMeta, A as WorkflowSubCanvas, E as onDragLineEndParams } from '../workflow-node-entity-
|
|
1
|
+
export { L as LineCenterPoint, x as LineColor, y as LineColors, g as LineEventProps, w as LinePoint, v as LinePointLocation, m as LinePosition, k as LineRenderType, u as LineType, C as NodesDragEndEvent, N as NodesDragEvent, B as NodesDragStartEvent, D as NodesDraggingEvent, O as OnDragLineEnd, s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, W as WorkflowJSON, l as WorkflowLineRenderContribution, z as WorkflowLineRenderContributionFactory, h as WorkflowNodeJSON, t as WorkflowNodeMeta, A as WorkflowSubCanvas, E as onDragLineEndParams } from '../workflow-node-entity-DgQT-wl9.mjs';
|
|
2
2
|
export { WorkflowEdgeJSON } from './workflow-edge.mjs';
|
|
3
3
|
export { WorkflowNodeFormMeta, WorkflowNodeRegistry, WorkflowNodeRenderProps } from './workflow-registry.mjs';
|
|
4
4
|
export { NodePostionUpdateEvent, WorkflowOperationBaseService } from './workflow-operation.mjs';
|
package/dist/typings/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { L as LineCenterPoint, x as LineColor, y as LineColors, g as LineEventProps, w as LinePoint, v as LinePointLocation, m as LinePosition, k as LineRenderType, u as LineType, C as NodesDragEndEvent, N as NodesDragEvent, B as NodesDragStartEvent, D as NodesDraggingEvent, O as OnDragLineEnd, s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, W as WorkflowJSON, l as WorkflowLineRenderContribution, z as WorkflowLineRenderContributionFactory, h as WorkflowNodeJSON, t as WorkflowNodeMeta, A as WorkflowSubCanvas, E as onDragLineEndParams } from '../workflow-node-entity-
|
|
1
|
+
export { L as LineCenterPoint, x as LineColor, y as LineColors, g as LineEventProps, w as LinePoint, v as LinePointLocation, m as LinePosition, k as LineRenderType, u as LineType, C as NodesDragEndEvent, N as NodesDragEvent, B as NodesDragStartEvent, D as NodesDraggingEvent, O as OnDragLineEnd, s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, W as WorkflowJSON, l as WorkflowLineRenderContribution, z as WorkflowLineRenderContributionFactory, h as WorkflowNodeJSON, t as WorkflowNodeMeta, A as WorkflowSubCanvas, E as onDragLineEndParams } from '../workflow-node-entity-kGsp2Roz.js';
|
|
2
2
|
export { WorkflowEdgeJSON } from './workflow-edge.js';
|
|
3
3
|
export { WorkflowNodeFormMeta, WorkflowNodeRegistry, WorkflowNodeRenderProps } from './workflow-registry.js';
|
|
4
4
|
export { NodePostionUpdateEvent, WorkflowOperationBaseService } from './workflow-operation.js';
|
|
@@ -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 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;;;
|
|
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\nimport { WorkflowJSON } from './workflow-json';\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 /**\n * 更新节点与线条\n */\n fromJSON(json: WorkflowJSON): 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;;;ACDL,IAAM,+BAA+B,OAAO,8BAA8B;;;AHzB1E,IAAM,YAAY,OAAO,EAAE;","names":["WorkflowContentChangeType","LineType","LineColors"]}
|
|
@@ -2,6 +2,6 @@ import 'react';
|
|
|
2
2
|
import '@flowgram.ai/utils';
|
|
3
3
|
import '@flowgram.ai/document';
|
|
4
4
|
import '@flowgram.ai/core';
|
|
5
|
-
export { g as LineEventProps, C as NodesDragEndEvent, N as NodesDragEvent, B as NodesDragStartEvent, D as NodesDraggingEvent, O as OnDragLineEnd, E as onDragLineEndParams } from '../workflow-node-entity-
|
|
5
|
+
export { g as LineEventProps, C as NodesDragEndEvent, N as NodesDragEvent, B as NodesDragStartEvent, D as NodesDraggingEvent, O as OnDragLineEnd, E as onDragLineEndParams } from '../workflow-node-entity-DgQT-wl9.mjs';
|
|
6
6
|
import '@flowgram.ai/form-core';
|
|
7
7
|
import './workflow-edge.mjs';
|
|
@@ -2,6 +2,6 @@ import 'react';
|
|
|
2
2
|
import '@flowgram.ai/utils';
|
|
3
3
|
import '@flowgram.ai/document';
|
|
4
4
|
import '@flowgram.ai/core';
|
|
5
|
-
export { g as LineEventProps, C as NodesDragEndEvent, N as NodesDragEvent, B as NodesDragStartEvent, D as NodesDraggingEvent, O as OnDragLineEnd, E as onDragLineEndParams } from '../workflow-node-entity-
|
|
5
|
+
export { g as LineEventProps, C as NodesDragEndEvent, N as NodesDragEvent, B as NodesDragStartEvent, D as NodesDraggingEvent, O as OnDragLineEnd, E as onDragLineEndParams } from '../workflow-node-entity-kGsp2Roz.js';
|
|
6
6
|
import '@flowgram.ai/form-core';
|
|
7
7
|
import './workflow-edge.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, W as WorkflowJSON } from '../workflow-node-entity-
|
|
1
|
+
export { s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, W as WorkflowJSON } from '../workflow-node-entity-DgQT-wl9.mjs';
|
|
2
2
|
import './workflow-edge.mjs';
|
|
3
3
|
import '@flowgram.ai/document';
|
|
4
4
|
import '@flowgram.ai/core';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, W as WorkflowJSON } from '../workflow-node-entity-
|
|
1
|
+
export { s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, W as WorkflowJSON } from '../workflow-node-entity-kGsp2Roz.js';
|
|
2
2
|
import './workflow-edge.js';
|
|
3
3
|
import '@flowgram.ai/document';
|
|
4
4
|
import '@flowgram.ai/core';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@flowgram.ai/utils';
|
|
2
|
-
export { L as LineCenterPoint, x as LineColor, y as LineColors, w as LinePoint, v as LinePointLocation, m as LinePosition, k as LineRenderType, u as LineType, l as WorkflowLineRenderContribution, z as WorkflowLineRenderContributionFactory } from '../workflow-node-entity-
|
|
2
|
+
export { L as LineCenterPoint, x as LineColor, y as LineColors, w as LinePoint, v as LinePointLocation, m as LinePosition, k as LineRenderType, u as LineType, l as WorkflowLineRenderContribution, z as WorkflowLineRenderContributionFactory } from '../workflow-node-entity-DgQT-wl9.mjs';
|
|
3
3
|
import '@flowgram.ai/document';
|
|
4
4
|
import '@flowgram.ai/core';
|
|
5
5
|
import 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@flowgram.ai/utils';
|
|
2
|
-
export { L as LineCenterPoint, x as LineColor, y as LineColors, w as LinePoint, v as LinePointLocation, m as LinePosition, k as LineRenderType, u as LineType, l as WorkflowLineRenderContribution, z as WorkflowLineRenderContributionFactory } from '../workflow-node-entity-
|
|
2
|
+
export { L as LineCenterPoint, x as LineColor, y as LineColors, w as LinePoint, v as LinePointLocation, m as LinePosition, k as LineRenderType, u as LineType, l as WorkflowLineRenderContribution, z as WorkflowLineRenderContributionFactory } from '../workflow-node-entity-kGsp2Roz.js';
|
|
3
3
|
import '@flowgram.ai/document';
|
|
4
4
|
import '@flowgram.ai/core';
|
|
5
5
|
import 'react';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@flowgram.ai/utils';
|
|
2
2
|
import '@flowgram.ai/document';
|
|
3
|
-
export { h as WorkflowNodeJSON, t as WorkflowNodeMeta } from '../workflow-node-entity-
|
|
3
|
+
export { h as WorkflowNodeJSON, t as WorkflowNodeMeta } from '../workflow-node-entity-DgQT-wl9.mjs';
|
|
4
4
|
import './workflow-edge.mjs';
|
|
5
5
|
import '@flowgram.ai/core';
|
|
6
6
|
import 'react';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@flowgram.ai/utils';
|
|
2
2
|
import '@flowgram.ai/document';
|
|
3
|
-
export { h as WorkflowNodeJSON, t as WorkflowNodeMeta } from '../workflow-node-entity-
|
|
3
|
+
export { h as WorkflowNodeJSON, t as WorkflowNodeMeta } from '../workflow-node-entity-kGsp2Roz.js';
|
|
4
4
|
import './workflow-edge.js';
|
|
5
5
|
import '@flowgram.ai/core';
|
|
6
6
|
import 'react';
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { IPoint, Event } from '@flowgram.ai/utils';
|
|
2
2
|
import { FlowNodeEntity, FlowOperationBaseService, FlowNodeEntityOrId } from '@flowgram.ai/document';
|
|
3
|
+
import { W as WorkflowJSON } from '../workflow-node-entity-DgQT-wl9.mjs';
|
|
4
|
+
import '@flowgram.ai/core';
|
|
5
|
+
import 'react';
|
|
6
|
+
import '@flowgram.ai/form-core';
|
|
7
|
+
import './workflow-edge.mjs';
|
|
3
8
|
|
|
4
9
|
/**
|
|
5
10
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
@@ -23,6 +28,10 @@ interface WorkflowOperationBaseService extends FlowOperationBaseService {
|
|
|
23
28
|
* @returns
|
|
24
29
|
*/
|
|
25
30
|
updateNodePosition(nodeOrId: FlowNodeEntityOrId, position: IPoint): void;
|
|
31
|
+
/**
|
|
32
|
+
* 更新节点与线条
|
|
33
|
+
*/
|
|
34
|
+
fromJSON(json: WorkflowJSON): void;
|
|
26
35
|
}
|
|
27
36
|
declare const WorkflowOperationBaseService: unique symbol;
|
|
28
37
|
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { IPoint, Event } from '@flowgram.ai/utils';
|
|
2
2
|
import { FlowNodeEntity, FlowOperationBaseService, FlowNodeEntityOrId } from '@flowgram.ai/document';
|
|
3
|
+
import { W as WorkflowJSON } from '../workflow-node-entity-kGsp2Roz.js';
|
|
4
|
+
import '@flowgram.ai/core';
|
|
5
|
+
import 'react';
|
|
6
|
+
import '@flowgram.ai/form-core';
|
|
7
|
+
import './workflow-edge.js';
|
|
3
8
|
|
|
4
9
|
/**
|
|
5
10
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
@@ -23,6 +28,10 @@ interface WorkflowOperationBaseService extends FlowOperationBaseService {
|
|
|
23
28
|
* @returns
|
|
24
29
|
*/
|
|
25
30
|
updateNodePosition(nodeOrId: FlowNodeEntityOrId, position: IPoint): void;
|
|
31
|
+
/**
|
|
32
|
+
* 更新节点与线条
|
|
33
|
+
*/
|
|
34
|
+
fromJSON(json: WorkflowJSON): void;
|
|
26
35
|
}
|
|
27
36
|
declare const WorkflowOperationBaseService: unique symbol;
|
|
28
37
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/typings/workflow-operation.ts"],"sourcesContent":["/**\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;
|
|
1
|
+
{"version":3,"sources":["../../src/typings/workflow-operation.ts"],"sourcesContent":["/**\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\nimport { WorkflowJSON } from './workflow-json';\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 /**\n * 更新节点与线条\n */\n fromJSON(json: WorkflowJSON): void;\n}\n\nexport const WorkflowOperationBaseService = Symbol('WorkflowOperationBaseService');\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuCO,IAAM,+BAA+B,OAAO,8BAA8B;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FormMeta } from '@flowgram.ai/node';
|
|
2
2
|
import { FormMetaOrFormMetaGenerator } from '@flowgram.ai/form-core';
|
|
3
3
|
import { FlowNodeRegistry } from '@flowgram.ai/document';
|
|
4
|
-
import { t as WorkflowNodeMeta, i as WorkflowPortEntity, d as WorkflowLinesManager, b as WorkflowNodeEntity } from '../workflow-node-entity-
|
|
4
|
+
import { t as WorkflowNodeMeta, i as WorkflowPortEntity, d as WorkflowLinesManager, b as WorkflowNodeEntity } from '../workflow-node-entity-DgQT-wl9.mjs';
|
|
5
5
|
import '@flowgram.ai/core';
|
|
6
6
|
import '@flowgram.ai/utils';
|
|
7
7
|
import 'react';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FormMeta } from '@flowgram.ai/node';
|
|
2
2
|
import { FormMetaOrFormMetaGenerator } from '@flowgram.ai/form-core';
|
|
3
3
|
import { FlowNodeRegistry } from '@flowgram.ai/document';
|
|
4
|
-
import { t as WorkflowNodeMeta, i as WorkflowPortEntity, d as WorkflowLinesManager, b as WorkflowNodeEntity } from '../workflow-node-entity-
|
|
4
|
+
import { t as WorkflowNodeMeta, i as WorkflowPortEntity, d as WorkflowLinesManager, b as WorkflowNodeEntity } from '../workflow-node-entity-kGsp2Roz.js';
|
|
5
5
|
import '@flowgram.ai/core';
|
|
6
6
|
import '@flowgram.ai/utils';
|
|
7
7
|
import 'react';
|
|
@@ -363,6 +363,9 @@ declare class WorkflowDocument extends FlowDocument {
|
|
|
363
363
|
fitView(easing?: boolean): Promise<void>;
|
|
364
364
|
init(): void;
|
|
365
365
|
load(): Promise<void>;
|
|
366
|
+
/**
|
|
367
|
+
* @deprecated use `ctx.operation.fromJSON` instead
|
|
368
|
+
*/
|
|
366
369
|
reload(json: WorkflowJSON, delayTime?: number): Promise<void>;
|
|
367
370
|
/**
|
|
368
371
|
* 从数据加载
|
|
@@ -377,7 +380,14 @@ declare class WorkflowDocument extends FlowDocument {
|
|
|
377
380
|
* 创建流程节点
|
|
378
381
|
* @param json
|
|
379
382
|
*/
|
|
380
|
-
createWorkflowNode(json: WorkflowNodeJSON,
|
|
383
|
+
createWorkflowNode(json: WorkflowNodeJSON,
|
|
384
|
+
/** @deprecated */
|
|
385
|
+
isClone?: boolean, parentID?: string): WorkflowNodeEntity;
|
|
386
|
+
/**
|
|
387
|
+
* 创建流程节点
|
|
388
|
+
* @param json
|
|
389
|
+
*/
|
|
390
|
+
private _createWorkflowNode;
|
|
381
391
|
/**
|
|
382
392
|
* 添加节点,如果节点已经存在则不会重复创建
|
|
383
393
|
* @param data
|
|
@@ -397,6 +407,7 @@ declare class WorkflowDocument extends FlowDocument {
|
|
|
397
407
|
*/
|
|
398
408
|
createWorkflowNodeByType(type: string | number, position?: IPoint, json?: Partial<WorkflowNodeJSON>, parentID?: string): WorkflowNodeEntity;
|
|
399
409
|
getAllNodes(): WorkflowNodeEntity[];
|
|
410
|
+
getAllEdges(): WorkflowLineEntity[];
|
|
400
411
|
getAllPorts(): WorkflowPortEntity[];
|
|
401
412
|
/**
|
|
402
413
|
* 获取画布中的非游离节点
|
|
@@ -419,7 +430,7 @@ declare class WorkflowDocument extends FlowDocument {
|
|
|
419
430
|
*/
|
|
420
431
|
private toNodeJSONFromOptions;
|
|
421
432
|
copyNode(node: WorkflowNodeEntity, newNodeId?: string | undefined, format?: (json: WorkflowNodeJSON) => WorkflowNodeJSON, position?: IPoint): WorkflowNodeEntity;
|
|
422
|
-
copyNodeFromJSON(flowNodeType: string, nodeJSON: WorkflowNodeJSON, newNodeId?: string | undefined, position?: IPoint,
|
|
433
|
+
copyNodeFromJSON(flowNodeType: string, nodeJSON: WorkflowNodeJSON, newNodeId?: string | undefined, position?: IPoint, parentID?: string): WorkflowNodeEntity;
|
|
423
434
|
canRemove(node: WorkflowNodeEntity, silent?: boolean): boolean;
|
|
424
435
|
/**
|
|
425
436
|
* 判断端口是否为错误态
|
|
@@ -438,6 +449,7 @@ declare class WorkflowDocument extends FlowDocument {
|
|
|
438
449
|
*/
|
|
439
450
|
renderJSON(json: WorkflowJSON, options?: {
|
|
440
451
|
parent?: WorkflowNodeEntity;
|
|
452
|
+
/** @deprecated useless api */
|
|
441
453
|
isClone?: boolean;
|
|
442
454
|
}): {
|
|
443
455
|
nodes: WorkflowNodeEntity[];
|
|
@@ -448,7 +460,8 @@ declare class WorkflowDocument extends FlowDocument {
|
|
|
448
460
|
*/
|
|
449
461
|
batchAddFromJSON(json: WorkflowJSON, options?: {
|
|
450
462
|
parent?: WorkflowNodeEntity;
|
|
451
|
-
|
|
463
|
+
onNodeCreated?: (node: WorkflowNodeEntity) => void;
|
|
464
|
+
onEdgeCreated?: (edge: WorkflowLineEntity) => void;
|
|
452
465
|
}): {
|
|
453
466
|
nodes: WorkflowNodeEntity[];
|
|
454
467
|
edges: WorkflowLineEntity[];
|
|
@@ -363,6 +363,9 @@ declare class WorkflowDocument extends FlowDocument {
|
|
|
363
363
|
fitView(easing?: boolean): Promise<void>;
|
|
364
364
|
init(): void;
|
|
365
365
|
load(): Promise<void>;
|
|
366
|
+
/**
|
|
367
|
+
* @deprecated use `ctx.operation.fromJSON` instead
|
|
368
|
+
*/
|
|
366
369
|
reload(json: WorkflowJSON, delayTime?: number): Promise<void>;
|
|
367
370
|
/**
|
|
368
371
|
* 从数据加载
|
|
@@ -377,7 +380,14 @@ declare class WorkflowDocument extends FlowDocument {
|
|
|
377
380
|
* 创建流程节点
|
|
378
381
|
* @param json
|
|
379
382
|
*/
|
|
380
|
-
createWorkflowNode(json: WorkflowNodeJSON,
|
|
383
|
+
createWorkflowNode(json: WorkflowNodeJSON,
|
|
384
|
+
/** @deprecated */
|
|
385
|
+
isClone?: boolean, parentID?: string): WorkflowNodeEntity;
|
|
386
|
+
/**
|
|
387
|
+
* 创建流程节点
|
|
388
|
+
* @param json
|
|
389
|
+
*/
|
|
390
|
+
private _createWorkflowNode;
|
|
381
391
|
/**
|
|
382
392
|
* 添加节点,如果节点已经存在则不会重复创建
|
|
383
393
|
* @param data
|
|
@@ -397,6 +407,7 @@ declare class WorkflowDocument extends FlowDocument {
|
|
|
397
407
|
*/
|
|
398
408
|
createWorkflowNodeByType(type: string | number, position?: IPoint, json?: Partial<WorkflowNodeJSON>, parentID?: string): WorkflowNodeEntity;
|
|
399
409
|
getAllNodes(): WorkflowNodeEntity[];
|
|
410
|
+
getAllEdges(): WorkflowLineEntity[];
|
|
400
411
|
getAllPorts(): WorkflowPortEntity[];
|
|
401
412
|
/**
|
|
402
413
|
* 获取画布中的非游离节点
|
|
@@ -419,7 +430,7 @@ declare class WorkflowDocument extends FlowDocument {
|
|
|
419
430
|
*/
|
|
420
431
|
private toNodeJSONFromOptions;
|
|
421
432
|
copyNode(node: WorkflowNodeEntity, newNodeId?: string | undefined, format?: (json: WorkflowNodeJSON) => WorkflowNodeJSON, position?: IPoint): WorkflowNodeEntity;
|
|
422
|
-
copyNodeFromJSON(flowNodeType: string, nodeJSON: WorkflowNodeJSON, newNodeId?: string | undefined, position?: IPoint,
|
|
433
|
+
copyNodeFromJSON(flowNodeType: string, nodeJSON: WorkflowNodeJSON, newNodeId?: string | undefined, position?: IPoint, parentID?: string): WorkflowNodeEntity;
|
|
423
434
|
canRemove(node: WorkflowNodeEntity, silent?: boolean): boolean;
|
|
424
435
|
/**
|
|
425
436
|
* 判断端口是否为错误态
|
|
@@ -438,6 +449,7 @@ declare class WorkflowDocument extends FlowDocument {
|
|
|
438
449
|
*/
|
|
439
450
|
renderJSON(json: WorkflowJSON, options?: {
|
|
440
451
|
parent?: WorkflowNodeEntity;
|
|
452
|
+
/** @deprecated useless api */
|
|
441
453
|
isClone?: boolean;
|
|
442
454
|
}): {
|
|
443
455
|
nodes: WorkflowNodeEntity[];
|
|
@@ -448,7 +460,8 @@ declare class WorkflowDocument extends FlowDocument {
|
|
|
448
460
|
*/
|
|
449
461
|
batchAddFromJSON(json: WorkflowJSON, options?: {
|
|
450
462
|
parent?: WorkflowNodeEntity;
|
|
451
|
-
|
|
463
|
+
onNodeCreated?: (node: WorkflowNodeEntity) => void;
|
|
464
|
+
onEdgeCreated?: (edge: WorkflowLineEntity) => void;
|
|
452
465
|
}): {
|
|
453
466
|
nodes: WorkflowNodeEntity[];
|
|
454
467
|
edges: WorkflowLineEntity[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowgram.ai/free-layout-core",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
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": "^5.0.9",
|
|
37
|
-
"@flowgram.ai/core": "0.5.
|
|
38
|
-
"@flowgram.ai/document": "0.5.
|
|
39
|
-
"@flowgram.ai/
|
|
40
|
-
"@flowgram.ai/
|
|
41
|
-
"@flowgram.ai/
|
|
42
|
-
"@flowgram.ai/
|
|
37
|
+
"@flowgram.ai/core": "0.5.3",
|
|
38
|
+
"@flowgram.ai/document": "0.5.3",
|
|
39
|
+
"@flowgram.ai/node": "0.5.3",
|
|
40
|
+
"@flowgram.ai/form-core": "0.5.3",
|
|
41
|
+
"@flowgram.ai/reactive": "0.5.3",
|
|
42
|
+
"@flowgram.ai/utils": "0.5.3"
|
|
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": "^3.2.4",
|
|
56
|
-
"@flowgram.ai/
|
|
57
|
-
"@flowgram.ai/
|
|
56
|
+
"@flowgram.ai/eslint-config": "0.5.3",
|
|
57
|
+
"@flowgram.ai/ts-config": "0.5.3"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"react": ">=16.8",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/typings/workflow-operation.ts"],"sourcesContent":["/**\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":";AAgCO,IAAM,+BAA+B,OAAO,8BAA8B;","names":[]}
|