bpmn-js 9.0.2 → 9.1.0

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/lib/BaseViewer.js CHANGED
@@ -13,6 +13,7 @@ import {
13
13
 
14
14
  import {
15
15
  domify,
16
+ assignStyle,
16
17
  query as domQuery,
17
18
  remove as domRemove
18
19
  } from 'min-dom';
@@ -655,7 +656,7 @@ BaseViewer.prototype._createContainer = function(options) {
655
656
 
656
657
  var container = domify('<div class="bjs-container"></div>');
657
658
 
658
- assign(container.style, {
659
+ assignStyle(container, {
659
660
  width: ensureUnit(options.width),
660
661
  height: ensureUnit(options.height),
661
662
  position: options.position
@@ -735,7 +736,8 @@ function findBPMNDiagram(definitions, diagramId) {
735
736
  import {
736
737
  open as openPoweredBy,
737
738
  BPMNIO_IMG,
738
- LINK_STYLES as BPMNIO_LINK_STYLES
739
+ LOGO_STYLES,
740
+ LINK_STYLES
739
741
  } from './util/PoweredByUtil';
740
742
 
741
743
  import {
@@ -758,12 +760,20 @@ function addProjectLogo(container) {
758
760
  'target="_blank" ' +
759
761
  'class="bjs-powered-by" ' +
760
762
  'title="Powered by bpmn.io" ' +
761
- 'style="position: absolute; bottom: 15px; right: 15px; z-index: 100; ' + BPMNIO_LINK_STYLES + '">' +
763
+ '>' +
762
764
  img +
763
765
  '</a>';
764
766
 
765
767
  var linkElement = domify(linkMarkup);
766
768
 
769
+ assignStyle(domQuery('svg', linkElement), LOGO_STYLES);
770
+ assignStyle(linkElement, LINK_STYLES, {
771
+ position: 'absolute',
772
+ bottom: '15px',
773
+ right: '15px',
774
+ zIndex: '100'
775
+ });
776
+
767
777
  container.appendChild(linkElement);
768
778
 
769
779
  domEvent.bind(linkElement, 'click', function(event) {
@@ -80,7 +80,7 @@ export default function DrilldownOverlayBehavior(
80
80
  }, true);
81
81
 
82
82
 
83
- eventBus.on('import.done', function() {
83
+ eventBus.on('import.render.complete', function() {
84
84
  elementRegistry.filter(function(e) {
85
85
  return self.canDrillDown(e);
86
86
  }).map(function(el) {
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { asBounds, asTRBL } from 'diagram-js/lib/layout/LayoutUtil';
3
- import { is } from '../../util/ModelUtil';
3
+ import { is, isAny } from '../../util/ModelUtil';
4
4
 
5
5
  var DEFAULT_POSITION = {
6
6
  x: 180,
@@ -79,7 +79,7 @@ SubprocessCompatibility.prototype.createNewDiagrams = function(plane) {
79
79
  collapsedElements.push(bo);
80
80
  }
81
81
 
82
- if (is(parent, 'bpmn:SubProcess') && parent !== plane.bpmnElement) {
82
+ if (shouldMoveToPlane(bo, plane)) {
83
83
 
84
84
  // don't change the array while we iterate over it
85
85
  elementsToMove.push({ diElement: diElement, parent: parent });
@@ -168,7 +168,7 @@ SubprocessCompatibility.prototype.createDiagram = function(bo) {
168
168
  SubprocessCompatibility.$inject = [ 'eventBus', 'moddle' ];
169
169
 
170
170
 
171
- // helpers
171
+ // helpers //////////////////////////
172
172
 
173
173
  function findRootDiagram(element) {
174
174
  if (is(element, 'bpmndi:BPMNDiagram')) {
@@ -199,3 +199,20 @@ function getPlaneBounds(plane) {
199
199
 
200
200
  return asBounds(planeTrbl);
201
201
  }
202
+
203
+ function shouldMoveToPlane(bo, plane) {
204
+ var parent = bo.$parent;
205
+
206
+ // don't move elements that are already on the plane
207
+ if (!is(parent, 'bpmn:SubProcess') || parent === plane.bpmnElement) {
208
+ return false;
209
+ }
210
+
211
+ // dataAssociations are children of the subprocess but rendered on process level
212
+ // cf. https://github.com/bpmn-io/bpmn-js/issues/1619
213
+ if (isAny(bo, ['bpmn:DataInputAssociation', 'bpmn:DataOutputAssociation'])) {
214
+ return false;
215
+ }
216
+
217
+ return true;
218
+ }
@@ -68,6 +68,12 @@ BpmnInteractionEvents.prototype.createParticipantHit = function(element, gfx) {
68
68
  // remove existing hits
69
69
  this._interactionEvents.removeHits(gfx);
70
70
 
71
+ // add body hit
72
+ this._interactionEvents.createBoxHit(gfx, 'no-move', {
73
+ width: element.width,
74
+ height: element.height
75
+ });
76
+
71
77
  // add outline hit
72
78
  this._interactionEvents.createBoxHit(gfx, 'click-stroke', {
73
79
  width: element.width,
@@ -89,6 +95,12 @@ BpmnInteractionEvents.prototype.createSubProcessHit = function(element, gfx) {
89
95
  // remove existing hits
90
96
  this._interactionEvents.removeHits(gfx);
91
97
 
98
+ // add body hit
99
+ this._interactionEvents.createBoxHit(gfx, 'no-move', {
100
+ width: element.width,
101
+ height: element.height
102
+ });
103
+
92
104
  // add outline hit
93
105
  this._interactionEvents.createBoxHit(gfx, 'click-stroke', {
94
106
  width: element.width,
@@ -48,7 +48,9 @@ export default function LabelEditingProvider(
48
48
  'canvas.viewbox.changing',
49
49
  'drag.init',
50
50
  'element.mousedown',
51
- 'popupMenu.open'
51
+ 'popupMenu.open',
52
+ 'root.set',
53
+ 'selection.changed'
52
54
  ], function(event) {
53
55
 
54
56
  if (directEditing.isActive()) {
@@ -44,7 +44,7 @@ export default function UpdateLabelHandler(modeling, textRenderer, bpmnFactory)
44
44
  }
45
45
 
46
46
  if (!text && di.label) {
47
- di.label = null;
47
+ delete di.label;
48
48
  }
49
49
  }
50
50
 
@@ -20,7 +20,7 @@ export default function SubProcessStartEventBehavior(injector, modeling) {
20
20
 
21
21
  if (
22
22
  !is(newShape, 'bpmn:SubProcess') ||
23
- !is(oldShape, 'bpmn:Task') ||
23
+ ! (is(oldShape, 'bpmn:Task') || is(oldShape, 'bpmn:CallActivity')) ||
24
24
  !isExpanded(newShape)
25
25
  ) {
26
26
  return;
@@ -131,7 +131,7 @@ export default function BpmnOrderingProvider(eventBus, canvas, translate) {
131
131
  // render labels always on top
132
132
  if (element.labelTarget) {
133
133
  return {
134
- parent: canvas.findRoot(element.labelTarget) || canvas.getRootElement(),
134
+ parent: canvas.findRoot(newParent) || canvas.getRootElement(),
135
135
  index: -1
136
136
  };
137
137
  }
@@ -14,7 +14,8 @@ import {
14
14
 
15
15
  import {
16
16
  forEach,
17
- filter
17
+ filter,
18
+ isUndefined
18
19
  } from 'min-dash';
19
20
 
20
21
  import * as replaceOptions from '../replace/ReplaceOptions';
@@ -426,16 +427,16 @@ ReplaceMenuProvider.prototype._getLoopEntries = function(element) {
426
427
  var translate = this._translate;
427
428
 
428
429
  function toggleLoopEntry(event, entry) {
429
- var loopCharacteristics;
430
+ var loopCharacteristics = getBusinessObject(element).loopCharacteristics;
430
431
 
431
432
  if (entry.active) {
432
433
  loopCharacteristics = undefined;
433
434
  } else {
434
- loopCharacteristics = self._moddle.create(entry.options.loopCharacteristics);
435
-
436
- if (entry.options.isSequential) {
437
- loopCharacteristics.isSequential = entry.options.isSequential;
435
+ if (isUndefined(entry.options.isSequential) || !loopCharacteristics) {
436
+ loopCharacteristics = self._moddle.create(entry.options.loopCharacteristics);
438
437
  }
438
+
439
+ loopCharacteristics.isSequential = entry.options.isSequential;
439
440
  }
440
441
  self._modeling.updateProperties(element, { loopCharacteristics: loopCharacteristics });
441
442
  }
@@ -124,7 +124,7 @@ export function importBpmnDiagram(diagram, definitions, bpmnDiagram) {
124
124
  }
125
125
 
126
126
  /**
127
- * Returns all diagrams in the same hirarchy as the requested diagram.
127
+ * Returns all diagrams in the same hierarchy as the requested diagram.
128
128
  * Includes all parent and sub process diagrams.
129
129
  *
130
130
  * @param {Array} definitions
@@ -5,59 +5,61 @@
5
5
  */
6
6
 
7
7
  import {
8
+ assignStyle,
8
9
  domify,
9
- delegate as domDelegate
10
+ delegate as domDelegate,
11
+ query as domQuery
10
12
  } from 'min-dom';
11
13
 
12
14
 
13
15
  // inlined ../../resources/logo.svg
14
- var BPMNIO_LOGO_SVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21" style="vertical-align:middle"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>';
16
+ var BPMNIO_LOGO_SVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>';
15
17
 
16
18
  export var BPMNIO_IMG = BPMNIO_LOGO_SVG;
17
19
 
18
- function css(attrs) {
19
- return attrs.join(';');
20
- }
21
-
22
- export var LINK_STYLES = css([
23
- 'color: #404040'
24
- ]);
25
-
26
- var LIGHTBOX_STYLES = css([
27
- 'z-index: 1001',
28
- 'position: fixed',
29
- 'top: 0',
30
- 'left: 0',
31
- 'right: 0',
32
- 'bottom: 0'
33
- ]);
34
-
35
- var BACKDROP_STYLES = css([
36
- 'width: 100%',
37
- 'height: 100%',
38
- 'background: rgba(40,40,40,0.2)'
39
- ]);
40
-
41
- var NOTICE_STYLES = css([
42
- 'position: absolute',
43
- 'left: 50%',
44
- 'top: 40%',
45
- 'transform: translate(-50%)',
46
- 'width: 260px',
47
- 'padding: 10px',
48
- 'background: white',
49
- 'box-shadow: 0 1px 4px rgba(0,0,0,0.3)',
50
- 'font-family: Helvetica, Arial, sans-serif',
51
- 'font-size: 14px',
52
- 'display: flex',
53
- 'line-height: 1.3'
54
- ]);
20
+ export var LOGO_STYLES = {
21
+ verticalAlign: 'middle'
22
+ };
23
+
24
+ export var LINK_STYLES = {
25
+ 'color': '#404040'
26
+ };
27
+
28
+ var LIGHTBOX_STYLES = {
29
+ 'zIndex': '1001',
30
+ 'position': 'fixed',
31
+ 'top': '0',
32
+ 'left': '0',
33
+ 'right': '0',
34
+ 'bottom': '0'
35
+ };
36
+
37
+ var BACKDROP_STYLES = {
38
+ 'width': '100%',
39
+ 'height': '100%',
40
+ 'background': 'rgba(40,40,40,0.2)'
41
+ };
42
+
43
+ var NOTICE_STYLES = {
44
+ 'position': 'absolute',
45
+ 'left': '50%',
46
+ 'top': '40%',
47
+ 'transform': 'translate(-50%)',
48
+ 'width': '260px',
49
+ 'padding': '10px',
50
+ 'background': 'white',
51
+ 'boxShadow': '0 1px 4px rgba(0,0,0,0.3)',
52
+ 'fontFamily': 'Helvetica, Arial, sans-serif',
53
+ 'fontSize': '14px',
54
+ 'display': 'flex',
55
+ 'lineHeight': '1.3'
56
+ };
55
57
 
56
58
  var LIGHTBOX_MARKUP =
57
- '<div class="bjs-powered-by-lightbox" style="' + LIGHTBOX_STYLES + '">' +
58
- '<div class="backdrop" style="' + BACKDROP_STYLES + '"></div>' +
59
- '<div class="notice" style="' + NOTICE_STYLES + '">' +
60
- '<a href="https://bpmn.io" target="_blank" rel="noopener" style="margin: 15px 20px 15px 10px; align-self: center;' + LINK_STYLES + '">' +
59
+ '<div class="bjs-powered-by-lightbox">' +
60
+ '<div class="backdrop"></div>' +
61
+ '<div class="notice">' +
62
+ '<a href="https://bpmn.io" target="_blank" rel="noopener" class="link">' +
61
63
  BPMNIO_IMG +
62
64
  '</a>' +
63
65
  '<span>' +
@@ -70,10 +72,23 @@ var LIGHTBOX_MARKUP =
70
72
 
71
73
  var lightbox;
72
74
 
75
+ function createLightbox() {
76
+ lightbox = domify(LIGHTBOX_MARKUP);
77
+
78
+ assignStyle(lightbox, LIGHTBOX_STYLES);
79
+ assignStyle(domQuery('svg', lightbox), LOGO_STYLES);
80
+ assignStyle(domQuery('.backdrop', lightbox), BACKDROP_STYLES);
81
+ assignStyle(domQuery('.notice', lightbox), NOTICE_STYLES);
82
+ assignStyle(domQuery('.link', lightbox), LINK_STYLES, {
83
+ 'margin': '15px 20px 15px 10px',
84
+ 'alignSelf': 'center'
85
+ });
86
+ }
87
+
73
88
  export function open() {
74
89
 
75
90
  if (!lightbox) {
76
- lightbox = domify(LIGHTBOX_MARKUP);
91
+ createLightbox();
77
92
 
78
93
  domDelegate.bind(lightbox, '.backdrop', 'click', function(event) {
79
94
  document.body.removeChild(lightbox);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bpmn-js",
3
- "version": "9.0.2",
3
+ "version": "9.1.0",
4
4
  "description": "A bpmn 2.0 toolkit and web modeler",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -100,12 +100,12 @@
100
100
  "dependencies": {
101
101
  "bpmn-moddle": "^7.1.2",
102
102
  "css.escape": "^1.5.1",
103
- "diagram-js": "^8.1.2",
103
+ "diagram-js": "^8.3.0",
104
104
  "diagram-js-direct-editing": "^1.6.3",
105
105
  "ids": "^1.0.0",
106
106
  "inherits": "^2.0.4",
107
107
  "min-dash": "^3.5.2",
108
- "min-dom": "^3.1.3",
108
+ "min-dom": "^3.2.0",
109
109
  "object-refs": "^0.3.0",
110
110
  "tiny-svg": "^2.2.2"
111
111
  }