bpmn-js 18.22.0 → 18.22.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.
@@ -153,6 +153,10 @@
153
153
  display: block;
154
154
  }
155
155
 
156
+ .djs-outline-hidden .djs-outline {
157
+ display: none !important;
158
+ }
159
+
156
160
  .djs-shape.connect-ok .djs-visual > :nth-child(1) {
157
161
  fill: var(--shape-connect-allowed-fill-color) !important;
158
162
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * bpmn-js - bpmn-modeler v18.22.0
2
+ * bpmn-js - bpmn-modeler v18.22.1
3
3
  *
4
4
  * Copyright (c) 2014-present, camunda Services GmbH
5
5
  *
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * Source Code: https://github.com/bpmn-io/bpmn-js
10
10
  *
11
- * Date: 2026-07-23
11
+ * Date: 2026-07-29
12
12
  */
13
13
  (function (global, factory) {
14
14
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -4544,6 +4544,17 @@
4544
4544
  return isObject(value) && has(value, 'labelTarget');
4545
4545
  }
4546
4546
 
4547
+ /**
4548
+ * Checks whether a value is an instance of Root.
4549
+ *
4550
+ * @param {any} value
4551
+ *
4552
+ * @return {boolean}
4553
+ */
4554
+ function isRoot(value) {
4555
+ return isObject(value) && isNil(value.parent);
4556
+ }
4557
+
4547
4558
  /**
4548
4559
  * @typedef {import('../core/Types.js').ElementLike} Element
4549
4560
  * @typedef {import('../core/Types.js').ConnectionLike} Connection
@@ -17087,6 +17098,23 @@
17087
17098
  * @see http://bpmn.io/license for more information.
17088
17099
  */
17089
17100
 
17101
+ /**
17102
+ * Padding added around the diagram bounds on SVG export.
17103
+ *
17104
+ * `getBBox` returns the geometry bounds only, excluding element strokes, so
17105
+ * without padding strokes at the diagram edges get clipped. Historically this
17106
+ * padding was provided implicitly by element outlines, which diagram-js now
17107
+ * creates lazily (diagram-js@15.19, bpmn-io/diagram-js#1064).
17108
+ */
17109
+ const EXPORT_PADDING = 5;
17110
+
17111
+ /**
17112
+ * Class set on the canvas container to hide element outlines, which diagram-js
17113
+ * excludes from rendering while present. Applied when measuring the export
17114
+ * bounds so lazily created outlines do not skew them.
17115
+ */
17116
+ const OUTLINE_HIDDEN_CLS = 'djs-outline-hidden';
17117
+
17090
17118
  /**
17091
17119
  * @template T
17092
17120
  *
@@ -17537,15 +17565,31 @@
17537
17565
  const contents = innerSVG(contentNode),
17538
17566
  defs = defsNode ? '<defs>' + innerSVG(defsNode) + '</defs>' : '';
17539
17567
 
17540
- const bbox = contentNode.getBBox();
17568
+ // hide outlines so they do not skew the measured bounds
17569
+ const container = canvas.getContainer();
17570
+
17571
+ classes$1(container).add(OUTLINE_HIDDEN_CLS);
17572
+
17573
+ let bbox;
17574
+
17575
+ try {
17576
+ bbox = contentNode.getBBox();
17577
+ } finally {
17578
+ classes$1(container).remove(OUTLINE_HIDDEN_CLS);
17579
+ }
17580
+
17581
+ const x = bbox.x - EXPORT_PADDING,
17582
+ y = bbox.y - EXPORT_PADDING,
17583
+ width = bbox.width + EXPORT_PADDING * 2,
17584
+ height = bbox.height + EXPORT_PADDING * 2;
17541
17585
 
17542
17586
  svg =
17543
17587
  '<?xml version="1.0" encoding="utf-8"?>\n' +
17544
17588
  '<!-- created with bpmn-js / http://bpmn.io -->\n' +
17545
17589
  '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n' +
17546
17590
  '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" ' +
17547
- 'width="' + bbox.width + '" height="' + bbox.height + '" ' +
17548
- 'viewBox="' + bbox.x + ' ' + bbox.y + ' ' + bbox.width + ' ' + bbox.height + '" version="1.1">' +
17591
+ 'width="' + width + '" height="' + height + '" ' +
17592
+ 'viewBox="' + x + ' ' + y + ' ' + width + ' ' + height + '" version="1.1">' +
17549
17593
  defs + contents +
17550
17594
  '</svg>';
17551
17595
  } catch (e) {
@@ -62350,6 +62394,13 @@
62350
62394
  * @param {Element} element
62351
62395
  */
62352
62396
  function createElementOutline(element) {
62397
+
62398
+ // root elements have no outline; creating one would append a never-updated
62399
+ // rect to the untransformed root layer, polluting getActiveLayer().getBBox()
62400
+ if (isRoot(element)) {
62401
+ return;
62402
+ }
62403
+
62353
62404
  self.createOutline(element);
62354
62405
  }
62355
62406