camunda-bpmn-js 3.9.0 → 3.10.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.
@@ -121,8 +121,13 @@
121
121
  stroke: var(--element-selected-outline-stroke-color);
122
122
  }
123
123
 
124
+ .djs-connection.selected .djs-outline {
125
+ display: none;
126
+ }
127
+
124
128
  .djs-multi-select .djs-element.selected .djs-outline {
125
129
  stroke: var(--element-selected-outline-secondary-stroke-color);
130
+ display: block;
126
131
  }
127
132
 
128
133
  .djs-shape.connect-ok .djs-visual > :nth-child(1) {
@@ -18467,7 +18467,7 @@
18467
18467
  /**
18468
18468
  * Get width and height from element or overrides.
18469
18469
  *
18470
- * @param {Dimensions|Rect|Shape} bounds
18470
+ * @param {Dimensions|Rect|ShapeLike} bounds
18471
18471
  * @param {Object} overrides
18472
18472
  *
18473
18473
  * @returns {Dimensions}
@@ -18482,7 +18482,7 @@
18482
18482
  /**
18483
18483
  * Get width from element or overrides.
18484
18484
  *
18485
- * @param {Dimensions|Rect|Shape} bounds
18485
+ * @param {Dimensions|Rect|ShapeLike} bounds
18486
18486
  * @param {Object} overrides
18487
18487
  *
18488
18488
  * @returns {number}
@@ -18494,7 +18494,7 @@
18494
18494
  /**
18495
18495
  * Get height from element or overrides.
18496
18496
  *
18497
- * @param {Dimensions|Rect|Shape} bounds
18497
+ * @param {Dimensions|Rect|ShapeLike} bounds
18498
18498
  * @param {Object} overrides
18499
18499
  *
18500
18500
  * @returns {number}
@@ -22861,15 +22861,20 @@
22861
22861
 
22862
22862
  var self = this;
22863
22863
 
22864
- function createOutline(gfx, element) {
22864
+ /**
22865
+ * @param {SVGElement} gfx
22866
+ *
22867
+ * @return {SVGElement} outline
22868
+ */
22869
+ function createOutline(gfx) {
22865
22870
  var outline = create$1('rect');
22866
22871
 
22867
22872
  attr(outline, assign$1({
22868
- x: - self.offset,
22869
- y: - self.offset,
22873
+ x: 0,
22874
+ y: 0,
22870
22875
  rx: 4,
22871
- width: element.width + self.offset * 2,
22872
- height: element.height + self.offset * 2
22876
+ width: 100,
22877
+ height: 100
22873
22878
  }, OUTLINE_STYLE));
22874
22879
 
22875
22880
  return outline;
@@ -22884,12 +22889,11 @@
22884
22889
  var outline = query('.djs-outline', gfx);
22885
22890
 
22886
22891
  if (!outline) {
22887
- outline = self.getOutline(element) || createOutline(gfx, element);
22892
+ outline = self.getOutline(element) || createOutline();
22888
22893
  append(gfx, outline);
22889
-
22890
- } else {
22891
- self.updateShapeOutline(outline, element);
22892
22894
  }
22895
+
22896
+ self.updateShapeOutline(outline, element);
22893
22897
  });
22894
22898
 
22895
22899
  eventBus.on([ 'connection.added', 'connection.changed' ], function(event) {
@@ -22899,7 +22903,7 @@
22899
22903
  var outline = query('.djs-outline', gfx);
22900
22904
 
22901
22905
  if (!outline) {
22902
- outline = createOutline(gfx, element);
22906
+ outline = createOutline();
22903
22907
  append(gfx, outline);
22904
22908
  }
22905
22909
 
@@ -22943,7 +22947,7 @@
22943
22947
  *
22944
22948
  * @param {SVGElement} outline
22945
22949
  * @param {Element} connection
22946
- **/
22950
+ */
22947
22951
  Outline.prototype.updateConnectionOutline = function(outline, connection) {
22948
22952
  var bbox = getBBox(connection);
22949
22953
 
@@ -30260,12 +30264,20 @@
30260
30264
  /**
30261
30265
  * Get contex pad position.
30262
30266
  *
30267
+ * If target is a connection, the context pad will be placed according to the
30268
+ * connection's last waypoint.
30269
+ *
30270
+ * If multiple targets, the context pad will be placed according to the bounding
30271
+ * box containing all targets.
30272
+ *
30263
30273
  * @param {ContextPadTarget} target
30264
30274
  *
30265
30275
  * @return {Rect}
30266
30276
  */
30267
30277
  ContextPad.prototype._getPosition = function(target) {
30268
30278
 
30279
+ target = isConnection$1(target) ? getLastWaypoint(target) : target;
30280
+
30269
30281
  var elements = isArray$3(target) ? target : [ target ];
30270
30282
  var bBox = getBBox(elements);
30271
30283
 
@@ -30300,6 +30312,10 @@
30300
30312
  return array.indexOf(item) !== -1;
30301
30313
  }
30302
30314
 
30315
+ function getLastWaypoint(connection) {
30316
+ return connection.waypoints[connection.waypoints.length - 1];
30317
+ }
30318
+
30303
30319
  /**
30304
30320
  * @type { import('didi').ModuleDeclaration }
30305
30321
  */
@@ -31138,6 +31154,11 @@
31138
31154
  top = position.y - containerBounds.height;
31139
31155
  }
31140
31156
 
31157
+ // underAxis
31158
+ if (position.y < documentBounds.top) {
31159
+ top = position.y + containerBounds.height;
31160
+ }
31161
+
31141
31162
  return {
31142
31163
  x: left,
31143
31164
  y: top
@@ -63648,6 +63669,19 @@
63648
63669
  height: element.height + DEFAULT_OFFSET * 2
63649
63670
  }, OUTLINE_STYLE));
63650
63671
 
63672
+ } else if (is$5(element, 'bpmn:EndEvent')) {
63673
+
63674
+ outline = create$1('circle');
63675
+
63676
+ // Extra 1px offset needed due to increased stroke-width of end event
63677
+ // which makes it bigger than other events.
63678
+
63679
+ attr(outline, assign$1({
63680
+ cx: element.width / 2,
63681
+ cy: element.height / 2,
63682
+ r: element.width / 2 + DEFAULT_OFFSET + 1
63683
+ }, OUTLINE_STYLE));
63684
+
63651
63685
  } else if (is$5(element, 'bpmn:Event')) {
63652
63686
  outline = create$1('circle');
63653
63687