bpmn-js 9.0.2 → 9.0.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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,11 @@ All notable changes to [bpmn-js](https://github.com/bpmn-io/bpmn-js) are documen
7
7
 
8
8
  ___Note:__ Yet to be released changes appear here._
9
9
 
10
+ ## 9.0.3
11
+
12
+ * `FIX`: submit direct editing result on drilldown ([#1609](https://github.com/bpmn-io/bpmn-js/issues/1609))
13
+ * `DEPS`: bump to `diagram-js@8.2.0` ([2bac149](https://github.com/bpmn-io/bpmn-js/commit/2bac1495058601fec203c134b41efe5600e5fc97))
14
+
10
15
  ## 9.0.2
11
16
 
12
17
  * `FIX`: support modeling of groups in collapsed subporcesses ([#1606](https://github.com/bpmn-io/bpmn-js/issues/1606))
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * bpmn-js - bpmn-modeler v9.0.2
2
+ * bpmn-js - bpmn-modeler v9.0.3
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-02-23
11
+ * Date: 2022-03-14
12
12
  */
13
13
  (function (global, factory) {
14
14
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -2372,7 +2372,7 @@
2372
2372
  }
2373
2373
  });
2374
2374
 
2375
- eventBus.on([ 'render.getShapePath', 'render.getConnectionPath'], renderPriority, function(evt, element) {
2375
+ eventBus.on([ 'render.getShapePath', 'render.getConnectionPath' ], renderPriority, function(evt, element) {
2376
2376
  if (self.canRender(element)) {
2377
2377
  if (evt.type === 'render.getShapePath') {
2378
2378
  return self.getShapePath(element);
@@ -2684,7 +2684,7 @@
2684
2684
 
2685
2685
  stopRecursion = !!stopRecursion;
2686
2686
  if (!isArray$2(elements)) {
2687
- elements = [elements];
2687
+ elements = [ elements ];
2688
2688
  }
2689
2689
 
2690
2690
  var minX,
@@ -2864,11 +2864,11 @@
2864
2864
  height = shape.height;
2865
2865
 
2866
2866
  var shapePath = [
2867
- ['M', x, y],
2868
- ['l', width, 0],
2869
- ['l', 0, height],
2870
- ['l', -width, 0],
2871
- ['z']
2867
+ [ 'M', x, y ],
2868
+ [ 'l', width, 0 ],
2869
+ [ 'l', 0, height ],
2870
+ [ 'l', -width, 0 ],
2871
+ [ 'z' ]
2872
2872
  ];
2873
2873
 
2874
2874
  return componentsToPath(shapePath);
@@ -4594,6 +4594,25 @@
4594
4594
  return layer.group;
4595
4595
  };
4596
4596
 
4597
+ /**
4598
+ * For a given index, return the number of layers that have a higher index and
4599
+ * are visible.
4600
+ *
4601
+ * This is used to determine the node a layer should be inserted at.
4602
+ *
4603
+ * @param {Number} index
4604
+ * @returns {Number}
4605
+ */
4606
+ Canvas.prototype._getChildIndex = function(index) {
4607
+ return reduce(this._layers, function(childIndex, layer) {
4608
+ if (layer.visible && index >= layer.index) {
4609
+ childIndex++;
4610
+ }
4611
+
4612
+ return childIndex;
4613
+ }, 0);
4614
+ };
4615
+
4597
4616
  /**
4598
4617
  * Creates a given layer and returns it.
4599
4618
  *
@@ -4608,19 +4627,80 @@
4608
4627
  index = UTILITY_LAYER_INDEX;
4609
4628
  }
4610
4629
 
4611
- var childIndex = reduce(this._layers, function(childIndex, layer) {
4612
- if (index >= layer.index) {
4613
- childIndex++;
4614
- }
4615
-
4616
- return childIndex;
4617
- }, 0);
4630
+ var childIndex = this._getChildIndex(index);
4618
4631
 
4619
4632
  return {
4620
4633
  group: createGroup(this._viewport, 'layer-' + name, childIndex),
4621
- index: index
4634
+ index: index,
4635
+ visible: true
4622
4636
  };
4637
+ };
4638
+
4639
+
4640
+ /**
4641
+ * Shows a given layer.
4642
+ *
4643
+ * @param {String} layer
4644
+ * @returns {SVGElement}
4645
+ */
4646
+ Canvas.prototype.showLayer = function(name) {
4647
+
4648
+ if (!name) {
4649
+ throw new Error('must specify a name');
4650
+ }
4651
+
4652
+ var layer = this._layers[name];
4653
+
4654
+ if (!layer) {
4655
+ throw new Error('layer <' + name + '> does not exist');
4656
+ }
4657
+
4658
+ var viewport = this._viewport;
4659
+ var group = layer.group;
4660
+ var index = layer.index;
4661
+
4662
+ if (layer.visible) {
4663
+ return group;
4664
+ }
4665
+
4666
+ var childIndex = this._getChildIndex(index);
4667
+
4668
+ viewport.insertBefore(group, viewport.childNodes[childIndex] || null);
4669
+
4670
+ layer.visible = true;
4671
+
4672
+ return group;
4673
+ };
4674
+
4675
+ /**
4676
+ * Hides a given layer.
4677
+ *
4678
+ * @param {String} layer
4679
+ * @returns {SVGElement}
4680
+ */
4681
+ Canvas.prototype.hideLayer = function(name) {
4682
+
4683
+ if (!name) {
4684
+ throw new Error('must specify a name');
4685
+ }
4686
+
4687
+ var layer = this._layers[name];
4688
+
4689
+ if (!layer) {
4690
+ throw new Error('layer <' + name + '> does not exist');
4691
+ }
4692
+
4693
+ var group = layer.group;
4694
+
4695
+ if (!layer.visible) {
4696
+ return group;
4697
+ }
4698
+
4699
+ remove$1(group);
4700
+
4701
+ layer.visible = false;
4623
4702
 
4703
+ return group;
4624
4704
  };
4625
4705
 
4626
4706
 
@@ -4863,7 +4943,7 @@
4863
4943
 
4864
4944
  var layer = this.getLayer(layerName, PLANE_LAYER_INDEX);
4865
4945
 
4866
- attr(layer, 'display', 'none');
4946
+ this.hideLayer(layerName);
4867
4947
 
4868
4948
  this._addRoot(rootElement, layer);
4869
4949
 
@@ -4982,17 +5062,13 @@
4982
5062
 
4983
5063
  var currentRoot = this._rootElement;
4984
5064
 
4985
- var currentLayer;
4986
-
4987
5065
  if (currentRoot) {
4988
5066
 
4989
5067
  // un-associate previous root element <svg>
4990
5068
  this._elementRegistry.updateGraphics(currentRoot, null, true);
4991
5069
 
4992
5070
  // hide previous layer
4993
- currentLayer = this._findPlaneForRoot(currentRoot).layer;
4994
-
4995
- attr(currentLayer, 'display', 'none');
5071
+ this.hideLayer(currentRoot.layer);
4996
5072
  }
4997
5073
 
4998
5074
  if (rootElement) {
@@ -5005,7 +5081,7 @@
5005
5081
  this._elementRegistry.updateGraphics(rootElement, this._svg, true);
5006
5082
 
5007
5083
  // show root layer
5008
- attr(layer, 'display', null);
5084
+ this.showLayer(rootElement.layer);
5009
5085
  }
5010
5086
 
5011
5087
  this._rootElement = rootElement;
@@ -7403,7 +7479,7 @@
7403
7479
  options = options || {};
7404
7480
 
7405
7481
  var configModule = {
7406
- 'config': ['value', options]
7482
+ 'config': [ 'value', options ]
7407
7483
  };
7408
7484
 
7409
7485
  var modules = [ configModule, CoreModule$1 ].concat(options.modules || []);
@@ -20962,7 +21038,7 @@
20962
21038
  };
20963
21039
 
20964
21040
 
20965
- Outline.$inject = ['eventBus', 'styles', 'elementRegistry'];
21041
+ Outline.$inject = [ 'eventBus', 'styles', 'elementRegistry' ];
20966
21042
 
20967
21043
  var OutlineModule = {
20968
21044
  __init__: [ 'outline' ],
@@ -21992,7 +22068,7 @@
21992
22068
  ];
21993
22069
 
21994
22070
  var ChangeSupportModule = {
21995
- __init__: [ 'changeSupport'],
22071
+ __init__: [ 'changeSupport' ],
21996
22072
  changeSupport: [ 'type', ChangeSupport ]
21997
22073
  };
21998
22074
 
@@ -22164,7 +22240,7 @@
22164
22240
 
22165
22241
  inherits$1(RootElementsBehavior, CommandInterceptor);
22166
22242
 
22167
- RootElementsBehavior.$inject = [ 'canvas', 'injector'];
22243
+ RootElementsBehavior.$inject = [ 'canvas', 'injector' ];
22168
22244
 
22169
22245
  var RootElementsModule = {
22170
22246
  __init__: [ 'rootElementsBehavior' ],
@@ -23273,7 +23349,7 @@
23273
23349
  var KEYCODE_Y = 89;
23274
23350
  var KEYCODE_Z = 90;
23275
23351
 
23276
- var KEYS_COPY = ['c', 'C', KEYCODE_C ];
23352
+ var KEYS_COPY = [ 'c', 'C', KEYCODE_C ];
23277
23353
  var KEYS_PASTE = [ 'v', 'V', KEYCODE_V ];
23278
23354
  var KEYS_REDO = [ 'y', 'Y', KEYCODE_Y ];
23279
23355
  var KEYS_UNDO = [ 'z', 'Z', KEYCODE_Z ];
@@ -23429,7 +23505,7 @@
23429
23505
 
23430
23506
  var event = context.keyEvent;
23431
23507
 
23432
- if (isKey(['Backspace', 'Delete', 'Del' ], event)) {
23508
+ if (isKey([ 'Backspace', 'Delete', 'Del' ], event)) {
23433
23509
  editorActions.trigger('removeSelection');
23434
23510
 
23435
23511
  return true;
@@ -29179,11 +29255,11 @@
29179
29255
  y = center.y;
29180
29256
 
29181
29257
  return [
29182
- ['M', x, y],
29183
- ['m', 0, -r],
29184
- ['a', r, r, 0, 1, 1, 0, 2 * r],
29185
- ['a', r, r, 0, 1, 1, 0, -2 * r],
29186
- ['z']
29258
+ [ 'M', x, y ],
29259
+ [ 'm', 0, -r ],
29260
+ [ 'a', r, r, 0, 1, 1, 0, 2 * r ],
29261
+ [ 'a', r, r, 0, 1, 1, 0, -2 * r ],
29262
+ [ 'z' ]
29187
29263
  ];
29188
29264
  }
29189
29265
 
@@ -30759,7 +30835,7 @@
30759
30835
  return parent.children || [];
30760
30836
  }
30761
30837
 
30762
- var abs$5= Math.abs,
30838
+ var abs$5 = Math.abs,
30763
30839
  round$6 = Math.round;
30764
30840
 
30765
30841
  var TOLERANCE = 10;
@@ -40119,7 +40195,8 @@
40119
40195
  'canvas.viewbox.changing',
40120
40196
  'drag.init',
40121
40197
  'element.mousedown',
40122
- 'popupMenu.open'
40198
+ 'popupMenu.open',
40199
+ 'root.set'
40123
40200
  ], function(event) {
40124
40201
 
40125
40202
  if (directEditing.isActive()) {
@@ -48246,7 +48323,7 @@
48246
48323
  }
48247
48324
 
48248
48325
  var LabelSupportModule = {
48249
- __init__: [ 'labelSupport'],
48326
+ __init__: [ 'labelSupport' ],
48250
48327
  labelSupport: [ 'type', LabelSupport ]
48251
48328
  };
48252
48329
 
@@ -48434,7 +48511,7 @@
48434
48511
  saveClear(oldShape.attachers, function(attacher) {
48435
48512
  var allowed = rules.allowed('elements.move', {
48436
48513
  target: newShape,
48437
- shapes: [attacher]
48514
+ shapes: [ attacher ]
48438
48515
  });
48439
48516
 
48440
48517
  if (allowed === 'attach') {
@@ -49568,7 +49645,7 @@
49568
49645
  }
49569
49646
 
49570
49647
  var SpaceToolModule = {
49571
- __init__: ['spaceToolPreview'],
49648
+ __init__: [ 'spaceToolPreview' ],
49572
49649
  __depends__: [
49573
49650
  DraggingModule,
49574
49651
  RulesModule$1,
@@ -49576,8 +49653,8 @@
49576
49653
  PreviewSupportModule,
49577
49654
  MouseModule
49578
49655
  ],
49579
- spaceTool: ['type', SpaceTool ],
49580
- spaceToolPreview: ['type', SpaceToolPreview ]
49656
+ spaceTool: [ 'type', SpaceTool ],
49657
+ spaceToolPreview: [ 'type', SpaceToolPreview ]
49581
49658
  };
49582
49659
 
49583
49660
  function BpmnFactory(moddle) {
@@ -51697,7 +51774,7 @@
51697
51774
  newParentIndex = context.newParentIndex,
51698
51775
  oldParent = shape.parent;
51699
51776
 
51700
- context.oldBounds = pick(shape, [ 'x', 'y', 'width', 'height']);
51777
+ context.oldBounds = pick(shape, [ 'x', 'y', 'width', 'height' ]);
51701
51778
 
51702
51779
  // save old parent in context
51703
51780
  context.oldParent = oldParent;
@@ -52343,7 +52420,7 @@
52343
52420
  // recursively hide/show children
52344
52421
  var result = setHiddenRecursive(children, shape.collapsed);
52345
52422
 
52346
- return [shape].concat(result);
52423
+ return [ shape ].concat(result);
52347
52424
  };
52348
52425
 
52349
52426
 
@@ -52360,7 +52437,7 @@
52360
52437
  // retoggle state
52361
52438
  shape.collapsed = !shape.collapsed;
52362
52439
 
52363
- return [shape].concat(result);
52440
+ return [ shape ].concat(result);
52364
52441
  };
52365
52442
 
52366
52443
 
@@ -58961,8 +59038,8 @@
58961
59038
  var h = box.height + offset * 2;
58962
59039
 
58963
59040
  var styles = [
58964
- 'width: '+ w +'px',
58965
- 'height: '+ h + 'px'
59041
+ 'width: ' + w + 'px',
59042
+ 'height: ' + h + 'px'
58966
59043
  ].join('; ');
58967
59044
 
58968
59045
  return {