bpmn-js 8.8.3 → 8.9.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/CHANGELOG.md CHANGED
@@ -6,6 +6,16 @@ All notable changes to [bpmn-js](https://github.com/bpmn-io/bpmn-js) are documen
6
6
 
7
7
  ___Note:__ Yet to be released changes appear here._
8
8
 
9
+ ## 8.9.0
10
+
11
+ * `FEAT`: select newly created sub-process ([`6214772b`](https://github.com/bpmn-io/bpmn-js/commit/6214772b8519cb82f61c4867b16c112bc6344922))
12
+ * `FEAT`: select newly created group for immediate resizing ([`56eb34cc`](https://github.com/bpmn-io/bpmn-js/commit/56eb34cc826ca0dc8ee788575a504d5fda301292))
13
+ * `FEAT`: simplify color scheme
14
+ * `FIX`: set label color on `bpmndi:BPMNLabel#color` ([#1543](https://github.com/bpmn-io/bpmn-js/pull/1543))
15
+ * `FIX`: don't create illegal `bpmndi:BPMNEdge#waypoints` property ([#1544](https://github.com/bpmn-io/bpmn-js/issues/1544))
16
+ * `FIX`: correct direct editing on touch devices
17
+ * `DEPS`: update to diagram-js@7.8.2
18
+
9
19
  ## 8.8.3
10
20
 
11
21
  * `FIX`: correct resize handles hidden behind element ([#1520](https://github.com/bpmn-io/bpmn-js/issues/1520))
@@ -2,84 +2,86 @@
2
2
  * color definitions
3
3
  */
4
4
  .djs-container {
5
- --blue-base-65: #4d90ff;
6
- --blue-base-65-opacity-30: rgba(77, 144, 255, 0.3);
7
- --blue-darken-48: #005df7;
8
- --blue-darken-55: #1a70ff;
9
- --blue-lighten-82: #a2c5ff;
10
-
11
- --red-base-62: #ff3d3d;
12
- --red-base-62-lighten-90: rgb(255, 235, 235);
13
-
14
- --silver-darken-94: #efefef;
15
-
16
- --color-000000: #000000;
17
- --color-000000-opacity-05: rgba(0, 0, 0, 0.05);
18
- --color-000000-opacity-10: rgba(0, 0, 0, 0.1);
19
- --color-333333: #333333;
20
- --color-666666: #666666;
21
- --color-aaaaaa: #aaaaaa;
22
- --color-cccccc: #cccccc;
23
- --color-cdcdcd: #cdcdcd;
24
- --color-dddddd: #dddddd;
25
- --color-f6f6f6: #f6f6f6;
26
- --color-fafafa: #fafafa;
27
- --color-fefefe: #fefefe;
28
- --color-ffffff: #ffffff;
29
-
30
- --bendpoint-fill-color: var(--blue-base-65-opacity-30);
31
- --bendpoint-stroke-color: var(--blue-base-65);
32
-
33
- --context-pad-entry-background-color: var(--color-fefefe);
34
- --context-pad-entry-hover-background-color: var(--silver-darken-94);
35
-
36
- --element-dragger-color: var(--blue-base-65);
37
- --element-hover-outline-fill-color: var(--blue-darken-48);
38
- --element-selected-outline-stroke-color: var(--blue-base-65);
39
-
40
- --lasso-fill-color: var(--color-000000-opacity-05);
41
- --lasso-stroke-color: var(--color-000000);
42
-
43
- --palette-entry-color: var(--color-333333);
44
- --palette-entry-hover-color: var(--blue-darken-48);
45
- --palette-entry-selected-color: var(--blue-base-65);
46
- --palette-separator-color: var(--color-aaaaaa);
47
- --palette-toggle-hover-background-color: var(--color-666666);
48
- --palette-background-color: var(--color-fafafa);
49
- --palette-border-color: var(--color-cccccc);
50
-
51
- --popup-body-background-color: var(--color-fefefe);
52
- --popup-header-entry-selected-color: var(--blue-base-65);
53
- --popup-header-entry-selected-background-color: var(--color-000000-opacity-10);
54
- --popup-header-separator-color: var(--color-dddddd);
55
- --popup-background-color: var(--color-fafafa);
56
- --popup-border-color: var(--color-cccccc);
57
-
58
- --resizer-fill-color: var(--blue-base-65-opacity-30);
59
- --resizer-stroke-color: var(--blue-base-65);
60
-
61
- --search-container-background-color: var(--color-fafafa);
62
- --search-container-border-color: var(--blue-darken-55);
63
- --search-container-box-shadow-color: var(--blue-lighten-82);
64
- --search-container-box-shadow-inset-color: var(--color-cdcdcd);
65
- --search-input-border-color: var(--color-cccccc);
66
- --search-result-border-color: var(--color-aaaaaa);
67
- --search-result-highlight-color: var(--color-000000);
68
- --search-result-selected-color: var(--blue-base-65-opacity-30);
69
-
70
- --shape-attach-allowed-stroke-color: var(--blue-base-65);
71
- --shape-connect-allowed-fill-color: var(--color-f6f6f6);
72
- --shape-drop-allowed-fill-color: var(--color-f6f6f6);
73
- --shape-drop-not-allowed-fill-color: var(--red-base-62-lighten-90);
74
- --shape-resize-preview-stroke-color: var(--blue-base-65);
75
-
76
- --snap-line-stroke-color: var(--blue-base-65-opacity-30);
77
-
78
- --space-tool-crosshair-stroke-color: var(--color-000000);
79
-
80
- --tooltip-error-background-color: var(--red-base-62-lighten-90);
81
- --tooltip-error-border-color: var(--red-base-62);
82
- --tooltip-error-color: var(--red-base-62);
5
+ --color-grey-225-10-15: hsl(225, 10%, 15%);
6
+ --color-grey-225-10-35: hsl(225, 10%, 35%);
7
+ --color-grey-225-10-55: hsl(225, 10%, 55%);
8
+ --color-grey-225-10-75: hsl(225, 10%, 75%);
9
+ --color-grey-225-10-80: hsl(225, 10%, 80%);
10
+ --color-grey-225-10-85: hsl(225, 10%, 85%);
11
+ --color-grey-225-10-90: hsl(225, 10%, 90%);
12
+ --color-grey-225-10-95: hsl(225, 10%, 95%);
13
+ --color-grey-225-10-97: hsl(225, 10%, 97%);
14
+
15
+ --color-blue-205-100-45: hsl(205, 100%, 45%);
16
+ --color-blue-205-100-45-opacity-30: hsla(205, 100%, 45%, 30%);
17
+ --color-blue-205-100-50: hsl(205, 100%, 50%);
18
+ --color-blue-205-100-95: hsl(205, 100%, 95%);
19
+
20
+ --color-green-150-86-44: hsl(150, 86%, 44%);
21
+
22
+ --color-red-360-100-40: hsl(360, 100%, 40%);
23
+ --color-red-360-100-45: hsl(360, 100%, 45%);
24
+ --color-red-360-100-92: hsl(360, 100%, 92%);
25
+ --color-red-360-100-97: hsl(360, 100%, 97%);
26
+
27
+ --color-white: hsl(0, 0%, 100%);
28
+ --color-black: hsl(0, 0%, 0%);
29
+ --color-black-opacity-05: hsla(0, 0%, 0%, 5%);
30
+ --color-black-opacity-10: hsla(0, 0%, 0%, 10%);
31
+
32
+ --bendpoint-fill-color: var(--color-blue-205-100-45-opacity-30);
33
+ --bendpoint-stroke-color: var(--color-blue-205-100-50);
34
+
35
+ --context-pad-entry-background-color: var(--color-white);
36
+ --context-pad-entry-hover-background-color: var(--color-grey-225-10-95);
37
+
38
+ --element-dragger-color: var(--color-blue-205-100-50);
39
+ --element-hover-outline-fill-color: var(--color-blue-205-100-45);
40
+ --element-selected-outline-stroke-color: var(--color-blue-205-100-50);
41
+
42
+ --lasso-fill-color: var(--color-black-opacity-05);
43
+ --lasso-stroke-color: var(--color-black);
44
+
45
+ --palette-entry-color: var(--color-grey-225-10-15);
46
+ --palette-entry-hover-color: var(--color-blue-205-100-45);
47
+ --palette-entry-selected-color: var(--color-blue-205-100-50);
48
+ --palette-separator-color: var(--color-grey-225-10-75);
49
+ --palette-toggle-hover-background-color: var(--color-grey-225-10-55);
50
+ --palette-background-color: var(--color-grey-225-10-97);
51
+ --palette-border-color: var(--color-grey-225-10-75);
52
+
53
+ --popup-body-background-color: var(--color-white);
54
+ --popup-header-entry-selected-color: var(--color-blue-205-100-50);
55
+ --popup-header-entry-selected-background-color: var(--color-black-opacity-10);
56
+ --popup-header-separator-color: var(--color-grey-225-10-75);
57
+ --popup-background-color: var(--color-grey-225-10-97);
58
+ --popup-border-color: var(--color-grey-225-10-75);
59
+
60
+ --resizer-fill-color: var(--color-blue-205-100-45-opacity-30);
61
+ --resizer-stroke-color: var(--color-blue-205-100-50);
62
+
63
+ --search-container-background-color: var(--color-grey-225-10-97);
64
+ --search-container-border-color: var(--color-blue-205-100-50);
65
+ --search-container-box-shadow-color: var(--color-blue-205-100-95);
66
+ --search-container-box-shadow-inset-color: var(--color-grey-225-10-80);
67
+ --search-input-border-color: var(--color-grey-225-10-75);
68
+ --search-result-border-color: var(--color-grey-225-10-75);
69
+ --search-result-highlight-color: var(--color-black);
70
+ --search-result-selected-color: var(--color-blue-205-100-45-opacity-30);
71
+
72
+ --shape-attach-allowed-stroke-color: var(--color-blue-205-100-50);
73
+ --shape-connect-allowed-fill-color: var(--color-grey-225-10-97);
74
+ --shape-drop-allowed-fill-color: var(--color-grey-225-10-97);
75
+ --shape-drop-not-allowed-fill-color: var(--color-red-360-100-97);
76
+ --shape-resize-preview-stroke-color: var(--color-blue-205-100-50);
77
+
78
+ --snap-line-stroke-color: var(--color-blue-205-100-45-opacity-30);
79
+
80
+ --space-tool-crosshair-stroke-color: var(--color-black);
81
+
82
+ --tooltip-error-background-color: var(--color-red-360-100-97);
83
+ --tooltip-error-border-color: var(--color-red-360-100-45);
84
+ --tooltip-error-color: var(--color-red-360-100-45);
83
85
  }
84
86
 
85
87
  /**
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * bpmn-js - bpmn-modeler v8.8.3
2
+ * bpmn-js - bpmn-modeler v8.9.0
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: 2021-12-03
11
+ * Date: 2022-01-14
12
12
  */
13
13
  (function (global, factory) {
14
14
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -5323,13 +5323,17 @@
5323
5323
  * Scrolls the viewbox to contain the given element.
5324
5324
  * Optionally specify a padding to be applied to the edges.
5325
5325
  *
5326
- * @param {Object} [element] the element to scroll to.
5326
+ * @param {Object|String} [element] the element to scroll to.
5327
5327
  * @param {Object|Number} [padding=100] the padding to be applied. Can also specify top, bottom, left and right.
5328
5328
  *
5329
5329
  */
5330
5330
  Canvas.prototype.scrollToElement = function(element, padding) {
5331
5331
  var defaultPadding = 100;
5332
5332
 
5333
+ if (typeof element === 'string') {
5334
+ element = this._elementRegistry.get(element);
5335
+ }
5336
+
5333
5337
  // switch to correct Plane
5334
5338
  var targetPlane = this.findPlane(element);
5335
5339
  if (targetPlane !== this._activePlane) {
@@ -25509,14 +25513,23 @@
25509
25513
  // the touch recognizer
25510
25514
  var recognizer;
25511
25515
 
25512
- function handler(type) {
25516
+ function handler(type, buttonType) {
25513
25517
 
25514
25518
  return function(event) {
25515
25519
 
25516
- interactionEvents.fire(type, event);
25520
+ var gfx = getGfx(event.target),
25521
+ element = gfx && elementRegistry.get(gfx);
25522
+
25523
+ // translate into an actual mouse click event
25524
+ if (buttonType) {
25525
+ event.srcEvent.button = buttonType;
25526
+ }
25527
+
25528
+ return interactionEvents.fire(type, event, element);
25517
25529
  };
25518
25530
  }
25519
25531
 
25532
+
25520
25533
  function getGfx(target) {
25521
25534
  var node = closest(target, 'svg, .djs-element', true);
25522
25535
  return node;
@@ -25527,10 +25540,6 @@
25527
25540
  // touch recognizer
25528
25541
  recognizer = createTouchRecognizer(svg);
25529
25542
 
25530
- recognizer.on('doubletap', handler('element.dblclick'));
25531
-
25532
- recognizer.on('tap', handler('element.click'));
25533
-
25534
25543
  function startGrabCanvas(event) {
25535
25544
 
25536
25545
  var lx = 0, ly = 0;
@@ -25598,6 +25607,9 @@
25598
25607
  recognizer.on('pinchcancel', end);
25599
25608
  }
25600
25609
 
25610
+ recognizer.on('tap', handler('element.click'));
25611
+ recognizer.on('doubletap', handler('element.dblclick', 1));
25612
+
25601
25613
  recognizer.on('panstart', startGrab);
25602
25614
  recognizer.on('press', startGrab);
25603
25615
 
@@ -39195,7 +39207,7 @@
39195
39207
 
39196
39208
  function activateDirectEdit(element, force) {
39197
39209
  if (force ||
39198
- isAny(element, [ 'bpmn:Task', 'bpmn:TextAnnotation', 'bpmn:Group' ]) ||
39210
+ isAny(element, [ 'bpmn:Task', 'bpmn:TextAnnotation' ]) ||
39199
39211
  isCollapsedSubProcess(element)) {
39200
39212
 
39201
39213
  directEditing.activate(element);
@@ -48091,7 +48103,8 @@
48091
48103
 
48092
48104
  BpmnFactory.prototype.createDiEdge = function(semantic, waypoints, attrs) {
48093
48105
  return this.create('bpmndi:BPMNEdge', assign({
48094
- bpmnElement: semantic
48106
+ bpmnElement: semantic,
48107
+ waypoint: this.createDiWaypoints(waypoints)
48095
48108
  }, attrs));
48096
48109
  };
48097
48110
 
@@ -52276,12 +52289,26 @@
52276
52289
  // TODO @barmac: remove once we drop bpmn.io properties
52277
52290
  ensureLegacySupport(assignedDi);
52278
52291
 
52279
- self._commandStack.execute('element.updateProperties', {
52280
- element: element,
52281
- properties: {
52282
- di: assignedDi
52283
- }
52284
- });
52292
+ if (element.labelTarget) {
52293
+
52294
+ // set label colors as bpmndi:BPMNLabel#color
52295
+ self._commandStack.execute('element.updateModdleProperties', {
52296
+ element: element,
52297
+ moddleElement: element.businessObject.di.label,
52298
+ properties: {
52299
+ color: di['background-color']
52300
+ }
52301
+ });
52302
+ } else {
52303
+
52304
+ // set colors bpmndi:BPMNEdge or bpmndi:BPMNShape
52305
+ self._commandStack.execute('element.updateProperties', {
52306
+ element: element,
52307
+ properties: {
52308
+ di: assignedDi
52309
+ }
52310
+ });
52311
+ }
52285
52312
  });
52286
52313
 
52287
52314
  };
@@ -54391,7 +54418,9 @@
54391
54418
  ENTRY_SELECTOR = '.entry',
54392
54419
  ELEMENT_SELECTOR = TOGGLE_SELECTOR + ', ' + ENTRY_SELECTOR;
54393
54420
 
54394
- var PALETTE_OPEN_CLS = 'open',
54421
+ var PALETTE_PREFIX = 'djs-palette-',
54422
+ PALETTE_SHOWN_CLS = 'shown',
54423
+ PALETTE_OPEN_CLS = 'open',
54395
54424
  PALETTE_TWO_COLUMN_CLS = 'two-column';
54396
54425
 
54397
54426
  var DEFAULT_PRIORITY = 1000;
@@ -54509,6 +54538,7 @@
54509
54538
  var container = this._container = domify(Palette.HTML_MARKUP);
54510
54539
 
54511
54540
  parentContainer.appendChild(container);
54541
+ classes$1(parentContainer).add(PALETTE_PREFIX + PALETTE_SHOWN_CLS);
54512
54542
 
54513
54543
  delegate.bind(container, ELEMENT_SELECTOR, 'click', function(event) {
54514
54544
 
@@ -54566,7 +54596,8 @@
54566
54596
 
54567
54597
  var twoColumn;
54568
54598
 
54569
- var cls = classes$1(container);
54599
+ var cls = classes$1(container),
54600
+ parentCls = classes$1(parent);
54570
54601
 
54571
54602
  if ('twoColumn' in state) {
54572
54603
  twoColumn = state.twoColumn;
@@ -54576,9 +54607,11 @@
54576
54607
 
54577
54608
  // always update two column
54578
54609
  cls.toggle(PALETTE_TWO_COLUMN_CLS, twoColumn);
54610
+ parentCls.toggle(PALETTE_PREFIX + PALETTE_TWO_COLUMN_CLS, twoColumn);
54579
54611
 
54580
54612
  if ('open' in state) {
54581
54613
  cls.toggle(PALETTE_OPEN_CLS, state.open);
54614
+ parentCls.toggle(PALETTE_PREFIX + PALETTE_OPEN_CLS, state.open);
54582
54615
  }
54583
54616
 
54584
54617
  eventBus.fire('palette.changed', {
@@ -55485,7 +55518,7 @@
55485
55518
 
55486
55519
  create.start(event, [ subProcess, startEvent ], {
55487
55520
  hints: {
55488
- autoSelect: [ startEvent ]
55521
+ autoSelect: [ subProcess ]
55489
55522
  }
55490
55523
  });
55491
55524
  }