bpmn-js 9.0.0 → 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,36 +7,35 @@ 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.0
11
-
12
- * `FEAT`: update umbedded label bounds when shape is moved ([#1586](https://github.com/bpmn-io/bpmn-js/pull/1586))
13
- * `FIX`: ensure plane ID change is undoable ([#1600](https://github.com/bpmn-io/bpmn-js/pull/1600))
14
- * `FIX`: allow groups and associations to be created in subprocesses ([#1599](https://github.com/bpmn-io/bpmn-js/pull/1599))
15
- * `CHORE`: expose `BpmnRenderer` extension points ([#1585](https://github.com/bpmn-io/bpmn-js/pull/1585))
10
+ ## 9.0.3
16
11
 
17
- ## 9.0.0-alpha.2
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))
18
14
 
19
- * `FIX`: use active plane for svg export ([#1592](https://github.com/bpmn-io/bpmn-js/issues/1592))
20
- * `FIX`: prevent infinite loop on root property change ([#1593](https://github.com/bpmn-io/bpmn-js/pull/1593))
15
+ ## 9.0.2
21
16
 
22
- ## 9.0.0-alpha.1
17
+ * `FIX`: support modeling of groups in collapsed subporcesses ([#1606](https://github.com/bpmn-io/bpmn-js/issues/1606))
18
+ * `FIX`: override default padding of breadcrumb element ([#1608](https://github.com/bpmn-io/bpmn-js/pull/1608))
23
19
 
24
- * `FEAT`: support modeling of collapsed subprocesses ([#1443](https://github.com/bpmn-io/bpmn-js/issues/1443))
25
- * `FIX`: create di for embedded labels ([#1579](https://github.com/bpmn-io/bpmn-js/pull/1579))
26
- * `CHORE`: bump to `diagram-js@8.1.1`
20
+ ## 9.0.1
27
21
 
28
- ### Breaking Changes
22
+ * `FIX`: use ES5 everywhere ([#1605](https://github.com/bpmn-io/bpmn-js/pull/1605))
23
+ * `FIX`: support DIs without associated business object ([#1605](https://github.com/bpmn-io/bpmn-js/pull/1605))
24
+ * `DEPS`: bump to `diagram-js@8.1.2` ([bdf9cf3](https://github.com/bpmn-io/bpmn-js/commit/bdf9cf3e752254a4c8172031d8a493955a9fca9c))
29
25
 
30
- * Reworked `viewer.open` behavior for single planes. ([#1576](https://github.com/bpmn-io/bpmn-js/pull/1576))
31
26
 
32
- ## 9.0.0-alpha.0
27
+ ## 9.0.0
33
28
 
34
- * `FEAT`: support drilldown into collapsed subprocesses ([#1443](https://github.com/bpmn-io/bpmn-js/issues/1443))
35
- * `CHORE`: bump to `diagram-js@8.0.1`
29
+ * `FEAT`: support drilldown and modeling of collapsed subprocesses ([#1443](https://github.com/bpmn-io/bpmn-js/issues/1443))
30
+ * `FEAT`: update embedded label bounds when shape is moved ([#1586](https://github.com/bpmn-io/bpmn-js/pull/1586))
31
+ * `FIX`: create di for embedded labels ([#1579](https://github.com/bpmn-io/bpmn-js/pull/1579))
32
+ * `CHORE`: expose `BpmnRenderer` extension points ([#1585](https://github.com/bpmn-io/bpmn-js/pull/1585))
33
+ * `CHORE`: bump to `diagram-js@8.1.1`
36
34
 
37
35
  ### Breaking Changes
38
36
 
39
37
  * Reworked the link of elements to bpmn DIs. You must access the `di` directly from the diagram element instead of the `businessObject`. [#1472](https://github.com/bpmn-io/bpmn-js/issues/1472)
38
+ * Reworked `viewer.open` behavior for single planes. ([#1576](https://github.com/bpmn-io/bpmn-js/pull/1576))
40
39
  * Reworked import and `BpmnFactory` APIs. [#1472](https://github.com/bpmn-io/bpmn-js/issues/1472)
41
40
  * Added `bpmn-js.css`, which is required to display drilldown overlays correctly.
42
41
 
@@ -40,7 +40,10 @@
40
40
  display: none;
41
41
  flex-wrap: wrap;
42
42
  align-items: center;
43
- top: 10px;
43
+ top: 30px;
44
+ left: 30px;
45
+ padding: 0px;
46
+ margin: 0px;
44
47
  font-family: var(--breadcrumbs-font-family);
45
48
  font-size: 16px;
46
49
  line-height: normal;
@@ -51,11 +54,11 @@
51
54
  }
52
55
 
53
56
  .djs-palette-shown .bjs-breadcrumbs {
54
- left: 50px;
57
+ left: 90px;
55
58
  }
56
59
 
57
60
  .djs-palette-shown.djs-palette-two-column .bjs-breadcrumbs {
58
- left: 100px;
61
+ left: 140px;
59
62
  }
60
63
 
61
64
  .bjs-breadcrumbs li {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * bpmn-js - bpmn-modeler v9.0.0
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-18
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);
4623
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;
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' ],
@@ -22656,6 +22732,11 @@
22656
22732
 
22657
22733
  plane.get('planeElement').forEach(function(diElement) {
22658
22734
  var bo = diElement.bpmnElement;
22735
+
22736
+ if (!bo) {
22737
+ return;
22738
+ }
22739
+
22659
22740
  var parent = bo.$parent;
22660
22741
 
22661
22742
  if (is$1(bo, 'bpmn:SubProcess') && !diElement.isExpanded) {
@@ -22685,7 +22766,7 @@
22685
22766
  var parent = element.parent;
22686
22767
 
22687
22768
  // parent is expanded, get nearest collapsed parent
22688
- while (parent && !collapsedElements.includes(parent)) {
22769
+ while (parent && collapsedElements.indexOf(parent) === -1) {
22689
22770
  parent = parent.$parent;
22690
22771
  }
22691
22772
 
@@ -23176,7 +23257,7 @@
23176
23257
  }
23177
23258
 
23178
23259
  var allowedModifiers = this._getAllowedModifiers(event.target);
23179
- return !allowedModifiers.includes(event.key);
23260
+ return allowedModifiers.indexOf(event.key) === -1;
23180
23261
  };
23181
23262
 
23182
23263
  Keyboard.prototype._getAllowedModifiers = function(element) {
@@ -23268,7 +23349,7 @@
23268
23349
  var KEYCODE_Y = 89;
23269
23350
  var KEYCODE_Z = 90;
23270
23351
 
23271
- var KEYS_COPY = ['c', 'C', KEYCODE_C ];
23352
+ var KEYS_COPY = [ 'c', 'C', KEYCODE_C ];
23272
23353
  var KEYS_PASTE = [ 'v', 'V', KEYCODE_V ];
23273
23354
  var KEYS_REDO = [ 'y', 'Y', KEYCODE_Y ];
23274
23355
  var KEYS_UNDO = [ 'z', 'Z', KEYCODE_Z ];
@@ -23424,7 +23505,7 @@
23424
23505
 
23425
23506
  var event = context.keyEvent;
23426
23507
 
23427
- if (isKey(['Backspace', 'Delete', 'Del' ], event)) {
23508
+ if (isKey([ 'Backspace', 'Delete', 'Del' ], event)) {
23428
23509
  editorActions.trigger('removeSelection');
23429
23510
 
23430
23511
  return true;
@@ -29174,11 +29255,11 @@
29174
29255
  y = center.y;
29175
29256
 
29176
29257
  return [
29177
- ['M', x, y],
29178
- ['m', 0, -r],
29179
- ['a', r, r, 0, 1, 1, 0, 2 * r],
29180
- ['a', r, r, 0, 1, 1, 0, -2 * r],
29181
- ['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' ]
29182
29263
  ];
29183
29264
  }
29184
29265
 
@@ -30754,7 +30835,7 @@
30754
30835
  return parent.children || [];
30755
30836
  }
30756
30837
 
30757
- var abs$5= Math.abs,
30838
+ var abs$5 = Math.abs,
30758
30839
  round$6 = Math.round;
30759
30840
 
30760
30841
  var TOLERANCE = 10;
@@ -40114,7 +40195,8 @@
40114
40195
  'canvas.viewbox.changing',
40115
40196
  'drag.init',
40116
40197
  'element.mousedown',
40117
- 'popupMenu.open'
40198
+ 'popupMenu.open',
40199
+ 'root.set'
40118
40200
  ], function(event) {
40119
40201
 
40120
40202
  if (directEditing.isActive()) {
@@ -42332,7 +42414,7 @@
42332
42414
  */
42333
42415
  function GroupBehavior(
42334
42416
  bpmnFactory,
42335
- canvas,
42417
+ bpmnjs,
42336
42418
  elementRegistry,
42337
42419
  eventBus,
42338
42420
  injector,
@@ -42340,18 +42422,6 @@
42340
42422
  ) {
42341
42423
  injector.invoke(CommandInterceptor, this);
42342
42424
 
42343
- /**
42344
- * Gets process definitions
42345
- *
42346
- * @return {ModdleElement} definitions
42347
- */
42348
- function getDefinitions() {
42349
- var rootElement = canvas.getRootElement(),
42350
- businessObject = getBusinessObject(rootElement);
42351
-
42352
- return businessObject.$parent;
42353
- }
42354
-
42355
42425
  /**
42356
42426
  * Removes a referenced category value for a given group shape
42357
42427
  *
@@ -42387,7 +42457,7 @@
42387
42457
  */
42388
42458
  function removeCategory(category) {
42389
42459
 
42390
- var definitions = getDefinitions();
42460
+ var definitions = bpmnjs.getDefinitions();
42391
42461
 
42392
42462
  remove(definitions.get('rootElements'), category);
42393
42463
  }
@@ -42452,7 +42522,7 @@
42452
42522
 
42453
42523
  var businessObject = getBusinessObject(shape),
42454
42524
  categoryValueRef = businessObject.categoryValueRef,
42455
- definitions = getDefinitions(),
42525
+ definitions = bpmnjs.getDefinitions(),
42456
42526
  category = categoryValueRef ? categoryValueRef.$parent : null;
42457
42527
 
42458
42528
  add(category.get('categoryValue'), categoryValueRef);
@@ -42470,7 +42540,7 @@
42470
42540
 
42471
42541
  if (is$1(businessObject, 'bpmn:Group') && !businessObject.categoryValueRef) {
42472
42542
 
42473
- var definitions = getDefinitions(),
42543
+ var definitions = bpmnjs.getDefinitions(),
42474
42544
  categoryValue = createCategoryValue(definitions, bpmnFactory);
42475
42545
 
42476
42546
  // link the reference to the Group
@@ -42498,7 +42568,7 @@
42498
42568
  categoryValue;
42499
42569
 
42500
42570
  if (is$1(property, 'bpmn:CategoryValue')) {
42501
- categoryValue = createCategoryValue(getDefinitions(), bpmnFactory);
42571
+ categoryValue = createCategoryValue(bpmnjs.getDefinitions(), bpmnFactory);
42502
42572
 
42503
42573
  // return copy of category
42504
42574
  return moddleCopy.copyElement(property, categoryValue);
@@ -42509,7 +42579,7 @@
42509
42579
 
42510
42580
  GroupBehavior.$inject = [
42511
42581
  'bpmnFactory',
42512
- 'canvas',
42582
+ 'bpmnjs',
42513
42583
  'elementRegistry',
42514
42584
  'eventBus',
42515
42585
  'injector',
@@ -45458,7 +45528,7 @@
45458
45528
 
45459
45529
 
45460
45530
  function handleConnection(c, incoming) {
45461
- if (allChildren.includes(c.source) && allChildren.includes(c.target)) {
45531
+ if (allChildren.indexOf(c.source) !== -1 && allChildren.indexOf(c.target) !== -1) {
45462
45532
  return;
45463
45533
  }
45464
45534
 
@@ -48253,7 +48323,7 @@
48253
48323
  }
48254
48324
 
48255
48325
  var LabelSupportModule = {
48256
- __init__: [ 'labelSupport'],
48326
+ __init__: [ 'labelSupport' ],
48257
48327
  labelSupport: [ 'type', LabelSupport ]
48258
48328
  };
48259
48329
 
@@ -48441,7 +48511,7 @@
48441
48511
  saveClear(oldShape.attachers, function(attacher) {
48442
48512
  var allowed = rules.allowed('elements.move', {
48443
48513
  target: newShape,
48444
- shapes: [attacher]
48514
+ shapes: [ attacher ]
48445
48515
  });
48446
48516
 
48447
48517
  if (allowed === 'attach') {
@@ -49575,7 +49645,7 @@
49575
49645
  }
49576
49646
 
49577
49647
  var SpaceToolModule = {
49578
- __init__: ['spaceToolPreview'],
49648
+ __init__: [ 'spaceToolPreview' ],
49579
49649
  __depends__: [
49580
49650
  DraggingModule,
49581
49651
  RulesModule$1,
@@ -49583,8 +49653,8 @@
49583
49653
  PreviewSupportModule,
49584
49654
  MouseModule
49585
49655
  ],
49586
- spaceTool: ['type', SpaceTool ],
49587
- spaceToolPreview: ['type', SpaceToolPreview ]
49656
+ spaceTool: [ 'type', SpaceTool ],
49657
+ spaceToolPreview: [ 'type', SpaceToolPreview ]
49588
49658
  };
49589
49659
 
49590
49660
  function BpmnFactory(moddle) {
@@ -51704,7 +51774,7 @@
51704
51774
  newParentIndex = context.newParentIndex,
51705
51775
  oldParent = shape.parent;
51706
51776
 
51707
- context.oldBounds = pick(shape, [ 'x', 'y', 'width', 'height']);
51777
+ context.oldBounds = pick(shape, [ 'x', 'y', 'width', 'height' ]);
51708
51778
 
51709
51779
  // save old parent in context
51710
51780
  context.oldParent = oldParent;
@@ -52350,7 +52420,7 @@
52350
52420
  // recursively hide/show children
52351
52421
  var result = setHiddenRecursive(children, shape.collapsed);
52352
52422
 
52353
- return [shape].concat(result);
52423
+ return [ shape ].concat(result);
52354
52424
  };
52355
52425
 
52356
52426
 
@@ -52367,7 +52437,7 @@
52367
52437
  // retoggle state
52368
52438
  shape.collapsed = !shape.collapsed;
52369
52439
 
52370
- return [shape].concat(result);
52440
+ return [ shape ].concat(result);
52371
52441
  };
52372
52442
 
52373
52443
 
@@ -58968,8 +59038,8 @@
58968
59038
  var h = box.height + offset * 2;
58969
59039
 
58970
59040
  var styles = [
58971
- 'width: '+ w +'px',
58972
- 'height: '+ h + 'px'
59041
+ 'width: ' + w + 'px',
59042
+ 'height: ' + h + 'px'
58973
59043
  ].join('; ');
58974
59044
 
58975
59045
  return {