@flowgram.ai/free-layout-core 0.2.15 → 0.2.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/esm/{chunk-J5FVRRUV.js → chunk-242F2JCI.js} +1 -1
  2. package/dist/esm/chunk-242F2JCI.js.map +1 -0
  3. package/dist/esm/{chunk-BJKYSQMI.js → chunk-CTGO4RKX.js} +1 -1
  4. package/dist/esm/chunk-CTGO4RKX.js.map +1 -0
  5. package/dist/esm/{chunk-IYUZVBAO.js → chunk-IKQUOAWQ.js} +1 -1
  6. package/dist/esm/chunk-IKQUOAWQ.js.map +1 -0
  7. package/dist/esm/{chunk-LJH3TSLZ.js → chunk-O4WKIIW2.js} +1 -1
  8. package/dist/esm/chunk-O4WKIIW2.js.map +1 -0
  9. package/dist/esm/index.js +18 -4
  10. package/dist/esm/index.js.map +1 -1
  11. package/dist/esm/typings/index.js +4 -4
  12. package/dist/esm/typings/workflow-json.js +1 -1
  13. package/dist/esm/typings/workflow-line.js +1 -1
  14. package/dist/esm/typings/workflow-operation.js +1 -1
  15. package/dist/index.d.mts +81 -4
  16. package/dist/index.d.ts +81 -4
  17. package/dist/index.js +14 -0
  18. package/dist/index.js.map +1 -1
  19. package/dist/typings/index.d.mts +7 -2
  20. package/dist/typings/index.d.ts +7 -2
  21. package/dist/typings/index.js.map +1 -1
  22. package/dist/typings/workflow-drag.d.mts +2 -2
  23. package/dist/typings/workflow-drag.d.ts +2 -2
  24. package/dist/typings/workflow-drag.js.map +1 -1
  25. package/dist/typings/workflow-edge.d.mts +4 -0
  26. package/dist/typings/workflow-edge.d.ts +4 -0
  27. package/dist/typings/workflow-edge.js.map +1 -1
  28. package/dist/typings/workflow-json.d.mts +2 -2
  29. package/dist/typings/workflow-json.d.ts +2 -2
  30. package/dist/typings/workflow-json.js.map +1 -1
  31. package/dist/typings/workflow-line.d.mts +2 -2
  32. package/dist/typings/workflow-line.d.ts +2 -2
  33. package/dist/typings/workflow-line.js.map +1 -1
  34. package/dist/typings/workflow-node.d.mts +2 -2
  35. package/dist/typings/workflow-node.d.ts +2 -2
  36. package/dist/typings/workflow-node.js.map +1 -1
  37. package/dist/typings/workflow-operation.d.mts +5 -0
  38. package/dist/typings/workflow-operation.d.ts +5 -0
  39. package/dist/typings/workflow-operation.js.map +1 -1
  40. package/dist/typings/workflow-registry.d.mts +7 -2
  41. package/dist/typings/workflow-registry.d.ts +7 -2
  42. package/dist/typings/workflow-registry.js.map +1 -1
  43. package/dist/typings/workflow-sub-canvas.d.mts +1 -1
  44. package/dist/typings/workflow-sub-canvas.d.ts +1 -1
  45. package/dist/typings/workflow-sub-canvas.js.map +1 -1
  46. package/dist/{workflow-line-entity-B34FWw9W.d.mts → workflow-line-entity-BpFc2Mu3.d.mts} +58 -2
  47. package/dist/{workflow-line-entity-B4Mfa03B.d.ts → workflow-line-entity-D4-erSyq.d.ts} +58 -2
  48. package/dist/{workflow-sub-canvas-DOVla1mw.d.mts → workflow-sub-canvas-IQzlYvPD.d.mts} +10 -0
  49. package/dist/{workflow-sub-canvas-DOVla1mw.d.ts → workflow-sub-canvas-IQzlYvPD.d.ts} +10 -0
  50. package/package.json +9 -9
  51. package/dist/esm/chunk-BJKYSQMI.js.map +0 -1
  52. package/dist/esm/chunk-IYUZVBAO.js.map +0 -1
  53. package/dist/esm/chunk-J5FVRRUV.js.map +0 -1
  54. package/dist/esm/chunk-LJH3TSLZ.js.map +0 -1
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  URLParams
3
- } from "../chunk-IYUZVBAO.js";
3
+ } from "../chunk-IKQUOAWQ.js";
4
4
  import "../chunk-KNYZRMIO.js";
5
5
  import "../chunk-NU6G5HF4.js";
6
6
  import "../chunk-TQLT57GW.js";
7
7
  import "../chunk-CGOMTQ3G.js";
8
8
  import {
9
9
  WorkflowContentChangeType
10
- } from "../chunk-J5FVRRUV.js";
10
+ } from "../chunk-242F2JCI.js";
11
11
  import {
12
12
  LineColors,
13
13
  LineType
14
- } from "../chunk-BJKYSQMI.js";
14
+ } from "../chunk-CTGO4RKX.js";
15
15
  import "../chunk-DDJTYHXN.js";
16
16
  import {
17
17
  WorkflowOperationBaseService
18
- } from "../chunk-LJH3TSLZ.js";
18
+ } from "../chunk-O4WKIIW2.js";
19
19
  import "../chunk-EUXUH3YW.js";
20
20
  export {
21
21
  LineColors,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  WorkflowContentChangeType
3
- } from "../chunk-J5FVRRUV.js";
3
+ } from "../chunk-242F2JCI.js";
4
4
  import "../chunk-EUXUH3YW.js";
5
5
  export {
6
6
  WorkflowContentChangeType
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  LineColors,
3
3
  LineType
4
- } from "../chunk-BJKYSQMI.js";
4
+ } from "../chunk-CTGO4RKX.js";
5
5
  import "../chunk-EUXUH3YW.js";
6
6
  export {
7
7
  LineColors,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  WorkflowOperationBaseService
3
- } from "../chunk-LJH3TSLZ.js";
3
+ } from "../chunk-O4WKIIW2.js";
4
4
  import "../chunk-EUXUH3YW.js";
5
5
  export {
6
6
  WorkflowOperationBaseService
package/dist/index.d.mts CHANGED
@@ -2,10 +2,10 @@ 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-B34FWw9W.mjs';
6
- export { J as HoverPosition, C as LINE_HOVER_DISTANCE, v as LineColor, w as LineColors, u as LineType, z as NodesDragEndEvent, y as NodesDragStartEvent, A as NodesDraggingEvent, P as POINT_RADIUS, G as PORT_SIZE, o as WORKFLOW_LINE_ENTITY, K as WorkfloEntityHoverable, s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, Q as WorkflowDocumentOptionsDefault, M 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-B34FWw9W.mjs';
7
- import { W as WorkflowNodeEntity } from './workflow-sub-canvas-DOVla1mw.mjs';
8
- export { a as WorkflowSubCanvas } from './workflow-sub-canvas-DOVla1mw.mjs';
5
+ import { W as WorkflowHoverService, a as WorkflowDocument, b as WorkflowLinesManager, c as WorkflowSelectService, d as WorkflowDocumentOptions, L as LineEventProps, N as NodesDragEvent, e as WorkflowNodeJSON, f as WorkflowPortEntity, g as WorkflowLineEntity, O as OnDragLineEnd, h as WorkflowPorts, i as WorkflowPortType, j as WorkflowPort, k as LineRenderType, l as WorkflowLineRenderContribution, m as LinePosition } from './workflow-line-entity-BpFc2Mu3.mjs';
6
+ export { J as HoverPosition, C as LINE_HOVER_DISTANCE, v as LineColor, w as LineColors, u as LineType, z as NodesDragEndEvent, y as NodesDragStartEvent, A as NodesDraggingEvent, P as POINT_RADIUS, G as PORT_SIZE, o as WORKFLOW_LINE_ENTITY, K as WorkfloEntityHoverable, s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, Q as WorkflowDocumentOptionsDefault, M 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-BpFc2Mu3.mjs';
7
+ import { W as WorkflowNodeEntity } from './workflow-sub-canvas-IQzlYvPD.mjs';
8
+ export { a as WorkflowSubCanvas } from './workflow-sub-canvas-IQzlYvPD.mjs';
9
9
  import * as _flowgram_ai_utils from '@flowgram.ai/utils';
10
10
  import { DisposableCollection, IPoint, Disposable, Rectangle } from '@flowgram.ai/utils';
11
11
  export { compose, composeAsync, delay } from '@flowgram.ai/utils';
@@ -17,6 +17,10 @@ export { WorkflowEdgeJSON } from './typings/workflow-edge.mjs';
17
17
  export { WorkflowNodeFormMeta, WorkflowNodeRegistry, WorkflowNodeRenderProps } from './typings/workflow-registry.mjs';
18
18
  import '@flowgram.ai/form-core';
19
19
 
20
+ /**
21
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
22
+ * SPDX-License-Identifier: MIT
23
+ */
20
24
  declare enum WorkflowCommands {
21
25
  DELETE_NODES = "DELETE_NODES",
22
26
  COPY_NODES = "COPY_NODES",
@@ -88,7 +92,9 @@ declare class WorkflowDragService {
88
92
  */
89
93
  canDropToNode(params: {
90
94
  dragNodeType?: FlowNodeType;
95
+ dragNode?: WorkflowNodeEntity;
91
96
  dropNode?: WorkflowNodeEntity;
97
+ dropNodeType?: FlowNodeType;
92
98
  }): {
93
99
  allowDrop: boolean;
94
100
  message?: string;
@@ -181,6 +187,11 @@ declare class WorkflowOperationBaseServiceImpl extends FlowOperationBaseServiceI
181
187
  updateNodePosition(nodeOrId: FlowNodeEntityOrId, position: IPoint): void;
182
188
  }
183
189
 
190
+ /**
191
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
192
+ * SPDX-License-Identifier: MIT
193
+ */
194
+
184
195
  interface NodeRenderReturnType {
185
196
  id: string;
186
197
  type: string | number;
@@ -266,29 +277,66 @@ interface NodeRenderReturnType {
266
277
  toggleExpand(): void;
267
278
  }
268
279
 
280
+ /**
281
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
282
+ * SPDX-License-Identifier: MIT
283
+ */
284
+
269
285
  declare function useNodeRender(nodeFromProps?: WorkflowNodeEntity): NodeRenderReturnType;
270
286
 
287
+ /**
288
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
289
+ * SPDX-License-Identifier: MIT
290
+ */
271
291
  /**
272
292
  * 获取当前渲染的 dom 节点
273
293
  */
274
294
  declare function useCurrentDomNode(): HTMLDivElement;
275
295
 
296
+ /**
297
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
298
+ * SPDX-License-Identifier: MIT
299
+ */
300
+
276
301
  /**
277
302
  * 获取当前节点
278
303
  */
279
304
  declare function useCurrentEntity(): WorkflowNodeEntity;
280
305
 
306
+ /**
307
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
308
+ * SPDX-License-Identifier: MIT
309
+ */
310
+
281
311
  declare function useWorkflowDocument(): WorkflowDocument;
282
312
 
313
+ /**
314
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
315
+ * SPDX-License-Identifier: MIT
316
+ */
283
317
  /**
284
318
  * 获取 readonly 状态
285
319
  */
286
320
  declare function usePlaygroundReadonlyState(listenChange?: boolean): boolean;
287
321
 
322
+ /**
323
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
324
+ * SPDX-License-Identifier: MIT
325
+ */
288
326
  declare function nanoid(n?: number): string;
289
327
 
328
+ /**
329
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
330
+ * SPDX-License-Identifier: MIT
331
+ */
332
+
290
333
  declare const fitView: (doc: WorkflowDocument, playgroundConfig: PlaygroundConfigEntity, easing?: boolean) => Promise<void>;
291
334
 
335
+ /**
336
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
337
+ * SPDX-License-Identifier: MIT
338
+ */
339
+
292
340
  /**
293
341
  * 获取没有碰撞的位置
294
342
  * 距离很小时,xy 各偏移 30
@@ -296,6 +344,10 @@ declare const fitView: (doc: WorkflowDocument, playgroundConfig: PlaygroundConfi
296
344
  */
297
345
  declare function getAntiOverlapPosition(doc: WorkflowDocument, position: IPoint, containerNode?: WorkflowNodeEntity): IPoint;
298
346
 
347
+ /**
348
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
349
+ * SPDX-License-Identifier: MIT
350
+ */
299
351
  declare enum EditorCursorState {
300
352
  GRAB = "GRAB",
301
353
  SELECT = "SELECT"
@@ -307,6 +359,11 @@ declare enum InteractiveType {
307
359
  PAD = "PAD"
308
360
  }
309
361
 
362
+ /**
363
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
364
+ * SPDX-License-Identifier: MIT
365
+ */
366
+
310
367
  /**
311
368
  * 节点的点位信息
312
369
  * portsData 只监听点位的数目和类型,不监听点位的 position 变化
@@ -388,6 +445,11 @@ declare class WorkflowNodePortsData extends EntityData {
388
445
  protected updatePortEntity(portInfo: WorkflowPort): WorkflowPortEntity;
389
446
  }
390
447
 
448
+ /**
449
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
450
+ * SPDX-License-Identifier: MIT
451
+ */
452
+
391
453
  interface WorkflowNodeLines {
392
454
  inputLines: WorkflowLineEntity[];
393
455
  outputLines: WorkflowLineEntity[];
@@ -428,6 +490,11 @@ declare class WorkflowNodeLinesData extends EntityData<WorkflowNodeLines> {
428
490
  removeLine(line: WorkflowLineEntity): void;
429
491
  }
430
492
 
493
+ /**
494
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
495
+ * SPDX-License-Identifier: MIT
496
+ */
497
+
431
498
  interface WorkflowLineRenderDataSchema {
432
499
  version: string;
433
500
  contributions: Map<LineRenderType, WorkflowLineRenderContribution>;
@@ -459,8 +526,18 @@ declare class WorkflowLineRenderData extends EntityData<WorkflowLineRenderDataSc
459
526
  private registerContribution;
460
527
  }
461
528
 
529
+ /**
530
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
531
+ * SPDX-License-Identifier: MIT
532
+ */
533
+
462
534
  declare const WorkflowDocumentContainerModule: ContainerModule;
463
535
 
536
+ /**
537
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
538
+ * SPDX-License-Identifier: MIT
539
+ */
540
+
464
541
  interface StraightData {
465
542
  points: IPoint[];
466
543
  path: string;
package/dist/index.d.ts CHANGED
@@ -2,10 +2,10 @@ 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-B4Mfa03B.js';
6
- export { J as HoverPosition, C as LINE_HOVER_DISTANCE, v as LineColor, w as LineColors, u as LineType, z as NodesDragEndEvent, y as NodesDragStartEvent, A as NodesDraggingEvent, P as POINT_RADIUS, G as PORT_SIZE, o as WORKFLOW_LINE_ENTITY, K as WorkfloEntityHoverable, s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, Q as WorkflowDocumentOptionsDefault, M 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-B4Mfa03B.js';
7
- import { W as WorkflowNodeEntity } from './workflow-sub-canvas-DOVla1mw.js';
8
- export { a as WorkflowSubCanvas } from './workflow-sub-canvas-DOVla1mw.js';
5
+ import { W as WorkflowHoverService, a as WorkflowDocument, b as WorkflowLinesManager, c as WorkflowSelectService, d as WorkflowDocumentOptions, L as LineEventProps, N as NodesDragEvent, e as WorkflowNodeJSON, f as WorkflowPortEntity, g as WorkflowLineEntity, O as OnDragLineEnd, h as WorkflowPorts, i as WorkflowPortType, j as WorkflowPort, k as LineRenderType, l as WorkflowLineRenderContribution, m as LinePosition } from './workflow-line-entity-D4-erSyq.js';
6
+ export { J as HoverPosition, C as LINE_HOVER_DISTANCE, v as LineColor, w as LineColors, u as LineType, z as NodesDragEndEvent, y as NodesDragStartEvent, A as NodesDraggingEvent, P as POINT_RADIUS, G as PORT_SIZE, o as WORKFLOW_LINE_ENTITY, K as WorkfloEntityHoverable, s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, Q as WorkflowDocumentOptionsDefault, M 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-D4-erSyq.js';
7
+ import { W as WorkflowNodeEntity } from './workflow-sub-canvas-IQzlYvPD.js';
8
+ export { a as WorkflowSubCanvas } from './workflow-sub-canvas-IQzlYvPD.js';
9
9
  import * as _flowgram_ai_utils from '@flowgram.ai/utils';
10
10
  import { DisposableCollection, IPoint, Disposable, Rectangle } from '@flowgram.ai/utils';
11
11
  export { compose, composeAsync, delay } from '@flowgram.ai/utils';
@@ -17,6 +17,10 @@ export { WorkflowEdgeJSON } from './typings/workflow-edge.js';
17
17
  export { WorkflowNodeFormMeta, WorkflowNodeRegistry, WorkflowNodeRenderProps } from './typings/workflow-registry.js';
18
18
  import '@flowgram.ai/form-core';
19
19
 
20
+ /**
21
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
22
+ * SPDX-License-Identifier: MIT
23
+ */
20
24
  declare enum WorkflowCommands {
21
25
  DELETE_NODES = "DELETE_NODES",
22
26
  COPY_NODES = "COPY_NODES",
@@ -88,7 +92,9 @@ declare class WorkflowDragService {
88
92
  */
89
93
  canDropToNode(params: {
90
94
  dragNodeType?: FlowNodeType;
95
+ dragNode?: WorkflowNodeEntity;
91
96
  dropNode?: WorkflowNodeEntity;
97
+ dropNodeType?: FlowNodeType;
92
98
  }): {
93
99
  allowDrop: boolean;
94
100
  message?: string;
@@ -181,6 +187,11 @@ declare class WorkflowOperationBaseServiceImpl extends FlowOperationBaseServiceI
181
187
  updateNodePosition(nodeOrId: FlowNodeEntityOrId, position: IPoint): void;
182
188
  }
183
189
 
190
+ /**
191
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
192
+ * SPDX-License-Identifier: MIT
193
+ */
194
+
184
195
  interface NodeRenderReturnType {
185
196
  id: string;
186
197
  type: string | number;
@@ -266,29 +277,66 @@ interface NodeRenderReturnType {
266
277
  toggleExpand(): void;
267
278
  }
268
279
 
280
+ /**
281
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
282
+ * SPDX-License-Identifier: MIT
283
+ */
284
+
269
285
  declare function useNodeRender(nodeFromProps?: WorkflowNodeEntity): NodeRenderReturnType;
270
286
 
287
+ /**
288
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
289
+ * SPDX-License-Identifier: MIT
290
+ */
271
291
  /**
272
292
  * 获取当前渲染的 dom 节点
273
293
  */
274
294
  declare function useCurrentDomNode(): HTMLDivElement;
275
295
 
296
+ /**
297
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
298
+ * SPDX-License-Identifier: MIT
299
+ */
300
+
276
301
  /**
277
302
  * 获取当前节点
278
303
  */
279
304
  declare function useCurrentEntity(): WorkflowNodeEntity;
280
305
 
306
+ /**
307
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
308
+ * SPDX-License-Identifier: MIT
309
+ */
310
+
281
311
  declare function useWorkflowDocument(): WorkflowDocument;
282
312
 
313
+ /**
314
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
315
+ * SPDX-License-Identifier: MIT
316
+ */
283
317
  /**
284
318
  * 获取 readonly 状态
285
319
  */
286
320
  declare function usePlaygroundReadonlyState(listenChange?: boolean): boolean;
287
321
 
322
+ /**
323
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
324
+ * SPDX-License-Identifier: MIT
325
+ */
288
326
  declare function nanoid(n?: number): string;
289
327
 
328
+ /**
329
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
330
+ * SPDX-License-Identifier: MIT
331
+ */
332
+
290
333
  declare const fitView: (doc: WorkflowDocument, playgroundConfig: PlaygroundConfigEntity, easing?: boolean) => Promise<void>;
291
334
 
335
+ /**
336
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
337
+ * SPDX-License-Identifier: MIT
338
+ */
339
+
292
340
  /**
293
341
  * 获取没有碰撞的位置
294
342
  * 距离很小时,xy 各偏移 30
@@ -296,6 +344,10 @@ declare const fitView: (doc: WorkflowDocument, playgroundConfig: PlaygroundConfi
296
344
  */
297
345
  declare function getAntiOverlapPosition(doc: WorkflowDocument, position: IPoint, containerNode?: WorkflowNodeEntity): IPoint;
298
346
 
347
+ /**
348
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
349
+ * SPDX-License-Identifier: MIT
350
+ */
299
351
  declare enum EditorCursorState {
300
352
  GRAB = "GRAB",
301
353
  SELECT = "SELECT"
@@ -307,6 +359,11 @@ declare enum InteractiveType {
307
359
  PAD = "PAD"
308
360
  }
309
361
 
362
+ /**
363
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
364
+ * SPDX-License-Identifier: MIT
365
+ */
366
+
310
367
  /**
311
368
  * 节点的点位信息
312
369
  * portsData 只监听点位的数目和类型,不监听点位的 position 变化
@@ -388,6 +445,11 @@ declare class WorkflowNodePortsData extends EntityData {
388
445
  protected updatePortEntity(portInfo: WorkflowPort): WorkflowPortEntity;
389
446
  }
390
447
 
448
+ /**
449
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
450
+ * SPDX-License-Identifier: MIT
451
+ */
452
+
391
453
  interface WorkflowNodeLines {
392
454
  inputLines: WorkflowLineEntity[];
393
455
  outputLines: WorkflowLineEntity[];
@@ -428,6 +490,11 @@ declare class WorkflowNodeLinesData extends EntityData<WorkflowNodeLines> {
428
490
  removeLine(line: WorkflowLineEntity): void;
429
491
  }
430
492
 
493
+ /**
494
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
495
+ * SPDX-License-Identifier: MIT
496
+ */
497
+
431
498
  interface WorkflowLineRenderDataSchema {
432
499
  version: string;
433
500
  contributions: Map<LineRenderType, WorkflowLineRenderContribution>;
@@ -459,8 +526,18 @@ declare class WorkflowLineRenderData extends EntityData<WorkflowLineRenderDataSc
459
526
  private registerContribution;
460
527
  }
461
528
 
529
+ /**
530
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
531
+ * SPDX-License-Identifier: MIT
532
+ */
533
+
462
534
  declare const WorkflowDocumentContainerModule: ContainerModule;
463
535
 
536
+ /**
537
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
538
+ * SPDX-License-Identifier: MIT
539
+ */
540
+
464
541
  interface StraightData {
465
542
  points: IPoint[];
466
543
  path: string;
package/dist/index.js CHANGED
@@ -2528,6 +2528,7 @@ var WorkflowDragService = class {
2528
2528
  const dropNode = this._dropNode;
2529
2529
  const { allowDrop } = this.canDropToNode({
2530
2530
  dragNodeType: type,
2531
+ dropNodeType: dropNode?.flowNodeType,
2531
2532
  dropNode
2532
2533
  });
2533
2534
  const dragNode = allowDrop ? await this.dropCard(type, e, data, dropNode) : void 0;
@@ -2587,7 +2588,20 @@ var WorkflowDragService = class {
2587
2588
  * 判断是否可以放置节点
2588
2589
  */
2589
2590
  canDropToNode(params) {
2591
+ const { canDropToNode } = this.document.options;
2590
2592
  const { dragNodeType, dropNode } = params;
2593
+ if (canDropToNode) {
2594
+ const result = canDropToNode(params);
2595
+ if (result) {
2596
+ return {
2597
+ allowDrop: true,
2598
+ dropNode
2599
+ };
2600
+ }
2601
+ return {
2602
+ allowDrop: false
2603
+ };
2604
+ }
2591
2605
  if (!dragNodeType) {
2592
2606
  return {
2593
2607
  allowDrop: false,