bpmn-js 9.0.4 → 9.2.1
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 +30 -0
- package/dist/assets/diagram-js.css +55 -51
- package/dist/bpmn-modeler.development.js +56709 -55920
- package/dist/bpmn-modeler.production.min.js +28 -29
- package/dist/bpmn-navigated-viewer.development.js +21579 -21237
- package/dist/bpmn-navigated-viewer.production.min.js +20 -21
- package/dist/bpmn-viewer.development.js +20780 -20438
- package/dist/bpmn-viewer.production.min.js +20 -21
- package/lib/BaseModeler.js +1 -1
- package/lib/BaseViewer.js +14 -4
- package/lib/Modeler.js +1 -1
- package/lib/NavigatedViewer.js +1 -1
- package/lib/Viewer.js +1 -1
- package/lib/draw/BpmnRenderUtil.js +3 -1
- package/lib/draw/BpmnRenderer.js +11 -9
- package/lib/features/auto-place/BpmnAutoPlaceUtil.js +10 -0
- package/lib/features/auto-resize/BpmnAutoResize.js +1 -1
- package/lib/features/auto-resize/BpmnAutoResizeProvider.js +1 -1
- package/lib/features/context-pad/ContextPadProvider.js +57 -3
- package/lib/features/copy-paste/ModdleCopy.js +0 -2
- package/lib/features/drilldown/DrilldownOverlayBehavior.js +1 -1
- package/lib/features/editor-actions/BpmnEditorActions.js +1 -1
- package/lib/features/grid-snapping/behavior/LayoutConnectionBehavior.js +1 -1
- package/lib/features/interaction-events/BpmnInteractionEvents.js +12 -0
- package/lib/features/keyboard/BpmnKeyboardBindings.js +1 -1
- package/lib/features/label-editing/LabelEditingProvider.js +14 -1
- package/lib/features/modeling/BpmnLayouter.js +1 -1
- package/lib/features/modeling/BpmnUpdater.js +1 -1
- package/lib/features/modeling/ElementFactory.js +1 -1
- package/lib/features/modeling/Modeling.js +1 -1
- package/lib/features/modeling/behavior/AdaptiveLabelPositioningBehavior.js +1 -1
- package/lib/features/modeling/behavior/AppendBehavior.js +1 -1
- package/lib/features/modeling/behavior/AssociationBehavior.js +1 -1
- package/lib/features/modeling/behavior/AttachEventBehavior.js +1 -1
- package/lib/features/modeling/behavior/BoundaryEventBehavior.js +1 -1
- package/lib/features/modeling/behavior/CreateBehavior.js +1 -1
- package/lib/features/modeling/behavior/CreateDataObjectBehavior.js +1 -1
- package/lib/features/modeling/behavior/CreateParticipantBehavior.js +1 -1
- package/lib/features/modeling/behavior/DataInputAssociationBehavior.js +1 -1
- package/lib/features/modeling/behavior/DataStoreBehavior.js +1 -1
- package/lib/features/modeling/behavior/DeleteLaneBehavior.js +1 -1
- package/lib/features/modeling/behavior/DetachEventBehavior.js +1 -1
- package/lib/features/modeling/behavior/DropOnFlowBehavior.js +1 -1
- package/lib/features/modeling/behavior/EventBasedGatewayBehavior.js +1 -1
- package/lib/features/modeling/behavior/GroupBehavior.js +1 -1
- package/lib/features/modeling/behavior/IsHorizontalFix.js +1 -1
- package/lib/features/modeling/behavior/LabelBehavior.js +1 -1
- package/lib/features/modeling/behavior/LayoutConnectionBehavior.js +117 -0
- package/lib/features/modeling/behavior/MessageFlowBehavior.js +1 -1
- package/lib/features/modeling/behavior/RemoveElementBehavior.js +1 -1
- package/lib/features/modeling/behavior/RemoveEmbeddedLabelBoundsBehavior.js +1 -1
- package/lib/features/modeling/behavior/RemoveParticipantBehavior.js +1 -1
- package/lib/features/modeling/behavior/ReplaceConnectionBehavior.js +1 -1
- package/lib/features/modeling/behavior/ReplaceElementBehaviour.js +1 -1
- package/lib/features/modeling/behavior/RootElementReferenceBehavior.js +1 -1
- package/lib/features/modeling/behavior/SubProcessPlaneBehavior.js +1 -1
- package/lib/features/modeling/behavior/SubProcessStartEventBehavior.js +1 -1
- package/lib/features/modeling/behavior/ToggleCollapseConnectionBehaviour.js +1 -1
- package/lib/features/modeling/behavior/ToggleElementCollapseBehaviour.js +1 -1
- package/lib/features/modeling/behavior/UnclaimIdBehavior.js +1 -1
- package/lib/features/modeling/behavior/UnsetDefaultFlowBehavior.js +1 -1
- package/lib/features/modeling/behavior/UpdateFlowNodeRefsBehavior.js +1 -1
- package/lib/features/modeling/behavior/index.js +3 -0
- package/lib/features/modeling/behavior/util/ConnectionLayoutUtil.js +16 -0
- package/lib/features/modeling/behavior/util/GeometricUtil.js +1 -121
- package/lib/features/modeling/behavior/util/LabelLayoutUtil.js +3 -192
- package/lib/features/modeling/behavior/util/LayoutUtil.js +230 -0
- package/lib/features/modeling/cmd/SetColorHandler.js +6 -2
- package/lib/features/ordering/BpmnOrderingProvider.js +1 -1
- package/lib/features/replace-preview/BpmnReplacePreview.js +1 -1
- package/lib/features/rules/BpmnRules.js +1 -6
- package/lib/features/snapping/BpmnCreateMoveSnapping.js +1 -1
- package/lib/util/PoweredByUtil.js +59 -44
- package/package.json +5 -5
- package/test/util/custom-rules/CustomRules.js +1 -1
package/lib/BaseModeler.js
CHANGED
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';
|
|
@@ -24,7 +25,7 @@ import {
|
|
|
24
25
|
import Diagram from 'diagram-js';
|
|
25
26
|
import BpmnModdle from 'bpmn-moddle';
|
|
26
27
|
|
|
27
|
-
import inherits from 'inherits';
|
|
28
|
+
import inherits from 'inherits-browser';
|
|
28
29
|
|
|
29
30
|
import {
|
|
30
31
|
importBpmnDiagram
|
|
@@ -655,7 +656,7 @@ BaseViewer.prototype._createContainer = function(options) {
|
|
|
655
656
|
|
|
656
657
|
var container = domify('<div class="bjs-container"></div>');
|
|
657
658
|
|
|
658
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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) {
|
package/lib/Modeler.js
CHANGED
package/lib/NavigatedViewer.js
CHANGED
package/lib/Viewer.js
CHANGED
|
@@ -14,6 +14,8 @@ import {
|
|
|
14
14
|
// re-export getDi for compatibility
|
|
15
15
|
export { getDi };
|
|
16
16
|
|
|
17
|
+
export var black = 'hsl(225, 10%, 15%)';
|
|
18
|
+
|
|
17
19
|
// element utils //////////////////////
|
|
18
20
|
|
|
19
21
|
/**
|
|
@@ -64,7 +66,7 @@ export function getFillColor(element, defaultColor) {
|
|
|
64
66
|
export function getStrokeColor(element, defaultColor) {
|
|
65
67
|
var di = getDi(element);
|
|
66
68
|
|
|
67
|
-
return di.get('color:border-color') || di.get('bioc:stroke') || defaultColor ||
|
|
69
|
+
return di.get('color:border-color') || di.get('bioc:stroke') || defaultColor || black;
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
export function getLabelColor(element, defaultColor, defaultStrokeColor) {
|
package/lib/draw/BpmnRenderer.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import inherits from 'inherits';
|
|
1
|
+
import inherits from 'inherits-browser';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
isObject,
|
|
@@ -57,6 +57,8 @@ import {
|
|
|
57
57
|
|
|
58
58
|
import Ids from 'ids';
|
|
59
59
|
|
|
60
|
+
import { black } from './BpmnRenderUtil';
|
|
61
|
+
|
|
60
62
|
var RENDERER_IDS = new Ids();
|
|
61
63
|
|
|
62
64
|
var TASK_BORDER_RADIUS = 10;
|
|
@@ -85,7 +87,7 @@ export default function BpmnRenderer(
|
|
|
85
87
|
|
|
86
88
|
function addMarker(id, options) {
|
|
87
89
|
var attrs = assign({
|
|
88
|
-
fill:
|
|
90
|
+
fill: black,
|
|
89
91
|
strokeWidth: 1,
|
|
90
92
|
strokeLinecap: 'round',
|
|
91
93
|
strokeDasharray: 'none'
|
|
@@ -264,7 +266,7 @@ export default function BpmnRenderer(
|
|
|
264
266
|
offset = offset || 0;
|
|
265
267
|
|
|
266
268
|
attrs = computeStyle(attrs, {
|
|
267
|
-
stroke:
|
|
269
|
+
stroke: black,
|
|
268
270
|
strokeWidth: 2,
|
|
269
271
|
fill: 'white'
|
|
270
272
|
});
|
|
@@ -299,7 +301,7 @@ export default function BpmnRenderer(
|
|
|
299
301
|
offset = offset || 0;
|
|
300
302
|
|
|
301
303
|
attrs = computeStyle(attrs, {
|
|
302
|
-
stroke:
|
|
304
|
+
stroke: black,
|
|
303
305
|
strokeWidth: 2,
|
|
304
306
|
fill: 'white'
|
|
305
307
|
});
|
|
@@ -332,7 +334,7 @@ export default function BpmnRenderer(
|
|
|
332
334
|
}).join(' ');
|
|
333
335
|
|
|
334
336
|
attrs = computeStyle(attrs, {
|
|
335
|
-
stroke:
|
|
337
|
+
stroke: black,
|
|
336
338
|
strokeWidth: 2,
|
|
337
339
|
fill: 'white'
|
|
338
340
|
});
|
|
@@ -350,7 +352,7 @@ export default function BpmnRenderer(
|
|
|
350
352
|
|
|
351
353
|
function drawLine(parentGfx, waypoints, attrs) {
|
|
352
354
|
attrs = computeStyle(attrs, [ 'no-fill' ], {
|
|
353
|
-
stroke:
|
|
355
|
+
stroke: black,
|
|
354
356
|
strokeWidth: 2,
|
|
355
357
|
fill: 'none'
|
|
356
358
|
});
|
|
@@ -366,7 +368,7 @@ export default function BpmnRenderer(
|
|
|
366
368
|
|
|
367
369
|
attrs = computeStyle(attrs, [ 'no-fill' ], {
|
|
368
370
|
strokeWidth: 2,
|
|
369
|
-
stroke:
|
|
371
|
+
stroke: black
|
|
370
372
|
});
|
|
371
373
|
|
|
372
374
|
var path = svgCreate('path');
|
|
@@ -1471,7 +1473,7 @@ export default function BpmnRenderer(
|
|
|
1471
1473
|
|
|
1472
1474
|
if (di.messageVisibleKind === 'initiating') {
|
|
1473
1475
|
messageAttrs.fill = 'white';
|
|
1474
|
-
messageAttrs.stroke =
|
|
1476
|
+
messageAttrs.stroke = black;
|
|
1475
1477
|
} else {
|
|
1476
1478
|
messageAttrs.fill = '#888';
|
|
1477
1479
|
messageAttrs.stroke = 'white';
|
|
@@ -1546,7 +1548,7 @@ export default function BpmnRenderer(
|
|
|
1546
1548
|
|
|
1547
1549
|
/* output arrow path */ drawPath(parentGfx, arrowPathData, {
|
|
1548
1550
|
strokeWidth: 1,
|
|
1549
|
-
fill:
|
|
1551
|
+
fill: black
|
|
1550
1552
|
});
|
|
1551
1553
|
|
|
1552
1554
|
return elementObject;
|
|
@@ -104,6 +104,12 @@ export function getTextAnnotationPosition(source, element) {
|
|
|
104
104
|
y: sourceTrbl.top - 50 - element.height / 2
|
|
105
105
|
};
|
|
106
106
|
|
|
107
|
+
if (isConnection(source)) {
|
|
108
|
+
position = getMid(source);
|
|
109
|
+
position.x += 100;
|
|
110
|
+
position.y -= 50;
|
|
111
|
+
}
|
|
112
|
+
|
|
107
113
|
var nextPositionDirection = {
|
|
108
114
|
y: {
|
|
109
115
|
margin: -30,
|
|
@@ -135,4 +141,8 @@ export function getDataElementPosition(source, element) {
|
|
|
135
141
|
};
|
|
136
142
|
|
|
137
143
|
return findFreePosition(source, element, position, generateGetNextPosition(nextPositionDirection));
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function isConnection(element) {
|
|
147
|
+
return !!element.waypoints;
|
|
138
148
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
assign,
|
|
3
3
|
forEach,
|
|
4
|
-
isArray
|
|
4
|
+
isArray,
|
|
5
|
+
every
|
|
5
6
|
} from 'min-dash';
|
|
6
7
|
|
|
7
8
|
import {
|
|
@@ -86,9 +87,49 @@ ContextPadProvider.$inject = [
|
|
|
86
87
|
'translate'
|
|
87
88
|
];
|
|
88
89
|
|
|
90
|
+
ContextPadProvider.prototype.getMultiElementContextPadEntries = function(elements) {
|
|
91
|
+
var modeling = this._modeling;
|
|
89
92
|
|
|
90
|
-
|
|
93
|
+
var actions = {};
|
|
94
|
+
|
|
95
|
+
if (this._isDeleteAllowed(elements)) {
|
|
96
|
+
assign(actions, {
|
|
97
|
+
'delete': {
|
|
98
|
+
group: 'edit',
|
|
99
|
+
className: 'bpmn-icon-trash',
|
|
100
|
+
title: this._translate('Remove'),
|
|
101
|
+
action: {
|
|
102
|
+
click: function(event, elements) {
|
|
103
|
+
modeling.removeElements(elements.slice());
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
91
109
|
|
|
110
|
+
return actions;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @param {djs.model.Base[]} elements
|
|
115
|
+
* @return {boolean}
|
|
116
|
+
*/
|
|
117
|
+
ContextPadProvider.prototype._isDeleteAllowed = function(elements) {
|
|
118
|
+
|
|
119
|
+
var baseAllowed = this._rules.allowed('elements.delete', {
|
|
120
|
+
elements: elements
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
if (isArray(baseAllowed)) {
|
|
124
|
+
return every(baseAllowed, function(element) {
|
|
125
|
+
return includes(baseAllowed, element);
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return baseAllowed;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
ContextPadProvider.prototype.getContextPadEntries = function(element) {
|
|
92
133
|
var contextPad = this._contextPad,
|
|
93
134
|
modeling = this._modeling,
|
|
94
135
|
|
|
@@ -113,7 +154,7 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) {
|
|
|
113
154
|
connect.start(event, element);
|
|
114
155
|
}
|
|
115
156
|
|
|
116
|
-
function removeElement(e) {
|
|
157
|
+
function removeElement(e, element) {
|
|
117
158
|
modeling.removeElements([ element ]);
|
|
118
159
|
}
|
|
119
160
|
|
|
@@ -362,6 +403,15 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) {
|
|
|
362
403
|
});
|
|
363
404
|
}
|
|
364
405
|
|
|
406
|
+
if (is(businessObject, 'bpmn:SequenceFlow')) {
|
|
407
|
+
assign(actions, {
|
|
408
|
+
'append.text-annotation': appendAction(
|
|
409
|
+
'bpmn:TextAnnotation',
|
|
410
|
+
'bpmn-icon-text-annotation'
|
|
411
|
+
)
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
|
|
365
415
|
if (
|
|
366
416
|
isAny(businessObject, [
|
|
367
417
|
'bpmn:FlowNode',
|
|
@@ -470,3 +520,7 @@ function isEventType(eventBo, type, definition) {
|
|
|
470
520
|
|
|
471
521
|
return isType && isDefinition;
|
|
472
522
|
}
|
|
523
|
+
|
|
524
|
+
function includes(array, item) {
|
|
525
|
+
return array.indexOf(item) !== -1;
|
|
526
|
+
}
|
|
@@ -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,
|
|
@@ -25,6 +25,8 @@ import {
|
|
|
25
25
|
isLabel
|
|
26
26
|
} from '../../util/LabelUtil';
|
|
27
27
|
|
|
28
|
+
var HIGH_PRIORITY = 2000;
|
|
29
|
+
|
|
28
30
|
|
|
29
31
|
export default function LabelEditingProvider(
|
|
30
32
|
eventBus, bpmnFactory, canvas, directEditing,
|
|
@@ -49,7 +51,8 @@ export default function LabelEditingProvider(
|
|
|
49
51
|
'drag.init',
|
|
50
52
|
'element.mousedown',
|
|
51
53
|
'popupMenu.open',
|
|
52
|
-
'root.set'
|
|
54
|
+
'root.set',
|
|
55
|
+
'selection.changed'
|
|
53
56
|
], function(event) {
|
|
54
57
|
|
|
55
58
|
if (directEditing.isActive()) {
|
|
@@ -57,6 +60,16 @@ export default function LabelEditingProvider(
|
|
|
57
60
|
}
|
|
58
61
|
});
|
|
59
62
|
|
|
63
|
+
eventBus.on([
|
|
64
|
+
'shape.remove',
|
|
65
|
+
'connection.remove'
|
|
66
|
+
], HIGH_PRIORITY, function(event) {
|
|
67
|
+
|
|
68
|
+
if (directEditing.isActive(event.element)) {
|
|
69
|
+
directEditing.cancel();
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
|
|
60
73
|
// cancel on command stack changes
|
|
61
74
|
eventBus.on([ 'commandStack.changed' ], function(e) {
|
|
62
75
|
if (directEditing.isActive()) {
|