@aranzatech/diagrams-bpmn 0.3.5 → 0.3.6

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 (55) hide show
  1. package/dist/{catalog-DNIyjHbl.d.ts → catalog-CYZHikuU.d.ts} +1 -1
  2. package/dist/{catalog-DG-sz0VM.d.cts → catalog-C_S9hyyn.d.cts} +1 -1
  3. package/dist/{chunk-JFYWN6QH.js → chunk-EMTO53AN.js} +52 -73
  4. package/dist/chunk-EMTO53AN.js.map +1 -0
  5. package/dist/chunk-G22XQD6H.js +64 -0
  6. package/dist/chunk-G22XQD6H.js.map +1 -0
  7. package/dist/{chunk-NYIYQUGX.js → chunk-OFOTX3LA.js} +124 -20
  8. package/dist/chunk-OFOTX3LA.js.map +1 -0
  9. package/dist/{chunk-YAYZW45I.js → chunk-SRUWPELT.js} +80 -3
  10. package/dist/chunk-SRUWPELT.js.map +1 -0
  11. package/dist/edges/index.cjs +73 -35
  12. package/dist/edges/index.cjs.map +1 -1
  13. package/dist/edges/index.js +2 -1
  14. package/dist/elements/index.d.cts +3 -3
  15. package/dist/elements/index.d.ts +3 -3
  16. package/dist/extensions/index.d.cts +2 -2
  17. package/dist/extensions/index.d.ts +2 -2
  18. package/dist/index.cjs +194 -53
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +4 -4
  21. package/dist/index.d.ts +4 -4
  22. package/dist/index.js +4 -3
  23. package/dist/index.js.map +1 -1
  24. package/dist/layout/index.cjs +1146 -872
  25. package/dist/layout/index.cjs.map +1 -1
  26. package/dist/layout/index.d.cts +4 -4
  27. package/dist/layout/index.d.ts +4 -4
  28. package/dist/layout/index.js +560 -89
  29. package/dist/layout/index.js.map +1 -1
  30. package/dist/modeling/index.cjs +78 -0
  31. package/dist/modeling/index.cjs.map +1 -1
  32. package/dist/modeling/index.d.cts +10 -5
  33. package/dist/modeling/index.d.ts +10 -5
  34. package/dist/modeling/index.js +1 -1
  35. package/dist/{types-nvF59RGF.d.cts → types--x9aoecw.d.cts} +5 -0
  36. package/dist/{types-nvF59RGF.d.ts → types--x9aoecw.d.ts} +5 -0
  37. package/dist/{types-dQUuSnV5.d.cts → types-CrFDTGo9.d.cts} +1 -1
  38. package/dist/{types-CuDL2YGL.d.ts → types-DoPv3m7u.d.ts} +2 -2
  39. package/dist/{types-X5FyP8oS.d.ts → types-DteJykQG.d.ts} +1 -1
  40. package/dist/{types-CDp9kWQ4.d.cts → types-YZ4sj3Ih.d.cts} +2 -2
  41. package/dist/validation/index.d.cts +3 -3
  42. package/dist/validation/index.d.ts +3 -3
  43. package/dist/xml/index.cjs +162 -18
  44. package/dist/xml/index.cjs.map +1 -1
  45. package/dist/xml/index.d.cts +4 -4
  46. package/dist/xml/index.d.ts +4 -4
  47. package/dist/xml/index.js +2 -1
  48. package/package.json +1 -1
  49. package/dist/chunk-FFWJA5BV.js +0 -163
  50. package/dist/chunk-FFWJA5BV.js.map +0 -1
  51. package/dist/chunk-JFYWN6QH.js.map +0 -1
  52. package/dist/chunk-NYIYQUGX.js.map +0 -1
  53. package/dist/chunk-YAYZW45I.js.map +0 -1
  54. package/dist/elk-QT7H4252.js +0 -6
  55. package/dist/elk-QT7H4252.js.map +0 -1
@@ -1,10 +1,10 @@
1
1
  import { ModelingRules, ClipboardState, DiagramSnapshot, DiagramState, DiagramEventBus, ResizeHandlePosition, DiagramCommand, ConnectionValidator, SmartGuideResult, SelectionState, LayoutCacheOptions, LayoutCache, EdgeLabelOffsetOptions, EdgeLabelLayout, CommandStackState, Viewport, LayoutFn } from '@aranzatech/diagrams-core';
2
2
  import { DiagramDocument, CreateDiagramDocumentOptions } from '@aranzatech/diagrams-core/serialization';
3
- import { c as BpmnEdgeType, b as BpmnEdgeData, f as BpmnElementType, m as BpmnNodeData } from '../types-nvF59RGF.cjs';
4
- import { d as BpmnRFNode, c as BpmnRFEdge } from '../types-CDp9kWQ4.cjs';
5
- export { g as getBpmnElementSize, i as isBpmnElementResizable } from '../catalog-DG-sz0VM.cjs';
3
+ import { c as BpmnEdgeType, b as BpmnEdgeData, f as BpmnElementType, m as BpmnNodeData } from '../types--x9aoecw.cjs';
4
+ import { d as BpmnRFNode, c as BpmnRFEdge } from '../types-YZ4sj3Ih.cjs';
5
+ export { g as getBpmnElementSize, i as isBpmnElementResizable } from '../catalog-C_S9hyyn.cjs';
6
6
  import '@xyflow/react';
7
- import '../types-dQUuSnV5.cjs';
7
+ import '../types-CrFDTGo9.cjs';
8
8
 
9
9
  type BpmnDiagramState = DiagramState<BpmnRFNode, BpmnRFEdge>;
10
10
  type BpmnClipboardState = ClipboardState<BpmnRFNode, BpmnRFEdge>;
@@ -217,6 +217,11 @@ declare function getBpmnPoolLaneNodeMinSize(state: BpmnDiagramState, nodeId: str
217
217
  height: number;
218
218
  } | undefined;
219
219
  declare function applyBpmnPoolLaneDimensionChange(nodes: BpmnRFNode[], previousNodes: BpmnRFNode[], nodeId: string, width: number, height: number): BpmnRFNode[];
220
+ interface GrowBpmnContainersOptions {
221
+ /** Clearance between content and container borders. Default 24. */
222
+ growPad?: number;
223
+ }
224
+ declare function growBpmnContainersToFit(nodes: BpmnRFNode[], options?: GrowBpmnContainersOptions): BpmnRFNode[];
220
225
  declare function layoutBpmnPoolLaneNodes(nodes: BpmnRFNode[], poolId: string): BpmnRFNode[];
221
226
  declare function reorderBpmnLaneAfterDrop(nodes: BpmnRFNode[], laneId: string): BpmnRFNode[];
222
227
  declare function getBpmnNodeSize(node: BpmnRFNode): {
@@ -360,4 +365,4 @@ declare function createBpmnLayoutCache(options?: LayoutCacheOptions): LayoutCach
360
365
  */
361
366
  declare function withBpmnLayoutCache(layoutFn: LayoutFn<BpmnRFNode, BpmnRFEdge>, cache?: LayoutCache): LayoutFn<BpmnRFNode, BpmnRFEdge>;
362
367
 
363
- export { BPMN_EDGE_CONNECTION_RULES, BPMN_MODELING_RULES, BPMN_POOL_LANE_LAYOUT, BPMN_POOL_LANE_STACK_LAYOUT, BPMN_ROUTABLE_EDGE_TYPES, BPMN_SELECTION_STYLE, type BpmnBoundaryAttachment, type BpmnClipboardState, type BpmnConnectionResolution, type BpmnConnectionRule, type BpmnDiagramDocument, type BpmnDiagramSnapshot, type BpmnDiagramState, type BpmnDropTargetResolution, type BpmnEdgeLaneContext, type BpmnEventBus, type ConnectBpmnOptions, type CreateBpmnNodeOptions, type FindBpmnContainerAtOptions, type GroupAsBpmnSubProcessOptions, type MoveBpmnLaneOptions, type PasteBpmnOptions, type ReorderBpmnLaneOptions, type ReparentBpmnNodeAtPositionOptions, type ReparentBpmnNodeOptions, type ReplaceBpmnNodeOptions, type ResizeBpmnNodeByHandleOptions, type ResizeBpmnNodeOptions, type ResolveBpmnDropTargetOptions, type RouteBpmnEdgeOptions, applyBpmnPoolLaneDimensionChange, attachBoundaryEventCommand, bpmnConnectionValidators, canContainBpmnElement, computeBpmnSmartGuides, connectBpmnCommand, copyBpmnElements, createBpmnDiagramDocument, createBpmnEventBus, createBpmnLayoutCache, createBpmnNode, createBpmnNodeCommand, deleteBpmnElementsCommand, deserializeBpmnDiagram, deserializeBpmnDiagramSnapshot, findBpmnContainerAt, getAppendedBpmnLaneFrame, getBoundaryEventAttachment, getBpmnDragHandleSelector, getBpmnEdgeLabelLayout, getBpmnEdgeLaneContext, getBpmnLaneIndexAtPosition, getBpmnNodeAbsolutePosition, getBpmnNodeCenter, getBpmnNodeSize, getBpmnNodeZIndex, getBpmnPoolLaneNodeMaxSize, getBpmnPoolLaneNodeMinSize, getBpmnPoolLanes, getBpmnPoolOrientation, getBpmnTabOrder, groupAsBpmnSubProcessCommand, inferBpmnEdgeType, isBpmnDroppableInContainer, isBpmnEdgeRoutingEditable, isBpmnProcessNode, layoutBpmnPoolLaneNodes, layoutBpmnPoolLaneNodesPreservingHeights, layoutBpmnPoolLanes, moveBpmnLaneCommand, parseBpmnDiagramDocument, pasteBpmnElementsCommand, persistBpmnHistory, reorderBpmnLane, reorderBpmnLaneAfterDrop, reorderBpmnLaneCommand, reorderBpmnPoolLaneAfterDropPreservingHeights, reparentBpmnNodeAtPosition, reparentBpmnNodeCommand, replaceBpmnNodeCommand, resizeBpmnNodeByHandleCommand, resizeBpmnNodeCommand, resolveBpmnConnection, resolveBpmnDropTarget, restoreBpmnHistory, routeBpmnEdgeCommand, runBpmnCommand, runBpmnCommands, selectBpmnElementsCommand, serializeBpmnDiagram, toBpmnRelativePosition, validateBpmnConnectionForEdgeType, withBpmnLayoutCache, withBpmnNodeZIndexes };
368
+ export { BPMN_EDGE_CONNECTION_RULES, BPMN_MODELING_RULES, BPMN_POOL_LANE_LAYOUT, BPMN_POOL_LANE_STACK_LAYOUT, BPMN_ROUTABLE_EDGE_TYPES, BPMN_SELECTION_STYLE, type BpmnBoundaryAttachment, type BpmnClipboardState, type BpmnConnectionResolution, type BpmnConnectionRule, type BpmnDiagramDocument, type BpmnDiagramSnapshot, type BpmnDiagramState, type BpmnDropTargetResolution, type BpmnEdgeLaneContext, type BpmnEventBus, type ConnectBpmnOptions, type CreateBpmnNodeOptions, type FindBpmnContainerAtOptions, type GroupAsBpmnSubProcessOptions, type GrowBpmnContainersOptions, type MoveBpmnLaneOptions, type PasteBpmnOptions, type ReorderBpmnLaneOptions, type ReparentBpmnNodeAtPositionOptions, type ReparentBpmnNodeOptions, type ReplaceBpmnNodeOptions, type ResizeBpmnNodeByHandleOptions, type ResizeBpmnNodeOptions, type ResolveBpmnDropTargetOptions, type RouteBpmnEdgeOptions, applyBpmnPoolLaneDimensionChange, attachBoundaryEventCommand, bpmnConnectionValidators, canContainBpmnElement, computeBpmnSmartGuides, connectBpmnCommand, copyBpmnElements, createBpmnDiagramDocument, createBpmnEventBus, createBpmnLayoutCache, createBpmnNode, createBpmnNodeCommand, deleteBpmnElementsCommand, deserializeBpmnDiagram, deserializeBpmnDiagramSnapshot, findBpmnContainerAt, getAppendedBpmnLaneFrame, getBoundaryEventAttachment, getBpmnDragHandleSelector, getBpmnEdgeLabelLayout, getBpmnEdgeLaneContext, getBpmnLaneIndexAtPosition, getBpmnNodeAbsolutePosition, getBpmnNodeCenter, getBpmnNodeSize, getBpmnNodeZIndex, getBpmnPoolLaneNodeMaxSize, getBpmnPoolLaneNodeMinSize, getBpmnPoolLanes, getBpmnPoolOrientation, getBpmnTabOrder, groupAsBpmnSubProcessCommand, growBpmnContainersToFit, inferBpmnEdgeType, isBpmnDroppableInContainer, isBpmnEdgeRoutingEditable, isBpmnProcessNode, layoutBpmnPoolLaneNodes, layoutBpmnPoolLaneNodesPreservingHeights, layoutBpmnPoolLanes, moveBpmnLaneCommand, parseBpmnDiagramDocument, pasteBpmnElementsCommand, persistBpmnHistory, reorderBpmnLane, reorderBpmnLaneAfterDrop, reorderBpmnLaneCommand, reorderBpmnPoolLaneAfterDropPreservingHeights, reparentBpmnNodeAtPosition, reparentBpmnNodeCommand, replaceBpmnNodeCommand, resizeBpmnNodeByHandleCommand, resizeBpmnNodeCommand, resolveBpmnConnection, resolveBpmnDropTarget, restoreBpmnHistory, routeBpmnEdgeCommand, runBpmnCommand, runBpmnCommands, selectBpmnElementsCommand, serializeBpmnDiagram, toBpmnRelativePosition, validateBpmnConnectionForEdgeType, withBpmnLayoutCache, withBpmnNodeZIndexes };
@@ -1,10 +1,10 @@
1
1
  import { ModelingRules, ClipboardState, DiagramSnapshot, DiagramState, DiagramEventBus, ResizeHandlePosition, DiagramCommand, ConnectionValidator, SmartGuideResult, SelectionState, LayoutCacheOptions, LayoutCache, EdgeLabelOffsetOptions, EdgeLabelLayout, CommandStackState, Viewport, LayoutFn } from '@aranzatech/diagrams-core';
2
2
  import { DiagramDocument, CreateDiagramDocumentOptions } from '@aranzatech/diagrams-core/serialization';
3
- import { c as BpmnEdgeType, b as BpmnEdgeData, f as BpmnElementType, m as BpmnNodeData } from '../types-nvF59RGF.js';
4
- import { d as BpmnRFNode, c as BpmnRFEdge } from '../types-CuDL2YGL.js';
5
- export { g as getBpmnElementSize, i as isBpmnElementResizable } from '../catalog-DNIyjHbl.js';
3
+ import { c as BpmnEdgeType, b as BpmnEdgeData, f as BpmnElementType, m as BpmnNodeData } from '../types--x9aoecw.js';
4
+ import { d as BpmnRFNode, c as BpmnRFEdge } from '../types-DoPv3m7u.js';
5
+ export { g as getBpmnElementSize, i as isBpmnElementResizable } from '../catalog-CYZHikuU.js';
6
6
  import '@xyflow/react';
7
- import '../types-X5FyP8oS.js';
7
+ import '../types-DteJykQG.js';
8
8
 
9
9
  type BpmnDiagramState = DiagramState<BpmnRFNode, BpmnRFEdge>;
10
10
  type BpmnClipboardState = ClipboardState<BpmnRFNode, BpmnRFEdge>;
@@ -217,6 +217,11 @@ declare function getBpmnPoolLaneNodeMinSize(state: BpmnDiagramState, nodeId: str
217
217
  height: number;
218
218
  } | undefined;
219
219
  declare function applyBpmnPoolLaneDimensionChange(nodes: BpmnRFNode[], previousNodes: BpmnRFNode[], nodeId: string, width: number, height: number): BpmnRFNode[];
220
+ interface GrowBpmnContainersOptions {
221
+ /** Clearance between content and container borders. Default 24. */
222
+ growPad?: number;
223
+ }
224
+ declare function growBpmnContainersToFit(nodes: BpmnRFNode[], options?: GrowBpmnContainersOptions): BpmnRFNode[];
220
225
  declare function layoutBpmnPoolLaneNodes(nodes: BpmnRFNode[], poolId: string): BpmnRFNode[];
221
226
  declare function reorderBpmnLaneAfterDrop(nodes: BpmnRFNode[], laneId: string): BpmnRFNode[];
222
227
  declare function getBpmnNodeSize(node: BpmnRFNode): {
@@ -360,4 +365,4 @@ declare function createBpmnLayoutCache(options?: LayoutCacheOptions): LayoutCach
360
365
  */
361
366
  declare function withBpmnLayoutCache(layoutFn: LayoutFn<BpmnRFNode, BpmnRFEdge>, cache?: LayoutCache): LayoutFn<BpmnRFNode, BpmnRFEdge>;
362
367
 
363
- export { BPMN_EDGE_CONNECTION_RULES, BPMN_MODELING_RULES, BPMN_POOL_LANE_LAYOUT, BPMN_POOL_LANE_STACK_LAYOUT, BPMN_ROUTABLE_EDGE_TYPES, BPMN_SELECTION_STYLE, type BpmnBoundaryAttachment, type BpmnClipboardState, type BpmnConnectionResolution, type BpmnConnectionRule, type BpmnDiagramDocument, type BpmnDiagramSnapshot, type BpmnDiagramState, type BpmnDropTargetResolution, type BpmnEdgeLaneContext, type BpmnEventBus, type ConnectBpmnOptions, type CreateBpmnNodeOptions, type FindBpmnContainerAtOptions, type GroupAsBpmnSubProcessOptions, type MoveBpmnLaneOptions, type PasteBpmnOptions, type ReorderBpmnLaneOptions, type ReparentBpmnNodeAtPositionOptions, type ReparentBpmnNodeOptions, type ReplaceBpmnNodeOptions, type ResizeBpmnNodeByHandleOptions, type ResizeBpmnNodeOptions, type ResolveBpmnDropTargetOptions, type RouteBpmnEdgeOptions, applyBpmnPoolLaneDimensionChange, attachBoundaryEventCommand, bpmnConnectionValidators, canContainBpmnElement, computeBpmnSmartGuides, connectBpmnCommand, copyBpmnElements, createBpmnDiagramDocument, createBpmnEventBus, createBpmnLayoutCache, createBpmnNode, createBpmnNodeCommand, deleteBpmnElementsCommand, deserializeBpmnDiagram, deserializeBpmnDiagramSnapshot, findBpmnContainerAt, getAppendedBpmnLaneFrame, getBoundaryEventAttachment, getBpmnDragHandleSelector, getBpmnEdgeLabelLayout, getBpmnEdgeLaneContext, getBpmnLaneIndexAtPosition, getBpmnNodeAbsolutePosition, getBpmnNodeCenter, getBpmnNodeSize, getBpmnNodeZIndex, getBpmnPoolLaneNodeMaxSize, getBpmnPoolLaneNodeMinSize, getBpmnPoolLanes, getBpmnPoolOrientation, getBpmnTabOrder, groupAsBpmnSubProcessCommand, inferBpmnEdgeType, isBpmnDroppableInContainer, isBpmnEdgeRoutingEditable, isBpmnProcessNode, layoutBpmnPoolLaneNodes, layoutBpmnPoolLaneNodesPreservingHeights, layoutBpmnPoolLanes, moveBpmnLaneCommand, parseBpmnDiagramDocument, pasteBpmnElementsCommand, persistBpmnHistory, reorderBpmnLane, reorderBpmnLaneAfterDrop, reorderBpmnLaneCommand, reorderBpmnPoolLaneAfterDropPreservingHeights, reparentBpmnNodeAtPosition, reparentBpmnNodeCommand, replaceBpmnNodeCommand, resizeBpmnNodeByHandleCommand, resizeBpmnNodeCommand, resolveBpmnConnection, resolveBpmnDropTarget, restoreBpmnHistory, routeBpmnEdgeCommand, runBpmnCommand, runBpmnCommands, selectBpmnElementsCommand, serializeBpmnDiagram, toBpmnRelativePosition, validateBpmnConnectionForEdgeType, withBpmnLayoutCache, withBpmnNodeZIndexes };
368
+ export { BPMN_EDGE_CONNECTION_RULES, BPMN_MODELING_RULES, BPMN_POOL_LANE_LAYOUT, BPMN_POOL_LANE_STACK_LAYOUT, BPMN_ROUTABLE_EDGE_TYPES, BPMN_SELECTION_STYLE, type BpmnBoundaryAttachment, type BpmnClipboardState, type BpmnConnectionResolution, type BpmnConnectionRule, type BpmnDiagramDocument, type BpmnDiagramSnapshot, type BpmnDiagramState, type BpmnDropTargetResolution, type BpmnEdgeLaneContext, type BpmnEventBus, type ConnectBpmnOptions, type CreateBpmnNodeOptions, type FindBpmnContainerAtOptions, type GroupAsBpmnSubProcessOptions, type GrowBpmnContainersOptions, type MoveBpmnLaneOptions, type PasteBpmnOptions, type ReorderBpmnLaneOptions, type ReparentBpmnNodeAtPositionOptions, type ReparentBpmnNodeOptions, type ReplaceBpmnNodeOptions, type ResizeBpmnNodeByHandleOptions, type ResizeBpmnNodeOptions, type ResolveBpmnDropTargetOptions, type RouteBpmnEdgeOptions, applyBpmnPoolLaneDimensionChange, attachBoundaryEventCommand, bpmnConnectionValidators, canContainBpmnElement, computeBpmnSmartGuides, connectBpmnCommand, copyBpmnElements, createBpmnDiagramDocument, createBpmnEventBus, createBpmnLayoutCache, createBpmnNode, createBpmnNodeCommand, deleteBpmnElementsCommand, deserializeBpmnDiagram, deserializeBpmnDiagramSnapshot, findBpmnContainerAt, getAppendedBpmnLaneFrame, getBoundaryEventAttachment, getBpmnDragHandleSelector, getBpmnEdgeLabelLayout, getBpmnEdgeLaneContext, getBpmnLaneIndexAtPosition, getBpmnNodeAbsolutePosition, getBpmnNodeCenter, getBpmnNodeSize, getBpmnNodeZIndex, getBpmnPoolLaneNodeMaxSize, getBpmnPoolLaneNodeMinSize, getBpmnPoolLanes, getBpmnPoolOrientation, getBpmnTabOrder, groupAsBpmnSubProcessCommand, growBpmnContainersToFit, inferBpmnEdgeType, isBpmnDroppableInContainer, isBpmnEdgeRoutingEditable, isBpmnProcessNode, layoutBpmnPoolLaneNodes, layoutBpmnPoolLaneNodesPreservingHeights, layoutBpmnPoolLanes, moveBpmnLaneCommand, parseBpmnDiagramDocument, pasteBpmnElementsCommand, persistBpmnHistory, reorderBpmnLane, reorderBpmnLaneAfterDrop, reorderBpmnLaneCommand, reorderBpmnPoolLaneAfterDropPreservingHeights, reparentBpmnNodeAtPosition, reparentBpmnNodeCommand, replaceBpmnNodeCommand, resizeBpmnNodeByHandleCommand, resizeBpmnNodeCommand, resolveBpmnConnection, resolveBpmnDropTarget, restoreBpmnHistory, routeBpmnEdgeCommand, runBpmnCommand, runBpmnCommands, selectBpmnElementsCommand, serializeBpmnDiagram, toBpmnRelativePosition, validateBpmnConnectionForEdgeType, withBpmnLayoutCache, withBpmnNodeZIndexes };
@@ -1,4 +1,4 @@
1
- export { BPMN_EDGE_CONNECTION_RULES, BPMN_MODELING_RULES, BPMN_POOL_LANE_LAYOUT, BPMN_POOL_LANE_STACK_LAYOUT, BPMN_ROUTABLE_EDGE_TYPES, BPMN_SELECTION_STYLE, applyBpmnPoolLaneDimensionChange, attachBoundaryEventCommand, bpmnConnectionValidators, canContainBpmnElement, computeBpmnSmartGuides, connectBpmnCommand, copyBpmnElements, createBpmnDiagramDocument, createBpmnEventBus, createBpmnLayoutCache, createBpmnNode, createBpmnNodeCommand, deleteBpmnElementsCommand, deserializeBpmnDiagram, deserializeBpmnDiagramSnapshot, findBpmnContainerAt, getAppendedBpmnLaneFrame, getBoundaryEventAttachment, getBpmnDragHandleSelector, getBpmnEdgeLabelLayout, getBpmnEdgeLaneContext, getBpmnLaneIndexAtPosition, getBpmnNodeAbsolutePosition, getBpmnNodeCenter, getBpmnNodeSize, getBpmnNodeZIndex, getBpmnPoolLaneNodeMaxSize, getBpmnPoolLaneNodeMinSize, getBpmnPoolLanes, getBpmnPoolOrientation, getBpmnTabOrder, groupAsBpmnSubProcessCommand, inferBpmnEdgeType, isBpmnDroppableInContainer, isBpmnEdgeRoutingEditable, isBpmnProcessNode, layoutBpmnPoolLaneNodes, layoutBpmnPoolLaneNodesPreservingHeights, layoutBpmnPoolLanes, moveBpmnLaneCommand, parseBpmnDiagramDocument, pasteBpmnElementsCommand, persistBpmnHistory, reorderBpmnLane, reorderBpmnLaneAfterDrop, reorderBpmnLaneCommand, reorderBpmnPoolLaneAfterDropPreservingHeights, reparentBpmnNodeAtPosition, reparentBpmnNodeCommand, replaceBpmnNodeCommand, resizeBpmnNodeByHandleCommand, resizeBpmnNodeCommand, resolveBpmnConnection, resolveBpmnDropTarget, restoreBpmnHistory, routeBpmnEdgeCommand, runBpmnCommand, runBpmnCommands, selectBpmnElementsCommand, serializeBpmnDiagram, toBpmnRelativePosition, validateBpmnConnectionForEdgeType, withBpmnLayoutCache, withBpmnNodeZIndexes } from '../chunk-YAYZW45I.js';
1
+ export { BPMN_EDGE_CONNECTION_RULES, BPMN_MODELING_RULES, BPMN_POOL_LANE_LAYOUT, BPMN_POOL_LANE_STACK_LAYOUT, BPMN_ROUTABLE_EDGE_TYPES, BPMN_SELECTION_STYLE, applyBpmnPoolLaneDimensionChange, attachBoundaryEventCommand, bpmnConnectionValidators, canContainBpmnElement, computeBpmnSmartGuides, connectBpmnCommand, copyBpmnElements, createBpmnDiagramDocument, createBpmnEventBus, createBpmnLayoutCache, createBpmnNode, createBpmnNodeCommand, deleteBpmnElementsCommand, deserializeBpmnDiagram, deserializeBpmnDiagramSnapshot, findBpmnContainerAt, getAppendedBpmnLaneFrame, getBoundaryEventAttachment, getBpmnDragHandleSelector, getBpmnEdgeLabelLayout, getBpmnEdgeLaneContext, getBpmnLaneIndexAtPosition, getBpmnNodeAbsolutePosition, getBpmnNodeCenter, getBpmnNodeSize, getBpmnNodeZIndex, getBpmnPoolLaneNodeMaxSize, getBpmnPoolLaneNodeMinSize, getBpmnPoolLanes, getBpmnPoolOrientation, getBpmnTabOrder, groupAsBpmnSubProcessCommand, growBpmnContainersToFit, inferBpmnEdgeType, isBpmnDroppableInContainer, isBpmnEdgeRoutingEditable, isBpmnProcessNode, layoutBpmnPoolLaneNodes, layoutBpmnPoolLaneNodesPreservingHeights, layoutBpmnPoolLanes, moveBpmnLaneCommand, parseBpmnDiagramDocument, pasteBpmnElementsCommand, persistBpmnHistory, reorderBpmnLane, reorderBpmnLaneAfterDrop, reorderBpmnLaneCommand, reorderBpmnPoolLaneAfterDropPreservingHeights, reparentBpmnNodeAtPosition, reparentBpmnNodeCommand, replaceBpmnNodeCommand, resizeBpmnNodeByHandleCommand, resizeBpmnNodeCommand, resolveBpmnConnection, resolveBpmnDropTarget, restoreBpmnHistory, routeBpmnEdgeCommand, runBpmnCommand, runBpmnCommands, selectBpmnElementsCommand, serializeBpmnDiagram, toBpmnRelativePosition, validateBpmnConnectionForEdgeType, withBpmnLayoutCache, withBpmnNodeZIndexes } from '../chunk-SRUWPELT.js';
2
2
  import '../chunk-RLAJNRF2.js';
3
3
  export { getBpmnElementSize, isBpmnElementResizable } from '../chunk-L5Z22RLX.js';
4
4
  //# sourceMappingURL=index.js.map
@@ -244,6 +244,11 @@ interface InlineDecisionTable {
244
244
  interface BpmnEdgeData extends Record<string, unknown> {
245
245
  label?: string;
246
246
  edgeType: BpmnEdgeType;
247
+ /** Optional visual color override used to differentiate branches and edge groups. */
248
+ color?: {
249
+ stroke: string;
250
+ fill?: string;
251
+ };
247
252
  conditionExpression?: string;
248
253
  /** Sequence flow marked as the default path of a gateway/activity. */
249
254
  isDefault?: boolean;
@@ -244,6 +244,11 @@ interface InlineDecisionTable {
244
244
  interface BpmnEdgeData extends Record<string, unknown> {
245
245
  label?: string;
246
246
  edgeType: BpmnEdgeType;
247
+ /** Optional visual color override used to differentiate branches and edge groups. */
248
+ color?: {
249
+ stroke: string;
250
+ fill?: string;
251
+ };
247
252
  conditionExpression?: string;
248
253
  /** Sequence flow marked as the default path of a gateway/activity. */
249
254
  isDefault?: boolean;
@@ -1,4 +1,4 @@
1
- import { p as BpmnServiceTaskConfig, I as InlineDecisionTable, b as BpmnEdgeData, m as BpmnNodeData } from './types-nvF59RGF.cjs';
1
+ import { p as BpmnServiceTaskConfig, I as InlineDecisionTable, b as BpmnEdgeData, m as BpmnNodeData } from './types--x9aoecw.cjs';
2
2
 
3
3
  type BpmnExecutionEngine = "flowable";
4
4
  interface BpmnAranzaTaskExtensions {
@@ -1,6 +1,6 @@
1
1
  import { Node, Edge } from '@xyflow/react';
2
- import { m as BpmnNodeData, b as BpmnEdgeData, a as BpmnDefinitionsSet } from './types-nvF59RGF.js';
3
- import { b as BpmnFlowableExportOptions } from './types-X5FyP8oS.js';
2
+ import { m as BpmnNodeData, b as BpmnEdgeData, a as BpmnDefinitionsSet } from './types--x9aoecw.js';
3
+ import { b as BpmnFlowableExportOptions } from './types-DteJykQG.js';
4
4
 
5
5
  type BpmnRFNode = Node<BpmnNodeData>;
6
6
  type BpmnRFEdge = Edge<BpmnEdgeData>;
@@ -1,4 +1,4 @@
1
- import { p as BpmnServiceTaskConfig, I as InlineDecisionTable, b as BpmnEdgeData, m as BpmnNodeData } from './types-nvF59RGF.js';
1
+ import { p as BpmnServiceTaskConfig, I as InlineDecisionTable, b as BpmnEdgeData, m as BpmnNodeData } from './types--x9aoecw.js';
2
2
 
3
3
  type BpmnExecutionEngine = "flowable";
4
4
  interface BpmnAranzaTaskExtensions {
@@ -1,6 +1,6 @@
1
1
  import { Node, Edge } from '@xyflow/react';
2
- import { m as BpmnNodeData, b as BpmnEdgeData, a as BpmnDefinitionsSet } from './types-nvF59RGF.cjs';
3
- import { b as BpmnFlowableExportOptions } from './types-dQUuSnV5.cjs';
2
+ import { m as BpmnNodeData, b as BpmnEdgeData, a as BpmnDefinitionsSet } from './types--x9aoecw.cjs';
3
+ import { b as BpmnFlowableExportOptions } from './types-CrFDTGo9.cjs';
4
4
 
5
5
  type BpmnRFNode = Node<BpmnNodeData>;
6
6
  type BpmnRFEdge = Edge<BpmnEdgeData>;
@@ -1,7 +1,7 @@
1
- import { d as BpmnRFNode, c as BpmnRFEdge } from '../types-CDp9kWQ4.cjs';
1
+ import { d as BpmnRFNode, c as BpmnRFEdge } from '../types-YZ4sj3Ih.cjs';
2
2
  import '@xyflow/react';
3
- import '../types-nvF59RGF.cjs';
4
- import '../types-dQUuSnV5.cjs';
3
+ import '../types--x9aoecw.cjs';
4
+ import '../types-CrFDTGo9.cjs';
5
5
 
6
6
  type BpmnValidationSeverity = "error" | "warning" | "info";
7
7
  interface BpmnValidationIssue {
@@ -1,7 +1,7 @@
1
- import { d as BpmnRFNode, c as BpmnRFEdge } from '../types-CuDL2YGL.js';
1
+ import { d as BpmnRFNode, c as BpmnRFEdge } from '../types-DoPv3m7u.js';
2
2
  import '@xyflow/react';
3
- import '../types-nvF59RGF.js';
4
- import '../types-X5FyP8oS.js';
3
+ import '../types--x9aoecw.js';
4
+ import '../types-DteJykQG.js';
5
5
 
6
6
  type BpmnValidationSeverity = "error" | "warning" | "info";
7
7
  interface BpmnValidationIssue {
@@ -1306,10 +1306,21 @@ async function parseBpmnXml(xml) {
1306
1306
  warnings,
1307
1307
  autoX: { value: 50 }
1308
1308
  };
1309
+ const participantProcessIds = /* @__PURE__ */ new Set();
1310
+ for (const rootEl of asElements(rootElement.rootElements)) {
1311
+ if (rootEl.$type !== "bpmn:Collaboration") continue;
1312
+ for (const participant of asElements(rootEl.participants)) {
1313
+ const processRef = participant.processRef;
1314
+ const processId = processRef ? asString(processRef.id) : void 0;
1315
+ if (processId) participantProcessIds.add(processId);
1316
+ }
1317
+ }
1309
1318
  for (const rootEl of asElements(rootElement.rootElements)) {
1310
1319
  if (rootEl.$type === "bpmn:Collaboration") {
1311
1320
  handleCollaboration(rootEl, ctx, nodes, edges);
1312
1321
  } else if (rootEl.$type === "bpmn:Process") {
1322
+ const processId = asString(rootEl.id);
1323
+ if (processId && participantProcessIds.has(processId)) continue;
1313
1324
  const laneMembership = extractLaneMembership(rootEl);
1314
1325
  const laneSets = asLaneSets(rootEl.laneSets);
1315
1326
  if (laneSets.length > 0) {
@@ -1401,6 +1412,47 @@ function normalizeChildPositions(nodes, nodeIds) {
1401
1412
  });
1402
1413
  }
1403
1414
 
1415
+ // src/edges/path.ts
1416
+ var LABEL_MIN_SEGMENT = 40;
1417
+ var LABEL_EXIT_DISTANCE = 28;
1418
+ function getPreferredLabelAnchor(points) {
1419
+ if (points.length === 0) return { x: 0, y: 0 };
1420
+ if (points.length === 1) return points[0];
1421
+ let bestIndex = -1;
1422
+ for (let i = 1; i < points.length; i += 1) {
1423
+ const length = Math.hypot(points[i].x - points[i - 1].x, points[i].y - points[i - 1].y);
1424
+ if (length >= LABEL_MIN_SEGMENT) {
1425
+ bestIndex = i;
1426
+ break;
1427
+ }
1428
+ }
1429
+ if (bestIndex === -1) {
1430
+ let bestLength = -1;
1431
+ bestIndex = 1;
1432
+ for (let i = 1; i < points.length; i += 1) {
1433
+ const length = Math.hypot(points[i].x - points[i - 1].x, points[i].y - points[i - 1].y);
1434
+ if (length > bestLength) {
1435
+ bestLength = length;
1436
+ bestIndex = i;
1437
+ }
1438
+ }
1439
+ }
1440
+ const from = points[bestIndex - 1];
1441
+ const to = points[bestIndex];
1442
+ const segLength = Math.hypot(to.x - from.x, to.y - from.y);
1443
+ const t = segLength > 0 ? Math.min(0.5, LABEL_EXIT_DISTANCE / segLength) : 0.5;
1444
+ const anchor = {
1445
+ x: from.x + (to.x - from.x) * t,
1446
+ y: from.y + (to.y - from.y) * t
1447
+ };
1448
+ const dx = to.x - from.x;
1449
+ const dy = to.y - from.y;
1450
+ if (Math.abs(dx) >= Math.abs(dy)) {
1451
+ return { x: anchor.x, y: anchor.y - 12 };
1452
+ }
1453
+ return { x: anchor.x + 12, y: anchor.y };
1454
+ }
1455
+
1404
1456
  // src/extensions/types.ts
1405
1457
  function hasText(value) {
1406
1458
  return typeof value === "string" && value.trim().length > 0;
@@ -1996,6 +2048,24 @@ function buildEdgeElement(moddle, edge, nodeById) {
1996
2048
  }
1997
2049
  return moddle.create(moddleType, attrs);
1998
2050
  }
2051
+ var DI_EXTERNAL_LABEL_TYPES = /* @__PURE__ */ new Set([
2052
+ "ExclusiveGateway",
2053
+ "InclusiveGateway",
2054
+ "ParallelGateway",
2055
+ "EventBasedGateway",
2056
+ "ComplexGateway",
2057
+ "StartEvent",
2058
+ "EndEvent",
2059
+ "IntermediateCatchEvent",
2060
+ "IntermediateThrowEvent",
2061
+ "BoundaryEvent"
2062
+ ]);
2063
+ var DI_LABEL_CHAR_W = 6.5;
2064
+ var DI_LABEL_MAX_W = 150;
2065
+ var DI_LABEL_H = 14;
2066
+ function diLabelWidth(label) {
2067
+ return Math.min(Math.ceil(label.length * DI_LABEL_CHAR_W), DI_LABEL_MAX_W);
2068
+ }
1999
2069
  function buildBpmnDI(moddle, definitions, nodes, edges) {
2000
2070
  const shapes = [];
2001
2071
  const edgeShapes = [];
@@ -2018,19 +2088,47 @@ function buildBpmnDI(moddle, definitions, nodes, edges) {
2018
2088
  if (node.data.isExpanded !== void 0) {
2019
2089
  shape.isExpanded = node.data.isExpanded;
2020
2090
  }
2091
+ const nodeLabel = typeof node.data.label === "string" ? node.data.label : "";
2092
+ if (nodeLabel && DI_EXTERNAL_LABEL_TYPES.has(node.data.elementType)) {
2093
+ const absPos = absolutePositionById.get(node.id) ?? node.position;
2094
+ const labelW = diLabelWidth(nodeLabel);
2095
+ shape.label = moddle.create("bpmndi:BPMNLabel", {
2096
+ bounds: moddle.create("dc:Bounds", {
2097
+ x: absPos.x + w / 2 - labelW / 2,
2098
+ y: absPos.y + h + 4,
2099
+ width: labelW,
2100
+ height: DI_LABEL_H
2101
+ })
2102
+ });
2103
+ }
2021
2104
  shapes.push(shape);
2022
2105
  }
2023
2106
  for (const edge of edges) {
2024
- const waypoints = resolveEdgeWaypoints(edge, nodes, absolutePositionById).map(
2107
+ const waypointPts = resolveEdgeWaypoints(edge, nodes, absolutePositionById);
2108
+ const waypoints = waypointPts.map(
2025
2109
  (p) => moddle.create("dc:Point", { x: p.x, y: p.y })
2026
2110
  );
2027
- edgeShapes.push(
2028
- moddle.create("bpmndi:BPMNEdge", {
2029
- id: uid("BPMNEdge", edge.id),
2030
- bpmnElement: { id: edge.id },
2031
- waypoint: waypoints
2032
- })
2033
- );
2111
+ const bpmnEdge = moddle.create("bpmndi:BPMNEdge", {
2112
+ id: uid("BPMNEdge", edge.id),
2113
+ bpmnElement: { id: edge.id },
2114
+ waypoint: waypoints
2115
+ });
2116
+ const edgeLabel = typeof edge.data?.label === "string" ? edge.data.label : "";
2117
+ if (edgeLabel && waypointPts.length >= 2) {
2118
+ const anchor = getPreferredLabelAnchor(waypointPts);
2119
+ const offsetX = typeof edge.data?.labelOffsetX === "number" ? edge.data.labelOffsetX : 0;
2120
+ const offsetY = typeof edge.data?.labelOffsetY === "number" ? edge.data.labelOffsetY : 0;
2121
+ const labelW = diLabelWidth(edgeLabel);
2122
+ bpmnEdge.label = moddle.create("bpmndi:BPMNLabel", {
2123
+ bounds: moddle.create("dc:Bounds", {
2124
+ x: anchor.x + offsetX - labelW / 2,
2125
+ y: anchor.y + offsetY - DI_LABEL_H / 2,
2126
+ width: labelW,
2127
+ height: DI_LABEL_H
2128
+ })
2129
+ });
2130
+ }
2131
+ edgeShapes.push(bpmnEdge);
2034
2132
  }
2035
2133
  const rootEls = definitions.rootElements;
2036
2134
  const planeElement = rootEls?.find((element) => element.$type === "bpmn:Collaboration") ?? rootEls?.find((element) => element.$type === "bpmn:Process") ?? rootEls?.[0];
@@ -2054,17 +2152,63 @@ function resolveEdgeWaypoints(edge, nodes, absolutePositionById) {
2054
2152
  if (!source || !target) return [];
2055
2153
  const sourceMeta = BPMN_ELEMENT_CATALOG[source.data.elementType];
2056
2154
  const targetMeta = BPMN_ELEMENT_CATALOG[target.data.elementType];
2057
- const sourcePosition = absolutePositionById.get(source.id) ?? source.position;
2058
- const targetPosition = absolutePositionById.get(target.id) ?? target.position;
2155
+ const sPos = absolutePositionById.get(source.id) ?? source.position;
2156
+ const tPos = absolutePositionById.get(target.id) ?? target.position;
2157
+ const sW = source.width ?? sourceMeta.defaultWidth;
2158
+ const sH = source.height ?? sourceMeta.defaultHeight;
2159
+ const tW = target.width ?? targetMeta.defaultWidth;
2160
+ const tH = target.height ?? targetMeta.defaultHeight;
2161
+ const sCX = sPos.x + sW / 2;
2162
+ const sCY = sPos.y + sH / 2;
2163
+ const tCX = tPos.x + tW / 2;
2164
+ const tCY = tPos.y + tH / 2;
2165
+ if (Math.abs(sCY - tCY) <= 1) {
2166
+ if (tPos.x >= sPos.x + sW) return [{ x: sPos.x + sW, y: sCY }, { x: tPos.x, y: sCY }];
2167
+ if (sPos.x >= tPos.x + tW) return [{ x: sPos.x, y: sCY }, { x: tPos.x + tW, y: sCY }];
2168
+ }
2169
+ if (Math.abs(sCX - tCX) <= 1) {
2170
+ if (tPos.y >= sPos.y + sH) return [{ x: sCX, y: sPos.y + sH }, { x: sCX, y: tPos.y }];
2171
+ if (sPos.y >= tPos.y + tH) return [{ x: sCX, y: sPos.y }, { x: sCX, y: tPos.y + tH }];
2172
+ }
2173
+ if (tPos.x >= sPos.x + sW) {
2174
+ const midX = (sPos.x + sW + tPos.x) / 2;
2175
+ return [
2176
+ { x: sPos.x + sW, y: sCY },
2177
+ { x: midX, y: sCY },
2178
+ { x: midX, y: tCY },
2179
+ { x: tPos.x, y: tCY }
2180
+ ];
2181
+ }
2182
+ if (sPos.x >= tPos.x + tW) {
2183
+ const midX = (tPos.x + tW + sPos.x) / 2;
2184
+ return [
2185
+ { x: sPos.x, y: sCY },
2186
+ { x: midX, y: sCY },
2187
+ { x: midX, y: tCY },
2188
+ { x: tPos.x + tW, y: tCY }
2189
+ ];
2190
+ }
2191
+ if (tPos.y >= sPos.y + sH) {
2192
+ const midY = (sPos.y + sH + tPos.y) / 2;
2193
+ return [
2194
+ { x: sCX, y: sPos.y + sH },
2195
+ { x: sCX, y: midY },
2196
+ { x: tCX, y: midY },
2197
+ { x: tCX, y: tPos.y }
2198
+ ];
2199
+ }
2200
+ if (sPos.y >= tPos.y + tH) {
2201
+ const midY = (tPos.y + tH + sPos.y) / 2;
2202
+ return [
2203
+ { x: sCX, y: sPos.y },
2204
+ { x: sCX, y: midY },
2205
+ { x: tCX, y: midY },
2206
+ { x: tCX, y: tPos.y + tH }
2207
+ ];
2208
+ }
2059
2209
  return [
2060
- {
2061
- x: sourcePosition.x + (source.width ?? sourceMeta.defaultWidth) / 2,
2062
- y: sourcePosition.y + (source.height ?? sourceMeta.defaultHeight) / 2
2063
- },
2064
- {
2065
- x: targetPosition.x + (target.width ?? targetMeta.defaultWidth) / 2,
2066
- y: targetPosition.y + (target.height ?? targetMeta.defaultHeight) / 2
2067
- }
2210
+ { x: sCX, y: sCY },
2211
+ { x: tCX, y: tCY }
2068
2212
  ];
2069
2213
  }
2070
2214
  function buildAbsolutePositionMap(nodes) {