bpmn-js 9.0.4 → 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) {
@@ -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,
@@ -49,7 +49,8 @@ export default function LabelEditingProvider(
49
49
  'drag.init',
50
50
  'element.mousedown',
51
51
  'popupMenu.open',
52
- 'root.set'
52
+ 'root.set',
53
+ 'selection.changed'
53
54
  ], function(event) {
54
55
 
55
56
  if (directEditing.isActive()) {
@@ -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.4",
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.2.0",
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
  }