@aranzatech/diagrams-bpmn 0.3.5 → 0.3.7

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 +1190 -874
  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 +604 -91
  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 +1 @@
1
- {"version":3,"sources":["../../src/edges/path.ts","../../src/edges/SequenceFlowEdge.tsx","../../src/edges/MessageFlowEdge.tsx","../../src/edges/AssociationEdge.tsx","../../src/edges/DataAssociationEdge.tsx","../../src/nodes/shared/theme.ts","../../src/edges/ConversationLinkEdge.tsx","../../src/edges/edgeTypes.ts"],"names":["dx","dy","pointsToSvgPath","getOrthogonalPath","useReactFlow","useRef","useCallback","jsxs","Fragment","jsx","BaseEdge","EdgeLabelRenderer","getStraightPath"],"mappings":";;;;;;;;;;AA8DO,SAAS,wBAAwB,MAAA,EAAsC;AAC5E,EAAA,IAAI,MAAA,CAAO,WAAW,CAAA,EAAG,OAAO,EAAE,CAAA,EAAG,CAAA,EAAG,GAAG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A,EAAiB,mBAAA;AAAA,EACjB,gBAAA,EAAkB;AACpB","file":"index.cjs","sourcesContent":["import type { Position } from \"@xyflow/react\";\n\nexport interface EdgePoint {\n x: number;\n y: number;\n}\n\nexport interface EdgeLabelAnchor {\n x: number;\n y: number;\n}\n\nexport function getEdgePoints(\n sourceX: number,\n sourceY: number,\n targetX: number,\n targetY: number,\n routingPoints?: EdgePoint[],\n): EdgePoint[] {\n if (routingPoints && routingPoints.length >= 2) {\n return routingPoints;\n }\n\n return [\n { x: sourceX, y: sourceY },\n { x: targetX, y: targetY },\n ];\n}\n\nexport function getPolylineMidpoint(points: EdgePoint[]): EdgePoint {\n if (points.length === 0) return { x: 0, y: 0 };\n if (points.length === 1) return points[0];\n\n let total = 0;\n const lengths: number[] = [];\n\n for (let i = 1; i < points.length; i += 1) {\n const dx = points[i].x - points[i - 1].x;\n const dy = points[i].y - points[i - 1].y;\n const length = Math.hypot(dx, dy);\n lengths.push(length);\n total += length;\n }\n\n const halfway = total / 2;\n let traversed = 0;\n\n for (let i = 1; i < points.length; i += 1) {\n const length = lengths[i - 1];\n if (traversed + length >= halfway) {\n const ratio = length === 0 ? 0 : (halfway - traversed) / length;\n return {\n x: points[i - 1].x + (points[i].x - points[i - 1].x) * ratio,\n y: points[i - 1].y + (points[i].y - points[i - 1].y) * ratio,\n };\n }\n traversed += length;\n }\n\n return points[points.length - 1];\n}\n\nexport function getPreferredLabelAnchor(points: EdgePoint[]): EdgeLabelAnchor {\n if (points.length === 0) return { x: 0, y: 0 };\n if (points.length === 1) return points[0];\n\n let bestIndex = 1;\n let bestLength = -1;\n\n for (let i = 1; i < points.length; i += 1) {\n const dx = points[i].x - points[i - 1].x;\n const dy = points[i].y - points[i - 1].y;\n const length = Math.hypot(dx, dy);\n if (length > bestLength) {\n bestLength = length;\n bestIndex = i;\n }\n }\n\n const from = points[bestIndex - 1];\n const to = points[bestIndex];\n const midpoint = {\n x: from.x + (to.x - from.x) / 2,\n y: from.y + (to.y - from.y) / 2,\n };\n\n const dx = to.x - from.x;\n const dy = to.y - from.y;\n\n if (Math.abs(dx) >= Math.abs(dy)) {\n return { x: midpoint.x, y: midpoint.y - 12 };\n }\n\n return { x: midpoint.x + 12, y: midpoint.y };\n}\n\nexport function getSegmentAngle(points: EdgePoint[]): number {\n if (points.length < 2) return 0;\n const from = points[0];\n const to = points[1];\n return Math.atan2(to.y - from.y, to.x - from.x);\n}\n\nexport function getDefaultFlowMarkerPath(points: EdgePoint[]): string | null {\n if (points.length < 2) return null;\n\n const start = points[0];\n const angle = getSegmentAngle(points);\n const anchorX = start.x + Math.cos(angle) * 16;\n const anchorY = start.y + Math.sin(angle) * 16;\n const normalAngle = angle + Math.PI / 2;\n const half = 7;\n\n const x1 = anchorX + Math.cos(normalAngle) * half;\n const y1 = anchorY + Math.sin(normalAngle) * half;\n const x2 = anchorX - Math.cos(normalAngle) * half;\n const y2 = anchorY - Math.sin(normalAngle) * half;\n\n return `M ${x1} ${y1} L ${x2} ${y2}`;\n}\n\nexport function fallbackAssociationDirection(\n sourcePosition?: Position,\n targetPosition?: Position,\n): \"horizontal\" | \"vertical\" {\n if (sourcePosition === \"left\" || sourcePosition === \"right\" || targetPosition === \"left\" || targetPosition === \"right\") {\n return \"horizontal\";\n }\n\n return \"vertical\";\n}\n","import { useCallback, useRef } from \"react\";\nimport { BaseEdge, EdgeLabelRenderer, useReactFlow, type EdgeProps } from \"@xyflow/react\";\nimport { getOrthogonalPath, pointsToSvgPath } from \"@aranzatech/diagrams-core/routing\";\nimport type { BpmnEdgeData } from \"../elements/types\";\nimport { getDefaultFlowMarkerPath, getPreferredLabelAnchor } from \"./path\";\n\nexport function SequenceFlowEdge({\n id,\n sourceX, sourceY, targetX, targetY,\n sourcePosition, targetPosition,\n data, label, markerEnd, style, selected,\n}: EdgeProps) {\n const d = data as BpmnEdgeData | undefined;\n const points = d?.routingPoints;\n const polyline = points && points.length >= 2\n ? [{ x: sourceX, y: sourceY }, ...points.slice(1, -1), { x: targetX, y: targetY }]\n : [{ x: sourceX, y: sourceY }, { x: targetX, y: targetY }];\n\n const path = points && points.length >= 2\n ? pointsToSvgPath([{ x: sourceX, y: sourceY }, ...points.slice(1, -1), { x: targetX, y: targetY }])\n : getOrthogonalPath(sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition);\n\n const labelAnchor = getPreferredLabelAnchor(polyline);\n const defaultMarkerPath = d?.isDefault ? getDefaultFlowMarkerPath(polyline) : null;\n\n const labelX = labelAnchor.x + (d?.labelOffsetX ?? 0);\n const labelY = labelAnchor.y + (d?.labelOffsetY ?? 0);\n\n const strokeColor = selected ? \"#1a56db\" : \"#404040\";\n const strokeWidth = selected ? 2.25 : 1.5;\n const haloWidth = selected ? 7 : 5;\n\n const { updateEdgeData, getViewport } = useReactFlow();\n const dragStartRef = useRef<{ mx: number; my: number; ox: number; oy: number } | null>(null);\n\n const handleLabelPointerDown = useCallback((e: React.PointerEvent<HTMLDivElement>) => {\n e.stopPropagation();\n e.currentTarget.setPointerCapture(e.pointerId);\n dragStartRef.current = {\n mx: e.clientX,\n my: e.clientY,\n ox: d?.labelOffsetX ?? 0,\n oy: d?.labelOffsetY ?? 0,\n };\n }, [d?.labelOffsetX, d?.labelOffsetY]);\n\n const handleLabelPointerMove = useCallback((e: React.PointerEvent<HTMLDivElement>) => {\n if (!dragStartRef.current) return;\n const { zoom } = getViewport();\n const dx = (e.clientX - dragStartRef.current.mx) / zoom;\n const dy = (e.clientY - dragStartRef.current.my) / zoom;\n updateEdgeData(id, {\n labelOffsetX: dragStartRef.current.ox + dx,\n labelOffsetY: dragStartRef.current.oy + dy,\n });\n }, [id, updateEdgeData, getViewport]);\n\n const handleLabelPointerUp = useCallback(() => {\n dragStartRef.current = null;\n }, []);\n\n return (\n <>\n <BaseEdge\n id={`${id}__halo`}\n path={path}\n style={{\n stroke: \"rgba(255,255,255,0.92)\",\n strokeWidth: haloWidth,\n }}\n />\n <BaseEdge\n id={id}\n path={path}\n {...(d?.conditionExpression ? { markerStart: \"url(#bpmn-diamond-open)\" } : {})}\n markerEnd={markerEnd ?? \"url(#bpmn-arrow)\"}\n style={{\n stroke: strokeColor,\n strokeWidth,\n ...(style ?? {}),\n }}\n />\n {defaultMarkerPath && (\n <path\n d={defaultMarkerPath}\n fill=\"none\"\n stroke={strokeColor}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n data-testid=\"bpmn-default-flow-marker\"\n />\n )}\n {(label ?? d?.label) && (\n <EdgeLabelRenderer>\n <div\n onPointerDown={handleLabelPointerDown}\n onPointerMove={handleLabelPointerMove}\n onPointerUp={handleLabelPointerUp}\n style={{\n position: \"absolute\",\n transform: `translate(-50%,-50%) translate(${labelX}px,${labelY}px)`,\n fontSize: 11,\n fontFamily: \"\\\"IBM Plex Sans\\\", Inter, system-ui, sans-serif\",\n background: \"rgba(255,255,255,0.96)\",\n color: \"#1f2937\",\n padding: \"2px 6px\",\n borderRadius: 999,\n border: \"1px solid rgba(148, 163, 184, 0.45)\",\n boxShadow: \"0 1px 2px rgba(15, 23, 42, 0.10)\",\n pointerEvents: \"all\",\n cursor: \"grab\",\n userSelect: \"none\",\n whiteSpace: \"nowrap\",\n zIndex: 12,\n }}\n className=\"nodrag nopan\"\n >\n {label ?? d?.label}\n </div>\n </EdgeLabelRenderer>\n )}\n </>\n );\n}\n","import { BaseEdge, EdgeLabelRenderer, type EdgeProps } from \"@xyflow/react\";\nimport { getOrthogonalPath, pointsToSvgPath } from \"@aranzatech/diagrams-core/routing\";\nimport type { BpmnEdgeData } from \"../elements/types\";\nimport { getPreferredLabelAnchor } from \"./path\";\n\nexport function MessageFlowEdge({\n id,\n sourceX, sourceY, targetX, targetY,\n sourcePosition, targetPosition,\n data, label, markerEnd, style, selected,\n}: EdgeProps) {\n const d = data as BpmnEdgeData | undefined;\n const points = d?.routingPoints;\n const polyline = points && points.length >= 2\n ? [{ x: sourceX, y: sourceY }, ...points.slice(1, -1), { x: targetX, y: targetY }]\n : [{ x: sourceX, y: sourceY }, { x: targetX, y: targetY }];\n\n const path = points && points.length >= 2\n ? pointsToSvgPath([{ x: sourceX, y: sourceY }, ...points.slice(1, -1), { x: targetX, y: targetY }])\n : getOrthogonalPath(sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition);\n\n const labelAnchor = getPreferredLabelAnchor(polyline);\n const strokeColor = selected ? \"#1a56db\" : \"#404040\";\n const strokeWidth = selected ? 2.25 : 1.5;\n const haloWidth = selected ? 7 : 5;\n\n return (\n <>\n <BaseEdge\n id={`${id}__halo`}\n path={path}\n style={{\n stroke: \"rgba(255,255,255,0.92)\",\n strokeWidth: haloWidth,\n }}\n />\n <BaseEdge\n id={id}\n path={path}\n markerStart=\"url(#bpmn-circle-open)\"\n markerEnd={markerEnd ?? \"url(#bpmn-arrow-open)\"}\n style={{\n stroke: strokeColor,\n strokeWidth,\n strokeDasharray: \"6 3\",\n ...(style ?? {}),\n }}\n />\n {(label ?? d?.label) && (\n <EdgeLabelRenderer>\n <div\n style={{\n position: \"absolute\",\n transform: `translate(-50%,-50%) translate(${labelAnchor.x}px,${labelAnchor.y}px)`,\n fontSize: 11,\n fontFamily: \"\\\"IBM Plex Sans\\\", Inter, system-ui, sans-serif\",\n background: \"rgba(255,255,255,0.96)\",\n color: \"#1f2937\",\n padding: \"2px 6px\",\n borderRadius: 999,\n border: \"1px solid rgba(148, 163, 184, 0.45)\",\n boxShadow: \"0 1px 2px rgba(15, 23, 42, 0.10)\",\n pointerEvents: \"all\",\n whiteSpace: \"nowrap\",\n zIndex: 12,\n }}\n className=\"nodrag nopan\"\n >\n {label ?? d?.label}\n </div>\n </EdgeLabelRenderer>\n )}\n </>\n );\n}\n","import { BaseEdge, type EdgeProps } from \"@xyflow/react\";\nimport { getOrthogonalPath, pointsToSvgPath } from \"@aranzatech/diagrams-core/routing\";\nimport type { BpmnEdgeData } from \"../elements/types\";\n\nexport function AssociationEdge({\n id,\n sourceX, sourceY, targetX, targetY,\n sourcePosition, targetPosition,\n data, style, selected,\n}: EdgeProps) {\n const d = data as BpmnEdgeData | undefined;\n const points = d?.routingPoints;\n const direction = d?.associationDirection ?? \"none\";\n\n const path = points && points.length >= 2\n ? pointsToSvgPath([{ x: sourceX, y: sourceY }, ...points.slice(1, -1), { x: targetX, y: targetY }])\n : getOrthogonalPath(sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition);\n\n return (\n <BaseEdge\n id={id}\n path={path}\n {...(direction === \"both\" ? { markerStart: \"url(#bpmn-arrow-open)\" } : {})}\n {...(direction === \"one\" || direction === \"both\" ? { markerEnd: \"url(#bpmn-arrow-open)\" } : {})}\n style={{\n stroke: selected ? \"#1a56db\" : \"#888\",\n strokeWidth: 1,\n strokeDasharray: \"3 3\",\n ...(style ?? {}),\n }}\n />\n );\n}\n","import { BaseEdge, type EdgeProps } from \"@xyflow/react\";\nimport { getOrthogonalPath, pointsToSvgPath } from \"@aranzatech/diagrams-core/routing\";\nimport type { BpmnEdgeData } from \"../elements/types\";\n\nexport function DataAssociationEdge({\n id,\n sourceX, sourceY, targetX, targetY,\n sourcePosition, targetPosition,\n data, style, selected,\n}: EdgeProps) {\n const d = data as BpmnEdgeData | undefined;\n const points = d?.routingPoints;\n\n const path = points && points.length >= 2\n ? pointsToSvgPath([{ x: sourceX, y: sourceY }, ...points.slice(1, -1), { x: targetX, y: targetY }])\n : getOrthogonalPath(sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition);\n\n return (\n <BaseEdge\n id={id}\n path={path}\n markerEnd=\"url(#bpmn-arrow-open)\"\n style={{\n stroke: selected ? \"#1a56db\" : \"#888\",\n strokeWidth: 1,\n strokeDasharray: \"3 3\",\n ...(style ?? {}),\n }}\n />\n );\n}\n","export const BPMN_THEME = {\n fill: \"#ffffff\",\n fillSoft: \"#f8fbff\",\n fillSubtle: \"#eef6ff\",\n stroke: \"#334155\",\n strokeMuted: \"#64748b\",\n strokeSelected: \"#2563eb\",\n strokeWidth: 1.5,\n strokeWidthSelected: 2.5,\n fontFamily: \"Inter, system-ui, sans-serif\",\n fontSize: 11,\n labelColor: \"#0f172a\",\n handleColor: \"#94a3b8\",\n handleColorSelected: \"#2563eb\",\n shadow: \"none\",\n shadowSelected: \"none\",\n transition: \"box-shadow 140ms ease, filter 140ms ease, transform 140ms ease\",\n} as const;\n\nexport function resolveStroke(selected: boolean | undefined, override?: string): string {\n if (selected) return BPMN_THEME.strokeSelected;\n return override ?? BPMN_THEME.stroke;\n}\n\nexport function resolveStrokeWidth(selected: boolean | undefined): number {\n return selected ? BPMN_THEME.strokeWidthSelected : BPMN_THEME.strokeWidth;\n}\n\nexport function resolveShapeFilter(_selected: boolean | undefined): string | undefined {\n return undefined;\n}\n\nexport function resolveNodeShadow(selected: boolean | undefined): string {\n return selected ? BPMN_THEME.shadowSelected : BPMN_THEME.shadow;\n}\n","import type { EdgeProps } from \"@xyflow/react\";\nimport { BaseEdge, getStraightPath } from \"@xyflow/react\";\nimport type { BpmnEdgeData } from \"../elements/types\";\nimport { BPMN_THEME } from \"../nodes/shared/theme\";\n\n// BPMN 2.0 §12.2 — ConversationLink is rendered as a double line.\n// Technique: draw the path twice — wide stroke then narrower background —\n// to produce a parallel-line effect without complex path offsets.\n\nexport function ConversationLinkEdge({\n sourceX, sourceY, targetX, targetY,\n data, markerEnd,\n}: EdgeProps) {\n const d = data as BpmnEdgeData | undefined;\n const stroke = BPMN_THEME.stroke;\n\n const [path] = getStraightPath({ sourceX, sourceY, targetX, targetY });\n\n return (\n <g>\n {/* Outer (wide) stroke */}\n <BaseEdge\n path={path}\n {...(markerEnd ? { markerEnd } : {})}\n style={{ stroke, strokeWidth: 5, fill: \"none\" }}\n />\n {/* Inner white gap — creates double-line visual */}\n <BaseEdge\n path={path}\n style={{ stroke: \"#ffffff\", strokeWidth: 2, fill: \"none\" }}\n />\n {/* Label */}\n {d?.label && (\n <text fontSize={BPMN_THEME.fontSize} fontFamily={BPMN_THEME.fontFamily} fill={stroke}>\n <textPath href={`#${path}`} startOffset=\"50%\" textAnchor=\"middle\">\n {d.label}\n </textPath>\n </text>\n )}\n </g>\n );\n}\n","import type { EdgeTypes } from \"@xyflow/react\";\nimport { SequenceFlowEdge } from \"./SequenceFlowEdge\";\nimport { MessageFlowEdge } from \"./MessageFlowEdge\";\nimport { AssociationEdge } from \"./AssociationEdge\";\nimport { DataAssociationEdge } from \"./DataAssociationEdge\";\nimport { ConversationLinkEdge } from \"./ConversationLinkEdge\";\n\n/** Pass this object to `DiagramCanvas` as `edgeTypes`. */\nexport const BPMN_EDGE_TYPES: EdgeTypes = {\n sequenceFlow: SequenceFlowEdge,\n messageFlow: MessageFlowEdge,\n association: AssociationEdge,\n dataAssociation: DataAssociationEdge,\n conversationLink: ConversationLinkEdge,\n};\n"]}
1
+ {"version":3,"sources":["../../src/edges/path.ts","../../src/edges/SequenceFlowEdge.tsx","../../src/edges/MessageFlowEdge.tsx","../../src/edges/AssociationEdge.tsx","../../src/edges/DataAssociationEdge.tsx","../../src/nodes/shared/theme.ts","../../src/edges/ConversationLinkEdge.tsx","../../src/edges/edgeTypes.ts"],"names":["pointsToSvgPath","getOrthogonalPath","useReactFlow","useRef","useCallback","jsxs","Fragment","jsx","BaseEdge","EdgeLabelRenderer","BPMN_EDGE_LABEL_Z_INDEX","getStraightPath"],"mappings":";;;;;;;;;;AAkEA,IAAM,iBAAA,GAAoB,EAAA;AAC1B,IAAM,mBAAA,GAAsB,EAAA;AAErB,SAAS,wBAAwB,MAAA,EAAsC;AAC5E,EAAA,IAAI,MAAA,CAAO,WAAW,CAAA,EAAG,OAAO,EAAE,CAAA,EAAG,CAAA,EAAG,GAAG,CAAA,EAAE;AAC7C,EAAA,IAAI,MAAA,CAAO,MAAA,KAAW,CAAA,EAAG,OAAO,OAAO,CAAC,CAAA;AAIxC,EAAA,IAAI,SAAA,GAAY,EAAA;AAChB,EAAA,KAAA,IAAS,IAAI,CAAA,EAAG,CAAA,GAAI,MAAA,CAAO,MAAA,EAAQ,KAAK,CAAA,EAAG;AACzC,IAAA,MAAM,MAAA,GAAS,KAAK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cAAA;AAAA,QAET,QAAA,EAAA,CAAA,CAAE;AAAA;AAAA,KACL,EACF;AAAA,GAAA,EAEJ,CAAA;AAEJ;;;ACpDO,IAAM,eAAA,GAA6B;AAAA,EACxC,YAAA,EAAc,gBAAA;AAAA,EACd,WAAA,EAAa,eAAA;AAAA,EACb,WAAA,EAAa,eAAA;AAAA,EACb,eAAA,EAAiB,mBAAA;AAAA,EACjB,gBAAA,EAAkB;AACpB","file":"index.cjs","sourcesContent":["import type { Position } from \"@xyflow/react\";\n\nexport interface EdgePoint {\n x: number;\n y: number;\n}\n\nexport interface EdgeLabelAnchor {\n x: number;\n y: number;\n}\n\nexport function getEdgePoints(\n sourceX: number,\n sourceY: number,\n targetX: number,\n targetY: number,\n routingPoints?: EdgePoint[],\n): EdgePoint[] {\n if (routingPoints && routingPoints.length >= 2) {\n return routingPoints;\n }\n\n return [\n { x: sourceX, y: sourceY },\n { x: targetX, y: targetY },\n ];\n}\n\nexport function getPolylineMidpoint(points: EdgePoint[]): EdgePoint {\n if (points.length === 0) return { x: 0, y: 0 };\n if (points.length === 1) return points[0];\n\n let total = 0;\n const lengths: number[] = [];\n\n for (let i = 1; i < points.length; i += 1) {\n const dx = points[i].x - points[i - 1].x;\n const dy = points[i].y - points[i - 1].y;\n const length = Math.hypot(dx, dy);\n lengths.push(length);\n total += length;\n }\n\n const halfway = total / 2;\n let traversed = 0;\n\n for (let i = 1; i < points.length; i += 1) {\n const length = lengths[i - 1];\n if (traversed + length >= halfway) {\n const ratio = length === 0 ? 0 : (halfway - traversed) / length;\n return {\n x: points[i - 1].x + (points[i].x - points[i - 1].x) * ratio,\n y: points[i - 1].y + (points[i].y - points[i - 1].y) * ratio,\n };\n }\n traversed += length;\n }\n\n return points[points.length - 1];\n}\n\n// BPMN convention (Camunda/Bizagi): a sequence-flow label (Sí/No) belongs at\n// the SOURCE exit — where the decision is read — not at the midpoint of the\n// longest segment, which on long routes leaves the label orphaned far from\n// its gateway.\nconst LABEL_MIN_SEGMENT = 40; // first segment long enough to host a label\nconst LABEL_EXIT_DISTANCE = 28; // px along the segment, measured from the exit\n\nexport function getPreferredLabelAnchor(points: EdgePoint[]): EdgeLabelAnchor {\n if (points.length === 0) return { x: 0, y: 0 };\n if (points.length === 1) return points[0];\n\n // Prefer the first segment (closest to the source) that can host a label;\n // fall back to the longest segment when every segment is tiny.\n let bestIndex = -1;\n for (let i = 1; i < points.length; i += 1) {\n const length = Math.hypot(points[i].x - points[i - 1].x, points[i].y - points[i - 1].y);\n if (length >= LABEL_MIN_SEGMENT) {\n bestIndex = i;\n break;\n }\n }\n\n if (bestIndex === -1) {\n let bestLength = -1;\n bestIndex = 1;\n for (let i = 1; i < points.length; i += 1) {\n const length = Math.hypot(points[i].x - points[i - 1].x, points[i].y - points[i - 1].y);\n if (length > bestLength) {\n bestLength = length;\n bestIndex = i;\n }\n }\n }\n\n const from = points[bestIndex - 1];\n const to = points[bestIndex];\n const segLength = Math.hypot(to.x - from.x, to.y - from.y);\n const t = segLength > 0 ? Math.min(0.5, LABEL_EXIT_DISTANCE / segLength) : 0.5;\n const anchor = {\n x: from.x + (to.x - from.x) * t,\n y: from.y + (to.y - from.y) * t,\n };\n\n const dx = to.x - from.x;\n const dy = to.y - from.y;\n\n if (Math.abs(dx) >= Math.abs(dy)) {\n return { x: anchor.x, y: anchor.y - 12 };\n }\n\n return { x: anchor.x + 12, y: anchor.y };\n}\n\nexport function getSegmentAngle(points: EdgePoint[]): number {\n if (points.length < 2) return 0;\n const from = points[0];\n const to = points[1];\n return Math.atan2(to.y - from.y, to.x - from.x);\n}\n\nexport function getDefaultFlowMarkerPath(points: EdgePoint[]): string | null {\n if (points.length < 2) return null;\n\n const start = points[0];\n const angle = getSegmentAngle(points);\n const anchorX = start.x + Math.cos(angle) * 16;\n const anchorY = start.y + Math.sin(angle) * 16;\n const normalAngle = angle + Math.PI / 2;\n const half = 7;\n\n const x1 = anchorX + Math.cos(normalAngle) * half;\n const y1 = anchorY + Math.sin(normalAngle) * half;\n const x2 = anchorX - Math.cos(normalAngle) * half;\n const y2 = anchorY - Math.sin(normalAngle) * half;\n\n return `M ${x1} ${y1} L ${x2} ${y2}`;\n}\n\nexport function fallbackAssociationDirection(\n sourcePosition?: Position,\n targetPosition?: Position,\n): \"horizontal\" | \"vertical\" {\n if (sourcePosition === \"left\" || sourcePosition === \"right\" || targetPosition === \"left\" || targetPosition === \"right\") {\n return \"horizontal\";\n }\n\n return \"vertical\";\n}\n","import { useCallback, useRef } from \"react\";\nimport { BaseEdge, EdgeLabelRenderer, useReactFlow, type EdgeProps } from \"@xyflow/react\";\nimport { getOrthogonalPath, pointsToSvgPath } from \"@aranzatech/diagrams-core/routing\";\nimport type { BpmnEdgeData } from \"../elements/types\";\nimport { getDefaultFlowMarkerPath, getPreferredLabelAnchor } from \"./path\";\n\nconst BPMN_EDGE_LABEL_Z_INDEX = 1000;\n\nexport function SequenceFlowEdge({\n id,\n sourceX, sourceY, targetX, targetY,\n sourcePosition, targetPosition,\n data, label, markerEnd, style, selected,\n}: EdgeProps) {\n const d = data as BpmnEdgeData | undefined;\n const points = d?.routingPoints;\n const polyline = points && points.length >= 2\n ? [{ x: sourceX, y: sourceY }, ...points.slice(1, -1), { x: targetX, y: targetY }]\n : [{ x: sourceX, y: sourceY }, { x: targetX, y: targetY }];\n\n const path = points && points.length >= 2\n ? pointsToSvgPath([{ x: sourceX, y: sourceY }, ...points.slice(1, -1), { x: targetX, y: targetY }])\n : getOrthogonalPath(sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition);\n\n const labelAnchor = getPreferredLabelAnchor(polyline);\n const defaultMarkerPath = d?.isDefault ? getDefaultFlowMarkerPath(polyline) : null;\n\n const labelX = labelAnchor.x + (d?.labelOffsetX ?? 0);\n const labelY = labelAnchor.y + (d?.labelOffsetY ?? 0);\n\n const strokeColor = d?.color?.stroke ?? (selected ? \"#1a56db\" : \"#404040\");\n const strokeWidth = selected ? 2.25 : 1.5;\n const haloWidth = selected ? 7 : 5;\n\n const { updateEdgeData, getViewport } = useReactFlow();\n const dragStartRef = useRef<{ mx: number; my: number; ox: number; oy: number } | null>(null);\n\n const handleLabelPointerDown = useCallback((e: React.PointerEvent<HTMLDivElement>) => {\n e.stopPropagation();\n e.currentTarget.setPointerCapture(e.pointerId);\n dragStartRef.current = {\n mx: e.clientX,\n my: e.clientY,\n ox: d?.labelOffsetX ?? 0,\n oy: d?.labelOffsetY ?? 0,\n };\n }, [d?.labelOffsetX, d?.labelOffsetY]);\n\n const handleLabelPointerMove = useCallback((e: React.PointerEvent<HTMLDivElement>) => {\n if (!dragStartRef.current) return;\n const { zoom } = getViewport();\n const dx = (e.clientX - dragStartRef.current.mx) / zoom;\n const dy = (e.clientY - dragStartRef.current.my) / zoom;\n updateEdgeData(id, {\n labelOffsetX: dragStartRef.current.ox + dx,\n labelOffsetY: dragStartRef.current.oy + dy,\n });\n }, [id, updateEdgeData, getViewport]);\n\n const handleLabelPointerUp = useCallback(() => {\n dragStartRef.current = null;\n }, []);\n\n return (\n <>\n <BaseEdge\n id={`${id}__halo`}\n path={path}\n style={{\n stroke: \"rgba(255,255,255,0.92)\",\n strokeWidth: haloWidth,\n }}\n />\n <BaseEdge\n id={id}\n path={path}\n {...(d?.conditionExpression ? { markerStart: \"url(#bpmn-diamond-open)\" } : {})}\n markerEnd={markerEnd ?? \"url(#bpmn-arrow)\"}\n style={{\n ...(style ?? {}),\n stroke: strokeColor,\n strokeWidth,\n }}\n />\n {defaultMarkerPath && (\n <path\n d={defaultMarkerPath}\n fill=\"none\"\n stroke={strokeColor}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n data-testid=\"bpmn-default-flow-marker\"\n />\n )}\n {(label ?? d?.label) && (\n <EdgeLabelRenderer>\n <div\n onPointerDown={handleLabelPointerDown}\n onPointerMove={handleLabelPointerMove}\n onPointerUp={handleLabelPointerUp}\n style={{\n position: \"absolute\",\n transform: `translate(-50%,-50%) translate(${labelX}px,${labelY}px)`,\n fontSize: 11,\n fontFamily: \"\\\"IBM Plex Sans\\\", Inter, system-ui, sans-serif\",\n background: d?.color?.fill ?? \"rgba(255,255,255,0.96)\",\n color: strokeColor,\n padding: \"2px 6px\",\n borderRadius: 999,\n border: `1px solid ${d?.color?.stroke ?? \"rgba(148, 163, 184, 0.45)\"}`,\n boxShadow: \"0 1px 2px rgba(15, 23, 42, 0.10)\",\n pointerEvents: \"all\",\n cursor: \"grab\",\n userSelect: \"none\",\n whiteSpace: \"nowrap\",\n zIndex: BPMN_EDGE_LABEL_Z_INDEX,\n }}\n className=\"nodrag nopan\"\n >\n {label ?? d?.label}\n </div>\n </EdgeLabelRenderer>\n )}\n </>\n );\n}\n","import { BaseEdge, EdgeLabelRenderer, type EdgeProps } from \"@xyflow/react\";\nimport { getOrthogonalPath, pointsToSvgPath } from \"@aranzatech/diagrams-core/routing\";\nimport type { BpmnEdgeData } from \"../elements/types\";\nimport { getPreferredLabelAnchor } from \"./path\";\n\nconst BPMN_EDGE_LABEL_Z_INDEX = 1000;\n\nexport function MessageFlowEdge({\n id,\n sourceX, sourceY, targetX, targetY,\n sourcePosition, targetPosition,\n data, label, markerEnd, style, selected,\n}: EdgeProps) {\n const d = data as BpmnEdgeData | undefined;\n const points = d?.routingPoints;\n const polyline = points && points.length >= 2\n ? [{ x: sourceX, y: sourceY }, ...points.slice(1, -1), { x: targetX, y: targetY }]\n : [{ x: sourceX, y: sourceY }, { x: targetX, y: targetY }];\n\n const path = points && points.length >= 2\n ? pointsToSvgPath([{ x: sourceX, y: sourceY }, ...points.slice(1, -1), { x: targetX, y: targetY }])\n : getOrthogonalPath(sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition);\n\n const labelAnchor = getPreferredLabelAnchor(polyline);\n const strokeColor = d?.color?.stroke ?? (selected ? \"#1a56db\" : \"#404040\");\n const strokeWidth = selected ? 2.25 : 1.5;\n const haloWidth = selected ? 7 : 5;\n\n return (\n <>\n <BaseEdge\n id={`${id}__halo`}\n path={path}\n style={{\n stroke: \"rgba(255,255,255,0.92)\",\n strokeWidth: haloWidth,\n }}\n />\n <BaseEdge\n id={id}\n path={path}\n markerStart=\"url(#bpmn-circle-open)\"\n markerEnd={markerEnd ?? \"url(#bpmn-arrow-open)\"}\n style={{\n strokeDasharray: \"6 3\",\n ...(style ?? {}),\n stroke: strokeColor,\n strokeWidth,\n }}\n />\n {(label ?? d?.label) && (\n <EdgeLabelRenderer>\n <div\n style={{\n position: \"absolute\",\n transform: `translate(-50%,-50%) translate(${labelAnchor.x}px,${labelAnchor.y}px)`,\n fontSize: 11,\n fontFamily: \"\\\"IBM Plex Sans\\\", Inter, system-ui, sans-serif\",\n background: d?.color?.fill ?? \"rgba(255,255,255,0.96)\",\n color: strokeColor,\n padding: \"2px 6px\",\n borderRadius: 999,\n border: `1px solid ${d?.color?.stroke ?? \"rgba(148, 163, 184, 0.45)\"}`,\n boxShadow: \"0 1px 2px rgba(15, 23, 42, 0.10)\",\n pointerEvents: \"all\",\n whiteSpace: \"nowrap\",\n zIndex: BPMN_EDGE_LABEL_Z_INDEX,\n }}\n className=\"nodrag nopan\"\n >\n {label ?? d?.label}\n </div>\n </EdgeLabelRenderer>\n )}\n </>\n );\n}\n","import { BaseEdge, type EdgeProps } from \"@xyflow/react\";\nimport { getOrthogonalPath, pointsToSvgPath } from \"@aranzatech/diagrams-core/routing\";\nimport type { BpmnEdgeData } from \"../elements/types\";\n\nexport function AssociationEdge({\n id,\n sourceX, sourceY, targetX, targetY,\n sourcePosition, targetPosition,\n data, style, selected,\n}: EdgeProps) {\n const d = data as BpmnEdgeData | undefined;\n const points = d?.routingPoints;\n const direction = d?.associationDirection ?? \"none\";\n const strokeColor = d?.color?.stroke ?? (selected ? \"#1a56db\" : \"#888\");\n\n const path = points && points.length >= 2\n ? pointsToSvgPath([{ x: sourceX, y: sourceY }, ...points.slice(1, -1), { x: targetX, y: targetY }])\n : getOrthogonalPath(sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition);\n\n return (\n <BaseEdge\n id={id}\n path={path}\n {...(direction === \"both\" ? { markerStart: \"url(#bpmn-arrow-open)\" } : {})}\n {...(direction === \"one\" || direction === \"both\" ? { markerEnd: \"url(#bpmn-arrow-open)\" } : {})}\n style={{\n ...(style ?? {}),\n stroke: strokeColor,\n strokeWidth: 1,\n strokeDasharray: \"3 3\",\n }}\n />\n );\n}\n","import { BaseEdge, type EdgeProps } from \"@xyflow/react\";\nimport { getOrthogonalPath, pointsToSvgPath } from \"@aranzatech/diagrams-core/routing\";\nimport type { BpmnEdgeData } from \"../elements/types\";\n\nexport function DataAssociationEdge({\n id,\n sourceX, sourceY, targetX, targetY,\n sourcePosition, targetPosition,\n data, style, selected,\n}: EdgeProps) {\n const d = data as BpmnEdgeData | undefined;\n const points = d?.routingPoints;\n const strokeColor = d?.color?.stroke ?? (selected ? \"#1a56db\" : \"#888\");\n\n const path = points && points.length >= 2\n ? pointsToSvgPath([{ x: sourceX, y: sourceY }, ...points.slice(1, -1), { x: targetX, y: targetY }])\n : getOrthogonalPath(sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition);\n\n return (\n <BaseEdge\n id={id}\n path={path}\n markerEnd=\"url(#bpmn-arrow-open)\"\n style={{\n ...(style ?? {}),\n stroke: strokeColor,\n strokeWidth: 1,\n strokeDasharray: \"3 3\",\n }}\n />\n );\n}\n","export const BPMN_THEME = {\n fill: \"#ffffff\",\n fillSoft: \"#f8fbff\",\n fillSubtle: \"#eef6ff\",\n stroke: \"#334155\",\n strokeMuted: \"#64748b\",\n strokeSelected: \"#2563eb\",\n strokeWidth: 1.5,\n strokeWidthSelected: 2.5,\n fontFamily: \"Inter, system-ui, sans-serif\",\n fontSize: 11,\n labelColor: \"#0f172a\",\n handleColor: \"#94a3b8\",\n handleColorSelected: \"#2563eb\",\n shadow: \"none\",\n shadowSelected: \"none\",\n transition: \"box-shadow 140ms ease, filter 140ms ease, transform 140ms ease\",\n} as const;\n\nexport function resolveStroke(selected: boolean | undefined, override?: string): string {\n if (selected) return BPMN_THEME.strokeSelected;\n return override ?? BPMN_THEME.stroke;\n}\n\nexport function resolveStrokeWidth(selected: boolean | undefined): number {\n return selected ? BPMN_THEME.strokeWidthSelected : BPMN_THEME.strokeWidth;\n}\n\nexport function resolveShapeFilter(_selected: boolean | undefined): string | undefined {\n return undefined;\n}\n\nexport function resolveNodeShadow(selected: boolean | undefined): string {\n return selected ? BPMN_THEME.shadowSelected : BPMN_THEME.shadow;\n}\n","import type { EdgeProps } from \"@xyflow/react\";\nimport { BaseEdge, EdgeLabelRenderer, getStraightPath } from \"@xyflow/react\";\nimport type { BpmnEdgeData } from \"../elements/types\";\nimport { BPMN_THEME } from \"../nodes/shared/theme\";\n\n// BPMN 2.0 §12.2 — ConversationLink is rendered as a double line.\n// Technique: draw the path twice — wide stroke then narrower background —\n// to produce a parallel-line effect without complex path offsets.\n\nconst BPMN_EDGE_LABEL_Z_INDEX = 1000;\n\nexport function ConversationLinkEdge({\n sourceX, sourceY, targetX, targetY,\n data, markerEnd,\n}: EdgeProps) {\n const d = data as BpmnEdgeData | undefined;\n const stroke = d?.color?.stroke ?? BPMN_THEME.stroke;\n\n const [path] = getStraightPath({ sourceX, sourceY, targetX, targetY });\n\n return (\n <g>\n {/* Outer (wide) stroke */}\n <BaseEdge\n path={path}\n {...(markerEnd ? { markerEnd } : {})}\n style={{ stroke, strokeWidth: 5, fill: \"none\" }}\n />\n {/* Inner white gap — creates double-line visual */}\n <BaseEdge\n path={path}\n style={{ stroke: \"#ffffff\", strokeWidth: 2, fill: \"none\" }}\n />\n {/* Label */}\n {d?.label && (\n <EdgeLabelRenderer>\n <div\n style={{\n position: \"absolute\",\n transform: `translate(-50%,-50%) translate(${(sourceX + targetX) / 2}px,${(sourceY + targetY) / 2}px)`,\n fontSize: BPMN_THEME.fontSize,\n fontFamily: BPMN_THEME.fontFamily,\n background: d?.color?.fill ?? \"rgba(255,255,255,0.96)\",\n color: stroke,\n padding: \"2px 6px\",\n borderRadius: 999,\n border: `1px solid ${d?.color?.stroke ?? \"rgba(148, 163, 184, 0.45)\"}`,\n boxShadow: \"0 1px 2px rgba(15, 23, 42, 0.10)\",\n pointerEvents: \"all\",\n whiteSpace: \"nowrap\",\n zIndex: BPMN_EDGE_LABEL_Z_INDEX,\n }}\n className=\"nodrag nopan\"\n >\n {d.label}\n </div>\n </EdgeLabelRenderer>\n )}\n </g>\n );\n}\n","import type { EdgeTypes } from \"@xyflow/react\";\nimport { SequenceFlowEdge } from \"./SequenceFlowEdge\";\nimport { MessageFlowEdge } from \"./MessageFlowEdge\";\nimport { AssociationEdge } from \"./AssociationEdge\";\nimport { DataAssociationEdge } from \"./DataAssociationEdge\";\nimport { ConversationLinkEdge } from \"./ConversationLinkEdge\";\n\n/** Pass this object to `DiagramCanvas` as `edgeTypes`. */\nexport const BPMN_EDGE_TYPES: EdgeTypes = {\n sequenceFlow: SequenceFlowEdge,\n messageFlow: MessageFlowEdge,\n association: AssociationEdge,\n dataAssociation: DataAssociationEdge,\n conversationLink: ConversationLinkEdge,\n};\n"]}
@@ -1,4 +1,5 @@
1
- export { AssociationEdge, BPMN_EDGE_TYPES, ConversationLinkEdge, DataAssociationEdge, MessageFlowEdge, SequenceFlowEdge } from '../chunk-JFYWN6QH.js';
1
+ export { AssociationEdge, BPMN_EDGE_TYPES, ConversationLinkEdge, DataAssociationEdge, MessageFlowEdge, SequenceFlowEdge } from '../chunk-EMTO53AN.js';
2
2
  import '../chunk-PDTXM32P.js';
3
+ import '../chunk-G22XQD6H.js';
3
4
  //# sourceMappingURL=index.js.map
4
5
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
- export { B as BPMN_ELEMENT_CATALOG, a as BPMN_RESIZABLE_ELEMENT_TYPES, g as getBpmnElementSize, b as getElementMeta, i as isBpmnElementResizable } from '../catalog-DG-sz0VM.cjs';
2
- import { f as BpmnElementType, k as BpmnHandlePolicy, n as BpmnOrientation, E as EventTrigger, m as BpmnNodeData, S as SubProcessVariant } from '../types-nvF59RGF.cjs';
3
- export { B as BpmnCategory, a as BpmnDefinitionsSet, b as BpmnEdgeData, c as BpmnEdgeType, d as BpmnElementMeta, e as BpmnElementSize, g as BpmnErrorDefinition, h as BpmnEscalationDefinition, i as BpmnEventDefinition, j as BpmnEventSemantics, l as BpmnMessageDefinition, o as BpmnProcessVariable, p as BpmnServiceTaskConfig, q as BpmnSignalDefinition, r as BpmnTimerDefinition, s as BpmnTimerKind, t as InlineDecisionInput, u as InlineDecisionOutput, v as InlineDecisionRule, I as InlineDecisionTable, T as TaskMarker } from '../types-nvF59RGF.cjs';
1
+ export { B as BPMN_ELEMENT_CATALOG, a as BPMN_RESIZABLE_ELEMENT_TYPES, g as getBpmnElementSize, b as getElementMeta, i as isBpmnElementResizable } from '../catalog-C_S9hyyn.cjs';
2
+ import { f as BpmnElementType, k as BpmnHandlePolicy, n as BpmnOrientation, E as EventTrigger, m as BpmnNodeData, S as SubProcessVariant } from '../types--x9aoecw.cjs';
3
+ export { B as BpmnCategory, a as BpmnDefinitionsSet, b as BpmnEdgeData, c as BpmnEdgeType, d as BpmnElementMeta, e as BpmnElementSize, g as BpmnErrorDefinition, h as BpmnEscalationDefinition, i as BpmnEventDefinition, j as BpmnEventSemantics, l as BpmnMessageDefinition, o as BpmnProcessVariable, p as BpmnServiceTaskConfig, q as BpmnSignalDefinition, r as BpmnTimerDefinition, s as BpmnTimerKind, t as InlineDecisionInput, u as InlineDecisionOutput, v as InlineDecisionRule, I as InlineDecisionTable, T as TaskMarker } from '../types--x9aoecw.cjs';
4
4
 
5
5
  declare function isTaskType(type: BpmnElementType): boolean;
6
6
  declare function isGatewayType(type: BpmnElementType): boolean;
@@ -1,6 +1,6 @@
1
- export { B as BPMN_ELEMENT_CATALOG, a as BPMN_RESIZABLE_ELEMENT_TYPES, g as getBpmnElementSize, b as getElementMeta, i as isBpmnElementResizable } from '../catalog-DNIyjHbl.js';
2
- import { f as BpmnElementType, k as BpmnHandlePolicy, n as BpmnOrientation, E as EventTrigger, m as BpmnNodeData, S as SubProcessVariant } from '../types-nvF59RGF.js';
3
- export { B as BpmnCategory, a as BpmnDefinitionsSet, b as BpmnEdgeData, c as BpmnEdgeType, d as BpmnElementMeta, e as BpmnElementSize, g as BpmnErrorDefinition, h as BpmnEscalationDefinition, i as BpmnEventDefinition, j as BpmnEventSemantics, l as BpmnMessageDefinition, o as BpmnProcessVariable, p as BpmnServiceTaskConfig, q as BpmnSignalDefinition, r as BpmnTimerDefinition, s as BpmnTimerKind, t as InlineDecisionInput, u as InlineDecisionOutput, v as InlineDecisionRule, I as InlineDecisionTable, T as TaskMarker } from '../types-nvF59RGF.js';
1
+ export { B as BPMN_ELEMENT_CATALOG, a as BPMN_RESIZABLE_ELEMENT_TYPES, g as getBpmnElementSize, b as getElementMeta, i as isBpmnElementResizable } from '../catalog-CYZHikuU.js';
2
+ import { f as BpmnElementType, k as BpmnHandlePolicy, n as BpmnOrientation, E as EventTrigger, m as BpmnNodeData, S as SubProcessVariant } from '../types--x9aoecw.js';
3
+ export { B as BpmnCategory, a as BpmnDefinitionsSet, b as BpmnEdgeData, c as BpmnEdgeType, d as BpmnElementMeta, e as BpmnElementSize, g as BpmnErrorDefinition, h as BpmnEscalationDefinition, i as BpmnEventDefinition, j as BpmnEventSemantics, l as BpmnMessageDefinition, o as BpmnProcessVariable, p as BpmnServiceTaskConfig, q as BpmnSignalDefinition, r as BpmnTimerDefinition, s as BpmnTimerKind, t as InlineDecisionInput, u as InlineDecisionOutput, v as InlineDecisionRule, I as InlineDecisionTable, T as TaskMarker } from '../types--x9aoecw.js';
4
4
 
5
5
  declare function isTaskType(type: BpmnElementType): boolean;
6
6
  declare function isGatewayType(type: BpmnElementType): boolean;
@@ -1,5 +1,5 @@
1
- export { B as BpmnAranzaTaskExtensions, a as BpmnExecutionEngine, b as BpmnFlowableExportOptions, c as BpmnFlowableTaskExtensions, d as BpmnMessageFlowExecutionExtensions, e as BpmnTaskExecutionExtensions, g as getBpmnMessageFlowExecutionExtensions, f as getBpmnTaskExecutionExtensions } from '../types-dQUuSnV5.cjs';
2
- import '../types-nvF59RGF.cjs';
1
+ export { B as BpmnAranzaTaskExtensions, a as BpmnExecutionEngine, b as BpmnFlowableExportOptions, c as BpmnFlowableTaskExtensions, d as BpmnMessageFlowExecutionExtensions, e as BpmnTaskExecutionExtensions, g as getBpmnMessageFlowExecutionExtensions, f as getBpmnTaskExecutionExtensions } from '../types-CrFDTGo9.cjs';
2
+ import '../types--x9aoecw.cjs';
3
3
 
4
4
  /**
5
5
  * bpmn-moddle package descriptor for the AranzaFlows extension namespace.
@@ -1,5 +1,5 @@
1
- export { B as BpmnAranzaTaskExtensions, a as BpmnExecutionEngine, b as BpmnFlowableExportOptions, c as BpmnFlowableTaskExtensions, d as BpmnMessageFlowExecutionExtensions, e as BpmnTaskExecutionExtensions, g as getBpmnMessageFlowExecutionExtensions, f as getBpmnTaskExecutionExtensions } from '../types-X5FyP8oS.js';
2
- import '../types-nvF59RGF.js';
1
+ export { B as BpmnAranzaTaskExtensions, a as BpmnExecutionEngine, b as BpmnFlowableExportOptions, c as BpmnFlowableTaskExtensions, d as BpmnMessageFlowExecutionExtensions, e as BpmnTaskExecutionExtensions, g as getBpmnMessageFlowExecutionExtensions, f as getBpmnTaskExecutionExtensions } from '../types-DteJykQG.js';
2
+ import '../types--x9aoecw.js';
3
3
 
4
4
  /**
5
5
  * bpmn-moddle package descriptor for the AranzaFlows extension namespace.
package/dist/index.cjs CHANGED
@@ -2259,32 +2259,44 @@ var BPMN_NODE_TYPES = {
2259
2259
  };
2260
2260
 
2261
2261
  // src/edges/path.ts
2262
+ var LABEL_MIN_SEGMENT = 40;
2263
+ var LABEL_EXIT_DISTANCE = 28;
2262
2264
  function getPreferredLabelAnchor(points) {
2263
2265
  if (points.length === 0) return { x: 0, y: 0 };
2264
2266
  if (points.length === 1) return points[0];
2265
- let bestIndex = 1;
2266
- let bestLength = -1;
2267
+ let bestIndex = -1;
2267
2268
  for (let i = 1; i < points.length; i += 1) {
2268
- const dx2 = points[i].x - points[i - 1].x;
2269
- const dy2 = points[i].y - points[i - 1].y;
2270
- const length = Math.hypot(dx2, dy2);
2271
- if (length > bestLength) {
2272
- bestLength = length;
2269
+ const length = Math.hypot(points[i].x - points[i - 1].x, points[i].y - points[i - 1].y);
2270
+ if (length >= LABEL_MIN_SEGMENT) {
2273
2271
  bestIndex = i;
2272
+ break;
2273
+ }
2274
+ }
2275
+ if (bestIndex === -1) {
2276
+ let bestLength = -1;
2277
+ bestIndex = 1;
2278
+ for (let i = 1; i < points.length; i += 1) {
2279
+ const length = Math.hypot(points[i].x - points[i - 1].x, points[i].y - points[i - 1].y);
2280
+ if (length > bestLength) {
2281
+ bestLength = length;
2282
+ bestIndex = i;
2283
+ }
2274
2284
  }
2275
2285
  }
2276
2286
  const from = points[bestIndex - 1];
2277
2287
  const to = points[bestIndex];
2278
- const midpoint = {
2279
- x: from.x + (to.x - from.x) / 2,
2280
- y: from.y + (to.y - from.y) / 2
2288
+ const segLength = Math.hypot(to.x - from.x, to.y - from.y);
2289
+ const t = segLength > 0 ? Math.min(0.5, LABEL_EXIT_DISTANCE / segLength) : 0.5;
2290
+ const anchor = {
2291
+ x: from.x + (to.x - from.x) * t,
2292
+ y: from.y + (to.y - from.y) * t
2281
2293
  };
2282
2294
  const dx = to.x - from.x;
2283
2295
  const dy = to.y - from.y;
2284
2296
  if (Math.abs(dx) >= Math.abs(dy)) {
2285
- return { x: midpoint.x, y: midpoint.y - 12 };
2297
+ return { x: anchor.x, y: anchor.y - 12 };
2286
2298
  }
2287
- return { x: midpoint.x + 12, y: midpoint.y };
2299
+ return { x: anchor.x + 12, y: anchor.y };
2288
2300
  }
2289
2301
  function getSegmentAngle(points) {
2290
2302
  if (points.length < 2) return 0;
@@ -2306,6 +2318,7 @@ function getDefaultFlowMarkerPath(points) {
2306
2318
  const y2 = anchorY - Math.sin(normalAngle) * half;
2307
2319
  return `M ${x1} ${y1} L ${x2} ${y2}`;
2308
2320
  }
2321
+ var BPMN_EDGE_LABEL_Z_INDEX = 1e3;
2309
2322
  function SequenceFlowEdge({
2310
2323
  id,
2311
2324
  sourceX,
@@ -2328,7 +2341,7 @@ function SequenceFlowEdge({
2328
2341
  const defaultMarkerPath = d?.isDefault ? getDefaultFlowMarkerPath(polyline) : null;
2329
2342
  const labelX = labelAnchor.x + (d?.labelOffsetX ?? 0);
2330
2343
  const labelY = labelAnchor.y + (d?.labelOffsetY ?? 0);
2331
- const strokeColor = selected ? "#1a56db" : "#404040";
2344
+ const strokeColor = d?.color?.stroke ?? (selected ? "#1a56db" : "#404040");
2332
2345
  const strokeWidth = selected ? 2.25 : 1.5;
2333
2346
  const haloWidth = selected ? 7 : 5;
2334
2347
  const { updateEdgeData, getViewport } = react.useReactFlow();
@@ -2376,9 +2389,9 @@ function SequenceFlowEdge({
2376
2389
  ...d?.conditionExpression ? { markerStart: "url(#bpmn-diamond-open)" } : {},
2377
2390
  markerEnd: markerEnd ?? "url(#bpmn-arrow)",
2378
2391
  style: {
2392
+ ...style ?? {},
2379
2393
  stroke: strokeColor,
2380
- strokeWidth,
2381
- ...style ?? {}
2394
+ strokeWidth
2382
2395
  }
2383
2396
  }
2384
2397
  ),
@@ -2404,17 +2417,17 @@ function SequenceFlowEdge({
2404
2417
  transform: `translate(-50%,-50%) translate(${labelX}px,${labelY}px)`,
2405
2418
  fontSize: 11,
2406
2419
  fontFamily: '"IBM Plex Sans", Inter, system-ui, sans-serif',
2407
- background: "rgba(255,255,255,0.96)",
2408
- color: "#1f2937",
2420
+ background: d?.color?.fill ?? "rgba(255,255,255,0.96)",
2421
+ color: strokeColor,
2409
2422
  padding: "2px 6px",
2410
2423
  borderRadius: 999,
2411
- border: "1px solid rgba(148, 163, 184, 0.45)",
2424
+ border: `1px solid ${d?.color?.stroke ?? "rgba(148, 163, 184, 0.45)"}`,
2412
2425
  boxShadow: "0 1px 2px rgba(15, 23, 42, 0.10)",
2413
2426
  pointerEvents: "all",
2414
2427
  cursor: "grab",
2415
2428
  userSelect: "none",
2416
2429
  whiteSpace: "nowrap",
2417
- zIndex: 12
2430
+ zIndex: BPMN_EDGE_LABEL_Z_INDEX
2418
2431
  },
2419
2432
  className: "nodrag nopan",
2420
2433
  children: label ?? d?.label
@@ -2422,6 +2435,7 @@ function SequenceFlowEdge({
2422
2435
  ) })
2423
2436
  ] });
2424
2437
  }
2438
+ var BPMN_EDGE_LABEL_Z_INDEX2 = 1e3;
2425
2439
  function MessageFlowEdge({
2426
2440
  id,
2427
2441
  sourceX,
@@ -2441,7 +2455,7 @@ function MessageFlowEdge({
2441
2455
  const polyline = points && points.length >= 2 ? [{ x: sourceX, y: sourceY }, ...points.slice(1, -1), { x: targetX, y: targetY }] : [{ x: sourceX, y: sourceY }, { x: targetX, y: targetY }];
2442
2456
  const path = points && points.length >= 2 ? routing.pointsToSvgPath([{ x: sourceX, y: sourceY }, ...points.slice(1, -1), { x: targetX, y: targetY }]) : routing.getOrthogonalPath(sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition);
2443
2457
  const labelAnchor = getPreferredLabelAnchor(polyline);
2444
- const strokeColor = selected ? "#1a56db" : "#404040";
2458
+ const strokeColor = d?.color?.stroke ?? (selected ? "#1a56db" : "#404040");
2445
2459
  const strokeWidth = selected ? 2.25 : 1.5;
2446
2460
  const haloWidth = selected ? 7 : 5;
2447
2461
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -2464,10 +2478,10 @@ function MessageFlowEdge({
2464
2478
  markerStart: "url(#bpmn-circle-open)",
2465
2479
  markerEnd: markerEnd ?? "url(#bpmn-arrow-open)",
2466
2480
  style: {
2467
- stroke: strokeColor,
2468
- strokeWidth,
2469
2481
  strokeDasharray: "6 3",
2470
- ...style ?? {}
2482
+ ...style ?? {},
2483
+ stroke: strokeColor,
2484
+ strokeWidth
2471
2485
  }
2472
2486
  }
2473
2487
  ),
@@ -2479,15 +2493,15 @@ function MessageFlowEdge({
2479
2493
  transform: `translate(-50%,-50%) translate(${labelAnchor.x}px,${labelAnchor.y}px)`,
2480
2494
  fontSize: 11,
2481
2495
  fontFamily: '"IBM Plex Sans", Inter, system-ui, sans-serif',
2482
- background: "rgba(255,255,255,0.96)",
2483
- color: "#1f2937",
2496
+ background: d?.color?.fill ?? "rgba(255,255,255,0.96)",
2497
+ color: strokeColor,
2484
2498
  padding: "2px 6px",
2485
2499
  borderRadius: 999,
2486
- border: "1px solid rgba(148, 163, 184, 0.45)",
2500
+ border: `1px solid ${d?.color?.stroke ?? "rgba(148, 163, 184, 0.45)"}`,
2487
2501
  boxShadow: "0 1px 2px rgba(15, 23, 42, 0.10)",
2488
2502
  pointerEvents: "all",
2489
2503
  whiteSpace: "nowrap",
2490
- zIndex: 12
2504
+ zIndex: BPMN_EDGE_LABEL_Z_INDEX2
2491
2505
  },
2492
2506
  className: "nodrag nopan",
2493
2507
  children: label ?? d?.label
@@ -2510,6 +2524,7 @@ function AssociationEdge({
2510
2524
  const d = data;
2511
2525
  const points = d?.routingPoints;
2512
2526
  const direction = d?.associationDirection ?? "none";
2527
+ const strokeColor = d?.color?.stroke ?? (selected ? "#1a56db" : "#888");
2513
2528
  const path = points && points.length >= 2 ? routing.pointsToSvgPath([{ x: sourceX, y: sourceY }, ...points.slice(1, -1), { x: targetX, y: targetY }]) : routing.getOrthogonalPath(sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition);
2514
2529
  return /* @__PURE__ */ jsxRuntime.jsx(
2515
2530
  react.BaseEdge,
@@ -2519,10 +2534,10 @@ function AssociationEdge({
2519
2534
  ...direction === "both" ? { markerStart: "url(#bpmn-arrow-open)" } : {},
2520
2535
  ...direction === "one" || direction === "both" ? { markerEnd: "url(#bpmn-arrow-open)" } : {},
2521
2536
  style: {
2522
- stroke: selected ? "#1a56db" : "#888",
2537
+ ...style ?? {},
2538
+ stroke: strokeColor,
2523
2539
  strokeWidth: 1,
2524
- strokeDasharray: "3 3",
2525
- ...style ?? {}
2540
+ strokeDasharray: "3 3"
2526
2541
  }
2527
2542
  }
2528
2543
  );
@@ -2541,6 +2556,7 @@ function DataAssociationEdge({
2541
2556
  }) {
2542
2557
  const d = data;
2543
2558
  const points = d?.routingPoints;
2559
+ const strokeColor = d?.color?.stroke ?? (selected ? "#1a56db" : "#888");
2544
2560
  const path = points && points.length >= 2 ? routing.pointsToSvgPath([{ x: sourceX, y: sourceY }, ...points.slice(1, -1), { x: targetX, y: targetY }]) : routing.getOrthogonalPath(sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition);
2545
2561
  return /* @__PURE__ */ jsxRuntime.jsx(
2546
2562
  react.BaseEdge,
@@ -2549,14 +2565,15 @@ function DataAssociationEdge({
2549
2565
  path,
2550
2566
  markerEnd: "url(#bpmn-arrow-open)",
2551
2567
  style: {
2552
- stroke: selected ? "#1a56db" : "#888",
2568
+ ...style ?? {},
2569
+ stroke: strokeColor,
2553
2570
  strokeWidth: 1,
2554
- strokeDasharray: "3 3",
2555
- ...style ?? {}
2571
+ strokeDasharray: "3 3"
2556
2572
  }
2557
2573
  }
2558
2574
  );
2559
2575
  }
2576
+ var BPMN_EDGE_LABEL_Z_INDEX3 = 1e3;
2560
2577
  function ConversationLinkEdge({
2561
2578
  sourceX,
2562
2579
  sourceY,
@@ -2566,7 +2583,7 @@ function ConversationLinkEdge({
2566
2583
  markerEnd
2567
2584
  }) {
2568
2585
  const d = data;
2569
- const stroke = BPMN_THEME.stroke;
2586
+ const stroke = d?.color?.stroke ?? BPMN_THEME.stroke;
2570
2587
  const [path] = react.getStraightPath({ sourceX, sourceY, targetX, targetY });
2571
2588
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
2572
2589
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2584,7 +2601,28 @@ function ConversationLinkEdge({
2584
2601
  style: { stroke: "#ffffff", strokeWidth: 2, fill: "none" }
2585
2602
  }
2586
2603
  ),
2587
- d?.label && /* @__PURE__ */ jsxRuntime.jsx("text", { fontSize: BPMN_THEME.fontSize, fontFamily: BPMN_THEME.fontFamily, fill: stroke, children: /* @__PURE__ */ jsxRuntime.jsx("textPath", { href: `#${path}`, startOffset: "50%", textAnchor: "middle", children: d.label }) })
2604
+ d?.label && /* @__PURE__ */ jsxRuntime.jsx(react.EdgeLabelRenderer, { children: /* @__PURE__ */ jsxRuntime.jsx(
2605
+ "div",
2606
+ {
2607
+ style: {
2608
+ position: "absolute",
2609
+ transform: `translate(-50%,-50%) translate(${(sourceX + targetX) / 2}px,${(sourceY + targetY) / 2}px)`,
2610
+ fontSize: BPMN_THEME.fontSize,
2611
+ fontFamily: BPMN_THEME.fontFamily,
2612
+ background: d?.color?.fill ?? "rgba(255,255,255,0.96)",
2613
+ color: stroke,
2614
+ padding: "2px 6px",
2615
+ borderRadius: 999,
2616
+ border: `1px solid ${d?.color?.stroke ?? "rgba(148, 163, 184, 0.45)"}`,
2617
+ boxShadow: "0 1px 2px rgba(15, 23, 42, 0.10)",
2618
+ pointerEvents: "all",
2619
+ whiteSpace: "nowrap",
2620
+ zIndex: BPMN_EDGE_LABEL_Z_INDEX3
2621
+ },
2622
+ className: "nodrag nopan",
2623
+ children: d.label
2624
+ }
2625
+ ) })
2588
2626
  ] });
2589
2627
  }
2590
2628
 
@@ -3249,10 +3287,21 @@ async function parseBpmnXml(xml) {
3249
3287
  warnings,
3250
3288
  autoX: { value: 50 }
3251
3289
  };
3290
+ const participantProcessIds = /* @__PURE__ */ new Set();
3291
+ for (const rootEl of asElements(rootElement.rootElements)) {
3292
+ if (rootEl.$type !== "bpmn:Collaboration") continue;
3293
+ for (const participant of asElements(rootEl.participants)) {
3294
+ const processRef = participant.processRef;
3295
+ const processId = processRef ? asString(processRef.id) : void 0;
3296
+ if (processId) participantProcessIds.add(processId);
3297
+ }
3298
+ }
3252
3299
  for (const rootEl of asElements(rootElement.rootElements)) {
3253
3300
  if (rootEl.$type === "bpmn:Collaboration") {
3254
3301
  handleCollaboration(rootEl, ctx, nodes, edges);
3255
3302
  } else if (rootEl.$type === "bpmn:Process") {
3303
+ const processId = asString(rootEl.id);
3304
+ if (processId && participantProcessIds.has(processId)) continue;
3256
3305
  const laneMembership = extractLaneMembership(rootEl);
3257
3306
  const laneSets = asLaneSets(rootEl.laneSets);
3258
3307
  if (laneSets.length > 0) {
@@ -3902,6 +3951,24 @@ function buildEdgeElement(moddle, edge, nodeById2) {
3902
3951
  }
3903
3952
  return moddle.create(moddleType, attrs);
3904
3953
  }
3954
+ var DI_EXTERNAL_LABEL_TYPES = /* @__PURE__ */ new Set([
3955
+ "ExclusiveGateway",
3956
+ "InclusiveGateway",
3957
+ "ParallelGateway",
3958
+ "EventBasedGateway",
3959
+ "ComplexGateway",
3960
+ "StartEvent",
3961
+ "EndEvent",
3962
+ "IntermediateCatchEvent",
3963
+ "IntermediateThrowEvent",
3964
+ "BoundaryEvent"
3965
+ ]);
3966
+ var DI_LABEL_CHAR_W = 6.5;
3967
+ var DI_LABEL_MAX_W = 150;
3968
+ var DI_LABEL_H = 14;
3969
+ function diLabelWidth(label) {
3970
+ return Math.min(Math.ceil(label.length * DI_LABEL_CHAR_W), DI_LABEL_MAX_W);
3971
+ }
3905
3972
  function buildBpmnDI(moddle, definitions, nodes, edges) {
3906
3973
  const shapes = [];
3907
3974
  const edgeShapes = [];
@@ -3924,19 +3991,47 @@ function buildBpmnDI(moddle, definitions, nodes, edges) {
3924
3991
  if (node.data.isExpanded !== void 0) {
3925
3992
  shape.isExpanded = node.data.isExpanded;
3926
3993
  }
3994
+ const nodeLabel = typeof node.data.label === "string" ? node.data.label : "";
3995
+ if (nodeLabel && DI_EXTERNAL_LABEL_TYPES.has(node.data.elementType)) {
3996
+ const absPos = absolutePositionById.get(node.id) ?? node.position;
3997
+ const labelW = diLabelWidth(nodeLabel);
3998
+ shape.label = moddle.create("bpmndi:BPMNLabel", {
3999
+ bounds: moddle.create("dc:Bounds", {
4000
+ x: absPos.x + w / 2 - labelW / 2,
4001
+ y: absPos.y + h + 4,
4002
+ width: labelW,
4003
+ height: DI_LABEL_H
4004
+ })
4005
+ });
4006
+ }
3927
4007
  shapes.push(shape);
3928
4008
  }
3929
4009
  for (const edge of edges) {
3930
- const waypoints = resolveEdgeWaypoints(edge, nodes, absolutePositionById).map(
4010
+ const waypointPts = resolveEdgeWaypoints(edge, nodes, absolutePositionById);
4011
+ const waypoints = waypointPts.map(
3931
4012
  (p) => moddle.create("dc:Point", { x: p.x, y: p.y })
3932
4013
  );
3933
- edgeShapes.push(
3934
- moddle.create("bpmndi:BPMNEdge", {
3935
- id: uid("BPMNEdge", edge.id),
3936
- bpmnElement: { id: edge.id },
3937
- waypoint: waypoints
3938
- })
3939
- );
4014
+ const bpmnEdge = moddle.create("bpmndi:BPMNEdge", {
4015
+ id: uid("BPMNEdge", edge.id),
4016
+ bpmnElement: { id: edge.id },
4017
+ waypoint: waypoints
4018
+ });
4019
+ const edgeLabel = typeof edge.data?.label === "string" ? edge.data.label : "";
4020
+ if (edgeLabel && waypointPts.length >= 2) {
4021
+ const anchor = getPreferredLabelAnchor(waypointPts);
4022
+ const offsetX = typeof edge.data?.labelOffsetX === "number" ? edge.data.labelOffsetX : 0;
4023
+ const offsetY = typeof edge.data?.labelOffsetY === "number" ? edge.data.labelOffsetY : 0;
4024
+ const labelW = diLabelWidth(edgeLabel);
4025
+ bpmnEdge.label = moddle.create("bpmndi:BPMNLabel", {
4026
+ bounds: moddle.create("dc:Bounds", {
4027
+ x: anchor.x + offsetX - labelW / 2,
4028
+ y: anchor.y + offsetY - DI_LABEL_H / 2,
4029
+ width: labelW,
4030
+ height: DI_LABEL_H
4031
+ })
4032
+ });
4033
+ }
4034
+ edgeShapes.push(bpmnEdge);
3940
4035
  }
3941
4036
  const rootEls = definitions.rootElements;
3942
4037
  const planeElement = rootEls?.find((element) => element.$type === "bpmn:Collaboration") ?? rootEls?.find((element) => element.$type === "bpmn:Process") ?? rootEls?.[0];
@@ -3960,17 +4055,63 @@ function resolveEdgeWaypoints(edge, nodes, absolutePositionById) {
3960
4055
  if (!source || !target) return [];
3961
4056
  const sourceMeta = BPMN_ELEMENT_CATALOG[source.data.elementType];
3962
4057
  const targetMeta = BPMN_ELEMENT_CATALOG[target.data.elementType];
3963
- const sourcePosition = absolutePositionById.get(source.id) ?? source.position;
3964
- const targetPosition = absolutePositionById.get(target.id) ?? target.position;
4058
+ const sPos = absolutePositionById.get(source.id) ?? source.position;
4059
+ const tPos = absolutePositionById.get(target.id) ?? target.position;
4060
+ const sW = source.width ?? sourceMeta.defaultWidth;
4061
+ const sH = source.height ?? sourceMeta.defaultHeight;
4062
+ const tW = target.width ?? targetMeta.defaultWidth;
4063
+ const tH = target.height ?? targetMeta.defaultHeight;
4064
+ const sCX = sPos.x + sW / 2;
4065
+ const sCY = sPos.y + sH / 2;
4066
+ const tCX = tPos.x + tW / 2;
4067
+ const tCY = tPos.y + tH / 2;
4068
+ if (Math.abs(sCY - tCY) <= 1) {
4069
+ if (tPos.x >= sPos.x + sW) return [{ x: sPos.x + sW, y: sCY }, { x: tPos.x, y: sCY }];
4070
+ if (sPos.x >= tPos.x + tW) return [{ x: sPos.x, y: sCY }, { x: tPos.x + tW, y: sCY }];
4071
+ }
4072
+ if (Math.abs(sCX - tCX) <= 1) {
4073
+ if (tPos.y >= sPos.y + sH) return [{ x: sCX, y: sPos.y + sH }, { x: sCX, y: tPos.y }];
4074
+ if (sPos.y >= tPos.y + tH) return [{ x: sCX, y: sPos.y }, { x: sCX, y: tPos.y + tH }];
4075
+ }
4076
+ if (tPos.x >= sPos.x + sW) {
4077
+ const midX = (sPos.x + sW + tPos.x) / 2;
4078
+ return [
4079
+ { x: sPos.x + sW, y: sCY },
4080
+ { x: midX, y: sCY },
4081
+ { x: midX, y: tCY },
4082
+ { x: tPos.x, y: tCY }
4083
+ ];
4084
+ }
4085
+ if (sPos.x >= tPos.x + tW) {
4086
+ const midX = (tPos.x + tW + sPos.x) / 2;
4087
+ return [
4088
+ { x: sPos.x, y: sCY },
4089
+ { x: midX, y: sCY },
4090
+ { x: midX, y: tCY },
4091
+ { x: tPos.x + tW, y: tCY }
4092
+ ];
4093
+ }
4094
+ if (tPos.y >= sPos.y + sH) {
4095
+ const midY = (sPos.y + sH + tPos.y) / 2;
4096
+ return [
4097
+ { x: sCX, y: sPos.y + sH },
4098
+ { x: sCX, y: midY },
4099
+ { x: tCX, y: midY },
4100
+ { x: tCX, y: tPos.y }
4101
+ ];
4102
+ }
4103
+ if (sPos.y >= tPos.y + tH) {
4104
+ const midY = (tPos.y + tH + sPos.y) / 2;
4105
+ return [
4106
+ { x: sCX, y: sPos.y },
4107
+ { x: sCX, y: midY },
4108
+ { x: tCX, y: midY },
4109
+ { x: tCX, y: tPos.y + tH }
4110
+ ];
4111
+ }
3965
4112
  return [
3966
- {
3967
- x: sourcePosition.x + (source.width ?? sourceMeta.defaultWidth) / 2,
3968
- y: sourcePosition.y + (source.height ?? sourceMeta.defaultHeight) / 2
3969
- },
3970
- {
3971
- x: targetPosition.x + (target.width ?? targetMeta.defaultWidth) / 2,
3972
- y: targetPosition.y + (target.height ?? targetMeta.defaultHeight) / 2
3973
- }
4113
+ { x: sCX, y: sCY },
4114
+ { x: tCX, y: tCY }
3974
4115
  ];
3975
4116
  }
3976
4117
  function buildAbsolutePositionMap(nodes) {