camunda-bpmn-js 0.11.4 → 0.12.2

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.
Files changed (27) hide show
  1. package/CHANGELOG.md +22 -5
  2. package/dist/base-modeler.development.js +89 -1060
  3. package/dist/base-modeler.production.min.js +3 -3
  4. package/dist/camunda-cloud-modeler.development.js +734 -1570
  5. package/dist/camunda-cloud-modeler.production.min.js +3 -3
  6. package/dist/camunda-platform-modeler.development.js +291 -1354
  7. package/dist/camunda-platform-modeler.production.min.js +3 -3
  8. package/lib/camunda-cloud/features/modeling/behavior/CleanUpAssignmentDefinitionBehavior.js +78 -0
  9. package/lib/camunda-cloud/features/modeling/behavior/CleanUpBusinessRuleTaskBehavior.js +112 -0
  10. package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeBoundaryEventBehavior.js +51 -55
  11. package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeCallActivityBehavior.js +56 -59
  12. package/lib/camunda-cloud/features/modeling/behavior/FormDefinitionBehavior.js +69 -127
  13. package/lib/camunda-cloud/features/modeling/behavior/UpdatePropagateAllChildVariablesBehavior.js +76 -128
  14. package/lib/camunda-cloud/features/modeling/behavior/index.js +6 -0
  15. package/lib/camunda-cloud/features/properties-provider/parts/implementation/InputOutput.js +21 -7
  16. package/lib/camunda-cloud/features/rules/BpmnRules.js +1 -1
  17. package/lib/camunda-cloud/helper/CalledElementHelper.js +43 -41
  18. package/lib/camunda-cloud/helper/FormsHelper.js +38 -50
  19. package/lib/camunda-cloud/helper/InputOutputHelper.js +92 -106
  20. package/lib/camunda-platform/features/modeling/behavior/DeleteErrorEventDefinitionBehavior.js +24 -47
  21. package/lib/camunda-platform/features/modeling/behavior/DeleteRetryTimeCycleBehavior.js +39 -81
  22. package/lib/camunda-platform/features/modeling/behavior/UpdateCamundaExclusiveBehavior.js +31 -65
  23. package/lib/camunda-platform/features/modeling/behavior/UpdateInputOutputBehavior.js +42 -76
  24. package/lib/camunda-platform/features/modeling/behavior/UpdateResultVariableBehavior.js +21 -26
  25. package/lib/camunda-platform/features/modeling/behavior/UserTaskFormsBehavior.js +16 -10
  26. package/lib/camunda-platform/helper/InputOutputHelper.js +29 -0
  27. package/package.json +5 -5
@@ -3231,6 +3231,13 @@
3231
3231
  return collection.indexOf(element);
3232
3232
  }
3233
3233
 
3234
+ var Collections = /*#__PURE__*/Object.freeze({
3235
+ __proto__: null,
3236
+ remove: remove$2,
3237
+ add: add$1,
3238
+ indexOf: indexOf$1
3239
+ });
3240
+
3234
3241
  /**
3235
3242
  * Computes the distance between two points
3236
3243
  *
@@ -19778,6 +19785,11 @@
19778
19785
  translate: [ 'value', translate$1 ]
19779
19786
  };
19780
19787
 
19788
+ var translate$3 = /*#__PURE__*/Object.freeze({
19789
+ __proto__: null,
19790
+ 'default': translate$2
19791
+ });
19792
+
19781
19793
  var DEFAULT_LABEL_SIZE$1 = {
19782
19794
  width: 90,
19783
19795
  height: 20
@@ -26857,6 +26869,11 @@
26857
26869
  };
26858
26870
  });
26859
26871
 
26872
+ var CommandInterceptor$1 = /*#__PURE__*/Object.freeze({
26873
+ __proto__: null,
26874
+ 'default': CommandInterceptor
26875
+ });
26876
+
26860
26877
  /**
26861
26878
  * An auto resize component that takes care of expanding a parent element
26862
26879
  * if child elements are created or moved close the parents edge.
@@ -30671,537 +30688,6 @@
30671
30688
  connectionPreview: [ 'type', ConnectionPreview ]
30672
30689
  };
30673
30690
 
30674
- function getOriginal$1(event) {
30675
- return event.originalEvent || event.srcEvent;
30676
- }
30677
-
30678
- function isButton$1(event, button) {
30679
- return (getOriginal$1(event) || event).button === button;
30680
- }
30681
-
30682
- function isPrimaryButton$1(event) {
30683
-
30684
- // button === 0 -> left áka primary mouse button
30685
- return isButton$1(event, 0);
30686
- }
30687
-
30688
- function isAuxiliaryButton$1(event) {
30689
-
30690
- // button === 1 -> auxiliary áka wheel button
30691
- return isButton$1(event, 1);
30692
- }
30693
-
30694
- function toSVGPoints$1(points) {
30695
- var result = '';
30696
-
30697
- for (var i = 0, p; (p = points[i]); i++) {
30698
- result += p.x + ',' + p.y + ' ';
30699
- }
30700
-
30701
- return result;
30702
- }
30703
-
30704
- function createLine$1(points, attrs) {
30705
-
30706
- var line = create('polyline');
30707
- attr$1(line, { points: toSVGPoints$1(points) });
30708
-
30709
- if (attrs) {
30710
- attr$1(line, attrs);
30711
- }
30712
-
30713
- return line;
30714
- }
30715
-
30716
- function updateLine$1(gfx, points) {
30717
- attr$1(gfx, { points: toSVGPoints$1(points) });
30718
-
30719
- return gfx;
30720
- }
30721
-
30722
- function allowAll$1(event) { return true; }
30723
-
30724
- function allowPrimaryAndAuxiliary$1(event) {
30725
- return isPrimaryButton$1(event) || isAuxiliaryButton$1(event);
30726
- }
30727
-
30728
- var LOW_PRIORITY$6 = 500;
30729
-
30730
-
30731
- /**
30732
- * A plugin that provides interaction events for diagram elements.
30733
- *
30734
- * It emits the following events:
30735
- *
30736
- * * element.click
30737
- * * element.contextmenu
30738
- * * element.dblclick
30739
- * * element.hover
30740
- * * element.mousedown
30741
- * * element.mousemove
30742
- * * element.mouseup
30743
- * * element.out
30744
- *
30745
- * Each event is a tuple { element, gfx, originalEvent }.
30746
- *
30747
- * Canceling the event via Event#preventDefault()
30748
- * prevents the original DOM operation.
30749
- *
30750
- * @param {EventBus} eventBus
30751
- */
30752
- function InteractionEvents$1(eventBus, elementRegistry, styles) {
30753
-
30754
- var self = this;
30755
-
30756
- /**
30757
- * Fire an interaction event.
30758
- *
30759
- * @param {string} type local event name, e.g. element.click.
30760
- * @param {DOMEvent} event native event
30761
- * @param {djs.model.Base} [element] the diagram element to emit the event on;
30762
- * defaults to the event target
30763
- */
30764
- function fire(type, event, element) {
30765
-
30766
- if (isIgnored(type, event)) {
30767
- return;
30768
- }
30769
-
30770
- var target, gfx, returnValue;
30771
-
30772
- if (!element) {
30773
- target = event.delegateTarget || event.target;
30774
-
30775
- if (target) {
30776
- gfx = target;
30777
- element = elementRegistry.get(gfx);
30778
- }
30779
- } else {
30780
- gfx = elementRegistry.getGraphics(element);
30781
- }
30782
-
30783
- if (!gfx || !element) {
30784
- return;
30785
- }
30786
-
30787
- returnValue = eventBus.fire(type, {
30788
- element: element,
30789
- gfx: gfx,
30790
- originalEvent: event
30791
- });
30792
-
30793
- if (returnValue === false) {
30794
- event.stopPropagation();
30795
- event.preventDefault();
30796
- }
30797
- }
30798
-
30799
- // TODO(nikku): document this
30800
- var handlers = {};
30801
-
30802
- function mouseHandler(localEventName) {
30803
- return handlers[localEventName];
30804
- }
30805
-
30806
- function isIgnored(localEventName, event) {
30807
-
30808
- var filter = ignoredFilters[localEventName] || isPrimaryButton$1;
30809
-
30810
- // only react on left mouse button interactions
30811
- // except for interaction events that are enabled
30812
- // for secundary mouse button
30813
- return !filter(event);
30814
- }
30815
-
30816
- var bindings = {
30817
- click: 'element.click',
30818
- contextmenu: 'element.contextmenu',
30819
- dblclick: 'element.dblclick',
30820
- mousedown: 'element.mousedown',
30821
- mousemove: 'element.mousemove',
30822
- mouseover: 'element.hover',
30823
- mouseout: 'element.out',
30824
- mouseup: 'element.mouseup',
30825
- };
30826
-
30827
- var ignoredFilters = {
30828
- 'element.contextmenu': allowAll$1,
30829
- 'element.mousedown': allowPrimaryAndAuxiliary$1,
30830
- 'element.mouseup': allowPrimaryAndAuxiliary$1,
30831
- 'element.click': allowPrimaryAndAuxiliary$1,
30832
- 'element.dblclick': allowPrimaryAndAuxiliary$1
30833
- };
30834
-
30835
-
30836
- // manual event trigger //////////
30837
-
30838
- /**
30839
- * Trigger an interaction event (based on a native dom event)
30840
- * on the target shape or connection.
30841
- *
30842
- * @param {string} eventName the name of the triggered DOM event
30843
- * @param {MouseEvent} event
30844
- * @param {djs.model.Base} targetElement
30845
- */
30846
- function triggerMouseEvent(eventName, event, targetElement) {
30847
-
30848
- // i.e. element.mousedown...
30849
- var localEventName = bindings[eventName];
30850
-
30851
- if (!localEventName) {
30852
- throw new Error('unmapped DOM event name <' + eventName + '>');
30853
- }
30854
-
30855
- return fire(localEventName, event, targetElement);
30856
- }
30857
-
30858
-
30859
- var ELEMENT_SELECTOR = 'svg, .djs-element';
30860
-
30861
- // event handling ///////
30862
-
30863
- function registerEvent(node, event, localEvent, ignoredFilter) {
30864
-
30865
- var handler = handlers[localEvent] = function(event) {
30866
- fire(localEvent, event);
30867
- };
30868
-
30869
- if (ignoredFilter) {
30870
- ignoredFilters[localEvent] = ignoredFilter;
30871
- }
30872
-
30873
- handler.$delegate = delegate.bind(node, ELEMENT_SELECTOR, event, handler);
30874
- }
30875
-
30876
- function unregisterEvent(node, event, localEvent) {
30877
-
30878
- var handler = mouseHandler(localEvent);
30879
-
30880
- if (!handler) {
30881
- return;
30882
- }
30883
-
30884
- delegate.unbind(node, event, handler.$delegate);
30885
- }
30886
-
30887
- function registerEvents(svg) {
30888
- forEach(bindings, function(val, key) {
30889
- registerEvent(svg, key, val);
30890
- });
30891
- }
30892
-
30893
- function unregisterEvents(svg) {
30894
- forEach(bindings, function(val, key) {
30895
- unregisterEvent(svg, key, val);
30896
- });
30897
- }
30898
-
30899
- eventBus.on('canvas.destroy', function(event) {
30900
- unregisterEvents(event.svg);
30901
- });
30902
-
30903
- eventBus.on('canvas.init', function(event) {
30904
- registerEvents(event.svg);
30905
- });
30906
-
30907
-
30908
- // hit box updating ////////////////
30909
-
30910
- eventBus.on([ 'shape.added', 'connection.added' ], function(event) {
30911
- var element = event.element,
30912
- gfx = event.gfx;
30913
-
30914
- eventBus.fire('interactionEvents.createHit', { element: element, gfx: gfx });
30915
- });
30916
-
30917
- // Update djs-hit on change.
30918
- // A low priortity is necessary, because djs-hit of labels has to be updated
30919
- // after the label bounds have been updated in the renderer.
30920
- eventBus.on([
30921
- 'shape.changed',
30922
- 'connection.changed'
30923
- ], LOW_PRIORITY$6, function(event) {
30924
-
30925
- var element = event.element,
30926
- gfx = event.gfx;
30927
-
30928
- eventBus.fire('interactionEvents.updateHit', { element: element, gfx: gfx });
30929
- });
30930
-
30931
- eventBus.on('interactionEvents.createHit', LOW_PRIORITY$6, function(event) {
30932
- var element = event.element,
30933
- gfx = event.gfx;
30934
-
30935
- self.createDefaultHit(element, gfx);
30936
- });
30937
-
30938
- eventBus.on('interactionEvents.updateHit', function(event) {
30939
- var element = event.element,
30940
- gfx = event.gfx;
30941
-
30942
- self.updateDefaultHit(element, gfx);
30943
- });
30944
-
30945
-
30946
- // hit styles ////////////
30947
-
30948
- var STROKE_HIT_STYLE = createHitStyle('djs-hit djs-hit-stroke');
30949
-
30950
- var CLICK_STROKE_HIT_STYLE = createHitStyle('djs-hit djs-hit-click-stroke');
30951
-
30952
- var ALL_HIT_STYLE = createHitStyle('djs-hit djs-hit-all');
30953
-
30954
- var HIT_TYPES = {
30955
- 'all': ALL_HIT_STYLE,
30956
- 'click-stroke': CLICK_STROKE_HIT_STYLE,
30957
- 'stroke': STROKE_HIT_STYLE
30958
- };
30959
-
30960
- function createHitStyle(classNames, attrs) {
30961
-
30962
- attrs = assign({
30963
- stroke: 'white',
30964
- strokeWidth: 15
30965
- }, attrs || {});
30966
-
30967
- return styles.cls(classNames, [ 'no-fill', 'no-border' ], attrs);
30968
- }
30969
-
30970
-
30971
- // style helpers ///////////////
30972
-
30973
- function applyStyle(hit, type) {
30974
-
30975
- var attrs = HIT_TYPES[type];
30976
-
30977
- if (!attrs) {
30978
- throw new Error('invalid hit type <' + type + '>');
30979
- }
30980
-
30981
- attr$1(hit, attrs);
30982
-
30983
- return hit;
30984
- }
30985
-
30986
- function appendHit(gfx, hit) {
30987
- append(gfx, hit);
30988
- }
30989
-
30990
-
30991
- // API
30992
-
30993
- /**
30994
- * Remove hints on the given graphics.
30995
- *
30996
- * @param {SVGElement} gfx
30997
- */
30998
- this.removeHits = function(gfx) {
30999
- var hits = all('.djs-hit', gfx);
31000
-
31001
- forEach(hits, remove$1);
31002
- };
31003
-
31004
- /**
31005
- * Create default hit for the given element.
31006
- *
31007
- * @param {djs.model.Base} element
31008
- * @param {SVGElement} gfx
31009
- *
31010
- * @return {SVGElement} created hit
31011
- */
31012
- this.createDefaultHit = function(element, gfx) {
31013
- var waypoints = element.waypoints,
31014
- isFrame = element.isFrame,
31015
- boxType;
31016
-
31017
- if (waypoints) {
31018
- return this.createWaypointsHit(gfx, waypoints);
31019
- } else {
31020
-
31021
- boxType = isFrame ? 'stroke' : 'all';
31022
-
31023
- return this.createBoxHit(gfx, boxType, {
31024
- width: element.width,
31025
- height: element.height
31026
- });
31027
- }
31028
- };
31029
-
31030
- /**
31031
- * Create hits for the given waypoints.
31032
- *
31033
- * @param {SVGElement} gfx
31034
- * @param {Array<Point>} waypoints
31035
- *
31036
- * @return {SVGElement}
31037
- */
31038
- this.createWaypointsHit = function(gfx, waypoints) {
31039
-
31040
- var hit = createLine$1(waypoints);
31041
-
31042
- applyStyle(hit, 'stroke');
31043
-
31044
- appendHit(gfx, hit);
31045
-
31046
- return hit;
31047
- };
31048
-
31049
- /**
31050
- * Create hits for a box.
31051
- *
31052
- * @param {SVGElement} gfx
31053
- * @param {string} hitType
31054
- * @param {Object} attrs
31055
- *
31056
- * @return {SVGElement}
31057
- */
31058
- this.createBoxHit = function(gfx, type, attrs) {
31059
-
31060
- attrs = assign({
31061
- x: 0,
31062
- y: 0
31063
- }, attrs);
31064
-
31065
- var hit = create('rect');
31066
-
31067
- applyStyle(hit, type);
31068
-
31069
- attr$1(hit, attrs);
31070
-
31071
- appendHit(gfx, hit);
31072
-
31073
- return hit;
31074
- };
31075
-
31076
- /**
31077
- * Update default hit of the element.
31078
- *
31079
- * @param {djs.model.Base} element
31080
- * @param {SVGElement} gfx
31081
- *
31082
- * @return {SVGElement} updated hit
31083
- */
31084
- this.updateDefaultHit = function(element, gfx) {
31085
-
31086
- var hit = query('.djs-hit', gfx);
31087
-
31088
- if (!hit) {
31089
- return;
31090
- }
31091
-
31092
- if (element.waypoints) {
31093
- updateLine$1(hit, element.waypoints);
31094
- } else {
31095
- attr$1(hit, {
31096
- width: element.width,
31097
- height: element.height
31098
- });
31099
- }
31100
-
31101
- return hit;
31102
- };
31103
-
31104
- this.fire = fire;
31105
-
31106
- this.triggerMouseEvent = triggerMouseEvent;
31107
-
31108
- this.mouseHandler = mouseHandler;
31109
-
31110
- this.registerEvent = registerEvent;
31111
- this.unregisterEvent = unregisterEvent;
31112
- }
31113
-
31114
-
31115
- InteractionEvents$1.$inject = [
31116
- 'eventBus',
31117
- 'elementRegistry',
31118
- 'styles'
31119
- ];
31120
-
31121
-
31122
- /**
31123
- * An event indicating that the mouse hovered over an element
31124
- *
31125
- * @event element.hover
31126
- *
31127
- * @type {Object}
31128
- * @property {djs.model.Base} element
31129
- * @property {SVGElement} gfx
31130
- * @property {Event} originalEvent
31131
- */
31132
-
31133
- /**
31134
- * An event indicating that the mouse has left an element
31135
- *
31136
- * @event element.out
31137
- *
31138
- * @type {Object}
31139
- * @property {djs.model.Base} element
31140
- * @property {SVGElement} gfx
31141
- * @property {Event} originalEvent
31142
- */
31143
-
31144
- /**
31145
- * An event indicating that the mouse has clicked an element
31146
- *
31147
- * @event element.click
31148
- *
31149
- * @type {Object}
31150
- * @property {djs.model.Base} element
31151
- * @property {SVGElement} gfx
31152
- * @property {Event} originalEvent
31153
- */
31154
-
31155
- /**
31156
- * An event indicating that the mouse has double clicked an element
31157
- *
31158
- * @event element.dblclick
31159
- *
31160
- * @type {Object}
31161
- * @property {djs.model.Base} element
31162
- * @property {SVGElement} gfx
31163
- * @property {Event} originalEvent
31164
- */
31165
-
31166
- /**
31167
- * An event indicating that the mouse has gone down on an element.
31168
- *
31169
- * @event element.mousedown
31170
- *
31171
- * @type {Object}
31172
- * @property {djs.model.Base} element
31173
- * @property {SVGElement} gfx
31174
- * @property {Event} originalEvent
31175
- */
31176
-
31177
- /**
31178
- * An event indicating that the mouse has gone up on an element.
31179
- *
31180
- * @event element.mouseup
31181
- *
31182
- * @type {Object}
31183
- * @property {djs.model.Base} element
31184
- * @property {SVGElement} gfx
31185
- * @property {Event} originalEvent
31186
- */
31187
-
31188
- /**
31189
- * An event indicating that the context menu action is triggered
31190
- * via mouse or touch controls.
31191
- *
31192
- * @event element.contextmenu
31193
- *
31194
- * @type {Object}
31195
- * @property {djs.model.Base} element
31196
- * @property {SVGElement} gfx
31197
- * @property {Event} originalEvent
31198
- */
31199
-
31200
- var InteractionEventsModule$1 = {
31201
- __init__: [ 'interactionEvents' ],
31202
- interactionEvents: [ 'type', InteractionEvents$1 ]
31203
- };
31204
-
31205
30691
  var min = Math.min,
31206
30692
  max$1 = Math.max;
31207
30693
 
@@ -31835,7 +31321,7 @@
31835
31321
 
31836
31322
  var DirectEditingModule = {
31837
31323
  __depends__: [
31838
- InteractionEventsModule$1
31324
+ InteractionEventsModule
31839
31325
  ],
31840
31326
  __init__: [ 'directEditing' ],
31841
31327
  directEditing: [ 'type', DirectEditing ]
@@ -32784,7 +32270,7 @@
32784
32270
  return !!element.labelTarget;
32785
32271
  }
32786
32272
 
32787
- var LOW_PRIORITY$7 = 750;
32273
+ var LOW_PRIORITY$6 = 750;
32788
32274
 
32789
32275
 
32790
32276
  function CreatePreview(
@@ -32829,7 +32315,7 @@
32829
32315
  return dragGroup;
32830
32316
  }
32831
32317
 
32832
- eventBus.on('create.move', LOW_PRIORITY$7, function(event) {
32318
+ eventBus.on('create.move', LOW_PRIORITY$6, function(event) {
32833
32319
 
32834
32320
  var hover = event.hover,
32835
32321
  context = event.context,
@@ -34176,12 +33662,12 @@
34176
33662
  });
34177
33663
  }
34178
33664
 
34179
- var LOW_PRIORITY$8 = 750;
33665
+ var LOW_PRIORITY$7 = 750;
34180
33666
 
34181
33667
 
34182
33668
  function BpmnCopyPaste(bpmnFactory, eventBus, moddleCopy) {
34183
33669
 
34184
- eventBus.on('copyPaste.copyElement', LOW_PRIORITY$8, function(context) {
33670
+ eventBus.on('copyPaste.copyElement', LOW_PRIORITY$7, function(context) {
34185
33671
  var descriptor = context.descriptor,
34186
33672
  element = context.element;
34187
33673
 
@@ -34528,9 +34014,9 @@
34528
34014
  return;
34529
34015
  }
34530
34016
 
34531
- // disallow copying IDs if already assigned
34532
- if (propertyDescriptor.isId && this._moddle.ids.assigned(property)) {
34533
- return;
34017
+ // copy id
34018
+ if (propertyDescriptor.isId) {
34019
+ return this._copyId(property, parent);
34534
34020
  }
34535
34021
 
34536
34022
  // copy arrays
@@ -34571,6 +34057,18 @@
34571
34057
  return property;
34572
34058
  };
34573
34059
 
34060
+ ModdleCopy.prototype._copyId = function(id, element) {
34061
+
34062
+ // disallow if already taken
34063
+ if (this._moddle.ids.assigned(id)) {
34064
+ return;
34065
+ } else {
34066
+
34067
+ this._moddle.ids.claim(id, element);
34068
+ return id;
34069
+ }
34070
+ };
34071
+
34574
34072
  // helpers //////////
34575
34073
 
34576
34074
  function getPropertyNames(descriptor, keepDefaultProperties) {
@@ -37977,7 +37475,7 @@
37977
37475
  }
37978
37476
 
37979
37477
  var LOWER_PRIORITY = 1200;
37980
- var LOW_PRIORITY$9 = 800;
37478
+ var LOW_PRIORITY$8 = 800;
37981
37479
 
37982
37480
  /**
37983
37481
  * Basic grid snapping that covers connecting, creating, moving, resizing shapes, moving bendpoints
@@ -37991,7 +37489,7 @@
37991
37489
 
37992
37490
  var self = this;
37993
37491
 
37994
- eventBus.on('diagram.init', LOW_PRIORITY$9, function() {
37492
+ eventBus.on('diagram.init', LOW_PRIORITY$8, function() {
37995
37493
  self.setActive(active);
37996
37494
  });
37997
37495
 
@@ -38882,7 +38380,7 @@
38882
38380
  return true;
38883
38381
  };
38884
38382
 
38885
- var InteractionEventsModule$2 = {
38383
+ var InteractionEventsModule$1 = {
38886
38384
  __init__: [ 'bpmnInteractionEvents' ],
38887
38385
  bpmnInteractionEvents: [ 'type', BpmnInteractionEvents ]
38888
38386
  };
@@ -39537,7 +39035,7 @@
39537
39035
  var MARKER_RESIZING = 'djs-resizing',
39538
39036
  MARKER_RESIZE_NOT_OK = 'resize-not-ok';
39539
39037
 
39540
- var LOW_PRIORITY$a = 500;
39038
+ var LOW_PRIORITY$9 = 500;
39541
39039
 
39542
39040
 
39543
39041
  /**
@@ -39598,7 +39096,7 @@
39598
39096
  }
39599
39097
 
39600
39098
  // add and update previews
39601
- eventBus.on('resize.move', LOW_PRIORITY$a, function(event) {
39099
+ eventBus.on('resize.move', LOW_PRIORITY$9, function(event) {
39602
39100
  updateFrame(event.context);
39603
39101
  });
39604
39102
 
@@ -40695,7 +40193,7 @@
40695
40193
  'modeling'
40696
40194
  ];
40697
40195
 
40698
- var LOW_PRIORITY$b = 500;
40196
+ var LOW_PRIORITY$a = 500;
40699
40197
 
40700
40198
 
40701
40199
  /**
@@ -40708,7 +40206,7 @@
40708
40206
 
40709
40207
  var self = this;
40710
40208
 
40711
- this.postExecuted('elements.create', LOW_PRIORITY$b, function(context) {
40209
+ this.postExecuted('elements.create', LOW_PRIORITY$a, function(context) {
40712
40210
  var elements = context.elements;
40713
40211
 
40714
40212
  elements = elements.filter(function(shape) {
@@ -40731,7 +40229,7 @@
40731
40229
  }, true);
40732
40230
 
40733
40231
 
40734
- this.preExecute('elements.move', LOW_PRIORITY$b, function(context) {
40232
+ this.preExecute('elements.move', LOW_PRIORITY$a, function(context) {
40735
40233
  var shapes = context.shapes,
40736
40234
  host = context.newHost;
40737
40235
 
@@ -40857,7 +40355,7 @@
40857
40355
 
40858
40356
  inherits_browser(BoundaryEventBehavior, CommandInterceptor);
40859
40357
 
40860
- var LOW_PRIORITY$c = 500;
40358
+ var LOW_PRIORITY$b = 500;
40861
40359
 
40862
40360
 
40863
40361
  /**
@@ -40971,7 +40469,7 @@
40971
40469
  }
40972
40470
  });
40973
40471
 
40974
- eventBus.on('copyPaste.pasteElement', LOW_PRIORITY$c, function(context) {
40472
+ eventBus.on('copyPaste.pasteElement', LOW_PRIORITY$b, function(context) {
40975
40473
  var descriptor = context.descriptor,
40976
40474
  businessObject = descriptor.businessObject;
40977
40475
 
@@ -41794,7 +41292,7 @@
41794
41292
  }
41795
41293
  }
41796
41294
 
41797
- var LOW_PRIORITY$d = 500;
41295
+ var LOW_PRIORITY$c = 500;
41798
41296
 
41799
41297
 
41800
41298
  /**
@@ -41863,7 +41361,7 @@
41863
41361
  /**
41864
41362
  * Adjust sizes of other lanes after lane deletion
41865
41363
  */
41866
- this.postExecuted('shape.delete', LOW_PRIORITY$d, function(event) {
41364
+ this.postExecuted('shape.delete', LOW_PRIORITY$c, function(event) {
41867
41365
 
41868
41366
  var context = event.context,
41869
41367
  hints = context.hints,
@@ -41892,7 +41390,7 @@
41892
41390
 
41893
41391
  inherits_browser(DeleteLaneBehavior, CommandInterceptor);
41894
41392
 
41895
- var LOW_PRIORITY$e = 500;
41393
+ var LOW_PRIORITY$d = 500;
41896
41394
 
41897
41395
 
41898
41396
  /**
@@ -41905,7 +41403,7 @@
41905
41403
 
41906
41404
  var self = this;
41907
41405
 
41908
- this.postExecuted('elements.create', LOW_PRIORITY$e, function(context) {
41406
+ this.postExecuted('elements.create', LOW_PRIORITY$d, function(context) {
41909
41407
  var elements = context.elements;
41910
41408
 
41911
41409
  elements.filter(function(shape) {
@@ -41919,7 +41417,7 @@
41919
41417
  });
41920
41418
  }, true);
41921
41419
 
41922
- this.preExecute('elements.move', LOW_PRIORITY$e, function(context) {
41420
+ this.preExecute('elements.move', LOW_PRIORITY$d, function(context) {
41923
41421
  var shapes = context.shapes,
41924
41422
  newHost = context.newHost;
41925
41423
 
@@ -43711,7 +43209,7 @@
43711
43209
  }
43712
43210
 
43713
43211
  function getWaypointsInsideBounds(waypoints, bounds) {
43714
- var originalWaypoints = map(waypoints, getOriginal$2);
43212
+ var originalWaypoints = map(waypoints, getOriginal$1);
43715
43213
 
43716
43214
  return filter(originalWaypoints, function(waypoint) {
43717
43215
  return isInsideBounds(waypoint, bounds);
@@ -43728,7 +43226,7 @@
43728
43226
  return getOrientation(bounds, point, 1) === 'intersect';
43729
43227
  }
43730
43228
 
43731
- function getOriginal$2(point) {
43229
+ function getOriginal$1(point) {
43732
43230
  return point.original || point;
43733
43231
  }
43734
43232
 
@@ -44615,7 +44113,7 @@
44615
44113
  };
44616
44114
  }
44617
44115
 
44618
- var LOW_PRIORITY$f = 500;
44116
+ var LOW_PRIORITY$e = 500;
44619
44117
 
44620
44118
 
44621
44119
  function ToggleElementCollapseBehaviour(
@@ -44673,7 +44171,7 @@
44673
44171
  };
44674
44172
  }
44675
44173
 
44676
- this.executed([ 'shape.toggleCollapse' ], LOW_PRIORITY$f, function(e) {
44174
+ this.executed([ 'shape.toggleCollapse' ], LOW_PRIORITY$e, function(e) {
44677
44175
 
44678
44176
  var context = e.context,
44679
44177
  shape = context.shape;
@@ -44696,7 +44194,7 @@
44696
44194
  }
44697
44195
  });
44698
44196
 
44699
- this.reverted([ 'shape.toggleCollapse' ], LOW_PRIORITY$f, function(e) {
44197
+ this.reverted([ 'shape.toggleCollapse' ], LOW_PRIORITY$e, function(e) {
44700
44198
 
44701
44199
  var context = e.context;
44702
44200
  var shape = context.shape;
@@ -44711,7 +44209,7 @@
44711
44209
  }
44712
44210
  });
44713
44211
 
44714
- this.postExecuted([ 'shape.toggleCollapse' ], LOW_PRIORITY$f, function(e) {
44212
+ this.postExecuted([ 'shape.toggleCollapse' ], LOW_PRIORITY$e, function(e) {
44715
44213
  var shape = e.context.shape,
44716
44214
  defaultSize = elementFactory._getDefaultSize(shape),
44717
44215
  newBounds;
@@ -44799,7 +44297,7 @@
44799
44297
 
44800
44298
  UnclaimIdBehavior.$inject = [ 'canvas', 'injector', 'moddle', 'modeling' ];
44801
44299
 
44802
- var LOW_PRIORITY$g = 500,
44300
+ var LOW_PRIORITY$f = 500,
44803
44301
  HIGH_PRIORITY$c = 5000;
44804
44302
 
44805
44303
 
@@ -44881,7 +44379,7 @@
44881
44379
  initContext();
44882
44380
  });
44883
44381
 
44884
- this.postExecuted(laneRefUpdateEvents, LOW_PRIORITY$g, function(event) {
44382
+ this.postExecuted(laneRefUpdateEvents, LOW_PRIORITY$f, function(event) {
44885
44383
  releaseContext();
44886
44384
  });
44887
44385
 
@@ -47220,7 +46718,7 @@
47220
46718
  return collection;
47221
46719
  }
47222
46720
 
47223
- var LOW_PRIORITY$h = 250,
46721
+ var LOW_PRIORITY$g = 250,
47224
46722
  HIGH_PRIORITY$e = 1400;
47225
46723
 
47226
46724
 
@@ -47251,7 +46749,7 @@
47251
46749
  });
47252
46750
 
47253
46751
  // add labels to visual's group
47254
- movePreview && eventBus.on('shape.move.start', LOW_PRIORITY$h, function(e) {
46752
+ movePreview && eventBus.on('shape.move.start', LOW_PRIORITY$g, function(e) {
47255
46753
 
47256
46754
  var context = e.context,
47257
46755
  shapes = context.shapes;
@@ -47380,7 +46878,7 @@
47380
46878
  labelSupport: [ 'type', LabelSupport ]
47381
46879
  };
47382
46880
 
47383
- var LOW_PRIORITY$i = 251,
46881
+ var LOW_PRIORITY$h = 251,
47384
46882
  HIGH_PRIORITY$f = 1401;
47385
46883
 
47386
46884
  var MARKER_ATTACH$1 = 'attach-ok';
@@ -47422,7 +46920,7 @@
47422
46920
  });
47423
46921
 
47424
46922
  // add attachers to the visual's group
47425
- movePreview && eventBus.on('shape.move.start', LOW_PRIORITY$i, function(e) {
46923
+ movePreview && eventBus.on('shape.move.start', LOW_PRIORITY$h, function(e) {
47426
46924
 
47427
46925
  var context = e.context,
47428
46926
  shapes = context.shapes,
@@ -47704,7 +47202,7 @@
47704
47202
  attachSupport: [ 'type', AttachSupport ]
47705
47203
  };
47706
47204
 
47707
- var LOW_PRIORITY$j = 250;
47205
+ var LOW_PRIORITY$i = 250;
47708
47206
 
47709
47207
  /**
47710
47208
  * The tool manager acts as middle-man between the available tool's and the Palette,
@@ -47780,7 +47278,7 @@
47780
47278
  eventsToRegister.push(event + '.canceled');
47781
47279
  });
47782
47280
 
47783
- eventBus.on(eventsToRegister, LOW_PRIORITY$j, function(event) {
47281
+ eventBus.on(eventsToRegister, LOW_PRIORITY$i, function(event) {
47784
47282
 
47785
47283
  // We defer the de-activation of the tool to the .activate phase,
47786
47284
  // so we're able to check if we want to toggle off the current
@@ -48409,7 +47907,7 @@
48409
47907
  var MARKER_DRAGGING = 'djs-dragging',
48410
47908
  MARKER_RESIZING$1 = 'djs-resizing';
48411
47909
 
48412
- var LOW_PRIORITY$k = 250;
47910
+ var LOW_PRIORITY$j = 250;
48413
47911
 
48414
47912
  var max$6 = Math.max;
48415
47913
 
@@ -48484,7 +47982,7 @@
48484
47982
  });
48485
47983
 
48486
47984
  // add and update move/resize previews
48487
- eventBus.on('spaceTool.move', LOW_PRIORITY$k, function(event) {
47985
+ eventBus.on('spaceTool.move', LOW_PRIORITY$j, function(event) {
48488
47986
 
48489
47987
  var context = event.context,
48490
47988
  line = context.line,
@@ -54614,7 +54112,7 @@
54614
54112
  connectionDocking: [ 'type', CroppingConnectionDocking ]
54615
54113
  };
54616
54114
 
54617
- var LOW_PRIORITY$l = 500,
54115
+ var LOW_PRIORITY$k = 500,
54618
54116
  MEDIUM_PRIORITY = 1250,
54619
54117
  HIGH_PRIORITY$h = 1500;
54620
54118
 
@@ -54713,7 +54211,7 @@
54713
54211
  // to let others modify the move event before we update
54714
54212
  // the context
54715
54213
  //
54716
- eventBus.on('shape.move.move', LOW_PRIORITY$l, function(event) {
54214
+ eventBus.on('shape.move.move', LOW_PRIORITY$k, function(event) {
54717
54215
 
54718
54216
  var context = event.context,
54719
54217
  validatedShapes = context.validatedShapes,
@@ -54859,7 +54357,7 @@
54859
54357
  });
54860
54358
  }
54861
54359
 
54862
- var LOW_PRIORITY$m = 499;
54360
+ var LOW_PRIORITY$l = 499;
54863
54361
 
54864
54362
  var MARKER_DRAGGING$1 = 'djs-dragging',
54865
54363
  MARKER_OK$3 = 'drop-ok',
@@ -54937,7 +54435,7 @@
54937
54435
  // assign a low priority to this handler
54938
54436
  // to let others modify the move context before
54939
54437
  // we draw things
54940
- eventBus.on('shape.move.start', LOW_PRIORITY$m, function(event) {
54438
+ eventBus.on('shape.move.start', LOW_PRIORITY$l, function(event) {
54941
54439
  var context = event.context,
54942
54440
  dragShapes = context.shapes,
54943
54441
  allDraggedElements = context.allDraggedElements;
@@ -54984,7 +54482,7 @@
54984
54482
  });
54985
54483
 
54986
54484
  // update previews
54987
- eventBus.on('shape.move.move', LOW_PRIORITY$m, function(event) {
54485
+ eventBus.on('shape.move.move', LOW_PRIORITY$l, function(event) {
54988
54486
 
54989
54487
  var context = event.context,
54990
54488
  dragGroup = context.dragGroup,
@@ -56326,7 +55824,7 @@
56326
55824
  paletteProvider: [ 'type', PaletteProvider ]
56327
55825
  };
56328
55826
 
56329
- var LOW_PRIORITY$n = 250;
55827
+ var LOW_PRIORITY$m = 250;
56330
55828
 
56331
55829
 
56332
55830
  function BpmnReplacePreview(
@@ -56407,7 +55905,7 @@
56407
55905
  });
56408
55906
  }
56409
55907
 
56410
- eventBus.on('shape.move.move', LOW_PRIORITY$n, function(event) {
55908
+ eventBus.on('shape.move.move', LOW_PRIORITY$m, function(event) {
56411
55909
 
56412
55910
  var context = event.context,
56413
55911
  canExecute = context.canExecute;
@@ -58337,7 +57835,7 @@
58337
57835
  DistributeElementsModule$1,
58338
57836
  EditorActionsModule$1,
58339
57837
  GridSnappingModule$1,
58340
- InteractionEventsModule$2,
57838
+ InteractionEventsModule$1,
58341
57839
  KeyboardModule$1,
58342
57840
  KeyboardMoveSelectionModule,
58343
57841
  LabelEditingModule,
@@ -58363,24 +57861,6 @@
58363
57861
  Modeler.prototype._modelingModules
58364
57862
  );
58365
57863
 
58366
- /**
58367
- * SVGs for elements are generated by the {@link GraphicsFactory}.
58368
- *
58369
- * This utility gives quick access to the important semantic
58370
- * parts of an element.
58371
- */
58372
-
58373
- /**
58374
- * Returns the visual part of a diagram element
58375
- *
58376
- * @param {Snap<SVGElement>} gfx
58377
- *
58378
- * @return {Snap<SVGElement>}
58379
- */
58380
- function getVisual$1(gfx) {
58381
- return gfx.childNodes[0];
58382
- }
58383
-
58384
57864
  var MINIMAP_VIEWBOX_PADDING = 50;
58385
57865
 
58386
57866
  var RANGE$1 = { min: 0.2, max: 4 },
@@ -58388,7 +57868,7 @@
58388
57868
 
58389
57869
  var DELTA_THRESHOLD$1 = 0.1;
58390
57870
 
58391
- var LOW_PRIORITY$o = 250;
57871
+ var LOW_PRIORITY$n = 250;
58392
57872
 
58393
57873
 
58394
57874
  /**
@@ -58662,7 +58142,7 @@
58662
58142
  });
58663
58143
 
58664
58144
  // update on elements changed
58665
- eventBus.on('elements.changed', LOW_PRIORITY$o, function(context) {
58145
+ eventBus.on('elements.changed', LOW_PRIORITY$n, function(context) {
58666
58146
  var elements = context.elements;
58667
58147
 
58668
58148
  elements.forEach(function(element) {
@@ -59033,7 +58513,7 @@
59033
58513
  visual;
59034
58514
 
59035
58515
  if (gfx) {
59036
- visual = getVisual$1(gfx);
58516
+ visual = getVisual(gfx);
59037
58517
 
59038
58518
  if (visual) {
59039
58519
  var elementGfx = clone(visual);
@@ -59634,421 +59114,6 @@
59634
59114
  ]
59635
59115
  };
59636
59116
 
59637
- var DEFAULT_PRIORITY$6 = 1000;
59638
-
59639
- /**
59640
- * A utility that can be used to plug-in into the command execution for
59641
- * extension and/or validation.
59642
- *
59643
- * @param {EventBus} eventBus
59644
- *
59645
- * @example
59646
- *
59647
- * import inherits from 'inherits';
59648
- *
59649
- * import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
59650
- *
59651
- * function CommandLogger(eventBus) {
59652
- * CommandInterceptor.call(this, eventBus);
59653
- *
59654
- * this.preExecute(function(event) {
59655
- * console.log('command pre-execute', event);
59656
- * });
59657
- * }
59658
- *
59659
- * inherits(CommandLogger, CommandInterceptor);
59660
- *
59661
- */
59662
- function CommandInterceptor$1(eventBus) {
59663
- this._eventBus = eventBus;
59664
- }
59665
-
59666
- CommandInterceptor$1.$inject = [ 'eventBus' ];
59667
-
59668
- function unwrapEvent$1(fn, that) {
59669
- return function(event) {
59670
- return fn.call(that || null, event.context, event.command, event);
59671
- };
59672
- }
59673
-
59674
- /**
59675
- * Register an interceptor for a command execution
59676
- *
59677
- * @param {string|Array<string>} [events] list of commands to register on
59678
- * @param {string} [hook] command hook, i.e. preExecute, executed to listen on
59679
- * @param {number} [priority] the priority on which to hook into the execution
59680
- * @param {Function} handlerFn interceptor to be invoked with (event)
59681
- * @param {boolean} unwrap if true, unwrap the event and pass (context, command, event) to the
59682
- * listener instead
59683
- * @param {Object} [that] Pass context (`this`) to the handler function
59684
- */
59685
- CommandInterceptor$1.prototype.on = function(events, hook, priority, handlerFn, unwrap, that) {
59686
-
59687
- if (isFunction(hook) || isNumber(hook)) {
59688
- that = unwrap;
59689
- unwrap = handlerFn;
59690
- handlerFn = priority;
59691
- priority = hook;
59692
- hook = null;
59693
- }
59694
-
59695
- if (isFunction(priority)) {
59696
- that = unwrap;
59697
- unwrap = handlerFn;
59698
- handlerFn = priority;
59699
- priority = DEFAULT_PRIORITY$6;
59700
- }
59701
-
59702
- if (isObject(unwrap)) {
59703
- that = unwrap;
59704
- unwrap = false;
59705
- }
59706
-
59707
- if (!isFunction(handlerFn)) {
59708
- throw new Error('handlerFn must be a function');
59709
- }
59710
-
59711
- if (!isArray(events)) {
59712
- events = [ events ];
59713
- }
59714
-
59715
- var eventBus = this._eventBus;
59716
-
59717
- forEach(events, function(event) {
59718
-
59719
- // concat commandStack(.event)?(.hook)?
59720
- var fullEvent = [ 'commandStack', event, hook ].filter(function(e) { return e; }).join('.');
59721
-
59722
- eventBus.on(fullEvent, priority, unwrap ? unwrapEvent$1(handlerFn, that) : handlerFn, that);
59723
- });
59724
- };
59725
-
59726
-
59727
- var hooks$1 = [
59728
- 'canExecute',
59729
- 'preExecute',
59730
- 'preExecuted',
59731
- 'execute',
59732
- 'executed',
59733
- 'postExecute',
59734
- 'postExecuted',
59735
- 'revert',
59736
- 'reverted'
59737
- ];
59738
-
59739
- /*
59740
- * Install hook shortcuts
59741
- *
59742
- * This will generate the CommandInterceptor#(preExecute|...|reverted) methods
59743
- * which will in term forward to CommandInterceptor#on.
59744
- */
59745
- forEach(hooks$1, function(hook) {
59746
-
59747
- /**
59748
- * {canExecute|preExecute|preExecuted|execute|executed|postExecute|postExecuted|revert|reverted}
59749
- *
59750
- * A named hook for plugging into the command execution
59751
- *
59752
- * @param {string|Array<string>} [events] list of commands to register on
59753
- * @param {number} [priority] the priority on which to hook into the execution
59754
- * @param {Function} handlerFn interceptor to be invoked with (event)
59755
- * @param {boolean} [unwrap=false] if true, unwrap the event and pass (context, command, event) to the
59756
- * listener instead
59757
- * @param {Object} [that] Pass context (`this`) to the handler function
59758
- */
59759
- CommandInterceptor$1.prototype[hook] = function(events, priority, handlerFn, unwrap, that) {
59760
-
59761
- if (isFunction(events) || isNumber(events)) {
59762
- that = unwrap;
59763
- unwrap = handlerFn;
59764
- handlerFn = priority;
59765
- priority = events;
59766
- events = null;
59767
- }
59768
-
59769
- this.on(events, hook, priority, handlerFn, unwrap, that);
59770
- };
59771
- });
59772
-
59773
- var CommandInterceptor$2 = /*#__PURE__*/Object.freeze({
59774
- __proto__: null,
59775
- 'default': CommandInterceptor$1
59776
- });
59777
-
59778
- /**
59779
- * Failsafe remove an element from a collection
59780
- *
59781
- * @param {Array<Object>} [collection]
59782
- * @param {Object} [element]
59783
- *
59784
- * @return {number} the previous index of the element
59785
- */
59786
- function remove$3(collection, element) {
59787
-
59788
- if (!collection || !element) {
59789
- return -1;
59790
- }
59791
-
59792
- var idx = collection.indexOf(element);
59793
-
59794
- if (idx !== -1) {
59795
- collection.splice(idx, 1);
59796
- }
59797
-
59798
- return idx;
59799
- }
59800
-
59801
- /**
59802
- * Fail save add an element to the given connection, ensuring
59803
- * it does not yet exist.
59804
- *
59805
- * @param {Array<Object>} collection
59806
- * @param {Object} element
59807
- * @param {number} idx
59808
- */
59809
- function add$2(collection, element, idx) {
59810
-
59811
- if (!collection || !element) {
59812
- return;
59813
- }
59814
-
59815
- if (typeof idx !== 'number') {
59816
- idx = -1;
59817
- }
59818
-
59819
- var currentIdx = collection.indexOf(element);
59820
-
59821
- if (currentIdx !== -1) {
59822
-
59823
- if (currentIdx === idx) {
59824
-
59825
- // nothing to do, position has not changed
59826
- return;
59827
- } else {
59828
-
59829
- if (idx !== -1) {
59830
-
59831
- // remove from current position
59832
- collection.splice(currentIdx, 1);
59833
- } else {
59834
-
59835
- // already exists in collection
59836
- return;
59837
- }
59838
- }
59839
- }
59840
-
59841
- if (idx !== -1) {
59842
-
59843
- // insert at specified position
59844
- collection.splice(idx, 0, element);
59845
- } else {
59846
-
59847
- // push to end
59848
- collection.push(element);
59849
- }
59850
- }
59851
-
59852
-
59853
- /**
59854
- * Fail save get the index of an element in a collection.
59855
- *
59856
- * @param {Array<Object>} collection
59857
- * @param {Object} element
59858
- *
59859
- * @return {number} the index or -1 if collection or element do
59860
- * not exist or the element is not contained.
59861
- */
59862
- function indexOf$2(collection, element) {
59863
-
59864
- if (!collection || !element) {
59865
- return -1;
59866
- }
59867
-
59868
- return collection.indexOf(element);
59869
- }
59870
-
59871
- var Collections = /*#__PURE__*/Object.freeze({
59872
- __proto__: null,
59873
- remove: remove$3,
59874
- add: add$2,
59875
- indexOf: indexOf$2
59876
- });
59877
-
59878
- /**
59879
- * Remove from the beginning of a collection until it is empty.
59880
- *
59881
- * This is a null-safe operation that ensures elements
59882
- * are being removed from the given collection until the
59883
- * collection is empty.
59884
- *
59885
- * The implementation deals with the fact that a remove operation
59886
- * may touch, i.e. remove multiple elements in the collection
59887
- * at a time.
59888
- *
59889
- * @param {Array<Object>} [collection]
59890
- * @param {Function} removeFn
59891
- *
59892
- * @return {Array<Object>} the cleared collection
59893
- */
59894
- function saveClear$1(collection, removeFn) {
59895
-
59896
- if (typeof removeFn !== 'function') {
59897
- throw new Error('removeFn iterator must be a function');
59898
- }
59899
-
59900
- if (!collection) {
59901
- return;
59902
- }
59903
-
59904
- var e;
59905
-
59906
- while ((e = collection[0])) {
59907
- removeFn(e);
59908
- }
59909
-
59910
- return collection;
59911
- }
59912
-
59913
- /**
59914
- * Returns the surrounding bbox for all elements in
59915
- * the array or the element primitive.
59916
- *
59917
- * @param {Array<djs.model.Shape>|djs.model.Shape} elements
59918
- * @param {boolean} stopRecursion
59919
- */
59920
- function getBBox$1(elements, stopRecursion) {
59921
-
59922
- stopRecursion = !!stopRecursion;
59923
- if (!isArray(elements)) {
59924
- elements = [elements];
59925
- }
59926
-
59927
- var minX,
59928
- minY,
59929
- maxX,
59930
- maxY;
59931
-
59932
- forEach(elements, function(element) {
59933
-
59934
- // If element is a connection the bbox must be computed first
59935
- var bbox = element;
59936
- if (element.waypoints && !stopRecursion) {
59937
- bbox = getBBox$1(element.waypoints, true);
59938
- }
59939
-
59940
- var x = bbox.x,
59941
- y = bbox.y,
59942
- height = bbox.height || 0,
59943
- width = bbox.width || 0;
59944
-
59945
- if (x < minX || minX === undefined) {
59946
- minX = x;
59947
- }
59948
- if (y < minY || minY === undefined) {
59949
- minY = y;
59950
- }
59951
-
59952
- if ((x + width) > maxX || maxX === undefined) {
59953
- maxX = x + width;
59954
- }
59955
- if ((y + height) > maxY || maxY === undefined) {
59956
- maxY = y + height;
59957
- }
59958
- });
59959
-
59960
- return {
59961
- x: minX,
59962
- y: minY,
59963
- height: maxY - minY,
59964
- width: maxX - minX
59965
- };
59966
- }
59967
-
59968
- var DEFAULT_CHILD_BOX_PADDING$1 = 20;
59969
-
59970
- function asPadding$1(mayBePadding, defaultValue) {
59971
- if (typeof mayBePadding !== 'undefined') {
59972
- return mayBePadding;
59973
- } else {
59974
- return DEFAULT_CHILD_BOX_PADDING$1;
59975
- }
59976
- }
59977
-
59978
- function addPadding$2(bbox, padding) {
59979
- var left, right, top, bottom;
59980
-
59981
- if (typeof padding === 'object') {
59982
- left = asPadding$1(padding.left);
59983
- right = asPadding$1(padding.right);
59984
- top = asPadding$1(padding.top);
59985
- bottom = asPadding$1(padding.bottom);
59986
- } else {
59987
- left = right = top = bottom = asPadding$1(padding);
59988
- }
59989
-
59990
- return {
59991
- x: bbox.x - left,
59992
- y: bbox.y - top,
59993
- width: bbox.width + left + right,
59994
- height: bbox.height + top + bottom
59995
- };
59996
- }
59997
-
59998
-
59999
- /**
60000
- * Is the given element part of the resize
60001
- * targets min boundary box?
60002
- *
60003
- * This is the default implementation which excludes
60004
- * connections and labels.
60005
- *
60006
- * @param {djs.model.Base} element
60007
- */
60008
- function isBBoxChild$1(element) {
60009
-
60010
- // exclude connections
60011
- if (element.waypoints) {
60012
- return false;
60013
- }
60014
-
60015
- // exclude labels
60016
- if (element.type === 'label') {
60017
- return false;
60018
- }
60019
-
60020
- return true;
60021
- }
60022
-
60023
- /**
60024
- * Return children bounding computed from a shapes children
60025
- * or a list of prefiltered children.
60026
- *
60027
- * @param {djs.model.Shape|Array<djs.model.Shape>} shapeOrChildren
60028
- * @param {number|Object} padding
60029
- *
60030
- * @return {Bounds}
60031
- */
60032
- function computeChildrenBBox$1(shapeOrChildren, padding) {
60033
-
60034
- var elements;
60035
-
60036
- // compute based on shape
60037
- if (shapeOrChildren.length === undefined) {
60038
-
60039
- // grab all the children that are part of the
60040
- // parents children box
60041
- elements = filter(shapeOrChildren.children, isBBoxChild$1);
60042
-
60043
- } else {
60044
- elements = shapeOrChildren;
60045
- }
60046
-
60047
- if (elements.length) {
60048
- return addPadding$2(getBBox$1(elements), padding);
60049
- }
60050
- }
60051
-
60052
59117
  /**
60053
59118
  * Similar to the bpmn-js/lib/import/Importer we emit
60054
59119
  * import life-cycle events:
@@ -60171,7 +59236,7 @@
60171
59236
 
60172
59237
  var visibleElements = filterVisible$1(subProcess.children);
60173
59238
 
60174
- var visibleBBox = computeChildrenBBox$1(visibleElements);
59239
+ var visibleBBox = computeChildrenBBox(visibleElements);
60175
59240
 
60176
59241
  var visibleBBoxMid = {
60177
59242
  x: visibleBBox.x + visibleBBox.width / 2,
@@ -60197,7 +59262,7 @@
60197
59262
  var self = this;
60198
59263
 
60199
59264
  function deleteElements(elements) {
60200
- saveClear$1(elements, function(element) {
59265
+ saveClear(elements, function(element) {
60201
59266
  deleteElement(element);
60202
59267
  });
60203
59268
  }
@@ -60275,12 +59340,12 @@
60275
59340
 
60276
59341
  // (1) add to target plane
60277
59342
  sourcePlaneElements.forEach(function(sourcePlaneElement) {
60278
- add$2(targetPlaneElements, sourcePlaneElement);
59343
+ add$1(targetPlaneElements, sourcePlaneElement);
60279
59344
  });
60280
59345
 
60281
59346
  // (2) remove from source plane
60282
59347
  sourcePlaneElements.slice().forEach(function(sourcePlaneElement) {
60283
- remove$3(sourceDiagram.plane.planeElement, sourcePlaneElement);
59348
+ remove$2(sourceDiagram.plane.planeElement, sourcePlaneElement);
60284
59349
 
60285
59350
  sourcePlaneElement.$parent = targetDiagram.plane;
60286
59351
  });
@@ -60321,7 +59386,7 @@
60321
59386
  var self = this;
60322
59387
 
60323
59388
  function deleteElements(elements) {
60324
- saveClear$1(elements, function(element) {
59389
+ saveClear(elements, function(element) {
60325
59390
  deleteElement(element);
60326
59391
  });
60327
59392
  }
@@ -60358,7 +59423,7 @@
60358
59423
  var definitions = this._bpmnjs.getDefinitions(),
60359
59424
  diagrams = definitions.diagrams;
60360
59425
 
60361
- add$2(diagrams, targetDiagram);
59426
+ add$1(diagrams, targetDiagram);
60362
59427
  }
60363
59428
 
60364
59429
  var sourceDiagram = this.findDiagram(this._canvas.getRootElement().id);
@@ -60422,7 +59487,7 @@
60422
59487
  var definitions = this._bpmnjs.getDefinitions(),
60423
59488
  diagrams = definitions.diagrams;
60424
59489
 
60425
- remove$3(diagrams, subProcessDiagram);
59490
+ remove$2(diagrams, subProcessDiagram);
60426
59491
  }
60427
59492
 
60428
59493
  // (4) try to import
@@ -60482,12 +59547,12 @@
60482
59547
 
60483
59548
  // (1) add to target plane
60484
59549
  sourcePlaneElements.forEach(function(sourcePlaneElement) {
60485
- add$2(targetPlaneElements, sourcePlaneElement);
59550
+ add$1(targetPlaneElements, sourcePlaneElement);
60486
59551
  });
60487
59552
 
60488
59553
  // (2) remove from source plane
60489
59554
  sourcePlaneElements.slice().forEach(function(sourcePlaneElement) {
60490
- remove$3(sourceDiagram.plane.planeElement, sourcePlaneElement);
59555
+ remove$2(sourceDiagram.plane.planeElement, sourcePlaneElement);
60491
59556
 
60492
59557
  sourcePlaneElement.$parent = targetDiagram.plane;
60493
59558
  });
@@ -60508,7 +59573,7 @@
60508
59573
  const HIGH_PRIORITY$k = 2000;
60509
59574
 
60510
59575
 
60511
- class SignavioBehavior extends CommandInterceptor$1 {
59576
+ class SignavioBehavior extends CommandInterceptor {
60512
59577
 
60513
59578
  constructor(
60514
59579
  bpmnjs, bpmnImporter, canvas,
@@ -64359,42 +63424,6 @@
64359
63424
  __init__: [ CommandInitializer ]
64360
63425
  };
64361
63426
 
64362
- /**
64363
- * A simple translation stub to be used for multi-language support
64364
- * in diagrams. Can be easily replaced with a more sophisticated
64365
- * solution.
64366
- *
64367
- * @example
64368
- *
64369
- * // use it inside any diagram component by injecting `translate`.
64370
- *
64371
- * function MyService(translate) {
64372
- * alert(translate('HELLO {you}', { you: 'You!' }));
64373
- * }
64374
- *
64375
- * @param {string} template to interpolate
64376
- * @param {Object} [replacements] a map with substitutes
64377
- *
64378
- * @return {string} the translated string
64379
- */
64380
- function translate$3(template, replacements) {
64381
-
64382
- replacements = replacements || {};
64383
-
64384
- return template.replace(/{([^}]+)}/g, function(_, key) {
64385
- return replacements[key] || '{' + key + '}';
64386
- });
64387
- }
64388
-
64389
- var index$2 = {
64390
- translate: [ 'value', translate$3 ]
64391
- };
64392
-
64393
- var translate$4 = /*#__PURE__*/Object.freeze({
64394
- __proto__: null,
64395
- 'default': index$2
64396
- });
64397
-
64398
63427
  var require$$1$1 = /*@__PURE__*/getAugmentedNamespace(index_esm$2);
64399
63428
 
64400
63429
  var require$$2 = /*@__PURE__*/getAugmentedNamespace(index_esm);
@@ -66703,7 +65732,7 @@
66703
65732
  var HIDE_CLASS = 'bpp-hidden';
66704
65733
  var DEBOUNCE_DELAY = 300;
66705
65734
 
66706
- var DEFAULT_PRIORITY$7 = 1000;
65735
+ var DEFAULT_PRIORITY$6 = 1000;
66707
65736
 
66708
65737
  function isToggle(node) {
66709
65738
  return node.type === 'checkbox' || node.type === 'radio';
@@ -66931,7 +65960,7 @@
66931
65960
 
66932
65961
  if (!provider) {
66933
65962
  provider = priority;
66934
- priority = DEFAULT_PRIORITY$7;
65963
+ priority = DEFAULT_PRIORITY$6;
66935
65964
  }
66936
65965
 
66937
65966
  if (typeof provider.getTabs !== 'function') {
@@ -68056,7 +67085,7 @@
68056
67085
  return string.replace(/\r\n|\r|\n/g, '\n');
68057
67086
  }
68058
67087
 
68059
- var require$$1$2 = /*@__PURE__*/getAugmentedNamespace(translate$4);
67088
+ var require$$1$2 = /*@__PURE__*/getAugmentedNamespace(translate$3);
68060
67089
 
68061
67090
  var lib = {
68062
67091
  __depends__: [
@@ -68069,7 +67098,7 @@
68069
67098
 
68070
67099
  var bpmnJsPropertiesPanel = lib;
68071
67100
 
68072
- var DEFAULT_PRIORITY$8 = 1000;
67101
+ var DEFAULT_PRIORITY$7 = 1000;
68073
67102
 
68074
67103
 
68075
67104
  /**
@@ -68090,7 +67119,7 @@
68090
67119
  function PropertiesActivator(eventBus, priority) {
68091
67120
  var self = this;
68092
67121
 
68093
- priority = priority || DEFAULT_PRIORITY$8;
67122
+ priority = priority || DEFAULT_PRIORITY$7;
68094
67123
 
68095
67124
  eventBus.on('propertiesPanel.isEntryVisible', priority, function(context) {
68096
67125
  var element = context.element,
@@ -73049,18 +72078,19 @@
73049
72078
 
73050
72079
 
73051
72080
  /**
73052
- * Camunda BPMN specific `camunda:errorEventDefinition` behavior.
73053
- *
73054
- * When `camunda:type` is set to something different than `external`
73055
- * on an element, then `camunda:errorEventDefinition` extension elements
73056
- * shall be removed.
72081
+ * Camunda BPMN specific camunda:ErrorEventDefinition behavior.
73057
72082
  */
73058
- function DeleteErrorEventDefinitionBehavior(eventBus) {
73059
-
73060
- CommandInterceptor$1.call(this, eventBus);
72083
+ class DeleteErrorEventDefinitionBehavior extends CommandInterceptor {
72084
+ constructor(eventBus, modeling) {
72085
+ super(eventBus);
73061
72086
 
73062
- this.executed([ 'properties-panel.update-businessobject', 'element.updateProperties' ],
73063
- HIGH_PRIORITY$l, function(context) {
72087
+ /**
72088
+ * Remove camunda:ErrorEventDefinitions on camunda:type set to external.
72089
+ */
72090
+ this.postExecute([
72091
+ 'element.updateProperties',
72092
+ 'properties-panel.update-businessobject'
72093
+ ], HIGH_PRIORITY$l, function(context) {
73064
72094
  const {
73065
72095
  element,
73066
72096
  oldProperties,
@@ -73068,52 +72098,30 @@
73068
72098
  } = context;
73069
72099
 
73070
72100
  const businessObject = getBusinessObject(element),
73071
- extensionElements = businessObject.extensionElements;
72101
+ extensionElements = businessObject.get('extensionElements');
73072
72102
 
73073
- // (1) Check whether behavior is suitable
73074
- if (
73075
- is$1(element, 'camunda:ExternalCapable') &&
73076
- extensionElements &&
73077
- externalTypeChanged(oldProperties, properties)
73078
- ) {
72103
+ if (is$1(element, 'camunda:ExternalCapable')
72104
+ && extensionElements
72105
+ && externalTypeChanged(oldProperties, properties)) {
73079
72106
 
73080
- // (2) Delete camunda:ErrorEventDefinition elements and save them for revert
73081
- context.deletedErrorEventDefinitions = extensionElements.values;
72107
+ const values = extensionElements.get('values').filter((element) => {
72108
+ return !is$1(element, 'camunda:ErrorEventDefinition');
72109
+ });
73082
72110
 
73083
- extensionElements.values = extensionElements.values.filter(
73084
- element => !is$1(element, 'camunda:ErrorEventDefinition')
73085
- );
72111
+ modeling.updateModdleProperties(element, extensionElements, { values });
73086
72112
  }
73087
-
73088
72113
  }, true);
73089
72114
 
73090
- this.reverted([ 'properties-panel.update-businessobject', 'element.updateProperties' ],
73091
- HIGH_PRIORITY$l, function({ context }) {
73092
- const {
73093
- element,
73094
- deletedErrorEventDefinitions: oldExtensionElements
73095
- } = context;
73096
-
73097
- const businessObject = getBusinessObject(element);
73098
-
73099
- // Only intercept the revert, if the behavior became active
73100
- if (oldExtensionElements) {
73101
- const extensionElements = businessObject.extensionElements;
73102
-
73103
- extensionElements.values = oldExtensionElements;
73104
- }
73105
- });
72115
+ }
73106
72116
  }
73107
72117
 
73108
-
73109
72118
  DeleteErrorEventDefinitionBehavior.$inject = [
73110
- 'eventBus'
72119
+ 'eventBus',
72120
+ 'modeling'
73111
72121
  ];
73112
72122
 
73113
- inherits_browser(DeleteErrorEventDefinitionBehavior, CommandInterceptor$1);
73114
-
73115
72123
 
73116
- // helper //////////////////
72124
+ // helpers //////////
73117
72125
 
73118
72126
  function externalTypeChanged(oldProperties, updatesProperties) {
73119
72127
  const {
@@ -73127,22 +72135,23 @@
73127
72135
  return oldType === 'external' && newType !== 'external';
73128
72136
  }
73129
72137
 
73130
- const HIGH_PRIORITY$m = 15000;
72138
+ const HIGH_PRIORITY$m = 5000;
73131
72139
 
73132
72140
 
73133
72141
  /**
73134
- * Camunda BPMN specific `camunda:FailedJobRetryTimeCycle` behavior.
73135
- *
73136
- * When `camunda:asyncAfter` or `camunda:asyncBefore` are set to false
73137
- * on an element, then `camunda:FailedJobRetryTimeCycle` shall be removed. This ensures
73138
- * that the BPMN diagram XML reflects the behavior of Camunda Platform engine.
72142
+ * Camunda BPMN specific camunda:FailedJobRetryTimeCycle behavior.
73139
72143
  */
73140
- function DeleteRetryTimeCycleBehavior(eventBus) {
73141
-
73142
- CommandInterceptor$1.call(this, eventBus);
72144
+ class DeleteRetryTimeCycleBehavior extends CommandInterceptor {
72145
+ constructor(eventBus, modeling) {
72146
+ super(eventBus);
73143
72147
 
73144
- this.executed([ 'properties-panel.update-businessobject', 'element.updateProperties' ],
73145
- HIGH_PRIORITY$m, function(context) {
72148
+ /**
72149
+ * Remove camunda:FailedJobRetryTimeCycle if camunda:asyncAfter or camunda:asyncBefore is set to false.
72150
+ */
72151
+ this.postExecute([
72152
+ 'element.updateProperties',
72153
+ 'properties-panel.update-businessobject'
72154
+ ], HIGH_PRIORITY$m, function(context) {
73146
72155
  const {
73147
72156
  element,
73148
72157
  properties
@@ -73151,112 +72160,76 @@
73151
72160
  const businessObject = getBusinessObject(element),
73152
72161
  extensionElements = businessObject.extensionElements;
73153
72162
 
73154
- // (1.1) Execute if...
73155
- if (is$1(element, 'camunda:AsyncCapable') && // ...asyncCapable
73156
- properties && // ...properties updated
73157
- (properties['camunda:asyncBefore'] === false || // ...update async (1)
73158
- properties['camunda:asyncAfter'] === false) && // ...update async (2)
73159
- (extensionElements && extensionElements.values.length) && // ...we have extensionElements
73160
- (extensionElements.values.find(ele => is$1(ele, 'camunda:FailedJobRetryTimeCycle'))) && // ...we have retryTimeCycle
73161
- !getTimerEventDefinition(element) // ...we don't have a TimerEventDefinition
72163
+ if (
72164
+ !is$1(element, 'camunda:AsyncCapable')
72165
+ || (properties[ 'camunda:asyncBefore' ] !== false && properties[ 'camunda:asyncAfter' ] !== false)
72166
+ || !extensionElements
72167
+ || !extensionElements.get('values').length
72168
+ || !extensionElements.get('values').find((value) => is$1(value, 'camunda:FailedJobRetryTimeCycle'))
72169
+ || getTimerEventDefinition(element)
72170
+ || isAsyncBefore(businessObject)
72171
+ || isAsyncAfter(businessObject)
73162
72172
  ) {
73163
-
73164
- // (1.2) ... but don't execute if one async is still true
73165
- if (isAsyncBefore(businessObject) || isAsyncAfter(businessObject)) {
73166
- return;
73167
- }
73168
-
73169
- // (2) Delete the camunda:FailedJobRetryTimeCycle and save them for revert
73170
- context.deleteRetryCycleOldExtElements = extensionElements.values;
73171
-
73172
- extensionElements.values = extensionElements.values.filter(
73173
- ele => !is$1(ele, 'camunda:FailedJobRetryTimeCycle'));
72173
+ return;
73174
72174
  }
73175
72175
 
73176
- }, true);
73177
-
73178
- this.reverted([ 'properties-panel.update-businessobject', 'element.updateProperties' ],
73179
- HIGH_PRIORITY$m, function({ context }) {
73180
- const {
73181
- element,
73182
- deleteRetryCycleOldExtElements: oldExtensionElements
73183
- } = context;
73184
-
73185
- const businessObject = getBusinessObject(element);
72176
+ const values = extensionElements.get('values').filter((element) => {
72177
+ return !is$1(element, 'camunda:FailedJobRetryTimeCycle');
72178
+ });
73186
72179
 
73187
- // Only intercept the revert, if the behavior became active
73188
- if (oldExtensionElements) {
73189
- const extensionElements = businessObject.extensionElements;
72180
+ modeling.updateModdleProperties(element, extensionElements, { values });
72181
+ }, true);
73190
72182
 
73191
- extensionElements.values = oldExtensionElements;
73192
- }
73193
- });
72183
+ }
73194
72184
  }
73195
72185
 
73196
-
73197
72186
  DeleteRetryTimeCycleBehavior.$inject = [
73198
- 'eventBus'
72187
+ 'eventBus',
72188
+ 'modeling'
73199
72189
  ];
73200
72190
 
73201
- inherits_browser(DeleteRetryTimeCycleBehavior, CommandInterceptor$1);
73202
-
73203
72191
 
73204
- // helper //////////////////
72192
+ // helpers //////////
73205
72193
 
73206
- /**
73207
- * Returns true if the attribute 'camunda:asyncBefore' is set
73208
- * to true.
73209
- *
73210
- * @param {ModdleElement} bo
73211
- *
73212
- * @return {boolean} a boolean value
73213
- */
73214
- function isAsyncBefore(bo) {
73215
- return !!(bo.get('camunda:asyncBefore') || bo.get('camunda:async'));
72194
+ function isAsyncBefore(businessObject) {
72195
+ return !!(businessObject.get('camunda:asyncBefore') || businessObject.get('camunda:async'));
73216
72196
  }
73217
72197
 
73218
- /**
73219
- * Returns true if the attribute 'camunda:asyncAfter' is set
73220
- * to true.
73221
- *
73222
- * @param {ModdleElement} bo
73223
- *
73224
- * @return {boolean} a boolean value
73225
- */
73226
- function isAsyncAfter(bo) {
73227
- return !!bo.get('camunda:asyncAfter');
72198
+ function isAsyncAfter(businessObject) {
72199
+ return !!businessObject.get('camunda:asyncAfter');
73228
72200
  }
73229
72201
 
73230
72202
  function getTimerEventDefinition(element) {
73231
72203
  return getEventDefinition$2(element, 'bpmn:TimerEventDefinition');
73232
72204
  }
73233
72205
 
73234
- function getEventDefinition$2(element, eventType) {
72206
+ function getEventDefinition$2(element, type) {
73235
72207
  const businessObject = getBusinessObject(element);
73236
72208
 
73237
72209
  const eventDefinitions = businessObject.get('eventDefinitions') || [];
73238
72210
 
73239
- return find(eventDefinitions, function(definition) {
73240
- return is$1(definition, eventType);
72211
+ return eventDefinitions.find((eventDefinition) => {
72212
+ return is$1(eventDefinition, type);
73241
72213
  });
73242
72214
  }
73243
72215
 
73244
- const HIGH_PRIORITY$n = 15000;
72216
+ const HIGH_PRIORITY$n = 5000;
73245
72217
 
73246
72218
 
73247
72219
  /**
73248
- * Camunda BPMN specific `camunda:exclusive` behavior.
73249
- *
73250
- * When `camunda:asyncAfter` or `camunda:asyncBefore` are set to false
73251
- * on an element, then `camunda:exclusive` shall be set to true. This ensures
73252
- * that the BPMN diagram XML reflects the behavior of Camunda Platform engine.
72220
+ * Camunda BPMN specific camunda:exclusive behavior.
73253
72221
  */
73254
- function UpdateCamundaExclusiveBehavior(eventBus) {
73255
-
73256
- CommandInterceptor$1.call(this, eventBus);
72222
+ class UpdateCamundaExclusiveBehavior extends CommandInterceptor {
72223
+ constructor(eventBus) {
72224
+ super(eventBus);
73257
72225
 
73258
- this.preExecute([ 'properties-panel.update-businessobject', 'element.updateProperties' ],
73259
- HIGH_PRIORITY$n, function(context) {
72226
+ /**
72227
+ * Set camunda:exclusive to true on camunda:asyncBefore or camunda:asyncAfter set to false.
72228
+ */
72229
+ this.preExecute([
72230
+ 'element.updateProperties',
72231
+ 'properties-panel.update-businessobject'
72232
+ ], HIGH_PRIORITY$n, function(context) {
73260
72233
  const {
73261
72234
  element,
73262
72235
  properties
@@ -73264,125 +72237,53 @@
73264
72237
 
73265
72238
  const businessObject = getBusinessObject(element);
73266
72239
 
73267
- // (1.1) Execute if...
73268
- if (is$1(element, 'camunda:AsyncCapable') && // ...asyncCapable
73269
- properties && // ...properties updated
73270
- (properties['camunda:asyncBefore'] === false || // ...update async before or (1)
73271
- properties['camunda:asyncAfter'] === false) && // ...update async after (2)
73272
- !isExclusive(businessObject) // ...is currently not exclusive
72240
+ if (!is$1(element, 'camunda:AsyncCapable')
72241
+ || (properties[ 'camunda:asyncBefore' ] !== false && properties[ 'camunda:asyncAfter' ] !== false)
72242
+ || isExclusive(businessObject)
72243
+ || (isAsyncAfter$1(businessObject) && properties[ 'camunda:asyncAfter' ] !== false)
72244
+ || (isAsyncBefore$1(businessObject) && properties[ 'camunda:asyncBefore' ] !== false)
72245
+ || (properties[ 'camunda:asyncBefore' ] === true || properties[ 'camunda:asyncAfter' ] === true)
73273
72246
  ) {
73274
-
73275
- // (1.2) ...but don't execute if...
73276
- if ((isAsyncAfter$1(businessObject) && properties['camunda:asyncAfter'] !== false) || // ...asyncAfter will stay
73277
- (isAsyncBefore$1(businessObject) && properties['camunda:asyncBefore'] !== false) || // ...asyncBefore will stay
73278
- (properties['camunda:asyncBefore'] || properties['camunda:asyncAfter']) // one is set to true
73279
- ) {
73280
- return;
73281
- }
73282
-
73283
- // (2) Update the context
73284
- properties['camunda:exclusive'] = true;
72247
+ return;
73285
72248
  }
72249
+
72250
+ properties[ 'camunda:exclusive' ] = true;
73286
72251
  }, true);
73287
- }
73288
72252
 
72253
+ }
72254
+ }
73289
72255
 
73290
72256
  UpdateCamundaExclusiveBehavior.$inject = [
73291
72257
  'eventBus'
73292
72258
  ];
73293
72259
 
73294
- inherits_browser(UpdateCamundaExclusiveBehavior, CommandInterceptor$1);
73295
-
73296
72260
 
73297
- // helper //////////////////
72261
+ // helpers //////////
73298
72262
 
73299
- /**
73300
- * Returns true if the attribute 'camunda:asyncBefore' is set
73301
- * to true.
73302
- *
73303
- * @param {ModdleElement} bo
73304
- *
73305
- * @return {boolean} a boolean value
73306
- */
73307
- function isAsyncBefore$1(bo) {
73308
- return !!(bo.get('camunda:asyncBefore') || bo.get('camunda:async'));
72263
+ function isAsyncBefore$1(businessObject) {
72264
+ return !!(businessObject.get('camunda:asyncBefore') || businessObject.get('camunda:async'));
73309
72265
  }
73310
72266
 
73311
- /**
73312
- * Returns true if the attribute 'camunda:asyncAfter' is set
73313
- * to true.
73314
- *
73315
- * @param {ModdleElement} bo
73316
- *
73317
- * @return {boolean} a boolean value
73318
- */
73319
- function isAsyncAfter$1(bo) {
73320
- return !!bo.get('camunda:asyncAfter');
72267
+ function isAsyncAfter$1(businessObject) {
72268
+ return !!businessObject.get('camunda:asyncAfter');
73321
72269
  }
73322
72270
 
73323
- /**
73324
- * Returns true if the attribute 'camunda:exclusive' is set
73325
- * to true.
73326
- *
73327
- * @param {ModdleElement} bo
73328
- *
73329
- * @return {boolean} a boolean value
73330
- */
73331
- function isExclusive(bo) {
73332
- return !!bo.get('camunda:exclusive');
72271
+ function isExclusive(businessObject) {
72272
+ return !!businessObject.get('camunda:exclusive');
73333
72273
  }
73334
72274
 
73335
- /**
73336
- * Camunda BPMN specific `camunda:inputOutput` behavior.
73337
- */
73338
- function UpdateInputOutputBehavior(eventBus, modeling) {
73339
-
73340
- CommandInterceptor$1.call(this, eventBus);
73341
-
73342
- this.postExecute([
73343
- 'element.updateProperties',
73344
- 'element.updateModdleProperties',
73345
- 'properties-panel.update-businessobject-list'
73346
- ], function(context) {
73347
- const {
73348
- element,
73349
- oldProperties,
73350
- propertyName
73351
- } = context;
73352
-
73353
- const businessObject = getBusinessObject(element);
73354
- const inputOutput = getInputOutput(businessObject);
73355
- const extensionElements = businessObject.get('extensionElements');
73356
-
73357
- // do not apply if inputOutput got recently added
73358
- if (!oldProperties && propertyName === 'values') {
73359
- return;
73360
- }
72275
+ function getInputOutput(businessObject) {
72276
+ const extensionElements = businessObject.get('extensionElements');
73361
72277
 
73362
- // remove camunda:inputOutput if there are no input/output parameters anymore
73363
- if (inputOutput && isEmpty$1(inputOutput)) {
73364
- const filtered = extensionElements.values.filter(function(element) {
73365
- return element !== inputOutput;
73366
- });
72278
+ if (!extensionElements) {
72279
+ return;
72280
+ }
73367
72281
 
73368
- modeling.updateModdleProperties(element, extensionElements, {
73369
- values: filtered
73370
- });
73371
- }
73372
- }, true);
72282
+ return extensionElements.get('values').find((value) => {
72283
+ return is$1(value, 'camunda:InputOutput');
72284
+ });
73373
72285
  }
73374
72286
 
73375
-
73376
- UpdateInputOutputBehavior.$inject = [
73377
- 'eventBus',
73378
- 'modeling'
73379
- ];
73380
-
73381
- inherits_browser(UpdateInputOutputBehavior, CommandInterceptor$1);
73382
-
73383
-
73384
- // helper //////////////////
73385
-
73386
72287
  function getInputParameters(inputOutput) {
73387
72288
  return inputOutput.get('inputParameters');
73388
72289
  }
@@ -73391,81 +72292,117 @@
73391
72292
  return inputOutput.get('outputParameters');
73392
72293
  }
73393
72294
 
73394
- function getInputOutput(businessObject) {
73395
- const extensionElements = businessObject.get('extensionElements');
72295
+ function isInputOutputEmpty(inputOutput) {
72296
+ const inputParameters = getInputParameters(inputOutput);
72297
+ const outputParameters = getOutputParameters(inputOutput);
73396
72298
 
73397
- if (!extensionElements) {
73398
- return;
73399
- }
72299
+ return !inputParameters.length && !outputParameters.length;
72300
+ }
73400
72301
 
73401
- const values = extensionElements.get('values');
72302
+ /**
72303
+ * Camunda BPMN specific camunda:InputOutput behavior.
72304
+ */
72305
+ class UpdateInputOutputBehavior extends CommandInterceptor {
72306
+ constructor(eventBus, modeling) {
72307
+ super(eventBus);
73402
72308
 
73403
- return values.find((value) => {
73404
- return is$1(value, 'camunda:InputOutput');
73405
- });
73406
- }
72309
+ /**
72310
+ * Remove empty camunda:InputOutput on update.
72311
+ */
72312
+ this.postExecute([
72313
+ 'element.updateProperties',
72314
+ 'element.updateModdleProperties',
72315
+ 'properties-panel.update-businessobject-list'
72316
+ ], function(context) {
72317
+ const {
72318
+ element,
72319
+ oldProperties,
72320
+ propertyName
72321
+ } = context;
73407
72322
 
73408
- function isEmpty$1(inputOutput) {
73409
- const inputParameters = getInputParameters(inputOutput);
73410
- const outputParameters = getOutputParameters(inputOutput);
72323
+ const businessObject = getBusinessObject(element),
72324
+ inputOutput = getInputOutput(businessObject),
72325
+ extensionElements = businessObject.get('extensionElements');
72326
+
72327
+ // do not remove newly added camunda:InputOutput
72328
+ if (!oldProperties && propertyName === 'values') {
72329
+ return;
72330
+ }
72331
+
72332
+ if (inputOutput && isInputOutputEmpty(inputOutput)) {
72333
+ const values = extensionElements.get('values').filter(function(element) {
72334
+ return element !== inputOutput;
72335
+ });
73411
72336
 
73412
- return inputParameters.length === 0 && outputParameters.length === 0;
72337
+ modeling.updateModdleProperties(element, extensionElements, { values });
72338
+ }
72339
+ }, true);
72340
+ }
73413
72341
  }
73414
72342
 
72343
+ UpdateInputOutputBehavior.$inject = [
72344
+ 'eventBus',
72345
+ 'modeling'
72346
+ ];
72347
+
73415
72348
  const HIGH_PRIORITY$o = 5000;
73416
72349
 
73417
72350
 
73418
72351
  /**
73419
- * Camunda BPMN specific `camunda:resultVariable` behavior.
73420
- *
73421
- * When `camunda:resultVariable` is removed from a service task like element
73422
- * `camunda:mapDecisionResult` for the element will be cleaned up.
72352
+ * Camunda BPMN specific camunda:resultVariable behavior.
73423
72353
  */
73424
- function UpdateResultVariableBehavior(eventBus) {
73425
-
73426
- CommandInterceptor$1.call(this, eventBus);
72354
+ class UpdateResultVariableBehavior extends CommandInterceptor {
72355
+ constructor(eventBus) {
72356
+ super(eventBus);
73427
72357
 
73428
- this.preExecute([ 'properties-panel.update-businessobject', 'element.updateProperties' ],
73429
- HIGH_PRIORITY$o, function(context) {
72358
+ /**
72359
+ * Remove camunda:mapDecisionResult on camunda:resultVariable removed.
72360
+ */
72361
+ this.preExecute([
72362
+ 'element.updateProperties',
72363
+ 'properties-panel.update-businessobject'
72364
+ ], HIGH_PRIORITY$o, function(context) {
73430
72365
  const {
73431
72366
  element,
73432
72367
  properties
73433
72368
  } = context;
73434
72369
 
73435
72370
  if (
73436
- is$1(element, 'camunda:DmnCapable') &&
73437
- has(properties, 'camunda:resultVariable') &&
73438
- isEmpty$2(properties['camunda:resultVariable'])
72371
+ is$1(element, 'camunda:DmnCapable')
72372
+ && has(properties, 'camunda:resultVariable')
72373
+ && isEmpty$1(properties[ 'camunda:resultVariable' ])
73439
72374
  ) {
73440
- properties['camunda:mapDecisionResult'] = null;
72375
+ properties[ 'camunda:mapDecisionResult' ] = null;
73441
72376
  }
73442
72377
  }, true);
73443
- }
73444
72378
 
72379
+ }
72380
+ }
73445
72381
 
73446
72382
  UpdateResultVariableBehavior.$inject = [
73447
72383
  'eventBus'
73448
72384
  ];
73449
72385
 
73450
- inherits_browser(UpdateResultVariableBehavior, CommandInterceptor$1);
73451
72386
 
72387
+ // helpers //////////
73452
72388
 
73453
- // helper //////////////////
73454
-
73455
- function isEmpty$2(value) {
72389
+ function isEmpty$1(value) {
73456
72390
  return value == undefined || value === '';
73457
72391
  }
73458
72392
 
73459
72393
  /**
73460
- * Camunda BPMN specific user task forms behavior ensuring that only one of the following options is configured:
73461
- *
73462
- * 1. embedded, external or Camunda forms using camunda:formKey
73463
- * 2. Camunda forms using camunda:formRef
72394
+ * Camunda BPMN specific user task forms behavior.
73464
72395
  */
73465
- class UserTaskFormsBehavior extends CommandInterceptor$1 {
72396
+ class UserTaskFormsBehavior extends CommandInterceptor {
73466
72397
  constructor(eventBus) {
73467
72398
  super(eventBus);
73468
72399
 
72400
+ /**
72401
+ * Ensure that only one of the following options is configured:
72402
+ *
72403
+ * 1. embedded, external or Camunda forms using camunda:formKey
72404
+ * 2. Camunda forms using camunda:formRef
72405
+ */
73469
72406
  this.preExecute([
73470
72407
  'element.updateProperties',
73471
72408
  'element.updateModdleProperties',
@@ -73479,13 +72416,13 @@
73479
72416
  context.element.businessObject
73480
72417
  );
73481
72418
 
73482
- if ('camunda:formKey' in properties) {
72419
+ if (has(properties, 'camunda:formKey')) {
73483
72420
  Object.assign(properties, {
73484
72421
  'camunda:formRef': undefined,
73485
72422
  'camunda:formRefBinding': undefined,
73486
72423
  'camunda:formRefVersion': undefined
73487
72424
  });
73488
- } else if ('camunda:formRef' in properties) {
72425
+ } else if (has(properties, 'camunda:formRef')) {
73489
72426
  Object.assign(properties, {
73490
72427
  'camunda:formKey': undefined
73491
72428
  });
@@ -73497,23 +72434,23 @@
73497
72434
  });
73498
72435
  }
73499
72436
 
73500
- if (!('camunda:formRefBinding' in properties) && isUndefined(businessObject.get('camunda:formRefBinding'))) {
72437
+ if (!has(properties, 'camunda:formRefBinding') && isUndefined(businessObject.get('camunda:formRefBinding'))) {
73501
72438
  Object.assign(properties, {
73502
72439
  'camunda:formRefBinding': 'latest'
73503
72440
  });
73504
72441
  }
73505
72442
  }
73506
72443
 
73507
- if ('camunda:formRefBinding' in properties && properties[ 'camunda:formRefBinding' ] !== 'version') {
72444
+ if (has(properties, 'camunda:formRefBinding') && properties[ 'camunda:formRefBinding' ] !== 'version') {
73508
72445
  Object.assign(properties, {
73509
72446
  'camunda:formRefVersion': undefined
73510
72447
  });
73511
72448
  }
73512
72449
  }, true);
72450
+
73513
72451
  }
73514
72452
  }
73515
72453
 
73516
-
73517
72454
  UserTaskFormsBehavior.$inject = [ 'eventBus' ];
73518
72455
 
73519
72456
  /**
@@ -73523,7 +72460,7 @@
73523
72460
  * 2. Updates camunda:FormData#businessKey if camunda:FormField#id is changed.
73524
72461
  * 3. Removes camunda:FormData#businessKey if camunda:FormField is removed.
73525
72462
  */
73526
- class UserTaskFormsBehavior$1 extends CommandInterceptor$1 {
72463
+ class UserTaskFormsBehavior$1 extends CommandInterceptor {
73527
72464
  constructor(eventBus, modeling) {
73528
72465
  super(eventBus);
73529
72466
 
@@ -74478,7 +73415,7 @@
74478
73415
  * console.log(evens);
74479
73416
  * // => [2, 4]
74480
73417
  */
74481
- function remove$4(array, predicate) {
73418
+ function remove$3(array, predicate) {
74482
73419
  var result = [];
74483
73420
  if (!(array && array.length)) {
74484
73421
  return result;
@@ -74499,7 +73436,7 @@
74499
73436
  return result;
74500
73437
  }
74501
73438
 
74502
- var remove_1 = remove$4;
73439
+ var remove_1 = remove$3;
74503
73440
 
74504
73441
  var findExtension$1 = Helper.findExtension,
74505
73442
  findExtensions$1 = Helper.findExtensions,
@@ -83416,7 +82353,7 @@
83416
82353
  * @param {Object} e
83417
82354
  * @param {boolean} unique
83418
82355
  */
83419
- function add$3(elements, e, unique) {
82356
+ function add$2(elements, e, unique) {
83420
82357
  var canAdd = !unique || elements.indexOf(e) === -1;
83421
82358
 
83422
82359
  if (canAdd) {
@@ -83440,7 +82377,7 @@
83440
82377
  processedFlowElements = [];
83441
82378
 
83442
82379
  eachElement$1(elements, function(element, i, depth) {
83443
- add$3(result, element, unique);
82380
+ add$2(result, element, unique);
83444
82381
 
83445
82382
  var flowElements = element.flowElements;
83446
82383
 
@@ -83448,7 +82385,7 @@
83448
82385
  if (maxDepth === -1 || depth < maxDepth) {
83449
82386
 
83450
82387
  // flowElements exist && flowElements not yet processed
83451
- if (flowElements && add$3(processedFlowElements, flowElements, unique)) {
82388
+ if (flowElements && add$2(processedFlowElements, flowElements, unique)) {
83452
82389
  return flowElements;
83453
82390
  }
83454
82391
  }
@@ -86338,7 +85275,7 @@
86338
85275
 
86339
85276
  var constraints = property.constraints || {};
86340
85277
 
86341
- if (constraints.notEmpty && isEmpty$3(value)) {
85278
+ if (constraints.notEmpty && isEmpty$2(value)) {
86342
85279
  return translate('Must not be empty');
86343
85280
  }
86344
85281
 
@@ -86415,7 +85352,7 @@
86415
85352
  return regexp.test(str);
86416
85353
  }
86417
85354
 
86418
- function isEmpty$3(str) {
85355
+ function isEmpty$2(str) {
86419
85356
  return !str || /^\s*$/.test(str);
86420
85357
  }
86421
85358
 
@@ -91034,12 +89971,12 @@
91034
89971
  return allowedIn.indexOf(WILDCARD) !== -1;
91035
89972
  }
91036
89973
 
91037
- var require$$0$1 = /*@__PURE__*/getAugmentedNamespace(CommandInterceptor$2);
89974
+ var require$$0$1 = /*@__PURE__*/getAugmentedNamespace(CommandInterceptor$1);
91038
89975
 
91039
89976
  var find$5 = require$$0.find,
91040
89977
  matchPattern$1 = require$$0.matchPattern;
91041
89978
 
91042
- var CommandInterceptor$3 = require$$0$1.default;
89979
+ var CommandInterceptor$2 = require$$0$1.default;
91043
89980
 
91044
89981
  var collectionAdd$1 = require$$2$2.add,
91045
89982
  collectionRemove = require$$2$2.remove;
@@ -91047,7 +89984,7 @@
91047
89984
  var getBusinessObject$T = require$$1.getBusinessObject,
91048
89985
  is$O = require$$1.is;
91049
89986
 
91050
- var LOW_PRIORITY$p = 500;
89987
+ var LOW_PRIORITY$o = 500;
91051
89988
 
91052
89989
 
91053
89990
  /**
@@ -91058,7 +89995,7 @@
91058
89995
  bpmnjs, eventBus, injector, moddleCopy, bpmnFactory
91059
89996
  ) {
91060
89997
 
91061
- injector.invoke(CommandInterceptor$3, this);
89998
+ injector.invoke(CommandInterceptor$2, this);
91062
89999
 
91063
90000
 
91064
90001
  function hasRootElement(rootElement) {
@@ -91129,7 +90066,7 @@
91129
90066
  });
91130
90067
 
91131
90068
 
91132
- eventBus.on('copyPaste.pasteElement', LOW_PRIORITY$p, function(context) {
90069
+ eventBus.on('copyPaste.pasteElement', LOW_PRIORITY$o, function(context) {
91133
90070
  var descriptor = context.descriptor,
91134
90071
  businessObject = descriptor.businessObject;
91135
90072
 
@@ -91173,7 +90110,7 @@
91173
90110
  'bpmnFactory'
91174
90111
  ];
91175
90112
 
91176
- inherits_browser(CopyPasteRootElementBehavior, CommandInterceptor$3);
90113
+ inherits_browser(CopyPasteRootElementBehavior, CommandInterceptor$2);
91177
90114
 
91178
90115
  var CopyPasteRootElementBehavior_1 = CopyPasteRootElementBehavior;
91179
90116
 
@@ -91258,7 +90195,7 @@
91258
90195
  return extensionElements.values.indexOf(extensionElement);
91259
90196
  }
91260
90197
 
91261
- var CommandInterceptor$4 = require$$0$1.default;
90198
+ var CommandInterceptor$3 = require$$0$1.default;
91262
90199
  var is$P = require$$1.is;
91263
90200
  var getBusinessObject$U = require$$1.getBusinessObject;
91264
90201
 
@@ -91269,7 +90206,7 @@
91269
90206
  modeling, injector
91270
90207
  ) {
91271
90208
 
91272
- injector.invoke(CommandInterceptor$4, this);
90209
+ injector.invoke(CommandInterceptor$3, this);
91273
90210
 
91274
90211
  this.postExecuted(['shape.create','shape.move'], function(context) {
91275
90212
 
@@ -91297,11 +90234,11 @@
91297
90234
  'injector',
91298
90235
  ];
91299
90236
 
91300
- inherits_browser(RemoveInitiatorBehaviour, CommandInterceptor$4);
90237
+ inherits_browser(RemoveInitiatorBehaviour, CommandInterceptor$3);
91301
90238
 
91302
90239
  var RemoveInitiatorBehaviour_1 = RemoveInitiatorBehaviour;
91303
90240
 
91304
- var CommandInterceptor$5 = require$$0$1.default;
90241
+ var CommandInterceptor$4 = require$$0$1.default;
91305
90242
  var is$Q = require$$1.is;
91306
90243
  var getBusinessObject$V = require$$1.getBusinessObject;
91307
90244
 
@@ -91311,7 +90248,7 @@
91311
90248
  function RemoveVariableEventBehaviour(
91312
90249
  modeling, injector, bpmnFactory, moddleCopy
91313
90250
  ) {
91314
- injector.invoke(CommandInterceptor$5, this);
90251
+ injector.invoke(CommandInterceptor$4, this);
91315
90252
 
91316
90253
  this.postExecuted(['shape.move', 'shape.create'], function(context) {
91317
90254
 
@@ -91363,7 +90300,7 @@
91363
90300
  'moddleCopy'
91364
90301
  ];
91365
90302
 
91366
- inherits_browser(RemoveVariableEventBehaviour, CommandInterceptor$5);
90303
+ inherits_browser(RemoveVariableEventBehaviour, CommandInterceptor$4);
91367
90304
 
91368
90305
  var RemoveVariableEventBehaviour_1 = RemoveVariableEventBehaviour;
91369
90306