@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.
@@ -1,4 +1,4 @@
1
- export { v as LineColor, w as LineColors, L as LineEventProps, m as LinePosition, k as LineRenderType, u as LineType, z as NodesDragEndEvent, N as NodesDragEvent, y as NodesDragStartEvent, A as NodesDraggingEvent, O as OnDragLineEnd, s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, q as WorkflowJSON, l as WorkflowLineRenderContribution, x as WorkflowLineRenderContributionFactory, e as WorkflowNodeJSON, t as WorkflowNodeMeta, B as onDragLineEndParams } from '../workflow-line-entity-D8NFe_5A.mjs';
1
+ export { v as LineColor, w as LineColors, L as LineEventProps, m as LinePosition, k as LineRenderType, u as LineType, z as NodesDragEndEvent, N as NodesDragEvent, y as NodesDragStartEvent, A as NodesDraggingEvent, O as OnDragLineEnd, s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, q as WorkflowJSON, l as WorkflowLineRenderContribution, x as WorkflowLineRenderContributionFactory, e as WorkflowNodeJSON, t as WorkflowNodeMeta, B as onDragLineEndParams } from '../workflow-line-entity-BcD7CpoN.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-DOVla1mw.mjs';
@@ -1,4 +1,4 @@
1
- export { v as LineColor, w as LineColors, L as LineEventProps, m as LinePosition, k as LineRenderType, u as LineType, z as NodesDragEndEvent, N as NodesDragEvent, y as NodesDragStartEvent, A as NodesDraggingEvent, O as OnDragLineEnd, s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, q as WorkflowJSON, l as WorkflowLineRenderContribution, x as WorkflowLineRenderContributionFactory, e as WorkflowNodeJSON, t as WorkflowNodeMeta, B as onDragLineEndParams } from '../workflow-line-entity-BkEp6R-u.js';
1
+ export { v as LineColor, w as LineColors, L as LineEventProps, m as LinePosition, k as LineRenderType, u as LineType, z as NodesDragEndEvent, N as NodesDragEvent, y as NodesDragStartEvent, A as NodesDraggingEvent, O as OnDragLineEnd, s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, q as WorkflowJSON, l as WorkflowLineRenderContribution, x as WorkflowLineRenderContributionFactory, e as WorkflowNodeJSON, t as WorkflowNodeMeta, B as onDragLineEndParams } from '../workflow-line-entity-CXh_ddVD.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-DOVla1mw.js';
@@ -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, z as NodesDragEndEvent, N as NodesDragEvent, y as NodesDragStartEvent, A as NodesDraggingEvent, O as OnDragLineEnd, B as onDragLineEndParams } from '../workflow-line-entity-D8NFe_5A.mjs';
5
+ export { L as LineEventProps, z as NodesDragEndEvent, N as NodesDragEvent, y as NodesDragStartEvent, A as NodesDraggingEvent, O as OnDragLineEnd, B as onDragLineEndParams } from '../workflow-line-entity-BcD7CpoN.mjs';
6
6
  import '../workflow-sub-canvas-DOVla1mw.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, z as NodesDragEndEvent, N as NodesDragEvent, y as NodesDragStartEvent, A as NodesDraggingEvent, O as OnDragLineEnd, B as onDragLineEndParams } from '../workflow-line-entity-BkEp6R-u.js';
5
+ export { L as LineEventProps, z as NodesDragEndEvent, N as NodesDragEvent, y as NodesDragStartEvent, A as NodesDraggingEvent, O as OnDragLineEnd, B as onDragLineEndParams } from '../workflow-line-entity-CXh_ddVD.js';
6
6
  import '../workflow-sub-canvas-DOVla1mw.js';
7
7
  import '@flowgram.ai/form-core';
8
8
  import './workflow-edge.js';
@@ -1,5 +1,5 @@
1
1
  import '../workflow-sub-canvas-DOVla1mw.mjs';
2
- export { s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, q as WorkflowJSON } from '../workflow-line-entity-D8NFe_5A.mjs';
2
+ export { s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, q as WorkflowJSON } from '../workflow-line-entity-BcD7CpoN.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-DOVla1mw.js';
2
- export { s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, q as WorkflowJSON } from '../workflow-line-entity-BkEp6R-u.js';
2
+ export { s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, q as WorkflowJSON } from '../workflow-line-entity-CXh_ddVD.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 { v as LineColor, w as LineColors, m as LinePosition, k as LineRenderType, u as LineType, l as WorkflowLineRenderContribution, x as WorkflowLineRenderContributionFactory } from '../workflow-line-entity-D8NFe_5A.mjs';
2
+ export { v as LineColor, w as LineColors, m as LinePosition, k as LineRenderType, u as LineType, l as WorkflowLineRenderContribution, x as WorkflowLineRenderContributionFactory } from '../workflow-line-entity-BcD7CpoN.mjs';
3
3
  import '@flowgram.ai/core';
4
4
  import '@flowgram.ai/document';
5
5
  import '../workflow-sub-canvas-DOVla1mw.mjs';
@@ -1,5 +1,5 @@
1
1
  import '@flowgram.ai/utils';
2
- export { v as LineColor, w as LineColors, m as LinePosition, k as LineRenderType, u as LineType, l as WorkflowLineRenderContribution, x as WorkflowLineRenderContributionFactory } from '../workflow-line-entity-BkEp6R-u.js';
2
+ export { v as LineColor, w as LineColors, m as LinePosition, k as LineRenderType, u as LineType, l as WorkflowLineRenderContribution, x as WorkflowLineRenderContributionFactory } from '../workflow-line-entity-CXh_ddVD.js';
3
3
  import '@flowgram.ai/core';
4
4
  import '@flowgram.ai/document';
5
5
  import '../workflow-sub-canvas-DOVla1mw.js';
@@ -1,7 +1,7 @@
1
1
  import '@flowgram.ai/utils';
2
2
  import '@flowgram.ai/document';
3
3
  import '../workflow-sub-canvas-DOVla1mw.mjs';
4
- export { e as WorkflowNodeJSON, t as WorkflowNodeMeta } from '../workflow-line-entity-D8NFe_5A.mjs';
4
+ export { e as WorkflowNodeJSON, t as WorkflowNodeMeta } from '../workflow-line-entity-BcD7CpoN.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-DOVla1mw.js';
4
- export { e as WorkflowNodeJSON, t as WorkflowNodeMeta } from '../workflow-line-entity-BkEp6R-u.js';
4
+ export { e as WorkflowNodeJSON, t as WorkflowNodeMeta } from '../workflow-line-entity-CXh_ddVD.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-DOVla1mw.mjs';
5
- import { t as WorkflowNodeMeta } from '../workflow-line-entity-D8NFe_5A.mjs';
5
+ import { t as WorkflowNodeMeta } from '../workflow-line-entity-BcD7CpoN.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-DOVla1mw.js';
5
- import { t as WorkflowNodeMeta } from '../workflow-line-entity-BkEp6R-u.js';
5
+ import { t as WorkflowNodeMeta } from '../workflow-line-entity-CXh_ddVD.js';
6
6
  import '@flowgram.ai/utils';
7
7
  import '@flowgram.ai/core';
8
8
  import './workflow-edge.js';
@@ -1,7 +1,7 @@
1
1
  import * as _flowgram_ai_utils from '@flowgram.ai/utils';
2
2
  import { IPoint, Rectangle, PositionSchema, Emitter, Event, PaddingSchema, SizeSchema, ScrollSchema, DisposableCollection } from '@flowgram.ai/utils';
3
3
  import { PlaygroundDragEvent, PlaygroundDrag, EntityManager, SelectionService, Playground, Entity, PlaygroundConfigEntity, PlaygroundContext, EntityOpts } from '@flowgram.ai/core';
4
- import { FlowNodeMeta, FlowNodeJSON, FlowNodeEntity, FlowDocumentOptions, FlowLayout, FlowDocumentProvider, FlowDocument } from '@flowgram.ai/document';
4
+ import { FlowNodeMeta, FlowNodeJSON, FlowNodeEntity, FlowDocumentOptions, FlowLayout, FlowDocumentProvider, FlowDocument, AddNodeData } from '@flowgram.ai/document';
5
5
  import { W as WorkflowNodeEntity, a as WorkflowSubCanvas } from './workflow-sub-canvas-DOVla1mw.mjs';
6
6
  import { NodeEngineContext } from '@flowgram.ai/form-core';
7
7
  import { WorkflowEdgeJSON } from './typings/workflow-edge.mjs';
@@ -367,6 +367,12 @@ declare class WorkflowDocument extends FlowDocument {
367
367
  * @param json
368
368
  */
369
369
  createWorkflowNode(json: WorkflowNodeJSON, isClone?: boolean, parentId?: string): WorkflowNodeEntity;
370
+ /**
371
+ * 添加节点,如果节点已经存在则不会重复创建
372
+ * @param data
373
+ * @param addedNodes
374
+ */
375
+ addNode(data: AddNodeData, addedNodes?: WorkflowNodeEntity[], ignoreCreateAndUpdateEvent?: boolean): WorkflowNodeEntity;
370
376
  get layout(): FreeLayout;
371
377
  /**
372
378
  * 获取默认的 x y 坐标, 默认为当前画布可视区域中心
@@ -1,7 +1,7 @@
1
1
  import * as _flowgram_ai_utils from '@flowgram.ai/utils';
2
2
  import { IPoint, Rectangle, PositionSchema, Emitter, Event, PaddingSchema, SizeSchema, ScrollSchema, DisposableCollection } from '@flowgram.ai/utils';
3
3
  import { PlaygroundDragEvent, PlaygroundDrag, EntityManager, SelectionService, Playground, Entity, PlaygroundConfigEntity, PlaygroundContext, EntityOpts } from '@flowgram.ai/core';
4
- import { FlowNodeMeta, FlowNodeJSON, FlowNodeEntity, FlowDocumentOptions, FlowLayout, FlowDocumentProvider, FlowDocument } from '@flowgram.ai/document';
4
+ import { FlowNodeMeta, FlowNodeJSON, FlowNodeEntity, FlowDocumentOptions, FlowLayout, FlowDocumentProvider, FlowDocument, AddNodeData } from '@flowgram.ai/document';
5
5
  import { W as WorkflowNodeEntity, a as WorkflowSubCanvas } from './workflow-sub-canvas-DOVla1mw.js';
6
6
  import { NodeEngineContext } from '@flowgram.ai/form-core';
7
7
  import { WorkflowEdgeJSON } from './typings/workflow-edge.js';
@@ -367,6 +367,12 @@ declare class WorkflowDocument extends FlowDocument {
367
367
  * @param json
368
368
  */
369
369
  createWorkflowNode(json: WorkflowNodeJSON, isClone?: boolean, parentId?: string): WorkflowNodeEntity;
370
+ /**
371
+ * 添加节点,如果节点已经存在则不会重复创建
372
+ * @param data
373
+ * @param addedNodes
374
+ */
375
+ addNode(data: AddNodeData, addedNodes?: WorkflowNodeEntity[], ignoreCreateAndUpdateEvent?: boolean): WorkflowNodeEntity;
370
376
  get layout(): FreeLayout;
371
377
  /**
372
378
  * 获取默认的 x y 坐标, 默认为当前画布可视区域中心
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowgram.ai/free-layout-core",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
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.2.8",
38
- "@flowgram.ai/node": "0.2.8",
39
- "@flowgram.ai/reactive": "0.2.8",
40
- "@flowgram.ai/form-core": "0.2.8",
41
- "@flowgram.ai/utils": "0.2.8",
42
- "@flowgram.ai/document": "0.2.8"
37
+ "@flowgram.ai/core": "0.2.9",
38
+ "@flowgram.ai/form-core": "0.2.9",
39
+ "@flowgram.ai/node": "0.2.9",
40
+ "@flowgram.ai/reactive": "0.2.9",
41
+ "@flowgram.ai/document": "0.2.9",
42
+ "@flowgram.ai/utils": "0.2.9"
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.0.4",
55
55
  "vitest": "^0.34.6",
56
- "@flowgram.ai/eslint-config": "0.2.8",
57
- "@flowgram.ai/ts-config": "0.2.8"
56
+ "@flowgram.ai/eslint-config": "0.2.9",
57
+ "@flowgram.ai/ts-config": "0.2.9"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "react": ">=16.8",