@aranzatech/diagrams-bpmn 0.3.5 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{catalog-DNIyjHbl.d.ts → catalog-CYZHikuU.d.ts} +1 -1
- package/dist/{catalog-DG-sz0VM.d.cts → catalog-C_S9hyyn.d.cts} +1 -1
- package/dist/{chunk-JFYWN6QH.js → chunk-EMTO53AN.js} +52 -73
- package/dist/chunk-EMTO53AN.js.map +1 -0
- package/dist/chunk-G22XQD6H.js +64 -0
- package/dist/chunk-G22XQD6H.js.map +1 -0
- package/dist/{chunk-NYIYQUGX.js → chunk-OFOTX3LA.js} +124 -20
- package/dist/chunk-OFOTX3LA.js.map +1 -0
- package/dist/{chunk-YAYZW45I.js → chunk-SRUWPELT.js} +80 -3
- package/dist/chunk-SRUWPELT.js.map +1 -0
- package/dist/edges/index.cjs +73 -35
- package/dist/edges/index.cjs.map +1 -1
- package/dist/edges/index.js +2 -1
- package/dist/elements/index.d.cts +3 -3
- package/dist/elements/index.d.ts +3 -3
- package/dist/extensions/index.d.cts +2 -2
- package/dist/extensions/index.d.ts +2 -2
- package/dist/index.cjs +194 -53
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/layout/index.cjs +1146 -872
- package/dist/layout/index.cjs.map +1 -1
- package/dist/layout/index.d.cts +4 -4
- package/dist/layout/index.d.ts +4 -4
- package/dist/layout/index.js +560 -89
- package/dist/layout/index.js.map +1 -1
- package/dist/modeling/index.cjs +78 -0
- package/dist/modeling/index.cjs.map +1 -1
- package/dist/modeling/index.d.cts +10 -5
- package/dist/modeling/index.d.ts +10 -5
- package/dist/modeling/index.js +1 -1
- package/dist/{types-nvF59RGF.d.cts → types--x9aoecw.d.cts} +5 -0
- package/dist/{types-nvF59RGF.d.ts → types--x9aoecw.d.ts} +5 -0
- package/dist/{types-dQUuSnV5.d.cts → types-CrFDTGo9.d.cts} +1 -1
- package/dist/{types-CuDL2YGL.d.ts → types-DoPv3m7u.d.ts} +2 -2
- package/dist/{types-X5FyP8oS.d.ts → types-DteJykQG.d.ts} +1 -1
- package/dist/{types-CDp9kWQ4.d.cts → types-YZ4sj3Ih.d.cts} +2 -2
- package/dist/validation/index.d.cts +3 -3
- package/dist/validation/index.d.ts +3 -3
- package/dist/xml/index.cjs +162 -18
- package/dist/xml/index.cjs.map +1 -1
- package/dist/xml/index.d.cts +4 -4
- package/dist/xml/index.d.ts +4 -4
- package/dist/xml/index.js +2 -1
- package/package.json +1 -1
- package/dist/chunk-FFWJA5BV.js +0 -163
- package/dist/chunk-FFWJA5BV.js.map +0 -1
- package/dist/chunk-JFYWN6QH.js.map +0 -1
- package/dist/chunk-NYIYQUGX.js.map +0 -1
- package/dist/chunk-YAYZW45I.js.map +0 -1
- package/dist/elk-QT7H4252.js +0 -6
- package/dist/elk-QT7H4252.js.map +0 -1
package/dist/modeling/index.cjs
CHANGED
|
@@ -1151,6 +1151,83 @@ function applyBpmnPoolLaneDimensionChange(nodes, previousNodes, nodeId, width, h
|
|
|
1151
1151
|
}
|
|
1152
1152
|
return nodes;
|
|
1153
1153
|
}
|
|
1154
|
+
var BPMN_CONTAINER_GROW_PAD = 24;
|
|
1155
|
+
function growBpmnContainersToFit(nodes, options = {}) {
|
|
1156
|
+
const growPad = options.growPad ?? BPMN_CONTAINER_GROW_PAD;
|
|
1157
|
+
const pad = BPMN_POOL_LANE_STACK_LAYOUT.poolInnerPad;
|
|
1158
|
+
const gap = BPMN_POOL_LANE_STACK_LAYOUT.laneGap;
|
|
1159
|
+
const updated = /* @__PURE__ */ new Map();
|
|
1160
|
+
const contentExtent = (parentId) => {
|
|
1161
|
+
let right = 0;
|
|
1162
|
+
let bottom = 0;
|
|
1163
|
+
for (const node of nodes) {
|
|
1164
|
+
if (node.parentId !== parentId) continue;
|
|
1165
|
+
if (node.data.elementType === "Lane") continue;
|
|
1166
|
+
const size = getBpmnNodeSize(node);
|
|
1167
|
+
right = Math.max(right, node.position.x + size.width);
|
|
1168
|
+
bottom = Math.max(bottom, node.position.y + size.height);
|
|
1169
|
+
}
|
|
1170
|
+
return { right, bottom };
|
|
1171
|
+
};
|
|
1172
|
+
for (const pool of nodes) {
|
|
1173
|
+
if (pool.data.elementType !== "Pool") continue;
|
|
1174
|
+
if (getBpmnPoolOrientation(pool) === "vertical") continue;
|
|
1175
|
+
const poolSize = getBpmnNodeSize(pool);
|
|
1176
|
+
const lanes = getBpmnPoolLanesOrderedByStack(nodes, pool.id, "horizontal");
|
|
1177
|
+
if (lanes.length === 0) {
|
|
1178
|
+
const extent = contentExtent(pool.id);
|
|
1179
|
+
if (extent.right === 0 && extent.bottom === 0) continue;
|
|
1180
|
+
const poolW2 = Math.max(poolSize.width, extent.right + growPad);
|
|
1181
|
+
const poolH2 = Math.max(poolSize.height, extent.bottom + growPad);
|
|
1182
|
+
if (poolW2 === poolSize.width && poolH2 === poolSize.height) continue;
|
|
1183
|
+
updated.set(pool.id, {
|
|
1184
|
+
...pool,
|
|
1185
|
+
width: poolW2,
|
|
1186
|
+
height: poolH2,
|
|
1187
|
+
measured: { width: poolW2, height: poolH2 }
|
|
1188
|
+
});
|
|
1189
|
+
continue;
|
|
1190
|
+
}
|
|
1191
|
+
let requiredLaneW = Math.max(...lanes.map((l) => getBpmnNodeSize(l).width));
|
|
1192
|
+
const laneHeights = /* @__PURE__ */ new Map();
|
|
1193
|
+
let anyLaneGrew = false;
|
|
1194
|
+
for (const laneNode of lanes) {
|
|
1195
|
+
const laneSize = getBpmnNodeSize(laneNode);
|
|
1196
|
+
const extent = contentExtent(laneNode.id);
|
|
1197
|
+
const newH = Math.max(laneSize.height, extent.bottom + growPad);
|
|
1198
|
+
laneHeights.set(laneNode.id, newH);
|
|
1199
|
+
requiredLaneW = Math.max(requiredLaneW, extent.right + growPad);
|
|
1200
|
+
if (newH !== laneSize.height) anyLaneGrew = true;
|
|
1201
|
+
}
|
|
1202
|
+
const laneW = requiredLaneW;
|
|
1203
|
+
const laneWGrew = lanes.some((l) => getBpmnNodeSize(l).width !== laneW);
|
|
1204
|
+
if (!anyLaneGrew && !laneWGrew) continue;
|
|
1205
|
+
let cumY = pad;
|
|
1206
|
+
for (const laneNode of lanes) {
|
|
1207
|
+
const laneH = laneHeights.get(laneNode.id);
|
|
1208
|
+
updated.set(laneNode.id, {
|
|
1209
|
+
...laneNode,
|
|
1210
|
+
position: { x: pad, y: cumY },
|
|
1211
|
+
width: laneW,
|
|
1212
|
+
height: laneH,
|
|
1213
|
+
measured: { width: laneW, height: laneH }
|
|
1214
|
+
});
|
|
1215
|
+
cumY += laneH + gap;
|
|
1216
|
+
}
|
|
1217
|
+
const poolW = Math.max(poolSize.width, laneW + pad * 2);
|
|
1218
|
+
const poolH = Math.max(poolSize.height, cumY - gap + pad);
|
|
1219
|
+
if (poolW !== poolSize.width || poolH !== poolSize.height) {
|
|
1220
|
+
updated.set(pool.id, {
|
|
1221
|
+
...pool,
|
|
1222
|
+
width: poolW,
|
|
1223
|
+
height: poolH,
|
|
1224
|
+
measured: { width: poolW, height: poolH }
|
|
1225
|
+
});
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
if (updated.size === 0) return nodes;
|
|
1229
|
+
return nodes.map((node) => updated.get(node.id) ?? node);
|
|
1230
|
+
}
|
|
1154
1231
|
function resizeHorizontalBpmnLanes(lanes, pool) {
|
|
1155
1232
|
const pad = BPMN_POOL_LANE_LAYOUT.poolPad;
|
|
1156
1233
|
const poolSize = getBpmnNodeSize(pool);
|
|
@@ -2011,6 +2088,7 @@ exports.getBpmnPoolLanes = getBpmnPoolLanes;
|
|
|
2011
2088
|
exports.getBpmnPoolOrientation = getBpmnPoolOrientation;
|
|
2012
2089
|
exports.getBpmnTabOrder = getBpmnTabOrder;
|
|
2013
2090
|
exports.groupAsBpmnSubProcessCommand = groupAsBpmnSubProcessCommand;
|
|
2091
|
+
exports.growBpmnContainersToFit = growBpmnContainersToFit;
|
|
2014
2092
|
exports.inferBpmnEdgeType = inferBpmnEdgeType;
|
|
2015
2093
|
exports.isBpmnDroppableInContainer = isBpmnDroppableInContainer;
|
|
2016
2094
|
exports.isBpmnEdgeRoutingEditable = isBpmnEdgeRoutingEditable;
|