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-navigated-viewer v9.0.3
2
+ * bpmn-js - bpmn-navigated-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
  *
@@ -8026,7 +8041,7 @@
8026
8041
  collapsedElements.push(bo);
8027
8042
  }
8028
8043
 
8029
- if (is$1(parent, 'bpmn:SubProcess') && parent !== plane.bpmnElement) {
8044
+ if (shouldMoveToPlane(bo, plane)) {
8030
8045
 
8031
8046
  // don't change the array while we iterate over it
8032
8047
  elementsToMove.push({ diElement: diElement, parent: parent });
@@ -8115,7 +8130,7 @@
8115
8130
  SubprocessCompatibility.$inject = [ 'eventBus', 'moddle' ];
8116
8131
 
8117
8132
 
8118
- // helpers
8133
+ // helpers //////////////////////////
8119
8134
 
8120
8135
  function findRootDiagram(element) {
8121
8136
  if (is$1(element, 'bpmndi:BPMNDiagram')) {
@@ -8147,6 +8162,23 @@
8147
8162
  return asBounds(planeTrbl);
8148
8163
  }
8149
8164
 
8165
+ function shouldMoveToPlane(bo, plane) {
8166
+ var parent = bo.$parent;
8167
+
8168
+ // don't move elements that are already on the plane
8169
+ if (!is$1(parent, 'bpmn:SubProcess') || parent === plane.bpmnElement) {
8170
+ return false;
8171
+ }
8172
+
8173
+ // dataAssociations are children of the subprocess but rendered on process level
8174
+ // cf. https://github.com/bpmn-io/bpmn-js/issues/1619
8175
+ if (isAny(bo, ['bpmn:DataInputAssociation', 'bpmn:DataOutputAssociation'])) {
8176
+ return false;
8177
+ }
8178
+
8179
+ return true;
8180
+ }
8181
+
8150
8182
  var LOW_PRIORITY$1 = 250;
8151
8183
  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>';
8152
8184
 
@@ -8222,7 +8254,7 @@
8222
8254
  }, true);
8223
8255
 
8224
8256
 
8225
- eventBus.on('import.done', function() {
8257
+ eventBus.on('import.render.complete', function() {
8226
8258
  elementRegistry.filter(function(e) {
8227
8259
  return self.canDrillDown(e);
8228
8260
  }).map(function(el) {
@@ -20260,7 +20292,7 @@
20260
20292
  }
20261
20293
 
20262
20294
  /**
20263
- * Returns all diagrams in the same hirarchy as the requested diagram.
20295
+ * Returns all diagrams in the same hierarchy as the requested diagram.
20264
20296
  * Includes all parent and sub process diagrams.
20265
20297
  *
20266
20298
  * @param {Array} definitions