@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.
Files changed (52) hide show
  1. package/dist/{catalog-Di2nzGs9.d.ts → catalog-CK3_4cOb.d.ts} +1 -1
  2. package/dist/{catalog-BiLXVn-2.d.cts → catalog-xOMF2ifW.d.cts} +1 -1
  3. package/dist/{chunk-UAWLUDKC.js → chunk-HOWK3ZOO.js} +105 -13
  4. package/dist/chunk-HOWK3ZOO.js.map +1 -0
  5. package/dist/{chunk-O3NWJ5H7.js → chunk-QSMP34CT.js} +38 -5
  6. package/dist/chunk-QSMP34CT.js.map +1 -0
  7. package/dist/{chunk-IMW6RG6F.js → chunk-X54NHLBA.js} +43 -190
  8. package/dist/chunk-X54NHLBA.js.map +1 -0
  9. package/dist/chunk-XMVV7FRZ.js +163 -0
  10. package/dist/chunk-XMVV7FRZ.js.map +1 -0
  11. package/dist/edges/index.cjs +35 -2
  12. package/dist/edges/index.cjs.map +1 -1
  13. package/dist/edges/index.js +1 -1
  14. package/dist/elements/index.d.cts +4 -4
  15. package/dist/elements/index.d.ts +4 -4
  16. package/dist/elk-FSFIEL6O.js +6 -0
  17. package/dist/elk-FSFIEL6O.js.map +1 -0
  18. package/dist/{guards-DPHXfpY8.d.cts → guards-C70uIY_O.d.cts} +1 -1
  19. package/dist/{guards-qgSeZEU4.d.ts → guards-foB6XIfZ.d.ts} +1 -1
  20. package/dist/index.cjs +180 -200
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +5 -5
  23. package/dist/index.d.ts +5 -5
  24. package/dist/index.js +3 -3
  25. package/dist/layout/index.cjs +1428 -755
  26. package/dist/layout/index.cjs.map +1 -1
  27. package/dist/layout/index.d.cts +23 -12
  28. package/dist/layout/index.d.ts +23 -12
  29. package/dist/layout/index.js +547 -72
  30. package/dist/layout/index.js.map +1 -1
  31. package/dist/modeling/index.cjs +103 -10
  32. package/dist/modeling/index.cjs.map +1 -1
  33. package/dist/modeling/index.d.cts +23 -6
  34. package/dist/modeling/index.d.ts +23 -6
  35. package/dist/modeling/index.js +1 -1
  36. package/dist/nodes/index.cjs +42 -188
  37. package/dist/nodes/index.cjs.map +1 -1
  38. package/dist/nodes/index.d.cts +1 -1
  39. package/dist/nodes/index.d.ts +1 -1
  40. package/dist/nodes/index.js +1 -1
  41. package/dist/{types-rEfHsPr5.d.ts → types-DG5yPKld.d.ts} +1 -1
  42. package/dist/{types-s2_VvPGf.d.cts → types-jIDz306Y.d.cts} +1 -1
  43. package/dist/{types-Dfrt0wVs.d.cts → types-y-ZbX-ff.d.cts} +3 -0
  44. package/dist/{types-Dfrt0wVs.d.ts → types-y-ZbX-ff.d.ts} +3 -0
  45. package/dist/validation/index.d.cts +2 -2
  46. package/dist/validation/index.d.ts +2 -2
  47. package/dist/xml/index.d.cts +3 -3
  48. package/dist/xml/index.d.ts +3 -3
  49. package/package.json +2 -2
  50. package/dist/chunk-IMW6RG6F.js.map +0 -1
  51. package/dist/chunk-O3NWJ5H7.js.map +0 -1
  52. package/dist/chunk-UAWLUDKC.js.map +0 -1
package/dist/index.cjs CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  var react = require('@xyflow/react');
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
+ var react$1 = require('react');
5
6
  var routing = require('@aranzatech/diagrams-core/routing');
6
7
  var diagramsCore = require('@aranzatech/diagrams-core');
7
8
  var serialization = require('@aranzatech/diagrams-core/serialization');
@@ -761,6 +762,7 @@ var BPMN_THEME = {
761
762
  fillSoft: "#f8fbff",
762
763
  fillSubtle: "#eef6ff",
763
764
  stroke: "#334155",
765
+ strokeMuted: "#64748b",
764
766
  strokeSelected: "#2563eb",
765
767
  strokeWidth: 1.5,
766
768
  strokeWidthSelected: 2.5,
@@ -1400,71 +1402,33 @@ function SubProcessNode({ data, selected }) {
1400
1402
  }
1401
1403
  );
1402
1404
  }
1403
- var HEADER_WIDTH = 30;
1404
- var HEADER_HEIGHT = 28;
1405
- function PoolNode({ data, selected }) {
1406
- const d = data;
1407
- const stroke = resolveStroke(selected, d.color?.stroke);
1408
- const sw = resolveStrokeWidth(selected);
1409
- const orientation = d.orientation ?? "horizontal";
1410
- const fill = d.color?.fill ?? "#f8fbff";
1411
- const headerFill = d.color?.fill ?? "#eaf2ff";
1412
- if (orientation === "vertical") {
1413
- return /* @__PURE__ */ jsxRuntime.jsxs(
1414
- "div",
1415
- {
1416
- style: {
1417
- width: "100%",
1418
- height: "100%",
1419
- display: "flex",
1420
- flexDirection: "column",
1421
- border: `${sw}px solid ${stroke}`,
1422
- borderRadius: 4,
1423
- boxSizing: "border-box",
1424
- background: fill,
1425
- boxShadow: resolveNodeShadow(selected),
1426
- overflow: "hidden",
1427
- fontFamily: BPMN_THEME.fontFamily,
1428
- transition: BPMN_THEME.transition
1429
- },
1430
- children: [
1431
- /* @__PURE__ */ jsxRuntime.jsx(
1432
- "div",
1433
- {
1434
- "aria-label": "pool-header",
1435
- className: "pool-drag-handle",
1436
- style: {
1437
- height: HEADER_HEIGHT,
1438
- minHeight: HEADER_HEIGHT,
1439
- borderBottom: `${sw}px solid ${stroke}`,
1440
- display: "flex",
1441
- alignItems: "center",
1442
- justifyContent: "center",
1443
- background: headerFill,
1444
- padding: "0 8px",
1445
- cursor: "grab"
1446
- },
1447
- children: /* @__PURE__ */ jsxRuntime.jsx(
1448
- "span",
1449
- {
1450
- style: {
1451
- fontSize: BPMN_THEME.fontSize,
1452
- fontWeight: 600,
1453
- color: BPMN_THEME.labelColor,
1454
- whiteSpace: "nowrap",
1455
- overflow: "hidden",
1456
- textOverflow: "ellipsis"
1457
- },
1458
- children: d.label
1459
- }
1460
- )
1461
- }
1462
- ),
1463
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1, position: "relative" } })
1464
- ]
1405
+ function PoolNode({ selected }) {
1406
+ const sw = selected ? 2.5 : 2;
1407
+ const borderColor = selected ? "var(--color-accent)" : "color-mix(in srgb, var(--color-accent) 40%, transparent)";
1408
+ const bg = "color-mix(in srgb, var(--color-accent) 3%, white)";
1409
+ return /* @__PURE__ */ jsxRuntime.jsx(
1410
+ "div",
1411
+ {
1412
+ style: {
1413
+ width: "100%",
1414
+ height: "100%",
1415
+ border: `${sw}px solid ${borderColor}`,
1416
+ borderRadius: 6,
1417
+ boxSizing: "border-box",
1418
+ background: bg,
1419
+ fontFamily: BPMN_THEME.fontFamily,
1420
+ transition: "border-color 140ms ease",
1421
+ overflow: "visible"
1465
1422
  }
1466
- );
1467
- }
1423
+ }
1424
+ );
1425
+ }
1426
+ var LABEL_W = 28;
1427
+ function LaneNode({ data, selected }) {
1428
+ const d = data;
1429
+ const stroke = selected ? BPMN_THEME.strokeSelected : d.color?.stroke ?? BPMN_THEME.strokeMuted;
1430
+ const bodyFill = "#fbfdff";
1431
+ const labelFill = d.color?.fill ?? "#eef6ff";
1468
1432
  return /* @__PURE__ */ jsxRuntime.jsxs(
1469
1433
  "div",
1470
1434
  {
@@ -1472,11 +1436,11 @@ function PoolNode({ data, selected }) {
1472
1436
  width: "100%",
1473
1437
  height: "100%",
1474
1438
  display: "flex",
1475
- border: `${sw}px solid ${stroke}`,
1476
- borderRadius: 4,
1439
+ flexDirection: "row",
1440
+ border: `1px solid ${stroke}`,
1441
+ borderRadius: 3,
1477
1442
  boxSizing: "border-box",
1478
- background: fill,
1479
- boxShadow: resolveNodeShadow(selected),
1443
+ background: bodyFill,
1480
1444
  overflow: "hidden",
1481
1445
  fontFamily: BPMN_THEME.fontFamily,
1482
1446
  transition: BPMN_THEME.transition
@@ -1485,17 +1449,19 @@ function PoolNode({ data, selected }) {
1485
1449
  /* @__PURE__ */ jsxRuntime.jsx(
1486
1450
  "div",
1487
1451
  {
1488
- "aria-label": "pool-header",
1489
- className: "pool-drag-handle",
1452
+ "aria-label": "lane-header",
1453
+ className: "lane-drag-handle",
1490
1454
  style: {
1491
- width: HEADER_WIDTH,
1492
- minWidth: HEADER_WIDTH,
1493
- borderRight: `${sw}px solid ${stroke}`,
1455
+ width: LABEL_W,
1456
+ minWidth: LABEL_W,
1457
+ borderRight: `1px solid ${stroke}`,
1494
1458
  display: "flex",
1495
1459
  alignItems: "center",
1496
1460
  justifyContent: "center",
1497
- background: headerFill,
1498
- cursor: "grab"
1461
+ background: labelFill,
1462
+ cursor: "grab",
1463
+ userSelect: "none",
1464
+ flexShrink: 0
1499
1465
  },
1500
1466
  children: /* @__PURE__ */ jsxRuntime.jsx(
1501
1467
  "span",
@@ -1504,7 +1470,7 @@ function PoolNode({ data, selected }) {
1504
1470
  writingMode: "vertical-rl",
1505
1471
  transform: "rotate(180deg)",
1506
1472
  fontSize: BPMN_THEME.fontSize,
1507
- fontWeight: 600,
1473
+ fontWeight: 500,
1508
1474
  color: BPMN_THEME.labelColor,
1509
1475
  whiteSpace: "nowrap",
1510
1476
  overflow: "hidden",
@@ -1516,118 +1482,7 @@ function PoolNode({ data, selected }) {
1516
1482
  )
1517
1483
  }
1518
1484
  ),
1519
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1, position: "relative" } })
1520
- ]
1521
- }
1522
- );
1523
- }
1524
- var HEADER_HEIGHT2 = 24;
1525
- var HEADER_WIDTH2 = 28;
1526
- function LaneNode({ data, selected }) {
1527
- const d = data;
1528
- const stroke = resolveStroke(selected, d.color?.stroke);
1529
- const sw = resolveStrokeWidth(selected);
1530
- const orientation = d.orientation ?? "horizontal";
1531
- const fill = d.color?.fill ?? "#fbfdff";
1532
- const headerFill = d.color?.fill ?? "#eef6ff";
1533
- if (orientation === "vertical") {
1534
- return /* @__PURE__ */ jsxRuntime.jsxs(
1535
- "div",
1536
- {
1537
- style: {
1538
- width: "100%",
1539
- height: "100%",
1540
- display: "flex",
1541
- border: `${sw}px solid ${stroke}`,
1542
- borderRadius: 2,
1543
- boxSizing: "border-box",
1544
- background: fill,
1545
- boxShadow: resolveNodeShadow(selected),
1546
- overflow: "hidden",
1547
- fontFamily: BPMN_THEME.fontFamily,
1548
- transition: BPMN_THEME.transition
1549
- },
1550
- children: [
1551
- /* @__PURE__ */ jsxRuntime.jsx(
1552
- "div",
1553
- {
1554
- "aria-label": "lane-header",
1555
- className: "lane-drag-handle",
1556
- style: {
1557
- width: HEADER_WIDTH2,
1558
- minWidth: HEADER_WIDTH2,
1559
- borderRight: `1px solid ${stroke}`,
1560
- display: "flex",
1561
- alignItems: "center",
1562
- justifyContent: "center",
1563
- background: headerFill,
1564
- padding: "6px 0",
1565
- cursor: "grab"
1566
- },
1567
- children: /* @__PURE__ */ jsxRuntime.jsx(
1568
- "span",
1569
- {
1570
- style: {
1571
- writingMode: "vertical-rl",
1572
- transform: "rotate(180deg)",
1573
- fontSize: BPMN_THEME.fontSize,
1574
- fontWeight: 500,
1575
- color: BPMN_THEME.labelColor,
1576
- whiteSpace: "nowrap",
1577
- overflow: "hidden",
1578
- textOverflow: "ellipsis",
1579
- maxHeight: "90%"
1580
- },
1581
- children: d.label
1582
- }
1583
- )
1584
- }
1585
- ),
1586
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1, position: "relative" } })
1587
- ]
1588
- }
1589
- );
1590
- }
1591
- return /* @__PURE__ */ jsxRuntime.jsxs(
1592
- "div",
1593
- {
1594
- style: {
1595
- width: "100%",
1596
- height: "100%",
1597
- display: "flex",
1598
- flexDirection: "column",
1599
- border: `${sw}px solid ${stroke}`,
1600
- borderRadius: 2,
1601
- boxSizing: "border-box",
1602
- background: fill,
1603
- boxShadow: resolveNodeShadow(selected),
1604
- overflow: "hidden",
1605
- fontFamily: BPMN_THEME.fontFamily,
1606
- transition: BPMN_THEME.transition
1607
- },
1608
- children: [
1609
- /* @__PURE__ */ jsxRuntime.jsx(
1610
- "div",
1611
- {
1612
- "aria-label": "lane-header",
1613
- className: "lane-drag-handle",
1614
- style: {
1615
- height: HEADER_HEIGHT2,
1616
- minHeight: HEADER_HEIGHT2,
1617
- borderBottom: `1px solid ${stroke}`,
1618
- display: "flex",
1619
- alignItems: "center",
1620
- paddingLeft: 8,
1621
- background: headerFill,
1622
- fontSize: BPMN_THEME.fontSize,
1623
- fontWeight: 500,
1624
- color: BPMN_THEME.labelColor,
1625
- cursor: "grab"
1626
- },
1627
- children: d.label
1628
- }
1629
- ),
1630
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1, position: "relative" } })
1485
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nodrag", style: { flex: 1, position: "relative" } })
1631
1486
  ]
1632
1487
  }
1633
1488
  );
@@ -2291,6 +2146,33 @@ function SequenceFlowEdge({
2291
2146
  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);
2292
2147
  const midpoint = getPolylineMidpoint(polyline);
2293
2148
  const defaultMarkerPath = d?.isDefault ? getDefaultFlowMarkerPath(polyline) : null;
2149
+ const labelX = midpoint.x + (d?.labelOffsetX ?? 0);
2150
+ const labelY = midpoint.y + (d?.labelOffsetY ?? 0);
2151
+ const { updateEdgeData, getViewport } = react.useReactFlow();
2152
+ const dragStartRef = react$1.useRef(null);
2153
+ const handleLabelPointerDown = react$1.useCallback((e) => {
2154
+ e.stopPropagation();
2155
+ e.currentTarget.setPointerCapture(e.pointerId);
2156
+ dragStartRef.current = {
2157
+ mx: e.clientX,
2158
+ my: e.clientY,
2159
+ ox: d?.labelOffsetX ?? 0,
2160
+ oy: d?.labelOffsetY ?? 0
2161
+ };
2162
+ }, [d?.labelOffsetX, d?.labelOffsetY]);
2163
+ const handleLabelPointerMove = react$1.useCallback((e) => {
2164
+ if (!dragStartRef.current) return;
2165
+ const { zoom } = getViewport();
2166
+ const dx = (e.clientX - dragStartRef.current.mx) / zoom;
2167
+ const dy = (e.clientY - dragStartRef.current.my) / zoom;
2168
+ updateEdgeData(id, {
2169
+ labelOffsetX: dragStartRef.current.ox + dx,
2170
+ labelOffsetY: dragStartRef.current.oy + dy
2171
+ });
2172
+ }, [id, updateEdgeData, getViewport]);
2173
+ const handleLabelPointerUp = react$1.useCallback(() => {
2174
+ dragStartRef.current = null;
2175
+ }, []);
2294
2176
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2295
2177
  /* @__PURE__ */ jsxRuntime.jsx(
2296
2178
  react.BaseEdge,
@@ -2320,15 +2202,20 @@ function SequenceFlowEdge({
2320
2202
  (label ?? d?.label) && /* @__PURE__ */ jsxRuntime.jsx(react.EdgeLabelRenderer, { children: /* @__PURE__ */ jsxRuntime.jsx(
2321
2203
  "div",
2322
2204
  {
2205
+ onPointerDown: handleLabelPointerDown,
2206
+ onPointerMove: handleLabelPointerMove,
2207
+ onPointerUp: handleLabelPointerUp,
2323
2208
  style: {
2324
2209
  position: "absolute",
2325
- transform: `translate(-50%,-50%) translate(${midpoint.x}px,${midpoint.y}px)`,
2210
+ transform: `translate(-50%,-50%) translate(${labelX}px,${labelY}px)`,
2326
2211
  fontSize: 11,
2327
2212
  fontFamily: "Inter, system-ui, sans-serif",
2328
2213
  background: "rgba(255,255,255,0.85)",
2329
2214
  padding: "1px 4px",
2330
2215
  borderRadius: 2,
2331
- pointerEvents: "all"
2216
+ pointerEvents: "all",
2217
+ cursor: "grab",
2218
+ userSelect: "none"
2332
2219
  },
2333
2220
  className: "nodrag nopan",
2334
2221
  children: label ?? d?.label
@@ -4385,7 +4272,9 @@ function createBpmnNode(options) {
4385
4272
  height: options.height ?? size.height,
4386
4273
  zIndex: getBpmnNodeZIndex(options.elementType),
4387
4274
  ...options.parentId ? { parentId: options.parentId } : {},
4388
- ...options.elementType === "Lane" && options.parentId ? { extent: "parent" } : {},
4275
+ // extent:"parent" is intentionally omitted for Lane it blocks resize beyond
4276
+ // the Pool boundary before the Pool/Lane coupling can expand the Pool.
4277
+ // Lane containment during drag is handled programmatically in handleNodeDragStop.
4389
4278
  ...dragHandle ? { dragHandle } : {}
4390
4279
  };
4391
4280
  }
@@ -4402,8 +4291,13 @@ function withBpmnNodeZIndexes(nodes) {
4402
4291
  });
4403
4292
  }
4404
4293
  var BPMN_POOL_LANE_LAYOUT = {
4405
- poolHeaderSize: 30,
4406
- laneHeaderSize: 24,
4294
+ // Pool inner padding on all sides (no left label strip).
4295
+ // 8px = pool border (2px) + 6px visible gap.
4296
+ poolPad: 8,
4297
+ /** @deprecated use poolPad */
4298
+ poolHeaderSize: 8,
4299
+ // Lane left label strip (vertical text).
4300
+ laneHeaderSize: 28,
4407
4301
  laneGap: 0,
4408
4302
  verticalPoolHeaderSize: 28,
4409
4303
  minLaneSize: 96
@@ -4527,6 +4421,30 @@ function getBpmnPoolLanes(state, poolId) {
4527
4421
  (node) => node.data.elementType === "Lane"
4528
4422
  );
4529
4423
  }
4424
+ function getBpmnNodeBounds(state, node) {
4425
+ const position = getBpmnNodeAbsolutePosition(state, node) ?? node.position;
4426
+ const size = getBpmnNodeSize(node);
4427
+ return {
4428
+ ...position,
4429
+ width: size.width,
4430
+ height: size.height
4431
+ };
4432
+ }
4433
+ function findBpmnLaneAt(state, position) {
4434
+ return state.nodes.find((node) => {
4435
+ if (node.data.elementType !== "Lane") return false;
4436
+ const bounds = getBpmnNodeBounds(state, node);
4437
+ return position.x >= bounds.x && position.x <= bounds.x + bounds.width && position.y >= bounds.y && position.y <= bounds.y + bounds.height;
4438
+ });
4439
+ }
4440
+ function getAncestorLaneId(state, node) {
4441
+ let current = node;
4442
+ while (current) {
4443
+ if (current.data.elementType === "Lane") return current.id;
4444
+ current = current.parentId ? diagramsCore.getNode(state, current.parentId) : void 0;
4445
+ }
4446
+ return void 0;
4447
+ }
4530
4448
  function getNodeDimension(node, axis) {
4531
4449
  return node[axis] ?? node.measured?.[axis] ?? getBpmnElementSize(node.data.elementType)[axis];
4532
4450
  }
@@ -4535,16 +4453,18 @@ function getBpmnLaneOrderPosition(lane, orientation) {
4535
4453
  return orientation === "vertical" ? lane.position.x + size.width / 2 : lane.position.y + size.height / 2;
4536
4454
  }
4537
4455
  function resizeHorizontalBpmnLanes(lanes, pool) {
4456
+ const pad = BPMN_POOL_LANE_LAYOUT.poolPad;
4538
4457
  const poolSize = getBpmnNodeSize(pool);
4539
- const laneWidth = Math.max(BPMN_POOL_LANE_LAYOUT.minLaneSize, poolSize.width - BPMN_POOL_LANE_LAYOUT.poolHeaderSize);
4540
- const laneHeight = Math.max(BPMN_POOL_LANE_LAYOUT.minLaneSize, poolSize.height / Math.max(1, lanes.length));
4458
+ const laneWidth = Math.max(BPMN_POOL_LANE_LAYOUT.minLaneSize, poolSize.width - pad * 2);
4459
+ const availH = Math.max(0, poolSize.height - pad * 2);
4460
+ const laneHeight = Math.max(BPMN_POOL_LANE_LAYOUT.minLaneSize, availH / Math.max(1, lanes.length));
4541
4461
  return lanes.map((lane, index) => ({
4542
4462
  ...lane,
4543
- position: { x: BPMN_POOL_LANE_LAYOUT.poolHeaderSize, y: index * laneHeight },
4463
+ position: { x: pad, y: pad + index * laneHeight },
4544
4464
  width: laneWidth,
4545
4465
  height: laneHeight,
4546
4466
  parentId: pool.id,
4547
- extent: "parent",
4467
+ // extent:"parent" intentionally omitted — blocks resize→Pool coupling.
4548
4468
  zIndex: getBpmnNodeZIndex("Lane"),
4549
4469
  data: { ...lane.data, orientation: "horizontal", laneIndex: index }
4550
4470
  }));
@@ -4575,10 +4495,22 @@ function layoutBpmnPoolLaneNodes(nodes, poolId) {
4575
4495
  return getBpmnLaneOrderPosition(a, orientation) - getBpmnLaneOrderPosition(b, orientation);
4576
4496
  });
4577
4497
  if (lanes.length === 0) return withBpmnNodeZIndexes(nodes);
4578
- const laneMap = new Map(
4579
- (orientation === "vertical" ? resizeVerticalBpmnLanes(lanes, pool) : resizeHorizontalBpmnLanes(lanes, pool)).map((lane) => [lane.id, lane])
4498
+ const resizedLanes = orientation === "vertical" ? resizeVerticalBpmnLanes(lanes, pool) : resizeHorizontalBpmnLanes(lanes, pool);
4499
+ const laneMap = new Map(resizedLanes.map((lane) => [lane.id, lane]));
4500
+ const pad = BPMN_POOL_LANE_LAYOUT.poolPad;
4501
+ const totalLaneH = resizedLanes.reduce((sum, l) => sum + (l.height ?? 0), 0);
4502
+ const requiredPoolH = totalLaneH + pad * 2;
4503
+ const poolMap = /* @__PURE__ */ new Map();
4504
+ if (orientation === "horizontal") {
4505
+ const currentH = getBpmnNodeSize(pool).height;
4506
+ poolMap.set(pool.id, {
4507
+ ...pool,
4508
+ height: Math.max(requiredPoolH, currentH)
4509
+ });
4510
+ }
4511
+ return withBpmnNodeZIndexes(
4512
+ nodes.map((node) => laneMap.get(node.id) ?? poolMap.get(node.id) ?? node)
4580
4513
  );
4581
- return withBpmnNodeZIndexes(nodes.map((node) => laneMap.get(node.id) ?? node));
4582
4514
  }
4583
4515
  function reorderBpmnLaneAfterDrop(nodes, laneId) {
4584
4516
  const lane = nodes.find((node) => node.id === laneId && node.data.elementType === "Lane");
@@ -4637,6 +4569,53 @@ function findBpmnContainerAt(state, options) {
4637
4569
  }
4638
4570
  });
4639
4571
  }
4572
+ function resolveBpmnDropTarget(state, options) {
4573
+ if (options.elementType === "Pool") {
4574
+ return { highlightedContainerId: null, invalidContainerId: null, isValid: true };
4575
+ }
4576
+ if (options.elementType === "Lane") {
4577
+ const pool = state.nodes.find((node) => {
4578
+ if (node.data.elementType !== "Pool") return false;
4579
+ const bounds = getBpmnNodeBounds(state, node);
4580
+ return options.position.x >= bounds.x && options.position.x <= bounds.x + bounds.width && options.position.y >= bounds.y && options.position.y <= bounds.y + bounds.height;
4581
+ });
4582
+ return {
4583
+ ...pool ? { container: pool } : {},
4584
+ highlightedContainerId: pool?.id ?? null,
4585
+ invalidContainerId: null,
4586
+ isValid: Boolean(pool)
4587
+ };
4588
+ }
4589
+ const lane = findBpmnLaneAt(state, options.position);
4590
+ if (lane) {
4591
+ return {
4592
+ container: lane,
4593
+ highlightedContainerId: lane.id,
4594
+ invalidContainerId: null,
4595
+ isValid: true
4596
+ };
4597
+ }
4598
+ const container = findBpmnContainerAt(state, {
4599
+ position: options.position,
4600
+ ...options.excludeId ? { excludeId: options.excludeId } : {}
4601
+ });
4602
+ if (container?.data.elementType === "Pool") {
4603
+ const hasLanes = getBpmnPoolLanes(state, container.id).length > 0;
4604
+ if (hasLanes) {
4605
+ return {
4606
+ highlightedContainerId: null,
4607
+ invalidContainerId: container.id,
4608
+ isValid: false
4609
+ };
4610
+ }
4611
+ }
4612
+ return {
4613
+ ...container ? { container } : {},
4614
+ highlightedContainerId: getAncestorLaneId(state, container) ?? container?.id ?? null,
4615
+ invalidContainerId: null,
4616
+ isValid: true
4617
+ };
4618
+ }
4640
4619
  function getBpmnNodeCenter(node, absolutePosition) {
4641
4620
  return diagramsCore.getNodeCenterPosition(absolutePosition, getBpmnNodeSize(node));
4642
4621
  }
@@ -5307,6 +5286,7 @@ exports.reparentBpmnNodeCommand = reparentBpmnNodeCommand;
5307
5286
  exports.replaceBpmnNodeCommand = replaceBpmnNodeCommand;
5308
5287
  exports.resizeBpmnNodeByHandleCommand = resizeBpmnNodeByHandleCommand;
5309
5288
  exports.resizeBpmnNodeCommand = resizeBpmnNodeCommand;
5289
+ exports.resolveBpmnDropTarget = resolveBpmnDropTarget;
5310
5290
  exports.restoreBpmnHistory = restoreBpmnHistory;
5311
5291
  exports.routeBpmnEdgeCommand = routeBpmnEdgeCommand;
5312
5292
  exports.runBatchSimulation = runBatchSimulation;