camunda-bpmn-js 3.7.0 → 3.9.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.
@@ -40,7 +40,6 @@
40
40
  --context-pad-entry-hover-background-color: var(--color-grey-225-10-95);
41
41
 
42
42
  --element-dragger-color: var(--color-blue-205-100-50);
43
- --element-dragging-color: var(--color-grey-225-10-75);
44
43
  --element-hover-outline-fill-color: var(--color-blue-205-100-45);
45
44
  --element-selected-outline-stroke-color: var(--color-blue-205-100-50);
46
45
  --element-selected-outline-secondary-stroke-color: var(--color-blue-205-100-70);
@@ -283,40 +282,10 @@ marker.djs-dragger tspan {
283
282
 
284
283
  .djs-dragging,
285
284
  .djs-dragging > * {
285
+ opacity: 0.3 !important;
286
286
  pointer-events: none !important;
287
287
  }
288
288
 
289
- .djs-dragging .djs-context-pad,
290
- .djs-dragging .djs-outline {
291
- display: none !important;
292
- }
293
-
294
- .djs-dragging * {
295
- fill: none !important;
296
- stroke: var(--element-dragging-color) !important;
297
- }
298
-
299
- .djs-dragging tspan,
300
- .djs-dragging text {
301
- fill: var(--element-dragging-color) !important;
302
- stroke: none !important;
303
- }
304
-
305
- marker.djs-dragging circle,
306
- marker.djs-dragging path,
307
- marker.djs-dragging polygon,
308
- marker.djs-dragging polyline,
309
- marker.djs-dragging rect {
310
- fill: var(--element-dragging-color) !important;
311
- stroke: none !important;
312
- }
313
-
314
- marker.djs-dragging text,
315
- marker.djs-dragging tspan {
316
- fill: none !important;
317
- stroke: var(--element-dragging-color) !important;
318
- }
319
-
320
289
  /**
321
290
  * no pointer events for visual
322
291
  */
@@ -22892,6 +22892,19 @@
22892
22892
  }
22893
22893
  });
22894
22894
 
22895
+ eventBus.on([ 'connection.added', 'connection.changed' ], function(event) {
22896
+ var element = event.element,
22897
+ gfx = event.gfx;
22898
+
22899
+ var outline = query('.djs-outline', gfx);
22900
+
22901
+ if (!outline) {
22902
+ outline = createOutline(gfx, element);
22903
+ append(gfx, outline);
22904
+ }
22905
+
22906
+ self.updateConnectionOutline(outline, element);
22907
+ });
22895
22908
  }
22896
22909
 
22897
22910
 
@@ -22923,6 +22936,25 @@
22923
22936
  }
22924
22937
  };
22925
22938
 
22939
+ /**
22940
+ * Updates the outline of a connection respecting the bounding box of
22941
+ * the connection and an outline offset.
22942
+ * Register an outline provider with the given priority.
22943
+ *
22944
+ * @param {SVGElement} outline
22945
+ * @param {Element} connection
22946
+ **/
22947
+ Outline.prototype.updateConnectionOutline = function(outline, connection) {
22948
+ var bbox = getBBox(connection);
22949
+
22950
+ attr(outline, {
22951
+ x: bbox.x - this.offset,
22952
+ y: bbox.y - this.offset,
22953
+ width: bbox.width + this.offset * 2,
22954
+ height: bbox.height + this.offset * 2
22955
+ });
22956
+ };
22957
+
22926
22958
  /**
22927
22959
  * Register an outline provider with the given priority.
22928
22960
  *
@@ -30163,6 +30195,8 @@
30163
30195
  return;
30164
30196
  }
30165
30197
 
30198
+ clearTimeout(this._timeout);
30199
+
30166
30200
  this._overlays.remove(this._overlayId);
30167
30201
 
30168
30202
  this._overlayId = null;
@@ -40890,6 +40924,73 @@
40890
40924
  };
40891
40925
  }
40892
40926
 
40927
+ const NON_INTERRUPTING_EVENT_TYPES = [
40928
+ 'bpmn:MessageEventDefinition',
40929
+ 'bpmn:TimerEventDefinition',
40930
+ 'bpmn:EscalationEventDefinition',
40931
+ 'bpmn:ConditionalEventDefinition',
40932
+ 'bpmn:SignalEventDefinition'
40933
+ ];
40934
+
40935
+ function canBeNonInterrupting(shape) {
40936
+
40937
+ const businessObject = getBusinessObject$1(shape);
40938
+
40939
+ if (
40940
+ !is$5(businessObject, 'bpmn:BoundaryEvent') &&
40941
+ !(is$5(businessObject, 'bpmn:StartEvent') && isEventSubProcess(businessObject.$parent))
40942
+ ) {
40943
+ return false;
40944
+ }
40945
+
40946
+ const eventDefinitions = businessObject.get('eventDefinitions');
40947
+ if (!eventDefinitions || !eventDefinitions.length) {
40948
+ return false;
40949
+ }
40950
+
40951
+ return NON_INTERRUPTING_EVENT_TYPES.some(event => is$5(eventDefinitions[0], event));
40952
+ }
40953
+
40954
+ function getInterruptingProperty(shape) {
40955
+ return is$5(shape, 'bpmn:BoundaryEvent') ? 'cancelActivity' : 'isInterrupting';
40956
+ }
40957
+
40958
+ function NonInterruptingBehavior(injector, modeling) {
40959
+ injector.invoke(CommandInterceptor, this);
40960
+
40961
+ this.postExecuted('shape.replace', function(event) {
40962
+ const oldShape = event.context.oldShape;
40963
+ const newShape = event.context.newShape;
40964
+ const hints = event.context.hints;
40965
+
40966
+ if (!canBeNonInterrupting(newShape)) {
40967
+ return;
40968
+ }
40969
+
40970
+ const property = getInterruptingProperty(newShape);
40971
+ const isExplicitChange = hints.targetElement && hints.targetElement[property] !== undefined;
40972
+
40973
+ if (isExplicitChange) {
40974
+ return;
40975
+ }
40976
+
40977
+ const isOldInterrupting = getBusinessObject$1(oldShape).get(property);
40978
+ const isNewInterruptingDefault = getBusinessObject$1(newShape).get(property);
40979
+
40980
+ if (isOldInterrupting === isNewInterruptingDefault) {
40981
+ return;
40982
+ }
40983
+
40984
+ modeling.updateProperties(newShape, {
40985
+ [property]: isOldInterrupting
40986
+ });
40987
+ });
40988
+ }
40989
+
40990
+ NonInterruptingBehavior.$inject = [ 'injector', 'modeling' ];
40991
+
40992
+ e$5(NonInterruptingBehavior, CommandInterceptor);
40993
+
40893
40994
  /**
40894
40995
  * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
40895
40996
  * @typedef {import('../Modeling').default} Modeling
@@ -43078,6 +43179,7 @@
43078
43179
  'labelBehavior',
43079
43180
  'layoutConnectionBehavior',
43080
43181
  'messageFlowBehavior',
43182
+ 'nonInterruptingBehavior',
43081
43183
  'removeElementBehavior',
43082
43184
  'removeEmbeddedLabelBoundsBehavior',
43083
43185
  'removeParticipantBehavior',
@@ -43116,6 +43218,7 @@
43116
43218
  labelBehavior: [ 'type', LabelBehavior ],
43117
43219
  layoutConnectionBehavior: [ 'type', LayoutConnectionBehavior ],
43118
43220
  messageFlowBehavior: [ 'type', MessageFlowBehavior ],
43221
+ nonInterruptingBehavior: [ 'type', NonInterruptingBehavior ],
43119
43222
  removeElementBehavior: [ 'type', RemoveElementBehavior ],
43120
43223
  removeEmbeddedLabelBoundsBehavior: [ 'type', RemoveEmbeddedLabelBoundsBehavior ],
43121
43224
  removeParticipantBehavior: [ 'type', RemoveParticipantBehavior ],
@@ -46683,7 +46786,7 @@
46683
46786
  newElement.x = element.x + (element.width - newElement.width) / 2;
46684
46787
  }
46685
46788
 
46686
- return replace.replaceElement(element, newElement, hints);
46789
+ return replace.replaceElement(element, newElement, { ...hints, targetElement });
46687
46790
  }
46688
46791
 
46689
46792
  this.replaceElement = replaceElement;
@@ -57498,7 +57601,8 @@
57498
57601
  className: 'bpmn-icon-intermediate-event-catch-message',
57499
57602
  target: {
57500
57603
  type: 'bpmn:BoundaryEvent',
57501
- eventDefinitionType: 'bpmn:MessageEventDefinition'
57604
+ eventDefinitionType: 'bpmn:MessageEventDefinition',
57605
+ cancelActivity: true
57502
57606
  }
57503
57607
  },
57504
57608
  {
@@ -57507,7 +57611,8 @@
57507
57611
  className: 'bpmn-icon-intermediate-event-catch-timer',
57508
57612
  target: {
57509
57613
  type: 'bpmn:BoundaryEvent',
57510
- eventDefinitionType: 'bpmn:TimerEventDefinition'
57614
+ eventDefinitionType: 'bpmn:TimerEventDefinition',
57615
+ cancelActivity: true
57511
57616
  }
57512
57617
  },
57513
57618
  {
@@ -57516,7 +57621,8 @@
57516
57621
  className: 'bpmn-icon-intermediate-event-catch-escalation',
57517
57622
  target: {
57518
57623
  type: 'bpmn:BoundaryEvent',
57519
- eventDefinitionType: 'bpmn:EscalationEventDefinition'
57624
+ eventDefinitionType: 'bpmn:EscalationEventDefinition',
57625
+ cancelActivity: true
57520
57626
  }
57521
57627
  },
57522
57628
  {
@@ -57525,7 +57631,8 @@
57525
57631
  className: 'bpmn-icon-intermediate-event-catch-condition',
57526
57632
  target: {
57527
57633
  type: 'bpmn:BoundaryEvent',
57528
- eventDefinitionType: 'bpmn:ConditionalEventDefinition'
57634
+ eventDefinitionType: 'bpmn:ConditionalEventDefinition',
57635
+ cancelActivity: true
57529
57636
  }
57530
57637
  },
57531
57638
  {
@@ -57534,7 +57641,8 @@
57534
57641
  className: 'bpmn-icon-intermediate-event-catch-error',
57535
57642
  target: {
57536
57643
  type: 'bpmn:BoundaryEvent',
57537
- eventDefinitionType: 'bpmn:ErrorEventDefinition'
57644
+ eventDefinitionType: 'bpmn:ErrorEventDefinition',
57645
+ cancelActivity: true
57538
57646
  }
57539
57647
  },
57540
57648
  {
@@ -57543,7 +57651,8 @@
57543
57651
  className: 'bpmn-icon-intermediate-event-catch-cancel',
57544
57652
  target: {
57545
57653
  type: 'bpmn:BoundaryEvent',
57546
- eventDefinitionType: 'bpmn:CancelEventDefinition'
57654
+ eventDefinitionType: 'bpmn:CancelEventDefinition',
57655
+ cancelActivity: true
57547
57656
  }
57548
57657
  },
57549
57658
  {
@@ -57552,7 +57661,8 @@
57552
57661
  className: 'bpmn-icon-intermediate-event-catch-signal',
57553
57662
  target: {
57554
57663
  type: 'bpmn:BoundaryEvent',
57555
- eventDefinitionType: 'bpmn:SignalEventDefinition'
57664
+ eventDefinitionType: 'bpmn:SignalEventDefinition',
57665
+ cancelActivity: true
57556
57666
  }
57557
57667
  },
57558
57668
  {
@@ -57561,7 +57671,8 @@
57561
57671
  className: 'bpmn-icon-intermediate-event-catch-compensation',
57562
57672
  target: {
57563
57673
  type: 'bpmn:BoundaryEvent',
57564
- eventDefinitionType: 'bpmn:CompensateEventDefinition'
57674
+ eventDefinitionType: 'bpmn:CompensateEventDefinition',
57675
+ cancelActivity: true
57565
57676
  }
57566
57677
  },
57567
57678
  {
@@ -57626,7 +57737,8 @@
57626
57737
  className: 'bpmn-icon-start-event-message',
57627
57738
  target: {
57628
57739
  type: 'bpmn:StartEvent',
57629
- eventDefinitionType: 'bpmn:MessageEventDefinition'
57740
+ eventDefinitionType: 'bpmn:MessageEventDefinition',
57741
+ isInterrupting: true
57630
57742
  }
57631
57743
  },
57632
57744
  {
@@ -57635,7 +57747,8 @@
57635
57747
  className: 'bpmn-icon-start-event-timer',
57636
57748
  target: {
57637
57749
  type: 'bpmn:StartEvent',
57638
- eventDefinitionType: 'bpmn:TimerEventDefinition'
57750
+ eventDefinitionType: 'bpmn:TimerEventDefinition',
57751
+ isInterrupting: true
57639
57752
  }
57640
57753
  },
57641
57754
  {
@@ -57644,7 +57757,8 @@
57644
57757
  className: 'bpmn-icon-start-event-condition',
57645
57758
  target: {
57646
57759
  type: 'bpmn:StartEvent',
57647
- eventDefinitionType: 'bpmn:ConditionalEventDefinition'
57760
+ eventDefinitionType: 'bpmn:ConditionalEventDefinition',
57761
+ isInterrupting: true
57648
57762
  }
57649
57763
  },
57650
57764
  {
@@ -57653,7 +57767,8 @@
57653
57767
  className: 'bpmn-icon-start-event-signal',
57654
57768
  target: {
57655
57769
  type: 'bpmn:StartEvent',
57656
- eventDefinitionType: 'bpmn:SignalEventDefinition'
57770
+ eventDefinitionType: 'bpmn:SignalEventDefinition',
57771
+ isInterrupting: true
57657
57772
  }
57658
57773
  },
57659
57774
  {
@@ -57662,7 +57777,8 @@
57662
57777
  className: 'bpmn-icon-start-event-error',
57663
57778
  target: {
57664
57779
  type: 'bpmn:StartEvent',
57665
- eventDefinitionType: 'bpmn:ErrorEventDefinition'
57780
+ eventDefinitionType: 'bpmn:ErrorEventDefinition',
57781
+ isInterrupting: true
57666
57782
  }
57667
57783
  },
57668
57784
  {
@@ -57671,7 +57787,8 @@
57671
57787
  className: 'bpmn-icon-start-event-escalation',
57672
57788
  target: {
57673
57789
  type: 'bpmn:StartEvent',
57674
- eventDefinitionType: 'bpmn:EscalationEventDefinition'
57790
+ eventDefinitionType: 'bpmn:EscalationEventDefinition',
57791
+ isInterrupting: true
57675
57792
  }
57676
57793
  },
57677
57794
  {
@@ -57680,7 +57797,8 @@
57680
57797
  className: 'bpmn-icon-start-event-compensation',
57681
57798
  target: {
57682
57799
  type: 'bpmn:StartEvent',
57683
- eventDefinitionType: 'bpmn:CompensateEventDefinition'
57800
+ eventDefinitionType: 'bpmn:CompensateEventDefinition',
57801
+ isInterrupting: true
57684
57802
  }
57685
57803
  },
57686
57804
  {
@@ -57790,6 +57908,22 @@
57790
57908
  }
57791
57909
  ];
57792
57910
 
57911
+ var Icons = {
57912
+ 'start-event-non-interrupting': `
57913
+ <svg viewBox="0 0 2048 2048" xmlns="http://www.w3.org/2000/svg">
57914
+ <g transform="translate(0 995.64)">
57915
+ <path d="m1899 28.357c21.545 567.43-598.38 1023.5-1133.6 835.92-548.09-147.21-801.57-873.95-463.59-1330 302.62-480.3 1071.7-507.54 1407.6-49.847 122.14 153.12 190.07 348.07 189.59 543.91z" fill="none" stroke="currentColor" stroke-dasharray="418.310422, 361.2328165" stroke-linecap="round" stroke-width="100"/>
57916
+ </g>
57917
+ </svg>`,
57918
+ 'intermediate-event-non-interrupting': `
57919
+ <svg viewBox="0 0 2048 2048" xmlns="http://www.w3.org/2000/svg">
57920
+ <g transform="translate(0 995.64)" fill="none" stroke="currentColor" stroke-linecap="round">
57921
+ <circle cx="1024" cy="28.357" r="875" stroke-dasharray="418.310422, 361.2328165" stroke-width="100"/>
57922
+ <circle cx="1024" cy="28.357" r="685" stroke-dasharray="348.31044857,261.23283643" stroke-dashoffset="500" stroke-width="100"/>
57923
+ </g>
57924
+ </svg>`
57925
+ };
57926
+
57793
57927
  /**
57794
57928
  * @typedef {import('../modeling/BpmnFactory').default} BpmnFactory
57795
57929
  * @typedef {import('diagram-js/lib/features/popup-menu/PopupMenu').default} PopupMenu
@@ -58085,6 +58219,13 @@
58085
58219
  };
58086
58220
  }
58087
58221
 
58222
+ if (canBeNonInterrupting(target)) {
58223
+ headerEntries = {
58224
+ ...headerEntries,
58225
+ ...this._getNonInterruptingHeaderEntries(target)
58226
+ };
58227
+ }
58228
+
58088
58229
  return headerEntries;
58089
58230
  };
58090
58231
 
@@ -58414,6 +58555,32 @@
58414
58555
  };
58415
58556
  };
58416
58557
 
58558
+
58559
+ ReplaceMenuProvider.prototype._getNonInterruptingHeaderEntries = function(element) {
58560
+ const translate = this._translate;
58561
+ const businessObject = getBusinessObject$1(element);
58562
+ const self = this;
58563
+
58564
+ const interruptingProperty = getInterruptingProperty(element);
58565
+
58566
+ const icon = is$5(element, 'bpmn:BoundaryEvent') ? Icons['intermediate-event-non-interrupting'] : Icons['start-event-non-interrupting'];
58567
+
58568
+ const isNonInterrupting = !businessObject[interruptingProperty];
58569
+
58570
+ return {
58571
+ 'toggle-non-interrupting': {
58572
+ imageHtml: icon,
58573
+ title: translate('Toggle Non-Interrupting'),
58574
+ active: isNonInterrupting,
58575
+ action: function() {
58576
+ self._modeling.updateProperties(element, {
58577
+ [interruptingProperty]: !!isNonInterrupting
58578
+ });
58579
+ }
58580
+ }
58581
+ };
58582
+ };
58583
+
58417
58584
  var PopupMenuModule = {
58418
58585
  __depends__: [
58419
58586
  PopupMenuModule$1,
@@ -63520,6 +63687,10 @@
63520
63687
  */
63521
63688
  OutlineProvider.prototype.updateOutline = function(element, outline) {
63522
63689
 
63690
+ if (isLabel(element)) {
63691
+ return;
63692
+ }
63693
+
63523
63694
  if (isAny(element, [ 'bpmn:SubProcess', 'bpmn:Group' ])) {
63524
63695
 
63525
63696
  attr(outline, {
@@ -96235,18 +96406,29 @@
96235
96406
  }
96236
96407
  ];
96237
96408
 
96238
- const options = tags.map(tag => snippetCompletion(
96239
- tag.name.replace('()', '(#{1})'),
96240
- {
96241
- label: tag.name,
96242
- type: 'function',
96243
- info: () => {
96244
- const html = domify$1(`<div class="description">${tag.description}<div>`);
96245
- return html;
96246
- },
96247
- boost: -1
96248
- }
96249
- ));
96409
+ const options = tags.map(tag => {
96410
+ const match = tag.name.match(/^([\w\s]+)\((.*)\)$/);
96411
+ const functionName = match[1];
96412
+ const functionArguments = match[2];
96413
+
96414
+ const placeHolders = functionArguments
96415
+ .split(', ')
96416
+ .map((arg) => `\${${arg}}`)
96417
+ .join(', ');
96418
+
96419
+ return snippetCompletion(
96420
+ `${functionName}(${placeHolders})`,
96421
+ {
96422
+ label: tag.name,
96423
+ type: 'function',
96424
+ info: () => {
96425
+ const html = domify$1(`<div class="description">${tag.description}<div>`);
96426
+ return html;
96427
+ },
96428
+ boost: -1
96429
+ }
96430
+ );
96431
+ });
96250
96432
 
96251
96433
  var builtins = context => {
96252
96434