bpmn-js 18.3.2 → 18.5.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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * bpmn-js - bpmn-modeler v18.3.2
2
+ * bpmn-js - bpmn-modeler v18.5.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: 2025-03-17
11
+ * Date: 2025-04-16
12
12
  */
13
13
  (function (global, factory) {
14
14
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -16714,12 +16714,11 @@
16714
16714
 
16715
16715
  forEach$1(collaboration.participants, contextual(handleParticipant, context));
16716
16716
 
16717
- handleArtifacts(collaboration.artifacts, context);
16718
-
16719
- // handle message flows latest in the process
16720
16717
  deferred.push(function() {
16721
16718
  handleMessageFlows(collaboration.messageFlows, context);
16722
16719
  });
16720
+
16721
+ handleArtifacts(collaboration.artifacts, context);
16723
16722
  }
16724
16723
 
16725
16724
 
@@ -18984,8 +18983,8 @@
18984
18983
  var pathData = pathMap.getScaledPath('EVENT_MESSAGE', {
18985
18984
  xScaleFactor: 0.9,
18986
18985
  yScaleFactor: 0.9,
18987
- containerWidth: element.width,
18988
- containerHeight: element.height,
18986
+ containerWidth: attrs.width || element.width,
18987
+ containerHeight: attrs.height || element.height,
18989
18988
  position: {
18990
18989
  mx: 0.235,
18991
18990
  my: 0.315
@@ -19009,17 +19008,23 @@
19009
19008
  return messagePath;
19010
19009
  },
19011
19010
  'bpmn:TimerEventDefinition': function(parentGfx, element, attrs = {}) {
19012
- var circle = drawCircle(parentGfx, element.width, element.height, 0.2 * element.height, {
19011
+ var baseWidth = attrs.width || element.width;
19012
+ var baseHeight = attrs.height || element.height;
19013
+
19014
+ // use a lighter stroke for event suprocess icons
19015
+ var strokeWidth = attrs.width ? 1 : 2;
19016
+
19017
+ var circle = drawCircle(parentGfx, baseWidth, baseHeight, 0.2 * baseHeight, {
19013
19018
  fill: getFillColor(element, defaultFillColor, attrs.fill),
19014
19019
  stroke: getStrokeColor$1(element, defaultStrokeColor, attrs.stroke),
19015
- strokeWidth: 2
19020
+ strokeWidth: strokeWidth
19016
19021
  });
19017
19022
 
19018
19023
  var pathData = pathMap.getScaledPath('EVENT_TIMER_WH', {
19019
19024
  xScaleFactor: 0.75,
19020
19025
  yScaleFactor: 0.75,
19021
- containerWidth: element.width,
19022
- containerHeight: element.height,
19026
+ containerWidth: baseWidth,
19027
+ containerHeight: baseHeight,
19023
19028
  position: {
19024
19029
  mx: 0.5,
19025
19030
  my: 0.5
@@ -19028,23 +19033,23 @@
19028
19033
 
19029
19034
  drawPath(parentGfx, pathData, {
19030
19035
  stroke: getStrokeColor$1(element, defaultStrokeColor, attrs.stroke),
19031
- strokeWidth: 2
19036
+ strokeWidth: strokeWidth
19032
19037
  });
19033
19038
 
19034
19039
  for (var i = 0; i < 12; i++) {
19035
19040
  var linePathData = pathMap.getScaledPath('EVENT_TIMER_LINE', {
19036
19041
  xScaleFactor: 0.75,
19037
19042
  yScaleFactor: 0.75,
19038
- containerWidth: element.width,
19039
- containerHeight: element.height,
19043
+ containerWidth: baseWidth,
19044
+ containerHeight: baseHeight,
19040
19045
  position: {
19041
19046
  mx: 0.5,
19042
19047
  my: 0.5
19043
19048
  }
19044
19049
  });
19045
19050
 
19046
- var width = element.width / 2,
19047
- height = element.height / 2;
19051
+ var width = baseWidth / 2,
19052
+ height = baseHeight / 2;
19048
19053
 
19049
19054
  drawPath(parentGfx, linePathData, {
19050
19055
  strokeWidth: 1,
@@ -19059,8 +19064,8 @@
19059
19064
  var pathData = pathMap.getScaledPath('EVENT_ESCALATION', {
19060
19065
  xScaleFactor: 1,
19061
19066
  yScaleFactor: 1,
19062
- containerWidth: event.width,
19063
- containerHeight: event.height,
19067
+ containerWidth: attrs.width || event.width,
19068
+ containerHeight: attrs.height || event.height,
19064
19069
  position: {
19065
19070
  mx: 0.5,
19066
19071
  my: 0.2
@@ -19081,8 +19086,8 @@
19081
19086
  var pathData = pathMap.getScaledPath('EVENT_CONDITIONAL', {
19082
19087
  xScaleFactor: 1,
19083
19088
  yScaleFactor: 1,
19084
- containerWidth: event.width,
19085
- containerHeight: event.height,
19089
+ containerWidth: attrs.width || event.width,
19090
+ containerHeight: attrs.height || event.height,
19086
19091
  position: {
19087
19092
  mx: 0.5,
19088
19093
  my: 0.222
@@ -19121,8 +19126,8 @@
19121
19126
  var pathData = pathMap.getScaledPath('EVENT_ERROR', {
19122
19127
  xScaleFactor: 1.1,
19123
19128
  yScaleFactor: 1.1,
19124
- containerWidth: event.width,
19125
- containerHeight: event.height,
19129
+ containerWidth: attrs.width || event.width,
19130
+ containerHeight: attrs.height || event.height,
19126
19131
  position: {
19127
19132
  mx: 0.2,
19128
19133
  my: 0.722
@@ -19167,8 +19172,8 @@
19167
19172
  var pathData = pathMap.getScaledPath('EVENT_COMPENSATION', {
19168
19173
  xScaleFactor: 1,
19169
19174
  yScaleFactor: 1,
19170
- containerWidth: event.width,
19171
- containerHeight: event.height,
19175
+ containerWidth: attrs.width || event.width,
19176
+ containerHeight: attrs.height || event.height,
19172
19177
  position: {
19173
19178
  mx: 0.22,
19174
19179
  my: 0.5
@@ -19189,8 +19194,8 @@
19189
19194
  var pathData = pathMap.getScaledPath('EVENT_SIGNAL', {
19190
19195
  xScaleFactor: 0.9,
19191
19196
  yScaleFactor: 0.9,
19192
- containerWidth: event.width,
19193
- containerHeight: event.height,
19197
+ containerWidth: attrs.width || event.width,
19198
+ containerHeight: attrs.height || event.height,
19194
19199
  position: {
19195
19200
  mx: 0.5,
19196
19201
  my: 0.2
@@ -19211,10 +19216,10 @@
19211
19216
  var pathData = pathMap.getScaledPath('EVENT_MULTIPLE', {
19212
19217
  xScaleFactor: 1.1,
19213
19218
  yScaleFactor: 1.1,
19214
- containerWidth: event.width,
19215
- containerHeight: event.height,
19219
+ containerWidth: attrs.width || event.width,
19220
+ containerHeight: attrs.height || event.height,
19216
19221
  position: {
19217
- mx: 0.222,
19222
+ mx: 0.211,
19218
19223
  my: 0.36
19219
19224
  }
19220
19225
  });
@@ -19225,6 +19230,7 @@
19225
19230
 
19226
19231
  return drawPath(parentGfx, pathData, {
19227
19232
  fill,
19233
+ stroke: getStrokeColor$1(event, defaultStrokeColor, attrs.stroke),
19228
19234
  strokeWidth: 1
19229
19235
  });
19230
19236
  },
@@ -19232,8 +19238,8 @@
19232
19238
  var pathData = pathMap.getScaledPath('EVENT_PARALLEL_MULTIPLE', {
19233
19239
  xScaleFactor: 1.2,
19234
19240
  yScaleFactor: 1.2,
19235
- containerWidth: event.width,
19236
- containerHeight: event.height,
19241
+ containerWidth: attrs.width || event.width,
19242
+ containerHeight: attrs.height || event.height,
19237
19243
  position: {
19238
19244
  mx: 0.458,
19239
19245
  my: 0.194
@@ -19257,57 +19263,59 @@
19257
19263
  }
19258
19264
  };
19259
19265
 
19260
- function renderEventIcon(element, parentGfx, attrs = {}) {
19266
+ function renderEventIcon(element, parentGfx, attrs = {}, proxyElement) {
19261
19267
  var semantic = getBusinessObject(element),
19262
19268
  isThrowing = isThrowEvent(semantic);
19263
19269
 
19270
+ var nodeElement = proxyElement || element;
19271
+
19264
19272
  if (semantic.get('eventDefinitions') && semantic.get('eventDefinitions').length > 1) {
19265
19273
  if (semantic.get('parallelMultiple')) {
19266
- return eventIconRenderers[ 'bpmn:ParallelMultipleEventDefinition' ](parentGfx, element, attrs, isThrowing);
19274
+ return eventIconRenderers[ 'bpmn:ParallelMultipleEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
19267
19275
  }
19268
19276
  else {
19269
- return eventIconRenderers[ 'bpmn:MultipleEventDefinition' ](parentGfx, element, attrs, isThrowing);
19277
+ return eventIconRenderers[ 'bpmn:MultipleEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
19270
19278
  }
19271
19279
  }
19272
19280
 
19273
19281
  if (isTypedEvent(semantic, 'bpmn:MessageEventDefinition')) {
19274
- return eventIconRenderers[ 'bpmn:MessageEventDefinition' ](parentGfx, element, attrs, isThrowing);
19282
+ return eventIconRenderers[ 'bpmn:MessageEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
19275
19283
  }
19276
19284
 
19277
19285
  if (isTypedEvent(semantic, 'bpmn:TimerEventDefinition')) {
19278
- return eventIconRenderers[ 'bpmn:TimerEventDefinition' ](parentGfx, element, attrs, isThrowing);
19286
+ return eventIconRenderers[ 'bpmn:TimerEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
19279
19287
  }
19280
19288
 
19281
19289
  if (isTypedEvent(semantic, 'bpmn:ConditionalEventDefinition')) {
19282
- return eventIconRenderers[ 'bpmn:ConditionalEventDefinition' ](parentGfx, element, attrs, isThrowing);
19290
+ return eventIconRenderers[ 'bpmn:ConditionalEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
19283
19291
  }
19284
19292
 
19285
19293
  if (isTypedEvent(semantic, 'bpmn:SignalEventDefinition')) {
19286
- return eventIconRenderers[ 'bpmn:SignalEventDefinition' ](parentGfx, element, attrs, isThrowing);
19294
+ return eventIconRenderers[ 'bpmn:SignalEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
19287
19295
  }
19288
19296
 
19289
19297
  if (isTypedEvent(semantic, 'bpmn:EscalationEventDefinition')) {
19290
- return eventIconRenderers[ 'bpmn:EscalationEventDefinition' ](parentGfx, element, attrs, isThrowing);
19298
+ return eventIconRenderers[ 'bpmn:EscalationEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
19291
19299
  }
19292
19300
 
19293
19301
  if (isTypedEvent(semantic, 'bpmn:LinkEventDefinition')) {
19294
- return eventIconRenderers[ 'bpmn:LinkEventDefinition' ](parentGfx, element, attrs, isThrowing);
19302
+ return eventIconRenderers[ 'bpmn:LinkEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
19295
19303
  }
19296
19304
 
19297
19305
  if (isTypedEvent(semantic, 'bpmn:ErrorEventDefinition')) {
19298
- return eventIconRenderers[ 'bpmn:ErrorEventDefinition' ](parentGfx, element, attrs, isThrowing);
19306
+ return eventIconRenderers[ 'bpmn:ErrorEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
19299
19307
  }
19300
19308
 
19301
19309
  if (isTypedEvent(semantic, 'bpmn:CancelEventDefinition')) {
19302
- return eventIconRenderers[ 'bpmn:CancelEventDefinition' ](parentGfx, element, attrs, isThrowing);
19310
+ return eventIconRenderers[ 'bpmn:CancelEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
19303
19311
  }
19304
19312
 
19305
19313
  if (isTypedEvent(semantic, 'bpmn:CompensateEventDefinition')) {
19306
- return eventIconRenderers[ 'bpmn:CompensateEventDefinition' ](parentGfx, element, attrs, isThrowing);
19314
+ return eventIconRenderers[ 'bpmn:CompensateEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
19307
19315
  }
19308
19316
 
19309
19317
  if (isTypedEvent(semantic, 'bpmn:TerminateEventDefinition')) {
19310
- return eventIconRenderers[ 'bpmn:TerminateEventDefinition' ](parentGfx, element, attrs, isThrowing);
19318
+ return eventIconRenderers[ 'bpmn:TerminateEventDefinition' ](parentGfx, nodeElement, attrs, isThrowing);
19311
19319
  }
19312
19320
 
19313
19321
  return null;
@@ -19729,14 +19737,23 @@
19729
19737
  function renderSubProcess(parentGfx, element, attrs = {}) {
19730
19738
  var activity = renderActivity(parentGfx, element, attrs);
19731
19739
 
19740
+ var expanded = isExpanded(element);
19741
+
19732
19742
  if (isEventSubProcess(element)) {
19733
19743
  attr(activity, {
19734
19744
  strokeDasharray: '0, 5.5',
19735
19745
  strokeWidth: 2.5
19736
19746
  });
19737
- }
19738
19747
 
19739
- var expanded = isExpanded(element);
19748
+ if (!expanded) {
19749
+ var flowElements = getBusinessObject(element).flowElements || [];
19750
+ var startEvents = flowElements.filter(e => is$1(e, 'bpmn:StartEvent'));
19751
+
19752
+ if (startEvents.length === 1) {
19753
+ renderEventSubProcessIcon(startEvents[0], parentGfx, attrs, element);
19754
+ }
19755
+ }
19756
+ }
19740
19757
 
19741
19758
  renderEmbeddedLabel(parentGfx, element, expanded ? 'center-top' : 'center-middle', attrs);
19742
19759
 
@@ -19749,6 +19766,39 @@
19749
19766
  return activity;
19750
19767
  }
19751
19768
 
19769
+ function renderEventSubProcessIcon(startEvent, parentGfx, attrs, proxyElement) {
19770
+ var iconSize = 22;
19771
+
19772
+ // match the colors of the enclosing subprocess
19773
+ var proxyAttrs = {
19774
+ fill: getFillColor(proxyElement, defaultFillColor, attrs.fill),
19775
+ stroke: getStrokeColor$1(proxyElement, defaultStrokeColor, attrs.stroke),
19776
+ width: iconSize,
19777
+ height: iconSize
19778
+ };
19779
+
19780
+ var interrupting = getBusinessObject(startEvent).isInterrupting;
19781
+ var strokeDasharray = interrupting ? 0 : 3;
19782
+
19783
+ // better visibility for non-interrupting events
19784
+ var strokeWidth = interrupting ? 1 : 1.2;
19785
+
19786
+ // make the icon look larger by drawing a smaller circle
19787
+ var circleSize = 20;
19788
+ var shift = (iconSize - circleSize) / 2;
19789
+ var transform = 'translate(' + shift + ',' + shift + ')';
19790
+
19791
+ drawCircle(parentGfx, circleSize, circleSize, {
19792
+ fill: proxyAttrs.fill,
19793
+ stroke: proxyAttrs.stroke,
19794
+ strokeWidth,
19795
+ strokeDasharray,
19796
+ transform
19797
+ });
19798
+
19799
+ renderEventIcon(startEvent, parentGfx, proxyAttrs, proxyElement);
19800
+ }
19801
+
19752
19802
  function renderTask(parentGfx, element, attrs = {}) {
19753
19803
  var activity = renderActivity(parentGfx, element, attrs);
19754
19804
 
@@ -57659,6 +57709,16 @@
57659
57709
  });
57660
57710
  }
57661
57711
 
57712
+ if (is$1(businessObject, 'bpmn:MessageFlow')) {
57713
+ assign$1(actions, {
57714
+ 'append.text-annotation': appendAction(
57715
+ 'bpmn:TextAnnotation',
57716
+ 'bpmn-icon-text-annotation',
57717
+ translate('Add text annotation')
57718
+ )
57719
+ });
57720
+ }
57721
+
57662
57722
  if (
57663
57723
  isAny(businessObject, [
57664
57724
  'bpmn:FlowNode',