@flowgram.ai/free-layout-core 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +63 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +58 -1
- 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/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-registry.d.mts +1 -1
- package/dist/typings/workflow-registry.d.ts +1 -1
- package/dist/{workflow-line-entity-D8NFe_5A.d.mts → workflow-line-entity-BcD7CpoN.d.mts} +7 -1
- package/dist/{workflow-line-entity-BkEp6R-u.d.ts → workflow-line-entity-CXh_ddVD.d.ts} +7 -1
- package/package.json +9 -9
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-
|
|
6
|
-
export { 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, G as PORT_SIZE, o as WORKFLOW_LINE_ENTITY, J as WorkfloEntityHoverable, s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, M as WorkflowDocumentOptionsDefault, K as WorkflowDocumentProvider, I as WorkflowEntityHoverable, q as WorkflowJSON, E as WorkflowLineEntityOpts, F as WorkflowLineInfo, D as WorkflowLinePortInfo, x as WorkflowLineRenderContributionFactory, t as WorkflowNodeMeta, H as WorkflowPortEntityOpts, p as domReactToBounds, n as getPortEntityId, B as onDragLineEndParams } from './workflow-line-entity-
|
|
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-BcD7CpoN.mjs';
|
|
6
|
+
export { 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, G as PORT_SIZE, o as WORKFLOW_LINE_ENTITY, J as WorkfloEntityHoverable, s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, M as WorkflowDocumentOptionsDefault, K as WorkflowDocumentProvider, I as WorkflowEntityHoverable, q as WorkflowJSON, E as WorkflowLineEntityOpts, F as WorkflowLineInfo, D as WorkflowLinePortInfo, x as WorkflowLineRenderContributionFactory, t as WorkflowNodeMeta, H as WorkflowPortEntityOpts, p as domReactToBounds, n as getPortEntityId, B as onDragLineEndParams } from './workflow-line-entity-BcD7CpoN.mjs';
|
|
7
7
|
import { W as WorkflowNodeEntity } from './workflow-sub-canvas-DOVla1mw.mjs';
|
|
8
8
|
export { a as WorkflowSubCanvas } from './workflow-sub-canvas-DOVla1mw.mjs';
|
|
9
9
|
import * as _flowgram_ai_utils from '@flowgram.ai/utils';
|
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-
|
|
6
|
-
export { 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, G as PORT_SIZE, o as WORKFLOW_LINE_ENTITY, J as WorkfloEntityHoverable, s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, M as WorkflowDocumentOptionsDefault, K as WorkflowDocumentProvider, I as WorkflowEntityHoverable, q as WorkflowJSON, E as WorkflowLineEntityOpts, F as WorkflowLineInfo, D as WorkflowLinePortInfo, x as WorkflowLineRenderContributionFactory, t as WorkflowNodeMeta, H as WorkflowPortEntityOpts, p as domReactToBounds, n as getPortEntityId, B as onDragLineEndParams } from './workflow-line-entity-
|
|
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-CXh_ddVD.js';
|
|
6
|
+
export { 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, G as PORT_SIZE, o as WORKFLOW_LINE_ENTITY, J as WorkfloEntityHoverable, s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, M as WorkflowDocumentOptionsDefault, K as WorkflowDocumentProvider, I as WorkflowEntityHoverable, q as WorkflowJSON, E as WorkflowLineEntityOpts, F as WorkflowLineInfo, D as WorkflowLinePortInfo, x as WorkflowLineRenderContributionFactory, t as WorkflowNodeMeta, H as WorkflowPortEntityOpts, p as domReactToBounds, n as getPortEntityId, B as onDragLineEndParams } from './workflow-line-entity-CXh_ddVD.js';
|
|
7
7
|
import { W as WorkflowNodeEntity } from './workflow-sub-canvas-DOVla1mw.js';
|
|
8
8
|
export { a as WorkflowSubCanvas } from './workflow-sub-canvas-DOVla1mw.js';
|
|
9
9
|
import * as _flowgram_ai_utils from '@flowgram.ai/utils';
|
package/dist/index.js
CHANGED
|
@@ -1833,7 +1833,6 @@ var WorkflowDocument = class extends import_document7.FlowDocument {
|
|
|
1833
1833
|
parent
|
|
1834
1834
|
},
|
|
1835
1835
|
void 0,
|
|
1836
|
-
true,
|
|
1837
1836
|
true
|
|
1838
1837
|
);
|
|
1839
1838
|
const registry = node.getNodeRegistry();
|
|
@@ -1938,6 +1937,64 @@ var WorkflowDocument = class extends import_document7.FlowDocument {
|
|
|
1938
1937
|
}
|
|
1939
1938
|
return node;
|
|
1940
1939
|
}
|
|
1940
|
+
/**
|
|
1941
|
+
* 添加节点,如果节点已经存在则不会重复创建
|
|
1942
|
+
* @param data
|
|
1943
|
+
* @param addedNodes
|
|
1944
|
+
*/
|
|
1945
|
+
addNode(data, addedNodes, ignoreCreateAndUpdateEvent) {
|
|
1946
|
+
const { id, type = "block", originParent, parent, meta, hidden, index } = data;
|
|
1947
|
+
let node = this.getNode(id);
|
|
1948
|
+
let isNew = false;
|
|
1949
|
+
const register = this.getNodeRegistry(type, data.originParent);
|
|
1950
|
+
if (node && node.flowNodeType !== data.type) {
|
|
1951
|
+
node.dispose();
|
|
1952
|
+
node = void 0;
|
|
1953
|
+
}
|
|
1954
|
+
if (!node) {
|
|
1955
|
+
const { dataRegistries } = register;
|
|
1956
|
+
node = this.entityManager.createEntity(WorkflowNodeEntity, {
|
|
1957
|
+
id,
|
|
1958
|
+
document: this,
|
|
1959
|
+
flowNodeType: type,
|
|
1960
|
+
originParent,
|
|
1961
|
+
meta
|
|
1962
|
+
});
|
|
1963
|
+
const datas = dataRegistries ? this.nodeDataRegistries.concat(...dataRegistries) : this.nodeDataRegistries;
|
|
1964
|
+
node.addInitializeData(datas);
|
|
1965
|
+
node.onDispose(() => this.onNodeDisposeEmitter.fire({ node }));
|
|
1966
|
+
this.options.fromNodeJSON?.(node, data, true);
|
|
1967
|
+
isNew = true;
|
|
1968
|
+
} else {
|
|
1969
|
+
this.options.fromNodeJSON?.(node, data, false);
|
|
1970
|
+
}
|
|
1971
|
+
node.initData({
|
|
1972
|
+
originParent,
|
|
1973
|
+
parent,
|
|
1974
|
+
meta,
|
|
1975
|
+
hidden,
|
|
1976
|
+
index
|
|
1977
|
+
});
|
|
1978
|
+
addedNodes?.push(node);
|
|
1979
|
+
if (register.onCreate) {
|
|
1980
|
+
const extendNodes = register.onCreate(node, data);
|
|
1981
|
+
if (extendNodes && addedNodes) {
|
|
1982
|
+
addedNodes.push(...extendNodes);
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
if (!ignoreCreateAndUpdateEvent) {
|
|
1986
|
+
if (isNew) {
|
|
1987
|
+
this.onNodeCreateEmitter.fire({
|
|
1988
|
+
node,
|
|
1989
|
+
data,
|
|
1990
|
+
json: data
|
|
1991
|
+
});
|
|
1992
|
+
} else {
|
|
1993
|
+
this.onNodeUpdateEmitter.fire({ node, data, json: data });
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
return node;
|
|
1997
|
+
}
|
|
1941
1998
|
get layout() {
|
|
1942
1999
|
const layout = this.layouts.find((layout2) => layout2.name == this.currentLayoutKey);
|
|
1943
2000
|
if (!layout) {
|