@aranzatech/diagrams-bpmn 0.1.3 → 0.2.1

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 (66) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +121 -0
  3. package/dist/catalog-OVnBDD8R.d.ts +9 -0
  4. package/dist/catalog-OWfI_yHU.d.cts +9 -0
  5. package/dist/{chunk-W3ROOC6E.js → chunk-33AR3PXF.js} +177 -40
  6. package/dist/chunk-33AR3PXF.js.map +1 -0
  7. package/dist/{chunk-3AFZDIMQ.js → chunk-ECTJRD7Z.js} +3 -3
  8. package/dist/{chunk-3AFZDIMQ.js.map → chunk-ECTJRD7Z.js.map} +1 -1
  9. package/dist/{chunk-NXMUX67A.js → chunk-H3YMTGFG.js} +79 -38
  10. package/dist/chunk-H3YMTGFG.js.map +1 -0
  11. package/dist/chunk-KALSGH4D.js +36 -0
  12. package/dist/chunk-KALSGH4D.js.map +1 -0
  13. package/dist/{chunk-DNR5WBQH.js → chunk-L5Z22RLX.js} +81 -20
  14. package/dist/chunk-L5Z22RLX.js.map +1 -0
  15. package/dist/chunk-OZKTOILD.js +3 -0
  16. package/dist/chunk-OZKTOILD.js.map +1 -0
  17. package/dist/{chunk-4AX573IV.js → chunk-RLAJNRF2.js} +3 -3
  18. package/dist/{chunk-4AX573IV.js.map → chunk-RLAJNRF2.js.map} +1 -1
  19. package/dist/chunk-YQTIODXH.js +532 -0
  20. package/dist/chunk-YQTIODXH.js.map +1 -0
  21. package/dist/chunk-ZFGQVLHB.js +226 -0
  22. package/dist/chunk-ZFGQVLHB.js.map +1 -0
  23. package/dist/edges/index.cjs +1 -1
  24. package/dist/edges/index.cjs.map +1 -1
  25. package/dist/edges/index.js +2 -2
  26. package/dist/elements/index.cjs +81 -17
  27. package/dist/elements/index.cjs.map +1 -1
  28. package/dist/elements/index.d.cts +4 -6
  29. package/dist/elements/index.d.ts +4 -6
  30. package/dist/elements/index.js +3 -2
  31. package/dist/index.cjs +1120 -118
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.cts +10 -63
  34. package/dist/index.d.ts +10 -63
  35. package/dist/index.js +9 -42
  36. package/dist/index.js.map +1 -1
  37. package/dist/modeling/index.cjs +1241 -0
  38. package/dist/modeling/index.cjs.map +1 -0
  39. package/dist/modeling/index.d.cts +146 -0
  40. package/dist/modeling/index.d.ts +146 -0
  41. package/dist/modeling/index.js +5 -0
  42. package/dist/modeling/index.js.map +1 -0
  43. package/dist/nodes/index.cjs +91 -38
  44. package/dist/nodes/index.cjs.map +1 -1
  45. package/dist/nodes/index.js +2 -2
  46. package/dist/types-BxjCV2oX.d.ts +20 -0
  47. package/dist/{types-C78d_Kdh.d.cts → types-DznxZxpV.d.cts} +17 -19
  48. package/dist/{types-C78d_Kdh.d.ts → types-DznxZxpV.d.ts} +17 -19
  49. package/dist/types-vVi5T7qj.d.cts +20 -0
  50. package/dist/validation/index.cjs +848 -0
  51. package/dist/validation/index.cjs.map +1 -0
  52. package/dist/validation/index.d.cts +25 -0
  53. package/dist/validation/index.d.ts +25 -0
  54. package/dist/validation/index.js +5 -0
  55. package/dist/validation/index.js.map +1 -0
  56. package/dist/xml/index.cjs +215 -54
  57. package/dist/xml/index.cjs.map +1 -1
  58. package/dist/xml/index.d.cts +4 -19
  59. package/dist/xml/index.d.ts +4 -19
  60. package/dist/xml/index.js +2 -2
  61. package/package.json +16 -4
  62. package/dist/chunk-23B2IGK5.js +0 -24
  63. package/dist/chunk-23B2IGK5.js.map +0 -1
  64. package/dist/chunk-DNR5WBQH.js.map +0 -1
  65. package/dist/chunk-NXMUX67A.js.map +0 -1
  66. package/dist/chunk-W3ROOC6E.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/modeling/index.ts"],"names":[],"mappings":";;;;;AA0HO,SAAS,eAAe,OAAA,EAA4C;AACzE,EAAA,MAAM,IAAA,GAAO,kBAAA,CAAmB,OAAA,CAAQ,WAAW,CAAA;A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QAAA,GAAW,qBAA6C,IAAI,CAAA;AAClE,EAAA,IAAI,QAAA,CAAS,WAAA,IAAe,QAAA,CAAS,WAAA,KAAgB,MAAA,EAAQ;AAC3D,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,4CAAA,EAA+C,QAAA,CAAS,WAAW,CAAA,EAAA,CAAI,CAAA;AAAA,EACzF;AACA,EAAA,OAAO,QAAA;AACT;AAEO,SAAS,uBAAuB,IAAA,EAAgC;AACrE,EAAA,MAAM,QAAA,GAAW,yBAAyB,IAAI,CAAA;AAC9C,EAAA,OAAO,kBAAA,CAA2C,IAAA,CAAK,SAAA,CAAU,QAAQ,CAAC,CAAA;AAC5E;AAEO,SAAS,cAAA,CACd,OACA,OAAA,EAC2C;AAC3C,EAAA,OAAO,cAAA,CAAe,OAAO,OAAO,CAAA;AACtC;AAEO,SAAS,eAAA,CACd,KAAA,EACA,QAAA,EACA,OAAA,GAA2C,EAAC,EACD;AAC3C,EAAA,OAAO,eAAA,CAAgB,KAAA,EAAO,QAAA,EAAU,OAAO,CAAA;AACjD","file":"chunk-YQTIODXH.js","sourcesContent":["import {\n addNode,\n connectNodes,\n copyElements,\n createModelingRules,\n createSelectionState,\n executeCommand,\n executeCommands,\n getNode,\n getOutgoingEdges,\n getIncomingEdges,\n normalizeDiagramState,\n pasteElements,\n patchEdge,\n patchNode,\n removeElements,\n replaceNode,\n reparentNode,\n resizeNode,\n setSelection,\n type CommandStackState,\n type ClipboardState,\n type ConnectionValidator,\n type DiagramCommand,\n type DiagramState,\n type ModelingRules,\n type SelectionState,\n} from \"@aranzatech/diagrams-core\";\nimport {\n createDiagramDocument,\n deserializeDiagram,\n parseDiagramDocument,\n serializeDiagram,\n type CreateDiagramDocumentOptions,\n type DiagramDocument,\n} from \"@aranzatech/diagrams-core/serialization\";\nimport {\n BPMN_ELEMENT_CATALOG,\n getBpmnElementSize,\n isBpmnElementResizable,\n} from \"../elements/catalog\";\nimport {\n acceptsBoundaryEvents,\n getHandlePolicy,\n isDataType,\n isEventType,\n isGatewayType,\n} from \"../elements/guards\";\nimport type { BpmnElementType, BpmnEdgeData, BpmnEdgeType, BpmnNodeData } from \"../elements/types\";\nimport type { BpmnRFEdge, BpmnRFNode } from \"../xml/types\";\n\nexport { getBpmnElementSize, isBpmnElementResizable } from \"../elements/catalog\";\n\nexport type BpmnDiagramState = DiagramState<BpmnRFNode, BpmnRFEdge>;\nexport type BpmnClipboardState = ClipboardState<BpmnRFNode, BpmnRFEdge>;\nexport type BpmnDiagramDocument = DiagramDocument<BpmnRFNode, BpmnRFEdge>;\n\nexport interface CreateBpmnNodeOptions {\n id: string;\n elementType: BpmnElementType;\n position: { x: number; y: number };\n label?: string;\n parentId?: string;\n width?: number;\n height?: number;\n data?: Partial<BpmnNodeData>;\n}\n\nexport interface ConnectBpmnOptions {\n id?: string;\n source: string;\n target: string;\n edgeType?: BpmnEdgeType;\n label?: string;\n sourceHandle?: string | null;\n targetHandle?: string | null;\n data?: Partial<BpmnEdgeData>;\n}\n\nexport interface ReplaceBpmnNodeOptions {\n id: string;\n elementType: BpmnElementType;\n label?: string;\n data?: Partial<BpmnNodeData>;\n width?: number;\n height?: number;\n}\n\nexport interface ReparentBpmnNodeOptions {\n id: string;\n parentId?: string;\n position?: { x: number; y: number };\n}\n\nexport interface ResizeBpmnNodeOptions {\n id: string;\n width?: number;\n height?: number;\n}\n\nexport interface ReorderBpmnLaneOptions {\n poolId: string;\n laneId: string;\n index: number;\n}\n\nexport interface MoveBpmnLaneOptions {\n poolId: string;\n laneId: string;\n position: { x: number; y: number };\n}\n\nexport interface RouteBpmnEdgeOptions {\n id: string;\n routingPoints: Array<{ x: number; y: number }>;\n}\n\nexport interface PasteBpmnOptions {\n offset?: { x: number; y: number };\n position?: { x: number; y: number };\n}\n\nexport function createBpmnNode(options: CreateBpmnNodeOptions): BpmnRFNode {\n const size = getBpmnElementSize(options.elementType);\n const meta = BPMN_ELEMENT_CATALOG[options.elementType];\n const orientation = options.data?.orientation ?? meta.orientation;\n const dragHandle = getBpmnDragHandleSelector(options.elementType);\n return {\n id: options.id,\n type: options.elementType,\n position: options.position,\n data: {\n elementType: options.elementType,\n orientation,\n ...(options.label ? { label: options.label } : {}),\n ...(options.data ?? {}),\n },\n width: options.width ?? size.width,\n height: options.height ?? size.height,\n ...(options.parentId ? { parentId: options.parentId } : {}),\n ...(dragHandle ? { dragHandle } : {}),\n };\n}\n\nexport const BPMN_POOL_LANE_LAYOUT = {\n poolHeaderSize: 30,\n laneHeaderSize: 24,\n laneGap: 0,\n} as const;\n\nexport function getBpmnDragHandleSelector(\n elementType: BpmnElementType,\n): string | undefined {\n if (elementType === \"Pool\") return \".pool-drag-handle\";\n if (elementType === \"Lane\") return \".lane-drag-handle\";\n return undefined;\n}\n\nexport const BPMN_SELECTION_STYLE = {\n nodeOutline: \"#2563eb\",\n edgeStroke: \"#2563eb\",\n handleFill: \"#ffffff\",\n handleStroke: \"#2563eb\",\n resizeHandleSize: 8,\n routingPointRadius: 5,\n} as const;\n\nexport const BPMN_ROUTABLE_EDGE_TYPES = [\n \"sequenceFlow\",\n \"messageFlow\",\n \"association\",\n \"dataAssociation\",\n \"conversationLink\",\n] satisfies BpmnEdgeType[];\n\nexport interface BpmnConnectionRule {\n edgeType: BpmnEdgeType;\n sourceCategories: Array<BpmnRFNode[\"data\"][\"elementType\"] | \"flowNode\" | \"data\" | \"artifact\" | \"conversation\">;\n targetCategories: Array<BpmnRFNode[\"data\"][\"elementType\"] | \"flowNode\" | \"data\" | \"artifact\" | \"conversation\">;\n allowSameParent?: boolean;\n allowDifferentParent?: boolean;\n}\n\nexport const BPMN_EDGE_CONNECTION_RULES: Record<BpmnEdgeType, BpmnConnectionRule> = {\n sequenceFlow: {\n edgeType: \"sequenceFlow\",\n sourceCategories: [\"flowNode\"],\n targetCategories: [\"flowNode\"],\n allowSameParent: true,\n allowDifferentParent: false,\n },\n messageFlow: {\n edgeType: \"messageFlow\",\n sourceCategories: [\"flowNode\"],\n targetCategories: [\"flowNode\"],\n allowSameParent: false,\n allowDifferentParent: true,\n },\n association: {\n edgeType: \"association\",\n sourceCategories: [\"flowNode\", \"artifact\", \"data\"],\n targetCategories: [\"flowNode\", \"artifact\", \"data\"],\n allowSameParent: true,\n allowDifferentParent: true,\n },\n dataAssociation: {\n edgeType: \"dataAssociation\",\n sourceCategories: [\"flowNode\", \"data\"],\n targetCategories: [\"flowNode\", \"data\"],\n allowSameParent: true,\n allowDifferentParent: true,\n },\n conversationLink: {\n edgeType: \"conversationLink\",\n sourceCategories: [\"conversation\", \"flowNode\"],\n targetCategories: [\"conversation\", \"flowNode\"],\n allowSameParent: true,\n allowDifferentParent: true,\n },\n};\n\nexport function inferBpmnEdgeType(\n state: BpmnDiagramState,\n sourceId: string,\n targetId: string,\n): BpmnEdgeType {\n const source = getNode(state, sourceId);\n const target = getNode(state, targetId);\n if (!source || !target) return \"sequenceFlow\";\n\n if (isDataType(source.data.elementType) || isDataType(target.data.elementType)) {\n return \"dataAssociation\";\n }\n if (\n source.data.elementType === \"Annotation\" ||\n target.data.elementType === \"Annotation\" ||\n source.data.elementType === \"Group\" ||\n target.data.elementType === \"Group\"\n ) {\n return \"association\";\n }\n if (\n source.data.elementType === \"Conversation\" ||\n source.data.elementType === \"SubConversation\" ||\n source.data.elementType === \"CallConversation\" ||\n target.data.elementType === \"Conversation\" ||\n target.data.elementType === \"SubConversation\" ||\n target.data.elementType === \"CallConversation\"\n ) {\n return \"conversationLink\";\n }\n if (source.parentId && target.parentId && source.parentId !== target.parentId) {\n return \"messageFlow\";\n }\n return \"sequenceFlow\";\n}\n\nfunction canUseSequenceFlow(type: BpmnElementType): boolean {\n const meta = BPMN_ELEMENT_CATALOG[type];\n return (\n meta.handlePolicy !== \"none\" &&\n !isDataType(type) &&\n type !== \"Annotation\" &&\n type !== \"Group\" &&\n meta.category !== \"conversation\"\n );\n}\n\nfunction matchesConnectionCategory(\n type: BpmnElementType,\n categories: BpmnConnectionRule[\"sourceCategories\"],\n): boolean {\n return categories.some((category) => {\n if (category === type) return true;\n if (category === \"flowNode\") return canUseSequenceFlow(type);\n if (category === \"data\") return isDataType(type);\n if (category === \"artifact\") return type === \"Annotation\" || type === \"Group\";\n if (category === \"conversation\") return BPMN_ELEMENT_CATALOG[type].category === \"conversation\";\n return false;\n });\n}\n\nexport function isBpmnEdgeRoutingEditable(edgeType: BpmnEdgeType): boolean {\n return BPMN_ROUTABLE_EDGE_TYPES.includes(edgeType);\n}\n\nexport function isBpmnProcessNode(type: BpmnElementType): boolean {\n return (\n isEventType(type) ||\n isGatewayType(type) ||\n type.includes(\"Task\") ||\n type === \"CallActivity\" ||\n type === \"SubProcess\" ||\n type === \"Transaction\" ||\n type === \"EventSubProcess\" ||\n type === \"AdHocSubProcess\"\n );\n}\n\nexport function canContainBpmnElement(\n parentType: BpmnElementType | undefined,\n childType: BpmnElementType,\n): true | string {\n if (!parentType) return true;\n if (parentType === \"Pool\") {\n return childType === \"Lane\" || isBpmnProcessNode(childType)\n ? true\n : \"Pools can contain lanes or BPMN process nodes.\";\n }\n if (parentType === \"Lane\") {\n return isBpmnProcessNode(childType)\n ? true\n : \"Lanes can only contain BPMN process nodes.\";\n }\n if (\n parentType === \"SubProcess\" ||\n parentType === \"Transaction\" ||\n parentType === \"EventSubProcess\" ||\n parentType === \"AdHocSubProcess\"\n ) {\n return isBpmnProcessNode(childType)\n ? true\n : \"Subprocesses can only contain BPMN process nodes.\";\n }\n return `${parentType} cannot contain BPMN child elements.`;\n}\n\nfunction getDirectBpmnChildren(\n state: BpmnDiagramState,\n parentId: string,\n): BpmnRFNode[] {\n return state.nodes.filter((node) => node.parentId === parentId);\n}\n\nexport function getBpmnPoolLanes(\n state: BpmnDiagramState,\n poolId: string,\n): BpmnRFNode[] {\n return getDirectBpmnChildren(state, poolId).filter(\n (node) => node.data.elementType === \"Lane\",\n );\n}\n\nfunction getNodeDimension(node: BpmnRFNode, axis: \"width\" | \"height\"): number {\n return node[axis] ?? node.measured?.[axis] ?? getBpmnElementSize(node.data.elementType)[axis];\n}\n\nfunction resolvePoolLaneDirection(pool: BpmnRFNode): \"horizontal\" | \"vertical\" {\n return pool.data.orientation === \"vertical\" ? \"horizontal\" : \"vertical\";\n}\n\nexport function getBpmnLaneIndexAtPosition(\n state: BpmnDiagramState,\n poolId: string,\n position: { x: number; y: number },\n): number {\n const pool = getNode(state, poolId);\n if (!pool) return 0;\n const lanes = getBpmnPoolLanes(state, poolId);\n const direction = resolvePoolLaneDirection(pool);\n const axis = direction === \"vertical\" ? \"y\" : \"x\";\n const sizeKey = direction === \"vertical\" ? \"height\" : \"width\";\n\n for (let index = 0; index < lanes.length; index += 1) {\n const lane = lanes[index];\n const midpoint = lane.position[axis] + getNodeDimension(lane, sizeKey) / 2;\n if (position[axis] < midpoint) return index;\n }\n return lanes.length;\n}\n\nfunction sortBpmnLanes(\n state: BpmnDiagramState,\n poolId: string,\n laneId: string,\n index: number,\n): BpmnDiagramState {\n const lanes = getBpmnPoolLanes(state, poolId);\n const currentIndex = lanes.findIndex((lane) => lane.id === laneId);\n if (currentIndex < 0) return state;\n\n const orderedIds = lanes.map((lane) => lane.id);\n const [moved] = orderedIds.splice(currentIndex, 1);\n orderedIds.splice(Math.max(0, Math.min(index, orderedIds.length)), 0, moved);\n const order = new Map(orderedIds.map((id, laneIndex) => [id, laneIndex]));\n\n return {\n ...state,\n nodes: [...state.nodes].sort((a, b) => {\n const aOrder = order.get(a.id);\n const bOrder = order.get(b.id);\n if (aOrder === undefined && bOrder === undefined) return 0;\n if (aOrder === undefined) return -1;\n if (bOrder === undefined) return 1;\n return aOrder - bOrder;\n }),\n };\n}\n\nexport function layoutBpmnPoolLanes(\n state: BpmnDiagramState,\n poolId: string,\n): BpmnDiagramState {\n const pool = getNode(state, poolId);\n if (!pool) return state;\n const poolSize = getBpmnElementSize(\"Pool\");\n const direction = resolvePoolLaneDirection(pool);\n const lanes = getBpmnPoolLanes(state, poolId);\n let cursor = direction === \"vertical\" ? BPMN_POOL_LANE_LAYOUT.poolHeaderSize : 0;\n\n let next = state;\n for (const lane of lanes) {\n const laneSize = getBpmnElementSize(\"Lane\");\n const width =\n direction === \"vertical\"\n ? Math.max(poolSize.minWidth - BPMN_POOL_LANE_LAYOUT.poolHeaderSize, lane.width ?? laneSize.width)\n : lane.width ?? laneSize.width;\n const height =\n direction === \"vertical\"\n ? lane.height ?? laneSize.height\n : Math.max(poolSize.minHeight - BPMN_POOL_LANE_LAYOUT.poolHeaderSize, lane.height ?? laneSize.height);\n next = patchNode(next, lane.id, {\n position: direction === \"vertical\" ? { x: BPMN_POOL_LANE_LAYOUT.poolHeaderSize, y: cursor } : { x: cursor, y: BPMN_POOL_LANE_LAYOUT.poolHeaderSize },\n width,\n height,\n data: { orientation: pool.data.orientation ?? \"horizontal\" },\n });\n cursor += (direction === \"vertical\" ? height : width) + BPMN_POOL_LANE_LAYOUT.laneGap;\n }\n\n const minWidth =\n direction === \"vertical\"\n ? poolSize.minWidth\n : Math.max(poolSize.minWidth, cursor);\n const minHeight =\n direction === \"vertical\"\n ? Math.max(poolSize.minHeight, cursor)\n : poolSize.minHeight;\n return resizeNode(next, poolId, { width: minWidth, height: minHeight } as Parameters<typeof resizeNode<BpmnRFNode, BpmnRFEdge>>[2]);\n}\n\nexport function reorderBpmnLane(\n state: BpmnDiagramState,\n options: ReorderBpmnLaneOptions,\n): BpmnDiagramState {\n return layoutBpmnPoolLanes(\n sortBpmnLanes(state, options.poolId, options.laneId, options.index),\n options.poolId,\n );\n}\n\nexport function validateBpmnConnectionForEdgeType(\n state: BpmnDiagramState,\n edgeType: BpmnEdgeType,\n source: BpmnRFNode,\n target: BpmnRFNode,\n): true | string {\n const rule = BPMN_EDGE_CONNECTION_RULES[edgeType];\n if (!matchesConnectionCategory(source.data.elementType, rule.sourceCategories)) {\n return `${edgeType} cannot start from ${source.data.elementType}.`;\n }\n if (!matchesConnectionCategory(target.data.elementType, rule.targetCategories)) {\n return `${edgeType} cannot target ${target.data.elementType}.`;\n }\n const sameParent = (source.parentId ?? null) === (target.parentId ?? null);\n if (sameParent && rule.allowSameParent === false) {\n return `${edgeType} must connect BPMN elements in different participants/scopes.`;\n }\n if (!sameParent && rule.allowDifferentParent === false) {\n return `${edgeType} must stay inside the same BPMN participant/scope.`;\n }\n if (edgeType === \"sequenceFlow\") {\n if (source.data.elementType === \"EndEvent\") return \"End events cannot have outgoing sequence flows.\";\n if (target.data.elementType === \"StartEvent\") return \"Start events cannot have incoming sequence flows.\";\n return validateEdgeCardinality(state, edgeType, source, target);\n }\n return true;\n}\n\nfunction validateEdgeCardinality(\n state: BpmnDiagramState,\n edgeType: BpmnEdgeType,\n source: BpmnRFNode,\n target: BpmnRFNode,\n): true | string {\n if (edgeType !== \"sequenceFlow\") return true;\n\n const sourceMax = BPMN_ELEMENT_CATALOG[source.data.elementType].maxOutgoing;\n const targetMax = BPMN_ELEMENT_CATALOG[target.data.elementType].maxIncoming;\n const outgoing = getOutgoingEdges(state, source.id).filter(\n (edge) => edge.data?.edgeType === \"sequenceFlow\",\n );\n const incoming = getIncomingEdges(state, target.id).filter(\n (edge) => edge.data?.edgeType === \"sequenceFlow\",\n );\n\n if (sourceMax !== undefined && outgoing.length >= sourceMax) {\n return `${source.data.elementType} cannot have more than ${sourceMax} outgoing sequence flow(s).`;\n }\n if (targetMax !== undefined && incoming.length >= targetMax) {\n return `${target.data.elementType} cannot have more than ${targetMax} incoming sequence flow(s).`;\n }\n return true;\n}\n\nexport const bpmnConnectionValidators: Array<\n ConnectionValidator<BpmnRFNode, BpmnRFEdge>\n> = [\n ({ state, source, target }) => {\n if (source.id === target.id) return \"BPMN self-connections are not allowed.\";\n const edgeType = inferBpmnEdgeType(state, source.id, target.id);\n\n if (getHandlePolicy(source.data.elementType) === \"none\" || getHandlePolicy(target.data.elementType) === \"none\") {\n return \"Elements without BPMN connection handles cannot be directly connected.\";\n }\n\n if (edgeType === \"sequenceFlow\") {\n return validateBpmnConnectionForEdgeType(state, edgeType, source, target);\n }\n\n return validateBpmnConnectionForEdgeType(state, edgeType, source, target);\n },\n];\n\nexport const BPMN_MODELING_RULES: ModelingRules<BpmnRFNode, BpmnRFEdge> =\n createModelingRules({\n connect: [\n ({ state, source, target }) => {\n if (!source || !target) return false;\n for (const validator of bpmnConnectionValidators) {\n const result = validator({\n state,\n source,\n target,\n existingEdges: state.edges,\n });\n if (result !== true) return result;\n }\n return true;\n },\n ],\n drop: [\n ({ node, parent }) => {\n if (!node || !parent) return true;\n if (node.data.elementType === \"BoundaryEvent\") {\n return acceptsBoundaryEvents(parent.data.elementType)\n ? true\n : \"Boundary events can only be attached to tasks or subprocesses.\";\n }\n return canContainBpmnElement(parent.data.elementType, node.data.elementType);\n },\n ],\n reparent: [\n ({ node, parent }) => {\n if (!node || !parent) return true;\n if (node.data.elementType === \"BoundaryEvent\") {\n return acceptsBoundaryEvents(parent.data.elementType)\n ? true\n : \"Boundary events can only be reparented to tasks or subprocesses.\";\n }\n return canContainBpmnElement(parent?.data.elementType, node.data.elementType);\n },\n ],\n delete: [() => true],\n resize: [\n ({ node }) =>\n !node || isBpmnElementResizable(node.data.elementType)\n ? true\n : `${node.data.elementType} is not resizable in BPMN.`,\n ],\n });\n\nexport function createBpmnNodeCommand(\n options: CreateBpmnNodeOptions,\n): DiagramCommand<BpmnRFNode, BpmnRFEdge> {\n return {\n id: `bpmn.createNode.${options.id}`,\n label: `Create ${options.elementType}`,\n execute: (state) => addNode(state, createBpmnNode(options)),\n };\n}\n\nexport function connectBpmnCommand(\n options: ConnectBpmnOptions,\n): DiagramCommand<BpmnRFNode, BpmnRFEdge> {\n return {\n id: `bpmn.connect.${options.id ?? `${options.source}-${options.target}`}`,\n label: \"Connect BPMN elements\",\n execute: (state) => {\n const edgeType = options.edgeType ?? inferBpmnEdgeType(state, options.source, options.target);\n const source = getNode(state, options.source);\n const target = getNode(state, options.target);\n if (!source) throw new Error(`Source node \"${options.source}\" does not exist.`);\n if (!target) throw new Error(`Target node \"${options.target}\" does not exist.`);\n const validation = validateBpmnConnectionForEdgeType(state, edgeType, source, target);\n if (validation !== true) throw new Error(validation);\n return connectNodes(\n state,\n {\n source: options.source,\n target: options.target,\n type: edgeType,\n ...(options.sourceHandle !== undefined\n ? { sourceHandle: options.sourceHandle }\n : {}),\n ...(options.targetHandle !== undefined\n ? { targetHandle: options.targetHandle }\n : {}),\n ...(options.id ? { id: options.id } : {}),\n data: {\n edgeType,\n ...(options.label ? { label: options.label } : {}),\n ...(options.data ?? {}),\n },\n },\n [],\n );\n },\n };\n}\n\nexport function attachBoundaryEventCommand(\n boundaryId: string,\n hostId: string,\n): DiagramCommand<BpmnRFNode, BpmnRFEdge> {\n return {\n id: `bpmn.attachBoundary.${boundaryId}.${hostId}`,\n label: \"Attach boundary event\",\n execute: (state) => {\n const host = getNode(state, hostId);\n if (!host || !acceptsBoundaryEvents(host.data.elementType)) {\n throw new Error(`Element \"${hostId}\" cannot host boundary events.`);\n }\n const boundary = getNode(state, boundaryId);\n if (!boundary || boundary.data.elementType !== \"BoundaryEvent\") {\n throw new Error(`Element \"${boundaryId}\" is not a boundary event.`);\n }\n const reparented = reparentNode(state, boundaryId, { parentId: hostId });\n return patchNode(reparented, boundaryId, {\n data: { attachedToRef: hostId },\n });\n },\n };\n}\n\nexport function replaceBpmnNodeCommand(\n options: ReplaceBpmnNodeOptions,\n): DiagramCommand<BpmnRFNode, BpmnRFEdge> {\n return {\n id: `bpmn.replaceNode.${options.id}.${options.elementType}`,\n label: `Replace with ${options.elementType}`,\n execute: (state) => {\n const current = getNode(state, options.id);\n if (!current) throw new Error(`Element \"${options.id}\" does not exist.`);\n const meta = BPMN_ELEMENT_CATALOG[options.elementType];\n return replaceNode(state, options.id, {\n ...current,\n type: options.elementType,\n width: options.width ?? current.width ?? meta.defaultWidth,\n height: options.height ?? current.height ?? meta.defaultHeight,\n data: {\n ...current.data,\n elementType: options.elementType,\n ...(options.label ? { label: options.label } : {}),\n ...(options.data ?? {}),\n },\n });\n },\n };\n}\n\nexport function reparentBpmnNodeCommand(\n options: ReparentBpmnNodeOptions,\n): DiagramCommand<BpmnRFNode, BpmnRFEdge> {\n return {\n id: `bpmn.reparent.${options.id}.${options.parentId ?? \"root\"}`,\n label: \"Reparent BPMN element\",\n execute: (state) => {\n const node = getNode(state, options.id);\n const parent = options.parentId ? getNode(state, options.parentId) : undefined;\n if (!node) throw new Error(`Element \"${options.id}\" does not exist.`);\n if (parent && node.data.elementType === \"BoundaryEvent\" && !acceptsBoundaryEvents(parent.data.elementType)) {\n throw new Error(\"Boundary events can only be reparented to tasks or subprocesses.\");\n }\n const containment = canContainBpmnElement(parent?.data.elementType, node.data.elementType);\n if (containment !== true) throw new Error(containment);\n const reparented = reparentNode(state, options.id, {\n ...(options.parentId !== undefined ? { parentId: options.parentId } : {}),\n ...(options.position ? { position: options.position } : {}),\n });\n return parent?.data.elementType === \"Pool\" && node.data.elementType === \"Lane\"\n ? layoutBpmnPoolLanes(reparented, parent.id)\n : reparented;\n },\n };\n}\n\nexport function resizeBpmnNodeCommand(\n options: ResizeBpmnNodeOptions,\n): DiagramCommand<BpmnRFNode, BpmnRFEdge> {\n return {\n id: `bpmn.resize.${options.id}`,\n label: \"Resize BPMN element\",\n execute: (state) => {\n const node = getNode(state, options.id);\n if (!node) throw new Error(`Element \"${options.id}\" does not exist.`);\n const size = getBpmnElementSize(node.data.elementType);\n if (!size.resizable) {\n throw new Error(`${node.data.elementType} is not resizable in BPMN.`);\n }\n return resizeNode(state, options.id, {\n width:\n options.width === undefined\n ? undefined\n : Math.max(size.minWidth, options.width),\n height:\n options.height === undefined\n ? undefined\n : Math.max(size.minHeight, options.height),\n } as Parameters<typeof resizeNode<BpmnRFNode, BpmnRFEdge>>[2]);\n },\n };\n}\n\nexport function reorderBpmnLaneCommand(\n options: ReorderBpmnLaneOptions,\n): DiagramCommand<BpmnRFNode, BpmnRFEdge> {\n return {\n id: `bpmn.reorderLane.${options.poolId}.${options.laneId}`,\n label: \"Reorder BPMN lane\",\n execute: (state) => {\n const pool = getNode(state, options.poolId);\n const lane = getNode(state, options.laneId);\n if (!pool || pool.data.elementType !== \"Pool\") {\n throw new Error(`Element \"${options.poolId}\" is not a pool.`);\n }\n if (!lane || lane.data.elementType !== \"Lane\" || lane.parentId !== options.poolId) {\n throw new Error(`Element \"${options.laneId}\" is not a lane in pool \"${options.poolId}\".`);\n }\n return reorderBpmnLane(state, options);\n },\n };\n}\n\nexport function moveBpmnLaneCommand(\n options: MoveBpmnLaneOptions,\n): DiagramCommand<BpmnRFNode, BpmnRFEdge> {\n return {\n id: `bpmn.moveLane.${options.poolId}.${options.laneId}`,\n label: \"Move BPMN lane\",\n execute: (state) =>\n reorderBpmnLane(state, {\n poolId: options.poolId,\n laneId: options.laneId,\n index: getBpmnLaneIndexAtPosition(state, options.poolId, options.position),\n }),\n };\n}\n\nexport function routeBpmnEdgeCommand(\n options: RouteBpmnEdgeOptions,\n): DiagramCommand<BpmnRFNode, BpmnRFEdge> {\n return {\n id: `bpmn.routeEdge.${options.id}`,\n label: \"Route BPMN edge\",\n execute: (state) => {\n const edge = state.edges.find((item) => item.id === options.id);\n if (!edge) throw new Error(`Edge \"${options.id}\" does not exist.`);\n const edgeType = edge.data?.edgeType;\n if (!edgeType || !isBpmnEdgeRoutingEditable(edgeType)) {\n throw new Error(`${edgeType ?? \"edge\"} routing points cannot be edited.`);\n }\n return patchEdge(state, options.id, {\n data: { routingPoints: options.routingPoints },\n } as Parameters<typeof patchEdge<BpmnRFNode, BpmnRFEdge>>[2]);\n },\n };\n}\n\nexport function deleteBpmnElementsCommand(\n ids: string[],\n): DiagramCommand<BpmnRFNode, BpmnRFEdge> {\n return {\n id: `bpmn.delete.${ids.join(\".\")}`,\n label: \"Delete BPMN elements\",\n execute: (state) => removeElements(state, ids),\n };\n}\n\nexport function copyBpmnElements(\n state: BpmnDiagramState,\n selection?: SelectionState,\n): BpmnClipboardState {\n return copyElements(state, selection);\n}\n\nexport function pasteBpmnElementsCommand(\n clipboard: BpmnClipboardState,\n options: PasteBpmnOptions = {},\n): DiagramCommand<BpmnRFNode, BpmnRFEdge> {\n return {\n id: \"bpmn.paste\",\n label: \"Paste BPMN elements\",\n execute: (state) => pasteElements(state, clipboard, options),\n };\n}\n\nexport function selectBpmnElementsCommand(\n selection: SelectionState,\n): DiagramCommand<BpmnRFNode, BpmnRFEdge> {\n return {\n id: \"bpmn.select\",\n label: \"Select BPMN elements\",\n execute: (state) => setSelection(state, createSelectionState(selection.nodeIds, selection.edgeIds)),\n };\n}\n\nexport function createBpmnDiagramDocument(\n state: BpmnDiagramState,\n options: Omit<CreateDiagramDocumentOptions, \"diagramType\"> = {},\n): BpmnDiagramDocument {\n return createDiagramDocument(normalizeDiagramState(state), {\n ...options,\n diagramType: \"bpmn\",\n });\n}\n\nexport function serializeBpmnDiagram(\n state: BpmnDiagramState,\n options: Omit<CreateDiagramDocumentOptions, \"diagramType\"> = {},\n): string {\n return serializeDiagram(normalizeDiagramState(state), {\n ...options,\n diagramType: \"bpmn\",\n });\n}\n\nexport function parseBpmnDiagramDocument(json: string): BpmnDiagramDocument {\n const document = parseDiagramDocument<BpmnRFNode, BpmnRFEdge>(json);\n if (document.diagramType && document.diagramType !== \"bpmn\") {\n throw new Error(`Expected a BPMN diagram document, received \"${document.diagramType}\".`);\n }\n return document;\n}\n\nexport function deserializeBpmnDiagram(json: string): BpmnDiagramState {\n const document = parseBpmnDiagramDocument(json);\n return deserializeDiagram<BpmnRFNode, BpmnRFEdge>(JSON.stringify(document));\n}\n\nexport function runBpmnCommand(\n stack: CommandStackState<BpmnRFNode, BpmnRFEdge>,\n command: DiagramCommand<BpmnRFNode, BpmnRFEdge>,\n): CommandStackState<BpmnRFNode, BpmnRFEdge> {\n return executeCommand(stack, command);\n}\n\nexport function runBpmnCommands(\n stack: CommandStackState<BpmnRFNode, BpmnRFEdge>,\n commands: Array<DiagramCommand<BpmnRFNode, BpmnRFEdge>>,\n options: { id?: string; label?: string } = {},\n): CommandStackState<BpmnRFNode, BpmnRFEdge> {\n return executeCommands(stack, commands, options);\n}\n"]}
@@ -0,0 +1,226 @@
1
+ import { isDataType, isGatewayType, isEventType } from './chunk-RLAJNRF2.js';
2
+ import { BPMN_ELEMENT_CATALOG } from './chunk-L5Z22RLX.js';
3
+
4
+ // src/validation/index.ts
5
+ function isFlowNode(type) {
6
+ return isEventType(type) || isGatewayType(type) || type.includes("Task") || type === "CallActivity" || type === "SubProcess" || type === "Transaction" || type === "EventSubProcess" || type === "AdHocSubProcess" || type === "ChoreographyTask" || type === "SubChoreography" || type === "CallChoreography";
7
+ }
8
+ function isProcessNode(type) {
9
+ return isFlowNode(type) && type !== "BoundaryEvent";
10
+ }
11
+ function isSubProcess(type) {
12
+ return type === "SubProcess" || type === "Transaction" || type === "EventSubProcess" || type === "AdHocSubProcess";
13
+ }
14
+ function isCatchTarget(type) {
15
+ return type === "IntermediateCatchEvent" || type === "ReceiveTask";
16
+ }
17
+ function poolAncestor(node, nodeById) {
18
+ let current = node;
19
+ const visited = /* @__PURE__ */ new Set();
20
+ while (current?.parentId && !visited.has(current.id)) {
21
+ visited.add(current.id);
22
+ const parent = nodeById.get(current.parentId);
23
+ if (parent?.data.elementType === "Pool") return parent.id;
24
+ current = parent;
25
+ }
26
+ return void 0;
27
+ }
28
+ function countSequenceEdges(edges, nodeId, direction) {
29
+ return edges.filter((edge) => {
30
+ if (edge.data?.edgeType !== "sequenceFlow") return false;
31
+ return direction === "in" ? edge.target === nodeId : edge.source === nodeId;
32
+ }).length;
33
+ }
34
+ function sequenceEdges(edges) {
35
+ return edges.filter((edge) => (edge.data?.edgeType ?? edge.type) === "sequenceFlow");
36
+ }
37
+ function sequenceOut(edges, nodeId) {
38
+ return sequenceEdges(edges).filter((edge) => edge.source === nodeId);
39
+ }
40
+ function sequenceIn(edges, nodeId) {
41
+ return sequenceEdges(edges).filter((edge) => edge.target === nodeId);
42
+ }
43
+ function issue(code, severity, message, elementId, relatedElementIds) {
44
+ return {
45
+ id: `${code}:${elementId ?? relatedElementIds?.join(",") ?? "diagram"}`,
46
+ code,
47
+ severity,
48
+ message,
49
+ ...elementId ? { elementId } : {},
50
+ ...relatedElementIds ? { relatedElementIds } : {}
51
+ };
52
+ }
53
+ function validateBpmnDiagram(nodes, edges, options = {}) {
54
+ const opts = {
55
+ requireStartEvent: true,
56
+ requireEndEvent: true,
57
+ strictNames: false,
58
+ ...options
59
+ };
60
+ const issues = [];
61
+ const nodeById = new Map(nodes.map((node) => [node.id, node]));
62
+ const seqEdges = sequenceEdges(edges);
63
+ const processNodes = nodes.filter((node) => isProcessNode(node.data.elementType));
64
+ if (opts.requireStartEvent && !processNodes.some((node) => node.data.elementType === "StartEvent")) {
65
+ issues.push(issue("bpmn/start-event-required", "error", "The diagram must contain at least one start event."));
66
+ }
67
+ if (opts.requireEndEvent && !processNodes.some((node) => node.data.elementType === "EndEvent")) {
68
+ issues.push(issue("bpmn/end-event-required", "error", "The diagram must contain at least one end event."));
69
+ }
70
+ for (const edge of edges) {
71
+ const edgeType = edge.data?.edgeType ?? edge.type;
72
+ const source = nodeById.get(edge.source);
73
+ const target = nodeById.get(edge.target);
74
+ if (!source || !target) {
75
+ issues.push(issue(
76
+ "bpmn/no-orphan-edges",
77
+ "error",
78
+ `Edge "${edge.id}" references a missing ${!source ? "source" : "target"} node.`,
79
+ edge.id,
80
+ [edge.source, edge.target]
81
+ ));
82
+ continue;
83
+ }
84
+ if (edge.source === edge.target) {
85
+ issues.push(issue("bpmn/no-self-loop", "error", "BPMN edges cannot connect an element to itself.", edge.id, [edge.source]));
86
+ }
87
+ if (edgeType === "sequenceFlow") {
88
+ if (!isFlowNode(source.data.elementType) || !isFlowNode(target.data.elementType) || isDataType(source.data.elementType) || isDataType(target.data.elementType)) {
89
+ issues.push(issue("bpmn/sequence-flow-valid-endpoints", "error", "Sequence flows must connect BPMN flow nodes.", edge.id, [source.id, target.id]));
90
+ }
91
+ const sourcePool = poolAncestor(source, nodeById);
92
+ const targetPool = poolAncestor(target, nodeById);
93
+ if (sourcePool && targetPool && sourcePool !== targetPool) {
94
+ issues.push(issue("bpmn/sequence-flow-no-cross-pool", "error", "Sequence flows cannot cross pools. Use message flow between participants.", edge.id, [source.id, target.id]));
95
+ }
96
+ }
97
+ if (edgeType === "messageFlow") {
98
+ const sourcePool = poolAncestor(source, nodeById);
99
+ const targetPool = poolAncestor(target, nodeById);
100
+ if (!sourcePool || !targetPool || sourcePool === targetPool) {
101
+ issues.push(issue("bpmn/message-flow-valid-endpoints", "error", "Message flows must connect flow nodes in different pools.", edge.id, [source.id, target.id]));
102
+ }
103
+ if (!isFlowNode(source.data.elementType) || !isFlowNode(target.data.elementType)) {
104
+ issues.push(issue("bpmn/message-flow-valid-endpoints", "error", "Message flows must connect BPMN flow nodes, not containers.", edge.id, [source.id, target.id]));
105
+ }
106
+ }
107
+ if (edgeType === "dataAssociation") {
108
+ const hasDataEndpoint = isDataType(source.data.elementType) || isDataType(target.data.elementType);
109
+ const hasFlowEndpoint = isFlowNode(source.data.elementType) || isFlowNode(target.data.elementType);
110
+ if (!hasDataEndpoint || !hasFlowEndpoint) {
111
+ issues.push(issue("bpmn/data-association-valid-endpoints", "error", "Data associations must connect data elements with flow nodes.", edge.id, [source.id, target.id]));
112
+ }
113
+ }
114
+ }
115
+ const duplicateSequenceKeys = /* @__PURE__ */ new Set();
116
+ const reportedDuplicateKeys = /* @__PURE__ */ new Set();
117
+ for (const edge of seqEdges) {
118
+ const key = `${edge.source}->${edge.target}`;
119
+ if (duplicateSequenceKeys.has(key) && !reportedDuplicateKeys.has(key)) {
120
+ reportedDuplicateKeys.add(key);
121
+ issues.push(issue("bpmn/no-duplicate-sequence-flow", "error", "Only one sequence flow is allowed between the same source and target.", edge.id, [edge.source, edge.target]));
122
+ }
123
+ duplicateSequenceKeys.add(key);
124
+ }
125
+ for (const node of nodes) {
126
+ const type = node.data.elementType;
127
+ const incoming = countSequenceEdges(edges, node.id, "in");
128
+ const outgoing = countSequenceEdges(edges, node.id, "out");
129
+ const meta = BPMN_ELEMENT_CATALOG[type];
130
+ if (type === "StartEvent" && incoming > 0) {
131
+ issues.push(issue("bpmn/start-event-no-incoming", "error", "Start events cannot have incoming sequence flows.", node.id));
132
+ }
133
+ if (type === "EndEvent") {
134
+ if (outgoing > 0) issues.push(issue("bpmn/no-outgoing-from-end-event", "error", "End events cannot have outgoing sequence flows.", node.id));
135
+ if (incoming === 0) issues.push(issue("bpmn/end-event-has-incoming", "error", "End events should have at least one incoming sequence flow.", node.id));
136
+ }
137
+ if ((type === "IntermediateCatchEvent" || type === "IntermediateThrowEvent") && (incoming === 0 || outgoing === 0)) {
138
+ issues.push(issue("bpmn/intermediate-event-both-flows", "error", "Intermediate events should have both incoming and outgoing sequence flows.", node.id));
139
+ }
140
+ if (type === "BoundaryEvent") {
141
+ const hostId = node.data.attachedToRef ?? node.parentId;
142
+ const host = hostId ? nodeById.get(hostId) : void 0;
143
+ if (!host || !BPMN_ELEMENT_CATALOG[host.data.elementType]?.acceptsBoundaryEvents) {
144
+ issues.push(issue("bpmn/boundary-event-attached", "error", "Boundary events must be attached to an activity or subprocess.", node.id, hostId ? [hostId] : void 0));
145
+ }
146
+ if (sequenceIn(edges, node.id).length > 0) {
147
+ issues.push(issue("bpmn/boundary-no-incoming", "error", "Boundary events cannot have incoming sequence flows.", node.id));
148
+ }
149
+ if (sequenceOut(edges, node.id).length === 0) {
150
+ issues.push(issue("bpmn/boundary-has-outgoing", "warning", "Boundary events should define an outgoing exception path.", node.id));
151
+ }
152
+ }
153
+ if (isGatewayType(type)) {
154
+ if (incoming === 0) issues.push(issue("bpmn/gateway-has-incoming", "error", "Gateways should have at least one incoming sequence flow.", node.id));
155
+ if (outgoing === 0) issues.push(issue("bpmn/gateway-has-outgoing", "error", "Gateways should have at least one outgoing sequence flow.", node.id));
156
+ }
157
+ if (type === "ExclusiveGateway" || type === "InclusiveGateway" || type === "ComplexGateway") {
158
+ const outgoingEdges = sequenceOut(edges, node.id);
159
+ const defaults = outgoingEdges.filter((edge) => edge.data?.isDefault);
160
+ if (defaults.length > 1) {
161
+ issues.push(issue("bpmn/gateway-single-default", "error", "Gateways can have at most one default sequence flow.", node.id, defaults.map((edge) => edge.id)));
162
+ }
163
+ if (outgoingEdges.length >= 2) {
164
+ for (const edge of outgoingEdges) {
165
+ if (!edge.data?.isDefault && !edge.data?.conditionExpression) {
166
+ issues.push(issue("bpmn/gateway-condition", "error", "Conditional gateway branches should have a condition or be marked as default.", edge.id, [node.id, edge.target]));
167
+ }
168
+ }
169
+ }
170
+ }
171
+ if (type === "EventBasedGateway") {
172
+ const outgoingEdges = edges.filter((edge) => edge.data?.edgeType === "sequenceFlow" && edge.source === node.id);
173
+ if (outgoingEdges.length < 2) {
174
+ issues.push(issue("bpmn/event-based-gateway-min-outgoing", "error", "Event-based gateways should have at least two outgoing sequence flows.", node.id));
175
+ }
176
+ for (const edge of outgoingEdges) {
177
+ const target = nodeById.get(edge.target);
178
+ if (target && !isCatchTarget(target.data.elementType)) {
179
+ issues.push(issue("bpmn/event-based-gateway-valid-targets", "error", "Event-based gateways must target catch events or receive tasks.", edge.id, [node.id, target.id]));
180
+ }
181
+ }
182
+ }
183
+ if (meta.maxIncoming !== void 0 && incoming > meta.maxIncoming) {
184
+ issues.push(issue("bpmn/max-incoming", "error", `${type} cannot have more than ${meta.maxIncoming} incoming sequence flow(s).`, node.id));
185
+ }
186
+ if (meta.maxOutgoing !== void 0 && outgoing > meta.maxOutgoing) {
187
+ issues.push(issue("bpmn/max-outgoing", "error", `${type} cannot have more than ${meta.maxOutgoing} outgoing sequence flow(s).`, node.id));
188
+ }
189
+ if (opts.strictNames && (type.includes("Task") || isGatewayType(type)) && !node.data.label) {
190
+ issues.push(issue("bpmn/name-required", "warning", `${type} should have a label.`, node.id));
191
+ }
192
+ if (isSubProcess(type)) {
193
+ const childNodes = nodes.filter((child) => child.parentId === node.id);
194
+ if (childNodes.length > 0) {
195
+ if (!childNodes.some((child) => child.data.elementType === "StartEvent")) {
196
+ issues.push(issue("bpmn/subprocess-has-start-end", "error", "Expanded subprocesses should contain a start event.", node.id));
197
+ }
198
+ if (!childNodes.some((child) => child.data.elementType === "EndEvent")) {
199
+ issues.push(issue("bpmn/subprocess-has-start-end", "error", "Expanded subprocesses should contain an end event.", node.id));
200
+ }
201
+ }
202
+ if (type === "EventSubProcess") {
203
+ const starts = childNodes.filter((child) => child.data.elementType === "StartEvent");
204
+ for (const start of starts) {
205
+ if (!start.data.trigger || start.data.trigger === "none") {
206
+ issues.push(issue("bpmn/event-subprocess-triggered-start", "error", "Event subprocess start events must define an event trigger.", start.id, [node.id]));
207
+ }
208
+ }
209
+ }
210
+ }
211
+ if (type === "Lane") {
212
+ const parent = node.parentId ? nodeById.get(node.parentId) : void 0;
213
+ if (parent?.data.elementType !== "Pool") {
214
+ issues.push(issue("bpmn/lane-parent-pool", "error", "Lanes must be contained by a pool.", node.id));
215
+ }
216
+ }
217
+ }
218
+ return {
219
+ valid: issues.every((item) => item.severity !== "error"),
220
+ issues
221
+ };
222
+ }
223
+
224
+ export { validateBpmnDiagram };
225
+ //# sourceMappingURL=chunk-ZFGQVLHB.js.map
226
+ //# sourceMappingURL=chunk-ZFGQVLHB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/validation/index.ts"],"names":[],"mappings":";;;;AA+BA,SAAS,WAAW,IAAA,EAAgC;AAClD,EAAA,OACE,WAAA,CAAY,IAAI,CAAA,IAChB,aAAA,CAAc,IAAI,KAClB,IAAA,CAAK,QAAA,CAAS,MAAM,CAAA,IACpB,IAAA,KAAS,cAAA,IACT,SAAS,YAAA,IACT,IAAA,KAAS,aAAA,IACT,IAAA,KAAS,iBAAA,IACT,IAAA,KAAS,qBACT,IAAA,KAAS,kBAAA,IACT,IAAA,KAAS,iBAAA,IACT,IAAA,KAAS,kBAAA;AAEb;AAEA,SAAS,cAAc,IAAA,EAAgC;AACrD,EAAA,OAAO,UAAA,CAAW,IAAI,CAAA,IAAK,IAAA,KAAS,eAAA;AACtC;AAEA,SAAS,aAAa,IAAA,EAA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AA,IAAI,SAAS,iBAAA,EAAmB;AAC9B,QAAA,MAAM,MAAA,GAAS,WAAW,MAAA,CAAO,CAAC,UAAU,KAAA,CAAM,IAAA,CAAK,gBAAgB,YAAY,CAAA;AACnF,QAAA,KAAA,MAAW,SAAS,MAAA,EAAQ;AAC1B,UAAA,IAAI,CAAC,KAAA,CAAM,IAAA,CAAK,WAAW,KAAA,CAAM,IAAA,CAAK,YAAY,MAAA,EAAQ;AACxD,YAAA,MAAA,CAAO,IAAA,CAAK,KAAA,CAAM,uCAAA,EAAyC,OAAA,EAAS,6DAAA,EAA+D,KAAA,CAAM,EAAA,EAAI,CAAC,IAAA,CAAK,EAAE,CAAC,CAAC,CAAA;AAAA,UACzJ;AAAA,QACF;AAAA,MACF;AAAA,IACF;AACA,IAAA,IAAI,SAAS,MAAA,EAAQ;AACnB,MAAA,MAAM,SAAS,IAAA,CAAK,QAAA,GAAW,SAAS,GAAA,CAAI,IAAA,CAAK,QAAQ,CAAA,GAAI,MAAA;AAC7D,MAAA,IAAI,MAAA,EAAQ,IAAA,CAAK,WAAA,KAAgB,MAAA,EAAQ;AACvC,QAAA,MAAA,CAAO,KAAK,KAAA,CAAM,uBAAA,EAAyB,SAAS,oCAAA,EAAsC,IAAA,CAAK,EAAE,CAAC,CAAA;AAAA,MACpG;AAAA,IACF;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,OAAO,MAAA,CAAO,KAAA,CAAM,CAAC,IAAA,KAAS,IAAA,CAAK,aAAa,OAAO,CAAA;AAAA,IACvD;AAAA,GACF;AACF","file":"chunk-ZFGQVLHB.js","sourcesContent":["import { BPMN_ELEMENT_CATALOG } from \"../elements/catalog\";\nimport {\n isDataType,\n isEventType,\n isGatewayType,\n} from \"../elements/guards\";\nimport type { BpmnElementType } from \"../elements/types\";\nimport type { BpmnRFEdge, BpmnRFNode } from \"../xml/types\";\n\nexport type BpmnValidationSeverity = \"error\" | \"warning\" | \"info\";\n\nexport interface BpmnValidationIssue {\n id: string;\n severity: BpmnValidationSeverity;\n code: string;\n message: string;\n elementId?: string;\n relatedElementIds?: string[];\n}\n\nexport interface BpmnValidationResult {\n valid: boolean;\n issues: BpmnValidationIssue[];\n}\n\nexport interface BpmnValidationOptions {\n requireStartEvent?: boolean;\n requireEndEvent?: boolean;\n strictNames?: boolean;\n}\n\nfunction isFlowNode(type: BpmnElementType): boolean {\n return (\n isEventType(type) ||\n isGatewayType(type) ||\n type.includes(\"Task\") ||\n type === \"CallActivity\" ||\n type === \"SubProcess\" ||\n type === \"Transaction\" ||\n type === \"EventSubProcess\" ||\n type === \"AdHocSubProcess\" ||\n type === \"ChoreographyTask\" ||\n type === \"SubChoreography\" ||\n type === \"CallChoreography\"\n );\n}\n\nfunction isProcessNode(type: BpmnElementType): boolean {\n return isFlowNode(type) && type !== \"BoundaryEvent\";\n}\n\nfunction isSubProcess(type: BpmnElementType): boolean {\n return (\n type === \"SubProcess\" ||\n type === \"Transaction\" ||\n type === \"EventSubProcess\" ||\n type === \"AdHocSubProcess\"\n );\n}\n\nfunction isCatchTarget(type: BpmnElementType): boolean {\n return type === \"IntermediateCatchEvent\" || type === \"ReceiveTask\";\n}\n\nfunction poolAncestor(\n node: BpmnRFNode | undefined,\n nodeById: Map<string, BpmnRFNode>,\n): string | undefined {\n let current = node;\n const visited = new Set<string>();\n while (current?.parentId && !visited.has(current.id)) {\n visited.add(current.id);\n const parent = nodeById.get(current.parentId);\n if (parent?.data.elementType === \"Pool\") return parent.id;\n current = parent;\n }\n return undefined;\n}\n\nfunction countSequenceEdges(edges: BpmnRFEdge[], nodeId: string, direction: \"in\" | \"out\"): number {\n return edges.filter((edge) => {\n if (edge.data?.edgeType !== \"sequenceFlow\") return false;\n return direction === \"in\" ? edge.target === nodeId : edge.source === nodeId;\n }).length;\n}\n\nfunction sequenceEdges(edges: BpmnRFEdge[]): BpmnRFEdge[] {\n return edges.filter((edge) => (edge.data?.edgeType ?? edge.type) === \"sequenceFlow\");\n}\n\nfunction sequenceOut(edges: BpmnRFEdge[], nodeId: string): BpmnRFEdge[] {\n return sequenceEdges(edges).filter((edge) => edge.source === nodeId);\n}\n\nfunction sequenceIn(edges: BpmnRFEdge[], nodeId: string): BpmnRFEdge[] {\n return sequenceEdges(edges).filter((edge) => edge.target === nodeId);\n}\n\nfunction issue(\n code: string,\n severity: BpmnValidationSeverity,\n message: string,\n elementId?: string,\n relatedElementIds?: string[],\n): BpmnValidationIssue {\n return {\n id: `${code}:${elementId ?? relatedElementIds?.join(\",\") ?? \"diagram\"}`,\n code,\n severity,\n message,\n ...(elementId ? { elementId } : {}),\n ...(relatedElementIds ? { relatedElementIds } : {}),\n };\n}\n\nexport function validateBpmnDiagram(\n nodes: BpmnRFNode[],\n edges: BpmnRFEdge[],\n options: BpmnValidationOptions = {},\n): BpmnValidationResult {\n const opts = {\n requireStartEvent: true,\n requireEndEvent: true,\n strictNames: false,\n ...options,\n };\n const issues: BpmnValidationIssue[] = [];\n const nodeById = new Map(nodes.map((node) => [node.id, node]));\n const seqEdges = sequenceEdges(edges);\n\n const processNodes = nodes.filter((node) => isProcessNode(node.data.elementType));\n if (opts.requireStartEvent && !processNodes.some((node) => node.data.elementType === \"StartEvent\")) {\n issues.push(issue(\"bpmn/start-event-required\", \"error\", \"The diagram must contain at least one start event.\"));\n }\n if (opts.requireEndEvent && !processNodes.some((node) => node.data.elementType === \"EndEvent\")) {\n issues.push(issue(\"bpmn/end-event-required\", \"error\", \"The diagram must contain at least one end event.\"));\n }\n\n for (const edge of edges) {\n const edgeType = edge.data?.edgeType ?? edge.type;\n const source = nodeById.get(edge.source);\n const target = nodeById.get(edge.target);\n\n if (!source || !target) {\n issues.push(issue(\n \"bpmn/no-orphan-edges\",\n \"error\",\n `Edge \"${edge.id}\" references a missing ${!source ? \"source\" : \"target\"} node.`,\n edge.id,\n [edge.source, edge.target],\n ));\n continue;\n }\n\n if (edge.source === edge.target) {\n issues.push(issue(\"bpmn/no-self-loop\", \"error\", \"BPMN edges cannot connect an element to itself.\", edge.id, [edge.source]));\n }\n\n if (edgeType === \"sequenceFlow\") {\n if (!isFlowNode(source.data.elementType) || !isFlowNode(target.data.elementType) || isDataType(source.data.elementType) || isDataType(target.data.elementType)) {\n issues.push(issue(\"bpmn/sequence-flow-valid-endpoints\", \"error\", \"Sequence flows must connect BPMN flow nodes.\", edge.id, [source.id, target.id]));\n }\n const sourcePool = poolAncestor(source, nodeById);\n const targetPool = poolAncestor(target, nodeById);\n if (sourcePool && targetPool && sourcePool !== targetPool) {\n issues.push(issue(\"bpmn/sequence-flow-no-cross-pool\", \"error\", \"Sequence flows cannot cross pools. Use message flow between participants.\", edge.id, [source.id, target.id]));\n }\n }\n\n if (edgeType === \"messageFlow\") {\n const sourcePool = poolAncestor(source, nodeById);\n const targetPool = poolAncestor(target, nodeById);\n if (!sourcePool || !targetPool || sourcePool === targetPool) {\n issues.push(issue(\"bpmn/message-flow-valid-endpoints\", \"error\", \"Message flows must connect flow nodes in different pools.\", edge.id, [source.id, target.id]));\n }\n if (!isFlowNode(source.data.elementType) || !isFlowNode(target.data.elementType)) {\n issues.push(issue(\"bpmn/message-flow-valid-endpoints\", \"error\", \"Message flows must connect BPMN flow nodes, not containers.\", edge.id, [source.id, target.id]));\n }\n }\n\n if (edgeType === \"dataAssociation\") {\n const hasDataEndpoint = isDataType(source.data.elementType) || isDataType(target.data.elementType);\n const hasFlowEndpoint = isFlowNode(source.data.elementType) || isFlowNode(target.data.elementType);\n if (!hasDataEndpoint || !hasFlowEndpoint) {\n issues.push(issue(\"bpmn/data-association-valid-endpoints\", \"error\", \"Data associations must connect data elements with flow nodes.\", edge.id, [source.id, target.id]));\n }\n }\n }\n\n const duplicateSequenceKeys = new Set<string>();\n const reportedDuplicateKeys = new Set<string>();\n for (const edge of seqEdges) {\n const key = `${edge.source}->${edge.target}`;\n if (duplicateSequenceKeys.has(key) && !reportedDuplicateKeys.has(key)) {\n reportedDuplicateKeys.add(key);\n issues.push(issue(\"bpmn/no-duplicate-sequence-flow\", \"error\", \"Only one sequence flow is allowed between the same source and target.\", edge.id, [edge.source, edge.target]));\n }\n duplicateSequenceKeys.add(key);\n }\n\n for (const node of nodes) {\n const type = node.data.elementType;\n const incoming = countSequenceEdges(edges, node.id, \"in\");\n const outgoing = countSequenceEdges(edges, node.id, \"out\");\n const meta = BPMN_ELEMENT_CATALOG[type];\n\n if (type === \"StartEvent\" && incoming > 0) {\n issues.push(issue(\"bpmn/start-event-no-incoming\", \"error\", \"Start events cannot have incoming sequence flows.\", node.id));\n }\n if (type === \"EndEvent\") {\n if (outgoing > 0) issues.push(issue(\"bpmn/no-outgoing-from-end-event\", \"error\", \"End events cannot have outgoing sequence flows.\", node.id));\n if (incoming === 0) issues.push(issue(\"bpmn/end-event-has-incoming\", \"error\", \"End events should have at least one incoming sequence flow.\", node.id));\n }\n if ((type === \"IntermediateCatchEvent\" || type === \"IntermediateThrowEvent\") && (incoming === 0 || outgoing === 0)) {\n issues.push(issue(\"bpmn/intermediate-event-both-flows\", \"error\", \"Intermediate events should have both incoming and outgoing sequence flows.\", node.id));\n }\n if (type === \"BoundaryEvent\") {\n const hostId = node.data.attachedToRef ?? node.parentId;\n const host = hostId ? nodeById.get(hostId) : undefined;\n if (!host || !BPMN_ELEMENT_CATALOG[host.data.elementType]?.acceptsBoundaryEvents) {\n issues.push(issue(\"bpmn/boundary-event-attached\", \"error\", \"Boundary events must be attached to an activity or subprocess.\", node.id, hostId ? [hostId] : undefined));\n }\n if (sequenceIn(edges, node.id).length > 0) {\n issues.push(issue(\"bpmn/boundary-no-incoming\", \"error\", \"Boundary events cannot have incoming sequence flows.\", node.id));\n }\n if (sequenceOut(edges, node.id).length === 0) {\n issues.push(issue(\"bpmn/boundary-has-outgoing\", \"warning\", \"Boundary events should define an outgoing exception path.\", node.id));\n }\n }\n if (isGatewayType(type)) {\n if (incoming === 0) issues.push(issue(\"bpmn/gateway-has-incoming\", \"error\", \"Gateways should have at least one incoming sequence flow.\", node.id));\n if (outgoing === 0) issues.push(issue(\"bpmn/gateway-has-outgoing\", \"error\", \"Gateways should have at least one outgoing sequence flow.\", node.id));\n }\n if (type === \"ExclusiveGateway\" || type === \"InclusiveGateway\" || type === \"ComplexGateway\") {\n const outgoingEdges = sequenceOut(edges, node.id);\n const defaults = outgoingEdges.filter((edge) => edge.data?.isDefault);\n if (defaults.length > 1) {\n issues.push(issue(\"bpmn/gateway-single-default\", \"error\", \"Gateways can have at most one default sequence flow.\", node.id, defaults.map((edge) => edge.id)));\n }\n if (outgoingEdges.length >= 2) {\n for (const edge of outgoingEdges) {\n if (!edge.data?.isDefault && !edge.data?.conditionExpression) {\n issues.push(issue(\"bpmn/gateway-condition\", \"error\", \"Conditional gateway branches should have a condition or be marked as default.\", edge.id, [node.id, edge.target]));\n }\n }\n }\n }\n if (type === \"EventBasedGateway\") {\n const outgoingEdges = edges.filter((edge) => edge.data?.edgeType === \"sequenceFlow\" && edge.source === node.id);\n if (outgoingEdges.length < 2) {\n issues.push(issue(\"bpmn/event-based-gateway-min-outgoing\", \"error\", \"Event-based gateways should have at least two outgoing sequence flows.\", node.id));\n }\n for (const edge of outgoingEdges) {\n const target = nodeById.get(edge.target);\n if (target && !isCatchTarget(target.data.elementType)) {\n issues.push(issue(\"bpmn/event-based-gateway-valid-targets\", \"error\", \"Event-based gateways must target catch events or receive tasks.\", edge.id, [node.id, target.id]));\n }\n }\n }\n if (meta.maxIncoming !== undefined && incoming > meta.maxIncoming) {\n issues.push(issue(\"bpmn/max-incoming\", \"error\", `${type} cannot have more than ${meta.maxIncoming} incoming sequence flow(s).`, node.id));\n }\n if (meta.maxOutgoing !== undefined && outgoing > meta.maxOutgoing) {\n issues.push(issue(\"bpmn/max-outgoing\", \"error\", `${type} cannot have more than ${meta.maxOutgoing} outgoing sequence flow(s).`, node.id));\n }\n if (opts.strictNames && (type.includes(\"Task\") || isGatewayType(type)) && !node.data.label) {\n issues.push(issue(\"bpmn/name-required\", \"warning\", `${type} should have a label.`, node.id));\n }\n if (isSubProcess(type)) {\n const childNodes = nodes.filter((child) => child.parentId === node.id);\n if (childNodes.length > 0) {\n if (!childNodes.some((child) => child.data.elementType === \"StartEvent\")) {\n issues.push(issue(\"bpmn/subprocess-has-start-end\", \"error\", \"Expanded subprocesses should contain a start event.\", node.id));\n }\n if (!childNodes.some((child) => child.data.elementType === \"EndEvent\")) {\n issues.push(issue(\"bpmn/subprocess-has-start-end\", \"error\", \"Expanded subprocesses should contain an end event.\", node.id));\n }\n }\n if (type === \"EventSubProcess\") {\n const starts = childNodes.filter((child) => child.data.elementType === \"StartEvent\");\n for (const start of starts) {\n if (!start.data.trigger || start.data.trigger === \"none\") {\n issues.push(issue(\"bpmn/event-subprocess-triggered-start\", \"error\", \"Event subprocess start events must define an event trigger.\", start.id, [node.id]));\n }\n }\n }\n }\n if (type === \"Lane\") {\n const parent = node.parentId ? nodeById.get(node.parentId) : undefined;\n if (parent?.data.elementType !== \"Pool\") {\n issues.push(issue(\"bpmn/lane-parent-pool\", \"error\", \"Lanes must be contained by a pool.\", node.id));\n }\n }\n }\n\n return {\n valid: issues.every((item) => item.severity !== \"error\"),\n issues,\n };\n}\n"]}
@@ -247,7 +247,7 @@ function DataAssociationEdge({
247
247
 
248
248
  // src/nodes/shared/theme.ts
249
249
  var BPMN_THEME = {
250
- stroke: "#404040",
250
+ stroke: "#334155",
251
251
  fontFamily: "Inter, system-ui, sans-serif",
252
252
  fontSize: 11};
253
253
  function ConversationLinkEdge({
@@ -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":["pointsToSvgPath","getOrthogonalPath","jsxs","Fragment","jsx","BaseEdge","EdgeLabelRenderer","getStraightPath"],"mappings":";;;;;;;;;AAOO,SAAS,aAAA,CACd,OAAA,EACA,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AAA,CAAW,UAAA,EAAY,IAAA,EAAM,MAAA,EAC5E,0BAAAA,cAAAA,CAAC,UAAA,EAAA,EAAS,IAAA,EAAM,CAAA,CAAA,EAAI,IAAI,CAAA,CAAA,EAAI,WAAA,EAAY,KAAA,EAAM,UAAA,EAAW,QAAA,EACtD,QAAA,EAAA,CAAA,CAAE,KAAA,EACL,CAAA,EACF;AAAA,GAAA,EAEJ,CAAA;AAEJ;;;ACjCO,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 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 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 { BaseEdge, EdgeLabelRenderer, type EdgeProps } from \"@xyflow/react\";\nimport { getOrthogonalPath, pointsToSvgPath } from \"@aranzatech/diagrams-core/routing\";\nimport type { BpmnEdgeData } from \"../elements/types\";\nimport { getDefaultFlowMarkerPath, getEdgePoints, getPolylineMidpoint } 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 = getEdgePoints(sourceX, sourceY, targetX, targetY, points);\n\n const path = points && points.length >= 2\n ? pointsToSvgPath(points)\n : getOrthogonalPath(sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition);\n\n const midpoint = getPolylineMidpoint(polyline);\n const defaultMarkerPath = d?.isDefault ? getDefaultFlowMarkerPath(polyline) : null;\n\n return (\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: selected ? \"#1a56db\" : \"#404040\",\n strokeWidth: selected ? 2 : 1.5,\n ...(style ?? {}),\n }}\n />\n {defaultMarkerPath && (\n <path\n d={defaultMarkerPath}\n fill=\"none\"\n stroke={selected ? \"#1a56db\" : \"#404040\"}\n strokeWidth={selected ? 2 : 1.5}\n strokeLinecap=\"round\"\n data-testid=\"bpmn-default-flow-marker\"\n />\n )}\n {(label ?? d?.label) && (\n <EdgeLabelRenderer>\n <div\n style={{\n position: \"absolute\",\n transform: `translate(-50%,-50%) translate(${midpoint.x}px,${midpoint.y}px)`,\n fontSize: 11,\n fontFamily: \"Inter, system-ui, sans-serif\",\n background: \"rgba(255,255,255,0.85)\",\n padding: \"1px 4px\",\n borderRadius: 2,\n pointerEvents: \"all\",\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 { getEdgePoints, getPolylineMidpoint } 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 = getEdgePoints(sourceX, sourceY, targetX, targetY, points);\n\n const path = points && points.length >= 2\n ? pointsToSvgPath(points)\n : getOrthogonalPath(sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition);\n\n const midpoint = getPolylineMidpoint(polyline);\n\n return (\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: selected ? \"#1a56db\" : \"#404040\",\n strokeWidth: selected ? 2 : 1.5,\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(${midpoint.x}px,${midpoint.y}px)`,\n fontSize: 11,\n fontFamily: \"Inter, system-ui, sans-serif\",\n background: \"rgba(255,255,255,0.85)\",\n padding: \"1px 4px\",\n borderRadius: 2,\n pointerEvents: \"all\",\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(points)\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(points)\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 stroke: \"#404040\",\n strokeSelected: \"#1a56db\",\n strokeWidth: 1.5,\n strokeWidthSelected: 2.5,\n fontFamily: \"Inter, system-ui, sans-serif\",\n fontSize: 11,\n labelColor: \"#1a1a1a\",\n handleColor: \"#8c8c8c\",\n handleColorSelected: \"#1a56db\",\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","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","jsxs","Fragment","jsx","BaseEdge","EdgeLabelRenderer","getStraightPath"],"mappings":";;;;;;;;;AAOO,SAAS,aAAA,CACd,OAAA,EACA,OAAA,EACA,OAAA,EACA,SACA,aAAA,EACa;AACb,EAAA,IAAI,aAAA,IAAiB,aAAA,CAAc,MAAA,IAAU,CAAA,EAAG;AAC9C,IAAA,OAAO,aAAA;AAAA,EACT;AAEA,EAAA,OAAO;AAAA,IACL,EAAE,CAAA,EAAG,OAAA,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AAA,EAAA,CAAA,CAAE,KAAA,EACL,CAAA,EACF;AAAA,GAAA,EAEJ,CAAA;AAEJ;;;ACjCO,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 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 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 { BaseEdge, EdgeLabelRenderer, type EdgeProps } from \"@xyflow/react\";\nimport { getOrthogonalPath, pointsToSvgPath } from \"@aranzatech/diagrams-core/routing\";\nimport type { BpmnEdgeData } from \"../elements/types\";\nimport { getDefaultFlowMarkerPath, getEdgePoints, getPolylineMidpoint } 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 = getEdgePoints(sourceX, sourceY, targetX, targetY, points);\n\n const path = points && points.length >= 2\n ? pointsToSvgPath(points)\n : getOrthogonalPath(sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition);\n\n const midpoint = getPolylineMidpoint(polyline);\n const defaultMarkerPath = d?.isDefault ? getDefaultFlowMarkerPath(polyline) : null;\n\n return (\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: selected ? \"#1a56db\" : \"#404040\",\n strokeWidth: selected ? 2 : 1.5,\n ...(style ?? {}),\n }}\n />\n {defaultMarkerPath && (\n <path\n d={defaultMarkerPath}\n fill=\"none\"\n stroke={selected ? \"#1a56db\" : \"#404040\"}\n strokeWidth={selected ? 2 : 1.5}\n strokeLinecap=\"round\"\n data-testid=\"bpmn-default-flow-marker\"\n />\n )}\n {(label ?? d?.label) && (\n <EdgeLabelRenderer>\n <div\n style={{\n position: \"absolute\",\n transform: `translate(-50%,-50%) translate(${midpoint.x}px,${midpoint.y}px)`,\n fontSize: 11,\n fontFamily: \"Inter, system-ui, sans-serif\",\n background: \"rgba(255,255,255,0.85)\",\n padding: \"1px 4px\",\n borderRadius: 2,\n pointerEvents: \"all\",\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 { getEdgePoints, getPolylineMidpoint } 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 = getEdgePoints(sourceX, sourceY, targetX, targetY, points);\n\n const path = points && points.length >= 2\n ? pointsToSvgPath(points)\n : getOrthogonalPath(sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition);\n\n const midpoint = getPolylineMidpoint(polyline);\n\n return (\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: selected ? \"#1a56db\" : \"#404040\",\n strokeWidth: selected ? 2 : 1.5,\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(${midpoint.x}px,${midpoint.y}px)`,\n fontSize: 11,\n fontFamily: \"Inter, system-ui, sans-serif\",\n background: \"rgba(255,255,255,0.85)\",\n padding: \"1px 4px\",\n borderRadius: 2,\n pointerEvents: \"all\",\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(points)\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(points)\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: \"0 4px 12px rgba(15, 23, 42, 0.08)\",\n shadowSelected: \"0 0 0 4px rgba(37, 99, 235, 0.14), 0 8px 18px rgba(15, 23, 42, 0.12)\",\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 selected\n ? \"drop-shadow(0 0 0 rgba(37,99,235,0.2)) drop-shadow(0 8px 14px rgba(15,23,42,0.12))\"\n : \"drop-shadow(0 4px 10px rgba(15,23,42,0.08))\";\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,4 +1,4 @@
1
- export { AssociationEdge, BPMN_EDGE_TYPES, ConversationLinkEdge, DataAssociationEdge, MessageFlowEdge, SequenceFlowEdge } from '../chunk-3AFZDIMQ.js';
2
- import '../chunk-23B2IGK5.js';
1
+ export { AssociationEdge, BPMN_EDGE_TYPES, ConversationLinkEdge, DataAssociationEdge, MessageFlowEdge, SequenceFlowEdge } from '../chunk-ECTJRD7Z.js';
2
+ import '../chunk-KALSGH4D.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map