bpmn-js 9.0.3 → 9.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * bpmn-js - bpmn-viewer v9.0.3
2
+ * bpmn-js - bpmn-viewer v9.0.4
3
3
  *
4
4
  * Copyright (c) 2014-present, camunda Services GmbH
5
5
  *
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * Source Code: https://github.com/bpmn-io/bpmn-js
10
10
  *
11
- * Date: 2022-03-14
11
+ * Date: 2022-05-13
12
12
  */
13
13
  (function (global, factory) {
14
14
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -516,6 +516,21 @@
516
516
  return bo && (typeof bo.$instanceOf === 'function') && bo.$instanceOf(type);
517
517
  }
518
518
 
519
+
520
+ /**
521
+ * Return true if element has any of the given types.
522
+ *
523
+ * @param {djs.model.Base} element
524
+ * @param {Array<string>} types
525
+ *
526
+ * @return {boolean}
527
+ */
528
+ function isAny(element, types) {
529
+ return some(types, function(t) {
530
+ return is$1(element, t);
531
+ });
532
+ }
533
+
519
534
  /**
520
535
  * Return the business object for a given element.
521
536
  *
@@ -8009,7 +8024,7 @@
8009
8024
  collapsedElements.push(bo);
8010
8025
  }
8011
8026
 
8012
- if (is$1(parent, 'bpmn:SubProcess') && parent !== plane.bpmnElement) {
8027
+ if (shouldMoveToPlane(bo, plane)) {
8013
8028
 
8014
8029
  // don't change the array while we iterate over it
8015
8030
  elementsToMove.push({ diElement: diElement, parent: parent });
@@ -8098,7 +8113,7 @@
8098
8113
  SubprocessCompatibility.$inject = [ 'eventBus', 'moddle' ];
8099
8114
 
8100
8115
 
8101
- // helpers
8116
+ // helpers //////////////////////////
8102
8117
 
8103
8118
  function findRootDiagram(element) {
8104
8119
  if (is$1(element, 'bpmndi:BPMNDiagram')) {
@@ -8130,6 +8145,23 @@
8130
8145
  return asBounds(planeTrbl);
8131
8146
  }
8132
8147
 
8148
+ function shouldMoveToPlane(bo, plane) {
8149
+ var parent = bo.$parent;
8150
+
8151
+ // don't move elements that are already on the plane
8152
+ if (!is$1(parent, 'bpmn:SubProcess') || parent === plane.bpmnElement) {
8153
+ return false;
8154
+ }
8155
+
8156
+ // dataAssociations are children of the subprocess but rendered on process level
8157
+ // cf. https://github.com/bpmn-io/bpmn-js/issues/1619
8158
+ if (isAny(bo, ['bpmn:DataInputAssociation', 'bpmn:DataOutputAssociation'])) {
8159
+ return false;
8160
+ }
8161
+
8162
+ return true;
8163
+ }
8164
+
8133
8165
  var LOW_PRIORITY = 250;
8134
8166
  var ARROW_DOWN_SVG = '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg>';
8135
8167
 
@@ -8205,7 +8237,7 @@
8205
8237
  }, true);
8206
8238
 
8207
8239
 
8208
- eventBus.on('import.done', function() {
8240
+ eventBus.on('import.render.complete', function() {
8209
8241
  elementRegistry.filter(function(e) {
8210
8242
  return self.canDrillDown(e);
8211
8243
  }).map(function(el) {
@@ -20243,7 +20275,7 @@
20243
20275
  }
20244
20276
 
20245
20277
  /**
20246
- * Returns all diagrams in the same hirarchy as the requested diagram.
20278
+ * Returns all diagrams in the same hierarchy as the requested diagram.
20247
20279
  * Includes all parent and sub process diagrams.
20248
20280
  *
20249
20281
  * @param {Array} definitions