@aranzatech/diagrams-bpmn 0.2.13 → 0.2.15
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.
- package/dist/{catalog-Di2nzGs9.d.ts → catalog-CK3_4cOb.d.ts} +1 -1
- package/dist/{catalog-BiLXVn-2.d.cts → catalog-xOMF2ifW.d.cts} +1 -1
- package/dist/{chunk-UAWLUDKC.js → chunk-HOWK3ZOO.js} +105 -13
- package/dist/chunk-HOWK3ZOO.js.map +1 -0
- package/dist/{chunk-O3NWJ5H7.js → chunk-QSMP34CT.js} +38 -5
- package/dist/chunk-QSMP34CT.js.map +1 -0
- package/dist/{chunk-IMW6RG6F.js → chunk-X54NHLBA.js} +43 -190
- package/dist/chunk-X54NHLBA.js.map +1 -0
- package/dist/chunk-XMVV7FRZ.js +163 -0
- package/dist/chunk-XMVV7FRZ.js.map +1 -0
- package/dist/edges/index.cjs +35 -2
- package/dist/edges/index.cjs.map +1 -1
- package/dist/edges/index.js +1 -1
- package/dist/elements/index.d.cts +4 -4
- package/dist/elements/index.d.ts +4 -4
- package/dist/elk-FSFIEL6O.js +6 -0
- package/dist/elk-FSFIEL6O.js.map +1 -0
- package/dist/{guards-DPHXfpY8.d.cts → guards-C70uIY_O.d.cts} +1 -1
- package/dist/{guards-qgSeZEU4.d.ts → guards-foB6XIfZ.d.ts} +1 -1
- package/dist/index.cjs +180 -200
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +3 -3
- package/dist/layout/index.cjs +1428 -755
- package/dist/layout/index.cjs.map +1 -1
- package/dist/layout/index.d.cts +23 -12
- package/dist/layout/index.d.ts +23 -12
- package/dist/layout/index.js +547 -72
- package/dist/layout/index.js.map +1 -1
- package/dist/modeling/index.cjs +103 -10
- package/dist/modeling/index.cjs.map +1 -1
- package/dist/modeling/index.d.cts +23 -6
- package/dist/modeling/index.d.ts +23 -6
- package/dist/modeling/index.js +1 -1
- package/dist/nodes/index.cjs +42 -188
- package/dist/nodes/index.cjs.map +1 -1
- package/dist/nodes/index.d.cts +1 -1
- package/dist/nodes/index.d.ts +1 -1
- package/dist/nodes/index.js +1 -1
- package/dist/{types-rEfHsPr5.d.ts → types-DG5yPKld.d.ts} +1 -1
- package/dist/{types-s2_VvPGf.d.cts → types-jIDz306Y.d.cts} +1 -1
- package/dist/{types-Dfrt0wVs.d.cts → types-y-ZbX-ff.d.cts} +3 -0
- package/dist/{types-Dfrt0wVs.d.ts → types-y-ZbX-ff.d.ts} +3 -0
- package/dist/validation/index.d.cts +2 -2
- package/dist/validation/index.d.ts +2 -2
- package/dist/xml/index.d.cts +3 -3
- package/dist/xml/index.d.ts +3 -3
- package/package.json +2 -2
- package/dist/chunk-IMW6RG6F.js.map +0 -1
- package/dist/chunk-O3NWJ5H7.js.map +0 -1
- package/dist/chunk-UAWLUDKC.js.map +0 -1
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { getBpmnNodeSize } from './chunk-HOWK3ZOO.js';
|
|
2
|
+
import { elkLayout } from '@aranzatech/diagrams-core/layout';
|
|
3
|
+
|
|
4
|
+
var BPMN_CONTAINER_TYPES = /* @__PURE__ */ new Set([
|
|
5
|
+
"Pool",
|
|
6
|
+
"Lane",
|
|
7
|
+
"SubProcess",
|
|
8
|
+
"Transaction",
|
|
9
|
+
"EventSubProcess",
|
|
10
|
+
"AdHocSubProcess"
|
|
11
|
+
]);
|
|
12
|
+
var CONTAINER_MIN_SIZE = {
|
|
13
|
+
Pool: { w: 720, h: 200 },
|
|
14
|
+
Lane: { w: 600, h: 160 },
|
|
15
|
+
SubProcess: { w: 240, h: 140 },
|
|
16
|
+
Transaction: { w: 240, h: 140 },
|
|
17
|
+
EventSubProcess: { w: 240, h: 140 },
|
|
18
|
+
AdHocSubProcess: { w: 240, h: 140 }
|
|
19
|
+
};
|
|
20
|
+
var CONTAINER_PADDING = {
|
|
21
|
+
Pool: "[top=30,left=60,bottom=30,right=50]",
|
|
22
|
+
Lane: "[top=40,left=70,bottom=40,right=50]",
|
|
23
|
+
SubProcess: "[top=30,left=40,bottom=30,right=40]",
|
|
24
|
+
Transaction: "[top=30,left=40,bottom=30,right=40]",
|
|
25
|
+
EventSubProcess: "[top=30,left=40,bottom=30,right=40]",
|
|
26
|
+
AdHocSubProcess: "[top=30,left=40,bottom=30,right=40]"
|
|
27
|
+
};
|
|
28
|
+
async function bpmnElkLayout(nodes, edges) {
|
|
29
|
+
const poolsWithLanes = /* @__PURE__ */ new Set();
|
|
30
|
+
for (const node of nodes) {
|
|
31
|
+
if (node.data.elementType === "Lane" && node.parentId) {
|
|
32
|
+
poolsWithLanes.add(node.parentId);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const result = await elkLayout(
|
|
36
|
+
nodes,
|
|
37
|
+
edges,
|
|
38
|
+
{
|
|
39
|
+
direction: "LR",
|
|
40
|
+
getNodeSize: (node) => {
|
|
41
|
+
const bNode = node;
|
|
42
|
+
if (BPMN_CONTAINER_TYPES.has(bNode.data.elementType)) return void 0;
|
|
43
|
+
return getBpmnNodeSize(bNode);
|
|
44
|
+
},
|
|
45
|
+
isContainerNode: (node) => BPMN_CONTAINER_TYPES.has(node.data.elementType),
|
|
46
|
+
getNodeLayoutOptions: (node) => {
|
|
47
|
+
const bNode = node;
|
|
48
|
+
const type = bNode.data.elementType;
|
|
49
|
+
if (!BPMN_CONTAINER_TYPES.has(type)) return void 0;
|
|
50
|
+
const min = CONTAINER_MIN_SIZE[type];
|
|
51
|
+
const isPoolWithLanes = type === "Pool" && poolsWithLanes.has(node.id);
|
|
52
|
+
const dir = isPoolWithLanes ? "DOWN" : "RIGHT";
|
|
53
|
+
return {
|
|
54
|
+
"elk.direction": dir,
|
|
55
|
+
"elk.nodeSize.constraints": "MINIMUM_SIZE",
|
|
56
|
+
// Each container handles its own layout pass so cross-lane edges
|
|
57
|
+
// participate in the internal layout without the global direction
|
|
58
|
+
// forcing Lane containers to align sideways.
|
|
59
|
+
"elk.hierarchyHandling": "INCLUDE_CHILDREN",
|
|
60
|
+
// Lanes within a Pool share a border — zero gap between them.
|
|
61
|
+
// Other containers keep the tighter inner spacing.
|
|
62
|
+
...isPoolWithLanes ? { "elk.spacing.nodeNode": "0", "elk.spacing.componentComponent": "0" } : {
|
|
63
|
+
"elk.layered.spacing.nodeNodeBetweenLayers": "100",
|
|
64
|
+
"elk.layered.spacing.edgeNodeBetweenLayers": "45",
|
|
65
|
+
"elk.spacing.nodeNode": "50"
|
|
66
|
+
},
|
|
67
|
+
...min ? { "elk.nodeSize.minimum": `[w=${min.w},h=${min.h}]` } : {},
|
|
68
|
+
...CONTAINER_PADDING[type] ? { "elk.padding": CONTAINER_PADDING[type] } : {}
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
elk: {
|
|
72
|
+
"elk.algorithm": "layered",
|
|
73
|
+
"elk.direction": "RIGHT",
|
|
74
|
+
// INHERIT: each container handles its own INCLUDE_CHILDREN pass so
|
|
75
|
+
// the global RIGHT direction does not force Lane containers sideways.
|
|
76
|
+
"elk.hierarchyHandling": "INHERIT",
|
|
77
|
+
"elk.edgeRouting": "ORTHOGONAL",
|
|
78
|
+
// Global spacing — generous values for visual breathing room.
|
|
79
|
+
"elk.layered.spacing.nodeNodeBetweenLayers": "120",
|
|
80
|
+
"elk.layered.spacing.edgeNodeBetweenLayers": "50",
|
|
81
|
+
"elk.spacing.nodeNode": "70",
|
|
82
|
+
"elk.spacing.componentComponent": "100"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
const nodeMap = new Map(result.nodes.map((n) => [n.id, n]));
|
|
87
|
+
const edgeMap = new Map(result.edges.map((e) => [e.id, e]));
|
|
88
|
+
const COMPONENT_GAP = 100;
|
|
89
|
+
const rootNodeOrder = nodes.filter((n) => !n.parentId).map((n) => n.id);
|
|
90
|
+
const rootHeights = /* @__PURE__ */ new Map();
|
|
91
|
+
for (const id of rootNodeOrder) {
|
|
92
|
+
const laid = nodeMap.get(id);
|
|
93
|
+
const orig = nodes.find((n) => n.id === id);
|
|
94
|
+
rootHeights.set(id, laid?.height ?? orig?.height ?? 200);
|
|
95
|
+
}
|
|
96
|
+
let stackY = 0;
|
|
97
|
+
const rootY = /* @__PURE__ */ new Map();
|
|
98
|
+
for (const id of rootNodeOrder) {
|
|
99
|
+
rootY.set(id, stackY);
|
|
100
|
+
stackY += (rootHeights.get(id) ?? 200) + COMPONENT_GAP;
|
|
101
|
+
}
|
|
102
|
+
const updatedNodes = nodes.map((node) => {
|
|
103
|
+
const laid = nodeMap.get(node.id);
|
|
104
|
+
if (!laid) return node;
|
|
105
|
+
const pos = node.parentId ? laid.position : { x: laid.position.x, y: rootY.get(node.id) ?? laid.position.y };
|
|
106
|
+
return { ...node, position: pos, width: laid.width, height: laid.height };
|
|
107
|
+
});
|
|
108
|
+
const lanesByPool = /* @__PURE__ */ new Map();
|
|
109
|
+
for (const node of updatedNodes) {
|
|
110
|
+
if (node.data.elementType === "Lane" && node.parentId) {
|
|
111
|
+
const arr = lanesByPool.get(node.parentId) ?? [];
|
|
112
|
+
arr.push(node.id);
|
|
113
|
+
lanesByPool.set(node.parentId, arr);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
const nodeIndex = new Map(updatedNodes.map((n, i) => [n.id, i]));
|
|
117
|
+
for (const laneIds of lanesByPool.values()) {
|
|
118
|
+
const widths = laneIds.map((id) => updatedNodes[nodeIndex.get(id)]?.width ?? 0);
|
|
119
|
+
const maxWidth = Math.max(...widths);
|
|
120
|
+
if (maxWidth <= 0) continue;
|
|
121
|
+
for (const id of laneIds) {
|
|
122
|
+
const idx = nodeIndex.get(id);
|
|
123
|
+
if (idx !== void 0) {
|
|
124
|
+
updatedNodes[idx] = { ...updatedNodes[idx], width: maxWidth };
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
const nodeRootContainer = /* @__PURE__ */ new Map();
|
|
129
|
+
for (const node of updatedNodes) {
|
|
130
|
+
nodeRootContainer.set(node.id, node.parentId ?? null);
|
|
131
|
+
}
|
|
132
|
+
const getRootContainer = (nodeId) => {
|
|
133
|
+
let current = nodeId;
|
|
134
|
+
const visited = /* @__PURE__ */ new Set();
|
|
135
|
+
while (current) {
|
|
136
|
+
if (visited.has(current)) break;
|
|
137
|
+
visited.add(current);
|
|
138
|
+
const parent = nodeRootContainer.get(current);
|
|
139
|
+
if (!parent) return current;
|
|
140
|
+
current = parent;
|
|
141
|
+
}
|
|
142
|
+
return null;
|
|
143
|
+
};
|
|
144
|
+
const updatedEdges = edges.map((edge) => {
|
|
145
|
+
const laid = edgeMap.get(edge.id);
|
|
146
|
+
if (!laid) return edge;
|
|
147
|
+
const nextData = { ...edge.data };
|
|
148
|
+
const sourceRoot = getRootContainer(edge.source);
|
|
149
|
+
const targetRoot = getRootContainer(edge.target);
|
|
150
|
+
const isCrossPool = sourceRoot !== targetRoot;
|
|
151
|
+
if (!isCrossPool && laid.points && laid.points.length > 0) {
|
|
152
|
+
nextData.routingPoints = laid.points;
|
|
153
|
+
} else {
|
|
154
|
+
delete nextData.routingPoints;
|
|
155
|
+
}
|
|
156
|
+
return { ...edge, data: nextData };
|
|
157
|
+
});
|
|
158
|
+
return { nodes: updatedNodes, edges: updatedEdges };
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export { bpmnElkLayout };
|
|
162
|
+
//# sourceMappingURL=chunk-XMVV7FRZ.js.map
|
|
163
|
+
//# sourceMappingURL=chunk-XMVV7FRZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/layout/elk.ts"],"names":[],"mappings":";;;AAOA,IAAM,oBAAA,uBAA2B,GAAA,CAAqB;AAAA,EACpD,MAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,iBAAA;AAAA,EACA;AACF,CAAC,CAAA;AAED,IAAM,kBAAA,GAAiF;AAAA,EACrF,IAAA,E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,OAAO,OAAA;AACpB,MAAA,OAAA,GAAU,MAAA;AAAA,IACZ;AACA,IAAA,OAAO,IAAA;AAAA,EACT,CAAA;AAEA,EAAA,MAAM,YAAA,GAAe,KAAA,CAAM,GAAA,CAAI,CAAC,IAAA,KAAS;AACvC,IAAA,MAAM,IAAA,GAAO,OAAA,CAAQ,GAAA,CAAI,IAAA,CAAK,EAAE,CAAA;AAChC,IAAA,IAAI,CAAC,MAAM,OAAO,IAAA;AAClB,IAAA,MAAM,QAAA,GAAW,EAAE,GAAG,IAAA,CAAK,IAAA,EAAK;AAChC,IAAA,MAAM,UAAA,GAAa,gBAAA,CAAiB,IAAA,CAAK,MAAM,CAAA;AAC/C,IAAA,MAAM,UAAA,GAAa,gBAAA,CAAiB,IAAA,CAAK,MAAM,CAAA;AAC/C,IAAA,MAAM,cAAc,UAAA,KAAe,UAAA;AACnC,IAAA,IAAI,CAAC,WAAA,IAAe,IAAA,CAAK,UAAU,IAAA,CAAK,MAAA,CAAO,SAAS,CAAA,EAAG;AACzD,MAAA,QAAA,CAAS,gBAAgB,IAAA,CAAK,MAAA;AAAA,IAChC,CAAA,MAAO;AACL,MAAA,OAAO,QAAA,CAAS,aAAA;AAAA,IAClB;AACA,IAAA,OAAO,EAAE,GAAG,IAAA,EAAM,IAAA,EAAM,QAAA,EAAS;AAAA,EACnC,CAAC,CAAA;AAED,EAAA,OAAO,EAAE,KAAA,EAAO,YAAA,EAAc,KAAA,EAAO,YAAA,EAA6B;AACpE","file":"chunk-XMVV7FRZ.js","sourcesContent":["import { elkLayout } from \"@aranzatech/diagrams-core/layout\";\nimport type { DiagramNode, DiagramEdge } from \"@aranzatech/diagrams-core/types\";\nimport type { BpmnRFNode, BpmnRFEdge } from \"../xml/types\";\nimport type { BpmnElementType } from \"../elements/types\";\nimport { getBpmnNodeSize } from \"../modeling\";\n\n// Container types that ELK auto-sizes based on their children.\nconst BPMN_CONTAINER_TYPES = new Set<BpmnElementType>([\n \"Pool\",\n \"Lane\",\n \"SubProcess\",\n \"Transaction\",\n \"EventSubProcess\",\n \"AdHocSubProcess\",\n]);\n\nconst CONTAINER_MIN_SIZE: Partial<Record<BpmnElementType, { w: number; h: number }>> = {\n Pool: { w: 720, h: 200 },\n Lane: { w: 600, h: 160 },\n SubProcess: { w: 240, h: 140 },\n Transaction: { w: 240, h: 140 },\n EventSubProcess: { w: 240, h: 140 },\n AdHocSubProcess: { w: 240, h: 140 },\n};\n\n// Padding inside each container type.\n// Left padding for Pool/Lane accounts for the vertical label strip (~30px) + breathing room.\nconst CONTAINER_PADDING: Partial<Record<BpmnElementType, string>> = {\n Pool: \"[top=30,left=60,bottom=30,right=50]\",\n Lane: \"[top=40,left=70,bottom=40,right=50]\",\n SubProcess: \"[top=30,left=40,bottom=30,right=40]\",\n Transaction: \"[top=30,left=40,bottom=30,right=40]\",\n EventSubProcess: \"[top=30,left=40,bottom=30,right=40]\",\n AdHocSubProcess: \"[top=30,left=40,bottom=30,right=40]\",\n};\n\n/**\n * ELK-based auto-layout for BPMN diagrams.\n *\n * Spacing philosophy: fixed, generous values that scale consistently\n * regardless of diagram size. \"Air\" between elements is not waste —\n * it is what makes the flow readable to the human eye.\n *\n * Direction policy:\n * - Root: RIGHT — free nodes and pools flow LR on the canvas.\n * - Pool with Lanes: DOWN internally so lanes stack top-to-bottom;\n * the pool itself is placed LR on the canvas.\n * - Lane / SubProcess / Pool-without-lanes: RIGHT — content flows LR.\n * - Each container runs its own INCLUDE_CHILDREN pass (per-container\n * hierarchyHandling) so cross-lane edges are routed correctly without\n * the global RIGHT direction forcing Lane containers sideways.\n * - Root uses INHERIT so each pool is laid out independently.\n * - Post-processing equalises Lane widths within each Pool so all Lanes\n * span the full Pool width.\n */\nexport async function bpmnElkLayout(\n nodes: BpmnRFNode[],\n edges: BpmnRFEdge[],\n): Promise<{ nodes: BpmnRFNode[]; edges: BpmnRFEdge[] }> {\n // Pools that directly contain at least one Lane.\n const poolsWithLanes = new Set<string>();\n for (const node of nodes) {\n if (node.data.elementType === \"Lane\" && node.parentId) {\n poolsWithLanes.add(node.parentId);\n }\n }\n\n const result = await elkLayout(\n nodes as unknown as DiagramNode[],\n edges as unknown as DiagramEdge[],\n {\n direction: \"LR\",\n getNodeSize: (node) => {\n const bNode = node as unknown as BpmnRFNode;\n if (BPMN_CONTAINER_TYPES.has(bNode.data.elementType)) return undefined;\n return getBpmnNodeSize(bNode);\n },\n isContainerNode: (node) =>\n BPMN_CONTAINER_TYPES.has((node as unknown as BpmnRFNode).data.elementType),\n getNodeLayoutOptions: (node) => {\n const bNode = node as unknown as BpmnRFNode;\n const type = bNode.data.elementType;\n if (!BPMN_CONTAINER_TYPES.has(type)) return undefined;\n\n const min = CONTAINER_MIN_SIZE[type];\n const isPoolWithLanes = type === \"Pool\" && poolsWithLanes.has(node.id);\n\n // Pool with Lanes stacks Lanes top-to-bottom (standard horizontal BPMN).\n // Everything else flows left-to-right.\n const dir = isPoolWithLanes ? \"DOWN\" : \"RIGHT\";\n\n return {\n \"elk.direction\": dir,\n \"elk.nodeSize.constraints\": \"MINIMUM_SIZE\",\n // Each container handles its own layout pass so cross-lane edges\n // participate in the internal layout without the global direction\n // forcing Lane containers to align sideways.\n \"elk.hierarchyHandling\": \"INCLUDE_CHILDREN\",\n // Lanes within a Pool share a border — zero gap between them.\n // Other containers keep the tighter inner spacing.\n ...(isPoolWithLanes\n ? { \"elk.spacing.nodeNode\": \"0\", \"elk.spacing.componentComponent\": \"0\" }\n : {\n \"elk.layered.spacing.nodeNodeBetweenLayers\": \"100\",\n \"elk.layered.spacing.edgeNodeBetweenLayers\": \"45\",\n \"elk.spacing.nodeNode\": \"50\",\n }),\n ...(min ? { \"elk.nodeSize.minimum\": `[w=${min.w},h=${min.h}]` } : {}),\n ...(CONTAINER_PADDING[type] ? { \"elk.padding\": CONTAINER_PADDING[type] } : {}),\n };\n },\n elk: {\n \"elk.algorithm\": \"layered\",\n \"elk.direction\": \"RIGHT\",\n // INHERIT: each container handles its own INCLUDE_CHILDREN pass so\n // the global RIGHT direction does not force Lane containers sideways.\n \"elk.hierarchyHandling\": \"INHERIT\",\n \"elk.edgeRouting\": \"ORTHOGONAL\",\n // Global spacing — generous values for visual breathing room.\n \"elk.layered.spacing.nodeNodeBetweenLayers\": \"120\",\n \"elk.layered.spacing.edgeNodeBetweenLayers\": \"50\",\n \"elk.spacing.nodeNode\": \"70\",\n \"elk.spacing.componentComponent\": \"100\",\n },\n },\n );\n\n const nodeMap = new Map(result.nodes.map((n) => [n.id, n]));\n const edgeMap = new Map(result.edges.map((e) => [e.id, e]));\n\n // ── Fix 1: Preserve original vertical order of root nodes (Pools, free nodes) ──\n // ELK may reorder disconnected components based on cross-pool edge direction.\n // We restore the original top-to-bottom order so Pools never swap positions.\n const COMPONENT_GAP = 100;\n const rootNodeOrder = nodes\n .filter((n) => !n.parentId)\n .map((n) => n.id);\n\n // Compute ELK heights for each root node, then re-stack top-to-bottom.\n const rootHeights = new Map<string, number>();\n for (const id of rootNodeOrder) {\n const laid = nodeMap.get(id);\n const orig = nodes.find((n) => n.id === id);\n rootHeights.set(id, laid?.height ?? orig?.height ?? 200);\n }\n let stackY = 0;\n const rootY = new Map<string, number>();\n for (const id of rootNodeOrder) {\n rootY.set(id, stackY);\n stackY += (rootHeights.get(id) ?? 200) + COMPONENT_GAP;\n }\n\n const updatedNodes = nodes.map((node) => {\n const laid = nodeMap.get(node.id);\n if (!laid) return node;\n const pos = node.parentId\n ? laid.position // children: ELK relative position\n : { x: laid.position.x, y: rootY.get(node.id) ?? laid.position.y }; // root: preserved order\n return { ...node, position: pos, width: laid.width, height: laid.height };\n });\n\n // Post-processing: equalise Lane widths within each Pool so all Lanes\n // span the full Pool width regardless of their individual content width.\n const lanesByPool = new Map<string, string[]>();\n for (const node of updatedNodes) {\n if (node.data.elementType === \"Lane\" && node.parentId) {\n const arr = lanesByPool.get(node.parentId) ?? [];\n arr.push(node.id);\n lanesByPool.set(node.parentId, arr);\n }\n }\n const nodeIndex = new Map(updatedNodes.map((n, i) => [n.id, i]));\n for (const laneIds of lanesByPool.values()) {\n const widths = laneIds.map((id) => updatedNodes[nodeIndex.get(id)!]?.width ?? 0);\n const maxWidth = Math.max(...widths);\n if (maxWidth <= 0) continue;\n for (const id of laneIds) {\n const idx = nodeIndex.get(id);\n if (idx !== undefined) {\n updatedNodes[idx] = { ...updatedNodes[idx], width: maxWidth };\n }\n }\n }\n\n // ── Fix 2: Identify cross-pool edges (source and target live in different root containers) ──\n // ELK routes them incorrectly when pools are laid out independently.\n // Clear their routingPoints so ReactFlow renders smooth default curves instead.\n const nodeRootContainer = new Map<string, string | null>();\n for (const node of updatedNodes) {\n nodeRootContainer.set(node.id, node.parentId ?? null);\n }\n const getRootContainer = (nodeId: string): string | null => {\n let current: string | null = nodeId;\n const visited = new Set<string>();\n while (current) {\n if (visited.has(current)) break;\n visited.add(current);\n const parent = nodeRootContainer.get(current);\n if (!parent) return current;\n current = parent;\n }\n return null;\n };\n\n const updatedEdges = edges.map((edge) => {\n const laid = edgeMap.get(edge.id);\n if (!laid) return edge;\n const nextData = { ...edge.data };\n const sourceRoot = getRootContainer(edge.source);\n const targetRoot = getRootContainer(edge.target);\n const isCrossPool = sourceRoot !== targetRoot;\n if (!isCrossPool && laid.points && laid.points.length > 0) {\n nextData.routingPoints = laid.points;\n } else {\n delete nextData.routingPoints;\n }\n return { ...edge, data: nextData };\n });\n\n return { nodes: updatedNodes, edges: updatedEdges as BpmnRFEdge[] };\n}\n"]}
|
package/dist/edges/index.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var react$1 = require('react');
|
|
3
4
|
var react = require('@xyflow/react');
|
|
4
5
|
var routing = require('@aranzatech/diagrams-core/routing');
|
|
5
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -74,6 +75,33 @@ function SequenceFlowEdge({
|
|
|
74
75
|
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);
|
|
75
76
|
const midpoint = getPolylineMidpoint(polyline);
|
|
76
77
|
const defaultMarkerPath = d?.isDefault ? getDefaultFlowMarkerPath(polyline) : null;
|
|
78
|
+
const labelX = midpoint.x + (d?.labelOffsetX ?? 0);
|
|
79
|
+
const labelY = midpoint.y + (d?.labelOffsetY ?? 0);
|
|
80
|
+
const { updateEdgeData, getViewport } = react.useReactFlow();
|
|
81
|
+
const dragStartRef = react$1.useRef(null);
|
|
82
|
+
const handleLabelPointerDown = react$1.useCallback((e) => {
|
|
83
|
+
e.stopPropagation();
|
|
84
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
85
|
+
dragStartRef.current = {
|
|
86
|
+
mx: e.clientX,
|
|
87
|
+
my: e.clientY,
|
|
88
|
+
ox: d?.labelOffsetX ?? 0,
|
|
89
|
+
oy: d?.labelOffsetY ?? 0
|
|
90
|
+
};
|
|
91
|
+
}, [d?.labelOffsetX, d?.labelOffsetY]);
|
|
92
|
+
const handleLabelPointerMove = react$1.useCallback((e) => {
|
|
93
|
+
if (!dragStartRef.current) return;
|
|
94
|
+
const { zoom } = getViewport();
|
|
95
|
+
const dx = (e.clientX - dragStartRef.current.mx) / zoom;
|
|
96
|
+
const dy = (e.clientY - dragStartRef.current.my) / zoom;
|
|
97
|
+
updateEdgeData(id, {
|
|
98
|
+
labelOffsetX: dragStartRef.current.ox + dx,
|
|
99
|
+
labelOffsetY: dragStartRef.current.oy + dy
|
|
100
|
+
});
|
|
101
|
+
}, [id, updateEdgeData, getViewport]);
|
|
102
|
+
const handleLabelPointerUp = react$1.useCallback(() => {
|
|
103
|
+
dragStartRef.current = null;
|
|
104
|
+
}, []);
|
|
77
105
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
78
106
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
79
107
|
react.BaseEdge,
|
|
@@ -103,15 +131,20 @@ function SequenceFlowEdge({
|
|
|
103
131
|
(label ?? d?.label) && /* @__PURE__ */ jsxRuntime.jsx(react.EdgeLabelRenderer, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
104
132
|
"div",
|
|
105
133
|
{
|
|
134
|
+
onPointerDown: handleLabelPointerDown,
|
|
135
|
+
onPointerMove: handleLabelPointerMove,
|
|
136
|
+
onPointerUp: handleLabelPointerUp,
|
|
106
137
|
style: {
|
|
107
138
|
position: "absolute",
|
|
108
|
-
transform: `translate(-50%,-50%) translate(${
|
|
139
|
+
transform: `translate(-50%,-50%) translate(${labelX}px,${labelY}px)`,
|
|
109
140
|
fontSize: 11,
|
|
110
141
|
fontFamily: "Inter, system-ui, sans-serif",
|
|
111
142
|
background: "rgba(255,255,255,0.85)",
|
|
112
143
|
padding: "1px 4px",
|
|
113
144
|
borderRadius: 2,
|
|
114
|
-
pointerEvents: "all"
|
|
145
|
+
pointerEvents: "all",
|
|
146
|
+
cursor: "grab",
|
|
147
|
+
userSelect: "none"
|
|
115
148
|
},
|
|
116
149
|
className: "nodrag nopan",
|
|
117
150
|
children: label ?? d?.label
|
package/dist/edges/index.cjs.map
CHANGED
|
@@ -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":";;;;;;;;;AAwBO,SAAS,oBAAoB,MAAA,EAAgC;AAClE,EAAA,IAAI,MAAA,CAAO,WAAW,CAAA,EAAG,OAAO,EAAE,CAAA,EAAG,CAAA,EAAG,GAAG,CAAA,EAAE;AAC7C,EAAA,I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{ 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, 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 = 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 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 { 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 = 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 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([{ 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","getStraightPath"],"mappings":";;;;;;;;;;AAwBO,SAAS,oBAAoB,MAAA,EAAgC;AAClE,EAAA,IAAI,MAAA,CAAO,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CAAW,QAAA,EAAU,UAAA,EAAY,UAAA,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 { 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, 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 = 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 midpoint = getPolylineMidpoint(polyline);\n const defaultMarkerPath = d?.isDefault ? getDefaultFlowMarkerPath(polyline) : null;\n\n const labelX = midpoint.x + (d?.labelOffsetX ?? 0);\n const labelY = midpoint.y + (d?.labelOffsetY ?? 0);\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}\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 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: \"Inter, system-ui, sans-serif\",\n background: \"rgba(255,255,255,0.85)\",\n padding: \"1px 4px\",\n borderRadius: 2,\n pointerEvents: \"all\",\n cursor: \"grab\",\n userSelect: \"none\",\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 { 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 = 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 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([{ 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"]}
|
package/dist/edges/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AssociationEdge, BPMN_EDGE_TYPES, ConversationLinkEdge, DataAssociationEdge, MessageFlowEdge, SequenceFlowEdge } from '../chunk-
|
|
1
|
+
export { AssociationEdge, BPMN_EDGE_TYPES, ConversationLinkEdge, DataAssociationEdge, MessageFlowEdge, SequenceFlowEdge } from '../chunk-QSMP34CT.js';
|
|
2
2
|
import '../chunk-PDTXM32P.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { B as BPMN_ELEMENT_CATALOG, a as BPMN_RESIZABLE_ELEMENT_TYPES, g as getBpmnElementSize, b as getElementMeta, i as isBpmnElementResizable } from '../catalog-
|
|
2
|
-
export { a as acceptsBoundaryEvents, g as getHandlePolicy, b as getOrientation, i as isChoreographyType, c as isContainerType, d as isConversationType, e as isDataType, f as isEventType, h as isGatewayType, j as isTaskType, s as supportsCollapse, k as supportsMarkers } from '../guards-
|
|
3
|
-
import { f as BpmnElementType, E as EventTrigger, m as BpmnNodeData } from '../types-
|
|
4
|
-
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, k as BpmnHandlePolicy, l as BpmnMessageDefinition, n as BpmnOrientation, o as BpmnProcessVariable, p as BpmnSignalDefinition, q as BpmnTimerDefinition, r as BpmnTimerKind, I as InlineDecisionInput, s as InlineDecisionOutput, t as InlineDecisionRule, u as InlineDecisionTable, S as SubProcessVariant, T as TaskMarker } from '../types-
|
|
1
|
+
export { B as BPMN_ELEMENT_CATALOG, a as BPMN_RESIZABLE_ELEMENT_TYPES, g as getBpmnElementSize, b as getElementMeta, i as isBpmnElementResizable } from '../catalog-xOMF2ifW.cjs';
|
|
2
|
+
export { a as acceptsBoundaryEvents, g as getHandlePolicy, b as getOrientation, i as isChoreographyType, c as isContainerType, d as isConversationType, e as isDataType, f as isEventType, h as isGatewayType, j as isTaskType, s as supportsCollapse, k as supportsMarkers } from '../guards-C70uIY_O.cjs';
|
|
3
|
+
import { f as BpmnElementType, E as EventTrigger, m as BpmnNodeData } from '../types-y-ZbX-ff.cjs';
|
|
4
|
+
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, k as BpmnHandlePolicy, l as BpmnMessageDefinition, n as BpmnOrientation, o as BpmnProcessVariable, p as BpmnSignalDefinition, q as BpmnTimerDefinition, r as BpmnTimerKind, I as InlineDecisionInput, s as InlineDecisionOutput, t as InlineDecisionRule, u as InlineDecisionTable, S as SubProcessVariant, T as TaskMarker } from '../types-y-ZbX-ff.cjs';
|
|
5
5
|
|
|
6
6
|
interface BpmnEventSubtypeEntry {
|
|
7
7
|
baseType: Extract<BpmnElementType, "StartEvent" | "EndEvent" | "IntermediateCatchEvent" | "IntermediateThrowEvent" | "BoundaryEvent">;
|
package/dist/elements/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { B as BPMN_ELEMENT_CATALOG, a as BPMN_RESIZABLE_ELEMENT_TYPES, g as getBpmnElementSize, b as getElementMeta, i as isBpmnElementResizable } from '../catalog-
|
|
2
|
-
export { a as acceptsBoundaryEvents, g as getHandlePolicy, b as getOrientation, i as isChoreographyType, c as isContainerType, d as isConversationType, e as isDataType, f as isEventType, h as isGatewayType, j as isTaskType, s as supportsCollapse, k as supportsMarkers } from '../guards-
|
|
3
|
-
import { f as BpmnElementType, E as EventTrigger, m as BpmnNodeData } from '../types-
|
|
4
|
-
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, k as BpmnHandlePolicy, l as BpmnMessageDefinition, n as BpmnOrientation, o as BpmnProcessVariable, p as BpmnSignalDefinition, q as BpmnTimerDefinition, r as BpmnTimerKind, I as InlineDecisionInput, s as InlineDecisionOutput, t as InlineDecisionRule, u as InlineDecisionTable, S as SubProcessVariant, T as TaskMarker } from '../types-
|
|
1
|
+
export { B as BPMN_ELEMENT_CATALOG, a as BPMN_RESIZABLE_ELEMENT_TYPES, g as getBpmnElementSize, b as getElementMeta, i as isBpmnElementResizable } from '../catalog-CK3_4cOb.js';
|
|
2
|
+
export { a as acceptsBoundaryEvents, g as getHandlePolicy, b as getOrientation, i as isChoreographyType, c as isContainerType, d as isConversationType, e as isDataType, f as isEventType, h as isGatewayType, j as isTaskType, s as supportsCollapse, k as supportsMarkers } from '../guards-foB6XIfZ.js';
|
|
3
|
+
import { f as BpmnElementType, E as EventTrigger, m as BpmnNodeData } from '../types-y-ZbX-ff.js';
|
|
4
|
+
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, k as BpmnHandlePolicy, l as BpmnMessageDefinition, n as BpmnOrientation, o as BpmnProcessVariable, p as BpmnSignalDefinition, q as BpmnTimerDefinition, r as BpmnTimerKind, I as InlineDecisionInput, s as InlineDecisionOutput, t as InlineDecisionRule, u as InlineDecisionTable, S as SubProcessVariant, T as TaskMarker } from '../types-y-ZbX-ff.js';
|
|
5
5
|
|
|
6
6
|
interface BpmnEventSubtypeEntry {
|
|
7
7
|
baseType: Extract<BpmnElementType, "StartEvent" | "EndEvent" | "IntermediateCatchEvent" | "IntermediateThrowEvent" | "BoundaryEvent">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"elk-FSFIEL6O.js"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as BpmnElementType, k as BpmnHandlePolicy, n as BpmnOrientation } from './types-
|
|
1
|
+
import { f as BpmnElementType, k as BpmnHandlePolicy, n as BpmnOrientation } from './types-y-ZbX-ff.cjs';
|
|
2
2
|
|
|
3
3
|
declare function isTaskType(type: BpmnElementType): boolean;
|
|
4
4
|
declare function isGatewayType(type: BpmnElementType): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as BpmnElementType, k as BpmnHandlePolicy, n as BpmnOrientation } from './types-
|
|
1
|
+
import { f as BpmnElementType, k as BpmnHandlePolicy, n as BpmnOrientation } from './types-y-ZbX-ff.js';
|
|
2
2
|
|
|
3
3
|
declare function isTaskType(type: BpmnElementType): boolean;
|
|
4
4
|
declare function isGatewayType(type: BpmnElementType): boolean;
|