bpmn-js 15.1.3 → 15.2.0

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) {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * bpmn-js - bpmn-modeler v15.1.3
2
+ * bpmn-js - bpmn-modeler v15.2.0
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: 2023-11-07
11
+ * Date: 2023-11-21
12
12
  */
13
13
  (function (global, factory) {
14
14
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -22648,15 +22648,20 @@
22648
22648
 
22649
22649
  var self = this;
22650
22650
 
22651
- function createOutline(gfx, element) {
22651
+ /**
22652
+ * @param {SVGElement} gfx
22653
+ *
22654
+ * @return {SVGElement} outline
22655
+ */
22656
+ function createOutline(gfx) {
22652
22657
  var outline = create$1('rect');
22653
22658
 
22654
22659
  attr(outline, assign$1({
22655
- x: - self.offset,
22656
- y: - self.offset,
22660
+ x: 0,
22661
+ y: 0,
22657
22662
  rx: 4,
22658
- width: element.width + self.offset * 2,
22659
- height: element.height + self.offset * 2
22663
+ width: 100,
22664
+ height: 100
22660
22665
  }, OUTLINE_STYLE));
22661
22666
 
22662
22667
  return outline;
@@ -22671,12 +22676,11 @@
22671
22676
  var outline = query('.djs-outline', gfx);
22672
22677
 
22673
22678
  if (!outline) {
22674
- outline = self.getOutline(element) || createOutline(gfx, element);
22679
+ outline = self.getOutline(element) || createOutline();
22675
22680
  append(gfx, outline);
22676
-
22677
- } else {
22678
- self.updateShapeOutline(outline, element);
22679
22681
  }
22682
+
22683
+ self.updateShapeOutline(outline, element);
22680
22684
  });
22681
22685
 
22682
22686
  eventBus.on([ 'connection.added', 'connection.changed' ], function(event) {
@@ -22686,7 +22690,7 @@
22686
22690
  var outline = query('.djs-outline', gfx);
22687
22691
 
22688
22692
  if (!outline) {
22689
- outline = createOutline(gfx, element);
22693
+ outline = createOutline();
22690
22694
  append(gfx, outline);
22691
22695
  }
22692
22696
 
@@ -22730,7 +22734,7 @@
22730
22734
  *
22731
22735
  * @param {SVGElement} outline
22732
22736
  * @param {Element} connection
22733
- **/
22737
+ */
22734
22738
  Outline.prototype.updateConnectionOutline = function(outline, connection) {
22735
22739
  var bbox = getBBox(connection);
22736
22740
 
@@ -30047,12 +30051,20 @@
30047
30051
  /**
30048
30052
  * Get contex pad position.
30049
30053
  *
30054
+ * If target is a connection, the context pad will be placed according to the
30055
+ * connection's last waypoint.
30056
+ *
30057
+ * If multiple targets, the context pad will be placed according to the bounding
30058
+ * box containing all targets.
30059
+ *
30050
30060
  * @param {ContextPadTarget} target
30051
30061
  *
30052
30062
  * @return {Rect}
30053
30063
  */
30054
30064
  ContextPad.prototype._getPosition = function(target) {
30055
30065
 
30066
+ target = isConnection(target) ? getLastWaypoint(target) : target;
30067
+
30056
30068
  var elements = isArray$3(target) ? target : [ target ];
30057
30069
  var bBox = getBBox(elements);
30058
30070
 
@@ -30087,6 +30099,10 @@
30087
30099
  return array.indexOf(item) !== -1;
30088
30100
  }
30089
30101
 
30102
+ function getLastWaypoint(connection) {
30103
+ return connection.waypoints[connection.waypoints.length - 1];
30104
+ }
30105
+
30090
30106
  /**
30091
30107
  * @type { import('didi').ModuleDeclaration }
30092
30108
  */
@@ -63433,6 +63449,19 @@
63433
63449
  height: element.height + DEFAULT_OFFSET * 2
63434
63450
  }, OUTLINE_STYLE));
63435
63451
 
63452
+ } else if (is$1(element, 'bpmn:EndEvent')) {
63453
+
63454
+ outline = create$1('circle');
63455
+
63456
+ // Extra 1px offset needed due to increased stroke-width of end event
63457
+ // which makes it bigger than other events.
63458
+
63459
+ attr(outline, assign$1({
63460
+ cx: element.width / 2,
63461
+ cy: element.height / 2,
63462
+ r: element.width / 2 + DEFAULT_OFFSET + 1
63463
+ }, OUTLINE_STYLE));
63464
+
63436
63465
  } else if (is$1(element, 'bpmn:Event')) {
63437
63466
  outline = create$1('circle');
63438
63467