camunda-bpmn-js 0.13.0-alpha.2 → 0.13.0-alpha.3

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.
@@ -17361,16 +17361,16 @@
17361
17361
  return drawPath(parentGfx, path, assign({ 'data-marker': type }, attrs));
17362
17362
  }
17363
17363
 
17364
+ function renderer(type) {
17365
+ return handlers[type];
17366
+ }
17367
+
17364
17368
  function as(type) {
17365
17369
  return function(parentGfx, element) {
17366
- return handlers[type](parentGfx, element);
17370
+ return renderer(type)(parentGfx, element);
17367
17371
  };
17368
17372
  }
17369
17373
 
17370
- function renderer(type) {
17371
- return handlers[type];
17372
- }
17373
-
17374
17374
  function renderEventContent(element, parentGfx) {
17375
17375
 
17376
17376
  var event = getSemantic(element);
@@ -18851,6 +18851,7 @@
18851
18851
  // extension API, use at your own risk
18852
18852
  this._drawPath = drawPath;
18853
18853
 
18854
+ this._renderer = renderer;
18854
18855
  }
18855
18856
 
18856
18857
 
@@ -18872,7 +18873,7 @@
18872
18873
 
18873
18874
  BpmnRenderer.prototype.drawShape = function(parentGfx, element) {
18874
18875
  var type = element.type;
18875
- var h = this.handlers[type];
18876
+ var h = this._renderer(type);
18876
18877
 
18877
18878
  /* jshint -W040 */
18878
18879
  return h(parentGfx, element);
@@ -18880,7 +18881,7 @@
18880
18881
 
18881
18882
  BpmnRenderer.prototype.drawConnection = function(parentGfx, element) {
18882
18883
  var type = element.type;
18883
- var h = this.handlers[type];
18884
+ var h = this._renderer(type);
18884
18885
 
18885
18886
  /* jshint -W040 */
18886
18887
  return h(parentGfx, element);
@@ -19885,7 +19886,7 @@
19885
19886
  });
19886
19887
  }
19887
19888
 
19888
- var translateModule = {
19889
+ var translate$2 = {
19889
19890
  translate: [ 'value', translate$1 ]
19890
19891
  };
19891
19892
 
@@ -20366,7 +20367,7 @@
20366
20367
 
20367
20368
  var ImportModule = {
20368
20369
  __depends__: [
20369
- translateModule
20370
+ translate$2
20370
20371
  ],
20371
20372
  bpmnImporter: [ 'type', BpmnImporter ]
20372
20373
  };
@@ -22735,6 +22736,11 @@
22735
22736
 
22736
22737
  plane.get('planeElement').forEach(function(diElement) {
22737
22738
  var bo = diElement.bpmnElement;
22739
+
22740
+ if (!bo) {
22741
+ return;
22742
+ }
22743
+
22738
22744
  var parent = bo.$parent;
22739
22745
 
22740
22746
  if (is$1(bo, 'bpmn:SubProcess') && !diElement.isExpanded) {
@@ -22764,7 +22770,7 @@
22764
22770
  var parent = element.parent;
22765
22771
 
22766
22772
  // parent is expanded, get nearest collapsed parent
22767
- while (parent && !collapsedElements.includes(parent)) {
22773
+ while (parent && collapsedElements.indexOf(parent) === -1) {
22768
22774
  parent = parent.$parent;
22769
22775
  }
22770
22776
 
@@ -23102,7 +23108,7 @@
23102
23108
  // modules the viewer is composed of
23103
23109
  Viewer.prototype._modules = [
23104
23110
  CoreModule$1,
23105
- translateModule,
23111
+ translate$2,
23106
23112
  SelectionModule,
23107
23113
  OverlaysModule,
23108
23114
  DrilldownModdule
@@ -23255,7 +23261,7 @@
23255
23261
  }
23256
23262
 
23257
23263
  var allowedModifiers = this._getAllowedModifiers(event.target);
23258
- return !allowedModifiers.includes(event.key);
23264
+ return allowedModifiers.indexOf(event.key) === -1;
23259
23265
  };
23260
23266
 
23261
23267
  Keyboard.prototype._getAllowedModifiers = function(element) {
@@ -31568,6 +31574,537 @@
31568
31574
  connectionPreview: [ 'type', ConnectionPreview ]
31569
31575
  };
31570
31576
 
31577
+ function getOriginal$1(event) {
31578
+ return event.originalEvent || event.srcEvent;
31579
+ }
31580
+
31581
+ function isButton$1(event, button) {
31582
+ return (getOriginal$1(event) || event).button === button;
31583
+ }
31584
+
31585
+ function isPrimaryButton$1(event) {
31586
+
31587
+ // button === 0 -> left áka primary mouse button
31588
+ return isButton$1(event, 0);
31589
+ }
31590
+
31591
+ function isAuxiliaryButton$1(event) {
31592
+
31593
+ // button === 1 -> auxiliary áka wheel button
31594
+ return isButton$1(event, 1);
31595
+ }
31596
+
31597
+ function toSVGPoints$1(points) {
31598
+ var result = '';
31599
+
31600
+ for (var i = 0, p; (p = points[i]); i++) {
31601
+ result += p.x + ',' + p.y + ' ';
31602
+ }
31603
+
31604
+ return result;
31605
+ }
31606
+
31607
+ function createLine$1(points, attrs) {
31608
+
31609
+ var line = create('polyline');
31610
+ attr$1(line, { points: toSVGPoints$1(points) });
31611
+
31612
+ if (attrs) {
31613
+ attr$1(line, attrs);
31614
+ }
31615
+
31616
+ return line;
31617
+ }
31618
+
31619
+ function updateLine$1(gfx, points) {
31620
+ attr$1(gfx, { points: toSVGPoints$1(points) });
31621
+
31622
+ return gfx;
31623
+ }
31624
+
31625
+ function allowAll$1(event) { return true; }
31626
+
31627
+ function allowPrimaryAndAuxiliary$1(event) {
31628
+ return isPrimaryButton$1(event) || isAuxiliaryButton$1(event);
31629
+ }
31630
+
31631
+ var LOW_PRIORITY$7 = 500;
31632
+
31633
+
31634
+ /**
31635
+ * A plugin that provides interaction events for diagram elements.
31636
+ *
31637
+ * It emits the following events:
31638
+ *
31639
+ * * element.click
31640
+ * * element.contextmenu
31641
+ * * element.dblclick
31642
+ * * element.hover
31643
+ * * element.mousedown
31644
+ * * element.mousemove
31645
+ * * element.mouseup
31646
+ * * element.out
31647
+ *
31648
+ * Each event is a tuple { element, gfx, originalEvent }.
31649
+ *
31650
+ * Canceling the event via Event#preventDefault()
31651
+ * prevents the original DOM operation.
31652
+ *
31653
+ * @param {EventBus} eventBus
31654
+ */
31655
+ function InteractionEvents$1(eventBus, elementRegistry, styles) {
31656
+
31657
+ var self = this;
31658
+
31659
+ /**
31660
+ * Fire an interaction event.
31661
+ *
31662
+ * @param {string} type local event name, e.g. element.click.
31663
+ * @param {DOMEvent} event native event
31664
+ * @param {djs.model.Base} [element] the diagram element to emit the event on;
31665
+ * defaults to the event target
31666
+ */
31667
+ function fire(type, event, element) {
31668
+
31669
+ if (isIgnored(type, event)) {
31670
+ return;
31671
+ }
31672
+
31673
+ var target, gfx, returnValue;
31674
+
31675
+ if (!element) {
31676
+ target = event.delegateTarget || event.target;
31677
+
31678
+ if (target) {
31679
+ gfx = target;
31680
+ element = elementRegistry.get(gfx);
31681
+ }
31682
+ } else {
31683
+ gfx = elementRegistry.getGraphics(element);
31684
+ }
31685
+
31686
+ if (!gfx || !element) {
31687
+ return;
31688
+ }
31689
+
31690
+ returnValue = eventBus.fire(type, {
31691
+ element: element,
31692
+ gfx: gfx,
31693
+ originalEvent: event
31694
+ });
31695
+
31696
+ if (returnValue === false) {
31697
+ event.stopPropagation();
31698
+ event.preventDefault();
31699
+ }
31700
+ }
31701
+
31702
+ // TODO(nikku): document this
31703
+ var handlers = {};
31704
+
31705
+ function mouseHandler(localEventName) {
31706
+ return handlers[localEventName];
31707
+ }
31708
+
31709
+ function isIgnored(localEventName, event) {
31710
+
31711
+ var filter = ignoredFilters[localEventName] || isPrimaryButton$1;
31712
+
31713
+ // only react on left mouse button interactions
31714
+ // except for interaction events that are enabled
31715
+ // for secundary mouse button
31716
+ return !filter(event);
31717
+ }
31718
+
31719
+ var bindings = {
31720
+ click: 'element.click',
31721
+ contextmenu: 'element.contextmenu',
31722
+ dblclick: 'element.dblclick',
31723
+ mousedown: 'element.mousedown',
31724
+ mousemove: 'element.mousemove',
31725
+ mouseover: 'element.hover',
31726
+ mouseout: 'element.out',
31727
+ mouseup: 'element.mouseup',
31728
+ };
31729
+
31730
+ var ignoredFilters = {
31731
+ 'element.contextmenu': allowAll$1,
31732
+ 'element.mousedown': allowPrimaryAndAuxiliary$1,
31733
+ 'element.mouseup': allowPrimaryAndAuxiliary$1,
31734
+ 'element.click': allowPrimaryAndAuxiliary$1,
31735
+ 'element.dblclick': allowPrimaryAndAuxiliary$1
31736
+ };
31737
+
31738
+
31739
+ // manual event trigger //////////
31740
+
31741
+ /**
31742
+ * Trigger an interaction event (based on a native dom event)
31743
+ * on the target shape or connection.
31744
+ *
31745
+ * @param {string} eventName the name of the triggered DOM event
31746
+ * @param {MouseEvent} event
31747
+ * @param {djs.model.Base} targetElement
31748
+ */
31749
+ function triggerMouseEvent(eventName, event, targetElement) {
31750
+
31751
+ // i.e. element.mousedown...
31752
+ var localEventName = bindings[eventName];
31753
+
31754
+ if (!localEventName) {
31755
+ throw new Error('unmapped DOM event name <' + eventName + '>');
31756
+ }
31757
+
31758
+ return fire(localEventName, event, targetElement);
31759
+ }
31760
+
31761
+
31762
+ var ELEMENT_SELECTOR = 'svg, .djs-element';
31763
+
31764
+ // event handling ///////
31765
+
31766
+ function registerEvent(node, event, localEvent, ignoredFilter) {
31767
+
31768
+ var handler = handlers[localEvent] = function(event) {
31769
+ fire(localEvent, event);
31770
+ };
31771
+
31772
+ if (ignoredFilter) {
31773
+ ignoredFilters[localEvent] = ignoredFilter;
31774
+ }
31775
+
31776
+ handler.$delegate = delegate.bind(node, ELEMENT_SELECTOR, event, handler);
31777
+ }
31778
+
31779
+ function unregisterEvent(node, event, localEvent) {
31780
+
31781
+ var handler = mouseHandler(localEvent);
31782
+
31783
+ if (!handler) {
31784
+ return;
31785
+ }
31786
+
31787
+ delegate.unbind(node, event, handler.$delegate);
31788
+ }
31789
+
31790
+ function registerEvents(svg) {
31791
+ forEach(bindings, function(val, key) {
31792
+ registerEvent(svg, key, val);
31793
+ });
31794
+ }
31795
+
31796
+ function unregisterEvents(svg) {
31797
+ forEach(bindings, function(val, key) {
31798
+ unregisterEvent(svg, key, val);
31799
+ });
31800
+ }
31801
+
31802
+ eventBus.on('canvas.destroy', function(event) {
31803
+ unregisterEvents(event.svg);
31804
+ });
31805
+
31806
+ eventBus.on('canvas.init', function(event) {
31807
+ registerEvents(event.svg);
31808
+ });
31809
+
31810
+
31811
+ // hit box updating ////////////////
31812
+
31813
+ eventBus.on([ 'shape.added', 'connection.added' ], function(event) {
31814
+ var element = event.element,
31815
+ gfx = event.gfx;
31816
+
31817
+ eventBus.fire('interactionEvents.createHit', { element: element, gfx: gfx });
31818
+ });
31819
+
31820
+ // Update djs-hit on change.
31821
+ // A low priortity is necessary, because djs-hit of labels has to be updated
31822
+ // after the label bounds have been updated in the renderer.
31823
+ eventBus.on([
31824
+ 'shape.changed',
31825
+ 'connection.changed'
31826
+ ], LOW_PRIORITY$7, function(event) {
31827
+
31828
+ var element = event.element,
31829
+ gfx = event.gfx;
31830
+
31831
+ eventBus.fire('interactionEvents.updateHit', { element: element, gfx: gfx });
31832
+ });
31833
+
31834
+ eventBus.on('interactionEvents.createHit', LOW_PRIORITY$7, function(event) {
31835
+ var element = event.element,
31836
+ gfx = event.gfx;
31837
+
31838
+ self.createDefaultHit(element, gfx);
31839
+ });
31840
+
31841
+ eventBus.on('interactionEvents.updateHit', function(event) {
31842
+ var element = event.element,
31843
+ gfx = event.gfx;
31844
+
31845
+ self.updateDefaultHit(element, gfx);
31846
+ });
31847
+
31848
+
31849
+ // hit styles ////////////
31850
+
31851
+ var STROKE_HIT_STYLE = createHitStyle('djs-hit djs-hit-stroke');
31852
+
31853
+ var CLICK_STROKE_HIT_STYLE = createHitStyle('djs-hit djs-hit-click-stroke');
31854
+
31855
+ var ALL_HIT_STYLE = createHitStyle('djs-hit djs-hit-all');
31856
+
31857
+ var HIT_TYPES = {
31858
+ 'all': ALL_HIT_STYLE,
31859
+ 'click-stroke': CLICK_STROKE_HIT_STYLE,
31860
+ 'stroke': STROKE_HIT_STYLE
31861
+ };
31862
+
31863
+ function createHitStyle(classNames, attrs) {
31864
+
31865
+ attrs = assign({
31866
+ stroke: 'white',
31867
+ strokeWidth: 15
31868
+ }, attrs || {});
31869
+
31870
+ return styles.cls(classNames, [ 'no-fill', 'no-border' ], attrs);
31871
+ }
31872
+
31873
+
31874
+ // style helpers ///////////////
31875
+
31876
+ function applyStyle(hit, type) {
31877
+
31878
+ var attrs = HIT_TYPES[type];
31879
+
31880
+ if (!attrs) {
31881
+ throw new Error('invalid hit type <' + type + '>');
31882
+ }
31883
+
31884
+ attr$1(hit, attrs);
31885
+
31886
+ return hit;
31887
+ }
31888
+
31889
+ function appendHit(gfx, hit) {
31890
+ append(gfx, hit);
31891
+ }
31892
+
31893
+
31894
+ // API
31895
+
31896
+ /**
31897
+ * Remove hints on the given graphics.
31898
+ *
31899
+ * @param {SVGElement} gfx
31900
+ */
31901
+ this.removeHits = function(gfx) {
31902
+ var hits = all('.djs-hit', gfx);
31903
+
31904
+ forEach(hits, remove$1);
31905
+ };
31906
+
31907
+ /**
31908
+ * Create default hit for the given element.
31909
+ *
31910
+ * @param {djs.model.Base} element
31911
+ * @param {SVGElement} gfx
31912
+ *
31913
+ * @return {SVGElement} created hit
31914
+ */
31915
+ this.createDefaultHit = function(element, gfx) {
31916
+ var waypoints = element.waypoints,
31917
+ isFrame = element.isFrame,
31918
+ boxType;
31919
+
31920
+ if (waypoints) {
31921
+ return this.createWaypointsHit(gfx, waypoints);
31922
+ } else {
31923
+
31924
+ boxType = isFrame ? 'stroke' : 'all';
31925
+
31926
+ return this.createBoxHit(gfx, boxType, {
31927
+ width: element.width,
31928
+ height: element.height
31929
+ });
31930
+ }
31931
+ };
31932
+
31933
+ /**
31934
+ * Create hits for the given waypoints.
31935
+ *
31936
+ * @param {SVGElement} gfx
31937
+ * @param {Array<Point>} waypoints
31938
+ *
31939
+ * @return {SVGElement}
31940
+ */
31941
+ this.createWaypointsHit = function(gfx, waypoints) {
31942
+
31943
+ var hit = createLine$1(waypoints);
31944
+
31945
+ applyStyle(hit, 'stroke');
31946
+
31947
+ appendHit(gfx, hit);
31948
+
31949
+ return hit;
31950
+ };
31951
+
31952
+ /**
31953
+ * Create hits for a box.
31954
+ *
31955
+ * @param {SVGElement} gfx
31956
+ * @param {string} hitType
31957
+ * @param {Object} attrs
31958
+ *
31959
+ * @return {SVGElement}
31960
+ */
31961
+ this.createBoxHit = function(gfx, type, attrs) {
31962
+
31963
+ attrs = assign({
31964
+ x: 0,
31965
+ y: 0
31966
+ }, attrs);
31967
+
31968
+ var hit = create('rect');
31969
+
31970
+ applyStyle(hit, type);
31971
+
31972
+ attr$1(hit, attrs);
31973
+
31974
+ appendHit(gfx, hit);
31975
+
31976
+ return hit;
31977
+ };
31978
+
31979
+ /**
31980
+ * Update default hit of the element.
31981
+ *
31982
+ * @param {djs.model.Base} element
31983
+ * @param {SVGElement} gfx
31984
+ *
31985
+ * @return {SVGElement} updated hit
31986
+ */
31987
+ this.updateDefaultHit = function(element, gfx) {
31988
+
31989
+ var hit = query('.djs-hit', gfx);
31990
+
31991
+ if (!hit) {
31992
+ return;
31993
+ }
31994
+
31995
+ if (element.waypoints) {
31996
+ updateLine$1(hit, element.waypoints);
31997
+ } else {
31998
+ attr$1(hit, {
31999
+ width: element.width,
32000
+ height: element.height
32001
+ });
32002
+ }
32003
+
32004
+ return hit;
32005
+ };
32006
+
32007
+ this.fire = fire;
32008
+
32009
+ this.triggerMouseEvent = triggerMouseEvent;
32010
+
32011
+ this.mouseHandler = mouseHandler;
32012
+
32013
+ this.registerEvent = registerEvent;
32014
+ this.unregisterEvent = unregisterEvent;
32015
+ }
32016
+
32017
+
32018
+ InteractionEvents$1.$inject = [
32019
+ 'eventBus',
32020
+ 'elementRegistry',
32021
+ 'styles'
32022
+ ];
32023
+
32024
+
32025
+ /**
32026
+ * An event indicating that the mouse hovered over an element
32027
+ *
32028
+ * @event element.hover
32029
+ *
32030
+ * @type {Object}
32031
+ * @property {djs.model.Base} element
32032
+ * @property {SVGElement} gfx
32033
+ * @property {Event} originalEvent
32034
+ */
32035
+
32036
+ /**
32037
+ * An event indicating that the mouse has left an element
32038
+ *
32039
+ * @event element.out
32040
+ *
32041
+ * @type {Object}
32042
+ * @property {djs.model.Base} element
32043
+ * @property {SVGElement} gfx
32044
+ * @property {Event} originalEvent
32045
+ */
32046
+
32047
+ /**
32048
+ * An event indicating that the mouse has clicked an element
32049
+ *
32050
+ * @event element.click
32051
+ *
32052
+ * @type {Object}
32053
+ * @property {djs.model.Base} element
32054
+ * @property {SVGElement} gfx
32055
+ * @property {Event} originalEvent
32056
+ */
32057
+
32058
+ /**
32059
+ * An event indicating that the mouse has double clicked an element
32060
+ *
32061
+ * @event element.dblclick
32062
+ *
32063
+ * @type {Object}
32064
+ * @property {djs.model.Base} element
32065
+ * @property {SVGElement} gfx
32066
+ * @property {Event} originalEvent
32067
+ */
32068
+
32069
+ /**
32070
+ * An event indicating that the mouse has gone down on an element.
32071
+ *
32072
+ * @event element.mousedown
32073
+ *
32074
+ * @type {Object}
32075
+ * @property {djs.model.Base} element
32076
+ * @property {SVGElement} gfx
32077
+ * @property {Event} originalEvent
32078
+ */
32079
+
32080
+ /**
32081
+ * An event indicating that the mouse has gone up on an element.
32082
+ *
32083
+ * @event element.mouseup
32084
+ *
32085
+ * @type {Object}
32086
+ * @property {djs.model.Base} element
32087
+ * @property {SVGElement} gfx
32088
+ * @property {Event} originalEvent
32089
+ */
32090
+
32091
+ /**
32092
+ * An event indicating that the context menu action is triggered
32093
+ * via mouse or touch controls.
32094
+ *
32095
+ * @event element.contextmenu
32096
+ *
32097
+ * @type {Object}
32098
+ * @property {djs.model.Base} element
32099
+ * @property {SVGElement} gfx
32100
+ * @property {Event} originalEvent
32101
+ */
32102
+
32103
+ var InteractionEventsModule$1 = {
32104
+ __init__: [ 'interactionEvents' ],
32105
+ interactionEvents: [ 'type', InteractionEvents$1 ]
32106
+ };
32107
+
31571
32108
  var min = Math.min,
31572
32109
  max$1 = Math.max;
31573
32110
 
@@ -32201,7 +32738,7 @@
32201
32738
 
32202
32739
  var DirectEditingModule = {
32203
32740
  __depends__: [
32204
- InteractionEventsModule
32741
+ InteractionEventsModule$1
32205
32742
  ],
32206
32743
  __init__: [ 'directEditing' ],
32207
32744
  directEditing: [ 'type', DirectEditing ]
@@ -33154,7 +33691,7 @@
33154
33691
  return !!element.labelTarget;
33155
33692
  }
33156
33693
 
33157
- var LOW_PRIORITY$7 = 750;
33694
+ var LOW_PRIORITY$8 = 750;
33158
33695
 
33159
33696
 
33160
33697
  function CreatePreview(
@@ -33199,7 +33736,7 @@
33199
33736
  return dragGroup;
33200
33737
  }
33201
33738
 
33202
- eventBus.on('create.move', LOW_PRIORITY$7, function(event) {
33739
+ eventBus.on('create.move', LOW_PRIORITY$8, function(event) {
33203
33740
 
33204
33741
  var hover = event.hover,
33205
33742
  context = event.context,
@@ -34566,12 +35103,12 @@
34566
35103
  });
34567
35104
  }
34568
35105
 
34569
- var LOW_PRIORITY$8 = 750;
35106
+ var LOW_PRIORITY$9 = 750;
34570
35107
 
34571
35108
 
34572
35109
  function BpmnCopyPaste(bpmnFactory, eventBus, moddleCopy) {
34573
35110
 
34574
- eventBus.on('copyPaste.copyElement', LOW_PRIORITY$8, function(context) {
35111
+ eventBus.on('copyPaste.copyElement', LOW_PRIORITY$9, function(context) {
34575
35112
  var descriptor = context.descriptor,
34576
35113
  element = context.element;
34577
35114
 
@@ -38379,7 +38916,7 @@
38379
38916
  }
38380
38917
 
38381
38918
  var LOWER_PRIORITY = 1200;
38382
- var LOW_PRIORITY$9 = 800;
38919
+ var LOW_PRIORITY$a = 800;
38383
38920
 
38384
38921
  /**
38385
38922
  * Basic grid snapping that covers connecting, creating, moving, resizing shapes, moving bendpoints
@@ -38393,7 +38930,7 @@
38393
38930
 
38394
38931
  var self = this;
38395
38932
 
38396
- eventBus.on('diagram.init', LOW_PRIORITY$9, function() {
38933
+ eventBus.on('diagram.init', LOW_PRIORITY$a, function() {
38397
38934
  self.setActive(active);
38398
38935
  });
38399
38936
 
@@ -39284,7 +39821,7 @@
39284
39821
  return true;
39285
39822
  };
39286
39823
 
39287
- var InteractionEventsModule$1 = {
39824
+ var InteractionEventsModule$2 = {
39288
39825
  __init__: [ 'bpmnInteractionEvents' ],
39289
39826
  bpmnInteractionEvents: [ 'type', BpmnInteractionEvents ]
39290
39827
  };
@@ -39870,7 +40407,7 @@
39870
40407
  var MARKER_RESIZING = 'djs-resizing',
39871
40408
  MARKER_RESIZE_NOT_OK = 'resize-not-ok';
39872
40409
 
39873
- var LOW_PRIORITY$a = 500;
40410
+ var LOW_PRIORITY$b = 500;
39874
40411
 
39875
40412
 
39876
40413
  /**
@@ -39931,7 +40468,7 @@
39931
40468
  }
39932
40469
 
39933
40470
  // add and update previews
39934
- eventBus.on('resize.move', LOW_PRIORITY$a, function(event) {
40471
+ eventBus.on('resize.move', LOW_PRIORITY$b, function(event) {
39935
40472
  updateFrame(event.context);
39936
40473
  });
39937
40474
 
@@ -41028,7 +41565,7 @@
41028
41565
  'modeling'
41029
41566
  ];
41030
41567
 
41031
- var LOW_PRIORITY$b = 500;
41568
+ var LOW_PRIORITY$c = 500;
41032
41569
 
41033
41570
 
41034
41571
  /**
@@ -41041,7 +41578,7 @@
41041
41578
 
41042
41579
  var self = this;
41043
41580
 
41044
- this.postExecuted('elements.create', LOW_PRIORITY$b, function(context) {
41581
+ this.postExecuted('elements.create', LOW_PRIORITY$c, function(context) {
41045
41582
  var elements = context.elements;
41046
41583
 
41047
41584
  elements = elements.filter(function(shape) {
@@ -41064,7 +41601,7 @@
41064
41601
  }, true);
41065
41602
 
41066
41603
 
41067
- this.preExecute('elements.move', LOW_PRIORITY$b, function(context) {
41604
+ this.preExecute('elements.move', LOW_PRIORITY$c, function(context) {
41068
41605
  var shapes = context.shapes,
41069
41606
  host = context.newHost;
41070
41607
 
@@ -41190,167 +41727,6 @@
41190
41727
 
41191
41728
  inherits_browser(BoundaryEventBehavior, CommandInterceptor);
41192
41729
 
41193
- var LOW_PRIORITY$c = 500;
41194
-
41195
-
41196
- /**
41197
- * Add referenced root elements (error, escalation, message, signal) if they don't exist.
41198
- * Copy referenced root elements on copy & paste.
41199
- */
41200
- function RootElementReferenceBehavior(
41201
- bpmnjs, eventBus, injector, moddleCopy, bpmnFactory
41202
- ) {
41203
- injector.invoke(CommandInterceptor, this);
41204
-
41205
- function canHaveRootElementReference(element) {
41206
- return isAny(element, [ 'bpmn:ReceiveTask', 'bpmn:SendTask' ]) ||
41207
- hasAnyEventDefinition(element, [
41208
- 'bpmn:ErrorEventDefinition',
41209
- 'bpmn:EscalationEventDefinition',
41210
- 'bpmn:MessageEventDefinition',
41211
- 'bpmn:SignalEventDefinition'
41212
- ]);
41213
- }
41214
-
41215
- function hasRootElement(rootElement) {
41216
- var definitions = bpmnjs.getDefinitions(),
41217
- rootElements = definitions.get('rootElements');
41218
-
41219
- return !!find(rootElements, matchPattern({ id: rootElement.id }));
41220
- }
41221
-
41222
- function getRootElementReferencePropertyName(eventDefinition) {
41223
- if (is$1(eventDefinition, 'bpmn:ErrorEventDefinition')) {
41224
- return 'errorRef';
41225
- } else if (is$1(eventDefinition, 'bpmn:EscalationEventDefinition')) {
41226
- return 'escalationRef';
41227
- } else if (is$1(eventDefinition, 'bpmn:MessageEventDefinition')) {
41228
- return 'messageRef';
41229
- } else if (is$1(eventDefinition, 'bpmn:SignalEventDefinition')) {
41230
- return 'signalRef';
41231
- }
41232
- }
41233
-
41234
- function getRootElement(businessObject) {
41235
- if (isAny(businessObject, [ 'bpmn:ReceiveTask', 'bpmn:SendTask' ])) {
41236
- return businessObject.get('messageRef');
41237
- }
41238
-
41239
- var eventDefinitions = businessObject.get('eventDefinitions'),
41240
- eventDefinition = eventDefinitions[ 0 ];
41241
-
41242
- return eventDefinition.get(getRootElementReferencePropertyName(eventDefinition));
41243
- }
41244
-
41245
- function setRootElement(businessObject, rootElement) {
41246
- if (isAny(businessObject, [ 'bpmn:ReceiveTask', 'bpmn:SendTask' ])) {
41247
- return businessObject.set('messageRef', rootElement);
41248
- }
41249
-
41250
- var eventDefinitions = businessObject.get('eventDefinitions'),
41251
- eventDefinition = eventDefinitions[ 0 ];
41252
-
41253
- return eventDefinition.set(getRootElementReferencePropertyName(eventDefinition), rootElement);
41254
- }
41255
-
41256
- // create shape
41257
- this.executed('shape.create', function(context) {
41258
- var shape = context.shape;
41259
-
41260
- if (!canHaveRootElementReference(shape)) {
41261
- return;
41262
- }
41263
-
41264
- var businessObject = getBusinessObject(shape),
41265
- rootElement = getRootElement(businessObject),
41266
- rootElements;
41267
-
41268
- if (rootElement && !hasRootElement(rootElement)) {
41269
- rootElements = bpmnjs.getDefinitions().get('rootElements');
41270
-
41271
- // add root element
41272
- add$1(rootElements, rootElement);
41273
-
41274
- context.addedRootElement = rootElement;
41275
- }
41276
- }, true);
41277
-
41278
- this.reverted('shape.create', function(context) {
41279
- var addedRootElement = context.addedRootElement;
41280
-
41281
- if (!addedRootElement) {
41282
- return;
41283
- }
41284
-
41285
- var rootElements = bpmnjs.getDefinitions().get('rootElements');
41286
-
41287
- // remove root element
41288
- remove$2(rootElements, addedRootElement);
41289
- }, true);
41290
-
41291
- eventBus.on('copyPaste.copyElement', function(context) {
41292
- var descriptor = context.descriptor,
41293
- element = context.element;
41294
-
41295
- if (!canHaveRootElementReference(element)) {
41296
- return;
41297
- }
41298
-
41299
- var businessObject = getBusinessObject(element),
41300
- rootElement = getRootElement(businessObject);
41301
-
41302
- if (rootElement) {
41303
- descriptor.referencedRootElement = rootElement;
41304
- }
41305
- });
41306
-
41307
- eventBus.on('copyPaste.pasteElement', LOW_PRIORITY$c, function(context) {
41308
- var descriptor = context.descriptor,
41309
- businessObject = descriptor.businessObject;
41310
-
41311
- if (!canHaveRootElementReference(businessObject)) {
41312
- return;
41313
- }
41314
-
41315
- var referencedRootElement = descriptor.referencedRootElement;
41316
-
41317
- if (!referencedRootElement) {
41318
- return;
41319
- }
41320
-
41321
- if (!hasRootElement(referencedRootElement)) {
41322
- referencedRootElement = moddleCopy.copyElement(
41323
- referencedRootElement,
41324
- bpmnFactory.create(referencedRootElement.$type)
41325
- );
41326
- }
41327
-
41328
- setRootElement(businessObject, referencedRootElement);
41329
- });
41330
- }
41331
-
41332
- RootElementReferenceBehavior.$inject = [
41333
- 'bpmnjs',
41334
- 'eventBus',
41335
- 'injector',
41336
- 'moddleCopy',
41337
- 'bpmnFactory'
41338
- ];
41339
-
41340
- inherits_browser(RootElementReferenceBehavior, CommandInterceptor);
41341
-
41342
- // helpers //////////
41343
-
41344
- function hasAnyEventDefinition(element, types) {
41345
- if (!isArray(types)) {
41346
- types = [ types ];
41347
- }
41348
-
41349
- return some(types, function(type) {
41350
- return hasEventDefinition(element, type);
41351
- });
41352
- }
41353
-
41354
41730
  function CreateBehavior(injector) {
41355
41731
  injector.invoke(CommandInterceptor, this);
41356
41732
 
@@ -41371,118 +41747,6 @@
41371
41747
 
41372
41748
  inherits_browser(CreateBehavior, CommandInterceptor);
41373
41749
 
41374
- var HIGH_PRIORITY$8 = 1500;
41375
- var HIGHEST_PRIORITY = 2000;
41376
-
41377
-
41378
- /**
41379
- * Correct hover targets in certain situations to improve diagram interaction.
41380
- *
41381
- * @param {ElementRegistry} elementRegistry
41382
- * @param {EventBus} eventBus
41383
- * @param {Canvas} canvas
41384
- */
41385
- function FixHoverBehavior(elementRegistry, eventBus, canvas) {
41386
-
41387
- eventBus.on([
41388
- 'create.hover',
41389
- 'create.move',
41390
- 'create.out',
41391
- 'create.end',
41392
- 'shape.move.hover',
41393
- 'shape.move.move',
41394
- 'shape.move.out',
41395
- 'shape.move.end'
41396
- ], HIGH_PRIORITY$8, function(event) {
41397
- var context = event.context,
41398
- shape = context.shape || event.shape,
41399
- hover = event.hover;
41400
-
41401
- // ensure elements are not dropped onto a bpmn:Lane but onto
41402
- // the underlying bpmn:Participant
41403
- if (is$1(hover, 'bpmn:Lane') && !isAny(shape, [ 'bpmn:Lane', 'bpmn:Participant' ])) {
41404
- event.hover = getLanesRoot(hover);
41405
- event.hoverGfx = elementRegistry.getGraphics(event.hover);
41406
- }
41407
-
41408
- var rootElement = canvas.getRootElement();
41409
-
41410
- // ensure bpmn:Group and label elements are dropped
41411
- // always onto the root
41412
- if (hover !== rootElement && (shape.labelTarget || is$1(shape, 'bpmn:Group'))) {
41413
- event.hover = rootElement;
41414
- event.hoverGfx = elementRegistry.getGraphics(event.hover);
41415
- }
41416
- });
41417
-
41418
- eventBus.on([
41419
- 'connect.hover',
41420
- 'connect.out',
41421
- 'connect.end',
41422
- 'connect.cleanup',
41423
- 'global-connect.hover',
41424
- 'global-connect.out',
41425
- 'global-connect.end',
41426
- 'global-connect.cleanup'
41427
- ], HIGH_PRIORITY$8, function(event) {
41428
- var hover = event.hover;
41429
-
41430
- // ensure connections start/end on bpmn:Participant,
41431
- // not the underlying bpmn:Lane
41432
- if (is$1(hover, 'bpmn:Lane')) {
41433
- event.hover = getLanesRoot(hover) || hover;
41434
- event.hoverGfx = elementRegistry.getGraphics(event.hover);
41435
- }
41436
- });
41437
-
41438
-
41439
- eventBus.on([
41440
- 'bendpoint.move.hover'
41441
- ], HIGH_PRIORITY$8, function(event) {
41442
- var context = event.context,
41443
- hover = event.hover,
41444
- type = context.type;
41445
-
41446
- // ensure reconnect start/end on bpmn:Participant,
41447
- // not the underlying bpmn:Lane
41448
- if (is$1(hover, 'bpmn:Lane') && /reconnect/.test(type)) {
41449
- event.hover = getLanesRoot(hover) || hover;
41450
- event.hoverGfx = elementRegistry.getGraphics(event.hover);
41451
- }
41452
- });
41453
-
41454
-
41455
- eventBus.on([
41456
- 'connect.start'
41457
- ], HIGH_PRIORITY$8, function(event) {
41458
- var context = event.context,
41459
- start = context.start;
41460
-
41461
- // ensure connect start on bpmn:Participant,
41462
- // not the underlying bpmn:Lane
41463
- if (is$1(start, 'bpmn:Lane')) {
41464
- context.start = getLanesRoot(start) || start;
41465
- }
41466
- });
41467
-
41468
-
41469
- // allow movement of participants from lanes
41470
- eventBus.on('shape.move.start', HIGHEST_PRIORITY, function(event) {
41471
- var shape = event.shape;
41472
-
41473
- if (is$1(shape, 'bpmn:Lane')) {
41474
- event.shape = getLanesRoot(shape) || shape;
41475
- }
41476
- });
41477
-
41478
- }
41479
-
41480
- FixHoverBehavior.$inject = [
41481
- 'elementRegistry',
41482
- 'eventBus',
41483
- 'canvas'
41484
- ];
41485
-
41486
41750
  /**
41487
41751
  * BPMN specific create data object behavior
41488
41752
  */
@@ -41520,7 +41784,7 @@
41520
41784
 
41521
41785
  var PARTICIPANT_BORDER_WIDTH = 30;
41522
41786
 
41523
- var HIGH_PRIORITY$9 = 2000;
41787
+ var HIGH_PRIORITY$8 = 2000;
41524
41788
 
41525
41789
 
41526
41790
  /**
@@ -41533,7 +41797,7 @@
41533
41797
  eventBus.on([
41534
41798
  'create.start',
41535
41799
  'shape.move.start'
41536
- ], HIGH_PRIORITY$9, function(event) {
41800
+ ], HIGH_PRIORITY$8, function(event) {
41537
41801
  var context = event.context,
41538
41802
  shape = context.shape,
41539
41803
  rootElement = canvas.getRootElement();
@@ -41568,7 +41832,7 @@
41568
41832
  });
41569
41833
 
41570
41834
  // force hovering process when creating first participant
41571
- eventBus.on('create.start', HIGH_PRIORITY$9, function(event) {
41835
+ eventBus.on('create.start', HIGH_PRIORITY$8, function(event) {
41572
41836
  var context = event.context,
41573
41837
  shape = context.shape,
41574
41838
  rootElement = canvas.getRootElement(),
@@ -41580,7 +41844,7 @@
41580
41844
  }
41581
41845
 
41582
41846
  if (is$1(shape, 'bpmn:Participant') && is$1(rootElement, 'bpmn:Process')) {
41583
- eventBus.on('element.hover', HIGH_PRIORITY$9, ensureHoveringProcess);
41847
+ eventBus.on('element.hover', HIGH_PRIORITY$8, ensureHoveringProcess);
41584
41848
 
41585
41849
  eventBus.once('create.cleanup', function() {
41586
41850
  eventBus.off('element.hover', ensureHoveringProcess);
@@ -41601,7 +41865,7 @@
41601
41865
 
41602
41866
  // when creating mutliple elements through `elements.create` parent must be set to collaboration
41603
41867
  // and passed to `shape.create` as hint
41604
- this.preExecute('elements.create', HIGH_PRIORITY$9, function(context) {
41868
+ this.preExecute('elements.create', HIGH_PRIORITY$8, function(context) {
41605
41869
  var elements = context.elements,
41606
41870
  parent = context.parent,
41607
41871
  participant = findParticipant(elements),
@@ -42560,6 +42824,118 @@
42560
42824
  return is$1(connection, 'bpmn:SequenceFlow');
42561
42825
  }
42562
42826
 
42827
+ var HIGH_PRIORITY$9 = 1500;
42828
+ var HIGHEST_PRIORITY = 2000;
42829
+
42830
+
42831
+ /**
42832
+ * Correct hover targets in certain situations to improve diagram interaction.
42833
+ *
42834
+ * @param {ElementRegistry} elementRegistry
42835
+ * @param {EventBus} eventBus
42836
+ * @param {Canvas} canvas
42837
+ */
42838
+ function FixHoverBehavior(elementRegistry, eventBus, canvas) {
42839
+
42840
+ eventBus.on([
42841
+ 'create.hover',
42842
+ 'create.move',
42843
+ 'create.out',
42844
+ 'create.end',
42845
+ 'shape.move.hover',
42846
+ 'shape.move.move',
42847
+ 'shape.move.out',
42848
+ 'shape.move.end'
42849
+ ], HIGH_PRIORITY$9, function(event) {
42850
+ var context = event.context,
42851
+ shape = context.shape || event.shape,
42852
+ hover = event.hover;
42853
+
42854
+ // ensure elements are not dropped onto a bpmn:Lane but onto
42855
+ // the underlying bpmn:Participant
42856
+ if (is$1(hover, 'bpmn:Lane') && !isAny(shape, [ 'bpmn:Lane', 'bpmn:Participant' ])) {
42857
+ event.hover = getLanesRoot(hover);
42858
+ event.hoverGfx = elementRegistry.getGraphics(event.hover);
42859
+ }
42860
+
42861
+ var rootElement = canvas.getRootElement();
42862
+
42863
+ // ensure bpmn:Group and label elements are dropped
42864
+ // always onto the root
42865
+ if (hover !== rootElement && (shape.labelTarget || is$1(shape, 'bpmn:Group'))) {
42866
+ event.hover = rootElement;
42867
+ event.hoverGfx = elementRegistry.getGraphics(event.hover);
42868
+ }
42869
+ });
42870
+
42871
+ eventBus.on([
42872
+ 'connect.hover',
42873
+ 'connect.out',
42874
+ 'connect.end',
42875
+ 'connect.cleanup',
42876
+ 'global-connect.hover',
42877
+ 'global-connect.out',
42878
+ 'global-connect.end',
42879
+ 'global-connect.cleanup'
42880
+ ], HIGH_PRIORITY$9, function(event) {
42881
+ var hover = event.hover;
42882
+
42883
+ // ensure connections start/end on bpmn:Participant,
42884
+ // not the underlying bpmn:Lane
42885
+ if (is$1(hover, 'bpmn:Lane')) {
42886
+ event.hover = getLanesRoot(hover) || hover;
42887
+ event.hoverGfx = elementRegistry.getGraphics(event.hover);
42888
+ }
42889
+ });
42890
+
42891
+
42892
+ eventBus.on([
42893
+ 'bendpoint.move.hover'
42894
+ ], HIGH_PRIORITY$9, function(event) {
42895
+ var context = event.context,
42896
+ hover = event.hover,
42897
+ type = context.type;
42898
+
42899
+ // ensure reconnect start/end on bpmn:Participant,
42900
+ // not the underlying bpmn:Lane
42901
+ if (is$1(hover, 'bpmn:Lane') && /reconnect/.test(type)) {
42902
+ event.hover = getLanesRoot(hover) || hover;
42903
+ event.hoverGfx = elementRegistry.getGraphics(event.hover);
42904
+ }
42905
+ });
42906
+
42907
+
42908
+ eventBus.on([
42909
+ 'connect.start'
42910
+ ], HIGH_PRIORITY$9, function(event) {
42911
+ var context = event.context,
42912
+ start = context.start;
42913
+
42914
+ // ensure connect start on bpmn:Participant,
42915
+ // not the underlying bpmn:Lane
42916
+ if (is$1(start, 'bpmn:Lane')) {
42917
+ context.start = getLanesRoot(start) || start;
42918
+ }
42919
+ });
42920
+
42921
+
42922
+ // allow movement of participants from lanes
42923
+ eventBus.on('shape.move.start', HIGHEST_PRIORITY, function(event) {
42924
+ var shape = event.shape;
42925
+
42926
+ if (is$1(shape, 'bpmn:Lane')) {
42927
+ event.shape = getLanesRoot(shape) || shape;
42928
+ }
42929
+ });
42930
+
42931
+ }
42932
+
42933
+ FixHoverBehavior.$inject = [
42934
+ 'elementRegistry',
42935
+ 'eventBus',
42936
+ 'canvas'
42937
+ ];
42938
+
42563
42939
  var HIGH_PRIORITY$a = 2000;
42564
42940
 
42565
42941
 
@@ -42568,7 +42944,7 @@
42568
42944
  */
42569
42945
  function GroupBehavior(
42570
42946
  bpmnFactory,
42571
- canvas,
42947
+ bpmnjs,
42572
42948
  elementRegistry,
42573
42949
  eventBus,
42574
42950
  injector,
@@ -42576,18 +42952,6 @@
42576
42952
  ) {
42577
42953
  injector.invoke(CommandInterceptor, this);
42578
42954
 
42579
- /**
42580
- * Gets process definitions
42581
- *
42582
- * @return {ModdleElement} definitions
42583
- */
42584
- function getDefinitions() {
42585
- var rootElement = canvas.getRootElement(),
42586
- businessObject = getBusinessObject(rootElement);
42587
-
42588
- return businessObject.$parent;
42589
- }
42590
-
42591
42955
  /**
42592
42956
  * Removes a referenced category value for a given group shape
42593
42957
  *
@@ -42623,7 +42987,7 @@
42623
42987
  */
42624
42988
  function removeCategory(category) {
42625
42989
 
42626
- var definitions = getDefinitions();
42990
+ var definitions = bpmnjs.getDefinitions();
42627
42991
 
42628
42992
  remove$2(definitions.get('rootElements'), category);
42629
42993
  }
@@ -42688,7 +43052,7 @@
42688
43052
 
42689
43053
  var businessObject = getBusinessObject(shape),
42690
43054
  categoryValueRef = businessObject.categoryValueRef,
42691
- definitions = getDefinitions(),
43055
+ definitions = bpmnjs.getDefinitions(),
42692
43056
  category = categoryValueRef ? categoryValueRef.$parent : null;
42693
43057
 
42694
43058
  add$1(category.get('categoryValue'), categoryValueRef);
@@ -42706,7 +43070,7 @@
42706
43070
 
42707
43071
  if (is$1(businessObject, 'bpmn:Group') && !businessObject.categoryValueRef) {
42708
43072
 
42709
- var definitions = getDefinitions(),
43073
+ var definitions = bpmnjs.getDefinitions(),
42710
43074
  categoryValue = createCategoryValue(definitions, bpmnFactory);
42711
43075
 
42712
43076
  // link the reference to the Group
@@ -42734,7 +43098,7 @@
42734
43098
  categoryValue;
42735
43099
 
42736
43100
  if (is$1(property, 'bpmn:CategoryValue')) {
42737
- categoryValue = createCategoryValue(getDefinitions(), bpmnFactory);
43101
+ categoryValue = createCategoryValue(bpmnjs.getDefinitions(), bpmnFactory);
42738
43102
 
42739
43103
  // return copy of category
42740
43104
  return moddleCopy.copyElement(property, categoryValue);
@@ -42745,7 +43109,7 @@
42745
43109
 
42746
43110
  GroupBehavior.$inject = [
42747
43111
  'bpmnFactory',
42748
- 'canvas',
43112
+ 'bpmnjs',
42749
43113
  'elementRegistry',
42750
43114
  'eventBus',
42751
43115
  'injector',
@@ -44024,7 +44388,7 @@
44024
44388
  }
44025
44389
 
44026
44390
  function getWaypointsInsideBounds(waypoints, bounds) {
44027
- var originalWaypoints = map(waypoints, getOriginal$1);
44391
+ var originalWaypoints = map(waypoints, getOriginal$2);
44028
44392
 
44029
44393
  return filter(originalWaypoints, function(waypoint) {
44030
44394
  return isInsideBounds(waypoint, bounds);
@@ -44041,7 +44405,7 @@
44041
44405
  return getOrientation(bounds, point, 1) === 'intersect';
44042
44406
  }
44043
44407
 
44044
- function getOriginal$1(point) {
44408
+ function getOriginal$2(point) {
44045
44409
  return point.original || point;
44046
44410
  }
44047
44411
 
@@ -44154,6 +44518,151 @@
44154
44518
  'translate'
44155
44519
  ];
44156
44520
 
44521
+ /**
44522
+ * BPMN specific behavior ensuring that bpmndi:Label's dc:Bounds are removed
44523
+ * when shape is resized.
44524
+ */
44525
+ function RemoveEmbeddedLabelBoundsBehavior(eventBus, modeling) {
44526
+ CommandInterceptor.call(this, eventBus);
44527
+
44528
+ this.preExecute('shape.resize', function(context) {
44529
+ var shape = context.shape;
44530
+
44531
+ var di = getDi(shape),
44532
+ label = di && di.get('label'),
44533
+ bounds = label && label.get('bounds');
44534
+
44535
+ if (bounds) {
44536
+ modeling.updateModdleProperties(shape, label, {
44537
+ bounds: undefined
44538
+ });
44539
+ }
44540
+ }, true);
44541
+ }
44542
+
44543
+ inherits_browser(RemoveEmbeddedLabelBoundsBehavior, CommandInterceptor);
44544
+
44545
+ RemoveEmbeddedLabelBoundsBehavior.$inject = [
44546
+ 'eventBus',
44547
+ 'modeling'
44548
+ ];
44549
+
44550
+ function RemoveElementBehavior(eventBus, bpmnRules, modeling) {
44551
+
44552
+ CommandInterceptor.call(this, eventBus);
44553
+
44554
+ /**
44555
+ * Combine sequence flows when deleting an element
44556
+ * if there is one incoming and one outgoing
44557
+ * sequence flow
44558
+ */
44559
+ this.preExecute('shape.delete', function(e) {
44560
+
44561
+ var shape = e.context.shape;
44562
+
44563
+ // only handle [a] -> [shape] -> [b] patterns
44564
+ if (shape.incoming.length !== 1 || shape.outgoing.length !== 1) {
44565
+ return;
44566
+ }
44567
+
44568
+ var inConnection = shape.incoming[0],
44569
+ outConnection = shape.outgoing[0];
44570
+
44571
+ // only handle sequence flows
44572
+ if (!is$1(inConnection, 'bpmn:SequenceFlow') || !is$1(outConnection, 'bpmn:SequenceFlow')) {
44573
+ return;
44574
+ }
44575
+
44576
+ if (bpmnRules.canConnect(inConnection.source, outConnection.target, inConnection)) {
44577
+
44578
+ // compute new, combined waypoints
44579
+ var newWaypoints = getNewWaypoints(inConnection.waypoints, outConnection.waypoints);
44580
+
44581
+ modeling.reconnectEnd(inConnection, outConnection.target, newWaypoints);
44582
+ }
44583
+ });
44584
+
44585
+ }
44586
+
44587
+ inherits_browser(RemoveElementBehavior, CommandInterceptor);
44588
+
44589
+ RemoveElementBehavior.$inject = [
44590
+ 'eventBus',
44591
+ 'bpmnRules',
44592
+ 'modeling'
44593
+ ];
44594
+
44595
+
44596
+ // helpers //////////////////////
44597
+
44598
+ function getDocking$1(point) {
44599
+ return point.original || point;
44600
+ }
44601
+
44602
+
44603
+ function getNewWaypoints(inWaypoints, outWaypoints) {
44604
+
44605
+ var intersection = lineIntersect(
44606
+ getDocking$1(inWaypoints[inWaypoints.length - 2]),
44607
+ getDocking$1(inWaypoints[inWaypoints.length - 1]),
44608
+ getDocking$1(outWaypoints[1]),
44609
+ getDocking$1(outWaypoints[0]));
44610
+
44611
+ if (intersection) {
44612
+ return [].concat(
44613
+ inWaypoints.slice(0, inWaypoints.length - 1),
44614
+ [ intersection ],
44615
+ outWaypoints.slice(1));
44616
+ } else {
44617
+ return [
44618
+ getDocking$1(inWaypoints[0]),
44619
+ getDocking$1(outWaypoints[outWaypoints.length - 1])
44620
+ ];
44621
+ }
44622
+ }
44623
+
44624
+ /**
44625
+ * BPMN specific remove behavior
44626
+ */
44627
+ function RemoveParticipantBehavior(eventBus, modeling) {
44628
+
44629
+ CommandInterceptor.call(this, eventBus);
44630
+
44631
+
44632
+ /**
44633
+ * morph collaboration diagram into process diagram
44634
+ * after the last participant has been removed
44635
+ */
44636
+
44637
+ this.preExecute('shape.delete', function(context) {
44638
+
44639
+ var shape = context.shape,
44640
+ parent = shape.parent;
44641
+
44642
+ // activate the behavior if the shape to be removed
44643
+ // is a participant
44644
+ if (is$1(shape, 'bpmn:Participant')) {
44645
+ context.collaborationRoot = parent;
44646
+ }
44647
+ }, true);
44648
+
44649
+ this.postExecute('shape.delete', function(context) {
44650
+
44651
+ var collaborationRoot = context.collaborationRoot;
44652
+
44653
+ if (collaborationRoot && !collaborationRoot.businessObject.participants.length) {
44654
+
44655
+ // replace empty collaboration with process diagram
44656
+ modeling.makeProcess();
44657
+ }
44658
+ }, true);
44659
+
44660
+ }
44661
+
44662
+ RemoveParticipantBehavior.$inject = [ 'eventBus', 'modeling' ];
44663
+
44664
+ inherits_browser(RemoveParticipantBehavior, CommandInterceptor);
44665
+
44157
44666
  function ReplaceConnectionBehavior(eventBus, modeling, bpmnRules, injector) {
44158
44667
 
44159
44668
  CommandInterceptor.call(this, eventBus);
@@ -44326,48 +44835,6 @@
44326
44835
  'injector'
44327
44836
  ];
44328
44837
 
44329
- /**
44330
- * BPMN specific remove behavior
44331
- */
44332
- function RemoveParticipantBehavior(eventBus, modeling) {
44333
-
44334
- CommandInterceptor.call(this, eventBus);
44335
-
44336
-
44337
- /**
44338
- * morph collaboration diagram into process diagram
44339
- * after the last participant has been removed
44340
- */
44341
-
44342
- this.preExecute('shape.delete', function(context) {
44343
-
44344
- var shape = context.shape,
44345
- parent = shape.parent;
44346
-
44347
- // activate the behavior if the shape to be removed
44348
- // is a participant
44349
- if (is$1(shape, 'bpmn:Participant')) {
44350
- context.collaborationRoot = parent;
44351
- }
44352
- }, true);
44353
-
44354
- this.postExecute('shape.delete', function(context) {
44355
-
44356
- var collaborationRoot = context.collaborationRoot;
44357
-
44358
- if (collaborationRoot && !collaborationRoot.businessObject.participants.length) {
44359
-
44360
- // replace empty collaboration with process diagram
44361
- modeling.makeProcess();
44362
- }
44363
- }, true);
44364
-
44365
- }
44366
-
44367
- RemoveParticipantBehavior.$inject = [ 'eventBus', 'modeling' ];
44368
-
44369
- inherits_browser(RemoveParticipantBehavior, CommandInterceptor);
44370
-
44371
44838
  /**
44372
44839
  * BPMN-specific replace behavior.
44373
44840
  */
@@ -44701,78 +45168,165 @@
44701
45168
  'modeling'
44702
45169
  ];
44703
45170
 
44704
- function RemoveElementBehavior(eventBus, bpmnRules, modeling) {
44705
-
44706
- CommandInterceptor.call(this, eventBus);
44707
-
44708
- /**
44709
- * Combine sequence flows when deleting an element
44710
- * if there is one incoming and one outgoing
44711
- * sequence flow
44712
- */
44713
- this.preExecute('shape.delete', function(e) {
44714
-
44715
- var shape = e.context.shape;
44716
-
44717
- // only handle [a] -> [shape] -> [b] patterns
44718
- if (shape.incoming.length !== 1 || shape.outgoing.length !== 1) {
44719
- return;
44720
- }
44721
-
44722
- var inConnection = shape.incoming[0],
44723
- outConnection = shape.outgoing[0];
44724
-
44725
- // only handle sequence flows
44726
- if (!is$1(inConnection, 'bpmn:SequenceFlow') || !is$1(outConnection, 'bpmn:SequenceFlow')) {
44727
- return;
44728
- }
44729
-
44730
- if (bpmnRules.canConnect(inConnection.source, outConnection.target, inConnection)) {
44731
-
44732
- // compute new, combined waypoints
44733
- var newWaypoints = getNewWaypoints(inConnection.waypoints, outConnection.waypoints);
44734
-
44735
- modeling.reconnectEnd(inConnection, outConnection.target, newWaypoints);
44736
- }
44737
- });
44738
-
44739
- }
44740
-
44741
- inherits_browser(RemoveElementBehavior, CommandInterceptor);
44742
-
44743
- RemoveElementBehavior.$inject = [
44744
- 'eventBus',
44745
- 'bpmnRules',
44746
- 'modeling'
44747
- ];
44748
-
44749
-
44750
- // helpers //////////////////////
44751
-
44752
- function getDocking$1(point) {
44753
- return point.original || point;
44754
- }
44755
-
44756
-
44757
- function getNewWaypoints(inWaypoints, outWaypoints) {
44758
-
44759
- var intersection = lineIntersect(
44760
- getDocking$1(inWaypoints[inWaypoints.length - 2]),
44761
- getDocking$1(inWaypoints[inWaypoints.length - 1]),
44762
- getDocking$1(outWaypoints[1]),
44763
- getDocking$1(outWaypoints[0]));
44764
-
44765
- if (intersection) {
44766
- return [].concat(
44767
- inWaypoints.slice(0, inWaypoints.length - 1),
44768
- [ intersection ],
44769
- outWaypoints.slice(1));
44770
- } else {
44771
- return [
44772
- getDocking$1(inWaypoints[0]),
44773
- getDocking$1(outWaypoints[outWaypoints.length - 1])
44774
- ];
44775
- }
45171
+ var LOW_PRIORITY$f = 500;
45172
+
45173
+
45174
+ /**
45175
+ * Add referenced root elements (error, escalation, message, signal) if they don't exist.
45176
+ * Copy referenced root elements on copy & paste.
45177
+ */
45178
+ function RootElementReferenceBehavior(
45179
+ bpmnjs, eventBus, injector, moddleCopy, bpmnFactory
45180
+ ) {
45181
+ injector.invoke(CommandInterceptor, this);
45182
+
45183
+ function canHaveRootElementReference(element) {
45184
+ return isAny(element, [ 'bpmn:ReceiveTask', 'bpmn:SendTask' ]) ||
45185
+ hasAnyEventDefinition(element, [
45186
+ 'bpmn:ErrorEventDefinition',
45187
+ 'bpmn:EscalationEventDefinition',
45188
+ 'bpmn:MessageEventDefinition',
45189
+ 'bpmn:SignalEventDefinition'
45190
+ ]);
45191
+ }
45192
+
45193
+ function hasRootElement(rootElement) {
45194
+ var definitions = bpmnjs.getDefinitions(),
45195
+ rootElements = definitions.get('rootElements');
45196
+
45197
+ return !!find(rootElements, matchPattern({ id: rootElement.id }));
45198
+ }
45199
+
45200
+ function getRootElementReferencePropertyName(eventDefinition) {
45201
+ if (is$1(eventDefinition, 'bpmn:ErrorEventDefinition')) {
45202
+ return 'errorRef';
45203
+ } else if (is$1(eventDefinition, 'bpmn:EscalationEventDefinition')) {
45204
+ return 'escalationRef';
45205
+ } else if (is$1(eventDefinition, 'bpmn:MessageEventDefinition')) {
45206
+ return 'messageRef';
45207
+ } else if (is$1(eventDefinition, 'bpmn:SignalEventDefinition')) {
45208
+ return 'signalRef';
45209
+ }
45210
+ }
45211
+
45212
+ function getRootElement(businessObject) {
45213
+ if (isAny(businessObject, [ 'bpmn:ReceiveTask', 'bpmn:SendTask' ])) {
45214
+ return businessObject.get('messageRef');
45215
+ }
45216
+
45217
+ var eventDefinitions = businessObject.get('eventDefinitions'),
45218
+ eventDefinition = eventDefinitions[ 0 ];
45219
+
45220
+ return eventDefinition.get(getRootElementReferencePropertyName(eventDefinition));
45221
+ }
45222
+
45223
+ function setRootElement(businessObject, rootElement) {
45224
+ if (isAny(businessObject, [ 'bpmn:ReceiveTask', 'bpmn:SendTask' ])) {
45225
+ return businessObject.set('messageRef', rootElement);
45226
+ }
45227
+
45228
+ var eventDefinitions = businessObject.get('eventDefinitions'),
45229
+ eventDefinition = eventDefinitions[ 0 ];
45230
+
45231
+ return eventDefinition.set(getRootElementReferencePropertyName(eventDefinition), rootElement);
45232
+ }
45233
+
45234
+ // create shape
45235
+ this.executed('shape.create', function(context) {
45236
+ var shape = context.shape;
45237
+
45238
+ if (!canHaveRootElementReference(shape)) {
45239
+ return;
45240
+ }
45241
+
45242
+ var businessObject = getBusinessObject(shape),
45243
+ rootElement = getRootElement(businessObject),
45244
+ rootElements;
45245
+
45246
+ if (rootElement && !hasRootElement(rootElement)) {
45247
+ rootElements = bpmnjs.getDefinitions().get('rootElements');
45248
+
45249
+ // add root element
45250
+ add$1(rootElements, rootElement);
45251
+
45252
+ context.addedRootElement = rootElement;
45253
+ }
45254
+ }, true);
45255
+
45256
+ this.reverted('shape.create', function(context) {
45257
+ var addedRootElement = context.addedRootElement;
45258
+
45259
+ if (!addedRootElement) {
45260
+ return;
45261
+ }
45262
+
45263
+ var rootElements = bpmnjs.getDefinitions().get('rootElements');
45264
+
45265
+ // remove root element
45266
+ remove$2(rootElements, addedRootElement);
45267
+ }, true);
45268
+
45269
+ eventBus.on('copyPaste.copyElement', function(context) {
45270
+ var descriptor = context.descriptor,
45271
+ element = context.element;
45272
+
45273
+ if (!canHaveRootElementReference(element)) {
45274
+ return;
45275
+ }
45276
+
45277
+ var businessObject = getBusinessObject(element),
45278
+ rootElement = getRootElement(businessObject);
45279
+
45280
+ if (rootElement) {
45281
+ descriptor.referencedRootElement = rootElement;
45282
+ }
45283
+ });
45284
+
45285
+ eventBus.on('copyPaste.pasteElement', LOW_PRIORITY$f, function(context) {
45286
+ var descriptor = context.descriptor,
45287
+ businessObject = descriptor.businessObject;
45288
+
45289
+ if (!canHaveRootElementReference(businessObject)) {
45290
+ return;
45291
+ }
45292
+
45293
+ var referencedRootElement = descriptor.referencedRootElement;
45294
+
45295
+ if (!referencedRootElement) {
45296
+ return;
45297
+ }
45298
+
45299
+ if (!hasRootElement(referencedRootElement)) {
45300
+ referencedRootElement = moddleCopy.copyElement(
45301
+ referencedRootElement,
45302
+ bpmnFactory.create(referencedRootElement.$type)
45303
+ );
45304
+ }
45305
+
45306
+ setRootElement(businessObject, referencedRootElement);
45307
+ });
45308
+ }
45309
+
45310
+ RootElementReferenceBehavior.$inject = [
45311
+ 'bpmnjs',
45312
+ 'eventBus',
45313
+ 'injector',
45314
+ 'moddleCopy',
45315
+ 'bpmnFactory'
45316
+ ];
45317
+
45318
+ inherits_browser(RootElementReferenceBehavior, CommandInterceptor);
45319
+
45320
+ // helpers //////////
45321
+
45322
+ function hasAnyEventDefinition(element, types) {
45323
+ if (!isArray(types)) {
45324
+ types = [ types ];
45325
+ }
45326
+
45327
+ return some(types, function(type) {
45328
+ return hasEventDefinition(element, type);
45329
+ });
44776
45330
  }
44777
45331
 
44778
45332
  var max$5 = Math.max;
@@ -44885,50 +45439,7 @@
44885
45439
  }
44886
45440
  }
44887
45441
 
44888
- /**
44889
- * Add start event replacing element with expanded sub process.
44890
- *
44891
- * @param {Injector} injector
44892
- * @param {Modeling} modeling
44893
- */
44894
- function SubProcessStartEventBehavior(injector, modeling) {
44895
- injector.invoke(CommandInterceptor, this);
44896
-
44897
- this.postExecuted('shape.replace', function(event) {
44898
- var oldShape = event.context.oldShape,
44899
- newShape = event.context.newShape;
44900
-
44901
- if (
44902
- !is$1(newShape, 'bpmn:SubProcess') ||
44903
- !is$1(oldShape, 'bpmn:Task') ||
44904
- !isExpanded(newShape)
44905
- ) {
44906
- return;
44907
- }
44908
-
44909
- var position = getStartEventPosition(newShape);
44910
-
44911
- modeling.createShape({ type: 'bpmn:StartEvent' }, position, newShape);
44912
- });
44913
- }
44914
-
44915
- SubProcessStartEventBehavior.$inject = [
44916
- 'injector',
44917
- 'modeling'
44918
- ];
44919
-
44920
- inherits_browser(SubProcessStartEventBehavior, CommandInterceptor);
44921
-
44922
- // helpers //////////
44923
-
44924
- function getStartEventPosition(shape) {
44925
- return {
44926
- x: shape.x + shape.width / 6,
44927
- y: shape.y + shape.height / 2
44928
- };
44929
- }
44930
-
44931
- var LOW_PRIORITY$f = 400;
45442
+ var LOW_PRIORITY$g = 400;
44932
45443
  var HIGH_PRIORITY$c = 600;
44933
45444
 
44934
45445
  var DEFAULT_POSITION$1 = {
@@ -45129,7 +45640,7 @@
45129
45640
  this.reverted('element.updateProperties', function(context) {
45130
45641
  var shape = context.element;
45131
45642
 
45132
- if (!isCollapsedSubProcess(shape)) {
45643
+ if (!is$1(shape, 'bpmn:SubProcess')) {
45133
45644
  return;
45134
45645
  }
45135
45646
 
@@ -45143,6 +45654,13 @@
45143
45654
  return;
45144
45655
  }
45145
45656
 
45657
+ if (isPlane(shape)) {
45658
+ elementRegistry.updateId(shape, toPlaneId(oldId));
45659
+ elementRegistry.updateId(newId, oldId);
45660
+
45661
+ return;
45662
+ }
45663
+
45146
45664
  var planeElement = elementRegistry.get(toPlaneId(newId));
45147
45665
 
45148
45666
  if (!planeElement) {
@@ -45175,7 +45693,7 @@
45175
45693
 
45176
45694
 
45177
45695
  // create/remove plane for the subprocess
45178
- this.executed('shape.toggleCollapse', LOW_PRIORITY$f, function(context) {
45696
+ this.executed('shape.toggleCollapse', LOW_PRIORITY$g, function(context) {
45179
45697
  var shape = context.shape;
45180
45698
 
45181
45699
  if (!is$1(shape, 'bpmn:SubProcess')) {
@@ -45193,7 +45711,7 @@
45193
45711
 
45194
45712
 
45195
45713
  // create/remove plane for the subprocess
45196
- this.reverted('shape.toggleCollapse', LOW_PRIORITY$f, function(context) {
45714
+ this.reverted('shape.toggleCollapse', LOW_PRIORITY$g, function(context) {
45197
45715
  var shape = context.shape;
45198
45716
 
45199
45717
  if (!is$1(shape, 'bpmn:SubProcess')) {
@@ -45462,6 +45980,49 @@
45462
45980
  'elementRegistry'
45463
45981
  ];
45464
45982
 
45983
+ /**
45984
+ * Add start event replacing element with expanded sub process.
45985
+ *
45986
+ * @param {Injector} injector
45987
+ * @param {Modeling} modeling
45988
+ */
45989
+ function SubProcessStartEventBehavior(injector, modeling) {
45990
+ injector.invoke(CommandInterceptor, this);
45991
+
45992
+ this.postExecuted('shape.replace', function(event) {
45993
+ var oldShape = event.context.oldShape,
45994
+ newShape = event.context.newShape;
45995
+
45996
+ if (
45997
+ !is$1(newShape, 'bpmn:SubProcess') ||
45998
+ !is$1(oldShape, 'bpmn:Task') ||
45999
+ !isExpanded(newShape)
46000
+ ) {
46001
+ return;
46002
+ }
46003
+
46004
+ var position = getStartEventPosition(newShape);
46005
+
46006
+ modeling.createShape({ type: 'bpmn:StartEvent' }, position, newShape);
46007
+ });
46008
+ }
46009
+
46010
+ SubProcessStartEventBehavior.$inject = [
46011
+ 'injector',
46012
+ 'modeling'
46013
+ ];
46014
+
46015
+ inherits_browser(SubProcessStartEventBehavior, CommandInterceptor);
46016
+
46017
+ // helpers //////////
46018
+
46019
+ function getStartEventPosition(shape) {
46020
+ return {
46021
+ x: shape.x + shape.width / 6,
46022
+ y: shape.y + shape.height / 2
46023
+ };
46024
+ }
46025
+
45465
46026
  function ToggleCollapseConnectionBehaviour(
45466
46027
  eventBus, modeling
45467
46028
  ) {
@@ -45497,7 +46058,7 @@
45497
46058
 
45498
46059
 
45499
46060
  function handleConnection(c, incoming) {
45500
- if (allChildren.includes(c.source) && allChildren.includes(c.target)) {
46061
+ if (allChildren.indexOf(c.source) !== -1 && allChildren.indexOf(c.target) !== -1) {
45501
46062
  return;
45502
46063
  }
45503
46064
 
@@ -45520,7 +46081,7 @@
45520
46081
  'modeling',
45521
46082
  ];
45522
46083
 
45523
- var LOW_PRIORITY$g = 500;
46084
+ var LOW_PRIORITY$h = 500;
45524
46085
 
45525
46086
 
45526
46087
  function ToggleElementCollapseBehaviour(
@@ -45578,7 +46139,7 @@
45578
46139
  };
45579
46140
  }
45580
46141
 
45581
- this.executed([ 'shape.toggleCollapse' ], LOW_PRIORITY$g, function(e) {
46142
+ this.executed([ 'shape.toggleCollapse' ], LOW_PRIORITY$h, function(e) {
45582
46143
 
45583
46144
  var context = e.context,
45584
46145
  shape = context.shape;
@@ -45601,7 +46162,7 @@
45601
46162
  }
45602
46163
  });
45603
46164
 
45604
- this.reverted([ 'shape.toggleCollapse' ], LOW_PRIORITY$g, function(e) {
46165
+ this.reverted([ 'shape.toggleCollapse' ], LOW_PRIORITY$h, function(e) {
45605
46166
 
45606
46167
  var context = e.context;
45607
46168
  var shape = context.shape;
@@ -45616,7 +46177,7 @@
45616
46177
  }
45617
46178
  });
45618
46179
 
45619
- this.postExecuted([ 'shape.toggleCollapse' ], LOW_PRIORITY$g, function(e) {
46180
+ this.postExecuted([ 'shape.toggleCollapse' ], LOW_PRIORITY$h, function(e) {
45620
46181
  var shape = e.context.shape,
45621
46182
  defaultSize = elementFactory.getDefaultSize(shape),
45622
46183
  newBounds;
@@ -45706,7 +46267,55 @@
45706
46267
 
45707
46268
  UnclaimIdBehavior.$inject = [ 'canvas', 'injector', 'moddle', 'modeling' ];
45708
46269
 
45709
- var LOW_PRIORITY$h = 500,
46270
+ /**
46271
+ * A behavior that unsets the Default property of
46272
+ * sequence flow source on element delete, if the
46273
+ * removed element is the Gateway or Task's default flow.
46274
+ *
46275
+ * @param {EventBus} eventBus
46276
+ * @param {Modeling} modeling
46277
+ */
46278
+ function DeleteSequenceFlowBehavior(eventBus, modeling) {
46279
+
46280
+ CommandInterceptor.call(this, eventBus);
46281
+
46282
+
46283
+ this.preExecute('connection.delete', function(event) {
46284
+ var context = event.context,
46285
+ connection = context.connection,
46286
+ source = connection.source;
46287
+
46288
+ if (isDefaultFlow(connection, source)) {
46289
+ modeling.updateProperties(source, {
46290
+ 'default': null
46291
+ });
46292
+ }
46293
+ });
46294
+ }
46295
+
46296
+ inherits_browser(DeleteSequenceFlowBehavior, CommandInterceptor);
46297
+
46298
+ DeleteSequenceFlowBehavior.$inject = [
46299
+ 'eventBus',
46300
+ 'modeling'
46301
+ ];
46302
+
46303
+
46304
+ // helpers //////////////////////
46305
+
46306
+ function isDefaultFlow(connection, source) {
46307
+
46308
+ if (!is$1(connection, 'bpmn:SequenceFlow')) {
46309
+ return false;
46310
+ }
46311
+
46312
+ var sourceBo = getBusinessObject(source),
46313
+ sequenceFlow = getBusinessObject(connection);
46314
+
46315
+ return sourceBo.get('default') === sequenceFlow;
46316
+ }
46317
+
46318
+ var LOW_PRIORITY$i = 500,
45710
46319
  HIGH_PRIORITY$d = 5000;
45711
46320
 
45712
46321
 
@@ -45788,7 +46397,7 @@
45788
46397
  initContext();
45789
46398
  });
45790
46399
 
45791
- this.postExecuted(laneRefUpdateEvents, LOW_PRIORITY$h, function(event) {
46400
+ this.postExecuted(laneRefUpdateEvents, LOW_PRIORITY$i, function(event) {
45792
46401
  releaseContext();
45793
46402
  });
45794
46403
 
@@ -45857,54 +46466,6 @@
45857
46466
  };
45858
46467
  }
45859
46468
 
45860
- /**
45861
- * A behavior that unsets the Default property of
45862
- * sequence flow source on element delete, if the
45863
- * removed element is the Gateway or Task's default flow.
45864
- *
45865
- * @param {EventBus} eventBus
45866
- * @param {Modeling} modeling
45867
- */
45868
- function DeleteSequenceFlowBehavior(eventBus, modeling) {
45869
-
45870
- CommandInterceptor.call(this, eventBus);
45871
-
45872
-
45873
- this.preExecute('connection.delete', function(event) {
45874
- var context = event.context,
45875
- connection = context.connection,
45876
- source = connection.source;
45877
-
45878
- if (isDefaultFlow(connection, source)) {
45879
- modeling.updateProperties(source, {
45880
- 'default': null
45881
- });
45882
- }
45883
- });
45884
- }
45885
-
45886
- inherits_browser(DeleteSequenceFlowBehavior, CommandInterceptor);
45887
-
45888
- DeleteSequenceFlowBehavior.$inject = [
45889
- 'eventBus',
45890
- 'modeling'
45891
- ];
45892
-
45893
-
45894
- // helpers //////////////////////
45895
-
45896
- function isDefaultFlow(connection, source) {
45897
-
45898
- if (!is$1(connection, 'bpmn:SequenceFlow')) {
45899
- return false;
45900
- }
45901
-
45902
- var sourceBo = getBusinessObject(source),
45903
- sequenceFlow = getBusinessObject(connection);
45904
-
45905
- return sourceBo.get('default') === sequenceFlow;
45906
- }
45907
-
45908
46469
  var BehaviorModule = {
45909
46470
  __init__: [
45910
46471
  'adaptiveLabelPositioningBehavior',
@@ -45912,17 +46473,16 @@
45912
46473
  'associationBehavior',
45913
46474
  'attachEventBehavior',
45914
46475
  'boundaryEventBehavior',
45915
- 'rootElementReferenceBehavior',
45916
46476
  'createBehavior',
45917
- 'fixHoverBehavior',
45918
46477
  'createDataObjectBehavior',
45919
46478
  'createParticipantBehavior',
45920
- 'dataStoreBehavior',
45921
46479
  'dataInputAssociationBehavior',
46480
+ 'dataStoreBehavior',
45922
46481
  'deleteLaneBehavior',
45923
46482
  'detachEventBehavior',
45924
46483
  'dropOnFlowBehavior',
45925
46484
  'eventBasedGatewayBehavior',
46485
+ 'fixHoverBehavior',
45926
46486
  'groupBehavior',
45927
46487
  'importDockingFix',
45928
46488
  'isHorizontalFix',
@@ -45930,28 +46490,28 @@
45930
46490
  'messageFlowBehavior',
45931
46491
  'modelingFeedback',
45932
46492
  'removeElementBehavior',
46493
+ 'removeEmbeddedLabelBoundsBehavior',
45933
46494
  'removeParticipantBehavior',
45934
46495
  'replaceConnectionBehavior',
45935
46496
  'replaceElementBehaviour',
45936
46497
  'resizeBehavior',
45937
46498
  'resizeLaneBehavior',
45938
- 'toggleCollapseConnectionBehaviour',
45939
- 'toggleElementCollapseBehaviour',
46499
+ 'rootElementReferenceBehavior',
45940
46500
  'spaceToolBehavior',
45941
- 'subProcessStartEventBehavior',
45942
46501
  'subProcessPlaneBehavior',
46502
+ 'subProcessStartEventBehavior',
46503
+ 'toggleCollapseConnectionBehaviour',
46504
+ 'toggleElementCollapseBehaviour',
45943
46505
  'unclaimIdBehavior',
45944
- 'unsetDefaultFlowBehavior',
45945
- 'updateFlowNodeRefsBehavior'
46506
+ 'updateFlowNodeRefsBehavior',
46507
+ 'unsetDefaultFlowBehavior'
45946
46508
  ],
45947
46509
  adaptiveLabelPositioningBehavior: [ 'type', AdaptiveLabelPositioningBehavior ],
45948
46510
  appendBehavior: [ 'type', AppendBehavior ],
45949
46511
  associationBehavior: [ 'type', AssociationBehavior ],
45950
46512
  attachEventBehavior: [ 'type', AttachEventBehavior ],
45951
46513
  boundaryEventBehavior: [ 'type', BoundaryEventBehavior ],
45952
- rootElementReferenceBehavior: [ 'type', RootElementReferenceBehavior ],
45953
46514
  createBehavior: [ 'type', CreateBehavior ],
45954
- fixHoverBehavior: [ 'type', FixHoverBehavior ],
45955
46515
  createDataObjectBehavior: [ 'type', CreateDataObjectBehavior ],
45956
46516
  createParticipantBehavior: [ 'type', CreateParticipantBehavior$1 ],
45957
46517
  dataInputAssociationBehavior: [ 'type', DataInputAssociationBehavior ],
@@ -45960,26 +46520,29 @@
45960
46520
  detachEventBehavior: [ 'type', DetachEventBehavior ],
45961
46521
  dropOnFlowBehavior: [ 'type', DropOnFlowBehavior ],
45962
46522
  eventBasedGatewayBehavior: [ 'type', EventBasedGatewayBehavior ],
46523
+ fixHoverBehavior: [ 'type', FixHoverBehavior ],
45963
46524
  groupBehavior: [ 'type', GroupBehavior ],
45964
46525
  importDockingFix: [ 'type', ImportDockingFix ],
45965
46526
  isHorizontalFix: [ 'type', IsHorizontalFix ],
45966
46527
  labelBehavior: [ 'type', LabelBehavior ],
45967
46528
  messageFlowBehavior: [ 'type', MessageFlowBehavior ],
45968
46529
  modelingFeedback: [ 'type', ModelingFeedback ],
45969
- replaceConnectionBehavior: [ 'type', ReplaceConnectionBehavior ],
46530
+ removeElementBehavior: [ 'type', RemoveElementBehavior ],
46531
+ removeEmbeddedLabelBoundsBehavior: ['type', RemoveEmbeddedLabelBoundsBehavior ],
45970
46532
  removeParticipantBehavior: [ 'type', RemoveParticipantBehavior ],
46533
+ replaceConnectionBehavior: [ 'type', ReplaceConnectionBehavior ],
45971
46534
  replaceElementBehaviour: [ 'type', ReplaceElementBehaviour ],
45972
46535
  resizeBehavior: [ 'type', ResizeBehavior$1 ],
45973
46536
  resizeLaneBehavior: [ 'type', ResizeLaneBehavior ],
45974
- removeElementBehavior: [ 'type', RemoveElementBehavior ],
45975
- toggleCollapseConnectionBehaviour: [ 'type', ToggleCollapseConnectionBehaviour ],
45976
- toggleElementCollapseBehaviour : [ 'type', ToggleElementCollapseBehaviour ],
46537
+ rootElementReferenceBehavior: [ 'type', RootElementReferenceBehavior ],
45977
46538
  spaceToolBehavior: [ 'type', SpaceToolBehavior$1 ],
45978
- subProcessStartEventBehavior: [ 'type', SubProcessStartEventBehavior ],
45979
46539
  subProcessPlaneBehavior: [ 'type', SubProcessPlaneBehavior ],
46540
+ subProcessStartEventBehavior: [ 'type', SubProcessStartEventBehavior ],
46541
+ toggleCollapseConnectionBehaviour: [ 'type', ToggleCollapseConnectionBehaviour ],
46542
+ toggleElementCollapseBehaviour : [ 'type', ToggleElementCollapseBehaviour ],
45980
46543
  unclaimIdBehavior: [ 'type', UnclaimIdBehavior ],
45981
- updateFlowNodeRefsBehavior: [ 'type', UpdateFlowNodeRefsBehavior ],
45982
- unsetDefaultFlowBehavior: [ 'type', DeleteSequenceFlowBehavior ]
46544
+ unsetDefaultFlowBehavior: [ 'type', DeleteSequenceFlowBehavior ],
46545
+ updateFlowNodeRefsBehavior: [ 'type', UpdateFlowNodeRefsBehavior ]
45983
46546
  };
45984
46547
 
45985
46548
  function getBoundaryAttachment(position, targetBounds) {
@@ -47080,7 +47643,7 @@
47080
47643
  level: 9,
47081
47644
  containers: [
47082
47645
  'bpmn:Collaboration',
47083
- 'bpmn:Process'
47646
+ 'bpmn:FlowElementsContainer'
47084
47647
  ]
47085
47648
  }
47086
47649
  },
@@ -47108,7 +47671,7 @@
47108
47671
  level: 10,
47109
47672
  containers: [
47110
47673
  'bpmn:Collaboration',
47111
- 'bpmn:Process'
47674
+ 'bpmn:FlowElementsContainer'
47112
47675
  ]
47113
47676
  }
47114
47677
  },
@@ -47218,7 +47781,7 @@
47218
47781
 
47219
47782
  var OrderingModule = {
47220
47783
  __depends__: [
47221
- translateModule
47784
+ translate$2
47222
47785
  ],
47223
47786
  __init__: [ 'bpmnOrderingProvider' ],
47224
47787
  bpmnOrderingProvider: [ 'type', BpmnOrderingProvider ]
@@ -48134,7 +48697,7 @@
48134
48697
  return collection;
48135
48698
  }
48136
48699
 
48137
- var LOW_PRIORITY$i = 250,
48700
+ var LOW_PRIORITY$j = 250,
48138
48701
  HIGH_PRIORITY$f = 1400;
48139
48702
 
48140
48703
 
@@ -48165,7 +48728,7 @@
48165
48728
  });
48166
48729
 
48167
48730
  // add labels to visual's group
48168
- movePreview && eventBus.on('shape.move.start', LOW_PRIORITY$i, function(e) {
48731
+ movePreview && eventBus.on('shape.move.start', LOW_PRIORITY$j, function(e) {
48169
48732
 
48170
48733
  var context = e.context,
48171
48734
  shapes = context.shapes;
@@ -48294,7 +48857,7 @@
48294
48857
  labelSupport: [ 'type', LabelSupport ]
48295
48858
  };
48296
48859
 
48297
- var LOW_PRIORITY$j = 251,
48860
+ var LOW_PRIORITY$k = 251,
48298
48861
  HIGH_PRIORITY$g = 1401;
48299
48862
 
48300
48863
  var MARKER_ATTACH$1 = 'attach-ok';
@@ -48336,7 +48899,7 @@
48336
48899
  });
48337
48900
 
48338
48901
  // add attachers to the visual's group
48339
- movePreview && eventBus.on('shape.move.start', LOW_PRIORITY$j, function(e) {
48902
+ movePreview && eventBus.on('shape.move.start', LOW_PRIORITY$k, function(e) {
48340
48903
 
48341
48904
  var context = e.context,
48342
48905
  shapes = context.shapes,
@@ -48618,7 +49181,7 @@
48618
49181
  attachSupport: [ 'type', AttachSupport ]
48619
49182
  };
48620
49183
 
48621
- var LOW_PRIORITY$k = 250;
49184
+ var LOW_PRIORITY$l = 250;
48622
49185
 
48623
49186
  /**
48624
49187
  * The tool manager acts as middle-man between the available tool's and the Palette,
@@ -48694,7 +49257,7 @@
48694
49257
  eventsToRegister.push(event + '.canceled');
48695
49258
  });
48696
49259
 
48697
- eventBus.on(eventsToRegister, LOW_PRIORITY$k, function(event) {
49260
+ eventBus.on(eventsToRegister, LOW_PRIORITY$l, function(event) {
48698
49261
 
48699
49262
  // We defer the de-activation of the tool to the .activate phase,
48700
49263
  // so we're able to check if we want to toggle off the current
@@ -49323,7 +49886,7 @@
49323
49886
  var MARKER_DRAGGING = 'djs-dragging',
49324
49887
  MARKER_RESIZING$1 = 'djs-resizing';
49325
49888
 
49326
- var LOW_PRIORITY$l = 250;
49889
+ var LOW_PRIORITY$m = 250;
49327
49890
 
49328
49891
  var max$6 = Math.max;
49329
49892
 
@@ -49398,7 +49961,7 @@
49398
49961
  });
49399
49962
 
49400
49963
  // add and update move/resize previews
49401
- eventBus.on('spaceTool.move', LOW_PRIORITY$l, function(event) {
49964
+ eventBus.on('spaceTool.move', LOW_PRIORITY$m, function(event) {
49402
49965
 
49403
49966
  var context = event.context,
49404
49967
  line = context.line,
@@ -50055,7 +50618,18 @@
50055
50618
 
50056
50619
  BpmnUpdater.prototype.updateBounds = function(shape) {
50057
50620
 
50058
- var di = getDi(shape);
50621
+ var di = getDi(shape),
50622
+ embeddedLabelBounds = getEmbeddedLabelBounds(shape);
50623
+
50624
+ // update embedded label bounds if possible
50625
+ if (embeddedLabelBounds) {
50626
+ var embeddedLabelBoundsDelta = delta(embeddedLabelBounds, di.get('bounds'));
50627
+
50628
+ assign(embeddedLabelBounds, {
50629
+ x: shape.x + embeddedLabelBoundsDelta.x,
50630
+ y: shape.y + embeddedLabelBoundsDelta.y
50631
+ });
50632
+ }
50059
50633
 
50060
50634
  var target = (shape instanceof Label) ? this._getLabel(di) : di;
50061
50635
 
@@ -50430,6 +51004,33 @@
50430
51004
  };
50431
51005
  }
50432
51006
 
51007
+ /**
51008
+ * Return dc:Bounds of bpmndi:BPMNLabel if exists.
51009
+ *
51010
+ * @param {djs.model.shape} shape
51011
+ *
51012
+ * @returns {Object|undefined}
51013
+ */
51014
+ function getEmbeddedLabelBounds(shape) {
51015
+ if (!is$1(shape, 'bpmn:Activity')) {
51016
+ return;
51017
+ }
51018
+
51019
+ var di = getDi(shape);
51020
+
51021
+ if (!di) {
51022
+ return;
51023
+ }
51024
+
51025
+ var label = di.get('label');
51026
+
51027
+ if (!label) {
51028
+ return;
51029
+ }
51030
+
51031
+ return label.get('bounds');
51032
+ }
51033
+
50433
51034
  /**
50434
51035
  * A bpmn-aware factory for diagram-js shapes
50435
51036
  */
@@ -55607,7 +56208,7 @@
55607
56208
  connectionDocking: [ 'type', CroppingConnectionDocking ]
55608
56209
  };
55609
56210
 
55610
- var LOW_PRIORITY$m = 500,
56211
+ var LOW_PRIORITY$n = 500,
55611
56212
  MEDIUM_PRIORITY = 1250,
55612
56213
  HIGH_PRIORITY$i = 1500;
55613
56214
 
@@ -55706,7 +56307,7 @@
55706
56307
  // to let others modify the move event before we update
55707
56308
  // the context
55708
56309
  //
55709
- eventBus.on('shape.move.move', LOW_PRIORITY$m, function(event) {
56310
+ eventBus.on('shape.move.move', LOW_PRIORITY$n, function(event) {
55710
56311
 
55711
56312
  var context = event.context,
55712
56313
  validatedShapes = context.validatedShapes,
@@ -55852,7 +56453,7 @@
55852
56453
  });
55853
56454
  }
55854
56455
 
55855
- var LOW_PRIORITY$n = 499;
56456
+ var LOW_PRIORITY$o = 499;
55856
56457
 
55857
56458
  var MARKER_DRAGGING$1 = 'djs-dragging',
55858
56459
  MARKER_OK$3 = 'drop-ok',
@@ -55930,7 +56531,7 @@
55930
56531
  // assign a low priority to this handler
55931
56532
  // to let others modify the move context before
55932
56533
  // we draw things
55933
- eventBus.on('shape.move.start', LOW_PRIORITY$n, function(event) {
56534
+ eventBus.on('shape.move.start', LOW_PRIORITY$o, function(event) {
55934
56535
  var context = event.context,
55935
56536
  dragShapes = context.shapes,
55936
56537
  allDraggedElements = context.allDraggedElements;
@@ -55977,7 +56578,7 @@
55977
56578
  });
55978
56579
 
55979
56580
  // update previews
55980
- eventBus.on('shape.move.move', LOW_PRIORITY$n, function(event) {
56581
+ eventBus.on('shape.move.move', LOW_PRIORITY$o, function(event) {
55981
56582
 
55982
56583
  var context = event.context,
55983
56584
  dragGroup = context.dragGroup,
@@ -57320,13 +57921,13 @@
57320
57921
  LassoToolModule,
57321
57922
  HandToolModule,
57322
57923
  GlobalConnectModule,
57323
- translateModule
57924
+ translate$2
57324
57925
  ],
57325
57926
  __init__: [ 'paletteProvider' ],
57326
57927
  paletteProvider: [ 'type', PaletteProvider ]
57327
57928
  };
57328
57929
 
57329
- var LOW_PRIORITY$o = 250;
57930
+ var LOW_PRIORITY$p = 250;
57330
57931
 
57331
57932
 
57332
57933
  function BpmnReplacePreview(
@@ -57407,7 +58008,7 @@
57407
58008
  });
57408
58009
  }
57409
58010
 
57410
- eventBus.on('shape.move.move', LOW_PRIORITY$o, function(event) {
58011
+ eventBus.on('shape.move.move', LOW_PRIORITY$p, function(event) {
57411
58012
 
57412
58013
  var context = event.context,
57413
58014
  canExecute = context.canExecute;
@@ -59337,7 +59938,7 @@
59337
59938
  DistributeElementsModule$1,
59338
59939
  EditorActionsModule$1,
59339
59940
  GridSnappingModule$1,
59340
- InteractionEventsModule$1,
59941
+ InteractionEventsModule$2,
59341
59942
  KeyboardModule$1,
59342
59943
  KeyboardMoveSelectionModule,
59343
59944
  LabelEditingModule,
@@ -59363,6 +59964,24 @@
59363
59964
  Modeler.prototype._modelingModules
59364
59965
  );
59365
59966
 
59967
+ /**
59968
+ * SVGs for elements are generated by the {@link GraphicsFactory}.
59969
+ *
59970
+ * This utility gives quick access to the important semantic
59971
+ * parts of an element.
59972
+ */
59973
+
59974
+ /**
59975
+ * Returns the visual part of a diagram element
59976
+ *
59977
+ * @param {Snap<SVGElement>} gfx
59978
+ *
59979
+ * @return {Snap<SVGElement>}
59980
+ */
59981
+ function getVisual$1(gfx) {
59982
+ return gfx.childNodes[0];
59983
+ }
59984
+
59366
59985
  var MINIMAP_VIEWBOX_PADDING = 50;
59367
59986
 
59368
59987
  var RANGE$1 = { min: 0.2, max: 4 },
@@ -59370,7 +59989,7 @@
59370
59989
 
59371
59990
  var DELTA_THRESHOLD$1 = 0.1;
59372
59991
 
59373
- var LOW_PRIORITY$p = 250;
59992
+ var LOW_PRIORITY$q = 250;
59374
59993
 
59375
59994
 
59376
59995
  /**
@@ -59644,7 +60263,7 @@
59644
60263
  });
59645
60264
 
59646
60265
  // update on elements changed
59647
- eventBus.on('elements.changed', LOW_PRIORITY$p, function(context) {
60266
+ eventBus.on('elements.changed', LOW_PRIORITY$q, function(context) {
59648
60267
  var elements = context.elements;
59649
60268
 
59650
60269
  elements.forEach(function(element) {
@@ -60030,7 +60649,7 @@
60030
60649
  visual;
60031
60650
 
60032
60651
  if (gfx) {
60033
- visual = getVisual(gfx);
60652
+ visual = getVisual$1(gfx);
60034
60653
 
60035
60654
  if (visual) {
60036
60655
  var elementGfx = clone(visual);
@@ -60863,8 +61482,9 @@
60863
61482
 
60864
61483
  function Group(props) {
60865
61484
  const {
60866
- id,
61485
+ element,
60867
61486
  entries = [],
61487
+ id,
60868
61488
  label
60869
61489
  } = props;
60870
61490
  const [open, setOpen] = useLayoutState(['groups', id, 'open'], false);
@@ -60912,7 +61532,16 @@
60912
61532
  })]
60913
61533
  }), o$2("div", {
60914
61534
  class: classnames('bio-properties-panel-group-entries', open ? 'open' : ''),
60915
- children: entries.map(e => e.component)
61535
+ children: entries.map(entry => {
61536
+ const {
61537
+ component: Component,
61538
+ id
61539
+ } = entry;
61540
+ return a(Component, { ...entry,
61541
+ key: id,
61542
+ element: element
61543
+ });
61544
+ })
60916
61545
  })]
60917
61546
  });
60918
61547
  }
@@ -60930,7 +61559,7 @@
60930
61559
  const DEFAULT_DESCRIPTION = {};
60931
61560
  /**
60932
61561
  * @typedef { {
60933
- * component: import('preact').ComponentChild,
61562
+ * component: import('preact').Component,
60934
61563
  * id: String,
60935
61564
  * isEdited?: Function
60936
61565
  * } } EntryDefinition
@@ -61058,13 +61687,13 @@
61058
61687
  class: "bio-properties-panel-scroll-container",
61059
61688
  children: groups.map(group => {
61060
61689
  const {
61061
- component: GroupComponent = Group,
61690
+ component: Component = Group,
61062
61691
  id
61063
61692
  } = group;
61064
- return o$2(GroupComponent, {
61065
- element: element,
61066
- ...group
61067
- }, id);
61693
+ return a(Component, { ...group,
61694
+ key: id,
61695
+ element: element
61696
+ });
61068
61697
  })
61069
61698
  })]
61070
61699
  })
@@ -61495,6 +62124,66 @@
61495
62124
  debounceInput: ['factory', debounceInput]
61496
62125
  };
61497
62126
 
62127
+ /**
62128
+ * Failsafe remove an element from a collection
62129
+ *
62130
+ * @param {Array<Object>} [collection]
62131
+ * @param {Object} [element]
62132
+ *
62133
+ * @return {number} the previous index of the element
62134
+ */
62135
+
62136
+ /**
62137
+ * Fail save add an element to the given connection, ensuring
62138
+ * it does not yet exist.
62139
+ *
62140
+ * @param {Array<Object>} collection
62141
+ * @param {Object} element
62142
+ * @param {number} idx
62143
+ */
62144
+ function add$2(collection, element, idx) {
62145
+
62146
+ if (!collection || !element) {
62147
+ return;
62148
+ }
62149
+
62150
+ if (typeof idx !== 'number') {
62151
+ idx = -1;
62152
+ }
62153
+
62154
+ var currentIdx = collection.indexOf(element);
62155
+
62156
+ if (currentIdx !== -1) {
62157
+
62158
+ if (currentIdx === idx) {
62159
+
62160
+ // nothing to do, position has not changed
62161
+ return;
62162
+ } else {
62163
+
62164
+ if (idx !== -1) {
62165
+
62166
+ // remove from current position
62167
+ collection.splice(currentIdx, 1);
62168
+ } else {
62169
+
62170
+ // already exists in collection
62171
+ return;
62172
+ }
62173
+ }
62174
+ }
62175
+
62176
+ if (idx !== -1) {
62177
+
62178
+ // insert at specified position
62179
+ collection.splice(idx, 0, element);
62180
+ } else {
62181
+
62182
+ // push to end
62183
+ collection.push(element);
62184
+ }
62185
+ }
62186
+
61498
62187
  // Note: this is the semver.org version of the spec that it implements
61499
62188
  // Not necessarily the package version of this code.
61500
62189
  const SEMVER_SPEC_VERSION = '2.0.0';
@@ -65392,7 +66081,9 @@
65392
66081
  'SignalStartEvent': StartEventSignalIcon,
65393
66082
  'TimerStartEvent': StartEventTimerIcon,
65394
66083
  'CollapsedSubProcess': SubprocessCollapsedIcon,
66084
+ 'CollapsedAdHocSubProcess': SubprocessCollapsedIcon,
65395
66085
  'ExpandedSubProcess': SubprocessExpandedIcon,
66086
+ 'ExpandedAdHocSubProcess': SubprocessExpandedIcon,
65396
66087
  'Task': TaskNoneIcon,
65397
66088
  'TextAnnotation': TextAnnotationicon,
65398
66089
  'Transaction': TransactionIcon,
@@ -66000,6 +66691,14 @@
66000
66691
  return compensateEventDefinition && compensateEventDefinition.get('activityRef');
66001
66692
  }
66002
66693
 
66694
+ /**
66695
+ * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry
66696
+ */
66697
+
66698
+ /**
66699
+ * @returns {Array<Entry>} entries
66700
+ */
66701
+
66003
66702
  function CompensationProps(props) {
66004
66703
  const {
66005
66704
  element
@@ -66011,15 +66710,11 @@
66011
66710
 
66012
66711
  return [{
66013
66712
  id: 'waitForCompletion',
66014
- component: o$2(WaitForCompletion, {
66015
- element: element
66016
- }),
66713
+ component: WaitForCompletion,
66017
66714
  isEdited: isEdited$6
66018
66715
  }, {
66019
66716
  id: 'activityRef',
66020
- component: o$2(ActivityRef, {
66021
- element: element
66022
- }),
66717
+ component: ActivityRef,
66023
66718
  isEdited: isEdited$4
66024
66719
  }];
66025
66720
  }
@@ -66229,18 +66924,14 @@
66229
66924
  } = props;
66230
66925
  const entries = [{
66231
66926
  id: 'documentation',
66232
- component: o$2(ElementDocumentationProperty, {
66233
- element: element
66234
- }),
66927
+ component: ElementDocumentationProperty,
66235
66928
  isEdited: isEdited$2
66236
66929
  }];
66237
66930
 
66238
66931
  if (hasProcessRef$2(element)) {
66239
66932
  entries.push({
66240
66933
  id: 'processDocumentation',
66241
- component: o$2(ProcessDocumentationProperty, {
66242
- element: element
66243
- }),
66934
+ component: ProcessDocumentationProperty,
66244
66935
  isEdited: isEdited$2
66245
66936
  });
66246
66937
  }
@@ -66433,24 +67124,18 @@
66433
67124
  const error = getError(element);
66434
67125
  let entries = [{
66435
67126
  id: 'errorRef',
66436
- component: o$2(ErrorRef$1, {
66437
- element: element
66438
- }),
67127
+ component: ErrorRef$1,
66439
67128
  isEdited: isEdited$4
66440
67129
  }];
66441
67130
 
66442
67131
  if (error) {
66443
67132
  entries = [...entries, {
66444
67133
  id: 'errorName',
66445
- component: o$2(ErrorName$1, {
66446
- element: element
66447
- }),
67134
+ component: ErrorName$1,
66448
67135
  isEdited: isEdited$1
66449
67136
  }, {
66450
67137
  id: 'errorCode',
66451
- component: o$2(ErrorCode$1, {
66452
- element: element
66453
- }),
67138
+ component: ErrorCode$1,
66454
67139
  isEdited: isEdited$1
66455
67140
  }];
66456
67141
  }
@@ -66636,24 +67321,18 @@
66636
67321
  const escalation = getEscalation(element);
66637
67322
  let entries = [{
66638
67323
  id: 'escalationRef',
66639
- component: o$2(EscalationRef, {
66640
- element: element
66641
- }),
67324
+ component: EscalationRef,
66642
67325
  isEdited: isEdited$4
66643
67326
  }];
66644
67327
 
66645
67328
  if (escalation) {
66646
67329
  entries = [...entries, {
66647
67330
  id: 'escalationName',
66648
- component: o$2(EscalationName, {
66649
- element: element
66650
- }),
67331
+ component: EscalationName,
66651
67332
  isEdited: isEdited$1
66652
67333
  }, {
66653
67334
  id: 'escalationCode',
66654
- component: o$2(EscalationCode, {
66655
- element: element
66656
- }),
67335
+ component: EscalationCode,
66657
67336
  isEdited: isEdited$1
66658
67337
  }];
66659
67338
  }
@@ -66815,6 +67494,14 @@
66815
67494
  return sortBy(elements, e => (e.name || '').toLowerCase());
66816
67495
  }
66817
67496
 
67497
+ /**
67498
+ * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry
67499
+ */
67500
+
67501
+ /**
67502
+ * @returns {Array<Entry>} entries
67503
+ */
67504
+
66818
67505
  function ExecutableProps(props) {
66819
67506
  const {
66820
67507
  element
@@ -66826,9 +67513,7 @@
66826
67513
 
66827
67514
  return [{
66828
67515
  id: 'isExecutable',
66829
- component: o$2(Executable, {
66830
- element: element
66831
- }),
67516
+ component: Executable,
66832
67517
  isEdited: isEdited$6
66833
67518
  }];
66834
67519
  }
@@ -66931,15 +67616,18 @@
66931
67616
  return SPACE_REGEX.test(value);
66932
67617
  }
66933
67618
 
66934
- function IdProps(props) {
66935
- const {
66936
- element
66937
- } = props;
67619
+ /**
67620
+ * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry
67621
+ */
67622
+
67623
+ /**
67624
+ * @returns {Array<Entry>} entries
67625
+ */
67626
+
67627
+ function IdProps() {
66938
67628
  return [{
66939
67629
  id: 'id',
66940
- component: o$2(Id$3, {
66941
- element: element
66942
- }),
67630
+ component: Id$3,
66943
67631
  isEdited: isEdited$1
66944
67632
  }];
66945
67633
  }
@@ -66978,6 +67666,14 @@
66978
67666
  });
66979
67667
  }
66980
67668
 
67669
+ /**
67670
+ * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry
67671
+ */
67672
+
67673
+ /**
67674
+ * @returns {Array<Entry>} entries
67675
+ */
67676
+
66981
67677
  function LinkProps(props) {
66982
67678
  const {
66983
67679
  element
@@ -66989,9 +67685,7 @@
66989
67685
 
66990
67686
  return [{
66991
67687
  id: 'linkName',
66992
- component: o$2(LinkName, {
66993
- element: element
66994
- }),
67688
+ component: LinkName,
66995
67689
  isEdited: isEdited$1
66996
67690
  }];
66997
67691
  }
@@ -67051,18 +67745,14 @@
67051
67745
  const message = getMessage(element);
67052
67746
  let entries = [{
67053
67747
  id: 'messageRef',
67054
- component: o$2(MessageRef, {
67055
- element: element
67056
- }),
67748
+ component: MessageRef,
67057
67749
  isEdited: isEdited$4
67058
67750
  }];
67059
67751
 
67060
67752
  if (message) {
67061
67753
  entries = [...entries, {
67062
67754
  id: 'messageName',
67063
- component: o$2(MessageName, {
67064
- element: element
67065
- }),
67755
+ component: MessageName,
67066
67756
  isEdited: isEdited$1
67067
67757
  }];
67068
67758
  }
@@ -67196,6 +67886,14 @@
67196
67886
  return sortBy(elements, e => (e.name || '').toLowerCase());
67197
67887
  }
67198
67888
 
67889
+ /**
67890
+ * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry
67891
+ */
67892
+
67893
+ /**
67894
+ * @returns {Array<Entry>} entries
67895
+ */
67896
+
67199
67897
  function MultiInstanceProps$2(props) {
67200
67898
  const {
67201
67899
  element
@@ -67207,15 +67905,11 @@
67207
67905
 
67208
67906
  const entries = [{
67209
67907
  id: 'loopCardinality',
67210
- component: o$2(LoopCardinality, {
67211
- element: element
67212
- }),
67908
+ component: LoopCardinality,
67213
67909
  isEdited: isEdited$1
67214
67910
  }, {
67215
67911
  id: 'completionCondition',
67216
- component: o$2(CompletionCondition$1, {
67217
- element: element
67218
- }),
67912
+ component: CompletionCondition$1,
67219
67913
  isEdited: isEdited$1
67220
67914
  }];
67221
67915
  return entries;
@@ -67439,6 +68133,14 @@
67439
68133
  return getBody(completionCondition);
67440
68134
  }
67441
68135
 
68136
+ /**
68137
+ * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry
68138
+ */
68139
+
68140
+ /**
68141
+ * @returns {Array<Entry>} entries
68142
+ */
68143
+
67442
68144
  function NameProps(props) {
67443
68145
  const {
67444
68146
  element
@@ -67450,9 +68152,7 @@
67450
68152
 
67451
68153
  return [{
67452
68154
  id: 'name',
67453
- component: o$2(Name$3, {
67454
- element: element
67455
- }),
68155
+ component: Name$3,
67456
68156
  isEdited: isEdited$1
67457
68157
  }];
67458
68158
  }
@@ -67533,12 +68233,20 @@
67533
68233
  categoryValue: [categoryValue]
67534
68234
  }); // add to correct place
67535
68235
 
67536
- add$1(definitions.get('rootElements'), category);
68236
+ add$2(definitions.get('rootElements'), category);
67537
68237
  getBusinessObject(category).$parent = definitions;
67538
68238
  getBusinessObject(categoryValue).$parent = category;
67539
68239
  return categoryValue;
67540
68240
  }
67541
68241
 
68242
+ /**
68243
+ * @typedef { import('@bpmn-io/properties-panel').EntryDefinition } Entry
68244
+ */
68245
+
68246
+ /**
68247
+ * @returns {Array<Entry>} entries
68248
+ */
68249
+
67542
68250
  function ProcessProps(props) {
67543
68251
  const {
67544
68252
  element
@@ -67550,15 +68258,11 @@
67550
68258
 
67551
68259
  return [{
67552
68260
  id: 'processId',
67553
- component: o$2(ProcessId, {
67554
- element: element
67555
- }),
68261
+ component: ProcessId,
67556
68262
  isEdited: isEdited$1
67557
68263
  }, {
67558
68264
  id: 'processName',
67559
- component: o$2(ProcessName, {
67560
- element: element
67561
- }),
68265
+ component: ProcessName,
67562
68266
  isEdited: isEdited$1
67563
68267
  }];
67564
68268
  }
@@ -67661,18 +68365,14 @@
67661
68365
  const signal = getSignal(element);
67662
68366
  let entries = [{
67663
68367
  id: 'signalRef',
67664
- component: o$2(SignalRef, {
67665
- element: element
67666
- }),
68368
+ component: SignalRef,
67667
68369
  isEdited: isEdited$4
67668
68370
  }];
67669
68371
 
67670
68372
  if (signal) {
67671
68373
  entries = [...entries, {
67672
68374
  id: 'signalName',
67673
- component: o$2(SignalName, {
67674
- element: element
67675
- }),
68375
+ component: SignalName,
67676
68376
  isEdited: isEdited$1
67677
68377
  }];
67678
68378
  }
@@ -67831,23 +68531,19 @@
67831
68531
  const entries = [];
67832
68532
  entries.push({
67833
68533
  id: getId(idPrefix, 'timerEventDefinitionType'),
67834
- component: o$2(TimerEventDefinitionType$1, {
67835
- element: element,
67836
- timerEventDefinition: timerEventDefinition,
67837
- timerEventDefinitionType: timerEventDefinitionType
67838
- }),
67839
- isEdited: isEdited$4
68534
+ component: TimerEventDefinitionType$1,
68535
+ isEdited: isEdited$4,
68536
+ timerEventDefinition,
68537
+ timerEventDefinitionType
67840
68538
  });
67841
68539
 
67842
68540
  if (timerEventDefinitionType) {
67843
68541
  entries.push({
67844
68542
  id: getId(idPrefix, 'timerEventDefinitionValue'),
67845
- component: o$2(TimerEventDefinitionValue$1, {
67846
- element: element,
67847
- timerEventDefinition: timerEventDefinition,
67848
- timerEventDefinitionType: timerEventDefinitionType
67849
- }),
67850
- isEdited: isEdited$1
68543
+ component: TimerEventDefinitionValue$1,
68544
+ isEdited: isEdited$1,
68545
+ timerEventDefinition,
68546
+ timerEventDefinitionType
67851
68547
  });
67852
68548
  }
67853
68549
 
@@ -68062,9 +68758,7 @@
68062
68758
  function GeneralGroup(element) {
68063
68759
  const entries = [...NameProps({
68064
68760
  element
68065
- }), ...IdProps({
68066
- element
68067
- }), ...ProcessProps({
68761
+ }), ...IdProps(), ...ProcessProps({
68068
68762
  element
68069
68763
  }), ...ExecutableProps({
68070
68764
  element